diff --git a/src/main/java/com/biutag/supervision/pojo/request/warning/WarningEndRequest.java b/src/main/java/com/biutag/supervision/pojo/request/warning/WarningEndRequest.java index afe594a..c7aa3a3 100644 --- a/src/main/java/com/biutag/supervision/pojo/request/warning/WarningEndRequest.java +++ b/src/main/java/com/biutag/supervision/pojo/request/warning/WarningEndRequest.java @@ -36,8 +36,8 @@ public class WarningEndRequest implements ParamChecked { throw new IllegalArgumentException("项目id不能为空"); } - if (StrUtil.isBlank(flowId)){ - throw new IllegalArgumentException("flowid不能为空"); - } +// if (StrUtil.isBlank(flowId)){ +// throw new IllegalArgumentException("flowid不能为空"); +// } } } diff --git a/src/main/java/com/biutag/supervision/service/Report/ReportFlowService.java b/src/main/java/com/biutag/supervision/service/Report/ReportFlowService.java index 240445b..5498c45 100644 --- a/src/main/java/com/biutag/supervision/service/Report/ReportFlowService.java +++ b/src/main/java/com/biutag/supervision/service/Report/ReportFlowService.java @@ -490,13 +490,18 @@ public class ReportFlowService extends ServiceImpl UserAuth currentUser = UserContextHolder.getCurrentUser(); - LambdaUpdateWrapper reportFlowLambdaQueryWrapper = new LambdaUpdateWrapper<>(); - reportFlowLambdaQueryWrapper.eq(ReportFlow::getId,queryParam.getFlowId()); - reportFlowLambdaQueryWrapper.set(ReportFlow::getApproverState, "end"); - reportFlowLambdaQueryWrapper.set(ReportFlow::getApprover, currentUser.getUserName()); - reportFlowLambdaQueryWrapper.set(ReportFlow::getApproverUnit, currentUser.getDepartName()); - reportFlowLambdaQueryWrapper.set(ReportFlow::getApproverUnitId, currentUser.getDepartId()); - int update = baseMapper.update(reportFlowLambdaQueryWrapper); + if (StrUtil.isNotBlank(queryParam.getFlowId())){ + LambdaUpdateWrapper reportFlowLambdaQueryWrapper = new LambdaUpdateWrapper<>(); + reportFlowLambdaQueryWrapper.eq(ReportFlow::getId,queryParam.getFlowId()); + reportFlowLambdaQueryWrapper.set(ReportFlow::getApproverState, "end"); + reportFlowLambdaQueryWrapper.set(ReportFlow::getApprover, currentUser.getUserName()); + reportFlowLambdaQueryWrapper.set(ReportFlow::getApproverUnit, currentUser.getDepartName()); + reportFlowLambdaQueryWrapper.set(ReportFlow::getApproverUnitId, currentUser.getDepartId()); + int update = baseMapper.update(reportFlowLambdaQueryWrapper); + if (update > 1) { + throw new RuntimeException("多条流程记录被找到,请联系后台人员"); + } + } // 留痕:写一条结束记录 ReportFlow endFlow = new ReportFlow(); @@ -516,6 +521,6 @@ public class ReportFlowService extends ServiceImpl // endFlow.setType("end"); boolean ok2 = baseMapper.insert(endFlow) > 0; - return Result.success(ok1 && ok2 && update==1); + return Result.success(ok1 && ok2); } }