|
|
@ -18,12 +18,15 @@ import org.nl.acs.limit_regional.server.LimitRegionalService; |
|
|
|
import org.nl.acs.limit_regional.server.dto.LimitRegionalDto; |
|
|
|
import org.nl.acs.opc.DeviceAppService; |
|
|
|
import org.nl.acs.opc.DeviceAppServiceImpl; |
|
|
|
import org.nl.acs.point.domain.AcsPoint; |
|
|
|
import org.nl.acs.point.service.IAcsPointService; |
|
|
|
import org.nl.acs.route.service.RouteLineService; |
|
|
|
import org.nl.acs.route.service.dto.RouteLineDto; |
|
|
|
import org.nl.acs.task.enums.TaskStatusEnum; |
|
|
|
import org.nl.acs.task.enums.TaskTypeEnum; |
|
|
|
import org.nl.acs.task.service.TaskService; |
|
|
|
import org.nl.acs.task.service.dto.TaskDto; |
|
|
|
import org.nl.common.exception.BadRequestException; |
|
|
|
import org.nl.common.utils.SecurityUtils; |
|
|
|
import org.nl.config.SpringContextHolder; |
|
|
|
import org.nl.config.lucene.service.LuceneExecuteLogService; |
|
|
@ -51,6 +54,7 @@ public class AutoCreateInst { |
|
|
|
InstructionService instructionService = SpringContextHolder.getBean(InstructionService.class); |
|
|
|
RouteLineService routeLineService = SpringContextHolder.getBean(RouteLineService.class); |
|
|
|
DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class); |
|
|
|
IAcsPointService acsPointService = SpringContextHolder.getBean(IAcsPointService.class); |
|
|
|
LuceneExecuteLogService luceneExecuteLogService = SpringContextHolder.getBean(LuceneExecuteLogServiceImpl.class); |
|
|
|
List<TaskDto> list = taskserver.queryAllByStatus("0"); |
|
|
|
for (int i = 0; i < list.size(); i++) { |
|
|
@ -108,6 +112,55 @@ public class AutoCreateInst { |
|
|
|
if (!StrUtil.equals(shortPathsList.get(0).getType(), CommonFinalParam.ONE)) { |
|
|
|
continue; |
|
|
|
} |
|
|
|
if (acsTask.getNext_device_code().equals("QZJYTW1")){ |
|
|
|
AcsPoint startPoint = acsPointService.lambdaQuery() |
|
|
|
.eq(AcsPoint::getPoint_code, start_device_code) |
|
|
|
.one(); |
|
|
|
AcsPoint nextPoint = acsPointService.lambdaQuery() |
|
|
|
.eq(AcsPoint::getPoint_code,"QZJYTW1") |
|
|
|
.one(); |
|
|
|
if (ObjectUtil.isEmpty(nextPoint)) { |
|
|
|
log.error("终点设备不存在"); |
|
|
|
continue; |
|
|
|
} |
|
|
|
if (!nextPoint.getIs_used().booleanValue() || nextPoint.getPoint_status().equals(CommonFinalParam.ONE)) { |
|
|
|
log.error("下发任务失败的原因是:终点点位被禁用或者终点点位有货,请检查起点点位"+nextPoint.getPoint_code()+"的状态!"); |
|
|
|
continue; |
|
|
|
} |
|
|
|
if (ObjectUtil.isEmpty(startPoint)) { |
|
|
|
log.error("起点设备不存在"); |
|
|
|
continue; |
|
|
|
} |
|
|
|
if (!startPoint.getIs_used().booleanValue() || startPoint.getPoint_status().equals(CommonFinalParam.ZERO)) { |
|
|
|
log.error("下发任务失败的原因是:起点点位被禁用或者起点点位无货,请检查起点点位"+startPoint.getPoint_code()+"的状态!"); |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (acsTask.getStart_device_code().equals("QZJYTW2")) { |
|
|
|
AcsPoint startPoint = acsPointService.lambdaQuery() |
|
|
|
.eq(AcsPoint::getPoint_code, "QZJYTW2") |
|
|
|
.one(); |
|
|
|
AcsPoint nextPoint = acsPointService.lambdaQuery() |
|
|
|
.eq(AcsPoint::getPoint_code, acsTask.getNext_device_code()) |
|
|
|
.one(); |
|
|
|
if (ObjectUtil.isEmpty(nextPoint)) { |
|
|
|
log.error("终点设备不存在"); |
|
|
|
continue; |
|
|
|
} |
|
|
|
if (!nextPoint.getIs_used().booleanValue() || nextPoint.getPoint_status().equals(CommonFinalParam.ONE)) { |
|
|
|
log.error("下发任务失败的原因是:终点点位被禁用或者终点点位有货,请检查起点点位" + nextPoint.getPoint_code() + "的状态!"); |
|
|
|
continue; |
|
|
|
} |
|
|
|
if (ObjectUtil.isEmpty(startPoint)) { |
|
|
|
log.error("起点设备不存在"); |
|
|
|
continue; |
|
|
|
} |
|
|
|
if (!startPoint.getIs_used().booleanValue() || startPoint.getPoint_status().equals(CommonFinalParam.ZERO)) { |
|
|
|
log.error("下发任务失败的原因是:起点点位被禁用或者起点点位无货,请检查起点点位" + startPoint.getPoint_code() + "的状态!"); |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
RouteLineDto routeLineDto = shortPathsList.get(0); |
|
|
|
String path = routeLineDto.getPath(); |
|
|
|