This commit is contained in:
2022-12-11 17:22:31 +08:00
parent 4f613bfb28
commit 3642362bf1
4 changed files with 46 additions and 4 deletions

View File

@@ -46,26 +46,38 @@ public class AgvToAcsServiceImpl implements AgvToAcsService {
Map<String, Object> 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());

View File

@@ -108,6 +108,14 @@ public class InstructionController {
return new ResponseEntity<>(HttpStatus.OK);
}
@Log("强制取消指令")
@ApiOperation("强制取消指令")
@PostMapping(value = "/forceCancel/{id}")
public ResponseEntity<Object> forceCancel(@RequestBody String id) throws Exception {
instructionService.cancelNOSendAgv(id);
return new ResponseEntity<>(HttpStatus.OK);
}
@Log("导出指令")
@ApiOperation("导出指令")
@GetMapping(value = "/download")