Merge branch 'test6.9.10' of http://git.yoho.cn/ufo/ufo-platform into test6.9.10
Showing
18 changed files
with
1462 additions
and
81 deletions
1 | package com.yoho.order.dal; | 1 | package com.yoho.order.dal; |
2 | 2 | ||
3 | +import java.util.HashMap; | ||
3 | import java.util.List; | 4 | import java.util.List; |
5 | +import java.util.Map; | ||
4 | 6 | ||
5 | import org.apache.ibatis.annotations.Param; | 7 | import org.apache.ibatis.annotations.Param; |
6 | 8 | ||
@@ -19,4 +21,15 @@ public interface AppraiseOrderMapper { | @@ -19,4 +21,15 @@ public interface AppraiseOrderMapper { | ||
19 | int selectCountByStatusAndDepotNo(@Param("list")List<Byte> statusList, @Param("depotNo")Integer depotNo, @Param("platformExpressInfoFlag")String platformExpressInfoFlag); | 21 | int selectCountByStatusAndDepotNo(@Param("list")List<Byte> statusList, @Param("depotNo")Integer depotNo, @Param("platformExpressInfoFlag")String platformExpressInfoFlag); |
20 | 22 | ||
21 | int selectTotalByCondition(@Param("appraiseOrderReq") AppraiseOrderReq req); | 23 | int selectTotalByCondition(@Param("appraiseOrderReq") AppraiseOrderReq req); |
24 | + | ||
25 | + int selectParentListCount(AppraiseOrderReq req); | ||
26 | + | ||
27 | + List<AppraiseOrder> selectParentList(AppraiseOrderReq req); | ||
28 | + | ||
29 | + int selectSonListCount(AppraiseOrderReq req); | ||
30 | + | ||
31 | + List<AppraiseOrder> selectSonList(AppraiseOrderReq req); | ||
32 | + | ||
33 | + List<Map<String, Object>> selectCountInfo(String orderCode); | ||
34 | + | ||
22 | } | 35 | } |
1 | package com.yoho.order.dal; | 1 | package com.yoho.order.dal; |
2 | 2 | ||
3 | +import com.yoho.order.model.AppraiseOrderMeta; | ||
3 | import org.apache.ibatis.annotations.Param; | 4 | import org.apache.ibatis.annotations.Param; |
4 | 5 | ||
5 | -import com.yoho.order.model.AppraiseOrderMeta; | 6 | +import java.util.List; |
6 | 7 | ||
7 | -/** | ||
8 | - * Created by caoyan on 2019/8/7. | ||
9 | - */ | ||
10 | public interface AppraiseOrderMetaMapper { | 8 | public interface AppraiseOrderMetaMapper { |
9 | + int deleteByPrimaryKey(Integer id); | ||
11 | 10 | ||
12 | - AppraiseOrderMeta selectByOrderCodeAndMetaKey(@Param("orderCode") String orderCode, @Param("metaKey") String metaKey); | 11 | + int insert(AppraiseOrderMeta record); |
12 | + | ||
13 | + int insertSelective(AppraiseOrderMeta record); | ||
14 | + | ||
15 | + AppraiseOrderMeta selectByPrimaryKey(Integer id); | ||
16 | + | ||
17 | + int updateByPrimaryKeySelective(AppraiseOrderMeta record); | ||
13 | 18 | ||
19 | + int updateByPrimaryKey(AppraiseOrderMeta record); | ||
20 | + | ||
21 | + | ||
22 | + List<AppraiseOrderMeta> selectFeeByOrderCodes(@Param("orderCodeList") List<String> orderCodeList); | ||
23 | + | ||
24 | + AppraiseOrderMeta selectAddress(String orderCode); | ||
25 | + | ||
26 | + AppraiseOrderMeta selectByOrderCodeAndMetaKey(@Param("orderCode") String orderCode, @Param("metaKey") String metaKey); | ||
14 | } | 27 | } |
1 | +package com.yoho.order.dal; | ||
2 | + | ||
3 | +import com.yoho.order.model.OrdersPayRefund; | ||
4 | +import org.apache.ibatis.annotations.Param; | ||
5 | + | ||
6 | +import java.util.List; | ||
7 | + | ||
8 | +public interface OrdersPayRefundMapper { | ||
9 | + int deleteByPrimaryKey(Integer id); | ||
10 | + | ||
11 | + int insert(OrdersPayRefund record); | ||
12 | + | ||
13 | + int insertSelective(OrdersPayRefund record); | ||
14 | + | ||
15 | + OrdersPayRefund selectByPrimaryKey(Integer id); | ||
16 | + | ||
17 | + int updateByPrimaryKeySelective(OrdersPayRefund record); | ||
18 | + | ||
19 | + int updateByPrimaryKey(OrdersPayRefund record); | ||
20 | + | ||
21 | + List<OrdersPayRefund> selectByRefundCodes(@Param("orderCodeList") List<String> orderCodeList); | ||
22 | +} |
1 | package com.yoho.order.model; | 1 | package com.yoho.order.model; |
2 | -import java.io.Serializable; | ||
3 | 2 | ||
4 | -import lombok.ToString; | 3 | +public class AppraiseOrderMeta { |
4 | + private Integer id; | ||
5 | 5 | ||
6 | -/** | ||
7 | - * @author caoyan | ||
8 | - * @date 2019/8/7 | ||
9 | - */ | ||
10 | -@ToString | ||
11 | -public class AppraiseOrderMeta implements Serializable { | 6 | + private Integer uid; |
12 | 7 | ||
13 | - private static final long serialVersionUID = 2607922995706119816L; | 8 | + private Long orderCode; |
14 | 9 | ||
15 | - private Integer id; | ||
16 | - | ||
17 | - private Integer uid; | ||
18 | - | ||
19 | - private String orderCode; | ||
20 | - | ||
21 | private Integer storageId; | 10 | private Integer storageId; |
22 | - | 11 | + |
23 | private String metaKey; | 12 | private String metaKey; |
24 | - | 13 | + |
25 | private String metaValue; | 14 | private String metaValue; |
26 | 15 | ||
27 | - public Integer getId() { | ||
28 | - return id; | ||
29 | - } | 16 | + public Integer getId() { |
17 | + return id; | ||
18 | + } | ||
30 | 19 | ||
31 | - public void setId(Integer id) { | ||
32 | - this.id = id; | ||
33 | - } | 20 | + public void setId(Integer id) { |
21 | + this.id = id; | ||
22 | + } | ||
34 | 23 | ||
35 | - public Integer getUid() { | ||
36 | - return uid; | ||
37 | - } | 24 | + public Integer getUid() { |
25 | + return uid; | ||
26 | + } | ||
38 | 27 | ||
39 | - public void setUid(Integer uid) { | ||
40 | - this.uid = uid; | ||
41 | - } | 28 | + public void setUid(Integer uid) { |
29 | + this.uid = uid; | ||
30 | + } | ||
42 | 31 | ||
43 | - public String getOrderCode() { | ||
44 | - return orderCode; | ||
45 | - } | 32 | + public Long getOrderCode() { |
33 | + return orderCode; | ||
34 | + } | ||
46 | 35 | ||
47 | - public void setOrderCode(String orderCode) { | ||
48 | - this.orderCode = orderCode; | ||
49 | - } | 36 | + public void setOrderCode(Long orderCode) { |
37 | + this.orderCode = orderCode; | ||
38 | + } | ||
50 | 39 | ||
51 | - public Integer getStorageId() { | ||
52 | - return storageId; | ||
53 | - } | 40 | + public Integer getStorageId() { |
41 | + return storageId; | ||
42 | + } | ||
54 | 43 | ||
55 | - public void setStorageId(Integer storageId) { | ||
56 | - this.storageId = storageId; | ||
57 | - } | 44 | + public void setStorageId(Integer storageId) { |
45 | + this.storageId = storageId; | ||
46 | + } | ||
58 | 47 | ||
59 | - public String getMetaKey() { | ||
60 | - return metaKey; | ||
61 | - } | 48 | + public String getMetaKey() { |
49 | + return metaKey; | ||
50 | + } | ||
62 | 51 | ||
63 | - public void setMetaKey(String metaKey) { | ||
64 | - this.metaKey = metaKey; | ||
65 | - } | 52 | + public void setMetaKey(String metaKey) { |
53 | + this.metaKey = metaKey == null ? null : metaKey.trim(); | ||
54 | + } | ||
66 | 55 | ||
67 | - public String getMetaValue() { | ||
68 | - return metaValue; | ||
69 | - } | 56 | + public String getMetaValue() { |
57 | + return metaValue; | ||
58 | + } | ||
70 | 59 | ||
71 | - public void setMetaValue(String metaValue) { | ||
72 | - this.metaValue = metaValue; | ||
73 | - } | ||
74 | - | 60 | + public void setMetaValue(String metaValue) { |
61 | + this.metaValue = metaValue == null ? null : metaValue.trim(); | ||
62 | + } | ||
75 | } | 63 | } |
@@ -32,4 +32,12 @@ public class AppraiseOrderReq extends PageRequestBO{ | @@ -32,4 +32,12 @@ public class AppraiseOrderReq extends PageRequestBO{ | ||
32 | private String platformExpressInfoFlag; | 32 | private String platformExpressInfoFlag; |
33 | 33 | ||
34 | private String sortRule; | 34 | private String sortRule; |
35 | + | ||
36 | + private Integer uid; | ||
37 | + | ||
38 | + private String buyStartTimeStr; | ||
39 | + private String buyEndTimeStr; | ||
40 | + private Integer buyStartTime; | ||
41 | + private Integer buyEndTime; | ||
42 | + | ||
35 | } | 43 | } |
@@ -34,7 +34,45 @@ public class AppraiseOrderResp extends PageRequestBO{ | @@ -34,7 +34,45 @@ public class AppraiseOrderResp extends PageRequestBO{ | ||
34 | private Integer attributes; | 34 | private Integer attributes; |
35 | 35 | ||
36 | private String attributesStr; | 36 | private String attributesStr; |
37 | - | 37 | + |
38 | + private Integer uid; | ||
39 | + | ||
40 | + private String amount; | ||
41 | + | ||
42 | + private Integer clientType; | ||
43 | + | ||
44 | + private Integer payment; | ||
45 | + | ||
46 | + private String imageUrl; | ||
47 | + | ||
48 | + private String colorName; | ||
49 | + | ||
50 | + private String avgPrice7Day; | ||
51 | + private String usedAmount; | ||
52 | + private String backAmount; | ||
53 | + | ||
54 | + private String packageFee; | ||
55 | + private String appraiseFee; | ||
56 | + private String storageManagementFee; | ||
57 | + | ||
58 | + private String deliverTimeStr; | ||
59 | + private String expressNumber; | ||
60 | + private String userName; | ||
61 | + private String mobile; | ||
62 | + private String backAddress; | ||
63 | + private String backAddressDetail; | ||
64 | + private String backMobile; | ||
65 | + private String userDegree; | ||
66 | + | ||
67 | + private int count; | ||
68 | + private int receiveCount; | ||
69 | + private int unReceiveCount; | ||
70 | + private int appraiseOkCount; | ||
71 | + private int appraiseBadCount; | ||
72 | + private int appraiseFaultCount; | ||
73 | + private int noAppraiseCount; | ||
74 | + | ||
75 | + | ||
38 | private String createTimeStr; | 76 | private String createTimeStr; |
39 | 77 | ||
40 | private String platformWaybillCode; | 78 | private String platformWaybillCode; |
1 | +package com.yoho.order.model; | ||
2 | + | ||
3 | +import java.math.BigDecimal; | ||
4 | + | ||
5 | +public class OrdersPayRefund { | ||
6 | + private Integer id; | ||
7 | + | ||
8 | + private Long orderCode; | ||
9 | + | ||
10 | + private Integer orderType; | ||
11 | + | ||
12 | + private String serialNo; | ||
13 | + | ||
14 | + private BigDecimal amount; | ||
15 | + | ||
16 | + private Byte status; | ||
17 | + | ||
18 | + private Integer createTime; | ||
19 | + | ||
20 | + private Integer updateTime; | ||
21 | + | ||
22 | + private String refundCode; | ||
23 | + | ||
24 | + public Integer getId() { | ||
25 | + return id; | ||
26 | + } | ||
27 | + | ||
28 | + public void setId(Integer id) { | ||
29 | + this.id = id; | ||
30 | + } | ||
31 | + | ||
32 | + public Long getOrderCode() { | ||
33 | + return orderCode; | ||
34 | + } | ||
35 | + | ||
36 | + public void setOrderCode(Long orderCode) { | ||
37 | + this.orderCode = orderCode; | ||
38 | + } | ||
39 | + | ||
40 | + public Integer getOrderType() { | ||
41 | + return orderType; | ||
42 | + } | ||
43 | + | ||
44 | + public void setOrderType(Integer orderType) { | ||
45 | + this.orderType = orderType; | ||
46 | + } | ||
47 | + | ||
48 | + public String getSerialNo() { | ||
49 | + return serialNo; | ||
50 | + } | ||
51 | + | ||
52 | + public void setSerialNo(String serialNo) { | ||
53 | + this.serialNo = serialNo == null ? null : serialNo.trim(); | ||
54 | + } | ||
55 | + | ||
56 | + public BigDecimal getAmount() { | ||
57 | + return amount; | ||
58 | + } | ||
59 | + | ||
60 | + public void setAmount(BigDecimal amount) { | ||
61 | + this.amount = amount; | ||
62 | + } | ||
63 | + | ||
64 | + public Byte getStatus() { | ||
65 | + return status; | ||
66 | + } | ||
67 | + | ||
68 | + public void setStatus(Byte status) { | ||
69 | + this.status = status; | ||
70 | + } | ||
71 | + | ||
72 | + public Integer getCreateTime() { | ||
73 | + return createTime; | ||
74 | + } | ||
75 | + | ||
76 | + public void setCreateTime(Integer createTime) { | ||
77 | + this.createTime = createTime; | ||
78 | + } | ||
79 | + | ||
80 | + public Integer getUpdateTime() { | ||
81 | + return updateTime; | ||
82 | + } | ||
83 | + | ||
84 | + public void setUpdateTime(Integer updateTime) { | ||
85 | + this.updateTime = updateTime; | ||
86 | + } | ||
87 | + | ||
88 | + public String getRefundCode() { | ||
89 | + return refundCode; | ||
90 | + } | ||
91 | + | ||
92 | + public void setRefundCode(String refundCode) { | ||
93 | + this.refundCode = refundCode == null ? null : refundCode.trim(); | ||
94 | + } | ||
95 | +} |
@@ -142,5 +142,48 @@ | @@ -142,5 +142,48 @@ | ||
142 | </if> | 142 | </if> |
143 | </if> | 143 | </if> |
144 | </sql> | 144 | </sql> |
145 | - | 145 | + |
146 | + <select id="selectCountInfo" resultType="java.util.HashMap"> | ||
147 | + select status, count(*) as num from appraise_order where parent_order_code = #{orderCode} and attributes = 7 | ||
148 | + </select> | ||
149 | + | ||
150 | + <select id="selectParentListCount" resultType="java.lang.Integer"> | ||
151 | + select count(*) from appraise_order | ||
152 | + where <include refid="list_condition"/> | ||
153 | + </select> | ||
154 | + <select id="selectParentList" resultMap="BaseResultMap"> | ||
155 | + select * from appraise_order | ||
156 | + where <include refid="list_condition"/> order by create_time desc limit #{start}, #{size} | ||
157 | + </select> | ||
158 | + | ||
159 | + <sql id="list_condition" > | ||
160 | + parent_order_code is null and attributes = 7 | ||
161 | + <if test="statusList != null and statusList.size()>0"> | ||
162 | + and status in | ||
163 | + <foreach collection="statusList" item="status" open="(" close=")" separator=","> | ||
164 | + #{status} | ||
165 | + </foreach> | ||
166 | + </if> | ||
167 | + <if test="orderCode != null and orderCode !=''"> | ||
168 | + and order_code = #{orderCode} | ||
169 | + </if> | ||
170 | + <if test="uid != null"> | ||
171 | + and uid = #{uid} | ||
172 | + </if> | ||
173 | + <if test="buyStartTime != null"> | ||
174 | + and create_time >= #{buyStartTime} | ||
175 | + </if> | ||
176 | + <if test="buyEndTime != null"> | ||
177 | + and create_time <= #{buyEndTime} | ||
178 | + </if> | ||
179 | + </sql> | ||
180 | + | ||
181 | + <select id="selectSonListCount" resultType="java.lang.Integer"> | ||
182 | + select count(*) from appraise_order where parent_order_code = #{orderCode} | ||
183 | + </select> | ||
184 | + | ||
185 | + <select id="selectSonList" resultMap="BaseResultMap"> | ||
186 | + select * from appraise_order where parent_order_code = #{orderCode} order by create_time desc limit #{start}, #{size} | ||
187 | + </select> | ||
188 | + | ||
146 | </mapper> | 189 | </mapper> |
1 | <?xml version="1.0" encoding="UTF-8" ?> | 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" > | 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.AppraiseOrderMetaMapper"> | ||
4 | - <resultMap id="BaseResultMap" type="com.yoho.order.model.AppraiseOrderMeta"> | ||
5 | - <result column="id" property="id" jdbcType="INTEGER" /> | ||
6 | - <result column="uid" property="uid" jdbcType="INTEGER" /> | ||
7 | - <result column="order_code" property="orderCode" jdbcType="BIGINT" /> | ||
8 | - <result column="storage_id" property="storageId" jdbcType="INTEGER" /> | ||
9 | - <result column="meta_key" property="metaKey" jdbcType="VARCHAR" /> | ||
10 | - <result column="meta_value" property="metaValue" jdbcType="VARCHAR" /> | ||
11 | - </resultMap> | 3 | +<mapper namespace="com.yoho.order.dal.AppraiseOrderMetaMapper" > |
4 | + <resultMap id="BaseResultMap" type="com.yoho.order.model.AppraiseOrderMeta" > | ||
5 | + <id column="id" property="id" jdbcType="INTEGER" /> | ||
6 | + <result column="uid" property="uid" jdbcType="INTEGER" /> | ||
7 | + <result column="order_code" property="orderCode" jdbcType="BIGINT" /> | ||
8 | + <result column="storage_id" property="storageId" jdbcType="INTEGER" /> | ||
9 | + <result column="meta_key" property="metaKey" jdbcType="VARCHAR" /> | ||
10 | + <result column="meta_value" property="metaValue" jdbcType="VARCHAR" /> | ||
11 | + </resultMap> | ||
12 | + <sql id="Base_Column_List" > | ||
13 | + id, uid, order_code, storage_id, meta_key, meta_value | ||
14 | + </sql> | ||
15 | + <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" > | ||
16 | + select | ||
17 | + <include refid="Base_Column_List" /> | ||
18 | + from appraise_order_meta | ||
19 | + where id = #{id,jdbcType=INTEGER} | ||
20 | + </select> | ||
21 | + <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" > | ||
22 | + delete from appraise_order_meta | ||
23 | + where id = #{id,jdbcType=INTEGER} | ||
24 | + </delete> | ||
25 | + <insert id="insert" parameterType="com.yoho.order.model.AppraiseOrderMeta" > | ||
26 | + insert into appraise_order_meta (id, uid, order_code, | ||
27 | + storage_id, meta_key, meta_value | ||
28 | + ) | ||
29 | + values (#{id,jdbcType=INTEGER}, #{uid,jdbcType=INTEGER}, #{orderCode,jdbcType=BIGINT}, | ||
30 | + #{storageId,jdbcType=INTEGER}, #{metaKey,jdbcType=VARCHAR}, #{metaValue,jdbcType=VARCHAR} | ||
31 | + ) | ||
32 | + </insert> | ||
33 | + <insert id="insertSelective" parameterType="com.yoho.order.model.AppraiseOrderMeta" > | ||
34 | + insert into appraise_order_meta | ||
35 | + <trim prefix="(" suffix=")" suffixOverrides="," > | ||
36 | + <if test="id != null" > | ||
37 | + id, | ||
38 | + </if> | ||
39 | + <if test="uid != null" > | ||
40 | + uid, | ||
41 | + </if> | ||
42 | + <if test="orderCode != null" > | ||
43 | + order_code, | ||
44 | + </if> | ||
45 | + <if test="storageId != null" > | ||
46 | + storage_id, | ||
47 | + </if> | ||
48 | + <if test="metaKey != null" > | ||
49 | + meta_key, | ||
50 | + </if> | ||
51 | + <if test="metaValue != null" > | ||
52 | + meta_value, | ||
53 | + </if> | ||
54 | + </trim> | ||
55 | + <trim prefix="values (" suffix=")" suffixOverrides="," > | ||
56 | + <if test="id != null" > | ||
57 | + #{id,jdbcType=INTEGER}, | ||
58 | + </if> | ||
59 | + <if test="uid != null" > | ||
60 | + #{uid,jdbcType=INTEGER}, | ||
61 | + </if> | ||
62 | + <if test="orderCode != null" > | ||
63 | + #{orderCode,jdbcType=BIGINT}, | ||
64 | + </if> | ||
65 | + <if test="storageId != null" > | ||
66 | + #{storageId,jdbcType=INTEGER}, | ||
67 | + </if> | ||
68 | + <if test="metaKey != null" > | ||
69 | + #{metaKey,jdbcType=VARCHAR}, | ||
70 | + </if> | ||
71 | + <if test="metaValue != null" > | ||
72 | + #{metaValue,jdbcType=VARCHAR}, | ||
73 | + </if> | ||
74 | + </trim> | ||
75 | + </insert> | ||
76 | + <update id="updateByPrimaryKeySelective" parameterType="com.yoho.order.model.AppraiseOrderMeta" > | ||
77 | + update appraise_order_meta | ||
78 | + <set > | ||
79 | + <if test="uid != null" > | ||
80 | + uid = #{uid,jdbcType=INTEGER}, | ||
81 | + </if> | ||
82 | + <if test="orderCode != null" > | ||
83 | + order_code = #{orderCode,jdbcType=BIGINT}, | ||
84 | + </if> | ||
85 | + <if test="storageId != null" > | ||
86 | + storage_id = #{storageId,jdbcType=INTEGER}, | ||
87 | + </if> | ||
88 | + <if test="metaKey != null" > | ||
89 | + meta_key = #{metaKey,jdbcType=VARCHAR}, | ||
90 | + </if> | ||
91 | + <if test="metaValue != null" > | ||
92 | + meta_value = #{metaValue,jdbcType=VARCHAR}, | ||
93 | + </if> | ||
94 | + </set> | ||
95 | + where id = #{id,jdbcType=INTEGER} | ||
96 | + </update> | ||
97 | + <update id="updateByPrimaryKey" parameterType="com.yoho.order.model.AppraiseOrderMeta" > | ||
98 | + update appraise_order_meta | ||
99 | + set uid = #{uid,jdbcType=INTEGER}, | ||
100 | + order_code = #{orderCode,jdbcType=BIGINT}, | ||
101 | + storage_id = #{storageId,jdbcType=INTEGER}, | ||
102 | + meta_key = #{metaKey,jdbcType=VARCHAR}, | ||
103 | + meta_value = #{metaValue,jdbcType=VARCHAR} | ||
104 | + where id = #{id,jdbcType=INTEGER} | ||
105 | + </update> | ||
106 | + | ||
107 | + <select id="selectFeeByOrderCodes" resultMap="BaseResultMap"> | ||
108 | + select <include refid="Base_Column_List" /> | ||
109 | + from appraise_order_meta where order_code in | ||
110 | + <foreach collection="orderCodeList" item="orderCode" open="(" close=")" separator=","> | ||
111 | + #{orderCode} | ||
112 | + </foreach> | ||
113 | + and meta_key = 'fee' | ||
114 | + </select> | ||
115 | + | ||
116 | + <select id="selectAddress" resultMap="BaseResultMap"> | ||
117 | + select <include refid="Base_Column_List" /> | ||
118 | + from appraise_order_meta where order_code = #{orderCode} and meta_key = 'back_delivery_address' limit 1 | ||
119 | + </select> | ||
120 | + | ||
12 | 121 | ||
13 | - <sql id="Base_Column_List"> | ||
14 | - id, uid, order_code, storage_id, meta_key, meta_value | ||
15 | - </sql> | ||
16 | - | ||
17 | <select id="selectByOrderCodeAndMetaKey" resultMap="BaseResultMap"> | 122 | <select id="selectByOrderCodeAndMetaKey" resultMap="BaseResultMap"> |
18 | select <include refid="Base_Column_List" /> | 123 | select <include refid="Base_Column_List" /> |
19 | from appraise_order_goods where order_code =#{orderCode} and meta_key=#{metaKey} | 124 | from appraise_order_goods where order_code =#{orderCode} and meta_key=#{metaKey} |
@@ -19,7 +19,7 @@ | @@ -19,7 +19,7 @@ | ||
19 | 19 | ||
20 | <select id="selectByOrderCodes" resultMap="BaseResultMap"> | 20 | <select id="selectByOrderCodes" resultMap="BaseResultMap"> |
21 | select <include refid="Base_Column_List" /> | 21 | select <include refid="Base_Column_List" /> |
22 | - from appraise_order where order_code in | 22 | + from appraise_order_storage where order_code in |
23 | <foreach collection="list" item="orderCode" open="(" close=")" separator=","> | 23 | <foreach collection="list" item="orderCode" open="(" close=")" separator=","> |
24 | #{orderCode} | 24 | #{orderCode} |
25 | </foreach> | 25 | </foreach> |
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.OrdersPayRefundMapper" > | ||
4 | + <resultMap id="BaseResultMap" type="com.yoho.order.model.OrdersPayRefund" > | ||
5 | + <id column="id" property="id" jdbcType="INTEGER" /> | ||
6 | + <result column="order_code" property="orderCode" jdbcType="BIGINT" /> | ||
7 | + <result column="order_type" property="orderType" jdbcType="INTEGER" /> | ||
8 | + <result column="serial_no" property="serialNo" jdbcType="VARCHAR" /> | ||
9 | + <result column="amount" property="amount" jdbcType="DECIMAL" /> | ||
10 | + <result column="status" property="status" jdbcType="TINYINT" /> | ||
11 | + <result column="create_time" property="createTime" jdbcType="INTEGER" /> | ||
12 | + <result column="update_time" property="updateTime" jdbcType="INTEGER" /> | ||
13 | + <result column="refund_code" property="refundCode" jdbcType="VARCHAR" /> | ||
14 | + </resultMap> | ||
15 | + <sql id="Base_Column_List" > | ||
16 | + id, order_code, order_type, serial_no, amount, status, create_time, update_time, | ||
17 | + refund_code | ||
18 | + </sql> | ||
19 | + <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" > | ||
20 | + select | ||
21 | + <include refid="Base_Column_List" /> | ||
22 | + from orders_pay_refund | ||
23 | + where id = #{id,jdbcType=INTEGER} | ||
24 | + </select> | ||
25 | + <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" > | ||
26 | + delete from orders_pay_refund | ||
27 | + where id = #{id,jdbcType=INTEGER} | ||
28 | + </delete> | ||
29 | + <insert id="insert" parameterType="com.yoho.order.model.OrdersPayRefund" > | ||
30 | + insert into orders_pay_refund (id, order_code, order_type, | ||
31 | + serial_no, amount, status, | ||
32 | + create_time, update_time, refund_code | ||
33 | + ) | ||
34 | + values (#{id,jdbcType=INTEGER}, #{orderCode,jdbcType=BIGINT}, #{orderType,jdbcType=INTEGER}, | ||
35 | + #{serialNo,jdbcType=VARCHAR}, #{amount,jdbcType=DECIMAL}, #{status,jdbcType=TINYINT}, | ||
36 | + #{createTime,jdbcType=INTEGER}, #{updateTime,jdbcType=INTEGER}, #{refundCode,jdbcType=VARCHAR} | ||
37 | + ) | ||
38 | + </insert> | ||
39 | + <insert id="insertSelective" parameterType="com.yoho.order.model.OrdersPayRefund" > | ||
40 | + insert into orders_pay_refund | ||
41 | + <trim prefix="(" suffix=")" suffixOverrides="," > | ||
42 | + <if test="id != null" > | ||
43 | + id, | ||
44 | + </if> | ||
45 | + <if test="orderCode != null" > | ||
46 | + order_code, | ||
47 | + </if> | ||
48 | + <if test="orderType != null" > | ||
49 | + order_type, | ||
50 | + </if> | ||
51 | + <if test="serialNo != null" > | ||
52 | + serial_no, | ||
53 | + </if> | ||
54 | + <if test="amount != null" > | ||
55 | + amount, | ||
56 | + </if> | ||
57 | + <if test="status != null" > | ||
58 | + status, | ||
59 | + </if> | ||
60 | + <if test="createTime != null" > | ||
61 | + create_time, | ||
62 | + </if> | ||
63 | + <if test="updateTime != null" > | ||
64 | + update_time, | ||
65 | + </if> | ||
66 | + <if test="refundCode != null" > | ||
67 | + refund_code, | ||
68 | + </if> | ||
69 | + </trim> | ||
70 | + <trim prefix="values (" suffix=")" suffixOverrides="," > | ||
71 | + <if test="id != null" > | ||
72 | + #{id,jdbcType=INTEGER}, | ||
73 | + </if> | ||
74 | + <if test="orderCode != null" > | ||
75 | + #{orderCode,jdbcType=BIGINT}, | ||
76 | + </if> | ||
77 | + <if test="orderType != null" > | ||
78 | + #{orderType,jdbcType=INTEGER}, | ||
79 | + </if> | ||
80 | + <if test="serialNo != null" > | ||
81 | + #{serialNo,jdbcType=VARCHAR}, | ||
82 | + </if> | ||
83 | + <if test="amount != null" > | ||
84 | + #{amount,jdbcType=DECIMAL}, | ||
85 | + </if> | ||
86 | + <if test="status != null" > | ||
87 | + #{status,jdbcType=TINYINT}, | ||
88 | + </if> | ||
89 | + <if test="createTime != null" > | ||
90 | + #{createTime,jdbcType=INTEGER}, | ||
91 | + </if> | ||
92 | + <if test="updateTime != null" > | ||
93 | + #{updateTime,jdbcType=INTEGER}, | ||
94 | + </if> | ||
95 | + <if test="refundCode != null" > | ||
96 | + #{refundCode,jdbcType=VARCHAR}, | ||
97 | + </if> | ||
98 | + </trim> | ||
99 | + </insert> | ||
100 | + <update id="updateByPrimaryKeySelective" parameterType="com.yoho.order.model.OrdersPayRefund" > | ||
101 | + update orders_pay_refund | ||
102 | + <set > | ||
103 | + <if test="orderCode != null" > | ||
104 | + order_code = #{orderCode,jdbcType=BIGINT}, | ||
105 | + </if> | ||
106 | + <if test="orderType != null" > | ||
107 | + order_type = #{orderType,jdbcType=INTEGER}, | ||
108 | + </if> | ||
109 | + <if test="serialNo != null" > | ||
110 | + serial_no = #{serialNo,jdbcType=VARCHAR}, | ||
111 | + </if> | ||
112 | + <if test="amount != null" > | ||
113 | + amount = #{amount,jdbcType=DECIMAL}, | ||
114 | + </if> | ||
115 | + <if test="status != null" > | ||
116 | + status = #{status,jdbcType=TINYINT}, | ||
117 | + </if> | ||
118 | + <if test="createTime != null" > | ||
119 | + create_time = #{createTime,jdbcType=INTEGER}, | ||
120 | + </if> | ||
121 | + <if test="updateTime != null" > | ||
122 | + update_time = #{updateTime,jdbcType=INTEGER}, | ||
123 | + </if> | ||
124 | + <if test="refundCode != null" > | ||
125 | + refund_code = #{refundCode,jdbcType=VARCHAR}, | ||
126 | + </if> | ||
127 | + </set> | ||
128 | + where id = #{id,jdbcType=INTEGER} | ||
129 | + </update> | ||
130 | + <update id="updateByPrimaryKey" parameterType="com.yoho.order.model.OrdersPayRefund" > | ||
131 | + update orders_pay_refund | ||
132 | + set order_code = #{orderCode,jdbcType=BIGINT}, | ||
133 | + order_type = #{orderType,jdbcType=INTEGER}, | ||
134 | + serial_no = #{serialNo,jdbcType=VARCHAR}, | ||
135 | + amount = #{amount,jdbcType=DECIMAL}, | ||
136 | + status = #{status,jdbcType=TINYINT}, | ||
137 | + create_time = #{createTime,jdbcType=INTEGER}, | ||
138 | + update_time = #{updateTime,jdbcType=INTEGER}, | ||
139 | + refund_code = #{refundCode,jdbcType=VARCHAR} | ||
140 | + where id = #{id,jdbcType=INTEGER} | ||
141 | + </update> | ||
142 | + | ||
143 | + <select id="selectByRefundCodes" resultMap="BaseResultMap" > | ||
144 | + select | ||
145 | + <include refid="Base_Column_List" /> | ||
146 | + from orders_pay_refund | ||
147 | + where refund_code in | ||
148 | + <foreach collection="orderCodeList" item="orderCode" open="(" close=")" separator=","> | ||
149 | + #{orderCode} | ||
150 | + </foreach> | ||
151 | + </select> | ||
152 | +</mapper> |
@@ -2,6 +2,7 @@ package com.yoho.ufo.order.controller; | @@ -2,6 +2,7 @@ package com.yoho.ufo.order.controller; | ||
2 | 2 | ||
3 | import java.util.Map; | 3 | import java.util.Map; |
4 | 4 | ||
5 | +import com.yoho.ufo.exception.PlatformException; | ||
5 | import org.slf4j.Logger; | 6 | import org.slf4j.Logger; |
6 | import org.slf4j.LoggerFactory; | 7 | import org.slf4j.LoggerFactory; |
7 | import org.springframework.beans.factory.annotation.Autowired; | 8 | import org.springframework.beans.factory.annotation.Autowired; |
@@ -52,4 +53,30 @@ public class AppraiseOrderController { | @@ -52,4 +53,30 @@ public class AppraiseOrderController { | ||
52 | return new ApiResponse.ApiResponseBuilder().code(200).message("查询成功").data(result).build(); | 53 | return new ApiResponse.ApiResponseBuilder().code(200).message("查询成功").data(result).build(); |
53 | } | 54 | } |
54 | 55 | ||
56 | + @RequestMapping(value = "/list") | ||
57 | + public ApiResponse list(AppraiseOrderReq req) { | ||
58 | + LOGGER.info("appraiseOrder.list in. param is {}", req); | ||
59 | + PageResponseBO<AppraiseOrderResp> result = null; | ||
60 | + try { | ||
61 | + result = appraiseOrderService.queryOrderList(req); | ||
62 | + return new ApiResponse.ApiResponseBuilder().code(200).message("查询成功").data(result).build(); | ||
63 | + } catch (PlatformException e) { | ||
64 | + return new ApiResponse(e.getCode(), e.getMessage(), null); | ||
65 | + } | ||
66 | + } | ||
67 | + | ||
68 | + @RequestMapping(value = "/detailList") | ||
69 | + public ApiResponse detailList(AppraiseOrderReq req) { | ||
70 | + LOGGER.info("appraiseOrder.detailList in. param is {}", req); | ||
71 | + PageResponseBO<AppraiseOrderResp> result = appraiseOrderService.queryOrderDetailList(req); | ||
72 | + return new ApiResponse.ApiResponseBuilder().code(200).message("查询成功").data(result).build(); | ||
73 | + } | ||
74 | + | ||
75 | + @RequestMapping(value = "/detailInfo") | ||
76 | + public ApiResponse detailInfo(AppraiseOrderReq req) { | ||
77 | + LOGGER.info("appraiseOrder.detailInfo in. param is {}", req); | ||
78 | + AppraiseOrderResp result = appraiseOrderService.detailInfo(req); | ||
79 | + return new ApiResponse.ApiResponseBuilder().code(200).message("查询成功").data(result).build(); | ||
80 | + } | ||
81 | + | ||
55 | } | 82 | } |
@@ -4,6 +4,8 @@ import java.util.Map; | @@ -4,6 +4,8 @@ import java.util.Map; | ||
4 | 4 | ||
5 | import com.yoho.order.model.AppraiseOrderReq; | 5 | import com.yoho.order.model.AppraiseOrderReq; |
6 | import com.yoho.order.model.AppraiseOrderResp; | 6 | import com.yoho.order.model.AppraiseOrderResp; |
7 | +import com.yoho.ufo.exception.PlatformException; | ||
8 | +import com.yoho.ufo.service.model.ApiResponse; | ||
7 | import com.yoho.ufo.service.model.PageResponseBO; | 9 | import com.yoho.ufo.service.model.PageResponseBO; |
8 | 10 | ||
9 | public interface IAppraiseOrderService { | 11 | public interface IAppraiseOrderService { |
@@ -13,4 +15,9 @@ public interface IAppraiseOrderService { | @@ -13,4 +15,9 @@ public interface IAppraiseOrderService { | ||
13 | 15 | ||
14 | AppraiseOrderResp getOrderDetail(String orderCode); | 16 | AppraiseOrderResp getOrderDetail(String orderCode); |
15 | 17 | ||
18 | + PageResponseBO<AppraiseOrderResp> queryOrderList(AppraiseOrderReq req) throws PlatformException; | ||
19 | + | ||
20 | + PageResponseBO<AppraiseOrderResp> queryOrderDetailList(AppraiseOrderReq req); | ||
21 | + | ||
22 | + AppraiseOrderResp detailInfo(AppraiseOrderReq req); | ||
16 | } | 23 | } |
1 | package com.yoho.ufo.order.service.impl; | 1 | package com.yoho.ufo.order.service.impl; |
2 | 2 | ||
3 | -import java.util.List; | ||
4 | -import java.util.Map; | 3 | +import java.math.BigDecimal; |
4 | +import java.text.ParseException; | ||
5 | +import java.text.SimpleDateFormat; | ||
6 | +import java.util.*; | ||
7 | +import java.util.function.Function; | ||
5 | import java.util.stream.Collectors; | 8 | import java.util.stream.Collectors; |
6 | 9 | ||
10 | +import com.alibaba.fastjson.JSON; | ||
11 | +import com.alibaba.fastjson.JSONObject; | ||
12 | +import com.yoho.core.rest.client.ServiceCaller; | ||
13 | +import com.yoho.order.dal.*; | ||
14 | +import com.yoho.order.model.*; | ||
15 | +import com.yoho.ufo.exception.PlatformException; | ||
16 | +import com.yoho.ufo.service.model.ApiResponse; | ||
17 | +import com.yohobuy.ufo.model.order.common.AppraiseOrderStatus; | ||
18 | +import org.apache.commons.collections.ArrayStack; | ||
7 | import org.apache.commons.collections.CollectionUtils; | 19 | import org.apache.commons.collections.CollectionUtils; |
8 | import org.apache.commons.lang3.StringUtils; | 20 | import org.apache.commons.lang3.StringUtils; |
9 | import org.elasticsearch.common.collect.Lists; | 21 | import org.elasticsearch.common.collect.Lists; |
10 | import org.elasticsearch.common.collect.Maps; | 22 | import org.elasticsearch.common.collect.Maps; |
11 | import org.slf4j.Logger; | 23 | import org.slf4j.Logger; |
12 | import org.slf4j.LoggerFactory; | 24 | import org.slf4j.LoggerFactory; |
25 | +import org.springframework.beans.BeanUtils; | ||
13 | import org.springframework.beans.factory.annotation.Autowired; | 26 | import org.springframework.beans.factory.annotation.Autowired; |
27 | +import org.springframework.beans.factory.annotation.Value; | ||
14 | import org.springframework.stereotype.Service; | 28 | import org.springframework.stereotype.Service; |
15 | 29 | ||
16 | import com.alibaba.fastjson.JSONObject; | 30 | import com.alibaba.fastjson.JSONObject; |
@@ -55,12 +69,29 @@ public class AppraiseOrderServiceImpl implements IAppraiseOrderService{ | @@ -55,12 +69,29 @@ public class AppraiseOrderServiceImpl implements IAppraiseOrderService{ | ||
55 | 69 | ||
56 | @Autowired | 70 | @Autowired |
57 | private AppraiseOrderStorageMapper appraiseOrderStorageMapper; | 71 | private AppraiseOrderStorageMapper appraiseOrderStorageMapper; |
58 | - | 72 | + |
59 | @Autowired | 73 | @Autowired |
60 | private AppraiseOrderMetaMapper appraiseOrderMetaMapper; | 74 | private AppraiseOrderMetaMapper appraiseOrderMetaMapper; |
61 | 75 | ||
62 | @Autowired | 76 | @Autowired |
63 | private ExpressRecordMapper expressRecordMapper; | 77 | private ExpressRecordMapper expressRecordMapper; |
78 | + | ||
79 | + @Autowired | ||
80 | + private OrdersPayRefundMapper ordersPayRefundMapper; | ||
81 | + | ||
82 | + @Autowired | ||
83 | + private StoredSellerMapper storedSellerMapper; | ||
84 | + | ||
85 | + | ||
86 | + @Value("${ip.port.uic.server}") | ||
87 | + private String uicServerIpAndPort; | ||
88 | + | ||
89 | + private static final String UIC_GETPROFILE_URL = "/uic/profile/getProfile"; | ||
90 | + | ||
91 | + private static final String UIC_GETUSERPROFILE_URL = "/uic/profile/getUserProfile"; | ||
92 | + | ||
93 | + @Autowired | ||
94 | + private ServiceCaller serviceCaller; | ||
64 | 95 | ||
65 | @Autowired | 96 | @Autowired |
66 | private StorageDepositMapper storageDepositMapper; | 97 | private StorageDepositMapper storageDepositMapper; |
@@ -165,7 +196,188 @@ public class AppraiseOrderServiceImpl implements IAppraiseOrderService{ | @@ -165,7 +196,188 @@ public class AppraiseOrderServiceImpl implements IAppraiseOrderService{ | ||
165 | 196 | ||
166 | return result; | 197 | return result; |
167 | } | 198 | } |
168 | - | 199 | + |
200 | + @Override | ||
201 | + public PageResponseBO<AppraiseOrderResp> queryOrderList(AppraiseOrderReq req) throws PlatformException { | ||
202 | + Byte status = req.getStatus(); | ||
203 | + List<Byte> checkStatusList = Lists.newArrayList(); | ||
204 | + if (status != null && status >= 0) { | ||
205 | + if (status == 101) { | ||
206 | + checkStatusList = Arrays.asList((byte) 12, (byte) 14, (byte) 15, (byte) 23); | ||
207 | + } else if (status == 102) { | ||
208 | + checkStatusList = Arrays.asList((byte) 34, (byte) 13); | ||
209 | + } else { | ||
210 | + checkStatusList = Arrays.asList(status); | ||
211 | + } | ||
212 | + } | ||
213 | + req.setStatusList(checkStatusList); | ||
214 | + req.setBuyStartTime(parseTime(req.getBuyStartTimeStr())); | ||
215 | + req.setBuyEndTime(parseTime(req.getBuyEndTimeStr())); | ||
216 | + | ||
217 | + int count = appraiseOrderMapper.selectParentListCount(req); | ||
218 | + | ||
219 | + PageResponseBO<AppraiseOrderResp> resp = new PageResponseBO<>(); | ||
220 | + resp.setTotal(count); | ||
221 | + if (count == 0) { | ||
222 | + resp.setList(Lists.newArrayList()); | ||
223 | + return resp; | ||
224 | + } | ||
225 | + | ||
226 | + req.setStart((req.getPage() - 1) * req.getSize()); | ||
227 | + List<AppraiseOrder> orderList = appraiseOrderMapper.selectParentList(req); | ||
228 | + List<AppraiseOrderResp> respList = exchangeBo(orderList); | ||
229 | + | ||
230 | + resp.setPage(req.getPage()); | ||
231 | + resp.setList(respList); | ||
232 | + resp.setSize(req.getSize()); | ||
233 | + resp.setTotal(count); | ||
234 | + return resp; | ||
235 | + } | ||
236 | + | ||
237 | + public AppraiseOrderResp detailInfo(AppraiseOrderReq req) { | ||
238 | + AppraiseOrderResp result = new AppraiseOrderResp(); | ||
239 | + Integer uid = req.getUid(); | ||
240 | + String orderCode = req.getOrderCode(); | ||
241 | + List<Map<String, Object>> countInfo = appraiseOrderMapper.selectCountInfo(orderCode); | ||
242 | + int count = 0; | ||
243 | + for (Map<String, Object> record : countInfo) { | ||
244 | + int c = ((Number) record.get("num")).intValue(); | ||
245 | + count += c; | ||
246 | + if (record.get("status").toString().equals(Integer.toString(AppraiseOrderStatus.JUDGE_PASS.getCode()))) { | ||
247 | + result.setAppraiseOkCount(c); | ||
248 | + } | ||
249 | + if (record.get("status").toString().equals(Integer.toString(AppraiseOrderStatus.CHECKING_FAKE.getCode()))) { | ||
250 | + result.setAppraiseBadCount(c); | ||
251 | + } | ||
252 | + if (record.get("status").toString().equals(Integer.toString(AppraiseOrderStatus.CHECKING_FAKE.getCode()))) { | ||
253 | + result.setAppraiseFaultCount(c);// TODO | ||
254 | + } | ||
255 | + if (record.get("status").toString().equals(Integer.toString(AppraiseOrderStatus.PLATFORM_APPRAISE_UNSURE.getCode()))) { | ||
256 | + result.setNoAppraiseCount(c); | ||
257 | + } | ||
258 | + if (record.get("status").toString().equals(Integer.toString(AppraiseOrderStatus.SHAM_SEND_OUT.getCode()))) { | ||
259 | + result.setUnReceiveCount(c); | ||
260 | + } | ||
261 | + } | ||
262 | + result.setCount(count); | ||
263 | + result.setReceiveCount(count - result.getUnReceiveCount()); | ||
264 | + | ||
265 | + //卖家信息 | ||
266 | + result.setUserName(getUserNameByUid(uid)); | ||
267 | + result.setMobile(getMobileByUid(uid)); | ||
268 | + result.setUid(uid); | ||
269 | + | ||
270 | + AppraiseOrderMeta addressInfo = appraiseOrderMetaMapper.selectAddress(orderCode); | ||
271 | + if (addressInfo != null) { | ||
272 | + JSONObject jo = JSON.parseObject(addressInfo.getMetaValue()); | ||
273 | + result.setBackAddress(jo.getString("area")); | ||
274 | + result.setBackAddressDetail(jo.getString("address")); | ||
275 | + result.setBackMobile(jo.getString("mobile")); | ||
276 | + } | ||
277 | + StoredSeller storedSeller = storedSellerMapper.selectUid(uid); | ||
278 | + if (storedSeller != null && storedSeller.getEntryType() != null) { | ||
279 | + if (1 == storedSeller.getEntryType()) { | ||
280 | + result.setUserDegree("入驻卖家"); | ||
281 | + } else if (2 == storedSeller.getEntryType()) { | ||
282 | + result.setUserDegree("超级卖家"); | ||
283 | + } | ||
284 | + } else { | ||
285 | + result.setUserDegree("普通卖家"); | ||
286 | + } | ||
287 | + List<ExpressRecord> expressRecordList = expressRecordMapper.selectByOrderCodeListAndType(Arrays.asList(orderCode), Lists.newArrayList(EnumExpressType.EXPRESS_TYPE_1.getCode())); | ||
288 | + if (!expressRecordList.isEmpty()) { | ||
289 | + result.setExpressNumber(expressRecordList.get(0).getWaybillCode()); | ||
290 | + result.setDeliverTimeStr(formatTime(expressRecordList.get(0).getCreateTime())); | ||
291 | + } | ||
292 | + return result; | ||
293 | + } | ||
294 | + | ||
295 | + @Override | ||
296 | + public PageResponseBO<AppraiseOrderResp> queryOrderDetailList(AppraiseOrderReq req) { | ||
297 | + long orderCode = Long.parseLong(req.getOrderCode()); | ||
298 | + | ||
299 | + int count = appraiseOrderMapper.selectSonListCount(req); | ||
300 | + | ||
301 | + PageResponseBO<AppraiseOrderResp> resp = new PageResponseBO<>(); | ||
302 | + resp.setTotal(count); | ||
303 | + if (count == 0) { | ||
304 | + resp.setList(Lists.newArrayList()); | ||
305 | + return resp; | ||
306 | + } | ||
307 | + | ||
308 | + req.setStart((req.getPage() - 1) * req.getSize()); | ||
309 | + List<AppraiseOrder> orderList = appraiseOrderMapper.selectSonList(req); | ||
310 | + List<AppraiseOrderGoods> goodsList = appraiseOrderGoodsMapper.selectByOrderCodes(orderList.stream().map(AppraiseOrder::getOrderCode).collect(Collectors.toList())); | ||
311 | + List<AppraiseOrderStorage> storageList = appraiseOrderStorageMapper.selectByOrderCodes(orderList.stream().map(AppraiseOrder::getOrderCode).collect(Collectors.toList())); | ||
312 | + List<AppraiseOrderMeta> feeList = appraiseOrderMetaMapper.selectFeeByOrderCodes(orderList.stream().map(AppraiseOrder::getOrderCode).collect(Collectors.toList())); | ||
313 | + List<OrdersPayRefund> refundList = ordersPayRefundMapper.selectByRefundCodes(orderList.stream().map(AppraiseOrder::getOrderCode).collect(Collectors.toList())); | ||
314 | + List<AppraiseOrderResp> respList = exchangeBo(orderList, goodsList, refundList, storageList, feeList); | ||
315 | + | ||
316 | + resp.setPage(req.getPage()); | ||
317 | + resp.setList(respList); | ||
318 | + resp.setSize(req.getSize()); | ||
319 | + resp.setTotal(count); | ||
320 | + return resp; | ||
321 | + } | ||
322 | + | ||
323 | + private List<AppraiseOrderResp> exchangeBo(List<AppraiseOrder> orderList, List<AppraiseOrderGoods> goodsList, List<OrdersPayRefund> refundList, List<AppraiseOrderStorage> storageList, List<AppraiseOrderMeta> feeList) { | ||
324 | + Map<String, AppraiseOrderStorage> storageMap = storageList.stream().collect(Collectors.toMap(AppraiseOrderStorage::getOrderCode, Function.identity())); | ||
325 | + Map<String, AppraiseOrderGoods> goodsMap = goodsList.stream().collect(Collectors.toMap(AppraiseOrderGoods::getOrderCode, Function.identity())); | ||
326 | + Map<Long, AppraiseOrderMeta> feeMap = feeList.stream().collect(Collectors.toMap(AppraiseOrderMeta::getOrderCode, Function.identity())); | ||
327 | + Map<Long, OrdersPayRefund> refundMap = refundList.stream().collect(Collectors.toMap(OrdersPayRefund::getOrderCode, Function.identity())); | ||
328 | + List<AppraiseOrderResp> result = Lists.newArrayList(); | ||
329 | + for(AppraiseOrder order : orderList) { | ||
330 | + AppraiseOrderResp r = new AppraiseOrderResp(); | ||
331 | + BeanUtils.copyProperties(order, r); | ||
332 | + AppraiseOrderStorage s = storageMap.get(order.getOrderCode()); | ||
333 | + if (s != null) { | ||
334 | + BeanUtils.copyProperties(s, r); | ||
335 | + } | ||
336 | + AppraiseOrderGoods goods = goodsMap.get(order.getOrderCode()); | ||
337 | + if (goods != null) { | ||
338 | + BeanUtils.copyProperties(goods, r); | ||
339 | + } | ||
340 | + AppraiseOrderMeta fee = feeMap.get(Long.parseLong(order.getOrderCode())); | ||
341 | + if (fee != null) { | ||
342 | + JSONObject j = JSON.parseObject(fee.getMetaValue()); | ||
343 | + r.setAvgPrice7Day(j.getString("prdPrice")); | ||
344 | + r.setAppraiseFee(j.getJSONObject("platformFee").getString("appraiseFee")); | ||
345 | + r.setPackageFee(j.getJSONObject("platformFee").getString("packageFee")); | ||
346 | + r.setStorageManagementFee(j.getJSONObject("platformFee").getString("storageManagementFee")); | ||
347 | + } | ||
348 | + r.setAmount(order.getAmount().toString()); | ||
349 | + OrdersPayRefund refund = refundMap.get(Long.parseLong(order.getOrderCode())); | ||
350 | + if (refund != null) { | ||
351 | + r.setBackAmount(refund.getAmount().toString()); | ||
352 | + r.setUsedAmount(order.getAmount().subtract(refund.getAmount()).toString()); | ||
353 | + } else { | ||
354 | + r.setBackAmount(BigDecimal.ZERO.toString()); | ||
355 | + r.setUsedAmount(order.getAmount().toString()); | ||
356 | + } | ||
357 | + r.setCreateTimeStr(formatTime(order.getCreateTime())); | ||
358 | + AppraiseOrderStatus status = AppraiseOrderStatus.getByCode(order.getStatus().intValue()); | ||
359 | + r.setStatusStr(status == null ? "" : status.getDesc()); | ||
360 | + result.add(r); | ||
361 | + } | ||
362 | + return result; | ||
363 | + } | ||
364 | + | ||
365 | + | ||
366 | + private List<AppraiseOrderResp> exchangeBo(List<AppraiseOrder> orderList) { | ||
367 | + List<AppraiseOrderResp> result = Lists.newArrayList(); | ||
368 | + for(AppraiseOrder order : orderList) { | ||
369 | + AppraiseOrderResp r = new AppraiseOrderResp(); | ||
370 | + BeanUtils.copyProperties(order, r); | ||
371 | + r.setAmount(order.getAmount().toString()); | ||
372 | + r.setCreateTimeStr(formatTime(order.getCreateTime())); | ||
373 | + AppraiseOrderStatus status = AppraiseOrderStatus.getByCode(order.getStatus().intValue()); | ||
374 | + r.setStatusStr(status == null ? "" : status.getDesc()); | ||
375 | + result.add(r); | ||
376 | + } | ||
377 | + return result; | ||
378 | + } | ||
379 | + | ||
380 | + | ||
169 | @Override | 381 | @Override |
170 | public AppraiseOrderResp getOrderDetail(String orderCode) { | 382 | public AppraiseOrderResp getOrderDetail(String orderCode) { |
171 | AppraiseOrder order = appraiseOrderMapper.selectByOrderCode(orderCode); | 383 | AppraiseOrder order = appraiseOrderMapper.selectByOrderCode(orderCode); |
@@ -418,5 +630,58 @@ public class AppraiseOrderServiceImpl implements IAppraiseOrderService{ | @@ -418,5 +630,58 @@ public class AppraiseOrderServiceImpl implements IAppraiseOrderService{ | ||
418 | } | 630 | } |
419 | } | 631 | } |
420 | 632 | ||
633 | + private String getUserNameByUid(Integer uid) { | ||
634 | + Map<String,Integer> request = Collections.singletonMap("uid", uid); | ||
635 | + String url = "http://" + uicServerIpAndPort + UIC_GETUSERPROFILE_URL; | ||
636 | + JSONObject jsonObject; | ||
637 | + try { | ||
638 | + jsonObject = serviceCaller.post("uic.getUserProfileAction", url, request, JSONObject.class, null).get(1); | ||
639 | + } catch (Exception e) { | ||
640 | + LOGGER.error("call"+ url + " fail!!! uid is {}", uid); | ||
641 | + return ""; | ||
642 | + } | ||
643 | + | ||
644 | + if(null != jsonObject) { | ||
645 | + return jsonObject.getString("profile_name"); | ||
646 | + } | ||
647 | + return ""; | ||
648 | + } | ||
649 | + private String getMobileByUid(Integer uid) { | ||
650 | + LOGGER.info("call getMobileByUid uid is{}", uid); | ||
651 | + Map<String,Integer> request = Collections.singletonMap("uid", uid); | ||
652 | + String url = "http://" + uicServerIpAndPort + UIC_GETPROFILE_URL; | ||
653 | + JSONObject jsonObject; | ||
654 | + try { | ||
655 | + jsonObject = serviceCaller.get("uic.getProfileAction", url, request, JSONObject.class, null).get(1); | ||
656 | + } catch (Exception e) { | ||
657 | + LOGGER.error("call"+ url + " fail!!! uid is {}", uid); | ||
658 | + return ""; | ||
659 | + } | ||
660 | + | ||
661 | + if(null == jsonObject.getJSONObject("data") || null == jsonObject.getJSONObject("data").getString("mobile_phone")) { | ||
662 | + return ""; | ||
663 | + } | ||
664 | + return jsonObject.getJSONObject("data").getString("mobile_phone"); | ||
665 | + } | ||
666 | + | ||
667 | + private Integer parseTime(String time) throws PlatformException { | ||
668 | + SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | ||
669 | + try { | ||
670 | + if (StringUtils.isNotBlank(time)) { | ||
671 | + return (int) (format.parse(time).getTime() / 1000); | ||
672 | + } | ||
673 | + return null; | ||
674 | + } catch (ParseException e) { | ||
675 | + throw new PlatformException("日期解析错误!", 400); | ||
676 | + } | ||
677 | + } | ||
678 | + | ||
679 | + private String formatTime(Integer time) { | ||
680 | + SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | ||
681 | + if (time != null && time > 0) { | ||
682 | + return format.format(new Date(time * 1000L)); | ||
683 | + } | ||
684 | + return ""; | ||
685 | + } | ||
421 | 686 | ||
422 | } | 687 | } |
@@ -65,8 +65,9 @@ datasources: | @@ -65,8 +65,9 @@ datasources: | ||
65 | - com.yoho.order.dal.AbnormalOrderMapper | 65 | - com.yoho.order.dal.AbnormalOrderMapper |
66 | - com.yoho.order.dal.AppraiseOrderMapper | 66 | - com.yoho.order.dal.AppraiseOrderMapper |
67 | - com.yoho.order.dal.AppraiseOrderGoodsMapper | 67 | - com.yoho.order.dal.AppraiseOrderGoodsMapper |
68 | - - com.yoho.order.dal.AppraiseOrderStorageMapper | ||
69 | - com.yoho.order.dal.AppraiseOrderMetaMapper | 68 | - com.yoho.order.dal.AppraiseOrderMetaMapper |
69 | + - com.yoho.order.dal.AppraiseOrderStorageMapper | ||
70 | + - com.yoho.order.dal.OrdersPayRefundMapper | ||
70 | 71 | ||
71 | ufo_resource: | 72 | ufo_resource: |
72 | servers: | 73 | servers: |
@@ -66,8 +66,9 @@ datasources: | @@ -66,8 +66,9 @@ datasources: | ||
66 | - com.yoho.order.dal.AbnormalOrderMapper | 66 | - com.yoho.order.dal.AbnormalOrderMapper |
67 | - com.yoho.order.dal.AppraiseOrderMapper | 67 | - com.yoho.order.dal.AppraiseOrderMapper |
68 | - com.yoho.order.dal.AppraiseOrderGoodsMapper | 68 | - com.yoho.order.dal.AppraiseOrderGoodsMapper |
69 | - - com.yoho.order.dal.AppraiseOrderStorageMapper | ||
70 | - com.yoho.order.dal.AppraiseOrderMetaMapper | 69 | - com.yoho.order.dal.AppraiseOrderMetaMapper |
70 | + - com.yoho.order.dal.AppraiseOrderStorageMapper | ||
71 | + - com.yoho.order.dal.OrdersPayRefundMapper | ||
71 | 72 | ||
72 | ufo_resource: | 73 | ufo_resource: |
73 | servers: | 74 | servers: |
1 | +<!DOCTYPE html> | ||
2 | +<div id="main" region="center" style="height:900px;"> | ||
3 | + <div id="tt" class="easyui-tabs" style="height:900px;"> | ||
4 | + <div title="订单信息" style="padding:20px;display:none;height:900px;"> | ||
5 | + <h2>卖家信息</h2> | ||
6 | + <div style="margin-top: 20px;margin-left: 30px"> | ||
7 | + <table border="0" style="width:95%;margin-top:5px;line-height:30px;" id="tab1"> | ||
8 | + <tr> | ||
9 | + <td>姓名:<span id="showUserName"></span></td> | ||
10 | + <td>UID:<span id="showUid"></span></td> | ||
11 | + <td>绑定手机号:<span id="showMobile"></span></td> | ||
12 | + <td>发货单号:<span id="showExpressNumber"></span></td> | ||
13 | + <td>发货时间:<span id="showDeliverTimeStr"></span></td> | ||
14 | + </tr> | ||
15 | + | ||
16 | + <tr> | ||
17 | + <td>寄回地址:<span id="showBackAddress"></span></td> | ||
18 | + <td>详细地址:<span id="showBackAddressDetail"></span></td> | ||
19 | + <td>寄回手机号:<span id="showBackMobile"></span></td> | ||
20 | + <td>邮政编码:<span id="showEx"></span></td> | ||
21 | + <td>身份信息:<span id="showUserDegree"></span></td> | ||
22 | + </tr> | ||
23 | + </table> | ||
24 | + </div> | ||
25 | + <br/><br/><br/> | ||
26 | + <h2>商品信息</h2> | ||
27 | + <div style="margin-top: 20px;margin-left: 30px"> | ||
28 | + <table border="0" style="width:95%;margin-top:5px;line-height:30px;" id="tab2"> | ||
29 | + <tr> | ||
30 | + <td>申请数量:<span id="showCount"></span></td> | ||
31 | + <td>实到数量:<span id="showReceiveCount"></span></td> | ||
32 | + <td>鉴定通过:<span id="showAppraiseOkCount"></span></td> | ||
33 | + <td>鉴定为假:<span id="showAppraiseBadCount"></span></td> | ||
34 | + <td>鉴定瑕疵:<span id="showAppraiseFaultCount"></span></td> | ||
35 | + <td>无法鉴定:<span id="showNoAppraiseCount"></span></td> | ||
36 | + </tr> | ||
37 | + </table> | ||
38 | + </div> | ||
39 | + <br/><br/><br/> | ||
40 | + <h2>订单信息</h2> | ||
41 | + <div style="margin-top: 20px;margin-left: 30px;height:400px;"> | ||
42 | + <table id="orderDetailTable"></table> | ||
43 | + </div> | ||
44 | + </div> | ||
45 | + <div title="物流信息" style="overflow:auto;padding:20px;display:none;"> | ||
46 | + <h2>卖家发货物流</h2> | ||
47 | + <hr> | ||
48 | + <table id="sellerExpressTable"></table> | ||
49 | + <h2>平台发货物流/平台寄回物流</h2> | ||
50 | + <hr> | ||
51 | + <table id="platformExpressTable"></table> | ||
52 | + </div> | ||
53 | + <div title="操作记录" style="overflow:auto;padding:20px;display:none;"> | ||
54 | + <hr> | ||
55 | + <table id="operateRecordTable"></table> | ||
56 | + </div> | ||
57 | + </div> | ||
58 | +</div> | ||
59 | +<script> | ||
60 | + | ||
61 | + $(function () { | ||
62 | + | ||
63 | + $('#tt').tabs({ | ||
64 | + border: false, | ||
65 | + onSelect: function (title, index) { | ||
66 | + if (index == 1) { | ||
67 | + getExpressList(orderCode) | ||
68 | + } | ||
69 | + if (index == 2) { | ||
70 | + getOperateRecord(orderCode) | ||
71 | + } | ||
72 | + } | ||
73 | + }); | ||
74 | + | ||
75 | + // 隐藏域赋值 | ||
76 | + $.post(contextPath + "/appraiseOrder/detailInfo", { | ||
77 | + orderCode: orderCode, | ||
78 | + uid : uid | ||
79 | + }, function (result) { | ||
80 | + if (result.code == 200) { | ||
81 | + var data = result.data; | ||
82 | + $("#showDeliverTimeStr").text(data.deliverTimeStr); | ||
83 | + $("#showExpressNumber").text(data.expressNumber); | ||
84 | + $("#showUserName").text(data.userName); | ||
85 | + $("#showUid").text(data.uid); | ||
86 | + $("#showMobile").text(data.mobile); | ||
87 | + $("#showBackAddress").text(data.backAddress); | ||
88 | + $("#showBackAddressDetail").text(data.backAddressDetail); | ||
89 | + $("#showBackMobile").text(data.backMobile); | ||
90 | + $("#showUserDegree").text(data.userDegree); | ||
91 | + $("#showCount").text(data.count); | ||
92 | + $("#showReceiveCount").text(data.receiveCount); | ||
93 | + $("#showAppraiseOkCount").text(data.appraiseOkCount); | ||
94 | + $("#showAppraiseBadCount").text(data.appraiseBadCount); | ||
95 | + $("#showAppraiseFaultCount").text(data.appraiseFaultCount); | ||
96 | + $("#showNoAppraiseCount").text(data.noAppraiseCount); | ||
97 | + $.parser.parse($("#trade").parent()); | ||
98 | + } | ||
99 | + }); | ||
100 | + | ||
101 | + $("#orderDetailTable").myDatagrid({ | ||
102 | + fit: true, | ||
103 | + fitColumns: true, | ||
104 | + nowrap: false, | ||
105 | + url: contextPath + "/appraiseOrder/detailList", | ||
106 | + method: 'POST', | ||
107 | + queryParams:{ | ||
108 | + orderCode: orderCode | ||
109 | + }, | ||
110 | + loadFilter: function (data) { | ||
111 | + var temp = defaultLoadFilter(data); | ||
112 | + temp.rows = temp.list; | ||
113 | + return temp; | ||
114 | + }, | ||
115 | + columns: [[{ | ||
116 | + title: "子订单编号", | ||
117 | + field: "orderCode", | ||
118 | + width: 80, | ||
119 | + align: "center" | ||
120 | + }, { | ||
121 | + title: "商品图片", | ||
122 | + field: "imageUrl", | ||
123 | + width: 80, | ||
124 | + align: "center", | ||
125 | + formatter: function (value, rowData) { | ||
126 | + return '<img id="productImage" height="78px" width="78px" src="'+value+'" />'; | ||
127 | + } | ||
128 | + }, { | ||
129 | + title: "商品名称", | ||
130 | + field: "productName", | ||
131 | + width: 100, | ||
132 | + align: "center" | ||
133 | + }, { | ||
134 | + title: "货号", | ||
135 | + field: "productCode", | ||
136 | + width: 80, | ||
137 | + align: "center" | ||
138 | + }, { | ||
139 | + title: "颜色", | ||
140 | + field: "colorName", | ||
141 | + width: 50, | ||
142 | + align: "center" | ||
143 | + }, { | ||
144 | + title: "尺码", | ||
145 | + field: "sizeName", | ||
146 | + width: 50, | ||
147 | + align: "center" | ||
148 | + }, { | ||
149 | + title: "7天均价", | ||
150 | + field: "avgPrice7Day", | ||
151 | + width: 40, | ||
152 | + align: "center" | ||
153 | + }, { | ||
154 | + title: "保证金", | ||
155 | + field: "amount", | ||
156 | + width: 100, | ||
157 | + align: "center", | ||
158 | + formatter: function (value, rowData) { | ||
159 | + var str = "缴纳保证金:" + rowData.amount; | ||
160 | + str += "<br/>退回保证金:" + rowData.backAmount; | ||
161 | + str += "<br/>扣除保证金:" + rowData.usedAmount; | ||
162 | + return str; | ||
163 | + } | ||
164 | + },{ | ||
165 | + title: "费用", | ||
166 | + field: "fee", | ||
167 | + width: 60, | ||
168 | + align: "center", | ||
169 | + formatter: function (value, rowData) { | ||
170 | + var str = "包装费:" + rowData.packageFee; | ||
171 | + str += "<br/>鉴定费:" + rowData.appraiseFee; | ||
172 | + str += "<br/>仓储费:" + rowData.storageManagementFee; | ||
173 | + return str; | ||
174 | + } | ||
175 | + },{ | ||
176 | + title: "状态", | ||
177 | + field: "statusStr", | ||
178 | + width: 60, | ||
179 | + align: "center" | ||
180 | + },{ | ||
181 | + title: "操作", | ||
182 | + field: "operations", | ||
183 | + width: 80, | ||
184 | + align: "center", | ||
185 | + formatter: function (value, rowData) { | ||
186 | + var str = "<a role='viewOp' dataId='" + rowData.orderCode + "' style='margin-left:10px;background-color: #5bc0de'>操作记录</a>"; | ||
187 | + str += "<br/><a role='viewEx' dataId='" + rowData.orderCode + "' style='margin-left:10px;background-color: #5bc0de'>物流</a>"; | ||
188 | + if(rowData.status == "2") { | ||
189 | + str = "<br/><a role='cancel' dataId='" + rowData.orderCode + "' style='margin-left:10px;background-color: #5bc0de'>取消订单</a>"; | ||
190 | + } | ||
191 | + return str; | ||
192 | + } | ||
193 | + }]], | ||
194 | + cache: false, | ||
195 | + pagination: true, | ||
196 | + pageSize: 10, | ||
197 | + pageList: [10], | ||
198 | + idField: "id", | ||
199 | + singleSelect: false, | ||
200 | + checkOnSelect: false, | ||
201 | + onLoadSuccess: function () { | ||
202 | + $(this).myDatagrid("getPanel").find("a[role='viewOp']").linkbutton({ | ||
203 | + iconCls: "icon-edit", | ||
204 | + onClick: function () { | ||
205 | + orderCode = $(this).attr("dataId"); | ||
206 | + getOperateRecord(orderCode); | ||
207 | + $('#tt').tabs('select',"操作记录"); | ||
208 | + } | ||
209 | + }); | ||
210 | + $(this).myDatagrid("getPanel").find("a[role='viewEx']").linkbutton({ | ||
211 | + iconCls: "icon-edit", | ||
212 | + onClick: function () { | ||
213 | + orderCode = $(this).attr("dataId"); | ||
214 | + getExpressList(orderCode); | ||
215 | + $('#tt').tabs('select',"物流信息"); | ||
216 | + } | ||
217 | + }); | ||
218 | + $(this).myDatagrid("getPanel").find("a[role='cancel']").linkbutton({ | ||
219 | + iconCls: "icon-edit", | ||
220 | + onClick: function () { | ||
221 | + orderCode = $(this).attr("dataId"); | ||
222 | + cancelSonOrder(orderCode); | ||
223 | + } | ||
224 | + }); | ||
225 | + } | ||
226 | + }); | ||
227 | + function getOperateRecord(orderCode){ | ||
228 | + $("#operateRecordTable").myDatagrid({ | ||
229 | + fit: false, | ||
230 | + fitColumns: true, | ||
231 | + striped: true, | ||
232 | + rownumbers:true, | ||
233 | + url: contextPath + "/buyerOrder/queryOperateRecordList", | ||
234 | + method: 'POST', | ||
235 | + queryParams: { | ||
236 | + orderCode: orderCode | ||
237 | + }, | ||
238 | + loadFilter: function (data) { | ||
239 | + var temp = defaultLoadFilter(data); | ||
240 | + temp=null==temp?[]:temp; | ||
241 | + temp.rows = temp.list; | ||
242 | + return temp; | ||
243 | + }, | ||
244 | + | ||
245 | + columns: [[{ | ||
246 | + title: "操作日志", | ||
247 | + field: "typeStr", | ||
248 | + width: 20, | ||
249 | + align: "center" | ||
250 | + }, { | ||
251 | + title: "操作人", | ||
252 | + field: "userName", | ||
253 | + width: 20, | ||
254 | + align: "center" | ||
255 | + }, { | ||
256 | + title: "处理时间", | ||
257 | + field: "updateTimeStr", | ||
258 | + width: 20, | ||
259 | + align: "center" | ||
260 | + }]], | ||
261 | + cache: false, | ||
262 | + pagination: false, | ||
263 | + idField: "id", | ||
264 | + singleSelect: true, | ||
265 | + onLoadSuccess: function (data) { | ||
266 | + if (data.total == 0) { | ||
267 | + $(this).datagrid('appendRow', { type: '<div style="text-align:center;color:red">没有数据!</div>' }).datagrid('mergeCells', { index: 0, field: 'type', colspan: 3 }) | ||
268 | + } | ||
269 | + } | ||
270 | + }); | ||
271 | + } | ||
272 | + | ||
273 | + function getExpressList(orderCode) { | ||
274 | + $("#sellerExpressTable").datagrid({ | ||
275 | + fit: false, | ||
276 | + fitColumns: true, | ||
277 | + striped: true, | ||
278 | + rownumbers:true, | ||
279 | + url: contextPath + "/buyerOrder/queryExpressList", | ||
280 | + method: 'POST', | ||
281 | + queryParams: { | ||
282 | + orderCode: orderCode, | ||
283 | + expressTypeStr: "1" | ||
284 | + }, | ||
285 | + loadFilter: function (data) { | ||
286 | + var temp = defaultLoadFilter(data); | ||
287 | + temp=null==temp?[]:temp; | ||
288 | + temp.rows = temp.list; | ||
289 | + return temp; | ||
290 | + }, | ||
291 | + | ||
292 | + columns: [[{ | ||
293 | + title: "物流公司", | ||
294 | + field: "expressCompanyName", | ||
295 | + width: 20, | ||
296 | + align: "center" | ||
297 | + }, { | ||
298 | + title: "快递单号", | ||
299 | + field: "waybillCode", | ||
300 | + width: 20, | ||
301 | + align: "center" | ||
302 | + }, { | ||
303 | + title: "处理时间", | ||
304 | + field: "createTimeStr", | ||
305 | + width: 20, | ||
306 | + align: "center" | ||
307 | + }, { | ||
308 | + title: "处理内容", | ||
309 | + field: "acceptRemark", | ||
310 | + width: 30, | ||
311 | + align: "center" | ||
312 | + }]], | ||
313 | + cache: false, | ||
314 | + pagination: false, | ||
315 | + idField: "id", | ||
316 | + singleSelect: true, | ||
317 | + onLoadSuccess: function (data) { | ||
318 | + if (data.total == 0) { | ||
319 | + $(this).datagrid('appendRow', { expressCompanyName: '<div style="text-align:center;color:red">没有数据!</div>' }).datagrid('mergeCells', { index: 0, field: 'expressCompanyName', colspan: 4 }) | ||
320 | + } | ||
321 | + } | ||
322 | + }); | ||
323 | + | ||
324 | + $("#platformExpressTable").myDatagrid({ | ||
325 | + fit: false, | ||
326 | + fitColumns: true, | ||
327 | + striped: true, | ||
328 | + rownumbers:true, | ||
329 | + url: contextPath + "/buyerOrder/queryExpressList", | ||
330 | + method: 'POST', | ||
331 | + queryParams: { | ||
332 | + orderCode: orderCode, | ||
333 | + expressTypeStr: "2,3,4" | ||
334 | + }, | ||
335 | + loadFilter: function (data) { | ||
336 | + var temp = defaultLoadFilter(data); | ||
337 | + temp=null==temp?[]:temp; | ||
338 | + temp.rows = temp.list; | ||
339 | + return temp; | ||
340 | + }, | ||
341 | + | ||
342 | + columns: [[{ | ||
343 | + title: "物流公司", | ||
344 | + field: "expressCompanyName", | ||
345 | + width: 20, | ||
346 | + align: "center" | ||
347 | + }, { | ||
348 | + title: "快递单号", | ||
349 | + field: "waybillCode", | ||
350 | + width: 20, | ||
351 | + align: "center" | ||
352 | + }, { | ||
353 | + title: "处理时间", | ||
354 | + field: "createTimeStr", | ||
355 | + width: 20, | ||
356 | + align: "center" | ||
357 | + }, { | ||
358 | + title: "处理内容", | ||
359 | + field: "acceptRemark", | ||
360 | + width: 30, | ||
361 | + align: "center" | ||
362 | + }]], | ||
363 | + cache: false, | ||
364 | + pagination: false, | ||
365 | + idField: "id", | ||
366 | + singleSelect: true, | ||
367 | + onLoadSuccess: function (data) { | ||
368 | + if (data.total == 0) { | ||
369 | + $(this).datagrid('appendRow', { expressCompanyName: '<div style="text-align:center;color:red">没有数据!</div>' }).datagrid('mergeCells', { index: 0, field: 'expressCompanyName', colspan: 4 }) | ||
370 | + } | ||
371 | + } | ||
372 | + }); | ||
373 | + } | ||
374 | + }); | ||
375 | +</script> |
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 | + <script src="/ufoPlatform/js/ajaxfileupload.js"></script> | ||
8 | + <style> | ||
9 | + .btn-download span { | ||
10 | + line-height: 40px; | ||
11 | + color: #87CEFA; | ||
12 | + } | ||
13 | + </style> | ||
14 | +</head> | ||
15 | +<body class="easyui-layout" fit="true"> | ||
16 | +<div region="north" style="height: 160px"> | ||
17 | + <script> | ||
18 | + document.write(addHead('商品管理 /鉴定管理', '')); | ||
19 | + </script> | ||
20 | + <div style="margin-left: 30px;" class="div_search"> | ||
21 | + <input id="orderCode" type="text"/> | ||
22 | + <input id="uid" type="text"/> | ||
23 | + <select id="status" class="easyui-combobox" style="width:250px;" > | ||
24 | + <option value="-1">订单状态</option> | ||
25 | + <option value="0">待付保证金</option> | ||
26 | + <option value="1">待发货</option> | ||
27 | + <option value="101">已取消</option> | ||
28 | + <option value="2">卖家已发货</option> | ||
29 | + <option value="31">平台质检中</option> | ||
30 | + <option value="102">平台鉴定完成</option> | ||
31 | + </select> | ||
32 | + 下单时间:<input id="buyStartTime" type="text"> | ||
33 | + <input id="buyEndTime" type="text"/> | ||
34 | + </div> | ||
35 | + <div style="margin: 10px 0 0 30px;" class="div_search"> | ||
36 | + <a id="searchLinkButton" class="easyui-linkbutton btn-info" data-options="iconCls:'icon-search'">筛选</a> | ||
37 | + <a id="searchAllLinkButton" class="easyui-linkbutton btn-info" data-options="iconCls:'icon-search'">全部</a> | ||
38 | + </div> | ||
39 | +</div> | ||
40 | +<div region="center"> | ||
41 | + <div style="margin-left: 30px;margin-top: 20px;height: 660px"> | ||
42 | + <table id="orderTable"></table> | ||
43 | + </div> | ||
44 | +</div> | ||
45 | + | ||
46 | +<script type="text/javascript"> | ||
47 | + var orderCode; | ||
48 | + var uid; | ||
49 | + function viewOrder(orderCode) { | ||
50 | + window.open(contextPath + "/html/orderManage/detail.html?orderCode=" + orderCode + "&ver=" + new Date().getTime()) | ||
51 | + } | ||
52 | + $(function () { | ||
53 | + $("#orderCode").textbox({ | ||
54 | + prompt: "父订单编号" | ||
55 | + }); | ||
56 | + $("#uid").textbox({ | ||
57 | + prompt: "UID" | ||
58 | + }); | ||
59 | + $('#buyStartTime').datetimebox({}); | ||
60 | + $('#buyEndTime').datetimebox({}); | ||
61 | + | ||
62 | + $("#orderTable").myDatagrid({ | ||
63 | + fit: true, | ||
64 | + fitColumns: true, | ||
65 | + nowrap: false, | ||
66 | + url: contextPath + "/appraiseOrder/list", | ||
67 | + method: 'POST', | ||
68 | + loadFilter: function (data) { | ||
69 | + var temp = defaultLoadFilter(data); | ||
70 | + temp.rows = temp.list; | ||
71 | + return temp; | ||
72 | + }, | ||
73 | + columns: [[{ | ||
74 | + title: "父订单编号", | ||
75 | + field: "orderCode", | ||
76 | + width: 60, | ||
77 | + align: "center" | ||
78 | + }, { | ||
79 | + title: "订单状态", | ||
80 | + field: "statusStr", | ||
81 | + width: 120, | ||
82 | + align: "center" | ||
83 | + }, { | ||
84 | + title: "订单类型", | ||
85 | + field: "attributes", | ||
86 | + width: 60, | ||
87 | + align: "center", | ||
88 | + formatter: function (value, rowData) { | ||
89 | + if(value == "7") { | ||
90 | + return "付费寄存"; | ||
91 | + } | ||
92 | + if(value == "8") { | ||
93 | + return "付费鉴定"; | ||
94 | + } | ||
95 | + return ""; | ||
96 | + } | ||
97 | + }, { | ||
98 | + title: "用户UID", | ||
99 | + field: "uid", | ||
100 | + width: 60, | ||
101 | + align: "center" | ||
102 | + }, { | ||
103 | + title: "保证金", | ||
104 | + field: "amount", | ||
105 | + width: 50, | ||
106 | + align: "center" | ||
107 | + }, { | ||
108 | + title: "下单时间", | ||
109 | + field: "createTimeStr", | ||
110 | + width: 100, | ||
111 | + align: "center", | ||
112 | + },{ | ||
113 | + title: "订单来源", | ||
114 | + field: "clientType", | ||
115 | + width: 60, | ||
116 | + align: "center", | ||
117 | + formatter: function (value, rowData) { | ||
118 | + if(value == "3") { | ||
119 | + return "IOS"; | ||
120 | + } | ||
121 | + if(value == "4") { | ||
122 | + return "安卓"; | ||
123 | + } | ||
124 | + if(value == "7") { | ||
125 | + return "miniapp"; | ||
126 | + } | ||
127 | + return ""; | ||
128 | + } | ||
129 | + },{ | ||
130 | + title: "支付渠道", | ||
131 | + field: "payment", | ||
132 | + width: 60, | ||
133 | + align: "center", | ||
134 | + formatter: function (value, rowData) { | ||
135 | + if(value == "1") { | ||
136 | + return "微信"; | ||
137 | + } | ||
138 | + if(value == "2") { | ||
139 | + return "支付宝"; | ||
140 | + } | ||
141 | + return ""; | ||
142 | + } | ||
143 | + },{ | ||
144 | + title: "操作", | ||
145 | + field: "operations", | ||
146 | + width: 60, | ||
147 | + align: "center", | ||
148 | + formatter: function (value, rowData) { | ||
149 | + var str = "<a role='view' dataId='" + rowData.orderCode + "' uid='" + rowData.uid + "' style='margin-left:10px;background-color: #5bc0de'>详情</a>"; | ||
150 | + if(rowData.status == "2") { | ||
151 | + str = "<a role='cancel' dataId='" + rowData.orderCode + "' style='margin-left:10px;background-color: #5bc0de'>取消订单</a>"; | ||
152 | + } | ||
153 | + return str; | ||
154 | + } | ||
155 | + }]], | ||
156 | + cache: false, | ||
157 | + pagination: true, | ||
158 | + pageSize: 10, | ||
159 | + pageList: [10], | ||
160 | + idField: "id", | ||
161 | + singleSelect: false, | ||
162 | + checkOnSelect: false, | ||
163 | + onLoadSuccess: function () { | ||
164 | + $(this).myDatagrid("getPanel").find("a[role='view']").linkbutton({ | ||
165 | + iconCls: "icon-edit", | ||
166 | + onClick: function () { | ||
167 | + orderCode = $(this).attr("dataId"); | ||
168 | + uid = $(this).attr("uid"); | ||
169 | + viewDetail(); | ||
170 | + } | ||
171 | + }); | ||
172 | + $(this).myDatagrid("getPanel").find("a[role='cancel']").linkbutton({ | ||
173 | + iconCls: "icon-edit", | ||
174 | + onClick: function () { | ||
175 | + orderCode = $(this).attr("dataId"); | ||
176 | + cancelParent(orderCode); | ||
177 | + } | ||
178 | + }); | ||
179 | + } | ||
180 | + }); | ||
181 | + | ||
182 | + function viewDetail() { | ||
183 | + var div = $("<div>").appendTo($(document.body)); | ||
184 | + var title = "寄存详情"; | ||
185 | + $(div).myDialog({ | ||
186 | + width: "1500px", | ||
187 | + height: "800px", | ||
188 | + title: title, | ||
189 | + href: contextPath + "/html/goods/appraise/orderDetail.html?time_version=" + new Date().getTime(), | ||
190 | + modal: true, | ||
191 | + collapsible: true, | ||
192 | + cache: false, | ||
193 | + buttons: [ { | ||
194 | + text: "关闭", | ||
195 | + iconCls: "icon-cancel", | ||
196 | + handler: function () { | ||
197 | + $(div).dialog("close"); | ||
198 | + } | ||
199 | + }] | ||
200 | + }); | ||
201 | + } | ||
202 | + | ||
203 | + // 搜索 | ||
204 | + $("#searchLinkButton").linkbutton({ | ||
205 | + onClick: function () { | ||
206 | + var param = {}; | ||
207 | + param.orderCode = $('#orderCode').textbox('getValue'); | ||
208 | + param.uid = $('#uid').textbox('getValue'); | ||
209 | + param.status = $('#status').combobox('getValue'); | ||
210 | + param.buyStartTimeStr = $('#buyStartTime').datetimebox('getValue'); | ||
211 | + param.buyEndTimeStr = $('#buyEndTime').datetimebox('getValue'); | ||
212 | + $("#orderTable").myDatagrid("load", param); | ||
213 | + } | ||
214 | + }); | ||
215 | + | ||
216 | + // 搜索全部 | ||
217 | + $("#searchAllLinkButton").linkbutton({ | ||
218 | + onClick: function () { | ||
219 | + var param = {}; | ||
220 | + $("#orderTable").myDatagrid("load", param); | ||
221 | + } | ||
222 | + }); | ||
223 | + }); | ||
224 | + | ||
225 | +</script> | ||
226 | + | ||
227 | +</body> | ||
228 | +</html> |
-
Please register or login to post a comment