10 小时以前 3d2fd3a3f7d0571721b0f894e07c80553fd1e26c
src/main/java/com/ruoyi/approve/service/impl/FinReimbursementServiceImpl.java
@@ -274,6 +274,26 @@
    @Override
    @Transactional(rollbackFor = Exception.class)
    public Boolean delete(List<Long> ids) {
        if (ids == null || ids.isEmpty()) {
            throw new ServiceException("删除失败,请选择要删除的数据");
        }
        // 查询报销单关联的审批实例ID
        List<FinReimbursement> reimbursements = finReimbursementMapper.selectList(
                new LambdaQueryWrapper<FinReimbursement>()
                        .in(FinReimbursement::getId, ids)
                        .isNotNull(FinReimbursement::getApprovalInstanceId)
        );
        List<Long> approvalInstanceIds = reimbursements.stream()
                .map(FinReimbursement::getApprovalInstanceId)
                .filter(Objects::nonNull)
                .distinct()
                .collect(Collectors.toList());
        // 删除关联的审批记录
        if (!approvalInstanceIds.isEmpty()) {
            approvalInstanceService.delete(approvalInstanceIds);
        }
        fileUtil.deleteStorageAttachmentsByApplicationAndRecordTypeAndRecordIds(ApplicationTypeEnum.FILE, RecordTypeEnum.FIN_REIMBURSEMENT, ids);
        //先删除明细
        finReimbursementDetailMapper.delete(new LambdaQueryWrapper<FinReimbursementDetail>().in(FinReimbursementDetail::getReimbursementId, ids));
@@ -494,10 +514,20 @@
        }
        String title = "报销审批";
        String message = "审批单号 " + instance.getInstanceNo() + " 需要您审批";
        String jumpPath = "/approvalInstance?id=" + instance.getId();
        String jumpPath = getJumpPathByBusinessType(instance.getBusinessType(), instance.getId());
        sysNoticeService.simpleNoticeByUser(title, message, approverIds, jumpPath);
    }
    private String getJumpPathByBusinessType(Long businessType, Long instanceId) {
        if (TypeEnums.TRAVEL_REIMBURSEMENT_APPROVAL.getCode().equals(businessType)) {
            return "/collaborativeApproval/ReimburseManage/travel-reimburse?id=" + instanceId;
        }
        if (TypeEnums.EXPENSE_APPROVAL.getCode().equals(businessType)) {
            return "/collaborativeApproval/ReimburseManage/cost-reimburse?id=" + instanceId;
        }
        return "/approvalInstance?id=" + instanceId;
    }
    private void resetApprovalFlow(FinReimbursement existing, Long reimbursementId) {
        if (existing == null || existing.getApprovalInstanceId() == null) {
            return;