|
@@ -727,35 +727,31 @@ public class UserOrderServiceImpl extends ServiceImpl<UserOrderDao, UserOrder> i
|
|
|
detail.setUpdateTime(now);
|
|
|
updateById(detail);
|
|
|
|
|
|
- try {
|
|
|
- if (null != data) {
|
|
|
- //更新付款单
|
|
|
- UserOrderPayment orderPayment = orderPaymentService
|
|
|
- .detailByTransNoOrPaymentNo(data.getId(), data.getPaymentNo());
|
|
|
- if (null != orderPayment) {
|
|
|
- orderPayment.setTransNo(data.getId());
|
|
|
- orderPayment.setStatus(TradeStatusEnum.succeeded);
|
|
|
- orderPayment.setArrivalTime(now);
|
|
|
- orderPayment.setUpdateTime(now);
|
|
|
-
|
|
|
- if (null != data.getExecutePaymentCallBack()) {
|
|
|
- orderPayment.setBackPayAmt(
|
|
|
- new BigDecimal(data.getExecutePaymentCallBack().getPayAmt()));
|
|
|
-
|
|
|
- BigDecimal feeAmt = new BigDecimal(data.getExecutePaymentCallBack().getFeeAmt());
|
|
|
- if (BigDecimal.ZERO.compareTo(feeAmt) == 0) {
|
|
|
- orderPayment.setFeeAmt(orderPayment.getPayAmt().subtract(orderPayment.getBackPayAmt()));
|
|
|
- } else {
|
|
|
- orderPayment.setFeeAmt(feeAmt);
|
|
|
- }
|
|
|
+ if (null != data) {
|
|
|
+ //更新付款单
|
|
|
+ UserOrderPayment orderPayment = orderPaymentService
|
|
|
+ .detailByTransNoOrPaymentNo(data.getId(), data.getPaymentNo());
|
|
|
+ if (null != orderPayment) {
|
|
|
+ orderPayment.setTransNo(data.getId());
|
|
|
+ orderPayment.setStatus(TradeStatusEnum.succeeded);
|
|
|
+ orderPayment.setArrivalTime(now);
|
|
|
+ orderPayment.setUpdateTime(now);
|
|
|
+
|
|
|
+ if (null != data.getExecutePaymentCallBack()) {
|
|
|
+ orderPayment.setBackPayAmt(
|
|
|
+ new BigDecimal(data.getExecutePaymentCallBack().getPayAmt()));
|
|
|
+
|
|
|
+ BigDecimal feeAmt = new BigDecimal(data.getExecutePaymentCallBack().getFeeAmt());
|
|
|
+ if (BigDecimal.ZERO.compareTo(feeAmt) == 0) {
|
|
|
+ orderPayment.setFeeAmt(orderPayment.getPayAmt().subtract(orderPayment.getBackPayAmt()));
|
|
|
+ } else {
|
|
|
+ orderPayment.setFeeAmt(feeAmt);
|
|
|
}
|
|
|
- orderPaymentService.updateById(orderPayment);
|
|
|
}
|
|
|
+ orderPaymentService.updateById(orderPayment);
|
|
|
}
|
|
|
- } catch (Exception e) {
|
|
|
- log.error("订单完成-更新付款单失败, UserOrderVo is {},PaymentCallBack is {}", JSONObject.toJSONString(detail), JSONObject.toJSONString(data));
|
|
|
- e.printStackTrace();
|
|
|
}
|
|
|
+
|
|
|
//调用业务
|
|
|
List<UserOrderDetailVo> orderDetailList = orderDetailService.getOrderDetilListByOrderNo(detail.getOrderNo());
|
|
|
|
|
@@ -789,7 +785,8 @@ public class UserOrderServiceImpl extends ServiceImpl<UserOrderDao, UserOrder> i
|
|
|
*
|
|
|
* @param orderDetailVo
|
|
|
*/
|
|
|
- private void savePlatformAccountRecord(UserOrderDetailVo orderDetailVo) {
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
+ public void savePlatformAccountRecord(UserOrderDetailVo orderDetailVo) {
|
|
|
BigDecimal expectPrice = orderDetailVo.getExpectPrice();
|
|
|
if (expectPrice.compareTo(BigDecimal.ZERO) <= 0) {
|
|
|
return;
|