|
@@ -192,29 +192,31 @@ public class WorkNodeProcessable {
|
|
|
.eq(BaseEntity::getDeleted, false)
|
|
|
.eq(OrderFund::getBusinessType, productionReturn.getBusinessType())
|
|
|
.eq(OrderFund::getBusinessId, productionReturn.getBusinessId()));
|
|
|
- ProductionFund productionFund = productionFundService.getOne(new LambdaQueryWrapper<ProductionFund>()
|
|
|
- .eq(BaseEntity::getDeleted, false)
|
|
|
- .eq(ProductionFund::getBusinessType, productionReturn.getBusinessType())
|
|
|
- .eq(ProductionFund::getBusinessId, productionReturn.getBusinessId())
|
|
|
- .eq(ProductionFund::getProductionNo, productionReturn.getProductionNo())
|
|
|
- .eq(ProductionFund::getProductionType, productionReturn.getProductionType())
|
|
|
- .eq(ProductionFund::getOrderFundId, orderFund.getId()));
|
|
|
// 新增罚款后退款记录
|
|
|
- FinanceFine financeFine = financeFineService.getFineByFundInfo(orderFund.getId(), productionFund.getId() != null ? productionFund.getId() : null);
|
|
|
- // 判断罚款记录是否为空,为空说明没有已确认的罚款,不新增罚款退款记录
|
|
|
- if (ObjectUtil.isNotNull(financeFine)) {
|
|
|
- FinanceFineRefund financeFineRefund = FinanceFineRefund
|
|
|
- .builder()
|
|
|
- .fineId(financeFine.getId())
|
|
|
- .refundAmount(financeFine.getRealFineAmount())
|
|
|
- .status(NOT_RETURNED.getCode())
|
|
|
- .build();
|
|
|
- if (productionReturn.getReturnInvoice()) {
|
|
|
- financeFineRefund.setRefundReason(RETURN_PRODUCTION_INVOICE.getCode());
|
|
|
- } else {
|
|
|
- financeFineRefund.setRefundReason(RETURN_PRODUCTION.getCode());
|
|
|
+ if(ObjectUtil.isNotNull(orderFund)) { // 判断有没有订单收款信息
|
|
|
+ ProductionFund productionFund = productionFundService.getOne(new LambdaQueryWrapper<ProductionFund>()
|
|
|
+ .eq(BaseEntity::getDeleted, false)
|
|
|
+ .eq(ProductionFund::getBusinessType, productionReturn.getBusinessType())
|
|
|
+ .eq(ProductionFund::getBusinessId, productionReturn.getBusinessId())
|
|
|
+ .eq(ProductionFund::getProductionNo, productionReturn.getProductionNo())
|
|
|
+ .eq(ProductionFund::getProductionType, productionReturn.getProductionType())
|
|
|
+ .eq(ProductionFund::getOrderFundId, orderFund.getId()));
|
|
|
+ FinanceFine financeFine = financeFineService.getFineByFundInfo(orderFund.getId(), productionFund != null ? productionFund.getId() : null);
|
|
|
+ // 判断罚款记录是否为空,为空说明没有已确认的罚款,不新增罚款退款记录
|
|
|
+ if (ObjectUtil.isNotNull(financeFine)) {
|
|
|
+ FinanceFineRefund financeFineRefund = FinanceFineRefund
|
|
|
+ .builder()
|
|
|
+ .fineId(financeFine.getId())
|
|
|
+ .refundAmount(financeFine.getRealFineAmount())
|
|
|
+ .status(NOT_RETURNED.getCode())
|
|
|
+ .build();
|
|
|
+ if (productionReturn.getReturnInvoice()) {
|
|
|
+ financeFineRefund.setRefundReason(RETURN_PRODUCTION_INVOICE.getCode());
|
|
|
+ } else {
|
|
|
+ financeFineRefund.setRefundReason(RETURN_PRODUCTION.getCode());
|
|
|
+ }
|
|
|
+ financeFineRefundService.saveIfNotExists(financeFineRefund);
|
|
|
}
|
|
|
- financeFineRefundService.saveIfNotExists(financeFineRefund);
|
|
|
}
|
|
|
break;
|
|
|
}
|