|
|
@@ -49,12 +49,22 @@ public class MissionController { |
|
|
|
|
|
|
|
private void checkAddInfo(MissionRequest request) throws ServiceException { |
|
|
|
//判断任务名称不能重复 |
|
|
|
LambdaQueryWrapper<ThMission> lambdaQueryWrapper= new LambdaQueryWrapper<>(); |
|
|
|
lambdaQueryWrapper.eq(ThMission::getName, request.getName()); |
|
|
|
lambdaQueryWrapper.eq(ThMission::getTenantId, ShiroUtils.getTenantId()); |
|
|
|
List<ThMission> missionList = missionService.getList(lambdaQueryWrapper); |
|
|
|
LambdaQueryWrapper<ThMission> lambdaQueryCheckRepartWrapper= new LambdaQueryWrapper<>(); |
|
|
|
lambdaQueryCheckRepartWrapper.eq(ThMission::getName, request.getName()); |
|
|
|
lambdaQueryCheckRepartWrapper.eq(ThMission::getTenantId, ShiroUtils.getTenantId()); |
|
|
|
List<ThMission> missionList = missionService.getList(lambdaQueryCheckRepartWrapper); |
|
|
|
if(!ObjectUtils.isEmpty(missionList) || missionList.size() >0 ){ |
|
|
|
throw new ServiceException(HttpStatus.SC_BAD_REQUEST,"任务名称不能重复"); |
|
|
|
throw new ServiceException(HttpStatus.SC_BAD_REQUEST,"任务名称不能重复!"); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
LambdaQueryWrapper<ThMission> lambdaQueryTimeWrapper= new LambdaQueryWrapper<>(); |
|
|
|
lambdaQueryTimeWrapper.eq(ThMission::getInspectionLine, request.getInspectionLine()); |
|
|
|
lambdaQueryTimeWrapper.eq(ThMission::getExecutionStartTime, request.getExecutionStartTime()); |
|
|
|
lambdaQueryTimeWrapper.eq(ThMission::getTenantId, ShiroUtils.getTenantId()); |
|
|
|
List<ThMission> missionListTime = missionService.getList(lambdaQueryTimeWrapper); |
|
|
|
if(!ObjectUtils.isEmpty(missionListTime) || missionListTime.size() >0 ){ |
|
|
|
throw new ServiceException(HttpStatus.SC_BAD_REQUEST,"同一个航线已存在相同的巡检时间!"); |
|
|
|
} |
|
|
|
|
|
|
|
if(request.getName().length()>100){ |