|
@@ -7,9 +7,7 @@ import com.yonge.cooleshow.auth.api.entity.SysUser;
|
|
|
import com.yonge.cooleshow.biz.dal.dto.req.OrderPayReq;
|
|
|
import com.yonge.cooleshow.biz.dal.enums.ClientEnum;
|
|
|
import com.yonge.cooleshow.biz.dal.enums.OrderStatusEnum;
|
|
|
-import com.yonge.cooleshow.biz.dal.service.SysUserContractRecordService;
|
|
|
-import com.yonge.cooleshow.biz.dal.service.SysUserService;
|
|
|
-import com.yonge.cooleshow.biz.dal.service.UserOrderService;
|
|
|
+import com.yonge.cooleshow.biz.dal.service.*;
|
|
|
import com.yonge.cooleshow.biz.dal.vo.UserOrderDetailVo;
|
|
|
import com.yonge.cooleshow.biz.dal.vo.UserOrderVo;
|
|
|
import com.yonge.cooleshow.biz.dal.vo.res.OrderPayRes;
|
|
@@ -34,7 +32,6 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import com.yonge.cooleshow.biz.dal.entity.UserOrderPayment;
|
|
|
import com.yonge.cooleshow.biz.dal.dao.UserOrderPaymentDao;
|
|
|
-import com.yonge.cooleshow.biz.dal.service.UserOrderPaymentService;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import java.math.BigDecimal;
|
|
@@ -62,6 +59,8 @@ public class UserOrderPaymentServiceImpl extends ServiceImpl<UserOrderPaymentDao
|
|
|
private SysUserContractRecordService sysUserContractRecordService;
|
|
|
@Autowired
|
|
|
private SysUserService userService;
|
|
|
+ @Autowired
|
|
|
+ private UserOrderRefundService orderRefundService;
|
|
|
|
|
|
@Override
|
|
|
public UserOrderPayment detailByOrderNo(String orderNo, PayChannelEnum payChannel, TradeStatusEnum status) {
|
|
@@ -127,11 +126,7 @@ public class UserOrderPaymentServiceImpl extends ServiceImpl<UserOrderPaymentDao
|
|
|
}
|
|
|
}
|
|
|
updateById(orderPayment);
|
|
|
- if (TradeStatusEnum.succeeded.equals(orderPayment.getCloseStatus())) {
|
|
|
- return true;
|
|
|
- } else {
|
|
|
- return false;
|
|
|
- }
|
|
|
+ return true;
|
|
|
}
|
|
|
|
|
|
|
|
@@ -273,6 +268,9 @@ public class UserOrderPaymentServiceImpl extends ServiceImpl<UserOrderPaymentDao
|
|
|
}
|
|
|
if (detail.getStatus().equals(OrderStatusEnum.WAIT_PAY) || detail.getStatus().equals(OrderStatusEnum.PAYING)) {
|
|
|
userOrderService.orderSuccess(detail, data);
|
|
|
+ } else if (!detail.getStatus().equals(OrderStatusEnum.PAID)) {
|
|
|
+ //原路退还
|
|
|
+ orderRefundService.orderFailRefund(data, detail.getOrderNo(), "订单已超时,金额原路退回");
|
|
|
}
|
|
|
|
|
|
//处理支付完成签署协议
|
|
@@ -309,7 +307,7 @@ public class UserOrderPaymentServiceImpl extends ServiceImpl<UserOrderPaymentDao
|
|
|
if (detail.getStatus().equals(OrderStatusEnum.WAIT_PAY) || detail.getStatus().equals(OrderStatusEnum.PAYING)) {
|
|
|
userOrderService.doOrderCancel(detail, OrderStatusEnum.FAIL, "支付回调失败:" + errMsg);
|
|
|
//关闭付款单
|
|
|
- onlyClosePayment(detail.getOrderNo(), "支付回调失败:" + errMsg);
|
|
|
+ closePaymentAndReqOpen(detail.getOrderNo(), "支付回调失败:" + errMsg);
|
|
|
}
|
|
|
}
|
|
|
|