Merge branch 'master' of http://git.yoho.cn/ufo/ufo-platform
Showing
16 changed files
with
627 additions
and
7 deletions
@@ -53,7 +53,7 @@ public class LoginController { | @@ -53,7 +53,7 @@ public class LoginController { | ||
53 | session.setAttribute(PlatformConstant.USER_SESSION, responseBO.getData()); | 53 | session.setAttribute(PlatformConstant.USER_SESSION, responseBO.getData()); |
54 | 54 | ||
55 | //获取用户所能见的菜单 | 55 | //获取用户所能见的菜单 |
56 | - Response<Map<String, List<MenuInfoResponseBO>>> menuResp = loginService.getUserMenu(responseBO.getData().getPid(), responseBO.getData().getRole_id(), "5"); | 56 | + Response<Map<String, List<MenuInfoResponseBO>>> menuResp = loginService.getUserMenu(responseBO.getData().getPid(), responseBO.getData().getRole_id(), "7"); |
57 | 57 | ||
58 | //存入session | 58 | //存入session |
59 | session.setAttribute(PlatformConstant.USER_MENU, menuResp.getData()); | 59 | session.setAttribute(PlatformConstant.USER_MENU, menuResp.getData()); |
@@ -139,6 +139,8 @@ public class UploadServiceImpl implements IUploadService { | @@ -139,6 +139,8 @@ public class UploadServiceImpl implements IUploadService { | ||
139 | fileMode = "0" + (new Random().nextInt(2) + 1); | 139 | fileMode = "0" + (new Random().nextInt(2) + 1); |
140 | } | 140 | } |
141 | 141 | ||
142 | + logger.info("upload image bucket is {}, fileMode is {}", bucket, fileMode); | ||
143 | + | ||
142 | String saveName = new SimpleDateFormat("/yyyy/MM/dd/HH/").format(new Date()); | 144 | String saveName = new SimpleDateFormat("/yyyy/MM/dd/HH/").format(new Date()); |
143 | String fileName = fileMode | 145 | String fileName = fileMode |
144 | + DigestUtils.md5Hex(uid + "_" + System.currentTimeMillis() + multipartFile.getOriginalFilename()) | 146 | + DigestUtils.md5Hex(uid + "_" + System.currentTimeMillis() + multipartFile.getOriginalFilename()) |
1 | +package com.yoho.order.dal; | ||
2 | + | ||
3 | +import com.yoho.order.model.TradeBillsReq; | ||
4 | +import com.yoho.order.model.TradeBills; | ||
5 | +import org.apache.ibatis.annotations.Param; | ||
6 | + | ||
7 | +import java.util.List; | ||
8 | + | ||
9 | +/** | ||
10 | + * Created by craig.qin on 2018/9/12. | ||
11 | + */ | ||
12 | +public interface TradeBillsMapper { | ||
13 | + | ||
14 | + int selectCountByCondition(@Param("billsTradeReq") TradeBillsReq req); | ||
15 | + | ||
16 | + List<TradeBills> selectByConditionWithPage(@Param("billsTradeReq") TradeBillsReq req); | ||
17 | + | ||
18 | +} |
1 | +package com.yoho.order.model; | ||
2 | + | ||
3 | +import lombok.Data; | ||
4 | + | ||
5 | +import java.math.BigDecimal; | ||
6 | + | ||
7 | +/** | ||
8 | + * 交易流水表 | ||
9 | + */ | ||
10 | +@Data | ||
11 | +public class TradeBills { | ||
12 | + | ||
13 | + private Integer id; | ||
14 | + | ||
15 | + private Integer uid; | ||
16 | + | ||
17 | + private Long orderCode; | ||
18 | + | ||
19 | + //1:买家uid; 2:卖家uid | ||
20 | + private Integer userType; | ||
21 | + | ||
22 | + //1:支付宝; 2:微信 | ||
23 | + private Integer payType; | ||
24 | + | ||
25 | + //1:保证金;2:货款;3:补偿款 | ||
26 | + private Integer tradeType; | ||
27 | + | ||
28 | + //1:用户收入; 2:用户支出 | ||
29 | + private Integer incomeOutcome; | ||
30 | + | ||
31 | + private BigDecimal amount; | ||
32 | + | ||
33 | + //yoho收入 | ||
34 | + private BigDecimal systemAmount; | ||
35 | + | ||
36 | + //0:订单未完结;1:订单完结 | ||
37 | + private Integer tradeStatus; | ||
38 | + | ||
39 | + private Integer createTime; | ||
40 | + | ||
41 | + //手工打款相关字段 | ||
42 | + //操作员id | ||
43 | + private Integer dealUid; | ||
44 | + //操作员名字,存储起来,展示的时候用 | ||
45 | + private String dealUserName; | ||
46 | + //打款状态:1 表示成功, 现在只有成功的才记录 | ||
47 | + private Integer dealStatus; | ||
48 | + //打款时间 | ||
49 | + private Integer dealTime; | ||
50 | + //打款关联id | ||
51 | + private Integer dealRelateId; | ||
52 | + | ||
53 | + @Override | ||
54 | + public String toString() { | ||
55 | + return "TradeBills{" + | ||
56 | + "id=" + id + | ||
57 | + ", uid=" + uid + | ||
58 | + ", orderCode=" + orderCode + | ||
59 | + ", userType=" + userType + | ||
60 | + ", payType=" + payType + | ||
61 | + ", tradeType=" + tradeType + | ||
62 | + ", incomeOutcome=" + incomeOutcome + | ||
63 | + ", amount=" + amount + | ||
64 | + ", systemAmount=" + systemAmount + | ||
65 | + ", tradeStatus=" + tradeStatus + | ||
66 | + ", createTime=" + createTime + | ||
67 | + ", dealUid=" + dealUid + | ||
68 | + ", dealUserName='" + dealUserName + '\'' + | ||
69 | + ", dealStatus=" + dealStatus + | ||
70 | + ", dealTime=" + dealTime + | ||
71 | + ", dealRelateId=" + dealRelateId + | ||
72 | + '}'; | ||
73 | + } | ||
74 | +} |
1 | +package com.yoho.order.model; | ||
2 | + | ||
3 | +import com.yoho.ufo.service.model.PageRequestBO; | ||
4 | + | ||
5 | +import java.util.List; | ||
6 | + | ||
7 | +/** | ||
8 | + * Created by craig.qin. | ||
9 | + */ | ||
10 | +public class TradeBillsReq extends PageRequestBO{ | ||
11 | + | ||
12 | + /** | ||
13 | + * | ||
14 | + */ | ||
15 | + private static final long serialVersionUID = 1620427808531296022L; | ||
16 | + | ||
17 | + private Integer id; | ||
18 | + | ||
19 | + private Long orderCode; | ||
20 | + | ||
21 | + private Integer uid; | ||
22 | + | ||
23 | + private String mobile; | ||
24 | + | ||
25 | + ///// status 并不是表里面的字段,是查询条件:全部、交易正常的订单、交易异常的订单 | ||
26 | + private Integer status; | ||
27 | + | ||
28 | + public Integer getId() { | ||
29 | + return id; | ||
30 | + } | ||
31 | + | ||
32 | + public void setId(Integer id) { | ||
33 | + this.id = id; | ||
34 | + } | ||
35 | + | ||
36 | + public Long getOrderCode() { | ||
37 | + return orderCode; | ||
38 | + } | ||
39 | + | ||
40 | + public void setOrderCode(Long orderCode) { | ||
41 | + this.orderCode = orderCode; | ||
42 | + } | ||
43 | + | ||
44 | + public Integer getUid() { | ||
45 | + return uid; | ||
46 | + } | ||
47 | + | ||
48 | + public void setUid(Integer uid) { | ||
49 | + this.uid = uid; | ||
50 | + } | ||
51 | + | ||
52 | + public String getMobile() { | ||
53 | + return mobile; | ||
54 | + } | ||
55 | + | ||
56 | + public void setMobile(String mobile) { | ||
57 | + this.mobile = mobile; | ||
58 | + } | ||
59 | + | ||
60 | + public Integer getStatus() { | ||
61 | + return status; | ||
62 | + } | ||
63 | + | ||
64 | + public void setStatus(Integer status) { | ||
65 | + this.status = status; | ||
66 | + } | ||
67 | + | ||
68 | + @Override | ||
69 | + public String toString() { | ||
70 | + return "TradeBillsReq{" + | ||
71 | + "id=" + id + | ||
72 | + ", orderCode=" + orderCode + | ||
73 | + ", uid=" + uid + | ||
74 | + ", mobile='" + mobile + '\'' + | ||
75 | + ", status=" + status + | ||
76 | + '}'; | ||
77 | + } | ||
78 | +} |
1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
2 | +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | ||
3 | +<mapper namespace="com.yoho.order.dal.TradeBillsMapper"> | ||
4 | + <resultMap id="BaseResultMap" type="com.yoho.order.model.TradeBills"> | ||
5 | + <id column="id" jdbcType="INTEGER" property="id" /> | ||
6 | + <result column="uid" jdbcType="INTEGER" property="uid" /> | ||
7 | + <result column="order_code" jdbcType="BIGINT" property="orderCode" /> | ||
8 | + <result column="user_type" jdbcType="TINYINT" property="userType" /> | ||
9 | + <result column="pay_type" jdbcType="TINYINT" property="payType" /> | ||
10 | + <result column="trade_type" jdbcType="INTEGER" property="tradeType" /> | ||
11 | + <result column="income_outcome" jdbcType="TINYINT" property="incomeOutcome" /> | ||
12 | + <result column="amount" jdbcType="DECIMAL" property="amount" /> | ||
13 | + <result column="system_amount" jdbcType="DECIMAL" property="systemAmount" /> | ||
14 | + <result column="trade_status" jdbcType="TINYINT" property="tradeStatus" /> | ||
15 | + <result column="create_time" jdbcType="INTEGER" property="createTime" /> | ||
16 | + <result column="deal_uid" jdbcType="INTEGER" property="dealUid" /> | ||
17 | + <result column="deal_status" jdbcType="TINYINT" property="dealStatus" /> | ||
18 | + <result column="deal_time" jdbcType="INTEGER" property="dealTime" /> | ||
19 | + <result column="deal_relate_id" jdbcType="INTEGER" property="dealRelateId" /> | ||
20 | + <result column="deal_user_name" jdbcType="VARCHAR" property="dealUserName" /> | ||
21 | + </resultMap> | ||
22 | + <sql id="Base_Column_List"> | ||
23 | + id,uid, order_code, user_type,pay_type,trade_type, | ||
24 | + income_outcome,amount,system_amount,trade_status,create_time, | ||
25 | + deal_uid,deal_status,deal_time,deal_relate_id,deal_user_name | ||
26 | + </sql> | ||
27 | + | ||
28 | + <sql id="Query_Condition_Sql" > | ||
29 | + <if test="billsTradeReq.orderCode != null"> | ||
30 | + and order_code = #{billsTradeReq.orderCode} | ||
31 | + </if> | ||
32 | + <if test="billsTradeReq.uid != null"> | ||
33 | + and uid = #{billsTradeReq.uid} | ||
34 | + </if> | ||
35 | + <if test="billsTradeReq.status != null "> | ||
36 | + <choose> | ||
37 | + <when test="billsTradeReq.status == 100 "> | ||
38 | + and trade_status = 100 | ||
39 | + </when> | ||
40 | + <otherwise> | ||
41 | + and trade_status != 100 and deal_status != 1 | ||
42 | + </otherwise> | ||
43 | + </choose> | ||
44 | + </if> | ||
45 | + </sql> | ||
46 | + | ||
47 | + <select id="selectCountByCondition" resultType="java.lang.Integer" parameterType="com.yoho.order.model.BuyerOrderReq"> | ||
48 | + select count(id) | ||
49 | + from trade_bills where 1=1 | ||
50 | + <include refid="Query_Condition_Sql" /> | ||
51 | + </select> | ||
52 | + | ||
53 | + <select id="selectByConditionWithPage" resultMap="BaseResultMap" parameterType="com.yoho.order.model.TradeBillsReq"> | ||
54 | + select <include refid="Base_Column_List" /> | ||
55 | + from trade_bills where 1=1 | ||
56 | + <include refid="Query_Condition_Sql" /> | ||
57 | + limit #{billsTradeReq.start},#{billsTradeReq.size} | ||
58 | + </select> | ||
59 | + | ||
60 | +</mapper> |
1 | +package com.yoho.ufo.order.constant; | ||
2 | + | ||
3 | +/** | ||
4 | + * 交易流水表 | ||
5 | + * 100:成功;200:失败,201:没有支付宝账号;202:金额不合法;299:转账失败 | ||
6 | + */ | ||
7 | +public enum TradeStatusEnum { | ||
8 | + success(100,"成功"), | ||
9 | + fail_201_no_alipayAccount(201,"没有支付宝账号"), | ||
10 | + fail_202_invalid_money(202,"金额不合法"), | ||
11 | + fail_299_transfer_failure(299,"转账失败"); | ||
12 | + private Integer code; | ||
13 | + private String desc; | ||
14 | + | ||
15 | + TradeStatusEnum(Integer code,String desc){ | ||
16 | + this.code = code; | ||
17 | + this.desc = desc; | ||
18 | + } | ||
19 | + | ||
20 | + public static String getDescByCode(Integer code){ | ||
21 | + if(code==null){ | ||
22 | + return ""; | ||
23 | + } | ||
24 | + for(TradeStatusEnum item:TradeStatusEnum.values()){ | ||
25 | + if(code.intValue() == item.code.intValue()){ | ||
26 | + return item.desc; | ||
27 | + } | ||
28 | + } | ||
29 | + return ""; | ||
30 | + } | ||
31 | +} |
1 | +package com.yoho.ufo.order.controller; | ||
2 | + | ||
3 | +import com.yoho.order.model.TradeBillsReq; | ||
4 | +import com.yoho.ufo.order.service.ITradeBillsService; | ||
5 | +import com.yoho.ufo.service.model.ApiResponse; | ||
6 | +import com.yoho.ufo.service.model.PageResponseBO; | ||
7 | +import com.yohobuy.ufo.model.order.resp.*; | ||
8 | +import org.slf4j.Logger; | ||
9 | +import org.slf4j.LoggerFactory; | ||
10 | +import org.springframework.beans.factory.annotation.Autowired; | ||
11 | +import org.springframework.web.bind.annotation.RequestMapping; | ||
12 | +import org.springframework.web.bind.annotation.RestController; | ||
13 | + | ||
14 | +@RestController | ||
15 | +@RequestMapping(value = "/tradeBills") | ||
16 | +public class TradeBillsController { | ||
17 | + | ||
18 | + private static final Logger LOGGER = LoggerFactory.getLogger(TradeBillsController.class); | ||
19 | + | ||
20 | + @Autowired | ||
21 | + private ITradeBillsService billsTradeService; | ||
22 | + | ||
23 | + @RequestMapping(value = "/queryTradeBillsList") | ||
24 | + public ApiResponse queryTradeBillsList(TradeBillsReq req) { | ||
25 | + LOGGER.info("queryBillsTradeList in. req is {}", req); | ||
26 | + PageResponseBO<TradeBillsResp> result = billsTradeService.queryTradeBillsList(req); | ||
27 | + return new ApiResponse.ApiResponseBuilder().code(200).message("查询成功").data(result).build(); | ||
28 | + } | ||
29 | + | ||
30 | +} |
1 | +package com.yoho.ufo.order.service; | ||
2 | + | ||
3 | +import com.yoho.order.model.TradeBillsReq; | ||
4 | +import com.yoho.ufo.service.model.PageResponseBO; | ||
5 | +import com.yohobuy.ufo.model.order.resp.TradeBillsResp; | ||
6 | + | ||
7 | +public interface ITradeBillsService { | ||
8 | + | ||
9 | + PageResponseBO<TradeBillsResp> queryTradeBillsList(TradeBillsReq req); | ||
10 | + | ||
11 | +} |
1 | +package com.yoho.ufo.order.service.impl; | ||
2 | + | ||
3 | +import com.alibaba.fastjson.JSONObject; | ||
4 | +import com.yoho.core.common.utils.DateUtil; | ||
5 | +import com.yoho.core.rest.client.ServiceCaller; | ||
6 | +import com.yoho.order.dal.TradeBillsMapper; | ||
7 | +import com.yoho.order.model.*; | ||
8 | +import com.yoho.ufo.order.constant.TradeStatusEnum; | ||
9 | +import com.yoho.ufo.order.service.ITradeBillsService; | ||
10 | +import com.yoho.ufo.service.impl.UserHelper; | ||
11 | +import com.yoho.ufo.service.model.PageResponseBO; | ||
12 | +import com.yohobuy.ufo.model.order.resp.*; | ||
13 | +import org.apache.commons.collections.CollectionUtils; | ||
14 | +import org.apache.commons.lang3.StringUtils; | ||
15 | +import org.elasticsearch.common.collect.Lists; | ||
16 | +import org.elasticsearch.common.collect.Maps; | ||
17 | +import org.slf4j.Logger; | ||
18 | +import org.slf4j.LoggerFactory; | ||
19 | +import org.springframework.beans.factory.annotation.Autowired; | ||
20 | +import org.springframework.beans.factory.annotation.Value; | ||
21 | +import org.springframework.stereotype.Service; | ||
22 | + | ||
23 | +import java.util.Collections; | ||
24 | +import java.util.List; | ||
25 | +import java.util.Map; | ||
26 | +import java.util.stream.Collectors; | ||
27 | + | ||
28 | +/** | ||
29 | + * @author craig.qin | ||
30 | + */ | ||
31 | +@Service | ||
32 | +public class TradeBillsServiceImpl implements ITradeBillsService { | ||
33 | + | ||
34 | + private static final Logger LOGGER = LoggerFactory.getLogger(TradeBillsServiceImpl.class); | ||
35 | + | ||
36 | + @Autowired | ||
37 | + private ServiceCaller serviceCaller; | ||
38 | + | ||
39 | + @Value("${ip.port.uic.server}") | ||
40 | + private String uicServerIpAndPort; | ||
41 | + | ||
42 | + private static final String UIC_GETPROFILE_URL = "/uic/profile/getProfile"; | ||
43 | + | ||
44 | + private static final String UIC_GETUSERPROFILE_URL = "/uic/profile/getUserProfile"; | ||
45 | + | ||
46 | + @Autowired | ||
47 | + private TradeBillsMapper tradeBillsMapper; | ||
48 | + | ||
49 | + public PageResponseBO<TradeBillsResp> queryTradeBillsList(TradeBillsReq req) { | ||
50 | + if(!checkAndBuildParam(req)) { | ||
51 | + return null; | ||
52 | + } | ||
53 | + | ||
54 | + if(req.getUid()==null&&StringUtils.isNotBlank(req.getMobile())){ | ||
55 | + Integer uid = getUidByMobile(req.getMobile()); | ||
56 | + if(uid!=null){ | ||
57 | + req.setUid(uid); | ||
58 | + } | ||
59 | + } | ||
60 | + | ||
61 | + int total = tradeBillsMapper.selectCountByCondition(req); | ||
62 | + if(total == 0) { | ||
63 | + return null; | ||
64 | + } | ||
65 | + | ||
66 | + List<TradeBills> tradeBillsList = tradeBillsMapper.selectByConditionWithPage(req); | ||
67 | + if(CollectionUtils.isEmpty(tradeBillsList)) { | ||
68 | + return null; | ||
69 | + } | ||
70 | + | ||
71 | + List<TradeBillsResp> respList = convertToResp(tradeBillsList); | ||
72 | + | ||
73 | + PageResponseBO<TradeBillsResp> result=new PageResponseBO<>(); | ||
74 | + result.setList(respList); | ||
75 | + result.setPage(req.getPage()); | ||
76 | + result.setSize(req.getSize()); | ||
77 | + result.setTotal(total); | ||
78 | + | ||
79 | + return result; | ||
80 | + } | ||
81 | + | ||
82 | + private boolean checkAndBuildParam(TradeBillsReq req){ | ||
83 | + /*if(req.getUid()==null&&req.getOrderCode()==null&&StringUtils.isBlank(req.getMobile())){ | ||
84 | + return false; | ||
85 | + }*/ | ||
86 | + return true; | ||
87 | + } | ||
88 | + | ||
89 | + private List<TradeBillsResp> convertToResp(List<TradeBills> tradeBillsList){ | ||
90 | + List<TradeBillsResp> respList = Lists.newArrayList(); | ||
91 | + for(TradeBills item : tradeBillsList) { | ||
92 | + TradeBillsResp resp=new TradeBillsResp(); | ||
93 | + resp.setId(item.getId()); | ||
94 | + resp.setUid(item.getUid()); | ||
95 | + resp.setMobile(getMobileByUid(item.getUid())); | ||
96 | + resp.setOrderCode(item.getOrderCode()); | ||
97 | + resp.setAmount(item.getAmount()); | ||
98 | + resp.setIncomeOutcome(item.getIncomeOutcome()); | ||
99 | + resp.setCreateTimeStr(null == item.getCreateTime() ? "" : DateUtil.long2DateStr(item.getCreateTime().longValue()*1000, "yyyy-MM-dd HH:mm:ss")); | ||
100 | + resp.setOperatorUid(item.getDealUid()); | ||
101 | + resp.setOperatorName(item.getDealUid()==0?"系统":item.getDealUserName()); | ||
102 | + resp.setTradeStatus(item.getTradeStatus()); | ||
103 | + //打款失败原因 | ||
104 | + if(100!=item.getTradeStatus()){ | ||
105 | + String failReason = TradeStatusEnum.getDescByCode(item.getTradeStatus()); | ||
106 | + resp.setTradeStatusDesc(StringUtils.isBlank(failReason)?String.valueOf(item.getTradeStatus()):failReason); | ||
107 | + } | ||
108 | + | ||
109 | + respList.add(resp); | ||
110 | + } | ||
111 | + | ||
112 | + | ||
113 | + | ||
114 | + return respList; | ||
115 | + } | ||
116 | + | ||
117 | + private String getMobileByUid(Integer uid) { | ||
118 | + LOGGER.info("TradeBillsServiceImpl call getMobileByUid uid is{}", uid); | ||
119 | + Map<String,Integer> request = Collections.singletonMap("uid", uid); | ||
120 | + JSONObject jsonObject = serviceCaller.get("uic.getProfileAction", "http://" + uicServerIpAndPort + UIC_GETPROFILE_URL, request, JSONObject.class, null).get(1); | ||
121 | + | ||
122 | + if(null == jsonObject.getJSONObject("data") || null == jsonObject.getJSONObject("data").getString("mobile_phone")) { | ||
123 | + return null; | ||
124 | + } | ||
125 | + | ||
126 | + return jsonObject.getJSONObject("data").getString("mobile_phone"); | ||
127 | + } | ||
128 | + | ||
129 | + private Integer getUidByMobile(String mobile) { | ||
130 | + Map<String,String> request = Collections.singletonMap("account", mobile); | ||
131 | + JSONObject jsonObject = serviceCaller.get("uic.getProfileAction", "http://" + uicServerIpAndPort + UIC_GETPROFILE_URL, request, JSONObject.class, null).get(1); | ||
132 | + if(null == jsonObject.getJSONObject("data") || null == jsonObject.getJSONObject("data").getInteger("uid")) { | ||
133 | + return null; | ||
134 | + } | ||
135 | + | ||
136 | + return jsonObject.getJSONObject("data").getInteger("uid"); | ||
137 | + } | ||
138 | + | ||
139 | +} |
@@ -31,6 +31,7 @@ datasources: | @@ -31,6 +31,7 @@ datasources: | ||
31 | - com.yoho.order.dal.ExpressRecordMapper | 31 | - com.yoho.order.dal.ExpressRecordMapper |
32 | - com.yoho.order.dal.AreaMapper | 32 | - com.yoho.order.dal.AreaMapper |
33 | - com.yoho.order.dal.OrderOperateRecordMapper | 33 | - com.yoho.order.dal.OrderOperateRecordMapper |
34 | + - com.yoho.order.dal.TradeBillsMapper | ||
34 | 35 | ||
35 | 36 | ||
36 | readOnlyInSlave: true | 37 | readOnlyInSlave: true |
@@ -31,5 +31,6 @@ datasources: | @@ -31,5 +31,6 @@ datasources: | ||
31 | - com.yoho.order.dal.ExpressRecordMapper | 31 | - com.yoho.order.dal.ExpressRecordMapper |
32 | - com.yoho.order.dal.AreaMapper | 32 | - com.yoho.order.dal.AreaMapper |
33 | - com.yoho.order.dal.OrderOperateRecordMapper | 33 | - com.yoho.order.dal.OrderOperateRecordMapper |
34 | + - com.yoho.order.dal.TradeBillsMapper | ||
34 | 35 | ||
35 | readOnlyInSlave: ${readOnlyInSlave} | 36 | readOnlyInSlave: ${readOnlyInSlave} |
1 | +<!DOCTYPE html> | ||
2 | +<html> | ||
3 | +<head> | ||
4 | + <meta charset="UTF-8"/> | ||
5 | + <title>Yoho!Buy运营平台</title> | ||
6 | + <script src="/ufoPlatform/js/include.js"></script> | ||
7 | +</head> | ||
8 | +<body class="easyui-layout"> | ||
9 | +<input type="hidden" id="buyerOrderCode"> | ||
10 | +<input type="skup" id="skup"> | ||
11 | +<div region="north" style="height:180px;"> | ||
12 | + <script> | ||
13 | + document.write(addHead('打款管理', '列表管理')); | ||
14 | + </script> | ||
15 | + | ||
16 | + <div style="padding:20px;"> | ||
17 | + <label>订单编号:</label> | ||
18 | + <input id="orderCode" type="text" class="easyui-textbox" style="width:150px"> | ||
19 | + | ||
20 | + <label>UID:</label> | ||
21 | + <input id="uid" type="text" class="easyui-textbox" style="width:150px"/> | ||
22 | + | ||
23 | + <label>手机号:</label> | ||
24 | + <input id="mobile" type="text" class="easyui-textbox" style="width:150px"/> | ||
25 | + | ||
26 | + <label>订单状态:</label> | ||
27 | + <select id="status" class="easyui-combobox" style="width:100px;" > | ||
28 | + <option value="">全部状态</option> | ||
29 | + <option value="100">打款成功</option> | ||
30 | + <option value="999">打款失败</option> | ||
31 | + </select> | ||
32 | + | ||
33 | + <a id="searchBtn" class="btn-info">查询</a> | ||
34 | + <!--<a id="allBtn" class="btn-success">全部</a>--> | ||
35 | + </div> | ||
36 | +</div> | ||
37 | + | ||
38 | +<div id="tradeBillsList" region="center"> | ||
39 | + <table id="tradeBillsListTable"></table> | ||
40 | +</div> | ||
41 | +<script> | ||
42 | +$(function() { | ||
43 | + $("#status").combobox({ | ||
44 | + panelHeight:'auto', | ||
45 | + multiple:false, | ||
46 | + }); | ||
47 | + | ||
48 | + $("#searchBtn").linkbutton({ | ||
49 | + iconCls : "icon-search", | ||
50 | + onClick : function() { | ||
51 | + /*if(!$("#orderCode").val() | ||
52 | + && !$("#uid").val() | ||
53 | + && !$("#mobile").val()){ | ||
54 | + $.messager.alert("提示","请录入查询条件<br/>[订单编号、UID、手机号]至少选择一个!"); | ||
55 | + $("#orderCode").focus(); | ||
56 | + return; | ||
57 | + }*/ | ||
58 | + | ||
59 | + $("#tradeBillsListTable").datagrid("load", { | ||
60 | + status : $("#status").myCombobox("getValue"), | ||
61 | + orderCode : $("#orderCode").val(), | ||
62 | + uid : $("#uid").val(), | ||
63 | + mobile : $("#mobile").val() | ||
64 | + }); | ||
65 | + } | ||
66 | + }); | ||
67 | + | ||
68 | + //全部按钮 | ||
69 | + /* $("#allBtn").linkbutton({ | ||
70 | + iconCls: "icon-import", | ||
71 | + onClick: function () { | ||
72 | + $("#orderCode").textbox('setValue',''); | ||
73 | + $("#status").combobox('setValue',''); | ||
74 | + //$("#uid").textbox('setValue',''); | ||
75 | + $("#mobile").textbox('setValue',''); | ||
76 | + $("#orderListTable").datagrid("load", { | ||
77 | + }); | ||
78 | + } | ||
79 | + });*/ | ||
80 | + | ||
81 | + getTradeBillsList(); | ||
82 | +}); | ||
83 | + | ||
84 | +function getTradeBillsList(){ | ||
85 | + $("#tradeBillsListTable").myDatagrid({ | ||
86 | + fit: true, | ||
87 | + fitColumns: true, | ||
88 | + striped: true, | ||
89 | + url: contextPath + "/tradeBills/queryTradeBillsList", | ||
90 | + method: 'POST', | ||
91 | + queryParams: {}, | ||
92 | + loadFilter: function (data) { | ||
93 | + var temp = defaultLoadFilter(data); | ||
94 | + temp=null==temp?[]:temp; | ||
95 | + temp.rows = temp.list; | ||
96 | + return temp; | ||
97 | + }, | ||
98 | + | ||
99 | + columns: [[{ | ||
100 | + title: "订单编号", | ||
101 | + field: "orderCode", | ||
102 | + width: 30, | ||
103 | + align: "center" | ||
104 | + },{ | ||
105 | + title: "打款金额", | ||
106 | + field: "amount", | ||
107 | + width: 30, | ||
108 | + align: "center" | ||
109 | + },{ | ||
110 | + title: "用户uid", | ||
111 | + field: "uid", | ||
112 | + width: 30, | ||
113 | + align: "center" | ||
114 | + },{ | ||
115 | + title: "用户手机号", | ||
116 | + field: "mobile", | ||
117 | + width: 30, | ||
118 | + align: "center" | ||
119 | + } ,{ | ||
120 | + title: "打款时间", | ||
121 | + field: "createTimeStr", | ||
122 | + width: 20, | ||
123 | + align: "center" | ||
124 | + },{ | ||
125 | + title: "操作员", | ||
126 | + field: "operatorName", | ||
127 | + width: 20, | ||
128 | + align: "center" | ||
129 | + },{ | ||
130 | + title: "订单状态", | ||
131 | + field: "tradeStatus", | ||
132 | + width: 20, | ||
133 | + align: "center", | ||
134 | + formatter: function (value, rowData, rowIndex) { | ||
135 | + if (value == 100) { | ||
136 | + return "打款成功"; | ||
137 | + }else { | ||
138 | + return "<span style='color: red'>打款失败</span>"; | ||
139 | + } | ||
140 | + } | ||
141 | + }, { | ||
142 | + title: "原因", | ||
143 | + field: "tradeStatusDesc", | ||
144 | + width: 20, | ||
145 | + align: "center" | ||
146 | + }, { | ||
147 | + title: "操作", | ||
148 | + field: "asdf", | ||
149 | + width: 40, | ||
150 | + align: "center", | ||
151 | + formatter: function (value, rowData, rowIndex) { | ||
152 | + if (rowData.tradeStatus != 100) { | ||
153 | + return "<a role='refundsConfirm' dataId='"+ rowData.id +"' style='margin-left:10px;background-color: #5cb85c !important;'>打款</a>"; | ||
154 | + } | ||
155 | + } | ||
156 | + }]], | ||
157 | + cache: false, | ||
158 | + pagination: true, | ||
159 | + //pageSize: 20, | ||
160 | + idField: "id", | ||
161 | + singleSelect: true, | ||
162 | + onLoadSuccess: function (data) { | ||
163 | + $(this).datagrid("getPanel").find("a[role='refundsConfirm']").linkbutton({ | ||
164 | + onClick: function () { | ||
165 | + var id = $(this).attr("dataId"); | ||
166 | + alert("开发中。。"); | ||
167 | + } | ||
168 | + }); | ||
169 | + } | ||
170 | + }); | ||
171 | +} | ||
172 | + | ||
173 | +</script> | ||
174 | +</body> | ||
175 | +</html> |
@@ -65,7 +65,7 @@ | @@ -65,7 +65,7 @@ | ||
65 | width: 171, | 65 | width: 171, |
66 | height: 120, | 66 | height: 120, |
67 | realInputName: "brandLogo", | 67 | realInputName: "brandLogo", |
68 | - url: contextPath + '/fileupload/uploadFile', | 68 | + url: contextPath + '/fileupload/upload', |
69 | queryParams: { | 69 | queryParams: { |
70 | bucket: "goodsimg" | 70 | bucket: "goodsimg" |
71 | }, | 71 | }, |
@@ -83,7 +83,7 @@ | @@ -83,7 +83,7 @@ | ||
83 | $.messager.alert("错误", data.message); | 83 | $.messager.alert("错误", data.message); |
84 | return ""; | 84 | return ""; |
85 | } | 85 | } |
86 | - return data.data.url; | 86 | + return data.data; |
87 | }, | 87 | }, |
88 | onLoadSuccess: function (data) { | 88 | onLoadSuccess: function (data) { |
89 | $.messager.progress("close"); | 89 | $.messager.progress("close"); |
@@ -52,7 +52,7 @@ | @@ -52,7 +52,7 @@ | ||
52 | width: 171, | 52 | width: 171, |
53 | height: 120, | 53 | height: 120, |
54 | realInputName: "colorValue", | 54 | realInputName: "colorValue", |
55 | - url: contextPath + '/fileupload/uploadFile', | 55 | + url: contextPath + '/fileupload/upload', |
56 | queryParams: { | 56 | queryParams: { |
57 | bucket: "goodsimg" | 57 | bucket: "goodsimg" |
58 | }, | 58 | }, |
@@ -70,7 +70,7 @@ | @@ -70,7 +70,7 @@ | ||
70 | $.messager.alert("错误", data.message); | 70 | $.messager.alert("错误", data.message); |
71 | return ""; | 71 | return ""; |
72 | } | 72 | } |
73 | - return data.data.url; | 73 | + return data.data; |
74 | }, | 74 | }, |
75 | onLoadSuccess: function (data) { | 75 | onLoadSuccess: function (data) { |
76 | $.messager.progress("close"); | 76 | $.messager.progress("close"); |
@@ -405,7 +405,7 @@ | @@ -405,7 +405,7 @@ | ||
405 | width: 104, | 405 | width: 104, |
406 | height: 104, | 406 | height: 104, |
407 | realInputName: "goodsImage", | 407 | realInputName: "goodsImage", |
408 | - url: contextPath + '/fileupload/uploadFile', | 408 | + url: contextPath + '/fileupload/upload', |
409 | queryParams: { | 409 | queryParams: { |
410 | bucket: "goodsimg" | 410 | bucket: "goodsimg" |
411 | }, | 411 | }, |
@@ -428,7 +428,7 @@ | @@ -428,7 +428,7 @@ | ||
428 | onLoadSuccess: function (data) { | 428 | onLoadSuccess: function (data) { |
429 | $.messager.progress("close"); | 429 | $.messager.progress("close"); |
430 | $(document).find('.file-close').click(); | 430 | $(document).find('.file-close').click(); |
431 | - that.dom.imageUpload.before('<div class="img" data-url="' + data.data.url + '" style="background-image:url(' + data.data.url + ');">'); | 431 | + that.dom.imageUpload.before('<div class="img" data-url="' + data.data + '" style="background-image:url(' + data.data + ');">'); |
432 | return false; | 432 | return false; |
433 | } | 433 | } |
434 | }); | 434 | }); |
-
Please register or login to post a comment