liyong
5 天以前 1c518e10a50050d383e714b581c94dea58ec4d67
src/main/java/com/ruoyi/approve/service/impl/FinReimbursementServiceImpl.java
@@ -199,7 +199,7 @@
            }
        }
        resetApprovalFlow(existing.getApprovalInstanceId(), reimbursementId);
        resetApprovalFlow(existing, reimbursementId);
        if (BILL_STATUS_IN_APPROVAL.equals(billStatus)) {
            reimbursement.setApprovalInstanceId(null);
            startApproval(reimbursement, finReimbursementDto);
@@ -498,11 +498,18 @@
        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;
        }
        approvalInstanceService.delete(Collections.singletonList(approvalInstanceId));
        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()