diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/NDCAgvServiceImpl.java b/acs/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/NDCAgvServiceImpl.java index 945a337..92b85cf 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/NDCAgvServiceImpl.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/NDCAgvServiceImpl.java @@ -235,10 +235,10 @@ public class NDCAgvServiceImpl implements NDCAgvService { byte low; if ("1".equals(option)) { high = (byte) IntToHexHigh(00); - low = (byte) IntToHexHigh(01); + low = (byte) IntToHexLow(01); } else if ("2".equals(option)) { high = (byte) IntToHexHigh(00); - low = (byte) IntToHexHigh(00); + low = (byte) IntToHexLow(00); } else { throw new BadRequestException("操作类型有误!"); } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/auto/run/OneNDCSocketConnectionAutoRun.java b/acs/nladmin-system/src/main/java/org/nl/acs/auto/run/OneNDCSocketConnectionAutoRun.java index d28e270..d496403 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/auto/run/OneNDCSocketConnectionAutoRun.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/auto/run/OneNDCSocketConnectionAutoRun.java @@ -28,6 +28,7 @@ import java.io.DataOutputStream; import java.io.IOException; import java.net.InetSocketAddress; import java.net.Socket; +import java.util.Arrays; import java.util.Date; import java.util.List; @@ -289,6 +290,7 @@ public class OneNDCSocketConnectionAutoRun extends AbstractAutoRunnable { System.out.println("Agv链接异常"); log.info("Agv链接异常"); log.error("agv连接出现异常:{}", e); + log.error("agv连接出现异常:{}", Arrays.toString(e.getStackTrace())); logServer.deviceExecuteLog("1", "", "", "agv异常" + e.getMessage()); logServer.deviceExecuteLog("1", "", "", "agv异常" + e); if (ObjectUtil.isNotEmpty(s)) { diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndcone/AgvNdcOneDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndcone/AgvNdcOneDeviceDriver.java index 49a7266..50a61d4 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndcone/AgvNdcOneDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndcone/AgvNdcOneDeviceDriver.java @@ -452,7 +452,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic //agv状态 jo.put("device_status", status_name); //电量 - jo.put("electricity", this.getElectric_qty()); + jo.put("energyLevel", this.getElectric_qty()); //任务号 jo.put("transportOrder", ObjectUtil.isEmpty(instruction) ? "0" : instruction.getTask_code()); //x坐标 diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/rest/WmsToAcsController.java b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/rest/WmsToAcsController.java index 5396eb9..41ae3c5 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/rest/WmsToAcsController.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/rest/WmsToAcsController.java @@ -10,7 +10,6 @@ import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.nl.acs.ext.wms.data.CancelTaskRequest; import org.nl.acs.ext.wms.data.CreateTaskRequest; -import org.nl.acs.ext.wms.data.CreateTaskResponse; import org.nl.acs.ext.wms.service.WmsToAcsService; import org.nl.modules.logging.InterfaceLogType; import org.nl.modules.logging.annotation.Log; diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java index fef2fe1..24efcdc 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java @@ -466,6 +466,8 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { @Override public Map deviceOption(JSONObject param) { + MDC.put(log_file_type, log_type); + log.info("deviceOption-----输入参数{}", param); String option = param.getString("option"); Assert.notBlank(option, "参数不能为空"); try { @@ -475,12 +477,14 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { map.put("status", 400); map.put("message", e.getMessage()); map.put("data", new JSONObject()); + log.info("deviceOption--------------:输出参数:" + JSON.toJSONString(map)); return map; } Map map = new HashMap<>(); map.put("status", 200); map.put("message", "操作成功!"); map.put("data", new JSONObject()); + log.info("deviceOption--------------:输出参数:" + JSON.toJSONString(map)); return map; } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java b/acs/nladmin-system/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java index d48c6aa..acfb2d3 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java @@ -700,7 +700,7 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial { } // 判断是否为WMS下发的任务,如果是反馈任务状态给WMS String hasWms = paramService.findByCode(AcsConfig.HASWMS).getValue(); - if (!StrUtil.startWith(dto.getTask_code(), "-") && StrUtil.equals(hasWms, "1")) { + if (!StrUtil.startWith(dto.getTask_code(), "-") && StrUtil.equals(hasWms, "1") && !StrUtil.equals(dto.getTask_status(), "0")) { TaskFeedbackDto feefbackdto = taskFeedbackService.findByCode(entity.getTask_code()); JSONObject feed_jo = new JSONObject(); feed_jo.put("task_id", entity.getExt_task_id()); @@ -966,7 +966,7 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial { entity.getStart_device_code(), entity.getNext_device_code(), entity.getRoute_plan_code()); - if (ObjectUtil.isNotEmpty(shortPathsList)){ + if (ObjectUtil.isNotEmpty(shortPathsList)) { String type = shortPathsList.get(0).getType(); // != 0 为agv任务 if (!StrUtil.equals(type, "0")) { @@ -1015,7 +1015,7 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial { entity.getStart_device_code(), entity.getNext_device_code(), entity.getRoute_plan_code()); - if (ObjectUtil.isNotEmpty(shortPathsList)){ + if (ObjectUtil.isNotEmpty(shortPathsList)) { String type = shortPathsList.get(0).getType(); // != 0 为agv任务 if (!StrUtil.equals(type, "0")) { diff --git a/acs/nladmin-system/src/main/java/org/nl/modules/quartz/task/AutoCreateInst.java b/acs/nladmin-system/src/main/java/org/nl/modules/quartz/task/AutoCreateInst.java index 5990fc1..772f2c3 100644 --- a/acs/nladmin-system/src/main/java/org/nl/modules/quartz/task/AutoCreateInst.java +++ b/acs/nladmin-system/src/main/java/org/nl/modules/quartz/task/AutoCreateInst.java @@ -44,7 +44,7 @@ public class AutoCreateInst { DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class); List list = taskserver.queryAll("task_status = '0' ORDER BY create_time ASC"); List list2 = taskserver.queryAll("task_status = '1' ORDER BY create_time ASC"); - Map> collect = list.stream().sorted(Comparator.comparing(TaskDto::getCreate_time)) + Map> collect = list.stream().sorted(Comparator.comparing(TaskDto::getCreate_time).thenComparing(TaskDto::getTask_code)) .collect(Collectors.groupingBy(TaskDto::getPriority)); TreeMap> treeMap = new TreeMap<>(new Comparator() { @Override