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);
}
} else if (phase == 0x77) {
} else if (phase == 0x4D) {
if (agvaddr == 0) {
agvaddr = agvaddr_copy;
}
@@ -1014,88 +1014,89 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
}
} else if (ObjectUtil.isNotEmpty(start_device_code) && StrUtil.equals(device_code, next_device_code)) {
if (device.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) {
manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) device.getDeviceDriver();
}
} else if (ObjectUtil.isNotEmpty(start_device_code) && StrUtil.equals(device_code, next_device_code)) {
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);
}
try {
manipulatorAgvStationDeviceDriver.writing(4);
} catch (Exception e) {
e.printStackTrace();
}
} 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);
}
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 {
// data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
// LuceneLogDto logDto = LuceneLogDto.builder()
@@ -1105,7 +1106,6 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
// logDto.setLog_level(4);
// luceneExecuteLogService.deviceExecuteLog(logDto);
// }
}
}
// 取货完毕

View File

@@ -325,7 +325,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
if (ObjectUtil.isEmpty(putDeviceCodeList)) {
putDeviceCodeList = this.getExtraDeviceCodes("put_device_code");
}
if(CollUtil.isEmpty(getDeviceCodeList) || getDeviceCodeList.size() == 0){
if (CollUtil.isEmpty(getDeviceCodeList) || getDeviceCodeList.size() == 0) {
notCreateInstMessage = "未设置取货点";
}
TaskDto task = null;
@@ -702,6 +702,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) nextdevice.getDeviceDriver();
hongXiangConveyorDeviceDriver.writing("to_close_door", "1");
}
/**
* 判断经过的烘箱是否关门
*/
@@ -875,6 +876,9 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
HongXiangConveyorDeviceDriver hongXiangConveyorDeviceDriver;
if (device.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) {
hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) device.getDeviceDriver();
// EXECUTOR.submit(() -> {
toOpenDoor(device);
// });
int mode = hongXiangConveyorDeviceDriver.getMode();
int door = hongXiangConveyorDeviceDriver.getDoor();
int action = hongXiangConveyorDeviceDriver.getAction();
@@ -914,19 +918,19 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
}
}
} else {
feedMessage = "行架机械手:";
if (mode != 3) {
feedMessage = feedMessage + "工作模式(mode)不为运行中状态,";
}
if (action != 1) {
feedMessage = feedMessage + "动作信号(action)不为取货中状态,";
}
if (move != 0) {
feedMessage = feedMessage + "光电信号(move)不为无货状态,";
}
if (task == 0) {
feedMessage = feedMessage + "当前上报任务号(task)不应该为0。";
}
feedMessage = "行架机械手:";
if (mode != 3) {
feedMessage = feedMessage + "工作模式(mode)不为运行中状态,";
}
if (action != 1) {
feedMessage = feedMessage + "动作信号(action)不为取货中状态,";
}
if (move != 0) {
feedMessage = feedMessage + "光电信号(move)不为无货状态,";
}
if (task == 0) {
feedMessage = feedMessage + "当前上报任务号(task)不应该为0。";
}
}
//取货完成关闭烘箱门
@@ -941,12 +945,43 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
EXECUTOR.execute(() -> {
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 {
feedMessage = "行架机械手:";
@@ -973,6 +1008,9 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
StandardInspectSiteDeviceDriver standardInspectSiteDeviceDriver;
if (nextDevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) {
hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) nextDevice.getDeviceDriver();
// EXECUTOR.submit(() -> {
toOpenDoor(nextDevice);
// });
int mode = hongXiangConveyorDeviceDriver.getMode();
int door = hongXiangConveyorDeviceDriver.getDoor();
int action = hongXiangConveyorDeviceDriver.getAction();
@@ -1052,60 +1090,96 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
map.put("to_time_min", String.valueOf(minutes));
hongXiangConveyorDeviceDriver.writing(map);
}
}
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");
}
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 == 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 {
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 {
feedMessage = "行架机械手:";
if (mode != 3) {
feedMessage = feedMessage + "工作模式(mode)不为运行中状态,";
}
if (action != 4) {
feedMessage = feedMessage + "动作信号(action)不为放货完成状态,";
}
if (move != 0) {
feedMessage = feedMessage + "光电信号(move)不为无货状态,";
}
if (task == 0) {
feedMessage = feedMessage + "当前上报任务号(task)不应该为0。";
}
feedMessage = "行架机械手:";
if (mode != 3) {
feedMessage = feedMessage + "工作模式(mode)不为运行中状态,";
}
if (action != 4) {
feedMessage = feedMessage + "动作信号(action)不为放货完成状态,";
}
if (move != 0) {
feedMessage = feedMessage + "光电信号(move)不为无货状态,";
}
if (task == 0) {
feedMessage = feedMessage + "当前上报任务号(task)不应该为0。";
}
}
}
}
}
public synchronized boolean finish_instruction(Instruction inst) throws Exception {
instructionService.finish(inst);
@@ -1153,8 +1227,8 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
this.setMessage("信号连接异常!");
}
String requireActionSucess = LangProcess.msg("universal_directives") + ":" + LangProcess.msg("universal_actionMessage4");
if(this.requireActionSucess){
requireActionSucess = LangProcess.msg("universal_directives") + ":" + LangProcess.msg("universal_actionMessage5");
if (this.requireActionSucess) {
requireActionSucess = LangProcess.msg("universal_directives") + ":" + LangProcess.msg("universal_actionMessage5");
}
map.put("device_name", this.getDevice().getDevice_name());
map.put("mode", mode);

View File

@@ -479,15 +479,11 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
luceneLogService.interfaceExecuteLog(luceneLogDto);
} catch (Exception e) {
JSONObject jsonObject = JSONObject.parseObject(result);
log.info("向lms申请套管工位请求----返回参数{}", result);
log.info("向lms申请套管工位请求----返回参数{}", e.getMessage());
applyPlugPullSitResponse = JSONObject.toJavaObject(jsonObject, ApplyPlugPullSitResponse.class);
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);
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);
applyfeedbackSubVolumeWeightResponse = JSONObject.toJavaObject(jsonObject, ApplyfeedbackSubVolumeWeightResponse.class);
} catch (Exception e) {
String message = e.getMessage();
JSONObject jsonObject = JSONObject.parseObject(result);
log.info("向LMS反馈子卷重量----返回参数{}", result);
JSONObject map = new JSONObject();
map.put("status", 400);
map.put("message", e.getMessage());
return JSONObject.toJavaObject(map, ApplyfeedbackSubVolumeWeightResponse.class);
applyfeedbackSubVolumeWeightResponse = JSONObject.toJavaObject(jsonObject, ApplyfeedbackSubVolumeWeightResponse.class);
LuceneLogDto luceneLogDto = new LuceneLogDto(4, "applyManipulatorAction", String.valueOf(applyfeedbackSubVolumeWeightResponse.getCode()),
JSON.toJSONString(param), message, "向LMS反馈子卷重量");
luceneLogService.interfaceExecuteLog(luceneLogDto);
}
LuceneLogDto luceneLogDto = new LuceneLogDto(4,"applyfeedbackSubVolumeWeightRequest", String.valueOf(applyfeedbackSubVolumeWeightResponse.getCode()),
JSON.toJSONString(param), String.valueOf(applyfeedbackSubVolumeWeightResponse.getMessage()), "ACS反馈LMS子卷重量");
@@ -550,16 +547,13 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
log.info("RGV工位上有货申请行架任务----返回参数{}", result);
applyManipulatorActionResponse = JSONObject.toJavaObject(jsonObject, ApplyManipulatorActionResponse.class);
} catch (Exception e) {
String message = e.getMessage();
JSONObject jsonObject = JSONObject.parseObject(result);
log.info("RGV工位上有货申请行架任务----返回参数{}", result);
applyManipulatorActionResponse = JSONObject.toJavaObject(jsonObject, ApplyManipulatorActionResponse.class);
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);
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()),
JSON.toJSONString(param), String.valueOf(applyManipulatorActionResponse), "RGV工位上有货申请行架任务");
@@ -692,11 +686,6 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
String wmsurl = paramService.findByCode(AcsConfig.WMSURL).getValue();
AddressDto addressDto = addressService.findByCode("actionFinishRequest2");
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 {
execute = HttpRequest.post(url)
.body(String.valueOf(jsonObject))
@@ -705,7 +694,16 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
String msg = e.getMessage();
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) {
LuceneLogDto luceneLogDto = new LuceneLogDto(4,"actionFinishRequest2", String.valueOf(execute.getStatus()),
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())) {
String interactionJson = task.getInteraction_json();
if (StrUtil.isEmpty(interactionJson)){
throw new BadRequestException("agv叉车调整长宽参数为空");
if (StrUtil.isEmpty(interactionJson)) {
throw new BadRequestException("agv叉车调整长宽参数为空");
}
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) {
dto.setSend_status("2");
} else {
@@ -647,12 +647,12 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
Device deviceByCode = deviceAppService.findDeviceByCode(dto.getStart_device_code());
if (dto.getAgv_system_type().equals(AgvSystemTypeEnum.XG_System_Type.getIndex())) {
String interactionJson = task.getInteraction_json();
if (StrUtil.isEmpty(interactionJson)){
throw new BadRequestException("agv叉车调整长宽参数为空");
if (StrUtil.isEmpty(interactionJson)) {
throw new BadRequestException("agv叉车调整长宽参数为空");
}
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) {
dto.setSend_status("2");
} else {
@@ -666,6 +666,24 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
} else {
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) {
@@ -1200,14 +1218,12 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
XianGongAgvService xianGongAgvService = SpringContextHolder.getBean(XianGongAgvService.class);
xianGongAgvService.deleteXZAgvInst(entity.getInstruction_code());
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")) {
XianGongAgvService xianGongAgvService = SpringContextHolder.getBean(XianGongAgvService.class);
xianGongAgvService.deleteXZAgvInst(entity.getInstruction_code());
flag = true;
}
else {
} else {
flag = true;
}
if (flag) {
@@ -1941,7 +1957,7 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
@Override
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;
}
@@ -1949,11 +1965,11 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
@Override
public List<Instruction> findReadyIns() {
//根据时间升序取第一个
List<Instruction> instructionsList = instructions.stream()
.filter(item -> StrUtil.equals(item.getInstruction_type(), TaskTypeEnum.Truss_Task.getIndex())
&& StrUtil.equals(item.getInstruction_status(), TaskStatusEnum.READY.getIndex())).collect(Collectors.toList());
return instructionsList;
//根据时间升序取第一个
List<Instruction> instructionsList = instructions.stream()
.filter(item -> StrUtil.equals(item.getInstruction_type(), TaskTypeEnum.Truss_Task.getIndex())
&& StrUtil.equals(item.getInstruction_status(), TaskStatusEnum.READY.getIndex())).collect(Collectors.toList());
return instructionsList;
}

View File

@@ -236,7 +236,7 @@ public class TaskServiceImpl extends CommonServiceImpl<TaskMapper, Task> impleme
}
@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 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.setNext_height(next_height);
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);
acsTask.setTask_status(CommonFinalParam.ONE);
this.update(acsTask);
@@ -1633,17 +1656,7 @@ public class TaskServiceImpl extends CommonServiceImpl<TaskMapper, Task> impleme
JSONArray ja = new JSONArray();
ja.add(feed_jo);
//TODO 有需要根据上位系统反馈的信息再做进一步处理
CompletableFuture.runAsync(() -> {
acstowmsService.feedTaskStatus(ja);
// 异步更新指令状态
try {
} catch (Exception e) {
e.printStackTrace();
}
});
acstowmsService.feedTaskStatus(ja);
}
}

View File

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

View File

@@ -18,7 +18,7 @@
style="width: 200px"
@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-input
v-model="query.requestparam"