更新
This commit is contained in:
@@ -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());
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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 }
|
||||
|
||||
@@ -165,6 +165,7 @@
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item :command="beforeHandleCommand(scope.$index, scope.row,'a')">完成</el-dropdown-item>
|
||||
<el-dropdown-item :command="beforeHandleCommand(scope.$index, scope.row,'b')">取消</el-dropdown-item>
|
||||
<el-dropdown-item :command="beforeHandleCommand(scope.$index, scope.row,'c')">强制取消</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</template>
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user