改支付状态 如果是已支付改退款中 如果是未支付改为取消
This commit is contained in:
parent
e2dfdd057e
commit
0a82851e2c
|
|
@ -315,7 +315,7 @@ public class OrderDetailServiceImpl implements OrderDetailService {
|
||||||
if (BigDecimal.ZERO.compareTo(detailMoney) > -1) {
|
if (BigDecimal.ZERO.compareTo(detailMoney) > -1) {
|
||||||
logger.info("子订单[{}]不需要退款 payMoney={}元", orderDetail.getId(), detailMoney);
|
logger.info("子订单[{}]不需要退款 payMoney={}元", orderDetail.getId(), detailMoney);
|
||||||
// 更新子财务单金额和状态
|
// 更新子财务单金额和状态
|
||||||
financialDetail.setPayStatus(PayStatus.REFUND.getCode());
|
financialDetail.setPayStatus(paid ? PayStatus.REFUND.getCode() : PayStatus.CANCEL.getCode());
|
||||||
financialDetail.setPayMoney(detailMoney);
|
financialDetail.setPayMoney(detailMoney);
|
||||||
financialDetailService.updateFinancialDetail(financialDetail);
|
financialDetailService.updateFinancialDetail(financialDetail);
|
||||||
|
|
||||||
|
|
@ -325,9 +325,9 @@ public class OrderDetailServiceImpl implements OrderDetailService {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 更新子财务单金额和状态
|
// 更新子财务单金额和状态 如果是已支付改退款中 如果是未支付改为取消
|
||||||
financialDetail.setPayMoney(detailMoney);
|
financialDetail.setPayMoney(detailMoney);
|
||||||
financialDetail.setPayStatus(PayStatus.REFUNDING.getCode());
|
financialDetail.setPayStatus(paid ? PayStatus.REVERSING.getCode() : PayStatus.CANCEL.getCode());
|
||||||
financialDetailService.updateFinancialDetail(financialDetail);
|
financialDetailService.updateFinancialDetail(financialDetail);
|
||||||
|
|
||||||
// 更新主财务单金额
|
// 更新主财务单金额
|
||||||
|
|
|
||||||
|
|
@ -376,12 +376,12 @@ public class OrderMasterServiceImpl implements OrderMasterService {
|
||||||
boolean paid = PayStatus.PAID.getCode().equals(financialMaster.getPayStatus()) ||
|
boolean paid = PayStatus.PAID.getCode().equals(financialMaster.getPayStatus()) ||
|
||||||
PayStatus.PAYED_ADD.getCode().equals(financialMaster.getPayStatus());
|
PayStatus.PAYED_ADD.getCode().equals(financialMaster.getPayStatus());
|
||||||
|
|
||||||
// 改主订单的支付状态
|
// 改支付状态 如果是已支付改退款中 如果是未支付改为取消
|
||||||
updatePayStatus(orderMasterId, PayStatus.REFUND.getCode());
|
updatePayStatus(orderMasterId, paid ? PayStatus.REVERSING.getCode() : PayStatus.CANCEL.getCode());
|
||||||
// 改子订单的支付状态
|
// 改子订单的支付状态
|
||||||
OrderDetail odUpdate = new OrderDetail();
|
OrderDetail odUpdate = new OrderDetail();
|
||||||
odUpdate.setOrderMasterId(orderMasterId);
|
odUpdate.setOrderMasterId(orderMasterId);
|
||||||
odUpdate.setPayStatus(PayStatus.REFUND.getCode());
|
odUpdate.setPayStatus(paid ? PayStatus.REVERSING.getCode() : PayStatus.CANCEL.getCode());
|
||||||
orderDetailService.updateByOrderMasterId(odUpdate);
|
orderDetailService.updateByOrderMasterId(odUpdate);
|
||||||
|
|
||||||
// 主订单金额=订单原价+加价
|
// 主订单金额=订单原价+加价
|
||||||
|
|
@ -395,12 +395,12 @@ public class OrderMasterServiceImpl implements OrderMasterService {
|
||||||
}
|
}
|
||||||
|
|
||||||
// 修改主财务单状态
|
// 修改主财务单状态
|
||||||
financialMasterService.updatePayStatus(financialMaster.getId(), PayStatus.REVERSING.getCode());
|
financialMasterService.updatePayStatus(financialMaster.getId(), paid ? PayStatus.REVERSING.getCode() : PayStatus.CANCEL.getCode());
|
||||||
// 修改子财务单状态
|
// 修改子财务单状态
|
||||||
List<FinancialDetail> fdList = financialDetailService.selectByFinancialMasterId(financialMaster.getId());
|
List<FinancialDetail> fdList = financialDetailService.selectByFinancialMasterId(financialMaster.getId());
|
||||||
for (FinancialDetail fd : fdList) {
|
for (FinancialDetail fd : fdList) {
|
||||||
if (PayStatus.PAID.getCode().equals(fd.getPayStatus())) {
|
if (PayStatus.PAID.getCode().equals(fd.getPayStatus())) {
|
||||||
financialDetailService.updatePayStatus(fd.getId(), PayStatus.REFUND.getCode());
|
financialDetailService.updatePayStatus(fd.getId(), paid ? PayStatus.REVERSING.getCode() : PayStatus.CANCEL.getCode());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue