From 7133ca2a00bdda835248e5268587c13665e8dabf Mon Sep 17 00:00:00 2001 From: gengby <858962040@qq.com> Date: Fri, 30 Jun 2023 14:44:20 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E6=9F=A5=E8=AF=A2=E4=BB=99?= =?UTF-8?q?=E5=B7=A5=E4=BB=BB=E5=8A=A1=E8=AE=B0=E5=BD=95=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=87=8F=E5=A4=AA=E5=A4=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../acs/agv/server/impl/AgvServiceImpl.java | 23 +++++++++---------- .../wms/service/impl/AgvToAcsServiceImpl.java | 2 +- .../quartz/task/QueryXZAgvTaskStatus.java | 13 +++-------- 3 files changed, 15 insertions(+), 23 deletions(-) diff --git a/hd/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/AgvServiceImpl.java b/hd/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/AgvServiceImpl.java index 44b9390..5737bc4 100644 --- a/hd/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/AgvServiceImpl.java +++ b/hd/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/AgvServiceImpl.java @@ -638,7 +638,7 @@ public class AgvServiceImpl implements AgvService { String agvurl = acsConfigService.findConfigFromCache().get(AcsConfig.AGVURL); String agvport = acsConfigService.findConfigFromCache().get(AcsConfig.AGVPORT); - agvurl = agvurl + ":" + agvport + "/orders?page=1&size=9999"; + agvurl = agvurl + ":" + agvport + "/orders?page=1&size=100&orderBy=createTime"; HttpResponse result = HttpRequest.get(agvurl) .timeout(20000)//超时,毫秒 @@ -659,7 +659,7 @@ public class AgvServiceImpl implements AgvService { String agvurl = acsConfigService.findConfigFromCache().get(AcsConfig.AGVURL); String agvport = acsConfigService.findConfigFromCache().get(AcsConfig.AGVPORT); - agvurl = agvurl + ":" + agvport + "/orders?page=1&size=9999"; + agvurl = agvurl + ":" + agvport + "/orders?page=1&size=100&orderBy=createTime"; HttpResponse result = HttpRequest.get(agvurl) .timeout(20000)//超时,毫秒 @@ -771,8 +771,7 @@ public class AgvServiceImpl implements AgvService { //1请求取货 2取货完成 3请求放货 4放货完成 5取货完成离开 6放货完成离开 7请求进入区域 8请求离开区域 @Override - public synchronized String process(String jobno, String type, String address, String action, String processingVehicle) - { + public synchronized String process(String jobno, String type, String address, String action, String processingVehicle) { { log.info("查询到AGV请求参数,jobno:{},address:{}", jobno + ",address:" + address + ",type:" + type + ",action:" + action); //释放AGV资源,继续后续动作 @@ -802,10 +801,10 @@ public class AgvServiceImpl implements AgvService { // if (addressdevice.getDeviceDriver() instanceof StandardManipulatorStackingSiteDeviceDriver) { standardManipulatorStackingSiteDeviceDriver = (StandardManipulatorStackingSiteDeviceDriver) addressdevice.getDeviceDriver(); - if(standardManipulatorStackingSiteDeviceDriver.getMove()==1){ + if (standardManipulatorStackingSiteDeviceDriver.getMove() == 1) { is_feedback = true; } else { - log.info("设备{} 请求取货,光电信号:{}",addressdevice,standardManipulatorStackingSiteDeviceDriver.getMove()); + log.info("设备{} 请求取货,光电信号:{}", addressdevice, standardManipulatorStackingSiteDeviceDriver.getMove()); } } if (addressdevice.getDeviceDriver() instanceof StandardStorageDeviceDriver) { @@ -815,10 +814,10 @@ public class AgvServiceImpl implements AgvService { if ("PauseOnStation".equals(type)) { if (addressdevice.getDeviceDriver() instanceof StandardManipulatorStackingSiteDeviceDriver) { standardManipulatorStackingSiteDeviceDriver = (StandardManipulatorStackingSiteDeviceDriver) addressdevice.getDeviceDriver(); - if(standardManipulatorStackingSiteDeviceDriver.getMove()==0){ + if (standardManipulatorStackingSiteDeviceDriver.getMove() == 0) { is_feedback = true; } else { - log.info("设备{} 请求离开,光电信号:{}",addressdevice,standardManipulatorStackingSiteDeviceDriver.getMove()); + log.info("设备{} 请求离开,光电信号:{}", addressdevice, standardManipulatorStackingSiteDeviceDriver.getMove()); } } if (addressdevice.getDeviceDriver() instanceof StandardStorageDeviceDriver) { @@ -832,10 +831,10 @@ public class AgvServiceImpl implements AgvService { if ("EntryRequired".equals(type)) { if (addressdevice.getDeviceDriver() instanceof StandardManipulatorStackingSiteDeviceDriver) { standardManipulatorStackingSiteDeviceDriver = (StandardManipulatorStackingSiteDeviceDriver) addressdevice.getDeviceDriver(); - if(standardManipulatorStackingSiteDeviceDriver.getMove()==0){ + if (standardManipulatorStackingSiteDeviceDriver.getMove() == 0) { is_feedback = true; } else { - log.info("设备{} 请求放货,光电信号:{}",addressdevice,standardManipulatorStackingSiteDeviceDriver.getMove()); + log.info("设备{} 请求放货,光电信号:{}", addressdevice, standardManipulatorStackingSiteDeviceDriver.getMove()); } } if (addressdevice.getDeviceDriver() instanceof StandardStorageDeviceDriver) { @@ -845,10 +844,10 @@ public class AgvServiceImpl implements AgvService { if ("PauseOnStation".equals(type)) { if (addressdevice.getDeviceDriver() instanceof StandardManipulatorStackingSiteDeviceDriver) { standardManipulatorStackingSiteDeviceDriver = (StandardManipulatorStackingSiteDeviceDriver) addressdevice.getDeviceDriver(); - if(standardManipulatorStackingSiteDeviceDriver.getMove()==1){ + if (standardManipulatorStackingSiteDeviceDriver.getMove() == 1) { is_feedback = true; } else { - log.info("设备{} 请求离开,光电信号:{}",addressdevice,standardManipulatorStackingSiteDeviceDriver.getMove()); + log.info("设备{} 请求离开,光电信号:{}", addressdevice, standardManipulatorStackingSiteDeviceDriver.getMove()); } } if (addressdevice.getDeviceDriver() instanceof StandardStorageDeviceDriver) { diff --git a/hd/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/AgvToAcsServiceImpl.java b/hd/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/AgvToAcsServiceImpl.java index 788c410..088ae32 100644 --- a/hd/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/AgvToAcsServiceImpl.java +++ b/hd/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/AgvToAcsServiceImpl.java @@ -40,7 +40,7 @@ public class AgvToAcsServiceImpl implements AgvToAcsService { //logServer.log("", "waitpointRequest", "erro", param.toString(), String.valueOf(map), "400", "api/agv/waitpointRequest", ""); throw new BadRequestException("请求失败,指令为空!"); } - log.info("任务号:{},请求成功!", inst_code); + log.info("任务号:{},AGV请求ACS接口成功!", inst_code); //logServer.log(inst_code, "waitpointRequest", "info", param.toString(), String.valueOf(map) + "请求等待点!", "200", "api/agv/waitpointRequest", ""); String task_code = instructionDto.getTask_code(); Map feedMap = new HashMap(); diff --git a/hd/nladmin-system/src/main/java/org/nl/modules/quartz/task/QueryXZAgvTaskStatus.java b/hd/nladmin-system/src/main/java/org/nl/modules/quartz/task/QueryXZAgvTaskStatus.java index b8ea35a..f701f63 100644 --- a/hd/nladmin-system/src/main/java/org/nl/modules/quartz/task/QueryXZAgvTaskStatus.java +++ b/hd/nladmin-system/src/main/java/org/nl/modules/quartz/task/QueryXZAgvTaskStatus.java @@ -1,6 +1,6 @@ package org.nl.modules.quartz.task; -import cn.hutool.core.map.MapUtil; +import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; import cn.hutool.http.HttpResponse; @@ -8,22 +8,14 @@ import lombok.extern.slf4j.Slf4j; import net.sf.json.JSONArray; import net.sf.json.JSONObject; import org.nl.acs.agv.server.AgvService; -import org.nl.acs.device.service.DeviceService; -import org.nl.acs.device.service.dto.DeviceDto; -import org.nl.acs.ext.wms.service.AcsToWmsService; import org.nl.acs.ext.wms.service.AcsToWmsZDService; import org.nl.acs.instruction.service.InstructionService; import org.nl.acs.instruction.service.dto.Instruction; -import org.nl.acs.opc.Device; import org.nl.acs.opc.DeviceAppService; import org.nl.acs.task.service.TaskService; -import org.nl.acs.task.service.dto.TaskDto; -import org.nl.utils.SpringContextHolder; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; -import java.util.List; - /** * 查询AGV任务状态 */ @@ -60,6 +52,7 @@ public class QueryXZAgvTaskStatus { //子任务状态 待以后处理 JSONArray blocks = JSONArray.fromObject(one.get("blocks")); String state = one.getString("state"); + log.info("查询到的指令号:{},车号:{}", inst_code, one.getString("vehicle")); if (!StrUtil.isEmpty(one.getString("vehicle"))) { String carno = one.getString("vehicle"); inst.setCarno(carno); @@ -75,7 +68,7 @@ public class QueryXZAgvTaskStatus { // 等待=WAITING //执行中 - if ("RUNNING".equals(state) || "CREATED".equals(state) || "TOBEDISPATCHED".equals(state) || "WAITING".equals(state)) { + if ("RUNNING".equals(state) || "CREATED".equals(state) || "TOBEDISPATCHED".equals(state) || "WAITING".equals(state)) { if (inst != null) { inst.setInstruction_status("1"); instructionService.update(inst);