Переглянути джерело

同一个航线已存在相同的巡检时间

tags/v1.1.0
qiujinyang 2 роки тому
джерело
коміт
503b765ce4
2 змінених файлів з 9 додано та 3 видалено
  1. +8
    -2
      tuoheng-admin/src/main/java/com/tuoheng/admin/controller/MissionController.java
  2. +1
    -1
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/ThInspectionServiceImpl.java

+ 8
- 2
tuoheng-admin/src/main/java/com/tuoheng/admin/controller/MissionController.java Переглянути файл

@@ -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,"同一个航线已存在相同的巡检时间!");

+ 1
- 1
tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/ThInspectionServiceImpl.java Переглянути файл

@@ -159,7 +159,7 @@ public class ThInspectionServiceImpl extends BaseServiceImpl<ThInspectionMapper,
missionStatusRequest.setId(thMission.getInspectionLine());
missionStatusRequest.setPushUrl(pushAndPull.getPushUrl());
missionStatusRequest.setPullUrl(pushAndPull.getPullUrl());
missionStatusRequest.setStatus(1);
missionStatusRequest.setStatus(2);
//修改任务状态,任务开始飞行
boolean b = missionService.updateStatus(missionStatusRequest);
return JsonResult.success(thMission.getInspectionLine());

Завантаження…
Відмінити
Зберегти