|
|
@@ -20,6 +20,7 @@ import org.springframework.util.ObjectUtils; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
|
|
|
|
import javax.validation.Valid; |
|
|
|
import java.util.Date; |
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
/** |
|
|
@@ -58,11 +59,16 @@ public class MissionController { |
|
|
|
throw new ServiceException(HttpStatus.SC_BAD_REQUEST,"任务名称不能重复!"); |
|
|
|
} |
|
|
|
|
|
|
|
Date executionStartTime = request.getExecutionStartTime(); |
|
|
|
long start = executionStartTime.getTime() - 500; |
|
|
|
long end = executionStartTime.getTime() + 500; |
|
|
|
Date startTime=new Date(start); |
|
|
|
Date endTime=new Date(end); |
|
|
|
|
|
|
|
LambdaQueryWrapper<ThMission> lambdaQueryTimeWrapper= new LambdaQueryWrapper<>(); |
|
|
|
lambdaQueryTimeWrapper.eq(ThMission::getInspectionLine, request.getInspectionLine()); |
|
|
|
lambdaQueryTimeWrapper.eq(ThMission::getExecutionStartTime, request.getExecutionStartTime()); |
|
|
|
lambdaQueryTimeWrapper.eq(ThMission::getTenantId, ShiroUtils.getTenantId()); |
|
|
|
lambdaQueryTimeWrapper.between(ThMission::getExecutionStartTime, startTime,endTime); |
|
|
|
//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,"同一个航线已存在相同的巡检时间!"); |