94a3112d 刘嘉

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

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