Commit 6b8728b9 by xiaoer.li@freemud.com

增加超时退款渠道

parent 3ceb92d4
......@@ -31,6 +31,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.util.Arrays;
import java.util.Map;
/**
......@@ -86,7 +87,8 @@ public class OrderAdapterServiceImpl implements OrderAdapterService {
private OrderCommonService orderCommonService;
@Autowired
private SellCouponOrderServiceImpl sellCouponOrderService;
@Value("${saas.autoRefund.client}")
private String autoRefundClient;
@Override
public BaseResponse createOrderNew(CreateOrderVo createOrderVo) {
AssortmentCustomerInfoVo assortmentCustomerInfoVo = assortmentCustomerInfoManager.getCustomerInfoByObject(createOrderVo.getSessionId());
......@@ -236,8 +238,9 @@ public class OrderAdapterServiceImpl implements OrderAdapterService {
if (!PayStatus.NOT_PAY.getCode().equals(orderBean.getPayStatus())){
return orderAdapter.sendPaySuccessNoticeMessage();
}
Integer client = OrderSourceType.getClientByCode(orderBean.getSource());
//若是app订单超时回调了 订单已取消则做退款处理
if (OrderStatus.CALCEL.getCode().equals(orderBean.getStatus()) && OrderSourceType.SAAS.getCode().equals(orderBean.getSource())) {
if (OrderStatus.CALCEL.getCode().equals(orderBean.getStatus()) && Arrays.asList(autoRefundClient.split(",")).contains(client)) {
orderService.timeOutRefund(orderBean);
return orderAdapter.sendPaySuccessNoticeMessage();
}
......
......@@ -3524,13 +3524,15 @@ public class OrderServiceImpl implements Orderservice {
//调用支付退款
log.info("payment timeout callback for refund orderDto={}",JSON.toJSONString(orderBean));
Integer abState = 4;
if (abState.equals(orderBean.getAbnormalState())) {
if (abState.equals(orderBean.getAbnormalState()) || CollectionUtils.isNotEmpty(orderBean.getRefundList())) {
log.info("payment timeout callback for refund is exist");
return;
}
com.freemud.application.sdk.api.base.BaseResponse<OrderRefundResponse> response = null;
Long refundId = System.currentTimeMillis();
OrderExtInfoDto orderExtInfoDTO = gson.fromJson(orderBean.getExtInfo(), OrderExtInfoDto.class);
if (orderExtInfoDTO==null || StringUtils.isBlank(orderExtInfoDTO.getFmId())) {
log.info("payment timeout callback for refund not create pre order");
return;
}
Integer state = PayRefundStatus.SUCCESS.getCode();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment