rev:优化日志

This commit is contained in:
2024-07-13 18:13:34 +08:00
parent 2e3bbf7bbb
commit ab5f7a82eb
7 changed files with 299 additions and 196 deletions

View File

@@ -945,7 +945,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
luceneExecuteLogService.deviceExecuteLog(logDto); luceneExecuteLogService.deviceExecuteLog(logDto);
} }
} else if (phase == 0x77) { } else if (phase == 0x4D) {
if (agvaddr == 0) { if (agvaddr == 0) {
agvaddr = agvaddr_copy; agvaddr = agvaddr_copy;
} }
@@ -1014,88 +1014,89 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
logDto.setLog_level(4); logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto); luceneExecuteLogService.deviceExecuteLog(logDto);
} }
} else if (ObjectUtil.isNotEmpty(start_device_code) && StrUtil.equals(device_code, next_device_code)) { }
if (device.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) { } else if (ObjectUtil.isNotEmpty(start_device_code) && StrUtil.equals(device_code, next_device_code)) {
manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) device.getDeviceDriver(); if (device.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) {
manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) device.getDeviceDriver();
try { try {
manipulatorAgvStationDeviceDriver.writing(4); manipulatorAgvStationDeviceDriver.writing(4);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
}
if ((manipulatorAgvStationDeviceDriver.getAction() == 1)) {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(this.getDeviceCode())
.content("agvphase:" + phase + "反馈:" + data)
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
} else {
message = "设备号:" + device_code + ",动作信号:" + manipulatorAgvStationDeviceDriver.getAction() + "报警信号:" + ",指令号:" + ikey + "不满足取货条件";
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(this.getDeviceCode())
.content(manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1")
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
}
} }
} else if (ObjectUtil.isNotEmpty(start_device_code) && StrUtil.equals(device_code, start_device_code2)) { if ((manipulatorAgvStationDeviceDriver.getAction() == 1)) {
if (device.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) { data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) device.getDeviceDriver(); LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(this.getDeviceCode())
try { .content("agvphase:" + phase + "反馈:" + data)
manipulatorAgvStationDeviceDriver.writing(4); .build();
} catch (Exception e) { logDto.setLog_level(4);
e.printStackTrace(); luceneExecuteLogService.deviceExecuteLog(logDto);
} } else {
if ((manipulatorAgvStationDeviceDriver.getAction() == 1)) { message = "设备号:" + device_code + ",动作信号:" + manipulatorAgvStationDeviceDriver.getAction() + "报警信号:" + ",指令号:" + ikey + "不满足取货条件";
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); LuceneLogDto logDto = LuceneLogDto.builder()
LuceneLogDto logDto = LuceneLogDto.builder() .device_code(this.getDeviceCode())
.device_code(this.getDeviceCode()) .content(manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1")
.content("agvphase:" + phase + "反馈:" + data) .build();
.build(); logDto.setLog_level(4);
logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto);
luceneExecuteLogService.deviceExecuteLog(logDto);
} else {
message = "设备号:" + device_code + ",动作信号:" + manipulatorAgvStationDeviceDriver.getAction() + "报警信号:" + ",指令号:" + ikey + "不满足取货条件";
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(this.getDeviceCode())
.content(manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1")
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
}
}
} else if (ObjectUtil.isNotEmpty(start_device_code) && StrUtil.equals(device_code, next_device_code2)) {
if (device.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) {
manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) device.getDeviceDriver();
try {
manipulatorAgvStationDeviceDriver.writing(2);
} catch (Exception e) {
e.printStackTrace();
}
if ((manipulatorAgvStationDeviceDriver.getAction() == 1)) {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(this.getDeviceCode())
.content("agvphase:" + phase + "反馈:" + data)
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
} else {
message = "设备号:" + device_code + ",动作信号:" + manipulatorAgvStationDeviceDriver.getAction() + "报警信号:" + ",指令号:" + ikey + "不满足取货条件";
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(this.getDeviceCode())
.content(manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1")
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
}
} }
} }
} else if (ObjectUtil.isNotEmpty(start_device_code) && StrUtil.equals(device_code, start_device_code2)) {
if (device.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) {
manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) device.getDeviceDriver();
try {
manipulatorAgvStationDeviceDriver.writing(4);
} catch (Exception e) {
e.printStackTrace();
}
if ((manipulatorAgvStationDeviceDriver.getAction() == 1)) {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(this.getDeviceCode())
.content("agvphase:" + phase + "反馈:" + data)
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
} else {
message = "设备号:" + device_code + ",动作信号:" + manipulatorAgvStationDeviceDriver.getAction() + "报警信号:" + ",指令号:" + ikey + "不满足取货条件";
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(this.getDeviceCode())
.content(manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1")
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
}
}
} else if (ObjectUtil.isNotEmpty(start_device_code) && StrUtil.equals(device_code, next_device_code2)) {
if (device.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) {
manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) device.getDeviceDriver();
try {
manipulatorAgvStationDeviceDriver.writing(2);
} catch (Exception e) {
e.printStackTrace();
}
if ((manipulatorAgvStationDeviceDriver.getAction() == 1)) {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(this.getDeviceCode())
.content("agvphase:" + phase + "反馈:" + data)
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
} else {
message = "设备号:" + device_code + ",动作信号:" + manipulatorAgvStationDeviceDriver.getAction() + "报警信号:" + ",指令号:" + ikey + "不满足取货条件";
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(this.getDeviceCode())
.content(manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1")
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
}
}
}
// else { // else {
// data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); // data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
// LuceneLogDto logDto = LuceneLogDto.builder() // LuceneLogDto logDto = LuceneLogDto.builder()
@@ -1105,7 +1106,6 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
// logDto.setLog_level(4); // logDto.setLog_level(4);
// luceneExecuteLogService.deviceExecuteLog(logDto); // luceneExecuteLogService.deviceExecuteLog(logDto);
// } // }
}
} }
// 取货完毕 // 取货完毕

View File

@@ -325,7 +325,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
if (ObjectUtil.isEmpty(putDeviceCodeList)) { if (ObjectUtil.isEmpty(putDeviceCodeList)) {
putDeviceCodeList = this.getExtraDeviceCodes("put_device_code"); putDeviceCodeList = this.getExtraDeviceCodes("put_device_code");
} }
if(CollUtil.isEmpty(getDeviceCodeList) || getDeviceCodeList.size() == 0){ if (CollUtil.isEmpty(getDeviceCodeList) || getDeviceCodeList.size() == 0) {
notCreateInstMessage = "未设置取货点"; notCreateInstMessage = "未设置取货点";
} }
TaskDto task = null; TaskDto task = null;
@@ -702,6 +702,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) nextdevice.getDeviceDriver(); hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) nextdevice.getDeviceDriver();
hongXiangConveyorDeviceDriver.writing("to_close_door", "1"); hongXiangConveyorDeviceDriver.writing("to_close_door", "1");
} }
/** /**
* 判断经过的烘箱是否关门 * 判断经过的烘箱是否关门
*/ */
@@ -875,6 +876,9 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
HongXiangConveyorDeviceDriver hongXiangConveyorDeviceDriver; HongXiangConveyorDeviceDriver hongXiangConveyorDeviceDriver;
if (device.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) { if (device.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) {
hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) device.getDeviceDriver(); hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) device.getDeviceDriver();
// EXECUTOR.submit(() -> {
toOpenDoor(device);
// });
int mode = hongXiangConveyorDeviceDriver.getMode(); int mode = hongXiangConveyorDeviceDriver.getMode();
int door = hongXiangConveyorDeviceDriver.getDoor(); int door = hongXiangConveyorDeviceDriver.getDoor();
int action = hongXiangConveyorDeviceDriver.getAction(); int action = hongXiangConveyorDeviceDriver.getAction();
@@ -914,19 +918,19 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
} }
} }
} else { } else {
feedMessage = "行架机械手:"; feedMessage = "行架机械手:";
if (mode != 3) { if (mode != 3) {
feedMessage = feedMessage + "工作模式(mode)不为运行中状态,"; feedMessage = feedMessage + "工作模式(mode)不为运行中状态,";
} }
if (action != 1) { if (action != 1) {
feedMessage = feedMessage + "动作信号(action)不为取货中状态,"; feedMessage = feedMessage + "动作信号(action)不为取货中状态,";
} }
if (move != 0) { if (move != 0) {
feedMessage = feedMessage + "光电信号(move)不为无货状态,"; feedMessage = feedMessage + "光电信号(move)不为无货状态,";
} }
if (task == 0) { if (task == 0) {
feedMessage = feedMessage + "当前上报任务号(task)不应该为0。"; feedMessage = feedMessage + "当前上报任务号(task)不应该为0。";
} }
} }
//取货完成关闭烘箱门 //取货完成关闭烘箱门
@@ -941,12 +945,43 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
EXECUTOR.execute(() -> { EXECUTOR.execute(() -> {
toCloseDoor(device); toCloseDoor(device);
}); });
int mode = hongXiangConveyorDeviceDriver.getMode();
int door = hongXiangConveyorDeviceDriver.getDoor();
int action = hongXiangConveyorDeviceDriver.getAction();
int error1 = hongXiangConveyorDeviceDriver.getError1();
int error = hongXiangConveyorDeviceDriver.getError();
int move = hongXiangConveyorDeviceDriver.getMove();
if (mode == 1 && door == 2 && action == 2 && error == 0 && error1 == 0 && move == 0) {
map.put("code", "to_command");
map.put("value", "3");
list.add(map);
this.writing(list);
this.setRequireActionSucess(true);
} else {
feedMessage = "烘箱:" + hongXiangConveyorDeviceDriver.getDevice_code();
if (mode != 1) {
feedMessage = feedMessage + "工作模式(mode)信号未联机,";
}
if (door != 2) {
feedMessage = feedMessage + "门状态(door)信号未关门,";
}
if (action != 1) {
feedMessage = feedMessage + "允许取放(action)信号未允许取放,";
}
if (move != 0) {
feedMessage = feedMessage + "取货位光电信号move不应该为有货状态,";
}
if (error1 != 0) {
feedMessage = feedMessage + "故障(error1)信号出现故障,故障值:" + error1 + "";
}
}
} else {
map.put("code", "to_command");
map.put("value", "3");
list.add(map);
this.writing(list);
this.setRequireActionSucess(true);
} }
map.put("code", "to_command");
map.put("value", "3");
list.add(map);
this.writing(list);
this.setRequireActionSucess(true);
} }
} else { } else {
feedMessage = "行架机械手:"; feedMessage = "行架机械手:";
@@ -973,6 +1008,9 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
StandardInspectSiteDeviceDriver standardInspectSiteDeviceDriver; StandardInspectSiteDeviceDriver standardInspectSiteDeviceDriver;
if (nextDevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) { if (nextDevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) {
hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) nextDevice.getDeviceDriver(); hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) nextDevice.getDeviceDriver();
// EXECUTOR.submit(() -> {
toOpenDoor(nextDevice);
// });
int mode = hongXiangConveyorDeviceDriver.getMode(); int mode = hongXiangConveyorDeviceDriver.getMode();
int door = hongXiangConveyorDeviceDriver.getDoor(); int door = hongXiangConveyorDeviceDriver.getDoor();
int action = hongXiangConveyorDeviceDriver.getAction(); int action = hongXiangConveyorDeviceDriver.getAction();
@@ -1052,60 +1090,96 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
map.put("to_time_min", String.valueOf(minutes)); map.put("to_time_min", String.valueOf(minutes));
hongXiangConveyorDeviceDriver.writing(map); hongXiangConveyorDeviceDriver.writing(map);
} }
} int mode = hongXiangConveyorDeviceDriver.getMode();
int door = hongXiangConveyorDeviceDriver.getDoor();
if (nextDevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver||nextDevice.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) { int action = hongXiangConveyorDeviceDriver.getAction();
if (!StrUtil.startWith(taskDto.getTask_code(), "-")) { int error1 = hongXiangConveyorDeviceDriver.getError1();
if (ObjectUtil.isNotEmpty(nextDevice.getExtraValue().get("link_three_lamp"))) { int error = hongXiangConveyorDeviceDriver.getError();
String lamp = nextDevice.getExtraValue().get("link_three_lamp").toString(); int move = hongXiangConveyorDeviceDriver.getMove();
Device lampDevice = deviceAppService.findDeviceByCode(lamp); if (mode == 1 && door == 2 && action == 2 && error == 0 && error1 == 0 && move == 1) {
if (ObjectUtil.isEmpty(lampDevice)) { map.put("code", "to_command");
return; map.put("value", "5");
} list.add(map);
if (lampDevice.getDeviceDriver() instanceof LampThreecolorDeviceDriver) { this.writing(list);
lampThreecolorDeviceDriver = (LampThreecolorDeviceDriver) lampDevice.getDeviceDriver(); this.setRequireActionSucess(true);
LuceneLogDto logDto = LuceneLogDto.builder() try {
.device_code(lampDevice.getDeviceDriver().getDeviceCode()) finish_instruction(inst2);
.content("下发报警灯" + lamp + "报警信号") } catch (Exception e) {
.build(); e.printStackTrace();
logDto.setLog_level(3); }
luceneExecuteLogService.deviceExecuteLog(logDto); feedMessage = "";
lampThreecolorDeviceDriver.writing("to_command", "1"); } else {
} feedMessage = "烘箱:" + hongXiangConveyorDeviceDriver.getDevice_code();
if (mode != 1) {
feedMessage = feedMessage + "工作模式(mode)信号未联机,";
}
if (door != 2) {
feedMessage = feedMessage + "门状态(door)信号未关门,";
}
if (action != 1) {
feedMessage = feedMessage + "允许取放(action)信号未允许取放,";
}
if (move != 1) {
feedMessage = feedMessage + "放货位光电信号不应该为无货状态";
}
if (error1 != 0) {
feedMessage = feedMessage + "故障(error1)信号出现故障。";
} }
} }
} else {
map.put("code", "to_command");
map.put("value", "5");
list.add(map);
this.writing(list);
this.setRequireActionSucess(true);
try {
finish_instruction(inst2);
} catch (Exception e) {
e.printStackTrace();
}
feedMessage = "";
}
// if (nextDevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver||nextDevice.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) {
// if (!StrUtil.startWith(taskDto.getTask_code(), "-")) {
// if (ObjectUtil.isNotEmpty(nextDevice.getExtraValue().get("link_three_lamp"))) {
// String lamp = nextDevice.getExtraValue().get("link_three_lamp").toString();
// Device lampDevice = deviceAppService.findDeviceByCode(lamp);
// if (ObjectUtil.isEmpty(lampDevice)) {
// return;
// }
// if (lampDevice.getDeviceDriver() instanceof LampThreecolorDeviceDriver) {
// lampThreecolorDeviceDriver = (LampThreecolorDeviceDriver) lampDevice.getDeviceDriver();
// LuceneLogDto logDto = LuceneLogDto.builder()
// .device_code(lampDevice.getDeviceDriver().getDeviceCode())
// .content("下发报警灯" + lamp + "报警信号")
// .build();
// logDto.setLog_level(3);
// luceneExecuteLogService.deviceExecuteLog(logDto);
// lampThreecolorDeviceDriver.writing("to_command", "1");
// }
// }
// }
//
} }
map.put("code", "to_command");
map.put("value", "5");
list.add(map);
this.writing(list);
this.setRequireActionSucess(true);
try {
finish_instruction(inst2);
} catch (Exception e) {
e.printStackTrace();
}
feedMessage = "";
} }
}
} else { } else {
feedMessage = "行架机械手:"; feedMessage = "行架机械手:";
if (mode != 3) { if (mode != 3) {
feedMessage = feedMessage + "工作模式(mode)不为运行中状态,"; feedMessage = feedMessage + "工作模式(mode)不为运行中状态,";
} }
if (action != 4) { if (action != 4) {
feedMessage = feedMessage + "动作信号(action)不为放货完成状态,"; feedMessage = feedMessage + "动作信号(action)不为放货完成状态,";
} }
if (move != 0) { if (move != 0) {
feedMessage = feedMessage + "光电信号(move)不为无货状态,"; feedMessage = feedMessage + "光电信号(move)不为无货状态,";
} }
if (task == 0) { if (task == 0) {
feedMessage = feedMessage + "当前上报任务号(task)不应该为0。"; feedMessage = feedMessage + "当前上报任务号(task)不应该为0。";
} }
}
} }
} }
}
public synchronized boolean finish_instruction(Instruction inst) throws Exception { public synchronized boolean finish_instruction(Instruction inst) throws Exception {
instructionService.finish(inst); instructionService.finish(inst);
@@ -1153,8 +1227,8 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
this.setMessage("信号连接异常!"); this.setMessage("信号连接异常!");
} }
String requireActionSucess = LangProcess.msg("universal_directives") + ":" + LangProcess.msg("universal_actionMessage4"); String requireActionSucess = LangProcess.msg("universal_directives") + ":" + LangProcess.msg("universal_actionMessage4");
if(this.requireActionSucess){ if (this.requireActionSucess) {
requireActionSucess = LangProcess.msg("universal_directives") + ":" + LangProcess.msg("universal_actionMessage5"); requireActionSucess = LangProcess.msg("universal_directives") + ":" + LangProcess.msg("universal_actionMessage5");
} }
map.put("device_name", this.getDevice().getDevice_name()); map.put("device_name", this.getDevice().getDevice_name());
map.put("mode", mode); map.put("mode", mode);

View File

@@ -479,15 +479,11 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
luceneLogService.interfaceExecuteLog(luceneLogDto); luceneLogService.interfaceExecuteLog(luceneLogDto);
} catch (Exception e) { } catch (Exception e) {
JSONObject jsonObject = JSONObject.parseObject(result); JSONObject jsonObject = JSONObject.parseObject(result);
log.info("向lms申请套管工位请求----返回参数{}", result); log.info("向lms申请套管工位请求----返回参数{}", e.getMessage());
applyPlugPullSitResponse = JSONObject.toJavaObject(jsonObject, ApplyPlugPullSitResponse.class); applyPlugPullSitResponse = JSONObject.toJavaObject(jsonObject, ApplyPlugPullSitResponse.class);
LuceneLogDto luceneLogDto = new LuceneLogDto(4, "applyPlugPullSiteRequest", String.valueOf(applyPlugPullSitResponse.getstatus()), LuceneLogDto luceneLogDto = new LuceneLogDto(4, "applyPlugPullSiteRequest", String.valueOf(applyPlugPullSitResponse.getstatus()),
JSON.toJSONString(param), String.valueOf(result), "ACS向LMS申请失败"); JSON.toJSONString(param), String.valueOf(result), "向lms申请套管工位请求失败");
luceneLogService.interfaceExecuteLog(luceneLogDto); luceneLogService.interfaceExecuteLog(luceneLogDto);
JSONObject map = new JSONObject();
map.put("status", 400);
map.put("message", e.getMessage());
return JSONObject.toJavaObject(map, ApplyPlugPullSitResponse.class);
} }
} }
@@ -517,12 +513,13 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
log.info("向LMS反馈子卷重量----返回参数{}", result); log.info("向LMS反馈子卷重量----返回参数{}", result);
applyfeedbackSubVolumeWeightResponse = JSONObject.toJavaObject(jsonObject, ApplyfeedbackSubVolumeWeightResponse.class); applyfeedbackSubVolumeWeightResponse = JSONObject.toJavaObject(jsonObject, ApplyfeedbackSubVolumeWeightResponse.class);
} catch (Exception e) { } catch (Exception e) {
String message = e.getMessage();
JSONObject jsonObject = JSONObject.parseObject(result); JSONObject jsonObject = JSONObject.parseObject(result);
log.info("向LMS反馈子卷重量----返回参数{}", result); log.info("向LMS反馈子卷重量----返回参数{}", result);
JSONObject map = new JSONObject(); applyfeedbackSubVolumeWeightResponse = JSONObject.toJavaObject(jsonObject, ApplyfeedbackSubVolumeWeightResponse.class);
map.put("status", 400); LuceneLogDto luceneLogDto = new LuceneLogDto(4, "applyManipulatorAction", String.valueOf(applyfeedbackSubVolumeWeightResponse.getCode()),
map.put("message", e.getMessage()); JSON.toJSONString(param), message, "向LMS反馈子卷重量");
return JSONObject.toJavaObject(map, ApplyfeedbackSubVolumeWeightResponse.class); luceneLogService.interfaceExecuteLog(luceneLogDto);
} }
LuceneLogDto luceneLogDto = new LuceneLogDto(4,"applyfeedbackSubVolumeWeightRequest", String.valueOf(applyfeedbackSubVolumeWeightResponse.getCode()), LuceneLogDto luceneLogDto = new LuceneLogDto(4,"applyfeedbackSubVolumeWeightRequest", String.valueOf(applyfeedbackSubVolumeWeightResponse.getCode()),
JSON.toJSONString(param), String.valueOf(applyfeedbackSubVolumeWeightResponse.getMessage()), "ACS反馈LMS子卷重量"); JSON.toJSONString(param), String.valueOf(applyfeedbackSubVolumeWeightResponse.getMessage()), "ACS反馈LMS子卷重量");
@@ -550,16 +547,13 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
log.info("RGV工位上有货申请行架任务----返回参数{}", result); log.info("RGV工位上有货申请行架任务----返回参数{}", result);
applyManipulatorActionResponse = JSONObject.toJavaObject(jsonObject, ApplyManipulatorActionResponse.class); applyManipulatorActionResponse = JSONObject.toJavaObject(jsonObject, ApplyManipulatorActionResponse.class);
} catch (Exception e) { } catch (Exception e) {
String message = e.getMessage();
JSONObject jsonObject = JSONObject.parseObject(result); JSONObject jsonObject = JSONObject.parseObject(result);
log.info("RGV工位上有货申请行架任务----返回参数{}", result); log.info("RGV工位上有货申请行架任务----返回参数{}", result);
applyManipulatorActionResponse = JSONObject.toJavaObject(jsonObject, ApplyManipulatorActionResponse.class); applyManipulatorActionResponse = JSONObject.toJavaObject(jsonObject, ApplyManipulatorActionResponse.class);
LuceneLogDto luceneLogDto = new LuceneLogDto(4, "applyManipulatorAction", String.valueOf(applyManipulatorActionResponse.getCode()), LuceneLogDto luceneLogDto = new LuceneLogDto(4, "applyManipulatorAction", String.valueOf(applyManipulatorActionResponse.getCode()),
JSON.toJSONString(param), String.valueOf(applyManipulatorActionResponse), "RGV工位上有货申请行架任务失败"); JSON.toJSONString(param), message, "RGV工位上有货申请行架任务失败");
luceneLogService.interfaceExecuteLog(luceneLogDto); luceneLogService.interfaceExecuteLog(luceneLogDto);
JSONObject map = new JSONObject();
map.put("status", 400);
map.put("message", e.getMessage());
return JSONObject.toJavaObject(map, ApplyManipulatorActionResponse.class);
} }
LuceneLogDto luceneLogDto = new LuceneLogDto(4, "applyManipulatorAction", String.valueOf(applyManipulatorActionResponse.getCode()), LuceneLogDto luceneLogDto = new LuceneLogDto(4, "applyManipulatorAction", String.valueOf(applyManipulatorActionResponse.getCode()),
JSON.toJSONString(param), String.valueOf(applyManipulatorActionResponse), "RGV工位上有货申请行架任务"); JSON.toJSONString(param), String.valueOf(applyManipulatorActionResponse), "RGV工位上有货申请行架任务");
@@ -692,11 +686,6 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
String wmsurl = paramService.findByCode(AcsConfig.WMSURL).getValue(); String wmsurl = paramService.findByCode(AcsConfig.WMSURL).getValue();
AddressDto addressDto = addressService.findByCode("actionFinishRequest2"); AddressDto addressDto = addressService.findByCode("actionFinishRequest2");
String url = wmsurl + addressDto.getMethods_url(); String url = wmsurl + addressDto.getMethods_url();
log.info("actionFinishRequest2 - 设备工位取货完成反馈{}", jsonObject);
LuceneLogDto luceneLogDto = new LuceneLogDto(4,"actionFinishRequest2", "",
String.valueOf(jsonObject),
"", jsonObject.getString("task_code") + "设备工位取货完成反馈");
luceneLogService.interfaceExecuteLog(luceneLogDto);
try { try {
execute = HttpRequest.post(url) execute = HttpRequest.post(url)
.body(String.valueOf(jsonObject)) .body(String.valueOf(jsonObject))
@@ -705,7 +694,16 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
String msg = e.getMessage(); String msg = e.getMessage();
log.info("feedbackDie-----输出参数{}", msg); log.info("feedbackDie-----输出参数{}", msg);
//网络不通 //网络不通
LuceneLogDto luceneLogDto1 = new LuceneLogDto(4,"actionFinishRequest2", String.valueOf(execute.getStatus()),
String.valueOf(jsonObject),
String.valueOf(execute.body()), jsonObject.getString("task_code") + "设备工位取货完成反馈失败");
luceneLogService.interfaceExecuteLog(luceneLogDto1);
} }
log.info("actionFinishRequest2 - 设备工位取货完成反馈{}", jsonObject);
LuceneLogDto luceneLogDto = new LuceneLogDto(4,"actionFinishRequest2", "",
String.valueOf(jsonObject),
"", jsonObject.getString("task_code") + "设备工位取货完成反馈");
luceneLogService.interfaceExecuteLog(luceneLogDto);
} catch (Exception e) { } catch (Exception e) {
LuceneLogDto luceneLogDto = new LuceneLogDto(4,"actionFinishRequest2", String.valueOf(execute.getStatus()), LuceneLogDto luceneLogDto = new LuceneLogDto(4,"actionFinishRequest2", String.valueOf(execute.getStatus()),
JSON.toJSONString(execute.body()), JSON.toJSONString(execute.body()),

View File

@@ -499,12 +499,12 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
if (dto.getAgv_system_type().equals(AgvSystemTypeEnum.XG_System_Type.getIndex())) { if (dto.getAgv_system_type().equals(AgvSystemTypeEnum.XG_System_Type.getIndex())) {
String interactionJson = task.getInteraction_json(); String interactionJson = task.getInteraction_json();
if (StrUtil.isEmpty(interactionJson)){ if (StrUtil.isEmpty(interactionJson)) {
throw new BadRequestException("agv叉车调整长宽参数为空"); throw new BadRequestException("agv叉车调整长宽参数为空");
} }
InteractionJsonDTO interactionJsonDTO = JSON.parseObject(interactionJson, InteractionJsonDTO.class); InteractionJsonDTO interactionJsonDTO = JSON.parseObject(interactionJson, InteractionJsonDTO.class);
//仙工叉车 //仙工叉车
HttpResponse response = xiangGongAgvService.sendOrderSequencesToForklift(dto,interactionJsonDTO); HttpResponse response = xiangGongAgvService.sendOrderSequencesToForklift(dto, interactionJsonDTO);
if (ObjectUtils.isEmpty(response) || response.getStatus() != 200) { if (ObjectUtils.isEmpty(response) || response.getStatus() != 200) {
dto.setSend_status("2"); dto.setSend_status("2");
} else { } else {
@@ -647,12 +647,12 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
Device deviceByCode = deviceAppService.findDeviceByCode(dto.getStart_device_code()); Device deviceByCode = deviceAppService.findDeviceByCode(dto.getStart_device_code());
if (dto.getAgv_system_type().equals(AgvSystemTypeEnum.XG_System_Type.getIndex())) { if (dto.getAgv_system_type().equals(AgvSystemTypeEnum.XG_System_Type.getIndex())) {
String interactionJson = task.getInteraction_json(); String interactionJson = task.getInteraction_json();
if (StrUtil.isEmpty(interactionJson)){ if (StrUtil.isEmpty(interactionJson)) {
throw new BadRequestException("agv叉车调整长宽参数为空"); throw new BadRequestException("agv叉车调整长宽参数为空");
} }
InteractionJsonDTO interactionJsonDTO = JSON.parseObject(interactionJson, InteractionJsonDTO.class); InteractionJsonDTO interactionJsonDTO = JSON.parseObject(interactionJson, InteractionJsonDTO.class);
//仙工叉车 //仙工叉车
HttpResponse response = xiangGongAgvService.sendOrderSequencesToForklift(dto,interactionJsonDTO); HttpResponse response = xiangGongAgvService.sendOrderSequencesToForklift(dto, interactionJsonDTO);
if (ObjectUtils.isEmpty(response) || response.getStatus() != 200) { if (ObjectUtils.isEmpty(response) || response.getStatus() != 200) {
dto.setSend_status("2"); dto.setSend_status("2");
} else { } else {
@@ -666,6 +666,24 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
} else { } else {
dto.setSend_status("1"); dto.setSend_status("1");
} }
} else if (dto.getAgv_system_type().equals(AgvSystemTypeEnum.Two_NDC_System_Type.getIndex())) {
NDCAgvService ndcAgvService = SpringContextHolder.getBean(NDCAgvService.class);
log.warn("下发AGV指令数据," + "指令号:" + dto.getInstruction_code() + ",AGV系统类型:" + dto.getAgv_system_type());
try {
ndcAgvService.sendAgvInstToNDC(task.getAgv_system_type(), dto);
dto.setSend_status("1");
} catch (Exception e) {
dto.setSend_status("2");
dto.setRemark(e.getMessage());
e.printStackTrace();
log.warn("下发AGV指令异常:" + e);
LuceneLogDto logDto1 = LuceneLogDto.builder()
.device_code(start_device_code)
.content("下发AGV指令异常")
.build();
logDto1.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto1);
}
} }
} }
} catch (Exception e) { } catch (Exception e) {
@@ -1200,14 +1218,12 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
XianGongAgvService xianGongAgvService = SpringContextHolder.getBean(XianGongAgvService.class); XianGongAgvService xianGongAgvService = SpringContextHolder.getBean(XianGongAgvService.class);
xianGongAgvService.deleteXZAgvInst(entity.getInstruction_code()); xianGongAgvService.deleteXZAgvInst(entity.getInstruction_code());
flag = true; flag = true;
} } else if (ObjectUtil.isNotEmpty(entity.getAgv_system_type()) && entity.getAgv_system_type().equals(AgvSystemTypeEnum.XG_System_Type)
else if (ObjectUtil.isNotEmpty(entity.getAgv_system_type()) && entity.getAgv_system_type().equals(AgvSystemTypeEnum.XG_System_Type)
&& !StrUtil.equals(entity.getSend_status(), "2")) { && !StrUtil.equals(entity.getSend_status(), "2")) {
XianGongAgvService xianGongAgvService = SpringContextHolder.getBean(XianGongAgvService.class); XianGongAgvService xianGongAgvService = SpringContextHolder.getBean(XianGongAgvService.class);
xianGongAgvService.deleteXZAgvInst(entity.getInstruction_code()); xianGongAgvService.deleteXZAgvInst(entity.getInstruction_code());
flag = true; flag = true;
} } else {
else {
flag = true; flag = true;
} }
if (flag) { if (flag) {
@@ -1941,7 +1957,7 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
@Override @Override
public List<Instruction> findByNextCode(String next_code) { public List<Instruction> findByNextCode(String next_code) {
List<Instruction> instructionList = instructions.stream().filter(item -> item.getNext_device_code().equals(next_code) ).collect(Collectors.toList()); List<Instruction> instructionList = instructions.stream().filter(item -> item.getNext_device_code().equals(next_code)).collect(Collectors.toList());
return instructionList; return instructionList;
} }
@@ -1949,11 +1965,11 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
@Override @Override
public List<Instruction> findReadyIns() { public List<Instruction> findReadyIns() {
//根据时间升序取第一个 //根据时间升序取第一个
List<Instruction> instructionsList = instructions.stream() List<Instruction> instructionsList = instructions.stream()
.filter(item -> StrUtil.equals(item.getInstruction_type(), TaskTypeEnum.Truss_Task.getIndex()) .filter(item -> StrUtil.equals(item.getInstruction_type(), TaskTypeEnum.Truss_Task.getIndex())
&& StrUtil.equals(item.getInstruction_status(), TaskStatusEnum.READY.getIndex())).collect(Collectors.toList()); && StrUtil.equals(item.getInstruction_status(), TaskStatusEnum.READY.getIndex())).collect(Collectors.toList());
return instructionsList; return instructionsList;
} }

View File

@@ -236,7 +236,7 @@ public class TaskServiceImpl extends CommonServiceImpl<TaskMapper, Task> impleme
} }
@Override @Override
public Map<String, Object> queryAll( Map whereJson, Pageable page) { public Map<String, Object> queryAll(Map whereJson, Pageable page) {
String task_code = (String) whereJson.get("task_code"); String task_code = (String) whereJson.get("task_code");
String vehicle_code = (String) whereJson.get("vehicle_code"); String vehicle_code = (String) whereJson.get("vehicle_code");
@@ -977,6 +977,29 @@ public class TaskServiceImpl extends CommonServiceImpl<TaskMapper, Task> impleme
instdto.setStart_height(start_height); instdto.setStart_height(start_height);
instdto.setNext_height(next_height); instdto.setNext_height(next_height);
instdto.setAgv_action_type(acsTask.getAgv_action_type()); instdto.setAgv_action_type(acsTask.getAgv_action_type());
if (StrUtil.equals(agv_system_type, CommonFinalParam.TWO)) {
// task_type
//1、生箔 Itype=1:取空,取满,放空,放满;
//2、分切 Itype=3取满、取空、放满、放空
//3、普通任务 Itype=2:取货、放货;
//4、叉车任务
//5、输送任务
//6、行架
//7、立库
if (StrUtil.equals(task_type, CommonFinalParam.ONE)) {
instdto.setAgv_inst_type(CommonFinalParam.ONE);
} else if (StrUtil.equals(task_type, "3")) {
instdto.setAgv_inst_type("2");
} else if (StrUtil.equals(task_type, "2")) {
instdto.setAgv_inst_type("3");
} else if (StrUtil.equals(task_type, "8")) {
instdto.setAgv_inst_type("2");
} else {
log.info("未找到对应的AGV指令类型任务号:" + acsTask.getTask_code() + ",task_type:" + acsTask.getTask_type());
}
} else {
instdto.setAgv_inst_type("4");
}
instructionservice.create2(instdto); instructionservice.create2(instdto);
acsTask.setTask_status(CommonFinalParam.ONE); acsTask.setTask_status(CommonFinalParam.ONE);
this.update(acsTask); this.update(acsTask);
@@ -1633,17 +1656,7 @@ public class TaskServiceImpl extends CommonServiceImpl<TaskMapper, Task> impleme
JSONArray ja = new JSONArray(); JSONArray ja = new JSONArray();
ja.add(feed_jo); ja.add(feed_jo);
//TODO 有需要根据上位系统反馈的信息再做进一步处理 //TODO 有需要根据上位系统反馈的信息再做进一步处理
acstowmsService.feedTaskStatus(ja);
CompletableFuture.runAsync(() -> {
acstowmsService.feedTaskStatus(ja);
// 异步更新指令状态
try {
} catch (Exception e) {
e.printStackTrace();
}
});
} }
} }

View File

@@ -88,6 +88,8 @@ public class LuceneLogDto {
+ home; + home;
} }
public LuceneLogDto(final Integer log_level,final String method, final String status, public LuceneLogDto(final Integer log_level,final String method, final String status,
final String requestparam, final String responseparam, final String content) { final String requestparam, final String responseparam, final String content) {
super(); super();

View File

@@ -18,7 +18,7 @@
style="width: 200px" style="width: 200px"
@change="crud.toQuery" @change="crud.toQuery"
> >
<el-option v-for="item in methods" :key="item.value" :label="item.label" :value="item.value" /> <el-option v-for="item in methods" :key="item.id" :label="item.label" :value="item.value" />
</el-select> </el-select>
<el-input <el-input
v-model="query.requestparam" v-model="query.requestparam"