36dffeef 刘嘉

菠萝派接口-检测退款接口

1 个父辈 b4c2c689
...@@ -106,7 +106,27 @@ public interface PineappleDao { ...@@ -106,7 +106,27 @@ public interface PineappleDao {
106 */ 106 */
107 List<CourierCompany> getCourierCompanyByName(Map<String,Object> params); 107 List<CourierCompany> getCourierCompanyByName(Map<String,Object> params);
108 108
109 /**
110 * 根据订单号查询退货信息
111 * @param orderSn
112 * @return
113 */
114 List<MemberProductBack> getMemberProductBackByOrderSn(@Param("orderSn") String orderSn);
115
116 /**
117 * 根据订单号查询换货信息
118 * @param orderSn
119 * @return
120 */
121 List<MemberProductExchange> getMemberProductExchangeByOrderSn(@Param("orderSn") String orderSn);
109 122
110 123
124 /**
125 * 根据订单ID查询投诉表
126 * @param id
127 * @return
128 */
129 List<SellerComplaint> getSellerComplaintByOrderId(@Param("orderId") Integer id);
130
111 131
112 } 132 }
......
...@@ -310,4 +310,133 @@ ...@@ -310,4 +310,133 @@
310 from `courier_company` 310 from `courier_company`
311 where company_name LIKE concat('%',#{name},'%') AND seller_id =#{sellerId} 311 where company_name LIKE concat('%',#{name},'%') AND seller_id =#{sellerId}
312 </select> 312 </select>
313
314
315 <!--退货表实体-->
316 <resultMap id="memberProductBackResult" type="com.sibu.orderHelper.integral.pineapple.model.MemberProductBack">
317 <result property="id" column="id" />
318 <result property="sellerId" column="seller_id" />
319 <result property="sellerName" column="seller_name" />
320 <result property="orderId" column="order_id" />
321 <result property="orderSn" column="order_sn" />
322 <result property="orderProductId" column="order_product_id" />
323 <result property="productId" column="product_id" />
324 <result property="productName" column="product_name" />
325 <result property="memberId" column="member_id" />
326 <result property="memberName" column="member_name" />
327 <result property="provinceId" column="province_id" />
328 <result property="cityId" column="city_id" />
329 <result property="areaId" column="area_id" />
330 <result property="addressAll" column="address_all" />
331 <result property="addressInfo" column="address_info" />
332 <result property="zipCode" column="zip_code" />
333 <result property="contactPhone" column="contact_phone" />
334 <result property="contactName" column="contact_name" />
335 <result property="logisticsId" column="logistics_id" />
336 <result property="logisticsName" column="logistics_name" />
337 <result property="logisticsMark" column="logistics_mark" />
338 <result property="logisticsNumber" column="logistics_number" />
339 <result property="question" column="question" />
340 <result property="image" column="image" />
341 <result property="stateReturn" column="state_return" />
342 <result property="stateMoney" column="state_money" />
343 <result property="number" column="number" />
344 <result property="backMoney" column="back_money" />
345 <result property="backIntegral" column="back_integral" />
346 <result property="backIntegralMoney" column="back_integral_money" />
347 <result property="backCouponUserId" column="back_coupon_user_id" />
348 <result property="backMoneyTime" column="back_money_time" />
349 <result property="optId" column="opt_id" />
350 <result property="optName" column="opt_name" />
351 <result property="remark" column="remark" />
352 <result property="createTime" column="create_time" />
353 <result property="updateTime" column="update_time" />
354 </resultMap>
355
356 <!--根据订单号查询换货信息-->
357 <select id="getMemberProductBackByOrderSn" parameterType="java.lang.String" resultMap="memberProductBackResult">
358 SELECT * FROM member_product_back WHERE order_sn = #{orderSn} AND state_return IN ('1','2','3','4') ORDER BY create_time
359 </select>
360
361 <!--换货实体类-->
362 <resultMap id="memberProductExchangeResult" type="com.sibu.orderHelper.integral.pineapple.model.MemberProductExchange">
363 <result property="id" column="id" />
364 <result property="sellerId" column="seller_id" />
365 <result property="sellerName" column="seller_name" />
366 <result property="orderId" column="order_id" />
367 <result property="orderSn" column="order_sn" />
368 <result property="orderProductId" column="order_product_id" />
369 <result property="productId" column="product_id" />
370 <result property="productName" column="product_name" />
371 <result property="memberId" column="member_id" />
372 <result property="memberName" column="member_name" />
373 <result property="provinceId" column="province_id" />
374 <result property="cityId" column="city_id" />
375 <result property="areaId" column="area_id" />
376 <result property="addressAll" column="address_all" />
377 <result property="addressInfo" column="address_info" />
378 <result property="zipCode" column="zip_code" />
379 <result property="changeName" column="change_name" />
380 <result property="phone" column="phone" />
381 <result property="logisticsId" column="logistics_id" />
382 <result property="logisticsName" column="logistics_name" />
383 <result property="logisticsMark" column="logistics_mark" />
384 <result property="logisticsNumber" column="logistics_number" />
385 <result property="provinceId2" column="province_id2" />
386 <result property="cityId2" column="city_id2" />
387 <result property="areaId2" column="area_id2" />
388 <result property="addressAll2" column="address_all2" />
389 <result property="addressInfo2" column="address_info2" />
390 <result property="zipCode2" column="zip_code2" />
391 <result property="changeName2" column="change_name2" />
392 <result property="phone2" column="phone2" />
393 <result property="logisticsId2" column="logistics_id2" />
394 <result property="logisticsName2" column="logistics_name2" />
395 <result property="logisticsMark2" column="logistics_mark2" />
396 <result property="logisticsNumber2" column="logistics_number2" />
397 <result property="number" column="number" />
398 <result property="question" column="question" />
399 <result property="image" column="image" />
400 <result property="name" column="name" />
401 <result property="state" column="state" />
402 <result property="optId" column="opt_id" />
403 <result property="optName" column="opt_name" />
404 <result property="remark" column="remark" />
405 <result property="createTime" column="create_time" />
406 <result property="updateTime" column="update_time" />
407 </resultMap>
408
409 <!--根据订单号查询换货信息-->
410 <select id="getMemberProductExchangeByOrderSn" parameterType="java.lang.String" resultMap="memberProductExchangeResult">
411 SELECT * FROM member_product_exchange WHERE order_sn = #{orderSn} AND state IN ('1','2','3','4') ORDER BY create_time
412 </select>
413
414 <!-- 投诉表实体-->
415 <resultMap id="sellerComplaintResult" type="com.sibu.orderHelper.integral.pineapple.model.SellerComplaint">
416 <result property="id" column="id" />
417 <result property="userId" column="user_id" />
418 <result property="userName" column="user_name" />
419 <result property="orderId" column="order_id" />
420 <result property="orderProductId" column="order_product_id" />
421 <result property="productBackId" column="product_back_id" />
422 <result property="productExchangeId" column="product_exchange_id" />
423 <result property="content" column="content" />
424 <result property="image" column="image" />
425 <result property="complaintTime" column="complaint_time" />
426 <result property="sellerId" column="seller_id" />
427 <result property="sellerComplaintTime" column="seller_complaint_time" />
428 <result property="sellerCompContent" column="seller_comp_content" />
429 <result property="sellerCompImage" column="seller_comp_image" />
430 <result property="state" column="state" />
431 <result property="optId" column="opt_id" />
432 <result property="optContent" column="opt_content" />
433 <result property="userContent" column="user_content" />
434 <result property="createTime" column="create_time" />
435 <result property="optTime" column="opt_time" />
436 </resultMap>
437
438 <!-- 根据条件查询投诉表-->
439 <select id="getSellerComplaintById" parameterType="java.lang.Integer" resultMap="sellerComplaintResult">
440 SELECT * FROM seller_complaint WHERE order_id = #{orderId} AND state IN (1,3,4) ORDER BY create_time
441 </select>
313 </mapper> 442 </mapper>
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -2,7 +2,9 @@ package com.sibu.orderHelper.enums; ...@@ -2,7 +2,9 @@ package com.sibu.orderHelper.enums;
2 2
3 3
4 import com.alibaba.druid.util.StringUtils; 4 import com.alibaba.druid.util.StringUtils;
5 import com.sibu.orderHelper.integral.pineapple.enums.MemberProductBackEnum;
5 import com.sibu.orderHelper.integral.pineapple.enums.OrderStatusEnum; 6 import com.sibu.orderHelper.integral.pineapple.enums.OrderStatusEnum;
7 import com.sibu.orderHelper.integral.pineapple.model.MemberProductBack;
6 import org.apache.commons.lang3.EnumUtils; 8 import org.apache.commons.lang3.EnumUtils;
7 9
8 import java.util.ArrayList; 10 import java.util.ArrayList;
...@@ -15,14 +17,16 @@ import java.util.List; ...@@ -15,14 +17,16 @@ import java.util.List;
15 * @description 菠萝派商城退款验证退款状态举类 17 * @description 菠萝派商城退款验证退款状态举类
16 */ 18 */
17 public enum PineappleRefundEnum { 19 public enum PineappleRefundEnum {
18 JH_01("JH_01", "买家已经申请退款等待卖家同意",Arrays.asList(OrderRefundStatusEnum.WAIT_SELLER_AUDIT.getCode())), 20 JH_01("JH_01", "买家已经申请退款等待卖家同意",Arrays.asList(MemberProductBackEnum.Pending.getCode())),
19 JH_02("JH_02", "卖家已经同意退款等待买家退货", Arrays.asList(OrderRefundStatusEnum.WAIT_CUSTOMER_REFUND_GOODS.getCode(),OrderRefundStatusEnum.AGREE_CHANGE_GOODS.getCode())), 21 JH_02("JH_02", "卖家已经同意退款等待买家退货", Arrays.asList(MemberProductBackEnum.AuditSucceess.getCode())),
20 JH_03("JH_03", "买家已经退货等待卖家确认收货",Arrays.asList(OrderRefundStatusEnum.WAIT_SELLER_RECEIVE_GOODS.getCode(),OrderRefundStatusEnum.WAIT_SELLER_AUDIT_RECEIVE_GOODS.getCode())), 22 JH_03("JH_03", "买家已经退货等待卖家确认收货",Arrays.asList(MemberProductBackEnum.MemberDeliver.getCode())),
21 JH_04("JH_04", "卖家拒绝退款",Arrays.asList(OrderRefundStatusEnum.WAIT_CUSTOMER_AUDIT.getCode(),OrderRefundStatusEnum.DISAGREE_REFUNDING_MONEY.getCode(),OrderRefundStatusEnum.DISAGREE_CHANGE_GOODS.getCode(),OrderRefundStatusEnum.DENY_CHANGE_GOODS.getCode())), 23 JH_04("JH_04", "卖家拒绝退款",Arrays.asList()),
22 JH_05("JH_05", "退款关闭",new ArrayList<>()), 24 JH_05("JH_05", "退款关闭",new ArrayList<>(MemberProductBackEnum.Inattentive.getCode())),
23 JH_06("JH_06", "退款成功",Arrays.asList(OrderRefundStatusEnum.SELLER_REFUNDING_MONEY_SUCCESS.getCode())), 25 JH_06("JH_06", "退款成功",Arrays.asList()),
24 JH_07("JH_07", "没有退款",new ArrayList<>()), 26 JH_07("JH_07", "没有退款",new ArrayList<>()),
25 JH_99("JH_99", "其他",new ArrayList<>()); 27 JH_99("JH_99", "其他",new ArrayList<>(MemberProductBackEnum.ShopDelivery.getCode()));
28
29
26 30
27 private String code; // 错误代码 31 private String code; // 错误代码
28 private String msg; // 错误消息 32 private String msg; // 错误消息
......
1 package com.sibu.orderHelper.integral.pineapple.enums;
2
3 import com.alibaba.druid.util.StringUtils;
4 import org.apache.commons.lang3.EnumUtils;
5
6 import java.util.List;
7
8 /**
9 * @author LauKa
10 * @contact a062431@vip.qq.com
11 * @date 2018/05/15
12 * @description 新系统退款表状态 1、未处理;2、审核通过;3、用户发货,4、店铺收货;5、不予处理'
13 */
14 public enum MemberProductBackEnum {
15 Pending(1, "未处理"), AuditSucceess(2, "审核通过"), MemberDeliver(3, "用户发货"),
16 ShopDelivery(4, "店铺收货"), Inattentive(5, "不予处理");
17
18 private int code; // 错误代码
19 private String msg; // 错误消息
20
21 public int getCode() {
22 return code;
23 }
24
25 public String getMsg() {
26 return msg;
27 }
28
29 MemberProductBackEnum(int code, String msg) {
30 this.code = code;
31 this.msg = msg;
32 }
33
34 public static MemberProductBackEnum valueOf(int code) { // 手写的从int到enum的转换函数
35 List<MemberProductBackEnum> enums = EnumUtils.getEnumList(MemberProductBackEnum.class);
36 MemberProductBackEnum result = enums.stream()
37 .filter(p -> p.getCode() == code)
38 .findFirst()
39 .orElse(null);
40 return result;
41 }
42
43
44 public static MemberProductBackEnum resolve(String code) {
45 List<MemberProductBackEnum> enums = EnumUtils.getEnumList(MemberProductBackEnum.class);
46 MemberProductBackEnum result = enums.stream()
47 .filter(p -> StringUtils.equalsIgnoreCase(String.valueOf(p.getCode()), code))
48 .findFirst()
49 .orElse(null);
50 return result;
51 }
52
53
54 }
1 package com.sibu.orderHelper.integral.pineapple.enums;
2
3 import com.alibaba.druid.util.StringUtils;
4 import org.apache.commons.lang3.EnumUtils;
5
6 import java.util.List;
7
8 /**
9 * @author LauKa
10 * @contact a062431@vip.qq.com
11 * @date 2018/05/15
12 * @description 新系统换货表状态 换货状态:1、未处理;2、审核通过;3、用户发回退件;4、商家收到退件;5、商家发出换件;6、原件退还;7、不处理
13 */
14 public enum MemberProductExchangeEnum {
15 Pending(1, "未处理"), AuditSucceess(2, "审核通过"), MemberDeliver(3, "用户发回退件"),
16 ShopDelivery(4, "商家收到退件"),ShopExchange(5,"商家发出换件"),ReturnOld(6,"原件退还"), Inattentive(7, "不予处理");
17
18 private int code; // 错误代码
19 private String msg; // 错误消息
20
21 public int getCode() {
22 return code;
23 }
24
25 public String getMsg() {
26 return msg;
27 }
28
29 MemberProductExchangeEnum(int code, String msg) {
30 this.code = code;
31 this.msg = msg;
32 }
33
34 public static MemberProductExchangeEnum valueOf(int code) { // 手写的从int到enum的转换函数
35 List<MemberProductExchangeEnum> enums = EnumUtils.getEnumList(MemberProductExchangeEnum.class);
36 MemberProductExchangeEnum result = enums.stream()
37 .filter(p -> p.getCode() == code)
38 .findFirst()
39 .orElse(null);
40 return result;
41 }
42
43
44 public static MemberProductExchangeEnum resolve(String code) {
45 List<MemberProductExchangeEnum> enums = EnumUtils.getEnumList(MemberProductExchangeEnum.class);
46 MemberProductExchangeEnum result = enums.stream()
47 .filter(p -> StringUtils.equalsIgnoreCase(String.valueOf(p.getCode()), code))
48 .findFirst()
49 .orElse(null);
50 return result;
51 }
52
53
54 }
1 package com.sibu.orderHelper.integral.pineapple.enums;
2
3
4 import com.alibaba.druid.util.StringUtils;
5 import org.apache.commons.lang3.EnumUtils;
6
7 import java.util.ArrayList;
8 import java.util.Arrays;
9 import java.util.List;
10
11 /**
12 * @author lauka
13 * @date 2018/03/30
14 * @description 菠萝派商城退款验证换货状态举类
15 */
16 public enum PineappleExchangeEnum {
17 JH_01("JH_01", "买家已经申请退款等待卖家同意",Arrays.asList(MemberProductExchangeEnum.Pending.getCode())),
18 JH_02("JH_02", "卖家已经同意退款等待买家退货", Arrays.asList(MemberProductExchangeEnum.AuditSucceess.getCode())),
19 JH_03("JH_03", "买家已经退货等待卖家确认收货",Arrays.asList(MemberProductExchangeEnum.MemberDeliver.getCode())),
20 JH_04("JH_04", "卖家拒绝退款",Arrays.asList()),
21 JH_05("JH_05", "退款关闭",new ArrayList<>(MemberProductExchangeEnum.Inattentive.getCode())),
22 JH_06("JH_06", "退款成功",Arrays.asList()),
23 JH_07("JH_07", "没有退款",Arrays.asList(MemberProductExchangeEnum.ReturnOld.getCode(),MemberProductExchangeEnum.ShopExchange.getCode())),
24 JH_99("JH_99", "其他",new ArrayList<>(MemberProductExchangeEnum.ShopDelivery.getCode()));
25
26
27
28 private String code; // 错误代码
29 private String msg; // 错误消息
30 List<Integer> mallOrderStatus;
31
32
33 PineappleExchangeEnum(String code, String msg, List<Integer> mallOrderStatus) {
34 this.code = code;
35 this.msg = msg;
36 this.mallOrderStatus = mallOrderStatus;
37 }
38
39 public String getCode() {
40 return code;
41 }
42
43 public void setCode(String code) {
44 this.code = code;
45 }
46
47 public String getMsg() {
48 return msg;
49 }
50
51 public void setMsg(String msg) {
52 this.msg = msg;
53 }
54
55 public static PineappleExchangeEnum resolve(String code) {
56 List<PineappleExchangeEnum> enums = EnumUtils.getEnumList(PineappleExchangeEnum.class);
57 PineappleExchangeEnum result = enums.stream()
58 .filter(p -> StringUtils.equalsIgnoreCase(p.code, code))
59 .findFirst()
60 .orElse(PineappleExchangeEnum.JH_99);
61 return result;
62 }
63
64 public static PineappleExchangeEnum resolveByPlatformRefundStatus(Integer platformOrderStatus) {
65 List<PineappleExchangeEnum> enums = EnumUtils.getEnumList(PineappleExchangeEnum.class);
66 PineappleExchangeEnum result = enums.stream()
67 .filter(p -> p.mallOrderStatus != null && p.mallOrderStatus.contains(platformOrderStatus))
68 .findFirst()
69 .orElse(PineappleExchangeEnum.JH_99);
70 return result;
71 }
72
73
74
75 }
1 package com.sibu.orderHelper.integral.pineapple.model;
2
3 import lombok.Data;
4 import lombok.ToString;
5
6 import java.io.Serializable;
7
8 @Data
9 @ToString
10 public class MemberProductBack implements Serializable{
11
12 private java.lang.Integer id;
13 private java.lang.Integer sellerId;
14 private java.lang.String sellerName;
15 private java.lang.Integer orderId;
16 private java.lang.String orderSn;
17 private java.lang.Integer orderProductId;
18 private java.lang.Integer productId;
19 private java.lang.String productName;
20 private java.lang.Integer memberId;
21 private java.lang.String memberName;
22 private java.lang.Integer provinceId;
23 private java.lang.Integer cityId;
24 private java.lang.Integer areaId;
25 private java.lang.String addressAll;
26 private java.lang.String addressInfo;
27 private java.lang.String zipCode;
28 private java.lang.String contactPhone;
29 private java.lang.String contactName;
30 private java.lang.Integer logisticsId;
31 private java.lang.String logisticsName;
32 private java.lang.String logisticsMark;
33 private java.lang.String logisticsNumber;
34 private java.lang.String question;
35 private java.lang.String image;
36 private java.lang.Integer stateReturn;
37 private java.lang.Integer stateMoney;
38 private java.lang.Integer number;
39 private java.math.BigDecimal backMoney;
40 private java.lang.Integer backIntegral;
41 private java.math.BigDecimal backIntegralMoney;
42 private java.lang.Integer backCouponUserId;
43 private java.util.Date backMoneyTime;
44 private java.lang.Integer optId;
45 private java.lang.String optName;
46 private java.lang.String remark;
47 private java.util.Date createTime;
48 private java.util.Date updateTime;
49 }
1 package com.sibu.orderHelper.integral.pineapple.model;
2
3 import lombok.Data;
4 import lombok.ToString;
5
6 import java.io.Serializable;
7
8 @Data
9 @ToString
10 public class MemberProductExchange implements Serializable {
11
12 private java.lang.Integer id;
13 private java.lang.Integer sellerId;
14 private java.lang.String sellerName;
15 private java.lang.Integer orderId;
16 private java.lang.String orderSn;
17 private java.lang.Integer orderProductId;
18 private java.lang.Integer productId;
19 private java.lang.String productName;
20 private java.lang.Integer memberId;
21 private java.lang.String memberName;
22 private java.lang.Integer provinceId;
23 private java.lang.Integer cityId;
24 private java.lang.Integer areaId;
25 private java.lang.String addressAll;
26 private java.lang.String addressInfo;
27 private java.lang.String zipCode;
28 private java.lang.String changeName;
29 private java.lang.String phone;
30 private java.lang.Integer logisticsId;
31 private java.lang.String logisticsName;
32 private java.lang.String logisticsMark;
33 private java.lang.String logisticsNumber;
34 private java.lang.Integer provinceId2;
35 private java.lang.Integer cityId2;
36 private java.lang.Integer areaId2;
37 private java.lang.String addressAll2;
38 private java.lang.String addressInfo2;
39 private java.lang.String zipCode2;
40 private java.lang.String changeName2;
41 private java.lang.String phone2;
42 private java.lang.Integer logisticsId2;
43 private java.lang.String logisticsName2;
44 private java.lang.String logisticsMark2;
45 private java.lang.String logisticsNumber2;
46 private java.lang.Integer number;
47 private java.lang.String question;
48 private java.lang.String image;
49 private java.lang.String name;
50 private java.lang.Integer state;
51 private java.lang.Integer optId;
52 private java.lang.String optName;
53 private java.lang.String remark;
54 private java.util.Date createTime;
55 private java.util.Date updateTime;
56 }
1 package com.sibu.orderHelper.integral.pineapple.model;
2
3 import lombok.Data;
4 import lombok.ToString;
5
6 import java.io.Serializable;
7
8 @Data
9 @ToString
10 public class SellerComplaint implements Serializable {
11
12 private java.lang.Integer id; //id
13 private java.lang.Integer userId; //投诉人ID
14 private java.lang.String userName; //投诉人账户
15 private java.lang.Integer orderId; //订单ID
16 private java.lang.Integer orderProductId; //网单ID
17 private java.lang.Integer productBackId; //退货管理id,如没有置为0
18 private java.lang.Integer productExchangeId; //换货管理id,如没有置为0
19 private java.lang.String content; //投诉内容
20 private java.lang.String image; //投诉图片
21 private java.util.Date complaintTime; //投诉时间
22 private java.lang.Integer sellerId; //投诉商家
23 private java.util.Date sellerComplaintTime; //商家申诉时间
24 private java.lang.String sellerCompContent; //商家申诉内容
25 private java.lang.String sellerCompImage; //商家申诉图片
26 private java.lang.Integer state; //状态:1、买家投诉待审核;2、买家投诉不通过;3、买家投诉通过;4、卖家申诉待审核;5、卖家申诉不通过;6、卖家申诉通过;
27 private java.lang.Integer optId; //平台处理人ID
28 private java.lang.String optContent; //平台处理结果
29 private java.lang.String userContent; //客户反馈意见
30 private java.util.Date createTime; //创建时间
31 private java.util.Date optTime; //处理时间
32 }