菠萝派接口- 检测退款换数据源
正在显示
2 个修改的文件
包含
23 行增加
和
9 行删除
... | @@ -124,7 +124,7 @@ public interface MemberReadDao { | ... | @@ -124,7 +124,7 @@ public interface MemberReadDao { |
124 | * @param id | 124 | * @param id |
125 | * @return | 125 | * @return |
126 | */ | 126 | */ |
127 | List<SellerComplaint> getSellerComplaintByOrderId(@Param("orderId") Integer id); | 127 | List<SellerComplaint> getSellerComplaintById(@Param("orderId") Integer id); |
128 | 128 | ||
129 | 129 | ||
130 | List<Seller> getSeller(@Param("id") String id); | 130 | List<Seller> getSeller(@Param("id") String id); | ... | ... |
... | @@ -8,6 +8,7 @@ import com.sibu.orderHelper.enums.*; | ... | @@ -8,6 +8,7 @@ import com.sibu.orderHelper.enums.*; |
8 | import com.sibu.orderHelper.integral.dao.PineappleDao; | 8 | import com.sibu.orderHelper.integral.dao.PineappleDao; |
9 | import com.sibu.orderHelper.integral.model.CheckRefundStatusBean; | 9 | import com.sibu.orderHelper.integral.model.CheckRefundStatusBean; |
10 | import com.sibu.orderHelper.integral.model.IMDoingOrderBean; | 10 | import com.sibu.orderHelper.integral.model.IMDoingOrderBean; |
11 | import com.sibu.orderHelper.integral.pineapple.enums.EJavaShopOrderStateEnum; | ||
11 | import com.sibu.orderHelper.integral.pineapple.enums.MemberProductBackEnum; | 12 | import com.sibu.orderHelper.integral.pineapple.enums.MemberProductBackEnum; |
12 | import com.sibu.orderHelper.integral.pineapple.enums.PineappleExchangeEnum; | 13 | import com.sibu.orderHelper.integral.pineapple.enums.PineappleExchangeEnum; |
13 | import com.sibu.orderHelper.integral.pineapple.exception.BizException; | 14 | import com.sibu.orderHelper.integral.pineapple.exception.BizException; |
... | @@ -18,6 +19,7 @@ import com.sibu.orderHelper.integral.pineapple.model.SellerComplaint; | ... | @@ -18,6 +19,7 @@ import com.sibu.orderHelper.integral.pineapple.model.SellerComplaint; |
18 | import com.sibu.orderHelper.integral.pineapple.request.CallRequest; | 19 | import com.sibu.orderHelper.integral.pineapple.request.CallRequest; |
19 | import com.sibu.orderHelper.integral.reponse.CheckRefundStatusResponse; | 20 | import com.sibu.orderHelper.integral.reponse.CheckRefundStatusResponse; |
20 | import com.sibu.orderHelper.integral.request.CheckRefundStatusRequest; | 21 | import com.sibu.orderHelper.integral.request.CheckRefundStatusRequest; |
22 | import com.sibu.orderHelper.mall.member.read.MemberReadDao; | ||
21 | import org.apache.log4j.Logger; | 23 | import org.apache.log4j.Logger; |
22 | import org.springframework.stereotype.Service; | 24 | import org.springframework.stereotype.Service; |
23 | 25 | ||
... | @@ -29,21 +31,25 @@ public class CheckRefundStatusBizServiceImpl extends AbstractBizService<CheckRef | ... | @@ -29,21 +31,25 @@ public class CheckRefundStatusBizServiceImpl extends AbstractBizService<CheckRef |
29 | 31 | ||
30 | private static Logger log = Logger.getLogger(CheckRefundStatusBizServiceImpl.class); | 32 | private static Logger log = Logger.getLogger(CheckRefundStatusBizServiceImpl.class); |
31 | @Resource | 33 | @Resource |
32 | private PineappleDao pineappleDao; | 34 | private MemberReadDao memberReadDao; |
33 | 35 | ||
34 | @Override | 36 | @Override |
35 | public CheckRefundStatusResponse call(CallRequest<CheckRefundStatusRequest> callRequest) throws Exception { | 37 | public CheckRefundStatusResponse call(CallRequest<CheckRefundStatusRequest> callRequest) throws Exception { |
36 | CheckRefundStatusResponse checkRefundStatusResponse = new CheckRefundStatusResponse(); | 38 | CheckRefundStatusResponse checkRefundStatusResponse = new CheckRefundStatusResponse(); |
37 | Map<String,Object> params = new HashMap<>(); | 39 | Map<String,Object> params = new HashMap<>(); |
38 | params.put("orderSn ",callRequest.getBizModel().getOrderID()); | 40 | params.put("orderSn",callRequest.getBizModel().getOrderID()); |
39 | params.put("sellerId",callRequest.getSupplier().getId()); | 41 | params.put("sellerId",callRequest.getSupplier().getId()); |
40 | Orders orders = pineappleDao.getOrdersByMap(params); | 42 | Orders orders = memberReadDao.getOrdersByMap(params); |
41 | if(StringUtil.isNull(orders)){ | 43 | if(StringUtil.isNull(orders)){ |
42 | log.error(String.format("修改订单备注,获取订单数据业务异常,订单号:[%s]",callRequest.getBizModel().getOrderID())); | 44 | log.error(String.format("检测订单退款,获取订单数据业务异常,订单号:[%s]",callRequest.getBizModel().getOrderID())); |
43 | throw new BizException(String.format("修改订单备注,获取订单数据业务异常,订单号:[%s]",callRequest.getBizModel().getOrderID())); | 45 | throw new BizException(String.format("检测订单退款,获取订单数据业务异常,订单号:[%s]",callRequest.getBizModel().getOrderID())); |
46 | } | ||
47 | if(orders.getOrderState() == EJavaShopOrderStateEnum.RefundFail.getCode()){ | ||
48 | log.error(String.format("检测订单退款,该订单已关闭,订单号:[%s]",callRequest.getBizModel().getOrderID())); | ||
49 | throw new BizException(String.format("检测订单退款,该订单已关闭,订单号:[%s]",callRequest.getBizModel().getOrderID())); | ||
44 | } | 50 | } |
45 | //1.查询退货表有没有记录 | 51 | //1.查询退货表有没有记录 |
46 | List<MemberProductBack> memberProductBackList= pineappleDao.getMemberProductBackByOrderSn(callRequest.getBizModel().getOrderID()); | 52 | List<MemberProductBack> memberProductBackList= memberReadDao.getMemberProductBackByOrderSn(callRequest.getBizModel().getOrderID()); |
47 | //5.如果退货表有记录,退款状态为店铺收货,判断退款金额状态 | 53 | //5.如果退货表有记录,退款状态为店铺收货,判断退款金额状态 |
48 | if(!StringUtil.isNull(memberProductBackList) && !memberProductBackList.isEmpty()){ | 54 | if(!StringUtil.isNull(memberProductBackList) && !memberProductBackList.isEmpty()){ |
49 | MemberProductBack memberProductBack = memberProductBackList.stream().findFirst().get(); | 55 | MemberProductBack memberProductBack = memberProductBackList.stream().findFirst().get(); |
... | @@ -60,6 +66,14 @@ public class CheckRefundStatusBizServiceImpl extends AbstractBizService<CheckRef | ... | @@ -60,6 +66,14 @@ public class CheckRefundStatusBizServiceImpl extends AbstractBizService<CheckRef |
60 | checkRefundStatusResponse.setCode(PineappleEnum.SUCCESS.getCode()); | 66 | checkRefundStatusResponse.setCode(PineappleEnum.SUCCESS.getCode()); |
61 | checkRefundStatusResponse.setMessage(PineappleEnum.SUCCESS.getMsg()); | 67 | checkRefundStatusResponse.setMessage(PineappleEnum.SUCCESS.getMsg()); |
62 | return checkRefundStatusResponse; | 68 | return checkRefundStatusResponse; |
69 | }else{ | ||
70 | checkRefundStatusResponse.setRefundStatus(PineappleRefundEnum.JH_06.getCode()); | ||
71 | checkRefundStatusResponse.setSubmessage(PineappleRefundEnum.JH_06.getMsg()); | ||
72 | checkRefundStatusResponse.setRefundStatusdescription(PineappleRefundEnum.JH_06.getMsg()); | ||
73 | checkRefundStatusResponse.setChildrenrefundStatus(new ArrayList()); | ||
74 | checkRefundStatusResponse.setCode(PineappleEnum.SUCCESS.getCode()); | ||
75 | checkRefundStatusResponse.setMessage(PineappleEnum.SUCCESS.getMsg()); | ||
76 | return checkRefundStatusResponse; | ||
63 | } | 77 | } |
64 | } | 78 | } |
65 | checkRefundStatusResponse.setRefundStatus(refundEnum.getCode()); | 79 | checkRefundStatusResponse.setRefundStatus(refundEnum.getCode()); |
... | @@ -72,7 +86,7 @@ public class CheckRefundStatusBizServiceImpl extends AbstractBizService<CheckRef | ... | @@ -72,7 +86,7 @@ public class CheckRefundStatusBizServiceImpl extends AbstractBizService<CheckRef |
72 | } | 86 | } |
73 | } | 87 | } |
74 | //2.查询换货表有没有记录 | 88 | //2.查询换货表有没有记录 |
75 | List<MemberProductExchange> memberProductExchangeList = pineappleDao.getMemberProductExchangeByOrderSn(callRequest.getBizModel().getOrderID()); | 89 | List<MemberProductExchange> memberProductExchangeList = memberReadDao.getMemberProductExchangeByOrderSn(callRequest.getBizModel().getOrderID()); |
76 | if(!StringUtil.isNull(memberProductExchangeList) && !memberProductExchangeList.isEmpty()){ | 90 | if(!StringUtil.isNull(memberProductExchangeList) && !memberProductExchangeList.isEmpty()){ |
77 | MemberProductExchange memberProductExchange = memberProductExchangeList.stream().findFirst().get(); | 91 | MemberProductExchange memberProductExchange = memberProductExchangeList.stream().findFirst().get(); |
78 | if(!StringUtil.isNull(memberProductExchange)){ | 92 | if(!StringUtil.isNull(memberProductExchange)){ |
... | @@ -88,7 +102,7 @@ public class CheckRefundStatusBizServiceImpl extends AbstractBizService<CheckRef | ... | @@ -88,7 +102,7 @@ public class CheckRefundStatusBizServiceImpl extends AbstractBizService<CheckRef |
88 | 102 | ||
89 | } | 103 | } |
90 | //3.如果都没有记录需要查询seller_complaint(投诉表),根据order_id订单id查询 | 104 | //3.如果都没有记录需要查询seller_complaint(投诉表),根据order_id订单id查询 |
91 | List<SellerComplaint> sellerComplaintList = pineappleDao.getSellerComplaintByOrderId(orders.getId()); | 105 | List<SellerComplaint> sellerComplaintList = memberReadDao.getSellerComplaintById(orders.getId()); |
92 | if(!StringUtil.isNull(sellerComplaintList) && !sellerComplaintList.isEmpty()){ | 106 | if(!StringUtil.isNull(sellerComplaintList) && !sellerComplaintList.isEmpty()){ |
93 | checkRefundStatusResponse.setRefundStatus(PineappleRefundEnum.JH_99.getCode()); | 107 | checkRefundStatusResponse.setRefundStatus(PineappleRefundEnum.JH_99.getCode()); |
94 | checkRefundStatusResponse.setSubmessage(PineappleRefundEnum.JH_99.getMsg()); | 108 | checkRefundStatusResponse.setSubmessage(PineappleRefundEnum.JH_99.getMsg()); | ... | ... |
-
请 注册 或 登录 后发表评论