|
@@ -16,6 +16,7 @@ import com.fjhx.account.service.account.AccountPaymentService;
|
|
|
import com.fjhx.account.service.account.AccountRequestFundsDetailService;
|
|
|
import com.fjhx.account.service.account.AccountRequestFundsService;
|
|
|
import com.fjhx.common.constant.SourceConstant;
|
|
|
+import com.fjhx.common.utils.Assert;
|
|
|
import com.fjhx.file.utils.ObsFileUtil;
|
|
|
import com.fjhx.flow.core.FlowDelegate;
|
|
|
import com.obs.services.internal.ServiceException;
|
|
@@ -91,6 +92,15 @@ public class AccountRequestFundsFlow extends FlowDelegate {
|
|
|
}
|
|
|
//修改申购状态为审批通过
|
|
|
accountRequestFunds.setStatus(AccountRequestFundsStatusEnum.PASS.getKey());
|
|
|
+ //修改核销状态以及预支单核销状态为已核销
|
|
|
+ if ("3".equals(accountRequestFundsDto.getType())) {
|
|
|
+ accountRequestFunds.setWriteOffStatus(1);
|
|
|
+ //修改预支单核销状态
|
|
|
+ AccountRequestFunds advance = accountRequestFundsService.getById(accountRequestFunds.getAdvanceId());
|
|
|
+ Assert.notEmpty(advance,"查询不到关联预支单信息");
|
|
|
+ advance.setWriteOffStatus(1);
|
|
|
+ accountRequestFundsService.updateById(advance);
|
|
|
+ }
|
|
|
accountRequestFundsService.updateById(accountRequestFunds);
|
|
|
//添加打款的数据
|
|
|
addPayment(accountRequestFundsDto);
|
|
@@ -122,7 +132,7 @@ public class AccountRequestFundsFlow extends FlowDelegate {
|
|
|
|
|
|
//如果是核销 核销数据审批通过后,根据“核销总额 - 预支总额”生成“待打款”数据
|
|
|
if ("3".equals(accountRequestFundsDto.getType())) {
|
|
|
- BigDecimal subtract = accountRequestFundsDto.getWriteOffAmount().subtract(accountRequestFundsDto.getAdvanceAmount());
|
|
|
+ BigDecimal subtract = accountRequestFundsDto.getTotal().subtract(accountRequestFundsDto.getAdvanceAmounts());
|
|
|
accountPayment.setAmount(subtract);
|
|
|
}
|
|
|
|