| | |
| | | } |
| | | } |
| | | |
| | | resetApprovalFlow(existing.getApprovalInstanceId(), reimbursementId); |
| | | resetApprovalFlow(existing, reimbursementId); |
| | | if (BILL_STATUS_IN_APPROVAL.equals(billStatus)) { |
| | | reimbursement.setApprovalInstanceId(null); |
| | | startApproval(reimbursement, finReimbursementDto); |
| | |
| | | sysNoticeService.simpleNoticeByUser(title, message, approverIds, jumpPath); |
| | | } |
| | | |
| | | private void resetApprovalFlow(Long approvalInstanceId, Long reimbursementId) { |
| | | if (approvalInstanceId == null) { |
| | | private void resetApprovalFlow(FinReimbursement existing, Long reimbursementId) { |
| | | if (existing == null || existing.getApprovalInstanceId() == null) { |
| | | return; |
| | | } |
| | | Long approvalInstanceId = existing.getApprovalInstanceId(); |
| | | if (!"REJECTED".equals(existing.getBillStatus())) { |
| | | approvalInstanceService.delete(Collections.singletonList(approvalInstanceId)); |
| | | } |
| | | clearApprovalBinding(reimbursementId); |
| | | } |
| | | |
| | | private void clearApprovalBinding(Long reimbursementId) { |
| | | int rows = finReimbursementMapper.update( |
| | | null, |
| | | Wrappers.<FinReimbursement>lambdaUpdate() |