diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/AgvToAcsServiceImpl.java b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/AgvToAcsServiceImpl.java index 113a59b..95e7f4c 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/AgvToAcsServiceImpl.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/AgvToAcsServiceImpl.java @@ -46,26 +46,38 @@ public class AgvToAcsServiceImpl implements AgvToAcsService { Map map = new HashMap<>(); map.put("status", 200); map.put("message", "操作成功"); + //取货点等待 if (address.contains("INGET")) { + //告诉设备请求取货 maGangConveyorDeviceDriver.writing(4); + //判断是否满足取货条件 if (maGangConveyorDeviceDriver.getMove() == 1 && maGangConveyorDeviceDriver.getAction() == 1) { + //满足响应成功 logService.deviceExecuteLog(deviceCode, vehicle_code, inst_code, "请求路径:api/agv/waitpointRequest,请求参数:" + param.toString() + ",请求成功-响应参数:" + map.toString()); return map; } else { + //不满足抛异常 logService.deviceExecuteLog(deviceCode, vehicle_code, inst_code, "请求路径:api/agv/waitpointRequest,请求参数:" + param.toString() + ",请求失败-原因:取货前-取货点无货!"); throw new BadRequestException("请求失败,取货前-取货点无货!"); } - } else if (address.contains("OUTGET")) { + }//取货完成等待 + else if (address.contains("OUTGET")) { + //取货完成以后判断取货点是否有货 if (maGangConveyorDeviceDriver.getMove() == 0) { + //无货告诉设备取货完成 maGangConveyorDeviceDriver.writing(2); logService.deviceExecuteLog(deviceCode, vehicle_code, inst_code, "请求路径:api/agv/waitpointRequest,请求参数:" + param.toString() + ",请求成功-响应参数:" + map.toString()); return map; } else { + //有货抛异常 logService.deviceExecuteLog(deviceCode, vehicle_code, inst_code, "请求路径:api/agv/waitpointRequest,请求参数:" + param.toString() + ",请求失败-原因:取货完成后-取货点有货!"); throw new BadRequestException("请求失败,取货完成后-取货点有货!"); } - } else if (address.contains("INPUT")) { + }//放货前等待 + else if (address.contains("INPUT")) { + //告诉设备请求放货 maGangConveyorDeviceDriver.writing(5); + //判断是否满足放货信号 if (maGangConveyorDeviceDriver.getMove() == 0 && maGangConveyorDeviceDriver.getAction() == 2) { logService.deviceExecuteLog(deviceCode, vehicle_code, inst_code, "请求路径:api/agv/waitpointRequest,请求参数:" + param.toString() + ",请求成功-响应参数:" + map.toString()); return map; @@ -73,7 +85,9 @@ public class AgvToAcsServiceImpl implements AgvToAcsService { logService.deviceExecuteLog(deviceCode, vehicle_code, inst_code, "请求路径:api/agv/waitpointRequest,请求参数:" + param.toString() + ",请求失败-原因:放货前-放货点有货!"); throw new BadRequestException("请求失败,放货前-放货点有货!"); } - } else if (address.contains("OUTPUT")) { + }//放货完成等待 + else if (address.contains("OUTPUT")) { + //放货完成后判断放货点是否有货 if (maGangConveyorDeviceDriver.getMove() == 1) { maGangConveyorDeviceDriver.writing(3); logService.deviceExecuteLog(deviceCode, vehicle_code, inst_code, "请求路径:api/agv/waitpointRequest,请求参数:" + param.toString() + ",请求成功-响应参数:" + map.toString()); diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/instruction/rest/InstructionController.java b/acs/nladmin-system/src/main/java/org/nl/acs/instruction/rest/InstructionController.java index 644f971..d5e32a9 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/instruction/rest/InstructionController.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/instruction/rest/InstructionController.java @@ -108,6 +108,14 @@ public class InstructionController { return new ResponseEntity<>(HttpStatus.OK); } + @Log("强制取消指令") + @ApiOperation("强制取消指令") + @PostMapping(value = "/forceCancel/{id}") + public ResponseEntity forceCancel(@RequestBody String id) throws Exception { + instructionService.cancelNOSendAgv(id); + return new ResponseEntity<>(HttpStatus.OK); + } + @Log("导出指令") @ApiOperation("导出指令") @GetMapping(value = "/download") diff --git a/acs/nladmin-ui/src/api/acs/instruction/instruction.js b/acs/nladmin-ui/src/api/acs/instruction/instruction.js index 12aea74..76c44df 100644 --- a/acs/nladmin-ui/src/api/acs/instruction/instruction.js +++ b/acs/nladmin-ui/src/api/acs/instruction/instruction.js @@ -40,6 +40,14 @@ export function cancel(instruction_id) { }) } +export function forceCancel(instruction_id) { + return request({ + url: 'api/instruction/forceCancel/' + instruction_id, + method: 'post', + data: instruction_id + }) +} + export function queryUnFinish() { return request({ url: 'api/instruction/unfinish/', @@ -62,4 +70,4 @@ export function reload() { }) } -export default { add, edit, del, finish, cancel, queryUnFinish, queryByTaskId, reload } +export default { add, edit, del, finish, forceCancel, cancel, queryUnFinish, queryByTaskId, reload } diff --git a/acs/nladmin-ui/src/views/acs/instruction/index.vue b/acs/nladmin-ui/src/views/acs/instruction/index.vue index 9130599..bd661ad 100644 --- a/acs/nladmin-ui/src/views/acs/instruction/index.vue +++ b/acs/nladmin-ui/src/views/acs/instruction/index.vue @@ -165,6 +165,7 @@ 完成 取消 + 强制取消 @@ -295,6 +296,14 @@ export default { console.log(err.response.data.message) }) }, + forceCancel(index, row) { + crudInstruction.forceCancel(row.instruction_id).then(res => { + this.crud.toQuery() + this.crud.notify('强制取消成功', CRUD.NOTIFICATION_TYPE.SUCCESS) + }).catch(err => { + console.log(err.response.data.message) + }) + }, reload() { crudInstruction.reload().then(res => { this.crud.toQuery() @@ -318,6 +327,9 @@ export default { case 'b':// 取消 this.cancel(command.index, command.row) break + case 'c':// 取消 + this.forceCancel(command.index, command.row) + break } }