94a3112d 刘嘉

菠萝派接口-发货接口、退款检测借口修改

1 个父辈 186ad9b8
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
6 6
7 <!--检测退款订单--> 7 <!--检测退款订单-->
8 <select id="countCheckRefundStatusResponse" parameterType="java.util.Map" resultType="java.lang.Integer"> 8 <select id="countCheckRefundStatusResponse" parameterType="java.util.Map" resultType="java.lang.Integer">
9 SELECT COUNT(*) FROM im_order_refund WHERE order_code = #{orderCode} AND refund_status IN ('1','2','3','5','7') 9 SELECT COUNT(*) FROM im_order_refund WHERE order_code = #{orderCode} AND refund_status NOT IN ('100','101','-128')
10 </select> 10 </select>
11 11
12 <select id="getIMDoingOrderBean" parameterType="java.util.Map" resultMap="iMDoingOrderBean"> 12 <select id="getIMDoingOrderBean" parameterType="java.util.Map" resultMap="iMDoingOrderBean">
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
34 <select id="childrenrefundStatusByCourse" parameterType="java.lang.String" resultMap="checkRefundStatusBean"> 34 <select id="childrenrefundStatusByCourse" parameterType="java.lang.String" resultMap="checkRefundStatusBean">
35 SELECT r.refund_code,r1.name,r.refund_status FROM im_refund_order_item r1 35 SELECT r.refund_code,r1.name,r.refund_status FROM im_refund_order_item r1
36 LEFT JOIN im_order_refund r ON r1.refund_id = r.refund_id 36 LEFT JOIN im_order_refund r ON r1.refund_id = r.refund_id
37 WHERE r.refund_status IN ('1','2','3','5') AND r.order_code = #{orderCode} 37 WHERE r.refund_status NOT IN ('7','100','101','-128') AND r.order_code = #{orderCode}
38 </select> 38 </select>
39 39
40 40
......
...@@ -15,13 +15,13 @@ import java.util.List; ...@@ -15,13 +15,13 @@ import java.util.List;
15 * @description 菠萝派商城退款验证退款状态举类 15 * @description 菠萝派商城退款验证退款状态举类
16 */ 16 */
17 public enum PineappleRefundEnum { 17 public enum PineappleRefundEnum {
18 JH_07("JH_07", "没有退款",new ArrayList<>()),
19 JH_01("JH_01", "买家已经申请退款等待卖家同意",Arrays.asList(OrderRefundStatusEnum.WAIT_SELLER_AUDIT.getCode())), 18 JH_01("JH_01", "买家已经申请退款等待卖家同意",Arrays.asList(OrderRefundStatusEnum.WAIT_SELLER_AUDIT.getCode())),
20 JH_02("JH_02", "卖家已经同意退款等待买家退货", Arrays.asList(OrderRefundStatusEnum.WAIT_CUSTOMER_REFUND_GOODS.getCode())), 19 JH_02("JH_02", "卖家已经同意退款等待买家退货", Arrays.asList(OrderRefundStatusEnum.WAIT_CUSTOMER_REFUND_GOODS.getCode(),OrderRefundStatusEnum.AGREE_CHANGE_GOODS.getCode())),
21 JH_03("JH_03", "买家已经退货等待卖家确认收货",Arrays.asList(OrderRefundStatusEnum.WAIT_SELLER_RECEIVE_GOODS.getCode(),OrderRefundStatusEnum.WAIT_SELLER_AUDIT_RECEIVE_GOODS.getCode())), 20 JH_03("JH_03", "买家已经退货等待卖家确认收货",Arrays.asList(OrderRefundStatusEnum.WAIT_SELLER_RECEIVE_GOODS.getCode(),OrderRefundStatusEnum.WAIT_SELLER_AUDIT_RECEIVE_GOODS.getCode())),
22 JH_04("JH_04", "卖家拒绝退款",new ArrayList<>()), 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_05("JH_05", "退款关闭",new ArrayList<>()), 22 JH_05("JH_05", "退款关闭",new ArrayList<>()),
24 JH_06("JH_06", "退款成功",Arrays.asList(OrderRefundStatusEnum.SELLER_REFUNDING_MONEY_SUCCESS.getCode())), 23 JH_06("JH_06", "退款成功",Arrays.asList(OrderRefundStatusEnum.SELLER_REFUNDING_MONEY_SUCCESS.getCode())),
24 JH_07("JH_07", "没有退款",new ArrayList<>()),
25 JH_99("JH_99", "其他",new ArrayList<>()); 25 JH_99("JH_99", "其他",new ArrayList<>());
26 26
27 private String code; // 错误代码 27 private String code; // 错误代码
......
...@@ -16,10 +16,7 @@ import org.apache.log4j.Logger; ...@@ -16,10 +16,7 @@ import org.apache.log4j.Logger;
16 import org.springframework.stereotype.Service; 16 import org.springframework.stereotype.Service;
17 17
18 import javax.annotation.Resource; 18 import javax.annotation.Resource;
19 import java.util.ArrayList; 19 import java.util.*;
20 import java.util.HashMap;
21 import java.util.List;
22 import java.util.Map;
23 20
24 @Service 21 @Service
25 public class CheckRefundStatusBizServiceImpl extends AbstractBizService<CheckRefundStatusRequest>{ 22 public class CheckRefundStatusBizServiceImpl extends AbstractBizService<CheckRefundStatusRequest>{
...@@ -53,7 +50,7 @@ public class CheckRefundStatusBizServiceImpl extends AbstractBizService<CheckRef ...@@ -53,7 +50,7 @@ public class CheckRefundStatusBizServiceImpl extends AbstractBizService<CheckRef
53 } 50 }
54 //看是否全额退款 查询退款成功 51 //看是否全额退款 查询退款成功
55 checkRefundStatusBeanList = pineappleDao.childrenrefundStatusBySuccess(IMDoingOrderBean.getOrderCode()); 52 checkRefundStatusBeanList = pineappleDao.childrenrefundStatusBySuccess(IMDoingOrderBean.getOrderCode());
56 if(PayOrderStatus.RefundSuccess.getCode() == IMDoingOrderBean.getOrderStatus().intValue()) { 53 if(PayOrderStatus.RefundSuccess.getCode()== IMDoingOrderBean.getOrderStatus().intValue()) {
57 if (StringUtil.isNull(checkRefundStatusBeanList) || checkRefundStatusBeanList.isEmpty()) { 54 if (StringUtil.isNull(checkRefundStatusBeanList) || checkRefundStatusBeanList.isEmpty()) {
58 log.error(String.format("订单号:%s查询不到退款成功记录,请求method:%s,appket:%s", callRequest.getBizModel().getOrderID(), callRequest.getRequest().getMethod(), callRequest.getRequest().getAppkey())); 55 log.error(String.format("订单号:%s查询不到退款成功记录,请求method:%s,appket:%s", callRequest.getBizModel().getOrderID(), callRequest.getRequest().getMethod(), callRequest.getRequest().getAppkey()));
59 throw new BizException(String.format("订单号:%s查询不到退款成功记录,请求method:%s,appket:%s", callRequest.getBizModel().getOrderID(), callRequest.getRequest().getMethod(), callRequest.getRequest().getAppkey())); 56 throw new BizException(String.format("订单号:%s查询不到退款成功记录,请求method:%s,appket:%s", callRequest.getBizModel().getOrderID(), callRequest.getRequest().getMethod(), callRequest.getRequest().getAppkey()));
...@@ -88,13 +85,15 @@ public class CheckRefundStatusBizServiceImpl extends AbstractBizService<CheckRef ...@@ -88,13 +85,15 @@ public class CheckRefundStatusBizServiceImpl extends AbstractBizService<CheckRef
88 }else{ 85 }else{
89 checkRefundStatusBeanList = pineappleDao.childrenrefundStatusByCourse(IMDoingOrderBean.getOrderCode()); 86 checkRefundStatusBeanList = pineappleDao.childrenrefundStatusByCourse(IMDoingOrderBean.getOrderCode());
90 if(!StringUtil.isNull(checkRefundStatusBeanList) && !checkRefundStatusBeanList.isEmpty()){ 87 if(!StringUtil.isNull(checkRefundStatusBeanList) && !checkRefundStatusBeanList.isEmpty()){
88 Optional<CheckRefundStatusBean> entity = checkRefundStatusBeanList.stream().findFirst();
89 checkRefundStatusResponse.setRefundStatus(PineappleRefundEnum.resolveByPlatformRefundStatus(Integer.valueOf(entity.get().getRefundStatus())).getCode());
90 checkRefundStatusResponse.setSubmessage(PineappleRefundEnum.resolveByPlatformRefundStatus(Integer.valueOf(entity.get().getRefundStatus())).getMsg());
91 checkRefundStatusResponse.setRefundStatusdescription(PineappleRefundEnum.resolveByPlatformRefundStatus(Integer.valueOf(entity.get().getRefundStatus())).getMsg());
91 for (CheckRefundStatusBean bean : checkRefundStatusBeanList) { 92 for (CheckRefundStatusBean bean : checkRefundStatusBeanList) {
92 bean.setRefundStatusdescription(PineappleRefundEnum.resolveByPlatformRefundStatus(Integer.valueOf(bean.getRefundStatus())).getMsg()); 93 bean.setRefundStatusdescription(PineappleRefundEnum.resolveByPlatformRefundStatus(Integer.valueOf(bean.getRefundStatus())).getMsg());
93 bean.setRefundStatus(PineappleRefundEnum.resolveByPlatformRefundStatus(Integer.valueOf(bean.getRefundStatus())).getCode()); 94 bean.setRefundStatus(PineappleRefundEnum.resolveByPlatformRefundStatus(Integer.valueOf(bean.getRefundStatus())).getCode());
94 } 95 }
95 checkRefundStatusResponse.setRefundStatus(PineappleRefundEnum.JH_99.getCode()); 96
96 checkRefundStatusResponse.setSubmessage(PineappleRefundEnum.JH_99.getMsg());
97 checkRefundStatusResponse.setRefundStatusdescription(PineappleRefundEnum.JH_99.getMsg());
98 checkRefundStatusResponse.setCode(PineappleEnum.SUCCESS.getCode()); 97 checkRefundStatusResponse.setCode(PineappleEnum.SUCCESS.getCode());
99 checkRefundStatusResponse.setMessage(PineappleEnum.SUCCESS.getMsg()); 98 checkRefundStatusResponse.setMessage(PineappleEnum.SUCCESS.getMsg());
100 checkRefundStatusResponse.setChildrenrefundStatus(checkRefundStatusBeanList); 99 checkRefundStatusResponse.setChildrenrefundStatus(checkRefundStatusBeanList);
......