add:代码优化

This commit is contained in:
2025-04-10 20:56:50 +08:00
parent a7a0b4f1fa
commit 039ea2579a
16 changed files with 413 additions and 196 deletions

View File

@@ -69,8 +69,8 @@ public class AgvWaitUtil {
return map;
} else {
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(inst.getCarno())
.content("agv诺宝对接位行架不允许取货:" + inst.getCarno() + "点位号" + manipulatorAgvStationDeviceDriver.getDevice_code())
.device_code(manipulatorAgvStationDeviceDriver.getDevice_code())
.content("未给agv进入信号原因是:" + manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1")
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
@@ -138,6 +138,16 @@ public class AgvWaitUtil {
if (manipulatorAgvStationDeviceDriver.getTo_command() != 3) {
manipulatorAgvStationDeviceDriver.writing(3);
}
if (manipulatorAgvStationDeviceDriver.getAction() != 0) {
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(manipulatorAgvStationDeviceDriver.getDevice_code())
.content("未给agv离开信号原因是" + manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为0")
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
log.info("不允许仙工AGV取货,对接位有报警,设备号 - {}", startDeviceCode);
throw new BadRequestException("上位系统不允许agv离开");
}
}
}
@@ -194,8 +204,8 @@ public class AgvWaitUtil {
}
if (manipulatorAgvStationDeviceDriver.getAction() != 1) {
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(inst.getCarno())
.content("agv诺宝对接位行架不允许放货:" + inst.getCarno() + "点位号" + manipulatorAgvStationDeviceDriver.getDevice_code())
.device_code(manipulatorAgvStationDeviceDriver.getDevice_code())
.content("未给agv进入信号原因是:" + manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1")
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
@@ -228,6 +238,16 @@ public class AgvWaitUtil {
if (manipulatorAgvStationDeviceDriver.getTo_command() != 5) {
manipulatorAgvStationDeviceDriver.writing(5);
}
if (manipulatorAgvStationDeviceDriver.getAction() != 0) {
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(manipulatorAgvStationDeviceDriver.getDevice_code())
.content("未给agv离开信号原因是" + manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为0")
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
log.info("不允许仙工AGV取货,对接位有报警,设备号 - {}", endDeviceCode);
throw new BadRequestException("上位系统不允许agv离开");
}
}
}

View File

@@ -108,7 +108,7 @@ public class TwoNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
byte[] b = new byte[1024];
socket = new Socket();
socket.connect(socketAddress, 2 * 1000);
socket.connect(socketAddress, 5 * 1000);
socket.setKeepAlive(true);//长链接
socket.setSoTimeout(30000);//读取超时时间
dos = new DataOutputStream(socket.getOutputStream());
@@ -117,7 +117,7 @@ public class TwoNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
while (socket.isConnected()) {
System.out.println("当前socket状态"+socket.isConnected());
int count = dis.read(b);
System.out.println("当前count值"+count);
// System.out.println("当前count值"+count);
if (count == -1) {
log.error("agv连接出现异常:服务端被关闭");
if (ObjectUtil.isNotEmpty(socket)) {

View File

@@ -321,7 +321,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
log.info("设备{},动作信号{} ,不满足取货条件,指令号{}", manipulatorAgvStationDeviceDriver.getDeviceCode(), manipulatorAgvStationDeviceDriver.getAction(), ikey);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(manipulatorAgvStationDeviceDriver.getDeviceCode())
.content(manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1")
.content("未给agv进入信号原因是" + manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1")
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
@@ -563,25 +563,34 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
} catch (Exception e) {
e.printStackTrace();
}
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);
String task_code = inst.getTask_code();
if (ObjectUtil.isNotEmpty(manipulatorAgvStationDeviceDriver.getDevice().getExtraValue().get("feedbackToLms"))
&& StrUtil.equals("true", manipulatorAgvStationDeviceDriver.getDevice().getExtraValue().get("feedbackToLms").toString())) {
JSONObject jsonObject = new JSONObject();
jsonObject.put("task_code", task_code);
LuceneLogDto logDto1 = LuceneLogDto.builder()
.device_code(manipulatorAgvStationDeviceDriver.getDevice_code())
.content("取货完成反馈:" + jsonObject.toJSONString() + ";设备:" + manipulatorAgvStationDeviceDriver.getDeviceCode())
if (manipulatorAgvStationDeviceDriver.getAction() == 0) {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(this.getDeviceCode())
.content("agvphase:" + phase + "反馈:" + data)
.build();
logDto1.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto1);
acsToWmsService.actionFinishRequest2(jsonObject);
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
String task_code = inst.getTask_code();
if (ObjectUtil.isNotEmpty(manipulatorAgvStationDeviceDriver.getDevice().getExtraValue().get("feedbackToLms"))
&& StrUtil.equals("true", manipulatorAgvStationDeviceDriver.getDevice().getExtraValue().get("feedbackToLms").toString())) {
JSONObject jsonObject = new JSONObject();
jsonObject.put("task_code", task_code);
LuceneLogDto logDto1 = LuceneLogDto.builder()
.device_code(manipulatorAgvStationDeviceDriver.getDevice_code())
.content("取货完成反馈:" + jsonObject.toJSONString() + ";设备:" + manipulatorAgvStationDeviceDriver.getDeviceCode())
.build();
logDto1.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto1);
acsToWmsService.actionFinishRequest2(jsonObject);
}
} else {
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(manipulatorAgvStationDeviceDriver.getDevice_code())
.content("未给agv离开信号原因是" + manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为0")
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
}
} else if (device.getDeviceDriver() instanceof HongXiangStationDeviceDriver) {
hongXiangStationDeviceDriver = (HongXiangStationDeviceDriver) device.getDeviceDriver();
@@ -800,8 +809,8 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
} else {
message = "设备号:" + device_code + ",动作信号:" + manipulatorAgvStationDeviceDriver.getAction() + "报警信号:" + ",指令号:" + ikey + "不满足取货条件";
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(manipulatorAgvStationDeviceDriver.getDevice_code())
.content(manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1")
.device_code(manipulatorAgvStationDeviceDriver.getDeviceCode())
.content("未给agv进入信号原因是" + manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1")
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
@@ -1005,7 +1014,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
message = "设备号:" + device_code + ",动作信号:" + manipulatorAgvStationDeviceDriver.getAction() + "报警信号:" + ",指令号:" + ikey + "不满足取货条件";
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(manipulatorAgvStationDeviceDriver.getDeviceCode())
.content(manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1")
.content("未给agv进入信号原因是" + manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1")
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
@@ -1032,7 +1041,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
message = "设备号:" + device_code + ",动作信号:" + manipulatorAgvStationDeviceDriver.getAction() + "报警信号:" + ",指令号:" + ikey + "不满足取货条件";
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(manipulatorAgvStationDeviceDriver.getDeviceCode())
.content(manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1")
.content("未给agv进入信号原因是" + manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1")
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
@@ -1058,8 +1067,8 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
} else {
message = "设备号:" + device_code + ",动作信号:" + manipulatorAgvStationDeviceDriver.getAction() + "报警信号:" + ",指令号:" + ikey + "不满足取货条件";
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(this.getDeviceCode())
.content(manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1")
.device_code(manipulatorAgvStationDeviceDriver.getDeviceCode())
.content("未给agv进入信号原因是" + manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1")
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
@@ -1086,7 +1095,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
message = "设备号:" + manipulatorAgvStationDeviceDriver.getDevice_code() + ",动作信号:" + manipulatorAgvStationDeviceDriver.getAction() + "报警信号:" + ",指令号:" + ikey + "不满足取货条件";
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(manipulatorAgvStationDeviceDriver.getDeviceCode())
.content(manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1")
.content("未给agv进入信号原因是" + manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1")
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
@@ -1213,25 +1222,34 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
} catch (Exception e) {
e.printStackTrace();
}
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);
String task_code = inst.getTask_code();
if (ObjectUtil.isNotEmpty(manipulatorAgvStationDeviceDriver.getDevice().getExtraValue().get("feedbackToLms"))
&& StrUtil.equals("true", manipulatorAgvStationDeviceDriver.getDevice().getExtraValue().get("feedbackToLms").toString())) {
JSONObject jsonObject = new JSONObject();
jsonObject.put("task_code", task_code);
LuceneLogDto logDto1 = LuceneLogDto.builder()
.device_code(manipulatorAgvStationDeviceDriver.getDevice_code())
.content("取货完成反馈:" + jsonObject.toJSONString() + ";设备:" + manipulatorAgvStationDeviceDriver.getDeviceCode())
if (manipulatorAgvStationDeviceDriver.getAction() == 0) {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(this.getDeviceCode())
.content("agvphase:" + phase + "反馈:" + data)
.build();
logDto1.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto1);
acsToWmsService.actionFinishRequest2(jsonObject);
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
String task_code = inst.getTask_code();
if (ObjectUtil.isNotEmpty(manipulatorAgvStationDeviceDriver.getDevice().getExtraValue().get("feedbackToLms"))
&& StrUtil.equals("true", manipulatorAgvStationDeviceDriver.getDevice().getExtraValue().get("feedbackToLms").toString())) {
JSONObject jsonObject = new JSONObject();
jsonObject.put("task_code", task_code);
LuceneLogDto logDto1 = LuceneLogDto.builder()
.device_code(manipulatorAgvStationDeviceDriver.getDevice_code())
.content("取货完成反馈:" + jsonObject.toJSONString() + ";设备:" + manipulatorAgvStationDeviceDriver.getDeviceCode())
.build();
logDto1.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto1);
acsToWmsService.actionFinishRequest2(jsonObject);
}
} else {
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(manipulatorAgvStationDeviceDriver.getDevice_code())
.content("未给agv离开信号原因是" + manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为0")
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
}
} else if (device.getDeviceDriver() instanceof PaperTubePickSiteDeviceDriver) {
paperTubePickSiteDeviceDriver = (PaperTubePickSiteDeviceDriver) device.getDeviceDriver();
@@ -1429,7 +1447,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
log.info("设备{},动作信号{} ,不满足取货条件,指令号{}", device_code, manipulatorAgvStationDeviceDriver.getAction(), ikey);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(manipulatorAgvStationDeviceDriver.getDeviceCode())
.content(manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1")
.content("未给agv进入信号原因是" + manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1")
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
@@ -1643,13 +1661,22 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
} catch (Exception e) {
e.printStackTrace();
}
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);
if (manipulatorAgvStationDeviceDriver.getAction() == 0) {
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 {
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(manipulatorAgvStationDeviceDriver.getDevice_code())
.content("未给agv离开信号原因是" + manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为0")
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
}
} else if (device.getDeviceDriver() instanceof HongXiangStationDeviceDriver) {
hongXiangStationDeviceDriver = (HongXiangStationDeviceDriver) device.getDeviceDriver();
try {
@@ -1687,10 +1714,28 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
String to_material = jsonObject.getString("to_material");
String to_spec = jsonObject.getString("to_spec");
String to_qty = jsonObject.getString("to_qty");
String to_material1 = jsonObject.getString("to_material1");
String to_spec1 = jsonObject.getString("to_spec1");
String to_qty1 = jsonObject.getString("to_qty1");
map.put("to_command", 5);
map.put("to_material", to_material);
map.put("to_spec", to_spec);
map.put("to_qty", to_qty);
// if ("BH_17".equals(device_code)) {
// map.put("to_material1", to_material1);
// map.put("to_spec1", to_spec1);
// map.put("to_qty1", to_qty1);
// }
// if ("BH_18".equals(device_code)) {
// map.put("to_material2", to_material1);
// map.put("to_spec2", to_spec1);
// map.put("to_qty2", to_qty1);
// }
// if ("BH_19".equals(device_code)) {
// map.put("to_material3", to_material1);
// map.put("to_spec3", to_spec1);
// map.put("to_qty3", to_qty1);
// }
paperTubePickSiteDeviceDriver.writing(map);
} else {
map.put("to_command", 5);
@@ -1856,7 +1901,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
log.info("设备{},动作信号{} ,不满足取货条件,指令号{}", device_code, manipulatorAgvStationDeviceDriver.getAction(), ikey);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(manipulatorAgvStationDeviceDriver.getDeviceCode())
.content(manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1")
.content("未给agv进入信号原因是" + manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1")
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
@@ -2053,13 +2098,22 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
} catch (Exception e) {
e.printStackTrace();
}
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);
if (manipulatorAgvStationDeviceDriver.getAction() == 0) {
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 {
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(manipulatorAgvStationDeviceDriver.getDevice_code())
.content("未给agv离开信号原因是" + manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为0")
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
}
} else if (device.getDeviceDriver() instanceof PaperTubePickSiteDeviceDriver) {
paperTubePickSiteDeviceDriver = (PaperTubePickSiteDeviceDriver) device.getDeviceDriver();
try {

View File

@@ -191,9 +191,7 @@ public class FoldDiscSiteDeviceDriver extends AbstractOpcDeviceDriver implements
container_type = this.itemProtocol.getContainer_type();
carrier_direction = this.itemProtocol.getCarrier_direction();
if (mode != last_mode) {
requireSucess = false;
}
// 更新指令状态
if (move != 0 && task > 0) {
@@ -383,15 +381,20 @@ public class FoldDiscSiteDeviceDriver extends AbstractOpcDeviceDriver implements
map3.put("value", "1");
list.add(map3);
this.writing(list);
requireSucess = true;
while (!StrUtil.equals(this.getOpcValueAccessor().getValue(this.getOpcServer() + "." + this.getOpcPlc() + "." + this.getDevice_code() + ".task").toString()
try {
Thread.sleep(500);
} catch (InterruptedException e) {
e.printStackTrace();
}
if (!StrUtil.equals(this.getOpcValueAccessor().getValue(this.getOpcServer() + "." + this.getOpcPlc() + "." + this.getDevice_code() + ".task").toString()
, inst.getInstruction_code())) {
this.writing(list);
try {
Thread.sleep(500);
} catch (InterruptedException e) {
e.printStackTrace();
}
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content(device_code + "电气的指令号:" + this.getOpcValueAccessor().getValue(this.getOpcServer() + "." + this.getOpcPlc() + "." + this.getDevice_code() + ".task").toString() + "与系统下发的指令:+" + inst.getInstruction_code() + "不一致,再次下发电气信号")
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
if (ObjectUtil.isEmpty(instructionService.findByTaskcodeAndStatus(taskdto.getTask_code()))) {
requireSucess = false;
return false;
@@ -504,7 +507,6 @@ public class FoldDiscSiteDeviceDriver extends AbstractOpcDeviceDriver implements
//创建指令后修改任务状态
taskdto.setTask_status(TaskStatusEnum.BUSY.getIndex());
taskserver.update(taskdto);
requireSucess = true;
String next_addr = nextDevice.getExtraValue().get("address").toString();
List list = new ArrayList();
@@ -521,26 +523,27 @@ public class FoldDiscSiteDeviceDriver extends AbstractOpcDeviceDriver implements
map3.put("value", "1");
list.add(map3);
this.writing(list);
requireSucess = true;
while (!StrUtil.equals(this.getOpcValueAccessor().getValue(this.getOpcServer() + "." + this.getOpcPlc() + "." + this.getDevice_code() + ".task").toString()
try {
Thread.sleep(500);
} catch (InterruptedException e) {
e.printStackTrace();
}
if (!StrUtil.equals(this.getOpcValueAccessor().getValue(this.getOpcServer() + "." + this.getOpcPlc() + "." + this.getDevice_code() + ".task").toString()
, instdto.getInstruction_code())) {
this.writing(list);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content(device_code + instdto.getInstruction_code() + "再次下发电气信号")
.build();
logDto.setLog_level(3);
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
if (ObjectUtil.isEmpty(taskserver.findByCode(taskdto.getTask_code()))) {
requireSucess = false;
return false;
}
}
requireSucess = true;
} else {
//如果不存在则直接找对应指令
Instruction inst = instructionService.findByDeviceCodeFromCache(this.device_code);
@@ -565,26 +568,26 @@ public class FoldDiscSiteDeviceDriver extends AbstractOpcDeviceDriver implements
map3.put("value", "1");
list.add(map3);
this.writing(list);
requireSucess = true;
while (!StrUtil.equals(this.getOpcValueAccessor().getValue(this.getOpcServer() + "." + this.getOpcPlc() + "." + this.getDevice_code() + ".task").toString()
try {
Thread.sleep(500);
} catch (InterruptedException e) {
e.printStackTrace();
}
if (!StrUtil.equals(this.getOpcValueAccessor().getValue(this.getOpcServer() + "." + this.getOpcPlc() + "." + this.getDevice_code() + ".task").toString()
, inst.getInstruction_code())) {
this.writing(list);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content(device_code + inst.getInstruction_code() + "再次下发电气信号")
.build();
logDto.setLog_level(3);
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
try {
Thread.sleep(500);
} catch (InterruptedException e) {
e.printStackTrace();
}
if (ObjectUtil.isEmpty(instructionService.findByDeviceCodeFromCache(this.device_code))) {
requireSucess = false;
return false;
}
}
requireSucess = true;
}
return true;
}

View File

@@ -248,7 +248,7 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
barcode = this.itemProtocol.getBarcode();
material_barcode = this.itemProtocol.getMaterialBarcode();
to_height_level = this.itemProtocol.getTo_height_level();
}catch (Exception e){
} catch (Exception e) {
this.iserror = true;
String extracted = DeviceErrorUtil.extracted(e);
LuceneLogDto logDto = LuceneLogDto.builder()
@@ -953,26 +953,26 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
map3.put("value", "1");
list.add(map3);
this.writing(list);
requireSucess = true;
while (!StrUtil.equals(this.getOpcValueAccessor().getValue(this.getOpcServer() + "." + this.getOpcPlc() + "." + this.getDevice_code() + ".task").toString()
try {
Thread.sleep(500);
} catch (InterruptedException e) {
e.printStackTrace();
}
if (!StrUtil.equals(this.getOpcValueAccessor().getValue(this.getOpcServer() + "." + this.getOpcPlc() + "." + this.getDevice_code() + ".task").toString()
, inst.getInstruction_code())) {
this.writing(list);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content(device_code + inst.getInstruction_code() + "再次下发电气信号")
.content(device_code + "电气的指令号:" + this.getOpcValueAccessor().getValue(this.getOpcServer() + "." + this.getOpcPlc() + "." + this.getDevice_code() + ".task").toString() + "与系统下发的指令:+" + inst.getInstruction_code() + "不一致,再次下发电气信号")
.build();
logDto.setLog_level(3);
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
try {
Thread.sleep(500);
} catch (InterruptedException e) {
e.printStackTrace();
}
if (ObjectUtil.isEmpty(instructionService.findByDeviceCodeFromCache(this.device_code))) {
requireSucess = false;
return true;
}
}
requireSucess = true;
return false;
}
@@ -1090,40 +1090,41 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
map4.put("value", "1");
list2.add(map4);
this.writing(list2);
led_message = getLedMessage(instdto);
List<String> deviceCodes = this.getExtraDeviceCodes("link_device_code");
String device = null;
if (ObjectUtil.isNotEmpty(deviceCodes)) {
for (String deviceCode : deviceCodes) {
Device linkDevice = deviceAppService.findDeviceByCode(deviceCode);
if (ObjectUtil.isEmpty(linkDevice)) {
throw new BadRequestException("设备:" + device_code + "关联设备->" + deviceCode + "为空!");
}
if (linkDevice.getDeviceDriver() instanceof LedScreenDeviceDriver) {
device = deviceCode;
}
}
// led_message = getLedMessage(instdto);
// List<String> deviceCodes = this.getExtraDeviceCodes("link_device_code");
// String device = null;
// if (ObjectUtil.isNotEmpty(deviceCodes)) {
// for (String deviceCode : deviceCodes) {
// Device linkDevice = deviceAppService.findDeviceByCode(deviceCode);
// if (ObjectUtil.isEmpty(linkDevice)) {
// throw new BadRequestException("设备:" + device_code + "关联设备->" + deviceCode + "为空!");
// }
// if (linkDevice.getDeviceDriver() instanceof LedScreenDeviceDriver) {
// device = deviceCode;
// }
// }
// }
// taskScreenService.getLedMessage(device);
try {
Thread.sleep(500);
} catch (InterruptedException e) {
e.printStackTrace();
}
taskScreenService.getLedMessage(device);
requireSucess = true;
while (!StrUtil.equals(this.getOpcValueAccessor().getValue(this.getOpcServer() + "." + this.getOpcPlc() + "." + this.getDevice_code() + ".task").toString()
if (!StrUtil.equals(this.getOpcValueAccessor().getValue(this.getOpcServer() + "." + this.getOpcPlc() + "." + this.getDevice_code() + ".task").toString()
, instdto.getInstruction_code())) {
this.writing(list);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content(device_code + instdto.getInstruction_code() + "再次下发电气信号")
.content(device_code + "电气的指令号:" + this.getOpcValueAccessor().getValue(this.getOpcServer() + "." + this.getOpcPlc() + "." + this.getDevice_code() + ".task").toString() + "与系统下发的指令:+" + instdto.getInstruction_code() + "不一致,再次下发电气信号")
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
if (ObjectUtil.isEmpty(taskserver.findByCode(taskdto.getTask_code()))) {
requireSucess = false;
return true;
}
}
requireSucess = true;
return false;
}

View File

@@ -221,7 +221,7 @@ public class TrappedManipulatorManipulatorDeviceDriver extends AbstractOpcDevice
this.iserror = true;
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content(this.device_code + "读取信号值时出现异常:" + var17.getMessage() + ",this.itemProtocol is null")
.content(this.device_code + "读取信号值时出现异常:" + Arrays.toString(var17.getStackTrace()))
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);

View File

@@ -39,6 +39,25 @@ public class ItemProtocol {
public static String item_to_spec = "to_spec";
//下发物料数量
public static String item_to_qty = "to_qty";
//下发BH-17物料类型
public static String item_to_material1 = "to_material1";
//下发BH-17物料规格
public static String item_to_spec1 = "to_spec1";
//下发BH-17物料数量
public static String item_to_qty1 = "to_qty1";
//下发BH-18物料类型
public static String item_to_material2 = "to_material2";
//下发BH-18物料规格
public static String item_to_spec2 = "to_spec2";
//下发BH-18物料数量
public static String item_to_qty2 = "to_qty2";
//下发BH-19物料类型
public static String item_to_material3 = "to_material3";
//下发BH-19物料规格
public static String item_to_spec3 = "to_spec3";
//下发BH-19物料数量
public static String item_to_qty3 = "to_qty3";
private PaperTubePickSiteDeviceDriver driver;
@@ -139,6 +158,15 @@ public class ItemProtocol {
list.add(new ItemDto(item_to_material, "下发物料类型", "DB2.W2"));
list.add(new ItemDto(item_to_spec, "下发物料规格", "DB2.W4"));
list.add(new ItemDto(item_to_qty, "下发物料数量", "DB2.W8"));
// list.add(new ItemDto(item_to_material1, "下发BH-17物料类型", "DB2.W2"));
// list.add(new ItemDto(item_to_spec1, "下发BH-17物料规格", "DB2.W4"));
// list.add(new ItemDto(item_to_qty1, "下发BH-17物料数量", "DB2.W8"));
// list.add(new ItemDto(item_to_material2, "下发BH-18物料类型", "DB2.W2"));
// list.add(new ItemDto(item_to_spec2, "下发BH-18物料规格", "DB2.W4"));
// list.add(new ItemDto(item_to_qty2, "下发BH-18物料数量", "DB2.W8"));
// list.add(new ItemDto(item_to_material3, "下发BH-19物料类型", "DB2.W2"));
// list.add(new ItemDto(item_to_spec3, "下发BH-19物料规格", "DB2.W4"));
// list.add(new ItemDto(item_to_qty3, "下发BH-19物料数量", "DB2.W8"));
return list;
}
}

View File

@@ -105,6 +105,33 @@ public class PaperTubePickSiteDeviceDriver extends AbstractOpcDeviceDriver imple
//下发物料数量
int to_qty=0;
int last_to_qty=0;
// //下发物料类型
// String to_material1 =null;
// String last_to_material1 =null;
// //下发物料规格
// int to_spec1=0;
// int last_to_spec1=0;
// //下发物料数量
// int to_qty1=0;
// int last_to_qty1=0;//下发物料类型
// String to_material2 =null;
// String last_to_material2 =null;
// //下发物料规格
// int to_spec2=0;
// int last_to_spec2=0;
// //下发物料数量
// int to_qty2=0;
// int last_to_qty2=0;//下发物料类型
// String to_material3 =null;
// String last_to_material3 =null;
// //下发物料规格
// int to_spec3=0;
// int last_to_spec3=0;
// //下发物料数量
// int to_qty3=0;
// int last_to_qty3=0;
//管芯编码
String paper_code = null;
int paper_location = 0 ;

View File

@@ -221,7 +221,13 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
} catch (Exception var17) {
var17.printStackTrace();
// feedMessage = var17.getMessage();
logServer.deviceExecuteLog(this.device_code, "", "", "读取信号值时出现异常:" + var17.getMessage() + ",this.itemProtocol is null:" + ObjectUtil.isEmpty(this.itemProtocol));
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content(this.device_code + "读取信号值时出现异常:" + Arrays.toString(var17.getStackTrace()))
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
}
if (mode == 0) {

View File

@@ -195,31 +195,42 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl
@Override
public void execute() throws Exception {
device_code = this.getDeviceCode();
mode = this.itemProtocol.getMode();
move = this.itemProtocol.getMove();
action = this.itemProtocol.getAction();
error = this.itemProtocol.getError();
task = this.itemProtocol.getTask();
heartbeat = this.itemProtocol.getHeartbeat();
barcode = this.itemProtocol.getBarcode();
weight1 = this.itemProtocol.getWeight1();
material1 = this.itemProtocol.getMaterial1();
weight2 = this.itemProtocol.getWeight2();
size = this.itemProtocol.getSize();
material2 = this.itemProtocol.getMaterial2();
toCommand = this.itemProtocol.getTo_command();
toMaterial1 = this.itemProtocol.getTo_material1();
toMaterial2 = this.itemProtocol.getTo_material2();
toMaterial3 = this.itemProtocol.getTo_material3();
toMaterial4 = this.itemProtocol.getTo_material4();
toQty1 = this.itemProtocol.getTo_qty1();
toQty2 = this.itemProtocol.getTo_qty2();
toQzzType = this.itemProtocol.getTo_qzz_type();
toSize1 = this.itemProtocol.getTo_size1();
toSize2 = this.itemProtocol.getTo_size2();
toSize3 = this.itemProtocol.getTo_size3();
toSize4 = this.itemProtocol.getTo_size4();
try {
device_code = this.getDeviceCode();
mode = this.itemProtocol.getMode();
move = this.itemProtocol.getMove();
action = this.itemProtocol.getAction();
error = this.itemProtocol.getError();
task = this.itemProtocol.getTask();
heartbeat = this.itemProtocol.getHeartbeat();
barcode = this.itemProtocol.getBarcode();
weight1 = this.itemProtocol.getWeight1();
material1 = this.itemProtocol.getMaterial1();
weight2 = this.itemProtocol.getWeight2();
size = this.itemProtocol.getSize();
material2 = this.itemProtocol.getMaterial2();
toCommand = this.itemProtocol.getTo_command();
toMaterial1 = this.itemProtocol.getTo_material1();
toMaterial2 = this.itemProtocol.getTo_material2();
toMaterial3 = this.itemProtocol.getTo_material3();
toMaterial4 = this.itemProtocol.getTo_material4();
toQty1 = this.itemProtocol.getTo_qty1();
toQty2 = this.itemProtocol.getTo_qty2();
toQzzType = this.itemProtocol.getTo_qzz_type();
toSize1 = this.itemProtocol.getTo_size1();
toSize2 = this.itemProtocol.getTo_size2();
toSize3 = this.itemProtocol.getTo_size3();
toSize4 = this.itemProtocol.getTo_size4();
} catch (Exception var17) {
var17.printStackTrace();
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content(this.device_code + "读取信号值时出现异常:" + Arrays.toString(var17.getStackTrace()))
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
}
if (mode != lastMode) {
requireSucess = false;

View File

@@ -246,10 +246,14 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
ManipulatorApplyPointRequest manipulatorApplyPointRequest = new ManipulatorApplyPointRequest();
ManipulatorApplyPointResponse manipulatorApplyPointResponse;
inst = checkInst();
if (ObjectUtil.isEmpty(inst)) {
log.info("指令号为空!");
return;
}
String task_code = inst.getTask_code();
manipulatorApplyPointRequest.setType("1");
manipulatorApplyPointRequest.setTask_code(task_code);
if (toCommand != 6) {
if (to_getpoint == 0) {
manipulatorApplyPointResponse = acsToWmsService.manipulatorApplyPointRequest(manipulatorApplyPointRequest);
if (manipulatorApplyPointResponse.getstatus() == 200) {
LuceneLogDto logDto1 = LuceneLogDto.builder()
@@ -261,10 +265,16 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
String get_device_code = manipulatorApplyPointResponse.getDevice_code();
Device device = deviceAppService.findDeviceByCode(get_device_code);
String to_new_getpoint = device.getExtraValue().get("address").toString();
Map<String, Object> map = new LinkedHashMap<>();
map.put("to_command", "6");
map.put("to_getpoint", Integer.parseInt(to_new_getpoint));
this.writing(map);
List list = new ArrayList();
Map<String, Object> map1 = new HashMap<>();
Map<String, Object> map2 = new HashMap<>();
map1.put("code", "to_command");
map1.put("value", "6");
map2.put("code", "to_getpoint");
map2.put("value", Integer.parseInt(to_new_getpoint));
list.add(map1);
list.add(map2);
this.writing(list);
message = "申请新取货点成功";
} else {
message = "申请新取货点失败";
@@ -285,10 +295,14 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
ManipulatorApplyPointRequest manipulatorApplyPointRequest = new ManipulatorApplyPointRequest();
ManipulatorApplyPointResponse manipulatorApplyPointResponse;
inst = checkInst();
if (ObjectUtil.isEmpty(inst)) {
log.info("指令号为空!");
return;
}
String task_code = inst.getTask_code();
manipulatorApplyPointRequest.setType("2");
manipulatorApplyPointRequest.setTask_code(task_code);
if (toCommand != 7) {
if (to_putpoint == 0) {
manipulatorApplyPointResponse = acsToWmsService.manipulatorApplyPointRequest(manipulatorApplyPointRequest);
if (manipulatorApplyPointResponse.getstatus() == 200) {
LuceneLogDto logDto1 = LuceneLogDto.builder()
@@ -300,10 +314,16 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
String put_device_code = manipulatorApplyPointResponse.getDevice_code();
Device device = deviceAppService.findDeviceByCode(put_device_code);
String to_new_putpoint = device.getExtraValue().get("address").toString();
Map<String, Object> map = new LinkedHashMap<>();
map.put("to_command", "7");
map.put("to_putpoint", Integer.parseInt(to_new_putpoint));
this.writing(map);
List list = new ArrayList();
Map<String, Object> map1 = new HashMap<>();
Map<String, Object> map2 = new HashMap<>();
map1.put("code", "to_command");
map1.put("value", "6");
map2.put("code", "to_putpoint");
map2.put("value", Integer.parseInt(to_new_putpoint));
list.add(map1);
list.add(map2);
this.writing(list);
message = "申请新放货点成功";
} else {
message = "申请新放货点失败";
@@ -315,8 +335,12 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
} catch (Exception var17) {
var17.printStackTrace();
// feedMessage = var17.getMessage();
logServer.deviceExecuteLog(this.device_code, "", "", "读取信号值时出现异常:" + var17.getMessage() + ",this.itemProtocol is null:" + ObjectUtil.isEmpty(this.itemProtocol));
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content(this.device_code + "读取信号值时出现异常:" + Arrays.toString(var17.getStackTrace()))
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
}
@@ -413,9 +437,12 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
Instruction inst2 = checkInst();
if (inst2 != null) {
if (StrUtil.equals(inst.getInstruction_status(), InstructionStatusEnum.BUSY.getIndex())) {
Map<String, Object> map = new LinkedHashMap<>();
map.put("to_command", "5");
this.writing(map);
List list = new ArrayList();
Map<String, Object> map1 = new HashMap<>();
map1.put("code", "to_command");
map1.put("value", "5");
list.add(map1);
this.writing(list);
message = "universal_message1";
try {
finish_instruction(inst2);

View File

@@ -307,8 +307,12 @@ public class PullTailManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
} catch (Exception var17) {
var17.printStackTrace();
// feedMessage = var17.getMessage();
logServer.deviceExecuteLog(this.device_code, "", "", "读取信号值时出现异常:" + var17.getMessage() + ",this.itemProtocol is null:" + ObjectUtil.isEmpty(this.itemProtocol));
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content(this.device_code + "读取信号值时出现异常:" + Arrays.toString(var17.getStackTrace()))
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
}

View File

@@ -190,8 +190,12 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
} catch (Exception var17) {
logServer.deviceExecuteLog(this.device_code, "", "", "读取信号值时出现异常:" + var17.getMessage());
// return;
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content(this.device_code + "读取信号值时出现异常:" + Arrays.toString(var17.getStackTrace()))
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
}
// if (!this.itemProtocol.getIsonline()) {
@@ -591,7 +595,7 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
try {
instructionService.create(instdto);
} catch (Exception e) {
logServer.deviceExecuteLog(device_code, "", instdto.getInstruction_code(), "指令创建失败,原因->" + e.getMessage());
logServer.deviceExecuteLog(device_code, "", instdto.getInstruction_code(), "->" + e.getMessage());
}
//创建指令后修改任务状态
taskDto.setTask_status(TaskStatusEnum.BUSY.getIndex());

View File

@@ -702,27 +702,33 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
@Override
public Map<String, Object> getTubeMes(String jsonObject) throws Exception {
log.info("下发管芯信息--------------:输入参数" + jsonObject);
JSONArray datas = JSONArray.parseArray(jsonObject);
Map map = new HashMap();
JSONObject jo = (JSONObject) datas.get(0);
String deviceCode = jo.getString("device_code");
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code("下发管芯信息")
.device_code(deviceCode)
.content("下发管芯信息-----输入参数:" + jsonObject)
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
JSONArray datas = JSONArray.parseArray(jsonObject);
Map map = new HashMap();
for (int i = 0; i < datas.size(); i++) {
JSONObject data = (JSONObject) datas.get(i);
String device_code = data.getString("device_code");
String to_material = data.getString("to_material");
String to_spec = data.getString("to_spec");
String to_qty = data.getString("to_qty");
Device device = deviceAppService.findDeviceByCode(device_code);
if (ObjectUtil.isEmpty(device)) {
throw new Exception("未找到对应设备:" + device_code);
}
PaperTubePickSiteDeviceDriver paperTubePickSiteDeviceDriver;
if (device.getDeviceDriver() instanceof PaperTubePickSiteDeviceDriver) {
paperTubePickSiteDeviceDriver = (PaperTubePickSiteDeviceDriver) device.getDeviceDriver();
Device code = deviceAppService.findDeviceByCode(deviceCode);
PaperTubePickSiteDeviceDriver paperTubePickSiteDeviceDriver;
if (code.getDeviceDriver() instanceof PaperTubePickSiteDeviceDriver) {
paperTubePickSiteDeviceDriver = (PaperTubePickSiteDeviceDriver) code.getDeviceDriver();
for (int i = 0; i < datas.size(); i++) {
JSONObject data = (JSONObject) datas.get(i);
String device_code = data.getString("device_code");
String to_material = data.getString("to_material");
String to_spec = data.getString("to_spec");
String to_qty = data.getString("to_qty");
// String to_material1 = data.getString("to_material1");
// String to_spec1 = data.getString("to_spec1");
// String to_qty1 = data.getString("to_qty1");
Device device = deviceAppService.findDeviceByCode(device_code);
if (ObjectUtil.isEmpty(device)) {
throw new Exception("未找到对应设备:" + device_code);
}
if (ObjectUtil.isEmpty(to_material)) {
map.put("to_material", "0");
map.put("to_spec", "0");
@@ -731,7 +737,23 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
map.put("to_material", to_material);
map.put("to_spec", to_spec);
map.put("to_qty", to_qty);
// if ("BH_17".equals(device_code)) {
// map.put("to_material1", to_material1);
// map.put("to_spec1", to_spec1);
// map.put("to_qty1", to_qty1);
// }
// if ("BH_18".equals(device_code)) {
// map.put("to_material2", to_material1);
// map.put("to_spec2", to_spec1);
// map.put("to_qty2", to_qty1);
// }
// if ("BH_19".equals(device_code)) {
// map.put("to_material3", to_material1);
// map.put("to_spec3", to_spec1);
// map.put("to_qty3", to_qty1);
// }
}
log.info("下发电气信号--------------:参数" + map);
paperTubePickSiteDeviceDriver.writing(map);
log.info("给电气下发信号成功!");
@@ -741,8 +763,8 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
resultJson.put("status", HttpStatus.OK.value());
resultJson.put("message", "操作成功");
LuceneLogDto logDto1 = LuceneLogDto.builder()
.device_code("下发管芯信息")
.content("下发管芯信息-----返回参数:" + resultJson)
.device_code(deviceCode)
.content("下发电气信号--------------:参数" + map)
.build();
logDto1.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto1);

View File

@@ -1000,7 +1000,7 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
InstructionMybatis ins = ConvertUtil.convert(entity, InstructionMybatis.class);
instructionMapper.updateById(ins);
removeByCodeFromCache(entity.getInstruction_code());
Task task = new LambdaQueryChainWrapper<>(taskMapper)
.eq(Task::getTask_id, insttaskid)
@@ -1041,7 +1041,7 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
}
}
removeByCodeFromCache(entity.getInstruction_code());
// this.reload();
}
@@ -1053,6 +1053,7 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
dto.setUpdate_time(now);
InstructionMybatis ins = ConvertUtil.convert(dto, InstructionMybatis.class);
instructionMapper.updateById(ins);
removeByCodeFromCache(dto.getInstruction_code());
String instnextdevice = dto.getNext_device_code();
String insttaskid = dto.getTask_id();
@@ -1105,7 +1106,7 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
}
removeByCodeFromCache(dto.getInstruction_code());
// removeByCodeFromCache(dto.getInstruction_code());
// this.reload();
}
@@ -1293,7 +1294,7 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
//1=XZ 2=NDC
if (ObjectUtil.isNotEmpty(entity.getAgv_system_type()) && entity.getAgv_system_type().equals(CommonFinalParam.TWO)) {
// NDC agv指令不当场取消指令,需要等agv上报
if (!StrUtil.isEmpty(entity.getAgv_jobno())) {
if ("1".equals(entity.getSend_status())) {
ndcAgvService.deleteAgvInstToNDC(BeanUtil.copyProperties(entity, Instruction.class));
flag = true;
} else {
@@ -1320,6 +1321,7 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
entity.setInstruction_status(InstructionStatusEnum.CANCEL.getIndex());
InstructionMybatis ins = ConvertUtil.convert(entity, InstructionMybatis.class);
instructionMapper.updateById(ins);
removeByCodeFromCache(entity.getInstruction_code());
DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class);
DeviceService deviceService = SpringContextHolder.getBean(DeviceServiceImpl.class);
@@ -1353,7 +1355,7 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
log.debug("地址对应设备未找到");
return;
}
removeByCodeFromCache(entity.getInstruction_code());
// removeByCodeFromCache(entity.getInstruction_code());
}
// this.reload();
}
@@ -1370,6 +1372,13 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
if (StrUtil.isEmpty(entity.getRoute_plan_code())) {
entity.setRoute_plan_code(task.getRoute_plan_code());
}
if (ObjectUtil.isNotEmpty(entity.getAgv_system_type()) && entity.getAgv_system_type().equals(CommonFinalParam.TWO)) {
// NDC agv指令不当场取消指令,需要等agv上报
if ("1".equals(entity.getSend_status())) {
ndcAgvService.deleteAgvInstToNDC(BeanUtil.copyProperties(entity, Instruction.class));
}
}
String currentUsername = SecurityUtils.getCurrentNickName();
String now = DateUtil.now();
entity.setUpdate_time(now);
@@ -1377,6 +1386,7 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
entity.setInstruction_status(InstructionStatusEnum.CANCEL.getIndex());
InstructionMybatis ins = ConvertUtil.convert(entity, InstructionMybatis.class);
instructionMapper.updateById(ins);
removeByCodeFromCache(entity.getInstruction_code());
DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class);
DeviceService deviceService = SpringContextHolder.getBean(DeviceServiceImpl.class);
// 如果是无光电的设备 指令完成变更起点、终点状态
@@ -1409,7 +1419,7 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
log.debug("地址对应设备未找到");
return;
}
removeByCodeFromCache(entity.getInstruction_code());
// removeByCodeFromCache(entity.getInstruction_code());
}
@Override

View File

@@ -1052,7 +1052,7 @@ public class TaskServiceImpl extends CommonServiceImpl<TaskMapper, Task> impleme
for (int m = 0; m < pathlist.size(); m++) {
if (pathlist.get(m).equals(start_device_code)) {
//起点为货架跳过堆垛机
if (startDevice.getDeviceDriver() instanceof StandardStorageDeviceDriver || nextDevice.getDeviceDriver() instanceof StandardStorageDeviceDriver ) {
if (startDevice.getDeviceDriver() instanceof StandardStorageDeviceDriver ) {
index = m + 2;
}else {
index = m + 1;