diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/extInterface/suray/service/impl/SurayToAcsServiceImpl.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/extInterface/suray/service/impl/SurayToAcsServiceImpl.java index 4808123..af3bfae 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/extInterface/suray/service/impl/SurayToAcsServiceImpl.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/extInterface/suray/service/impl/SurayToAcsServiceImpl.java @@ -58,13 +58,19 @@ public class SurayToAcsServiceImpl implements SurayToAcsService { instructionService.update(instruction); } } + if (2 == request.getTaskStatus()){ + if (instruction != null && instruction.instruction_status.equals("0")) { + instruction.setInstruction_status(InstructionStatusEnum.BUSY.getIndex()); + instructionService.update(instruction); + } + } if (8 == request.getTaskStatus()) { // 任务完成 if (instruction != null) { try { instructionService.finish(instruction.getInstruction_id()); } catch (Exception e) { - return TaskStatusReportResponse.failed(e.getMessage()); + return TaskStatusReportResponse.success(); } } } @@ -72,7 +78,7 @@ public class SurayToAcsServiceImpl implements SurayToAcsService { try { instructionService.cancel(instruction.getInstruction_id()); } catch (Exception e) { - return TaskStatusReportResponse.failed(e.getMessage()); + return TaskStatusReportResponse.success(); } } return TaskStatusReportResponse.success(); @@ -101,7 +107,7 @@ public class SurayToAcsServiceImpl implements SurayToAcsService { return response; } - Device device = deviceAppService.findDeviceByCode(request.getPointCode()); + Device device = deviceAppService.findDeviceByCode("1001"); if (device != null && device.getDeviceDriver() instanceof BeltConveyorDeviceDriver) { BeltConveyorDeviceDriver driver = (BeltConveyorDeviceDriver) device.getDeviceDriver(); if (driver.getMove() == 0) {