From 088ecca8ed268a71140c41a75ca69aeadf4b088e Mon Sep 17 00:00:00 2001 From: tuqiang <437016993@qq.com> Date: Wed, 25 Feb 2026 13:13:10 +0800 Subject: [PATCH] =?UTF-8?q?opt=EF=BC=9A=E6=89=8B=E6=8C=81=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/org/nl/hand/rest/PadController.java | 2 +- .../nl/hand/service/impl/PadServiceImpl.java | 40 ++++++++----------- 2 files changed, 18 insertions(+), 24 deletions(-) diff --git a/acs/nladmin-system/src/main/java/org/nl/hand/rest/PadController.java b/acs/nladmin-system/src/main/java/org/nl/hand/rest/PadController.java index e3e6948..614c107 100644 --- a/acs/nladmin-system/src/main/java/org/nl/hand/rest/PadController.java +++ b/acs/nladmin-system/src/main/java/org/nl/hand/rest/PadController.java @@ -46,7 +46,7 @@ public class PadController { return new ResponseEntity<>(padService.insts(whereJson), HttpStatus.OK); } - @PostMapping("/instoperation") + @PostMapping("/inst") @Log("指令操作") @ApiOperation("指令操作") @SaIgnore diff --git a/acs/nladmin-system/src/main/java/org/nl/hand/service/impl/PadServiceImpl.java b/acs/nladmin-system/src/main/java/org/nl/hand/service/impl/PadServiceImpl.java index 97164c8..766ce0b 100644 --- a/acs/nladmin-system/src/main/java/org/nl/hand/service/impl/PadServiceImpl.java +++ b/acs/nladmin-system/src/main/java/org/nl/hand/service/impl/PadServiceImpl.java @@ -35,14 +35,14 @@ public class PadServiceImpl implements PadService { @Override public Map tasks(Map whereJson) { JSONObject resultJson = new JSONObject(); - String vehicle_code = StrUtil.trimToEmpty(whereJson.get("vehicle_code")); + String car_no = StrUtil.trimToEmpty(whereJson.get("car_no")); String device_code = StrUtil.trimToEmpty(whereJson.get("device_code")); List taskDtos = taskService.queryAllByCache(); List> list = (taskDtos == null ? Stream.empty() : taskDtos.stream()) .filter(t -> { - if (StrUtil.isEmpty(vehicle_code)) return true; - String vc = t.getVehicle_code(); - return StrUtil.isNotEmpty(vc) && vc.contains(vehicle_code); + if (StrUtil.isEmpty(car_no)) return true; + String vc = t.getCar_no(); + return StrUtil.isNotEmpty(vc) && vc.contains(car_no); }) .filter(t -> { if (StrUtil.isEmpty(device_code)) return true; @@ -54,17 +54,17 @@ public class PadServiceImpl implements PadService { .map(t -> { Map m = new HashMap<>(); m.put("task_id", t.getTask_id()); - m.put("task_no", t.getTask_code()); + m.put("task_code", t.getTask_code()); m.put("priority", t.getPriority()); - m.put("start_device_code", t.getStart_device_code()); - m.put("next_device_code", t.getNext_device_code()); + m.put("point_code1", t.getStart_device_code()); + m.put("point_code2", t.getNext_device_code()); m.put("inst_status", t.getTask_status()); - m.put("vehicle_code", t.getVehicle_code()); + m.put("car_no", t.getCar_no()); m.put("create_time", t.getCreate_time()); return m; }) .collect(Collectors.toList()); - resultJson.put("result", list); + resultJson.put("data", list); resultJson.put("code", "1"); resultJson.put("message", "ok"); return resultJson; @@ -118,14 +118,14 @@ public class PadServiceImpl implements PadService { @Override public Map insts(Map whereJson) { JSONObject resultJson = new JSONObject(); - String vehicle_code = whereJson.get("vehicle_code"); + String car_no = whereJson.get("car_no"); String device_code = whereJson.get("device_code"); List instructions = instructionService.findAllInstFromCache(); List> list = (instructions == null ? Stream.empty() : instructions.stream()) .filter(instruction -> { - if (StrUtil.isEmpty(vehicle_code)) return true; - String vc = instruction.getVehicle_code(); - return StrUtil.isNotEmpty(vc) && vc.contains(vehicle_code); + if (StrUtil.isEmpty(car_no)) return true; + String vc = instruction.getCarno(); + return StrUtil.isNotEmpty(vc) && vc.contains(car_no); }) .filter(instruction -> { if (StrUtil.isEmpty(device_code)) return true; @@ -140,8 +140,8 @@ public class PadServiceImpl implements PadService { m.put("instruction_code", instruction.getInstruction_code()); m.put("task_no", instruction.getTask_code()); m.put("priority", instruction.getPriority()); - m.put("start_device_code", instruction.getStart_device_code()); - m.put("next_device_code", instruction.getNext_device_code()); + m.put("point_code1", instruction.getStart_device_code()); + m.put("point_code2", instruction.getNext_device_code()); m.put("inst_status", instruction.getInstruction_status()); m.put("vehicle_code", instruction.getVehicle_code()); m.put("car_no", instruction.getCarno()); @@ -149,7 +149,7 @@ public class PadServiceImpl implements PadService { return m; }) .collect(Collectors.toList()); - resultJson.put("result", list); + resultJson.put("data", list); resultJson.put("code", "1"); resultJson.put("message", "ok"); return resultJson; @@ -219,12 +219,7 @@ public class PadServiceImpl implements PadService { resultJson.put("message", "目的库位不存在,请添加目的库位!"); return resultJson; } - String vehicle_code = whereJson.get("vehicle_code"); - if (StrUtil.isEmpty(vehicle_code)) { - resultJson.put("code", "0"); - resultJson.put("message", "托盘号不能为空!"); - return resultJson; - } + TaskDto taskDto = new TaskDto(); taskDto.setStart_device_code(start_device_code); taskDto.setStart_point_code(start_device_code); @@ -232,7 +227,6 @@ public class PadServiceImpl implements PadService { taskDto.setNext_device_code(next_device_code); taskDto.setNext_point_code(next_device_code); taskDto.setNext_parent_code(next_device_code); - taskDto.setVehicle_code(vehicle_code); try { taskService.create(taskDto); } catch (Exception e) {