add: 烘箱行架增加日志和套轴等待

This commit is contained in:
yanps
2024-01-04 09:36:49 +08:00
parent 8e5c76a0a1
commit f69d754c9c
8 changed files with 83 additions and 27 deletions

View File

@@ -250,13 +250,13 @@ public class CasingStationConveyorDeviceDriver extends AbstractOpcDeviceDriver i
// apply_for_casing_inspection(material1, material2);
bushingSucess();
} else if (move != 1) {
remark += "套管工位没有货";
remark = "套管工位没有货";
} else if (task < 1) {
remark += "纸管库的任务号为空";
remark = "纸管库的任务号为空";
} else if (task1 < 1) {
remark += "行架任务为空";
remark = "行架任务为空";
} else if (requireSucess) {
remark += "requrieSucess为" + requireSucess;
remark = "requrieSucess为" + requireSucess;
}
break;
default:

View File

@@ -256,7 +256,7 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple
if (action != last_action) {
this.setFeedbackSucess(false);
logServer.deviceItemValue(this.device_code, "action", String.valueOf(action));
logServer.deviceExecuteLog(this.device_code, "", "", "信号action" + last_action + "->" + action +"feedbackSucess:"+feedbackSucess);
logServer.deviceExecuteLog(this.device_code, "", "", "信号action" + last_action + "->" + action + " feedbackSucess:" + feedbackSucess);
}
if (error != last_error) {
if (error != 0) {
@@ -437,7 +437,7 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple
applyManipulatorActionRequest.setType("2");
applyManipulatorActionRequest.setTask_code1(task_code);
applyManipulatorActionRequest.setSize(String.valueOf(inflatable_shaft_size));
logServer.deviceExecuteLog(this.device_code,"","","开始反馈尺寸");
logServer.deviceExecuteLog(this.device_code, "", "", "开始反馈尺寸");
applyManipulatorActionResponse = acsToWmsService.applyManipulatorActionRequest(applyManipulatorActionRequest);
if (applyManipulatorActionResponse.getstatus() == 200) {
feedbackSucess = true;
@@ -458,7 +458,7 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple
String task_code = inst1.getTask_code();
applyManipulatorActionRequest.setType("3");
applyManipulatorActionRequest.setTask_code1(task_code);
logServer.deviceExecuteLog(this.device_code,"","","开始申请放货点");
logServer.deviceExecuteLog(this.device_code, "", "", "开始申请放货点");
applyManipulatorActionResponse = acsToWmsService.applyManipulatorActionRequest(applyManipulatorActionRequest);
if (applyManipulatorActionResponse.getstatus() == 200) {
logServer.deviceExecuteLog(this.device_code, "", "", "申请放货点请求成功,响应参数:" + JSON.toJSONString(applyManipulatorActionResponse));
@@ -485,7 +485,7 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple
String task_code = inst1.getTask_code();
applyManipulatorActionRequest.setType("4");
applyManipulatorActionRequest.setTask_code1(task_code);
logServer.deviceExecuteLog(this.device_code,"","","开始申请取货点");
logServer.deviceExecuteLog(this.device_code, "", "", "开始申请取货点");
applyManipulatorActionResponse = acsToWmsService.applyManipulatorActionRequest(applyManipulatorActionRequest);
if (applyManipulatorActionResponse.getstatus() == 200) {
String get_device_code = applyManipulatorActionResponse.getDevice_code();
@@ -512,7 +512,7 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple
String task_code = inst1.getTask_code();
applyManipulatorActionRequest.setType("5");
applyManipulatorActionRequest.setTask_code1(task_code);
logServer.deviceExecuteLog(this.device_code,"","","申请二次放货点");
logServer.deviceExecuteLog(this.device_code, "", "", "申请二次放货点");
applyManipulatorActionResponse = acsToWmsService.applyManipulatorActionRequest(applyManipulatorActionRequest);
if (applyManipulatorActionResponse.getstatus() == 200) {
String put_device_code2 = applyManipulatorActionResponse.getDevice_code();
@@ -539,7 +539,7 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple
String task_code = inst1.getTask_code();
applyManipulatorActionRequest.setAction("1");
applyManipulatorActionRequest.setTask_code1(task_code);
logServer.deviceExecuteLog(this.device_code,"","","开始反馈缓存库取货完成");
logServer.deviceExecuteLog(this.device_code, "", "", "开始反馈缓存库取货完成");
ApplyManipulatorActionResponse applyManipulatorActionResponse1 = acsToWmsService.actionFinishRequest(applyManipulatorActionRequest);
if (applyManipulatorActionResponse1.getstatus() == 200) {
logServer.deviceExecuteLog(this.device_code, "", "", "缓存库取货请求成功,响应参数:" + JSON.toJSONString(applyManipulatorActionResponse1));
@@ -560,7 +560,7 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple
String task_code = inst1.getTask_code();
applyManipulatorActionRequest.setAction("2");
applyManipulatorActionRequest.setTask_code1(task_code);
logServer.deviceExecuteLog(this.device_code,"","","开始反馈缓存库放货完成");
logServer.deviceExecuteLog(this.device_code, "", "", "开始反馈缓存库放货完成");
ApplyManipulatorActionResponse applyManipulatorActionResponse1 = acsToWmsService.actionFinishRequest(applyManipulatorActionRequest);
if (applyManipulatorActionResponse1.getstatus() == 200) {
logServer.deviceExecuteLog(this.device_code, "", "", "缓存库放货完成,响应参数:" + JSON.toJSONString(applyManipulatorActionResponse1));
@@ -577,13 +577,40 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple
}
}
//异常气胀轴反馈
/*if (action == 9) {
String task_code = inst1.getTask_code();
applyManipulatorActionRequest.setType("9");
applyManipulatorActionRequest.setTask_code1(task_code);
logServer.deviceExecuteLog(this.device_code, "", "", "异常反馈");
applyManipulatorActionResponse = acsToWmsService.applyManipulatorActionRequest(applyManipulatorActionRequest);
if (ObjectUtil.isNotEmpty(applyManipulatorActionResponse) && applyManipulatorActionResponse.getstatus() == 200) {
logServer.deviceExecuteLog(this.device_code, "", "", "异常反馈完成,响应参数:" + JSON.toJSONString(applyManipulatorActionResponse));
Map<String, Object> map = new LinkedHashMap<>();
map.put("to_command", 9);
this.writing(map);
feedbackSucess = true;
message = "缓存库放货成功";
try {
instructionService.cancel(inst1.getInstruction_id());
logServer.deviceExecuteLog(this.device_code, "", "", "取消指令完成");
TaskDto byTaskCode = taskserver.findByTaskCode(inst1.getTask_code());
taskserver.cancel(byTaskCode.getTask_id());
logServer.deviceExecuteLog(this.device_code, "", "", "取消任务完成");
} catch (Exception e) {
message = "取消任务或指令失败,失败原因"+ e.getMessage();
logServer.deviceExecuteLog(this.device_code, "", "", "取消任务或指令失败,失败原因"+e.getMessage());
}
}
}*/
//放货完成
if (mode == 3 && action == 8 && move == 0) {
if (inst1 != null) {
try {
feedbackSucess = true;
logServer.deviceExecuteLog(this.device_code,"","","放货完成");
logServer.deviceExecuteLog(this.device_code, "", "", "放货完成");
finish_instruction(inst1);
Map<String, Object> map = new LinkedHashMap<>();
map.put("to_command", 8);
@@ -753,12 +780,12 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple
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);
// String opcservcerid = this.getDevice().getOpc_server_id();
// Server server = ReadUtil.getServer(opcservcerid);
Map<String, Object> itemMap = new HashMap<String, Object>();
itemMap.put(to_param, Integer.parseInt(value));
// itemMap.put(to_param, Integer.parseInt(value));
// itemMap.put(to_param, Integer.parseInt(value));
this.control(itemMap);
logServer.deviceExecuteLog(device_code, "", "", "下发电气信号设备号:" + device_code + ",下发电气:" + to_param + ",下发电气值:" + value);
}
@@ -845,11 +872,11 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple
if ("6".equals(task.getTruss_type())) {
flag = checkAgv(task);
if (flag) {
logServer.deviceExecuteLog(this.device_code,"","","RGV条件满足,允许创建指令,任务号为:"+task.getTask_code());
logServer.deviceExecuteLog(this.device_code, "", "", "RGV条件满足,允许创建指令,任务号为:" + task.getTask_code());
break;
} else {
task = null;
logServer.deviceExecuteLog(this.device_code,"","","RGV条件不满足,不允许允许创建指令,任务号为:"+task);
logServer.deviceExecuteLog(this.device_code, "", "", "RGV条件不满足,不允许允许创建指令,任务号为:" + task);
continue;
}
@@ -976,8 +1003,8 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple
rgv1 = (RgvDeviceDriver) agv1.getDeviceDriver();
rgv2 = (RgvDeviceDriver) agv2.getDeviceDriver();
if ((rgv1.getMode() == 2 && rgv1.getMove1() == 1 && rgv1.getMove2() == 0) || (rgv2.getMode() == 2 && rgv2.getMove1() == 1 && rgv2.getMove2() == 0)) {
logServer.deviceExecuteLog(device_code, "", "", "mode1"+rgv1.getMode()+"mode2"+
rgv2.getMode()+"rgv1的move2"+ rgv1.getMove2()+"rgv2的move2"+rgv2.getMove2());
logServer.deviceExecuteLog(device_code, "", "", "mode1" + rgv1.getMode() + "mode2" +
rgv2.getMode() + "rgv1的move2" + rgv1.getMove2() + "rgv2的move2" + rgv2.getMove2());
return true;
} else {
logServer.deviceExecuteLog(device_code, "", "", "rgv信号不符合");

View File

@@ -383,7 +383,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
//存在行架->暂存的AGV任务 需要过滤
// 6 行架任务 8烘箱任务
if(!StrUtil.equals(taskDto.getTask_type(),"6") && !StrUtil.equals(taskDto.getTask_type(),"8")){
if (!StrUtil.equals(taskDto.getTask_type(), "6") && !StrUtil.equals(taskDto.getTask_type(), "8")) {
taskDto = null;
continue;
}
@@ -436,7 +436,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
boolean isCloseDoor = this.judgeCloseDoor(start_device_code, next_device_code);
//未关门结束
if (isCloseDoor) {
notCreateInstMessage = "手动创建指令未下发电气信号原因->取货位:" + start_device_code + ",放货位:" + next_device_code +",存在关联的同一列烘箱设备未关门!指令号:" + instruction.getInstruction_code();
notCreateInstMessage = "手动创建指令未下发电气信号原因->取货位:" + start_device_code + ",放货位:" + next_device_code + ",存在关联的同一列烘箱设备未关门!指令号:" + instruction.getInstruction_code();
return false;
}
instruction.setInstruction_status("1");
@@ -473,12 +473,12 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
} else {
List<TaskDto> taskDtoList = taskserver.queryTaskByDeviceCode(startDeviceCode);
if (ObjectUtil.isNotEmpty(taskDtoList)) {
for(int j=0; j <taskDtoList.size();j++ ){
for (int j = 0; j < taskDtoList.size(); j++) {
//按照优先级排序 优先级相等按照创建时间排序
taskDtoList = this.sortTask(taskDtoList);
task = taskDtoList.get(j);
// 6 行架任务 8烘箱任务
if(!StrUtil.equals(task.getTask_type(),"6") && !StrUtil.equals(task.getTask_type(),"8")){
if (!StrUtil.equals(task.getTask_type(), "6") && !StrUtil.equals(task.getTask_type(), "8")) {
task = null;
continue;
}
@@ -797,6 +797,20 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
} else if (this.getAction() == 4) {
action = "放货完成";
}
String steps_type = "";
if (now_steps_type == 0) {
steps_type += "无任务执行";
} else if (now_steps_type == 1) {
steps_type = "更新指令状态";
} else if (now_steps_type == 2) {
steps_type = "下发电气信号";
}else if(now_steps_type == 3){
steps_type = "允许取货";
}else if (now_steps_type ==4 ){
steps_type += "允许放货";
}else if (now_steps_type == 5){
steps_type += "放货完成";
}
jo.put("device_name", this.getDevice().getDevice_name());
jo.put("mode", mode);
@@ -815,6 +829,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
jo.put("is_click", true);
jo.put("x", x_position);
jo.put("y", y_position);
jo.put("now_steps_type", steps_type);
return jo;
}

View File

@@ -248,14 +248,22 @@ public class PluggingUnpluggingMachineDeviceDriver extends AbstractOpcDeviceDriv
requireSucess = true;
logServer.deviceExecuteLog(this.device_code, "", "", "申请套轴成功,返回参数:" + applyManipulatorActionResponse);
message = "套轴申请成功";
}else if (ObjectUtils.isNotEmpty(applyManipulatorActionResponse) && "2".equals(applyManipulatorActionResponse.getIs_bushing())){
message = applyManipulatorActionResponse.getMessage();
Map<String, Object> map = new LinkedHashMap<>();
map.put("to_command", 98);
this.writing(map);
requireSucess = true;
message = "等待套轴";
logServer.deviceExecuteLog(this.device_code, "", "", "等待套轴,返回参数:" + applyManipulatorActionResponse);
}else {
message = applyManipulatorActionResponse.getMessage();
Map<String, Object> map = new LinkedHashMap<>();
map.put("to_command", 99);
this.writing(map);
requireSucess = true;
message = "申请失败";
logServer.deviceExecuteLog(this.device_code, "", "", "申请套轴失败,返回参数:" + applyManipulatorActionResponse);
message = "套轴申请失败";
logServer.deviceExecuteLog(this.device_code, "", "", "套轴申请失败,返回参数:" + applyManipulatorActionResponse);
}
}

View File

@@ -33,7 +33,6 @@ public class WmsToAcsController {
@PostMapping("/task")
@Log(value = "ACS接收WMS任务",isInterfaceLog = true,interfaceLogType= InterfaceLogType.LMS_TO_ACS)
@SaIgnore
public ResponseEntity<Object> createFromWms(@RequestBody String whereJson) {
return new ResponseEntity<>(wmstoacsService.crateTask(whereJson), HttpStatus.OK);
@@ -73,7 +72,6 @@ public class WmsToAcsController {
@PostMapping("/action")
@Log(value = "WMS下发点位信号",isInterfaceLog = true,interfaceLogType= InterfaceLogType.LMS_TO_ACS)
@SaIgnore
public ResponseEntity<Object> putAction(@RequestBody String whereJson) throws Exception {
return new ResponseEntity<>(wmstoacsService.putAction(whereJson), HttpStatus.OK);

View File

@@ -207,6 +207,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
HongXiangStationDeviceDriver hongXiangStationDeviceDriver;
LampThreecolorDeviceDriver lampThreecolorDeviceDriver;
SiemensConveyorDeviceDriver siemensConveyorDeviceDriver;
PluggingUnpluggingMachineDeviceDriver pluggingUnpluggingMachineDeviceDriver;
if (device.getDeviceDriver() instanceof HongXiangStationDeviceDriver) {
hongXiangStationDeviceDriver = (HongXiangStationDeviceDriver) device.getDeviceDriver();
hongXiangStationDeviceDriver.writing(code, value);
@@ -219,6 +220,10 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
siemensConveyorDeviceDriver = (SiemensConveyorDeviceDriver) device.getDeviceDriver();
siemensConveyorDeviceDriver.writing(code, value);
}
if (device.getDeviceDriver() instanceof PluggingUnpluggingMachineDeviceDriver) {
pluggingUnpluggingMachineDeviceDriver = (PluggingUnpluggingMachineDeviceDriver) device.getDeviceDriver();
pluggingUnpluggingMachineDeviceDriver.writing(code, value);
}
}