add:代码优化
This commit is contained in:
@@ -69,8 +69,8 @@ public class AgvWaitUtil {
|
|||||||
return map;
|
return map;
|
||||||
} else {
|
} else {
|
||||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||||
.device_code(inst.getCarno())
|
.device_code(manipulatorAgvStationDeviceDriver.getDevice_code())
|
||||||
.content("agv诺宝对接位行架不允许取货:" + inst.getCarno() + "点位号" + manipulatorAgvStationDeviceDriver.getDevice_code())
|
.content("未给agv进入信号原因是:" + manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1")
|
||||||
.build();
|
.build();
|
||||||
logDto.setLog_level(4);
|
logDto.setLog_level(4);
|
||||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||||
@@ -138,6 +138,16 @@ public class AgvWaitUtil {
|
|||||||
if (manipulatorAgvStationDeviceDriver.getTo_command() != 3) {
|
if (manipulatorAgvStationDeviceDriver.getTo_command() != 3) {
|
||||||
manipulatorAgvStationDeviceDriver.writing(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) {
|
if (manipulatorAgvStationDeviceDriver.getAction() != 1) {
|
||||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||||
.device_code(inst.getCarno())
|
.device_code(manipulatorAgvStationDeviceDriver.getDevice_code())
|
||||||
.content("agv诺宝对接位行架不允许放货:" + inst.getCarno() + "点位号" + manipulatorAgvStationDeviceDriver.getDevice_code())
|
.content("未给agv进入信号原因是:" + manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1")
|
||||||
.build();
|
.build();
|
||||||
logDto.setLog_level(4);
|
logDto.setLog_level(4);
|
||||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||||
@@ -228,6 +238,16 @@ public class AgvWaitUtil {
|
|||||||
if (manipulatorAgvStationDeviceDriver.getTo_command() != 5) {
|
if (manipulatorAgvStationDeviceDriver.getTo_command() != 5) {
|
||||||
manipulatorAgvStationDeviceDriver.writing(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离开");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ public class TwoNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
|||||||
|
|
||||||
byte[] b = new byte[1024];
|
byte[] b = new byte[1024];
|
||||||
socket = new Socket();
|
socket = new Socket();
|
||||||
socket.connect(socketAddress, 2 * 1000);
|
socket.connect(socketAddress, 5 * 1000);
|
||||||
socket.setKeepAlive(true);//长链接
|
socket.setKeepAlive(true);//长链接
|
||||||
socket.setSoTimeout(30000);//读取超时时间
|
socket.setSoTimeout(30000);//读取超时时间
|
||||||
dos = new DataOutputStream(socket.getOutputStream());
|
dos = new DataOutputStream(socket.getOutputStream());
|
||||||
@@ -117,7 +117,7 @@ public class TwoNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
|||||||
while (socket.isConnected()) {
|
while (socket.isConnected()) {
|
||||||
System.out.println("当前socket状态:"+socket.isConnected());
|
System.out.println("当前socket状态:"+socket.isConnected());
|
||||||
int count = dis.read(b);
|
int count = dis.read(b);
|
||||||
System.out.println("当前count值:"+count);
|
// System.out.println("当前count值:"+count);
|
||||||
if (count == -1) {
|
if (count == -1) {
|
||||||
log.error("agv连接出现异常:服务端被关闭");
|
log.error("agv连接出现异常:服务端被关闭");
|
||||||
if (ObjectUtil.isNotEmpty(socket)) {
|
if (ObjectUtil.isNotEmpty(socket)) {
|
||||||
|
|||||||
@@ -321,7 +321,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
log.info("设备{},动作信号{} ,不满足取货条件,指令号{}", manipulatorAgvStationDeviceDriver.getDeviceCode(), manipulatorAgvStationDeviceDriver.getAction(), ikey);
|
log.info("设备{},动作信号{} ,不满足取货条件,指令号{}", manipulatorAgvStationDeviceDriver.getDeviceCode(), manipulatorAgvStationDeviceDriver.getAction(), ikey);
|
||||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||||
.device_code(manipulatorAgvStationDeviceDriver.getDeviceCode())
|
.device_code(manipulatorAgvStationDeviceDriver.getDeviceCode())
|
||||||
.content(manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1")
|
.content("未给agv进入信号原因是:" + manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1")
|
||||||
.build();
|
.build();
|
||||||
logDto.setLog_level(4);
|
logDto.setLog_level(4);
|
||||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||||
@@ -563,6 +563,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
if (manipulatorAgvStationDeviceDriver.getAction() == 0) {
|
||||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
|
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
|
||||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||||
.device_code(this.getDeviceCode())
|
.device_code(this.getDeviceCode())
|
||||||
@@ -583,6 +584,14 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
luceneExecuteLogService.deviceExecuteLog(logDto1);
|
luceneExecuteLogService.deviceExecuteLog(logDto1);
|
||||||
acsToWmsService.actionFinishRequest2(jsonObject);
|
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) {
|
} else if (device.getDeviceDriver() instanceof HongXiangStationDeviceDriver) {
|
||||||
hongXiangStationDeviceDriver = (HongXiangStationDeviceDriver) device.getDeviceDriver();
|
hongXiangStationDeviceDriver = (HongXiangStationDeviceDriver) device.getDeviceDriver();
|
||||||
try {
|
try {
|
||||||
@@ -800,8 +809,8 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
} else {
|
} else {
|
||||||
message = "设备号:" + device_code + ",动作信号:" + manipulatorAgvStationDeviceDriver.getAction() + "报警信号:" + ",指令号:" + ikey + "不满足取货条件";
|
message = "设备号:" + device_code + ",动作信号:" + manipulatorAgvStationDeviceDriver.getAction() + "报警信号:" + ",指令号:" + ikey + "不满足取货条件";
|
||||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||||
.device_code(manipulatorAgvStationDeviceDriver.getDevice_code())
|
.device_code(manipulatorAgvStationDeviceDriver.getDeviceCode())
|
||||||
.content(manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1")
|
.content("未给agv进入信号原因是:" + manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1")
|
||||||
.build();
|
.build();
|
||||||
logDto.setLog_level(4);
|
logDto.setLog_level(4);
|
||||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||||
@@ -1005,7 +1014,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
message = "设备号:" + device_code + ",动作信号:" + manipulatorAgvStationDeviceDriver.getAction() + "报警信号:" + ",指令号:" + ikey + "不满足取货条件";
|
message = "设备号:" + device_code + ",动作信号:" + manipulatorAgvStationDeviceDriver.getAction() + "报警信号:" + ",指令号:" + ikey + "不满足取货条件";
|
||||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||||
.device_code(manipulatorAgvStationDeviceDriver.getDeviceCode())
|
.device_code(manipulatorAgvStationDeviceDriver.getDeviceCode())
|
||||||
.content(manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1")
|
.content("未给agv进入信号原因是:" + manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1")
|
||||||
.build();
|
.build();
|
||||||
logDto.setLog_level(4);
|
logDto.setLog_level(4);
|
||||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||||
@@ -1032,7 +1041,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
message = "设备号:" + device_code + ",动作信号:" + manipulatorAgvStationDeviceDriver.getAction() + "报警信号:" + ",指令号:" + ikey + "不满足取货条件";
|
message = "设备号:" + device_code + ",动作信号:" + manipulatorAgvStationDeviceDriver.getAction() + "报警信号:" + ",指令号:" + ikey + "不满足取货条件";
|
||||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||||
.device_code(manipulatorAgvStationDeviceDriver.getDeviceCode())
|
.device_code(manipulatorAgvStationDeviceDriver.getDeviceCode())
|
||||||
.content(manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1")
|
.content("未给agv进入信号原因是:" + manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1")
|
||||||
.build();
|
.build();
|
||||||
logDto.setLog_level(4);
|
logDto.setLog_level(4);
|
||||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||||
@@ -1058,8 +1067,8 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
} else {
|
} else {
|
||||||
message = "设备号:" + device_code + ",动作信号:" + manipulatorAgvStationDeviceDriver.getAction() + "报警信号:" + ",指令号:" + ikey + "不满足取货条件";
|
message = "设备号:" + device_code + ",动作信号:" + manipulatorAgvStationDeviceDriver.getAction() + "报警信号:" + ",指令号:" + ikey + "不满足取货条件";
|
||||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||||
.device_code(this.getDeviceCode())
|
.device_code(manipulatorAgvStationDeviceDriver.getDeviceCode())
|
||||||
.content(manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1")
|
.content("未给agv进入信号原因是:" + manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1")
|
||||||
.build();
|
.build();
|
||||||
logDto.setLog_level(4);
|
logDto.setLog_level(4);
|
||||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||||
@@ -1086,7 +1095,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
message = "设备号:" + manipulatorAgvStationDeviceDriver.getDevice_code() + ",动作信号:" + manipulatorAgvStationDeviceDriver.getAction() + "报警信号:" + ",指令号:" + ikey + "不满足取货条件";
|
message = "设备号:" + manipulatorAgvStationDeviceDriver.getDevice_code() + ",动作信号:" + manipulatorAgvStationDeviceDriver.getAction() + "报警信号:" + ",指令号:" + ikey + "不满足取货条件";
|
||||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||||
.device_code(manipulatorAgvStationDeviceDriver.getDeviceCode())
|
.device_code(manipulatorAgvStationDeviceDriver.getDeviceCode())
|
||||||
.content(manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1")
|
.content("未给agv进入信号原因是:" + manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1")
|
||||||
.build();
|
.build();
|
||||||
logDto.setLog_level(4);
|
logDto.setLog_level(4);
|
||||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||||
@@ -1213,6 +1222,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
if (manipulatorAgvStationDeviceDriver.getAction() == 0) {
|
||||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
|
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
|
||||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||||
.device_code(this.getDeviceCode())
|
.device_code(this.getDeviceCode())
|
||||||
@@ -1233,6 +1243,14 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
luceneExecuteLogService.deviceExecuteLog(logDto1);
|
luceneExecuteLogService.deviceExecuteLog(logDto1);
|
||||||
acsToWmsService.actionFinishRequest2(jsonObject);
|
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) {
|
} else if (device.getDeviceDriver() instanceof PaperTubePickSiteDeviceDriver) {
|
||||||
paperTubePickSiteDeviceDriver = (PaperTubePickSiteDeviceDriver) device.getDeviceDriver();
|
paperTubePickSiteDeviceDriver = (PaperTubePickSiteDeviceDriver) device.getDeviceDriver();
|
||||||
try {
|
try {
|
||||||
@@ -1429,7 +1447,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
log.info("设备{},动作信号{} ,不满足取货条件,指令号{}", device_code, manipulatorAgvStationDeviceDriver.getAction(), ikey);
|
log.info("设备{},动作信号{} ,不满足取货条件,指令号{}", device_code, manipulatorAgvStationDeviceDriver.getAction(), ikey);
|
||||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||||
.device_code(manipulatorAgvStationDeviceDriver.getDeviceCode())
|
.device_code(manipulatorAgvStationDeviceDriver.getDeviceCode())
|
||||||
.content(manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1")
|
.content("未给agv进入信号原因是:" + manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1")
|
||||||
.build();
|
.build();
|
||||||
logDto.setLog_level(4);
|
logDto.setLog_level(4);
|
||||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||||
@@ -1643,6 +1661,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
if (manipulatorAgvStationDeviceDriver.getAction() == 0) {
|
||||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
|
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
|
||||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||||
.device_code(this.getDeviceCode())
|
.device_code(this.getDeviceCode())
|
||||||
@@ -1650,6 +1669,14 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
.build();
|
.build();
|
||||||
logDto.setLog_level(4);
|
logDto.setLog_level(4);
|
||||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
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) {
|
} else if (device.getDeviceDriver() instanceof HongXiangStationDeviceDriver) {
|
||||||
hongXiangStationDeviceDriver = (HongXiangStationDeviceDriver) device.getDeviceDriver();
|
hongXiangStationDeviceDriver = (HongXiangStationDeviceDriver) device.getDeviceDriver();
|
||||||
try {
|
try {
|
||||||
@@ -1687,10 +1714,28 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
String to_material = jsonObject.getString("to_material");
|
String to_material = jsonObject.getString("to_material");
|
||||||
String to_spec = jsonObject.getString("to_spec");
|
String to_spec = jsonObject.getString("to_spec");
|
||||||
String to_qty = jsonObject.getString("to_qty");
|
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_command", 5);
|
||||||
map.put("to_material", to_material);
|
map.put("to_material", to_material);
|
||||||
map.put("to_spec", to_spec);
|
map.put("to_spec", to_spec);
|
||||||
map.put("to_qty", to_qty);
|
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);
|
paperTubePickSiteDeviceDriver.writing(map);
|
||||||
} else {
|
} else {
|
||||||
map.put("to_command", 5);
|
map.put("to_command", 5);
|
||||||
@@ -1856,7 +1901,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
log.info("设备{},动作信号{} ,不满足取货条件,指令号{}", device_code, manipulatorAgvStationDeviceDriver.getAction(), ikey);
|
log.info("设备{},动作信号{} ,不满足取货条件,指令号{}", device_code, manipulatorAgvStationDeviceDriver.getAction(), ikey);
|
||||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||||
.device_code(manipulatorAgvStationDeviceDriver.getDeviceCode())
|
.device_code(manipulatorAgvStationDeviceDriver.getDeviceCode())
|
||||||
.content(manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1")
|
.content("未给agv进入信号原因是:" + manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1")
|
||||||
.build();
|
.build();
|
||||||
logDto.setLog_level(4);
|
logDto.setLog_level(4);
|
||||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||||
@@ -2053,6 +2098,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
if (manipulatorAgvStationDeviceDriver.getAction() == 0) {
|
||||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
|
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
|
||||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||||
.device_code(this.getDeviceCode())
|
.device_code(this.getDeviceCode())
|
||||||
@@ -2060,6 +2106,14 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
|||||||
.build();
|
.build();
|
||||||
logDto.setLog_level(4);
|
logDto.setLog_level(4);
|
||||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
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) {
|
} else if (device.getDeviceDriver() instanceof PaperTubePickSiteDeviceDriver) {
|
||||||
paperTubePickSiteDeviceDriver = (PaperTubePickSiteDeviceDriver) device.getDeviceDriver();
|
paperTubePickSiteDeviceDriver = (PaperTubePickSiteDeviceDriver) device.getDeviceDriver();
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -191,9 +191,7 @@ public class FoldDiscSiteDeviceDriver extends AbstractOpcDeviceDriver implements
|
|||||||
container_type = this.itemProtocol.getContainer_type();
|
container_type = this.itemProtocol.getContainer_type();
|
||||||
carrier_direction = this.itemProtocol.getCarrier_direction();
|
carrier_direction = this.itemProtocol.getCarrier_direction();
|
||||||
if (mode != last_mode) {
|
if (mode != last_mode) {
|
||||||
|
|
||||||
requireSucess = false;
|
requireSucess = false;
|
||||||
|
|
||||||
}
|
}
|
||||||
// 更新指令状态
|
// 更新指令状态
|
||||||
if (move != 0 && task > 0) {
|
if (move != 0 && task > 0) {
|
||||||
@@ -383,15 +381,20 @@ public class FoldDiscSiteDeviceDriver extends AbstractOpcDeviceDriver implements
|
|||||||
map3.put("value", "1");
|
map3.put("value", "1");
|
||||||
list.add(map3);
|
list.add(map3);
|
||||||
this.writing(list);
|
this.writing(list);
|
||||||
requireSucess = true;
|
|
||||||
while (!StrUtil.equals(this.getOpcValueAccessor().getValue(this.getOpcServer() + "." + this.getOpcPlc() + "." + this.getDevice_code() + ".task").toString()
|
|
||||||
, inst.getInstruction_code())) {
|
|
||||||
this.writing(list);
|
|
||||||
try {
|
try {
|
||||||
Thread.sleep(500);
|
Thread.sleep(500);
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
e.printStackTrace();
|
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 + "电气的指令号:" + 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()))) {
|
if (ObjectUtil.isEmpty(instructionService.findByTaskcodeAndStatus(taskdto.getTask_code()))) {
|
||||||
requireSucess = false;
|
requireSucess = false;
|
||||||
return false;
|
return false;
|
||||||
@@ -504,7 +507,6 @@ public class FoldDiscSiteDeviceDriver extends AbstractOpcDeviceDriver implements
|
|||||||
//创建指令后修改任务状态
|
//创建指令后修改任务状态
|
||||||
taskdto.setTask_status(TaskStatusEnum.BUSY.getIndex());
|
taskdto.setTask_status(TaskStatusEnum.BUSY.getIndex());
|
||||||
taskserver.update(taskdto);
|
taskserver.update(taskdto);
|
||||||
requireSucess = true;
|
|
||||||
String next_addr = nextDevice.getExtraValue().get("address").toString();
|
String next_addr = nextDevice.getExtraValue().get("address").toString();
|
||||||
|
|
||||||
List list = new ArrayList();
|
List list = new ArrayList();
|
||||||
@@ -521,26 +523,27 @@ public class FoldDiscSiteDeviceDriver extends AbstractOpcDeviceDriver implements
|
|||||||
map3.put("value", "1");
|
map3.put("value", "1");
|
||||||
list.add(map3);
|
list.add(map3);
|
||||||
this.writing(list);
|
this.writing(list);
|
||||||
requireSucess = true;
|
try {
|
||||||
while (!StrUtil.equals(this.getOpcValueAccessor().getValue(this.getOpcServer() + "." + this.getOpcPlc() + "." + this.getDevice_code() + ".task").toString()
|
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())) {
|
, instdto.getInstruction_code())) {
|
||||||
this.writing(list);
|
this.writing(list);
|
||||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||||
.device_code(device_code)
|
.device_code(device_code)
|
||||||
.content(device_code + instdto.getInstruction_code() + "再次下发电气信号")
|
.content(device_code + instdto.getInstruction_code() + "再次下发电气信号")
|
||||||
.build();
|
.build();
|
||||||
logDto.setLog_level(3);
|
logDto.setLog_level(4);
|
||||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||||
try {
|
|
||||||
Thread.sleep(1000);
|
|
||||||
} catch (InterruptedException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
if (ObjectUtil.isEmpty(taskserver.findByCode(taskdto.getTask_code()))) {
|
if (ObjectUtil.isEmpty(taskserver.findByCode(taskdto.getTask_code()))) {
|
||||||
requireSucess = false;
|
requireSucess = false;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
requireSucess = true;
|
||||||
} else {
|
} else {
|
||||||
//如果不存在则直接找对应指令
|
//如果不存在则直接找对应指令
|
||||||
Instruction inst = instructionService.findByDeviceCodeFromCache(this.device_code);
|
Instruction inst = instructionService.findByDeviceCodeFromCache(this.device_code);
|
||||||
@@ -565,26 +568,26 @@ public class FoldDiscSiteDeviceDriver extends AbstractOpcDeviceDriver implements
|
|||||||
map3.put("value", "1");
|
map3.put("value", "1");
|
||||||
list.add(map3);
|
list.add(map3);
|
||||||
this.writing(list);
|
this.writing(list);
|
||||||
requireSucess = true;
|
try {
|
||||||
while (!StrUtil.equals(this.getOpcValueAccessor().getValue(this.getOpcServer() + "." + this.getOpcPlc() + "." + this.getDevice_code() + ".task").toString()
|
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())) {
|
, inst.getInstruction_code())) {
|
||||||
this.writing(list);
|
this.writing(list);
|
||||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||||
.device_code(device_code)
|
.device_code(device_code)
|
||||||
.content(device_code + inst.getInstruction_code() + "再次下发电气信号")
|
.content(device_code + inst.getInstruction_code() + "再次下发电气信号")
|
||||||
.build();
|
.build();
|
||||||
logDto.setLog_level(3);
|
logDto.setLog_level(4);
|
||||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||||
try {
|
|
||||||
Thread.sleep(500);
|
|
||||||
} catch (InterruptedException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
if (ObjectUtil.isEmpty(instructionService.findByDeviceCodeFromCache(this.device_code))) {
|
if (ObjectUtil.isEmpty(instructionService.findByDeviceCodeFromCache(this.device_code))) {
|
||||||
requireSucess = false;
|
requireSucess = false;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
requireSucess = true;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -953,26 +953,26 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
|
|||||||
map3.put("value", "1");
|
map3.put("value", "1");
|
||||||
list.add(map3);
|
list.add(map3);
|
||||||
this.writing(list);
|
this.writing(list);
|
||||||
requireSucess = true;
|
|
||||||
while (!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);
|
|
||||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
|
||||||
try {
|
try {
|
||||||
Thread.sleep(500);
|
Thread.sleep(500);
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
e.printStackTrace();
|
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 + "电气的指令号:" + 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.findByDeviceCodeFromCache(this.device_code))) {
|
if (ObjectUtil.isEmpty(instructionService.findByDeviceCodeFromCache(this.device_code))) {
|
||||||
requireSucess = false;
|
requireSucess = false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
requireSucess = true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1090,40 +1090,41 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
|
|||||||
map4.put("value", "1");
|
map4.put("value", "1");
|
||||||
list2.add(map4);
|
list2.add(map4);
|
||||||
this.writing(list2);
|
this.writing(list2);
|
||||||
led_message = getLedMessage(instdto);
|
// led_message = getLedMessage(instdto);
|
||||||
List<String> deviceCodes = this.getExtraDeviceCodes("link_device_code");
|
// List<String> deviceCodes = this.getExtraDeviceCodes("link_device_code");
|
||||||
String device = null;
|
// String device = null;
|
||||||
if (ObjectUtil.isNotEmpty(deviceCodes)) {
|
// if (ObjectUtil.isNotEmpty(deviceCodes)) {
|
||||||
for (String deviceCode : deviceCodes) {
|
// for (String deviceCode : deviceCodes) {
|
||||||
Device linkDevice = deviceAppService.findDeviceByCode(deviceCode);
|
// Device linkDevice = deviceAppService.findDeviceByCode(deviceCode);
|
||||||
if (ObjectUtil.isEmpty(linkDevice)) {
|
// if (ObjectUtil.isEmpty(linkDevice)) {
|
||||||
throw new BadRequestException("设备:" + device_code + "关联设备->" + deviceCode + "为空!");
|
// 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();
|
||||||
}
|
}
|
||||||
if (linkDevice.getDeviceDriver() instanceof LedScreenDeviceDriver) {
|
if (!StrUtil.equals(this.getOpcValueAccessor().getValue(this.getOpcServer() + "." + this.getOpcPlc() + "." + this.getDevice_code() + ".task").toString()
|
||||||
device = deviceCode;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
taskScreenService.getLedMessage(device);
|
|
||||||
requireSucess = true;
|
|
||||||
while (!StrUtil.equals(this.getOpcValueAccessor().getValue(this.getOpcServer() + "." + this.getOpcPlc() + "." + this.getDevice_code() + ".task").toString()
|
|
||||||
, instdto.getInstruction_code())) {
|
, instdto.getInstruction_code())) {
|
||||||
this.writing(list);
|
this.writing(list);
|
||||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||||
.device_code(device_code)
|
.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();
|
.build();
|
||||||
|
logDto.setLog_level(4);
|
||||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||||
try {
|
|
||||||
Thread.sleep(1000);
|
|
||||||
} catch (InterruptedException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
if (ObjectUtil.isEmpty(taskserver.findByCode(taskdto.getTask_code()))) {
|
if (ObjectUtil.isEmpty(taskserver.findByCode(taskdto.getTask_code()))) {
|
||||||
requireSucess = false;
|
requireSucess = false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
requireSucess = true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -221,7 +221,7 @@ public class TrappedManipulatorManipulatorDeviceDriver extends AbstractOpcDevice
|
|||||||
this.iserror = true;
|
this.iserror = true;
|
||||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||||
.device_code(device_code)
|
.device_code(device_code)
|
||||||
.content(this.device_code + "读取信号值时出现异常:" + var17.getMessage() + ",this.itemProtocol is null")
|
.content(this.device_code + "读取信号值时出现异常:" + Arrays.toString(var17.getStackTrace()))
|
||||||
.build();
|
.build();
|
||||||
logDto.setLog_level(4);
|
logDto.setLog_level(4);
|
||||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||||
|
|||||||
@@ -39,6 +39,25 @@ public class ItemProtocol {
|
|||||||
public static String item_to_spec = "to_spec";
|
public static String item_to_spec = "to_spec";
|
||||||
//下发物料数量
|
//下发物料数量
|
||||||
public static String item_to_qty = "to_qty";
|
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;
|
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_material, "下发物料类型", "DB2.W2"));
|
||||||
list.add(new ItemDto(item_to_spec, "下发物料规格", "DB2.W4"));
|
list.add(new ItemDto(item_to_spec, "下发物料规格", "DB2.W4"));
|
||||||
list.add(new ItemDto(item_to_qty, "下发物料数量", "DB2.W8"));
|
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;
|
return list;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -105,6 +105,33 @@ public class PaperTubePickSiteDeviceDriver extends AbstractOpcDeviceDriver imple
|
|||||||
//下发物料数量
|
//下发物料数量
|
||||||
int to_qty=0;
|
int to_qty=0;
|
||||||
int last_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;
|
String paper_code = null;
|
||||||
int paper_location = 0 ;
|
int paper_location = 0 ;
|
||||||
|
|||||||
@@ -221,7 +221,13 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
|
|||||||
} catch (Exception var17) {
|
} catch (Exception var17) {
|
||||||
var17.printStackTrace();
|
var17.printStackTrace();
|
||||||
// feedMessage = var17.getMessage();
|
// 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) {
|
if (mode == 0) {
|
||||||
|
|||||||
@@ -195,6 +195,7 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute() throws Exception {
|
public void execute() throws Exception {
|
||||||
|
try {
|
||||||
device_code = this.getDeviceCode();
|
device_code = this.getDeviceCode();
|
||||||
mode = this.itemProtocol.getMode();
|
mode = this.itemProtocol.getMode();
|
||||||
move = this.itemProtocol.getMove();
|
move = this.itemProtocol.getMove();
|
||||||
@@ -220,6 +221,16 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl
|
|||||||
toSize2 = this.itemProtocol.getTo_size2();
|
toSize2 = this.itemProtocol.getTo_size2();
|
||||||
toSize3 = this.itemProtocol.getTo_size3();
|
toSize3 = this.itemProtocol.getTo_size3();
|
||||||
toSize4 = this.itemProtocol.getTo_size4();
|
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) {
|
if (mode != lastMode) {
|
||||||
requireSucess = false;
|
requireSucess = false;
|
||||||
|
|||||||
@@ -246,10 +246,14 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
|
|||||||
ManipulatorApplyPointRequest manipulatorApplyPointRequest = new ManipulatorApplyPointRequest();
|
ManipulatorApplyPointRequest manipulatorApplyPointRequest = new ManipulatorApplyPointRequest();
|
||||||
ManipulatorApplyPointResponse manipulatorApplyPointResponse;
|
ManipulatorApplyPointResponse manipulatorApplyPointResponse;
|
||||||
inst = checkInst();
|
inst = checkInst();
|
||||||
|
if (ObjectUtil.isEmpty(inst)) {
|
||||||
|
log.info("指令号为空!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
String task_code = inst.getTask_code();
|
String task_code = inst.getTask_code();
|
||||||
manipulatorApplyPointRequest.setType("1");
|
manipulatorApplyPointRequest.setType("1");
|
||||||
manipulatorApplyPointRequest.setTask_code(task_code);
|
manipulatorApplyPointRequest.setTask_code(task_code);
|
||||||
if (toCommand != 6) {
|
if (to_getpoint == 0) {
|
||||||
manipulatorApplyPointResponse = acsToWmsService.manipulatorApplyPointRequest(manipulatorApplyPointRequest);
|
manipulatorApplyPointResponse = acsToWmsService.manipulatorApplyPointRequest(manipulatorApplyPointRequest);
|
||||||
if (manipulatorApplyPointResponse.getstatus() == 200) {
|
if (manipulatorApplyPointResponse.getstatus() == 200) {
|
||||||
LuceneLogDto logDto1 = LuceneLogDto.builder()
|
LuceneLogDto logDto1 = LuceneLogDto.builder()
|
||||||
@@ -261,10 +265,16 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
|
|||||||
String get_device_code = manipulatorApplyPointResponse.getDevice_code();
|
String get_device_code = manipulatorApplyPointResponse.getDevice_code();
|
||||||
Device device = deviceAppService.findDeviceByCode(get_device_code);
|
Device device = deviceAppService.findDeviceByCode(get_device_code);
|
||||||
String to_new_getpoint = device.getExtraValue().get("address").toString();
|
String to_new_getpoint = device.getExtraValue().get("address").toString();
|
||||||
Map<String, Object> map = new LinkedHashMap<>();
|
List list = new ArrayList();
|
||||||
map.put("to_command", "6");
|
Map<String, Object> map1 = new HashMap<>();
|
||||||
map.put("to_getpoint", Integer.parseInt(to_new_getpoint));
|
Map<String, Object> map2 = new HashMap<>();
|
||||||
this.writing(map);
|
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 = "申请新取货点成功";
|
message = "申请新取货点成功";
|
||||||
} else {
|
} else {
|
||||||
message = "申请新取货点失败";
|
message = "申请新取货点失败";
|
||||||
@@ -285,10 +295,14 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
|
|||||||
ManipulatorApplyPointRequest manipulatorApplyPointRequest = new ManipulatorApplyPointRequest();
|
ManipulatorApplyPointRequest manipulatorApplyPointRequest = new ManipulatorApplyPointRequest();
|
||||||
ManipulatorApplyPointResponse manipulatorApplyPointResponse;
|
ManipulatorApplyPointResponse manipulatorApplyPointResponse;
|
||||||
inst = checkInst();
|
inst = checkInst();
|
||||||
|
if (ObjectUtil.isEmpty(inst)) {
|
||||||
|
log.info("指令号为空!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
String task_code = inst.getTask_code();
|
String task_code = inst.getTask_code();
|
||||||
manipulatorApplyPointRequest.setType("2");
|
manipulatorApplyPointRequest.setType("2");
|
||||||
manipulatorApplyPointRequest.setTask_code(task_code);
|
manipulatorApplyPointRequest.setTask_code(task_code);
|
||||||
if (toCommand != 7) {
|
if (to_putpoint == 0) {
|
||||||
manipulatorApplyPointResponse = acsToWmsService.manipulatorApplyPointRequest(manipulatorApplyPointRequest);
|
manipulatorApplyPointResponse = acsToWmsService.manipulatorApplyPointRequest(manipulatorApplyPointRequest);
|
||||||
if (manipulatorApplyPointResponse.getstatus() == 200) {
|
if (manipulatorApplyPointResponse.getstatus() == 200) {
|
||||||
LuceneLogDto logDto1 = LuceneLogDto.builder()
|
LuceneLogDto logDto1 = LuceneLogDto.builder()
|
||||||
@@ -300,10 +314,16 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
|
|||||||
String put_device_code = manipulatorApplyPointResponse.getDevice_code();
|
String put_device_code = manipulatorApplyPointResponse.getDevice_code();
|
||||||
Device device = deviceAppService.findDeviceByCode(put_device_code);
|
Device device = deviceAppService.findDeviceByCode(put_device_code);
|
||||||
String to_new_putpoint = device.getExtraValue().get("address").toString();
|
String to_new_putpoint = device.getExtraValue().get("address").toString();
|
||||||
Map<String, Object> map = new LinkedHashMap<>();
|
List list = new ArrayList();
|
||||||
map.put("to_command", "7");
|
Map<String, Object> map1 = new HashMap<>();
|
||||||
map.put("to_putpoint", Integer.parseInt(to_new_putpoint));
|
Map<String, Object> map2 = new HashMap<>();
|
||||||
this.writing(map);
|
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 = "申请新放货点成功";
|
message = "申请新放货点成功";
|
||||||
} else {
|
} else {
|
||||||
message = "申请新放货点失败";
|
message = "申请新放货点失败";
|
||||||
@@ -315,8 +335,12 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
|
|||||||
|
|
||||||
} catch (Exception var17) {
|
} catch (Exception var17) {
|
||||||
var17.printStackTrace();
|
var17.printStackTrace();
|
||||||
// feedMessage = var17.getMessage();
|
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||||
logServer.deviceExecuteLog(this.device_code, "", "", "读取信号值时出现异常:" + var17.getMessage() + ",this.itemProtocol is null:" + ObjectUtil.isEmpty(this.itemProtocol));
|
.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();
|
Instruction inst2 = checkInst();
|
||||||
if (inst2 != null) {
|
if (inst2 != null) {
|
||||||
if (StrUtil.equals(inst.getInstruction_status(), InstructionStatusEnum.BUSY.getIndex())) {
|
if (StrUtil.equals(inst.getInstruction_status(), InstructionStatusEnum.BUSY.getIndex())) {
|
||||||
Map<String, Object> map = new LinkedHashMap<>();
|
List list = new ArrayList();
|
||||||
map.put("to_command", "5");
|
Map<String, Object> map1 = new HashMap<>();
|
||||||
this.writing(map);
|
map1.put("code", "to_command");
|
||||||
|
map1.put("value", "5");
|
||||||
|
list.add(map1);
|
||||||
|
this.writing(list);
|
||||||
message = "universal_message1";
|
message = "universal_message1";
|
||||||
try {
|
try {
|
||||||
finish_instruction(inst2);
|
finish_instruction(inst2);
|
||||||
|
|||||||
@@ -307,8 +307,12 @@ public class PullTailManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
|
|||||||
|
|
||||||
} catch (Exception var17) {
|
} catch (Exception var17) {
|
||||||
var17.printStackTrace();
|
var17.printStackTrace();
|
||||||
// feedMessage = var17.getMessage();
|
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||||
logServer.deviceExecuteLog(this.device_code, "", "", "读取信号值时出现异常:" + var17.getMessage() + ",this.itemProtocol is null:" + ObjectUtil.isEmpty(this.itemProtocol));
|
.device_code(device_code)
|
||||||
|
.content(this.device_code + "读取信号值时出现异常:" + Arrays.toString(var17.getStackTrace()))
|
||||||
|
.build();
|
||||||
|
logDto.setLog_level(4);
|
||||||
|
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -190,8 +190,12 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
|
|||||||
|
|
||||||
|
|
||||||
} catch (Exception var17) {
|
} catch (Exception var17) {
|
||||||
logServer.deviceExecuteLog(this.device_code, "", "", "读取信号值时出现异常:" + var17.getMessage());
|
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||||
// return;
|
.device_code(device_code)
|
||||||
|
.content(this.device_code + "读取信号值时出现异常:" + Arrays.toString(var17.getStackTrace()))
|
||||||
|
.build();
|
||||||
|
logDto.setLog_level(4);
|
||||||
|
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (!this.itemProtocol.getIsonline()) {
|
// if (!this.itemProtocol.getIsonline()) {
|
||||||
@@ -591,7 +595,7 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
|
|||||||
try {
|
try {
|
||||||
instructionService.create(instdto);
|
instructionService.create(instdto);
|
||||||
} catch (Exception e) {
|
} 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());
|
taskDto.setTask_status(TaskStatusEnum.BUSY.getIndex());
|
||||||
|
|||||||
@@ -702,27 +702,33 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
|||||||
@Override
|
@Override
|
||||||
public Map<String, Object> getTubeMes(String jsonObject) throws Exception {
|
public Map<String, Object> getTubeMes(String jsonObject) throws Exception {
|
||||||
log.info("下发管芯信息--------------:输入参数" + jsonObject);
|
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()
|
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||||
.device_code("下发管芯信息")
|
.device_code(deviceCode)
|
||||||
.content("下发管芯信息-----输入参数:" + jsonObject)
|
.content("下发管芯信息-----输入参数:" + jsonObject)
|
||||||
.build();
|
.build();
|
||||||
logDto.setLog_level(4);
|
logDto.setLog_level(4);
|
||||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||||
JSONArray datas = JSONArray.parseArray(jsonObject);
|
Device code = deviceAppService.findDeviceByCode(deviceCode);
|
||||||
Map map = new HashMap();
|
PaperTubePickSiteDeviceDriver paperTubePickSiteDeviceDriver;
|
||||||
|
if (code.getDeviceDriver() instanceof PaperTubePickSiteDeviceDriver) {
|
||||||
|
paperTubePickSiteDeviceDriver = (PaperTubePickSiteDeviceDriver) code.getDeviceDriver();
|
||||||
for (int i = 0; i < datas.size(); i++) {
|
for (int i = 0; i < datas.size(); i++) {
|
||||||
JSONObject data = (JSONObject) datas.get(i);
|
JSONObject data = (JSONObject) datas.get(i);
|
||||||
String device_code = data.getString("device_code");
|
String device_code = data.getString("device_code");
|
||||||
String to_material = data.getString("to_material");
|
String to_material = data.getString("to_material");
|
||||||
String to_spec = data.getString("to_spec");
|
String to_spec = data.getString("to_spec");
|
||||||
String to_qty = data.getString("to_qty");
|
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);
|
Device device = deviceAppService.findDeviceByCode(device_code);
|
||||||
if (ObjectUtil.isEmpty(device)) {
|
if (ObjectUtil.isEmpty(device)) {
|
||||||
throw new Exception("未找到对应设备:" + device_code);
|
throw new Exception("未找到对应设备:" + device_code);
|
||||||
}
|
}
|
||||||
PaperTubePickSiteDeviceDriver paperTubePickSiteDeviceDriver;
|
|
||||||
if (device.getDeviceDriver() instanceof PaperTubePickSiteDeviceDriver) {
|
|
||||||
paperTubePickSiteDeviceDriver = (PaperTubePickSiteDeviceDriver) device.getDeviceDriver();
|
|
||||||
if (ObjectUtil.isEmpty(to_material)) {
|
if (ObjectUtil.isEmpty(to_material)) {
|
||||||
map.put("to_material", "0");
|
map.put("to_material", "0");
|
||||||
map.put("to_spec", "0");
|
map.put("to_spec", "0");
|
||||||
@@ -731,7 +737,23 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
|||||||
map.put("to_material", to_material);
|
map.put("to_material", to_material);
|
||||||
map.put("to_spec", to_spec);
|
map.put("to_spec", to_spec);
|
||||||
map.put("to_qty", to_qty);
|
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);
|
log.info("下发电气信号--------------:参数" + map);
|
||||||
paperTubePickSiteDeviceDriver.writing(map);
|
paperTubePickSiteDeviceDriver.writing(map);
|
||||||
log.info("给电气下发信号成功!");
|
log.info("给电气下发信号成功!");
|
||||||
@@ -741,8 +763,8 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
|||||||
resultJson.put("status", HttpStatus.OK.value());
|
resultJson.put("status", HttpStatus.OK.value());
|
||||||
resultJson.put("message", "操作成功");
|
resultJson.put("message", "操作成功");
|
||||||
LuceneLogDto logDto1 = LuceneLogDto.builder()
|
LuceneLogDto logDto1 = LuceneLogDto.builder()
|
||||||
.device_code("下发管芯信息")
|
.device_code(deviceCode)
|
||||||
.content("下发管芯信息-----返回参数:" + resultJson)
|
.content("下发电气信号--------------:参数" + map)
|
||||||
.build();
|
.build();
|
||||||
logDto1.setLog_level(4);
|
logDto1.setLog_level(4);
|
||||||
luceneExecuteLogService.deviceExecuteLog(logDto1);
|
luceneExecuteLogService.deviceExecuteLog(logDto1);
|
||||||
|
|||||||
@@ -1000,7 +1000,7 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
|||||||
|
|
||||||
InstructionMybatis ins = ConvertUtil.convert(entity, InstructionMybatis.class);
|
InstructionMybatis ins = ConvertUtil.convert(entity, InstructionMybatis.class);
|
||||||
instructionMapper.updateById(ins);
|
instructionMapper.updateById(ins);
|
||||||
|
removeByCodeFromCache(entity.getInstruction_code());
|
||||||
|
|
||||||
Task task = new LambdaQueryChainWrapper<>(taskMapper)
|
Task task = new LambdaQueryChainWrapper<>(taskMapper)
|
||||||
.eq(Task::getTask_id, insttaskid)
|
.eq(Task::getTask_id, insttaskid)
|
||||||
@@ -1041,7 +1041,7 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
removeByCodeFromCache(entity.getInstruction_code());
|
|
||||||
// this.reload();
|
// this.reload();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1053,6 +1053,7 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
|||||||
dto.setUpdate_time(now);
|
dto.setUpdate_time(now);
|
||||||
InstructionMybatis ins = ConvertUtil.convert(dto, InstructionMybatis.class);
|
InstructionMybatis ins = ConvertUtil.convert(dto, InstructionMybatis.class);
|
||||||
instructionMapper.updateById(ins);
|
instructionMapper.updateById(ins);
|
||||||
|
removeByCodeFromCache(dto.getInstruction_code());
|
||||||
|
|
||||||
String instnextdevice = dto.getNext_device_code();
|
String instnextdevice = dto.getNext_device_code();
|
||||||
String insttaskid = dto.getTask_id();
|
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();
|
// this.reload();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1293,7 +1294,7 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
|||||||
//1=XZ 2=NDC
|
//1=XZ 2=NDC
|
||||||
if (ObjectUtil.isNotEmpty(entity.getAgv_system_type()) && entity.getAgv_system_type().equals(CommonFinalParam.TWO)) {
|
if (ObjectUtil.isNotEmpty(entity.getAgv_system_type()) && entity.getAgv_system_type().equals(CommonFinalParam.TWO)) {
|
||||||
// NDC agv指令不当场取消指令,需要等agv上报
|
// NDC agv指令不当场取消指令,需要等agv上报
|
||||||
if (!StrUtil.isEmpty(entity.getAgv_jobno())) {
|
if ("1".equals(entity.getSend_status())) {
|
||||||
ndcAgvService.deleteAgvInstToNDC(BeanUtil.copyProperties(entity, Instruction.class));
|
ndcAgvService.deleteAgvInstToNDC(BeanUtil.copyProperties(entity, Instruction.class));
|
||||||
flag = true;
|
flag = true;
|
||||||
} else {
|
} else {
|
||||||
@@ -1320,6 +1321,7 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
|||||||
entity.setInstruction_status(InstructionStatusEnum.CANCEL.getIndex());
|
entity.setInstruction_status(InstructionStatusEnum.CANCEL.getIndex());
|
||||||
InstructionMybatis ins = ConvertUtil.convert(entity, InstructionMybatis.class);
|
InstructionMybatis ins = ConvertUtil.convert(entity, InstructionMybatis.class);
|
||||||
instructionMapper.updateById(ins);
|
instructionMapper.updateById(ins);
|
||||||
|
removeByCodeFromCache(entity.getInstruction_code());
|
||||||
DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class);
|
DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class);
|
||||||
DeviceService deviceService = SpringContextHolder.getBean(DeviceServiceImpl.class);
|
DeviceService deviceService = SpringContextHolder.getBean(DeviceServiceImpl.class);
|
||||||
|
|
||||||
@@ -1353,7 +1355,7 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
|||||||
log.debug("地址对应设备未找到");
|
log.debug("地址对应设备未找到");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
removeByCodeFromCache(entity.getInstruction_code());
|
// removeByCodeFromCache(entity.getInstruction_code());
|
||||||
}
|
}
|
||||||
// this.reload();
|
// this.reload();
|
||||||
}
|
}
|
||||||
@@ -1370,6 +1372,13 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
|||||||
if (StrUtil.isEmpty(entity.getRoute_plan_code())) {
|
if (StrUtil.isEmpty(entity.getRoute_plan_code())) {
|
||||||
entity.setRoute_plan_code(task.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 currentUsername = SecurityUtils.getCurrentNickName();
|
||||||
String now = DateUtil.now();
|
String now = DateUtil.now();
|
||||||
entity.setUpdate_time(now);
|
entity.setUpdate_time(now);
|
||||||
@@ -1377,6 +1386,7 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
|||||||
entity.setInstruction_status(InstructionStatusEnum.CANCEL.getIndex());
|
entity.setInstruction_status(InstructionStatusEnum.CANCEL.getIndex());
|
||||||
InstructionMybatis ins = ConvertUtil.convert(entity, InstructionMybatis.class);
|
InstructionMybatis ins = ConvertUtil.convert(entity, InstructionMybatis.class);
|
||||||
instructionMapper.updateById(ins);
|
instructionMapper.updateById(ins);
|
||||||
|
removeByCodeFromCache(entity.getInstruction_code());
|
||||||
DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class);
|
DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class);
|
||||||
DeviceService deviceService = SpringContextHolder.getBean(DeviceServiceImpl.class);
|
DeviceService deviceService = SpringContextHolder.getBean(DeviceServiceImpl.class);
|
||||||
// 如果是无光电的设备 指令完成变更起点、终点状态
|
// 如果是无光电的设备 指令完成变更起点、终点状态
|
||||||
@@ -1409,7 +1419,7 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
|||||||
log.debug("地址对应设备未找到");
|
log.debug("地址对应设备未找到");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
removeByCodeFromCache(entity.getInstruction_code());
|
// removeByCodeFromCache(entity.getInstruction_code());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1052,7 +1052,7 @@ public class TaskServiceImpl extends CommonServiceImpl<TaskMapper, Task> impleme
|
|||||||
for (int m = 0; m < pathlist.size(); m++) {
|
for (int m = 0; m < pathlist.size(); m++) {
|
||||||
if (pathlist.get(m).equals(start_device_code)) {
|
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;
|
index = m + 2;
|
||||||
}else {
|
}else {
|
||||||
index = m + 1;
|
index = m + 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user