diff --git a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/basedriver/ssx_site/SsxSiteDeviceDriver.java b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/basedriver/ssx_site/SsxSiteDeviceDriver.java index 69cdf48..9762786 100644 --- a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/basedriver/ssx_site/SsxSiteDeviceDriver.java +++ b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/basedriver/ssx_site/SsxSiteDeviceDriver.java @@ -373,6 +373,18 @@ public class SsxSiteDeviceDriver extends AbstractOpcDeviceDriver implements Devi } + public void writing(String param, String value) { + + String to_param = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() + + "." + param; + //String opcservcerid = this.getDevice().getOpc_server_id(); +//Server server = ReadUtil.getServer(opcservcerid); + Map itemMap = new HashMap(); + + itemMap.put(to_param, value); +// itemMap.put(to_param, Integer.parseInt(value)); + this.control(itemMap); + } diff --git a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/hand/dto/HeadTaskDto.java b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/hand/dto/HeadTaskDto.java index 89ff13c..df2d5f0 100644 --- a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/hand/dto/HeadTaskDto.java +++ b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/hand/dto/HeadTaskDto.java @@ -36,4 +36,18 @@ public class HeadTaskDto implements Serializable { * 2 强制完成 */ private String type; + + /** + * 操作类型 + * 1 重新生成 + * 2 强制完成 + */ + private String sub_tray; + + /** + * 操作类型 + * 1 重新生成 + * 2 强制完成 + */ + private String mother_tray; } diff --git a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/hand/rest/HandController.java b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/hand/rest/HandController.java index c77b078..ce52850 100644 --- a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/hand/rest/HandController.java +++ b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/hand/rest/HandController.java @@ -96,4 +96,13 @@ public class HandController { public ResponseEntity taskOperation(@RequestBody HeadTaskDto dto) throws Exception { return new ResponseEntity<>(handService.taskOperation(dto), HttpStatus.OK); } + + @PostMapping("/record") + @Log("托盘码补录") + @ApiOperation("托盘码补录") + @SaIgnore + //@PreAuthorize("@el.check('sect:list')") + public ResponseEntity record(@RequestBody HeadTaskDto dto) throws Exception { + return new ResponseEntity<>(handService.record(dto), HttpStatus.OK); + } } diff --git a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/hand/service/HandService.java b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/hand/service/HandService.java index 1260ee7..73b0e3b 100644 --- a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/hand/service/HandService.java +++ b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/hand/service/HandService.java @@ -33,4 +33,6 @@ public interface HandService { Map querytasks(HeadTaskDto dto); Map taskOperation(HeadTaskDto dto); + + Map record(HeadTaskDto dto); } diff --git a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/hand/service/impl/HandServiceImpl.java b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/hand/service/impl/HandServiceImpl.java index 4c81276..bb87f16 100644 --- a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/hand/service/impl/HandServiceImpl.java +++ b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/hand/service/impl/HandServiceImpl.java @@ -16,6 +16,9 @@ import org.nl.acs.agv.server.AgvService; import org.nl.acs.agv.server.NDCAgvService; import org.nl.acs.device.domain.Device; import org.nl.acs.device.service.DeviceService; +import org.nl.acs.device_driver.basedriver.hongxiang_device.HongXiangConveyorDeviceDriver; +import org.nl.acs.device_driver.basedriver.ssx_site.SsxSiteDeviceDriver; +import org.nl.acs.device_driver.basedriver.standard_conveyor_control_with_scanner.StandardCoveyorControlWithScannerDeviceDriver; import org.nl.acs.ext.wms.data.JsonUtl; import org.nl.acs.instruction.domain.Instruction; import org.nl.acs.instruction.domain.InstructionMybatis; @@ -458,4 +461,27 @@ public class HandServiceImpl implements HandService { resultJson.put("data", data); return resultJson; } + + @Override + public Map record(HeadTaskDto dto) { + JSONObject resultJson = new JSONObject(); + JSONArray data = new JSONArray(); + String sub_tray=dto.getSub_tray(); + String mother_tray=dto.getMother_tray(); + Device device = deviceAppService.findDeviceByCode("SSX04"); + if (device.getDeviceDriver() instanceof SsxSiteDeviceDriver) { + SsxSiteDeviceDriver ssxSiteDeviceDriver = (SsxSiteDeviceDriver) device.getDeviceDriver(); + if(ObjectUtil.isNotEmpty(sub_tray)) { + log.info("手持补录SSX04子托盘编号sub_tray为{}",sub_tray); + ssxSiteDeviceDriver.writing("sub_tray",sub_tray); + } + if(ObjectUtil.isNotEmpty(mother_tray)) { + log.info("手持补录SSX04母托盘编号mother_tray为{}",mother_tray); + ssxSiteDeviceDriver.writing("mother_tray",mother_tray); + } + } + resultJson.put("message", "操作成功"); + resultJson.put("data", data); + return resultJson; + } }