add: 开发
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
package org.nl.acs.auto.run;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -10,9 +9,10 @@ import org.nl.acs.device.domain.Device;
|
||||
import org.nl.acs.device.service.DeviceService;
|
||||
import org.nl.acs.device_driver.agv.ndcone.AgvNdcOneDeviceDriver;
|
||||
import org.nl.acs.device_driver.agv.ndctwo.AgvNdcTwoDeviceDriver;
|
||||
import org.nl.acs.device_driver.autodoor.standard_autodoor.StandardAutodoorDeviceDriver;
|
||||
import org.nl.acs.device_driver.autodoor.lift_door.LiftDoorDeviceDriver;
|
||||
import org.nl.acs.device_driver.autodoor.air_shower_door.AirShowerDoorDeviceDriver;
|
||||
import org.nl.acs.device_driver.conveyor.standard_inspect_site.StandardInspectSiteDeviceDriver;
|
||||
import org.nl.acs.device_driver.two_conveyor.oven_manipulator.OvenGantryManipulatorDeviceDriver;
|
||||
import org.nl.acs.device_driver.conveyor.standard_ordinary_site.StandardOrdinarySiteDeviceDriver;
|
||||
import org.nl.acs.ext.wms.service.AcsToWmsService;
|
||||
import org.nl.acs.ext.wms.service.impl.AcsToWmsServiceImpl;
|
||||
import org.nl.acs.instruction.domain.Instruction;
|
||||
@@ -31,13 +31,9 @@ import org.springframework.stereotype.Component;
|
||||
import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Field;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.net.Socket;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
|
||||
import static org.nl.acs.agv.server.impl.NDCAgvServiceImpl.Bytes2HexString;
|
||||
|
||||
@@ -167,7 +163,8 @@ public class TwoNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
||||
String old_device_code = null;
|
||||
String emptyNum = null;
|
||||
//自动门
|
||||
StandardAutodoorDeviceDriver standardAutodoorDeviceDriver;
|
||||
AirShowerDoorDeviceDriver standardAutodoorDeviceDriver;
|
||||
LiftDoorDeviceDriver liftDoorDeviceDriver;
|
||||
if (agvaddr != 0) {
|
||||
old_device_code = deviceService.queryDeviceCodeByAddress(agvaddr);
|
||||
if (StrUtil.contains(old_device_code, "-")) {
|
||||
@@ -204,18 +201,41 @@ public class TwoNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
||||
} else {
|
||||
String agvcar = inst.getCarno();
|
||||
Device agvDevice = deviceAppService.findDeviceByCode(agvcar);
|
||||
agvNdcTwoDeviceDriver = (AgvNdcTwoDeviceDriver) agvDevice.getDeviceDriver();
|
||||
agvNdcTwoDeviceDriver.setInstruction(null);
|
||||
//标准-光电检测
|
||||
StandardInspectSiteDeviceDriver standardInspectSiteDeviceDriver;
|
||||
if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
|
||||
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver();
|
||||
try {
|
||||
standardInspectSiteDeviceDriver.writing(1);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
if (agvDevice != null) {
|
||||
if (agvDevice.getDeviceDriver() instanceof AgvNdcTwoDeviceDriver) {
|
||||
agvNdcTwoDeviceDriver = (AgvNdcTwoDeviceDriver) agvDevice.getDeviceDriver();
|
||||
agvNdcTwoDeviceDriver.setInstruction(null);
|
||||
} else if (device.getDeviceDriver() instanceof AgvNdcOneDeviceDriver) {
|
||||
agvNdcOneDeviceDriver = (AgvNdcOneDeviceDriver) device.getDeviceDriver();
|
||||
agvNdcOneDeviceDriver.setInstruction(null);
|
||||
}
|
||||
if ((standardInspectSiteDeviceDriver.getOption() == 3 )) {
|
||||
}
|
||||
//普通站点
|
||||
StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver;
|
||||
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
|
||||
standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver();
|
||||
//废泊处理的时候要判断是否允许任务完成
|
||||
if (ObjectUtil.isNotEmpty(device.getExtraValue().get("finish_task"))
|
||||
&& StrUtil.equals("true", device.getExtraValue().get("finish_task").toString())) {
|
||||
if (standardOrdinarySiteDeviceDriver.getOption() == 3) {
|
||||
inst.setInstruction_status("2");
|
||||
try {
|
||||
instructionService.finish(inst);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
|
||||
} else {
|
||||
log.info("等待LMS系统进行确认允许任务完成信号,设备号{},option值{}", standardOrdinarySiteDeviceDriver.getDevice_code(), standardOrdinarySiteDeviceDriver.getOption());
|
||||
logServer.deviceExecuteLog(device.getDevice_code(), "", "", "等待LMS系统进行确认允许取货,设备号" + device.getDevice_code() + ",指令号" + ikey);
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(standardOrdinarySiteDeviceDriver.getDevice_code())
|
||||
.content("等待LMS系统进行确认允许任务完成信号,设备号" + standardOrdinarySiteDeviceDriver.getDevice_code() + ",option当前值" + standardOrdinarySiteDeviceDriver.getOption())
|
||||
.build();
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
}
|
||||
} else {
|
||||
inst.setInstruction_status("2");
|
||||
try {
|
||||
instructionService.finish(inst);
|
||||
@@ -223,23 +243,9 @@ public class TwoNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
||||
e.printStackTrace();
|
||||
}
|
||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(agvDevice.getDevice_code())
|
||||
.content("agvphase:" + phase + "反馈:" + data)
|
||||
.build();
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
} else {
|
||||
agvNdcTwoDeviceDriver.setMessage("设备号:" + device_code + "option"+ standardInspectSiteDeviceDriver.getOption()+ "不满足完成任务条件");
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(agvDevice.getDevice_code())
|
||||
.content(agvNdcTwoDeviceDriver.getMessage())
|
||||
.build();
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
//请求删除任务
|
||||
@@ -263,8 +269,8 @@ public class TwoNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
||||
return;
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(device)) {
|
||||
if (device.getDeviceDriver() instanceof StandardAutodoorDeviceDriver) {
|
||||
standardAutodoorDeviceDriver = (StandardAutodoorDeviceDriver) device.getDeviceDriver();
|
||||
if (device.getDeviceDriver() instanceof AirShowerDoorDeviceDriver) {
|
||||
standardAutodoorDeviceDriver = (AirShowerDoorDeviceDriver) device.getDeviceDriver();
|
||||
try {
|
||||
standardAutodoorDeviceDriver.writing("to_open", "1");
|
||||
standardAutodoorDeviceDriver.writing("to_close", "0");
|
||||
@@ -279,6 +285,25 @@ public class TwoNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
||||
log.info("未下发NDC信号原因: 下发开门信号值为:{},读取开门信号值为:{}", standardAutodoorDeviceDriver.getToOpen(), standardAutodoorDeviceDriver.getToClose());
|
||||
}
|
||||
}
|
||||
if (device.getDeviceDriver() instanceof LiftDoorDeviceDriver) {
|
||||
liftDoorDeviceDriver = (LiftDoorDeviceDriver) device.getDeviceDriver();
|
||||
try {
|
||||
liftDoorDeviceDriver.writing("to_open1", "1");
|
||||
liftDoorDeviceDriver.writing("to_open2", "1");
|
||||
liftDoorDeviceDriver.writing("to_close1", "0");
|
||||
liftDoorDeviceDriver.writing("to_close2", "0");
|
||||
} catch (Exception e) {
|
||||
log.info("下发电梯门电气信号失败:" + e.getMessage());
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (liftDoorDeviceDriver.getOpen1() == 1 && liftDoorDeviceDriver.getToOpen1() == 1 && liftDoorDeviceDriver.getOpen2() == 1 && liftDoorDeviceDriver.getToOpen2() == 1) {
|
||||
log.info("下发电梯门开门信号值为:{},读取开门信号值为:{}", liftDoorDeviceDriver.getToOpen1(), liftDoorDeviceDriver.getOpen1(), liftDoorDeviceDriver.getToOpen2(), liftDoorDeviceDriver.getOpen2());
|
||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
|
||||
} else {
|
||||
log.info("未下发NDC信号原因: 下发开门信号值为:{},读取开门信号值为:{}", liftDoorDeviceDriver.getToOpen1(), liftDoorDeviceDriver.getOpen1(), liftDoorDeviceDriver.getToOpen2(), liftDoorDeviceDriver.getOpen2());
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
log.info(agvaddr + "对应设备号为空!");
|
||||
}
|
||||
@@ -289,8 +314,8 @@ public class TwoNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
||||
return;
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(device)) {
|
||||
if (device.getDeviceDriver() instanceof StandardAutodoorDeviceDriver) {
|
||||
standardAutodoorDeviceDriver = (StandardAutodoorDeviceDriver) device.getDeviceDriver();
|
||||
if (device.getDeviceDriver() instanceof AirShowerDoorDeviceDriver) {
|
||||
standardAutodoorDeviceDriver = (AirShowerDoorDeviceDriver) device.getDeviceDriver();
|
||||
try {
|
||||
standardAutodoorDeviceDriver.writing("to_close", "1");
|
||||
standardAutodoorDeviceDriver.writing("to_open", "0");
|
||||
|
||||
@@ -1578,7 +1578,7 @@ public class DeviceServiceImpl extends CommonServiceImpl<DeviceMapper, Device> i
|
||||
Iterator iterator = storageCells.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
StorageCellDto storageCellDto = (StorageCellDto) iterator.next();
|
||||
if (storageCellDto.getAddress() == code) {
|
||||
if (storageCellDto.getAddress() != null && storageCellDto.getAddress() == code) {
|
||||
return storageCellDto.getStorage_code();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -522,26 +522,26 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
|
||||
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
|
||||
standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver();
|
||||
if (ObjectUtil.isNotEmpty(this.device.getExtraValue().get("wait"))
|
||||
&& StrUtil.equals("true", this.device.getExtraValue().get("wait").toString())
|
||||
if (ObjectUtil.isNotEmpty(standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("wait"))
|
||||
&& StrUtil.equals("true", standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("wait").toString())
|
||||
&& StrUtil.equals(task.getTask_type(), "1")) {
|
||||
standardOrdinarySiteDeviceDriver.setOption(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);
|
||||
//
|
||||
if (standardOrdinarySiteDeviceDriver.getOption() == 2) {
|
||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
|
||||
standardOrdinarySiteDeviceDriver.setOption(0);
|
||||
} else {
|
||||
log.info("等待LMS系统进行确认离开,设备号{},指令号:{}", device_code, ikey);
|
||||
message = "等待LMS系统进行确认离开,设备号:" + device_code + ",指令号:" + ikey;
|
||||
}
|
||||
} else {
|
||||
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);
|
||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 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(standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("feedbackToLms"))
|
||||
&& StrUtil.equals("true", standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("feedbackToLms").toString())) {
|
||||
@@ -790,7 +790,9 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if ((manipulatorAgvStationDeviceDriver.getAction() == 1)) {
|
||||
//收卷辊忽略取货校验
|
||||
if (ObjectUtil.isNotEmpty(manipulatorAgvStationDeviceDriver.getDevice().getExtraValue().get("ignore_pickup_check"))
|
||||
&& StrUtil.equals("true", manipulatorAgvStationDeviceDriver.getDevice().getExtraValue().get("ignore_pickup_check").toString())) {
|
||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(this.getDeviceCode())
|
||||
@@ -799,13 +801,23 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
} else {
|
||||
message = "设备号:" + device_code + ",动作信号:" + manipulatorAgvStationDeviceDriver.getAction() + "报警信号:" + ",指令号:" + ikey + "不满足取货条件";
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(manipulatorAgvStationDeviceDriver.getDevice_code())
|
||||
.content(manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1")
|
||||
.build();
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
if ((manipulatorAgvStationDeviceDriver.getAction() == 1)) {
|
||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(this.getDeviceCode())
|
||||
.content("agvphase:" + phase + "反馈:" + data)
|
||||
.build();
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
} else {
|
||||
message = "设备号:" + device_code + ",动作信号:" + manipulatorAgvStationDeviceDriver.getAction() + "报警信号:" + ",指令号:" + ikey + "不满足取货条件";
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(manipulatorAgvStationDeviceDriver.getDevice_code())
|
||||
.content(manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1")
|
||||
.build();
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
}
|
||||
}
|
||||
} else if (device.getDeviceDriver() instanceof PaperTubePickSiteDeviceDriver) {
|
||||
paperTubePickSiteDeviceDriver = (PaperTubePickSiteDeviceDriver) device.getDeviceDriver();
|
||||
@@ -984,32 +996,52 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
String next_device_code = inst.getNext_device_code();
|
||||
String start_device_code2 = inst.getStart_device_code2();
|
||||
String next_device_code2 = inst.getNext_device_code2();
|
||||
|
||||
//取空锟或去烘箱放货的时候需要请求进入
|
||||
if (ObjectUtil.isNotEmpty(start_device_code) && StrUtil.equals(device_code, start_device_code)) {
|
||||
if (device.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) {
|
||||
manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) device.getDeviceDriver();
|
||||
|
||||
try {
|
||||
manipulatorAgvStationDeviceDriver.writing(2);
|
||||
manipulatorAgvStationDeviceDriver.writing(6);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if ((manipulatorAgvStationDeviceDriver.getAction() == 1)) {
|
||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(this.getDeviceCode())
|
||||
.content("agvphase:" + phase + "反馈:" + data)
|
||||
.build();
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
if (ObjectUtil.isNotEmpty(manipulatorAgvStationDeviceDriver.getDevice().getExtraValue().get("ignore_release_check"))
|
||||
&& StrUtil.equals("true", manipulatorAgvStationDeviceDriver.getDevice().getExtraValue().get("ignore_release_check").toString())) {
|
||||
if (manipulatorAgvStationDeviceDriver.getAction() == 1 && manipulatorAgvStationDeviceDriver.getMode() == 2 && manipulatorAgvStationDeviceDriver.getMove() == 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 {
|
||||
message = "设备号:" + device_code + ",动作信号:" + manipulatorAgvStationDeviceDriver.getAction() + "mode信号:" + manipulatorAgvStationDeviceDriver.getMode() + "光电信号:" + manipulatorAgvStationDeviceDriver.getMove() + ",指令号:" + ikey + "不满足取货条件";
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(manipulatorAgvStationDeviceDriver.getDeviceCode())
|
||||
.content(manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1")
|
||||
.build();
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
}
|
||||
} else {
|
||||
message = "设备号:" + device_code + ",动作信号:" + manipulatorAgvStationDeviceDriver.getAction() + "报警信号:" + ",指令号:" + ikey + "不满足取货条件";
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(manipulatorAgvStationDeviceDriver.getDeviceCode())
|
||||
.content(manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1")
|
||||
.build();
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
if ((manipulatorAgvStationDeviceDriver.getAction() == 1)) {
|
||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(this.getDeviceCode())
|
||||
.content("agvphase:" + phase + "反馈:" + data)
|
||||
.build();
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
} else {
|
||||
message = "设备号:" + device_code + ",动作信号:" + manipulatorAgvStationDeviceDriver.getAction() + "报警信号:" + ",指令号:" + ikey + "不满足取货条件";
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(manipulatorAgvStationDeviceDriver.getDeviceCode())
|
||||
.content(manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1")
|
||||
.build();
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (ObjectUtil.isNotEmpty(start_device_code) && StrUtil.equals(device_code, next_device_code)) {
|
||||
@@ -1104,6 +1136,79 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
// luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
// }
|
||||
}
|
||||
//请求离开
|
||||
else if (phase == 0x4E) {
|
||||
if (agvaddr == 0) {
|
||||
agvaddr = agvaddr_copy;
|
||||
}
|
||||
if (agvaddr < 1) {
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(device_code)
|
||||
.content("agv地址参数有误,phase:" + phase)
|
||||
.build();
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
return;
|
||||
}
|
||||
if (agvaddr != 0) {
|
||||
CommonFinalParam commonFinalParam = new CommonFinalParam();
|
||||
old_device_code = deviceService.queryDeviceCodeByAddress(agvaddr);
|
||||
if (StrUtil.contains(old_device_code, commonFinalParam.getBARRE())) {
|
||||
String[] point = old_device_code.split(commonFinalParam.getBARRE());
|
||||
device_code = point[0];
|
||||
} else if (StrUtil.contains(old_device_code, commonFinalParam.getPOINT())) {
|
||||
String[] point = old_device_code.split("\\.");
|
||||
device_code = point[0];
|
||||
emptyNum = point[1];
|
||||
} else {
|
||||
device_code = old_device_code;
|
||||
}
|
||||
}
|
||||
|
||||
device = deviceAppService.findDeviceByCode(device_code);
|
||||
if (ObjectUtil.isEmpty(device_code)) {
|
||||
log.info(agvaddr + "对应设备号为空!");
|
||||
return;
|
||||
}
|
||||
if (ObjectUtil.isEmpty(inst)) {
|
||||
log.info("未找到指令号{}对应的指令", ikey);
|
||||
return;
|
||||
}
|
||||
|
||||
String start_device_code = inst.getStart_device_code();
|
||||
String next_device_code = inst.getNext_device_code();
|
||||
String start_device_code2 = inst.getStart_device_code2();
|
||||
String next_device_code2 = inst.getNext_device_code2();
|
||||
//AGV取完收卷辊请求离开
|
||||
if (ObjectUtil.isNotEmpty(start_device_code) && StrUtil.equals(device_code, start_device_code)) {
|
||||
if (device.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) {
|
||||
manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) device.getDeviceDriver();
|
||||
try {
|
||||
manipulatorAgvStationDeviceDriver.writing(7);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (manipulatorAgvStationDeviceDriver.getAction() == 1) {
|
||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(this.getDeviceCode())
|
||||
.content("agvphase:" + phase + "反馈:" + data)
|
||||
.build();
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
} else {
|
||||
message = "设备号:" + device_code + ",动作信号:" + manipulatorAgvStationDeviceDriver.getAction() + "mode信号:" + manipulatorAgvStationDeviceDriver.getMode() + "光电信号:" + manipulatorAgvStationDeviceDriver.getMove() + ",指令号:" + ikey + "不满足取货条件";
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(manipulatorAgvStationDeviceDriver.getDeviceCode())
|
||||
.content(manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1")
|
||||
.build();
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 取货完毕
|
||||
//(Itype=1、3,需要WCS反馈)
|
||||
@@ -1418,23 +1523,52 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if ((manipulatorAgvStationDeviceDriver.getAction() == 1)) {
|
||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(this.getDeviceCode())
|
||||
.content("agvphase:" + phase + "反馈:" + data)
|
||||
.build();
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
//申请烘箱行架任务
|
||||
if (ObjectUtil.isNotEmpty(manipulatorAgvStationDeviceDriver.getDevice().getExtraValue().get("request_robot_task"))
|
||||
&& StrUtil.equals("true", manipulatorAgvStationDeviceDriver.getDevice().getExtraValue().get("request_robot_task").toString())) {
|
||||
if (manipulatorAgvStationDeviceDriver.getTo_command() != 4) {
|
||||
String task_code = inst.getTask_code();
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("task_code", task_code);
|
||||
acsToWmsService.applyOvenGantryTask(jsonObject);
|
||||
}
|
||||
//行架取货完成后反馈ndc
|
||||
if ((manipulatorAgvStationDeviceDriver.getAction() == 2)) {
|
||||
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 {
|
||||
log.info("设备{},动作信号{} ,不满足取货条件,指令号{}", manipulatorAgvStationDeviceDriver.getDeviceCode(), manipulatorAgvStationDeviceDriver.getAction(), ikey);
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(manipulatorAgvStationDeviceDriver.getDeviceCode())
|
||||
.content(manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1")
|
||||
.build();
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
}
|
||||
} else {
|
||||
message = "设备号:" + device_code + ",动作信号:" + manipulatorAgvStationDeviceDriver.getAction() + "报警信号:" + ",指令号:" + ikey + "不满足取货条件";
|
||||
log.info("设备{},动作信号{} ,不满足取货条件,指令号{}", device_code, manipulatorAgvStationDeviceDriver.getAction(), ikey);
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(manipulatorAgvStationDeviceDriver.getDeviceCode())
|
||||
.content(manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1")
|
||||
.build();
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
if ((manipulatorAgvStationDeviceDriver.getAction() == 1)) {
|
||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(this.getDeviceCode())
|
||||
.content("agvphase:" + phase + "反馈:" + data)
|
||||
.build();
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
} else {
|
||||
message = "设备号:" + device_code + ",动作信号:" + manipulatorAgvStationDeviceDriver.getAction() + "报警信号:" + ",指令号:" + ikey + "不满足取货条件";
|
||||
log.info("设备{},动作信号{} ,不满足取货条件,指令号{}", device_code, manipulatorAgvStationDeviceDriver.getAction(), ikey);
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(manipulatorAgvStationDeviceDriver.getDeviceCode())
|
||||
.content(manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1")
|
||||
.build();
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
}
|
||||
}
|
||||
} else if (device.getDeviceDriver() instanceof HongXiangStationDeviceDriver) {
|
||||
hongXiangStationDeviceDriver = (HongXiangStationDeviceDriver) device.getDeviceDriver();
|
||||
@@ -1814,29 +1948,49 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
}
|
||||
String agv_inst_type = inst.getAgv_inst_type();
|
||||
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
|
||||
// standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver();
|
||||
// if (ObjectUtil.isNotEmpty(standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("wait"))
|
||||
// && StrUtil.equals("true", standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("wait").toString())
|
||||
// && StrUtil.equals(task.getTask_type(), "1")) {
|
||||
// //
|
||||
// if (standardOrdinarySiteDeviceDriver.getOption() == 2) {
|
||||
// data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
|
||||
// standardOrdinarySiteDeviceDriver.setOption(0);
|
||||
// } else {
|
||||
// log.info("等待LMS系统进行确认离开,设备号{},指令号:{}", device_code, ikey);
|
||||
// message = "等待LMS系统进行确认离开,设备号:" + device_code + ",指令号:" + ikey;
|
||||
// }
|
||||
// } else {
|
||||
// data = ndcAgvService.sendAgvTwoModeInst(phase, index, 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);
|
||||
this.setPhase(phase);
|
||||
standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver();
|
||||
if (ObjectUtil.isNotEmpty(device.getExtraValue().get("wait"))
|
||||
&& StrUtil.equals("true", device.getExtraValue().get("wait").toString())
|
||||
&& StrUtil.equals(task.getTask_type(), "1")) {
|
||||
if (standardOrdinarySiteDeviceDriver.getOption() == 1) {
|
||||
String task_code = standardOrdinarySiteDeviceDriver.getTask_code();
|
||||
log.info("当前任务号{},创建任务号{}", task.getTask_code(), task_code);
|
||||
if (StrUtil.isEmpty(task_code) || !task_code.equals(task.getTask_code())) {
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(this.getDeviceCode())
|
||||
.content("任务号为空")
|
||||
.build();
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
} else {
|
||||
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 {
|
||||
log.info("等待LMS系统进行确认允许取货,设备号{},option值{}", standardOrdinarySiteDeviceDriver.getDevice_code(), standardOrdinarySiteDeviceDriver.getOption());
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "等待LMS系统进行确认允许取货,设备号" + device.getDevice_code() + ",指令号" + ikey);
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(standardOrdinarySiteDeviceDriver.getDevice_code())
|
||||
.content("等待LMS系统进行确认允许取货,设备号" + standardOrdinarySiteDeviceDriver.getDevice_code() + ",option当前值" + standardOrdinarySiteDeviceDriver.getOption())
|
||||
.build();
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
}
|
||||
} else {
|
||||
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);
|
||||
this.setPhase(phase);
|
||||
}
|
||||
|
||||
} else if (device.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) {
|
||||
manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) device.getDeviceDriver();
|
||||
@@ -1846,7 +2000,37 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if ((manipulatorAgvStationDeviceDriver.getAction() == 1)) {
|
||||
//申请烘箱行架任务
|
||||
if (ObjectUtil.isNotEmpty(manipulatorAgvStationDeviceDriver.getDevice().getExtraValue().get("request_robot_task"))
|
||||
&& StrUtil.equals("true", manipulatorAgvStationDeviceDriver.getDevice().getExtraValue().get("request_robot_task").toString())) {
|
||||
if (manipulatorAgvStationDeviceDriver.getTo_command() != 4) {
|
||||
String task_code = inst.getTask_code();
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("task_code", task_code);
|
||||
acsToWmsService.applyOvenGantryTask(jsonObject);
|
||||
}
|
||||
//行架取货完成后反馈ndc
|
||||
if ((manipulatorAgvStationDeviceDriver.getAction() == 2)) {
|
||||
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 {
|
||||
log.info("设备{},动作信号{} ,不满足取货条件,指令号{}", manipulatorAgvStationDeviceDriver.getDeviceCode(), manipulatorAgvStationDeviceDriver.getAction(), ikey);
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(manipulatorAgvStationDeviceDriver.getDeviceCode())
|
||||
.content(manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1")
|
||||
.build();
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
}
|
||||
}
|
||||
//收卷辊放货忽略取货校验
|
||||
if (ObjectUtil.isNotEmpty(manipulatorAgvStationDeviceDriver.getDevice().getExtraValue().get("ignore_pickup_check"))
|
||||
&& StrUtil.equals("true", manipulatorAgvStationDeviceDriver.getDevice().getExtraValue().get("ignore_pickup_check").toString())) {
|
||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(this.getDeviceCode())
|
||||
@@ -1855,14 +2039,24 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
} else {
|
||||
message = "设备号:" + device_code + ",动作信号:" + manipulatorAgvStationDeviceDriver.getAction() + "报警信号:" + ",指令号:" + ikey + "不满足取货条件";
|
||||
log.info("设备{},动作信号{} ,不满足取货条件,指令号{}", device_code, manipulatorAgvStationDeviceDriver.getAction(), ikey);
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(manipulatorAgvStationDeviceDriver.getDeviceCode())
|
||||
.content(manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1")
|
||||
.build();
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
if ((manipulatorAgvStationDeviceDriver.getAction() == 1)) {
|
||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(this.getDeviceCode())
|
||||
.content("agvphase:" + phase + "反馈:" + data)
|
||||
.build();
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
} else {
|
||||
message = "设备号:" + device_code + ",动作信号:" + manipulatorAgvStationDeviceDriver.getAction() + "报警信号:" + ",指令号:" + ikey + "不满足取货条件";
|
||||
log.info("设备{},动作信号{} ,不满足取货条件,指令号{}", device_code, manipulatorAgvStationDeviceDriver.getAction(), ikey);
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(manipulatorAgvStationDeviceDriver.getDeviceCode())
|
||||
.content(manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1")
|
||||
.build();
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
}
|
||||
}
|
||||
} else if (device.getDeviceDriver() instanceof HongXiangStationDeviceDriver) {
|
||||
hongXiangStationDeviceDriver = (HongXiangStationDeviceDriver) device.getDeviceDriver();
|
||||
@@ -2025,22 +2219,21 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
}
|
||||
String agv_inst_type = inst.getAgv_inst_type();
|
||||
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
|
||||
// standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver();
|
||||
// if (ObjectUtil.isNotEmpty(standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("wait"))
|
||||
// && StrUtil.equals("true", standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("wait").toString())
|
||||
// && StrUtil.equals(task.getTask_type(), "1")) {
|
||||
// //
|
||||
// if (standardOrdinarySiteDeviceDriver.getOption() == 2) {
|
||||
// data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
|
||||
// standardOrdinarySiteDeviceDriver.setOption(0);
|
||||
// } else {
|
||||
// log.info("等待LMS系统进行确认离开,设备号{},指令号:{}", device_code, ikey);
|
||||
// message = "等待LMS系统进行确认离开,设备号:" + device_code + ",指令号:" + ikey;
|
||||
// }
|
||||
// } else {
|
||||
// data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
|
||||
// }
|
||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
|
||||
standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver();
|
||||
if (ObjectUtil.isNotEmpty(standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("wait"))
|
||||
&& StrUtil.equals("true", standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("wait").toString())
|
||||
&& StrUtil.equals(task.getTask_type(), "1")) {
|
||||
//
|
||||
if (standardOrdinarySiteDeviceDriver.getOption() == 2) {
|
||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
|
||||
standardOrdinarySiteDeviceDriver.setOption(0);
|
||||
} else {
|
||||
log.info("等待LMS系统进行确认离开,设备号{},指令号:{}", device_code, ikey);
|
||||
message = "等待LMS系统进行确认离开,设备号:" + device_code + ",指令号:" + ikey;
|
||||
}
|
||||
} else {
|
||||
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
|
||||
}
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(this.getDeviceCode())
|
||||
.content("agvphase:" + phase + "反馈:" + data)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package org.nl.acs.device_driver.autodoor.standard_autodoor;
|
||||
package org.nl.acs.device_driver.autodoor.air_shower_door;
|
||||
|
||||
import org.nl.acs.device.device_driver.standard_inspect.ItemDto;
|
||||
import org.nl.acs.device.domain.Device;
|
||||
@@ -11,35 +11,35 @@ import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 自动门驱动定义
|
||||
* 风淋室门
|
||||
*/
|
||||
@Service
|
||||
public class StandardAutodoorDefination implements OpcDeviceDriverDefination {
|
||||
public class AirShowerDoorDefination implements OpcDeviceDriverDefination {
|
||||
@Override
|
||||
public String getDriverCode() {
|
||||
return "standard_autodoor";
|
||||
return "air_shower_door";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDriverName() {
|
||||
return "标准版-自动门";
|
||||
return "风淋室门";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDriverDescription() {
|
||||
return "标准版-自动门";
|
||||
return "风淋室门";
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public DeviceDriver getDriverInstance(Device device) {
|
||||
return (new StandardAutodoorDeviceDriver()).setDevice(device).setDriverDefination(this);
|
||||
return (new AirShowerDoorDeviceDriver()).setDevice(device).setDriverDefination(this);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends DeviceDriver> getDeviceDriverType() {
|
||||
return StandardAutodoorDeviceDriver.class;
|
||||
return AirShowerDoorDeviceDriver.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1,12 +1,12 @@
|
||||
package org.nl.acs.device_driver.autodoor.standard_autodoor;
|
||||
package org.nl.acs.device_driver.autodoor.air_shower_door;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.Data;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.acs.device.domain.Device;
|
||||
import org.nl.acs.device_driver.DeviceDriver;
|
||||
import org.nl.acs.device_driver.autodoor.standard_autodoor.ToDoorCommandControl;
|
||||
import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver;
|
||||
import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
|
||||
import org.nl.acs.log.service.DeviceExecuteLogService;
|
||||
@@ -28,7 +28,7 @@ import java.util.Map;
|
||||
@Slf4j
|
||||
@Data
|
||||
@RequiredArgsConstructor
|
||||
public class StandardAutodoorDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, DeviceStageMonitor {
|
||||
public class AirShowerDoorDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, DeviceStageMonitor {
|
||||
protected ItemProtocol itemProtocol = new ItemProtocol(this);
|
||||
protected ToDoorCommandControl toDoorCommandControl = new ToDoorCommandControl(this);
|
||||
DeviceExecuteLogService logServer = SpringContextHolder.getBean("deviceExecuteLogServiceImpl");
|
||||
@@ -1,4 +1,4 @@
|
||||
package org.nl.acs.device_driver.autodoor.standard_autodoor;
|
||||
package org.nl.acs.device_driver.autodoor.air_shower_door;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -15,9 +15,13 @@ public class ItemProtocol {
|
||||
public static String item_to_close = "to_close";
|
||||
|
||||
|
||||
private StandardAutodoorDeviceDriver driver;
|
||||
public static String item_status = "status";
|
||||
|
||||
public ItemProtocol(StandardAutodoorDeviceDriver driver) {
|
||||
public static String item_error = "error";
|
||||
|
||||
private AirShowerDoorDeviceDriver driver;
|
||||
|
||||
public ItemProtocol(AirShowerDoorDeviceDriver driver) {
|
||||
this.driver = driver;
|
||||
}
|
||||
|
||||
@@ -38,6 +42,16 @@ public class ItemProtocol {
|
||||
return this.getOpcIntegerValue(item_to_close);
|
||||
}
|
||||
|
||||
|
||||
public int getStatus() {
|
||||
return this.getOpcIntegerValue(item_status);
|
||||
}
|
||||
|
||||
|
||||
public int getError() {
|
||||
return this.getOpcIntegerValue(item_error);
|
||||
}
|
||||
|
||||
public int getOpcIntegerValue(String protocol) {
|
||||
Integer value = this.driver.getIntegeregerValue(protocol);
|
||||
if (value == null) {
|
||||
@@ -63,6 +77,8 @@ public class ItemProtocol {
|
||||
ArrayList list = new ArrayList();
|
||||
list.add(new ItemDto(item_open, "开到位", "10001"));
|
||||
list.add(new ItemDto(item_close, "关到位", "10002"));
|
||||
list.add(new ItemDto(item_status, "状态", "10002"));
|
||||
list.add(new ItemDto(item_error, "异常", "10002"));
|
||||
return list;
|
||||
}
|
||||
|
||||
@@ -44,6 +44,7 @@ public class LiftDoorDeviceDriver extends AbstractOpcDeviceDriver implements Dev
|
||||
int last_close2 = 0;
|
||||
int toOpen1 = 0;
|
||||
int last_toOpen1 = 0;
|
||||
int toOpen2 = 0;
|
||||
int toClose = 0;
|
||||
int last_toClose = 0;
|
||||
String device_code = null;
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
package org.nl.acs.device_driver.autodoor.standard_autodoor;
|
||||
|
||||
|
||||
import org.nl.acs.device_driver.autodoor.air_shower_door.AirShowerDoorDeviceDriver;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class ToDoorCommandControl {
|
||||
|
||||
private StandardAutodoorDeviceDriver driver;
|
||||
private AirShowerDoorDeviceDriver driver;
|
||||
|
||||
public ToDoorCommandControl(StandardAutodoorDeviceDriver driver){
|
||||
public ToDoorCommandControl(AirShowerDoorDeviceDriver driver){
|
||||
this.driver = driver;
|
||||
}
|
||||
|
||||
|
||||
@@ -17,6 +17,8 @@ public class ItemProtocol {
|
||||
|
||||
public static String item_to_command = "to_command";
|
||||
|
||||
public static String item_move = "move";
|
||||
|
||||
private ManipulatorAgvStationDeviceDriver driver;
|
||||
|
||||
public ItemProtocol(ManipulatorAgvStationDeviceDriver driver){
|
||||
@@ -33,6 +35,10 @@ public class ItemProtocol {
|
||||
return this.getOpcIntegerValue(item_action);
|
||||
}
|
||||
|
||||
public int getMove() {
|
||||
return this.getOpcIntegerValue(item_move);
|
||||
}
|
||||
|
||||
Boolean isonline;
|
||||
Boolean isError;
|
||||
|
||||
@@ -58,6 +64,7 @@ public class ItemProtocol {
|
||||
list.add(new ItemDto(item_heartbeat, "心跳", "DB19.B0"));
|
||||
list.add(new ItemDto(item_mode, "工作模式", "DB19.B1"));
|
||||
list.add(new ItemDto(item_action, "取放信号", "DB19.B3"));
|
||||
list.add(new ItemDto(item_move, "光电信号", "DB1.B2"));
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
@@ -90,6 +90,10 @@ public class ManipulatorAgvStationDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
|
||||
Boolean iserror = false;
|
||||
|
||||
//光电信号
|
||||
int move = 0;
|
||||
int last_move = 0;
|
||||
|
||||
/**
|
||||
* 1-执行任务;2-取货完成;3-放货完成;
|
||||
*/
|
||||
@@ -119,6 +123,7 @@ public class ManipulatorAgvStationDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
heartbeat = this.itemProtocol.getItem_heartbeat();
|
||||
action = this.itemProtocol.getItem_action();
|
||||
iserror = this.itemProtocol.isError;
|
||||
move = this.itemProtocol.getMove();
|
||||
|
||||
|
||||
if (mode != last_mode) {
|
||||
@@ -269,6 +274,7 @@ public class ManipulatorAgvStationDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
}
|
||||
jo.put("device_name", this.getDevice().getDevice_name());
|
||||
jo.put("mode", mode);
|
||||
jo.put("move", move);
|
||||
jo.put("action", action);
|
||||
jo.put("isOnline", true);
|
||||
jo.put("isError", this.getIserror());
|
||||
|
||||
@@ -350,27 +350,24 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
if (startdevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) {
|
||||
hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) startdevice.getDeviceDriver();
|
||||
if (hongXiangConveyorDeviceDriver.getMode() == 0 || hongXiangConveyorDeviceDriver.getMove() == 0) {
|
||||
notCreateInstMessage = "手动创建指令未下发电气信号原因->取货位-烘箱:" + hongXiangConveyorDeviceDriver.getDevice_code() + "未联机或无货,无法下发指令!指令号:" + instruction.getInstruction_code();
|
||||
notCreateInstMessage = "手动创建指令未下发电气信号原因->取货位-烘箱:" + hongXiangConveyorDeviceDriver.getDevice_code() + "未联机或无货,无法或者为开门下发指令!指令号:" + instruction.getInstruction_code();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if (nextdevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) {
|
||||
hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) nextdevice.getDeviceDriver();
|
||||
if (hongXiangConveyorDeviceDriver.getMode() == 0 || hongXiangConveyorDeviceDriver.getMove() == 1) {
|
||||
notCreateInstMessage = "手动创建指令未下发电气信号原因->放货位-烘箱:" + hongXiangConveyorDeviceDriver.getDevice_code() + "未联机或者有货,无法下发指令!指令号:" + instruction.getInstruction_code();
|
||||
if (hongXiangConveyorDeviceDriver.getMode() == 0 || hongXiangConveyorDeviceDriver.getMove() == 1 ) {
|
||||
notCreateInstMessage = "手动创建指令未下发电气信号原因->放货位-烘箱:" + hongXiangConveyorDeviceDriver.getDevice_code() + "未联机或者有货或者未开门,无法下发指令!指令号:" + instruction.getInstruction_code();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
//判断关联的同一列烘箱设备是否都关门 都关门返回false,有一个不关门就返回true
|
||||
boolean isCloseDoor = this.judgeCloseDoor(start_device_code, next_device_code);
|
||||
//未关门结束
|
||||
if (isCloseDoor) {
|
||||
notCreateInstMessage = "手动创建指令未下发电气信号原因->取货位:" + start_device_code + ",放货位:" + next_device_code + ",存在关联的同一列烘箱设备未关门!指令号:" + instruction.getInstruction_code();
|
||||
return false;
|
||||
}
|
||||
/*instruction.setInstruction_status("1");
|
||||
instruction.setUpdate_time(DateUtil.now());
|
||||
instructionService.update(instruction);*/
|
||||
|
||||
|
||||
|
||||
Device startDevice = deviceAppService.findDeviceByCode(start_device_code);
|
||||
Device nextDevice = deviceAppService.findDeviceByCode(next_device_code);
|
||||
if (ObjectUtil.isEmpty(startDevice.getExtraValue().get("address"))) {
|
||||
@@ -483,12 +480,6 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
instdto.setInstruction_status("0");
|
||||
instdto.setExecute_device_code(start_point_code);
|
||||
|
||||
//判断关联的同一列烘箱设备是否都关门 都关门返回false,有一个不关门就返回true
|
||||
boolean isCloseDoor = this.judgeCloseDoor(instdto.getStart_device_code(), instdto.getNext_device_code());
|
||||
//如果未关门结束
|
||||
if (isCloseDoor) {
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
instructionService.create(instdto);
|
||||
} catch (Exception e) {
|
||||
|
||||
@@ -14,7 +14,7 @@ import java.util.List;
|
||||
public class PipeCoreRackStationDefination implements OpcDeviceDriverDefination {
|
||||
@Override
|
||||
public String getDriverCode() {
|
||||
return "pipe_core_rack_manipulator";
|
||||
return "pipe_core_rack_station";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -39,10 +39,18 @@ public class ItemProtocol {
|
||||
public static String item_walk_y = "walk_y";
|
||||
|
||||
/**
|
||||
* 横坐标
|
||||
* 管芯规格
|
||||
*/
|
||||
public static String item_barcode = "barcode";
|
||||
|
||||
/**
|
||||
* 库位
|
||||
*/
|
||||
public static String item_target = "target";
|
||||
|
||||
//任务号
|
||||
public static String item_task = "task";
|
||||
|
||||
|
||||
/**
|
||||
* 下发命令
|
||||
@@ -68,6 +76,9 @@ public class ItemProtocol {
|
||||
*/
|
||||
public static String item_to_new_onset = "to_new_onset";
|
||||
|
||||
//下发任务号
|
||||
public static String item_to_task = "to_task";
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -84,6 +95,10 @@ public class ItemProtocol {
|
||||
this.driver=driver;
|
||||
}
|
||||
|
||||
|
||||
public String getTarget() {
|
||||
return this.getOpcStringValue(item_target);
|
||||
}
|
||||
public int getTo_onset() {
|
||||
return this.getOpcIntegerValue(item_to_onset);
|
||||
}
|
||||
@@ -103,6 +118,10 @@ public class ItemProtocol {
|
||||
return this.getOpcIntegerValue(item_heartbeat);
|
||||
}
|
||||
|
||||
|
||||
public int getTask() {
|
||||
return this.getOpcIntegerValue(item_task);
|
||||
}
|
||||
public int getMode() {
|
||||
return this.getOpcIntegerValue(item_mode);
|
||||
}
|
||||
@@ -134,6 +153,10 @@ public class ItemProtocol {
|
||||
return this.getOpcIntegerValue(item_to_command);
|
||||
}
|
||||
|
||||
public int getTo_task() {
|
||||
return this.getOpcIntegerValue(item_to_task);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -182,7 +205,10 @@ public class ItemProtocol {
|
||||
list.add(new ItemDto(item_action, "动作信号", "DB1.B3"));
|
||||
list.add(new ItemDto(item_error, "报警信号", "DB1.B5"));
|
||||
list.add(new ItemDto(item_walk_y, "行走列", "DB1.B4"));
|
||||
list.add(new ItemDto(item_barcode, "管芯条码", "DB1.B7"));
|
||||
list.add(new ItemDto(item_barcode, "管芯规格", "DB1.B7"));
|
||||
list.add(new ItemDto(item_target, "库位", "DB1.B7"));
|
||||
list.add(new ItemDto(item_task, "任务号", "DB9.D10"));
|
||||
|
||||
|
||||
return list;
|
||||
}
|
||||
@@ -192,7 +218,7 @@ public class ItemProtocol {
|
||||
list.add(new ItemDto(item_to_command, "下发命令", "DB2.W0"));
|
||||
list.add(new ItemDto(item_to_target, "下发目标站", "DB2.W4"));
|
||||
list.add(new ItemDto(item_to_onset, "下发起始站", "DB2.W2"));
|
||||
|
||||
list.add(new ItemDto(item_to_task, "下发任务号", "DB12.D6"));
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,6 +32,7 @@ public class PipeCoreRackManipulatorDefination implements OpcDeviceDriverDefinat
|
||||
return (new PipeCoreRackManipulatorDeviceDriver()).setDevice(device).setDriverDefination(this);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Class<? extends DeviceDriver> getDeviceDriverType() {
|
||||
return PipeCoreRackManipulatorDeviceDriver.class;
|
||||
|
||||
@@ -6,7 +6,6 @@ import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
|
||||
import lombok.Data;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -18,10 +17,11 @@ import org.nl.acs.device_driver.DeviceDriver;
|
||||
import org.nl.acs.device_driver.FeedLmsRealFailed;
|
||||
import org.nl.acs.device_driver.RouteableDeviceDriver;
|
||||
import org.nl.acs.device_driver.conveyor.standard_inspect_site.StandardInspectSiteDeviceDriver;
|
||||
import org.nl.acs.device_driver.conveyor.standard_ordinary_site.StandardOrdinarySiteDeviceDriver;
|
||||
import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver;
|
||||
import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
|
||||
import org.nl.acs.device_driver.two_conveyor.manipulator_agv_station.ManipulatorAgvStationDeviceDriver;
|
||||
import org.nl.acs.device_driver.two_conveyor.pipe_core_rack_conveyor.PipeCoreRackStationDeviceDriver;
|
||||
import org.nl.acs.device_driver.storage.standard_storage.StandardStorageDeviceDriver;
|
||||
import org.nl.acs.enums.PointErrorTypeEnum;
|
||||
import org.nl.acs.ext.wms.service.AcsToWmsService;
|
||||
import org.nl.acs.ext.wms.service.impl.AcsToWmsServiceImpl;
|
||||
import org.nl.acs.history.ErrorUtil;
|
||||
@@ -35,7 +35,6 @@ import org.nl.acs.opc.DeviceAppService;
|
||||
import org.nl.acs.opc.DeviceAppServiceImpl;
|
||||
import org.nl.acs.route.service.RouteLineService;
|
||||
import org.nl.acs.route.service.impl.RouteLineServiceImpl;
|
||||
import org.nl.acs.storage_cell.domain.StorageCell;
|
||||
import org.nl.acs.storage_cell.service.mapper.StorageCellMapper;
|
||||
import org.nl.acs.task.enums.ActionTypeEnum;
|
||||
import org.nl.acs.task.enums.TaskStatusEnum;
|
||||
@@ -62,7 +61,8 @@ public class PipeCoreRackManipulatorDeviceDriver extends AbstractOpcDeviceDriver
|
||||
|
||||
protected ItemProtocol itemProtocol = new ItemProtocol(this);
|
||||
|
||||
AcsToWmsService acsToWmsService = SpringContextHolder.getBean(AcsToWmsServiceImpl.class);;
|
||||
AcsToWmsService acsToWmsService = SpringContextHolder.getBean(AcsToWmsServiceImpl.class);
|
||||
;
|
||||
|
||||
DeviceExecuteLogService logServer = SpringContextHolder.getBean("deviceExecuteLogServiceImpl");
|
||||
|
||||
@@ -122,6 +122,7 @@ public class PipeCoreRackManipulatorDeviceDriver extends AbstractOpcDeviceDriver
|
||||
int to_layer = 0;
|
||||
|
||||
String barcode = null;
|
||||
String target = null;
|
||||
|
||||
Boolean isonline = true;
|
||||
int hasGoods = 0;
|
||||
@@ -143,7 +144,6 @@ public class PipeCoreRackManipulatorDeviceDriver extends AbstractOpcDeviceDriver
|
||||
int branchProtocol = 0;
|
||||
|
||||
|
||||
|
||||
String device_code;
|
||||
|
||||
//当前指令
|
||||
@@ -176,6 +176,9 @@ public class PipeCoreRackManipulatorDeviceDriver extends AbstractOpcDeviceDriver
|
||||
error = this.itemProtocol.getError();
|
||||
heartbeat = this.itemProtocol.getHeartbeat();
|
||||
barcode = this.itemProtocol.getBarcode();
|
||||
target = this.itemProtocol.getTarget();
|
||||
task = this.itemProtocol.getTask();
|
||||
to_task = this.itemProtocol.getTo_task();
|
||||
to_command = this.itemProtocol.getTo_command();
|
||||
to_target = this.itemProtocol.getTo_target();
|
||||
to_new_target = this.itemProtocol.getTo_new_target();
|
||||
@@ -191,7 +194,7 @@ public class PipeCoreRackManipulatorDeviceDriver extends AbstractOpcDeviceDriver
|
||||
}
|
||||
// 更新指令状态
|
||||
if (mode == 3 && task > 0) {
|
||||
if (null!=inst) {
|
||||
if (null != inst) {
|
||||
inst_message = "指令号:" + inst.getInstruction_code() + " " + inst.getStart_point_code() + "->" + inst.getNext_point_code();
|
||||
}
|
||||
updateInstructionStatus();
|
||||
@@ -205,6 +208,21 @@ public class PipeCoreRackManipulatorDeviceDriver extends AbstractOpcDeviceDriver
|
||||
} else if (error != 0) {
|
||||
this.setIserror(true);
|
||||
message = "universal_message3";
|
||||
//满入空出分配新点位
|
||||
if (error == 2 || error == 3) {
|
||||
if (barcode == null || target == null) {
|
||||
notCreateInstMessage = "管芯规格或库位为空";
|
||||
} else {
|
||||
if (error == 2) {
|
||||
errorDispose(PointErrorTypeEnum.IN.getCode());
|
||||
} else {
|
||||
errorDispose(PointErrorTypeEnum.OUT.getCode());
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//无报警
|
||||
} else {
|
||||
this.setIsonline(true);
|
||||
@@ -225,19 +243,19 @@ public class PipeCoreRackManipulatorDeviceDriver extends AbstractOpcDeviceDriver
|
||||
String remark = "";
|
||||
;
|
||||
if (mode != 2) {
|
||||
remark = "universal_remark2";
|
||||
remark = "工作模式(mode)不是待机状态";
|
||||
}
|
||||
if (move != 0) {
|
||||
remark = "universal_remark3";
|
||||
remark = "无货";
|
||||
}
|
||||
if (task != 0) {
|
||||
remark = "universal_remark4";
|
||||
remark = "当前上报任务号(task)应该为0";
|
||||
if (ObjectUtil.isNotEmpty(this.inst)) {
|
||||
this.inst = null;
|
||||
}
|
||||
}
|
||||
if (requireSucess) {
|
||||
remark = "universal_remark5";
|
||||
remark = "右击该图标,将请求任务复位标记(requireSucess)改为否。";
|
||||
}
|
||||
this.setNotCreateInstMessage(remark);
|
||||
//}
|
||||
@@ -274,14 +292,78 @@ public class PipeCoreRackManipulatorDeviceDriver extends AbstractOpcDeviceDriver
|
||||
last_to_type = to_type;
|
||||
}
|
||||
|
||||
private void errorDispose(Integer code) {
|
||||
Instruction instruction = checkInst();
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("barcode", barcode);
|
||||
param.put("target", target);
|
||||
param.put("type", code);
|
||||
param.put("task_code", instruction.getTask_code());
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(device_code)
|
||||
.content("管芯库满入或空出请求lms,参数:" + param)
|
||||
.build();
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
String response = acsToWmsService.secondaryAllocationPoint(param);
|
||||
JSONObject jo = JSON.parseObject(response);
|
||||
if (jo.getInteger("status") == 200) {
|
||||
LuceneLogDto logDto2 = LuceneLogDto.builder()
|
||||
.device_code(device_code)
|
||||
.content("管芯库满入或空出请求lms,参数,接口返回:" + jo)
|
||||
.build();
|
||||
logDto2.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto2);
|
||||
List list = new ArrayList();
|
||||
if (error == 2) {
|
||||
Map<String, Object> map1 = new HashMap<>();
|
||||
map1.put("code", "to_command");
|
||||
map1.put("value", 7);
|
||||
list.add(map1);
|
||||
Map<String, Object> map2 = new HashMap<>();
|
||||
map2.put("code", "to_new_target");
|
||||
map2.put("value", jo.getInteger("target"));
|
||||
list.add(map1);
|
||||
this.writing(list);
|
||||
}
|
||||
if (error == 3) {
|
||||
Map<String, Object> map1 = new HashMap<>();
|
||||
map1.put("code", "to_command");
|
||||
map1.put("value", 8);
|
||||
list.add(map1);
|
||||
Map<String, Object> map2 = new HashMap<>();
|
||||
map2.put("code", "to_new_target");
|
||||
map2.put("value", jo.getInteger("target"));
|
||||
list.add(map1);
|
||||
this.writing(list);
|
||||
}
|
||||
this.actionRequireSucess = true;
|
||||
} else {
|
||||
LuceneLogDto logDto2 = LuceneLogDto.builder()
|
||||
.device_code(device_code)
|
||||
.content("管芯库满入或空出请求lms,返回参数:" + jo)
|
||||
.build();
|
||||
logDto2.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto2);
|
||||
List list = new ArrayList();
|
||||
Map<String, Object> map1 = new HashMap<>();
|
||||
map1.put("code", "to_command");
|
||||
map1.put("value", 99);
|
||||
list.add(map1);
|
||||
this.writing(list);
|
||||
throw new BadRequestException("管芯库满入或空出请求lms返回失败");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void creatAGV(Integer actionType, int toCommand) {
|
||||
Instruction instruction = checkInst();
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("taskCode", instruction.getTask_code());
|
||||
param.put("actionType",actionType );
|
||||
param.put("actionType", actionType);
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(device_code)
|
||||
.content("行架取放货完成请求lms,参数:" + task + "--" +ActionTypeEnum.getStatus(actionType))
|
||||
.content("行架取放货完成请求lms,参数:" + task + "--" + ActionTypeEnum.getStatus(actionType))
|
||||
.build();
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
@@ -398,25 +480,12 @@ public class PipeCoreRackManipulatorDeviceDriver extends AbstractOpcDeviceDriver
|
||||
String next_device_code = taskDtoIns.getNext_device_code();
|
||||
Device startDevice = deviceAppService.findDeviceByCode(start_device_code);
|
||||
Device nextDevice = deviceAppService.findDeviceByCode(next_device_code);
|
||||
String start_point_code = taskDtoIns.getStart_point_code();
|
||||
String next_point_code = taskDtoIns.getNext_point_code();
|
||||
String next_addr = nextDevice.getExtraValue().get("address").toString();
|
||||
String start_addr = startDevice.getExtraValue().get("address").toString();
|
||||
// 起点不是行架对接位就是货位
|
||||
PipeCoreRackStationDeviceDriver pipeCoreRackStationDeviceDriver;
|
||||
StandardInspectSiteDeviceDriver standardInspectSiteDeviceDriver;
|
||||
if (startDevice.getDeviceDriver() instanceof PipeCoreRackStationDeviceDriver) {
|
||||
if (ObjectUtil.isEmpty(start_addr)) {
|
||||
notCreateInstMessage = "未设置电气调度号!";
|
||||
throw new BadRequestException("设备:" + startDevice.getDevice_code() + "未设置电气调度号!");
|
||||
}
|
||||
pipeCoreRackStationDeviceDriver = (PipeCoreRackStationDeviceDriver) startDevice.getDeviceDriver();
|
||||
if (pipeCoreRackStationDeviceDriver.getMove() != 1) {
|
||||
notCreateInstMessage = "手动创建指令未下发电气信号原因->取货位-管芯库行架对接位:" + pipeCoreRackStationDeviceDriver.getDevice_code() + "无货,无法下发指令!指令号:" + instruction.getInstruction_code();
|
||||
return false;
|
||||
}
|
||||
|
||||
}else {
|
||||
start_addr = getStorageCell(start_device_code);
|
||||
}
|
||||
StandardInspectSiteDeviceDriver standardInspectSiteDeviceDriver;
|
||||
|
||||
if (nextDevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
|
||||
if (ObjectUtil.isEmpty(next_addr)) {
|
||||
@@ -425,11 +494,23 @@ public class PipeCoreRackManipulatorDeviceDriver extends AbstractOpcDeviceDriver
|
||||
}
|
||||
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) nextDevice.getDeviceDriver();
|
||||
if (standardInspectSiteDeviceDriver.getMove() != 0) {
|
||||
notCreateInstMessage = "手动创建指令未下发电气信号原因->放货位-收卷锟对接位:" + standardInspectSiteDeviceDriver.getDevicecode() + "有货,无法下发指令!任务号:" + instruction.getInstruction_code();
|
||||
notCreateInstMessage = "手动创建指令未下发电气信号原因->放货位-管芯放货对接位:" + standardInspectSiteDeviceDriver.getDevicecode() + "有货,无法下发指令!任务号:" + instruction.getInstruction_code();
|
||||
return false;
|
||||
}
|
||||
}else {
|
||||
next_addr = getStorageCell(start_device_code);
|
||||
}
|
||||
if (startDevice.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
|
||||
if (ObjectUtil.isEmpty(start_addr)) {
|
||||
notCreateInstMessage = "未设置电气调度号!";
|
||||
throw new BadRequestException("设备:" + startDevice.getDevice_code() + "未设置电气调度号!");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (nextDevice.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
|
||||
if (ObjectUtil.isEmpty(next_addr)) {
|
||||
notCreateInstMessage = "未设置电气调度号!";
|
||||
throw new BadRequestException("设备:" + nextDevice.getDevice_code() + "未设置电气调度号!");
|
||||
}
|
||||
}
|
||||
Map<String, Object> map1 = new HashMap<>();
|
||||
Map<String, Object> map2 = new HashMap<>();
|
||||
@@ -458,22 +539,8 @@ public class PipeCoreRackManipulatorDeviceDriver extends AbstractOpcDeviceDriver
|
||||
Device nextDevice = deviceAppService.findDeviceByCode(next_device_code);
|
||||
String start_addr = startDevice.getExtraValue().get("address").toString();
|
||||
String next_addr = nextDevice.getExtraValue().get("address").toString();
|
||||
PipeCoreRackStationDeviceDriver pipeCoreRackStationDeviceDriver;
|
||||
StandardInspectSiteDeviceDriver standardInspectSiteDeviceDriver;
|
||||
// 起点不是行架对接位就是货位
|
||||
if (startDevice.getDeviceDriver() instanceof PipeCoreRackStationDeviceDriver) {
|
||||
if (ObjectUtil.isEmpty(start_addr)) {
|
||||
notCreateInstMessage = "未设置电气调度号!";
|
||||
throw new BadRequestException("设备:" + startDevice.getDevice_code() + "未设置电气调度号!");
|
||||
}
|
||||
pipeCoreRackStationDeviceDriver = (PipeCoreRackStationDeviceDriver) startDevice.getDeviceDriver();
|
||||
if (pipeCoreRackStationDeviceDriver.getMove() != 1) {
|
||||
notCreateInstMessage = "手动创建指令未下发电气信号原因->取货位-管芯库行架对接位:" + pipeCoreRackStationDeviceDriver.getDevice_code() + "无货,无法下发指令!指令号:" + taskDto.getTask_code();
|
||||
return false;
|
||||
}
|
||||
}else {
|
||||
start_addr = getStorageCell(start_device_code);
|
||||
}
|
||||
|
||||
|
||||
if (nextDevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
|
||||
if (ObjectUtil.isEmpty(next_addr)) {
|
||||
@@ -482,11 +549,22 @@ public class PipeCoreRackManipulatorDeviceDriver extends AbstractOpcDeviceDriver
|
||||
}
|
||||
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) nextDevice.getDeviceDriver();
|
||||
if (standardInspectSiteDeviceDriver.getMove() != 0) {
|
||||
notCreateInstMessage = "手动创建指令未下发电气信号原因->放货位-收卷锟对接位:" + standardInspectSiteDeviceDriver.getDevicecode() + "有货,无法下发指令!任务号:" + taskDto.getTask_code();
|
||||
notCreateInstMessage = "手动创建指令未下发电气信号原因->放货位-管芯放货对接位:" + standardInspectSiteDeviceDriver.getDevicecode() + "有货,无法下发指令!任务号:" + taskDto.getTask_code();
|
||||
return false;
|
||||
}
|
||||
}else {
|
||||
next_addr = getStorageCell(start_device_code);
|
||||
}
|
||||
if (startDevice.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
|
||||
if (ObjectUtil.isEmpty(start_addr)) {
|
||||
notCreateInstMessage = "未设置电气调度号!";
|
||||
throw new BadRequestException("设备:" + startDevice.getDevice_code() + "未设置电气调度号!");
|
||||
}
|
||||
}
|
||||
|
||||
if (nextDevice.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
|
||||
if (ObjectUtil.isEmpty(next_addr)) {
|
||||
notCreateInstMessage = "未设置电气调度号!";
|
||||
throw new BadRequestException("设备:" + nextDevice.getDevice_code() + "未设置电气调度号!");
|
||||
}
|
||||
}
|
||||
|
||||
String taskid = taskDto.getTask_id();
|
||||
@@ -536,17 +614,6 @@ public class PipeCoreRackManipulatorDeviceDriver extends AbstractOpcDeviceDriver
|
||||
|
||||
}
|
||||
|
||||
private String getStorageCell(String start_device_code) {
|
||||
StorageCell storageCell = new LambdaQueryChainWrapper<>(storageCellMapper)
|
||||
.eq(StorageCell::getStorage_code, start_device_code)
|
||||
.one();
|
||||
|
||||
if (ObjectUtil.isEmpty(storageCell)) {
|
||||
notCreateInstMessage = "货位信息为空!";
|
||||
throw new BadRequestException("设备:" + start_device_code + "货位信息为空!");
|
||||
}
|
||||
return storageCell.getX() + storageCell.getY() + storageCell.getZ();
|
||||
}
|
||||
|
||||
private void packageData(Instruction instdto, String route_plan_code, String taskid, String taskcode, String start_device_code, String next_device_code, String start_point_code, String next_point_code, String start_device_code2, String next_device_code2) {
|
||||
instdto.setInstruction_id(IdUtil.simpleUUID());
|
||||
@@ -689,7 +756,7 @@ public class PipeCoreRackManipulatorDeviceDriver extends AbstractOpcDeviceDriver
|
||||
jo.put("isError", this.getIserror());
|
||||
jo.put("message", LangProcess.msg(message));
|
||||
jo.put("notCreateTaskMessage", notCreateTaskMessage);
|
||||
jo.put("notCreateInstMessage", LangProcess.msg(notCreateInstMessage));
|
||||
jo.put("notCreateInstMessage", notCreateInstMessage);
|
||||
jo.put("feedMessage", LangProcess.msg(feedMessage));
|
||||
jo.put("driver_type", "siemens_conveyor");
|
||||
jo.put("is_click", true);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.nl.acs.device_driver.two_conveyor.roll_up_roller_manipulator;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import lombok.Data;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.acs.device.device_driver.standard_inspect.ItemDto;
|
||||
@@ -51,7 +52,10 @@ public class ItemProtocol {
|
||||
*/
|
||||
public static String item_y = "y";
|
||||
|
||||
|
||||
/**
|
||||
* 目标站
|
||||
*/
|
||||
public static String item_target = "target";
|
||||
|
||||
/**
|
||||
* 下发命令
|
||||
@@ -94,8 +98,12 @@ public class ItemProtocol {
|
||||
public int getTo_onset() {
|
||||
return this.getOpcIntegerValue(item_to_onset);
|
||||
}
|
||||
public int getTo_target() {
|
||||
return this.getOpcIntegerValue(item_to_target);
|
||||
public String getTo_target() {
|
||||
return this.getOpcStringValue(item_to_target);
|
||||
}
|
||||
|
||||
public String getTarget() {
|
||||
return this.getOpcStringValue(item_target);
|
||||
}
|
||||
|
||||
public int getHeartbeat() {
|
||||
@@ -180,6 +188,15 @@ public class ItemProtocol {
|
||||
|
||||
}
|
||||
|
||||
public String getOpcStringValue(String protocol) {
|
||||
String value = this.driver.getStringValue(protocol);
|
||||
if (StrUtil.isBlank(value)) {
|
||||
} else {
|
||||
return value;
|
||||
}
|
||||
return "0";
|
||||
}
|
||||
|
||||
public static List<ItemDto> getReadableItemDtos() {
|
||||
ArrayList<ItemDto> list = new ArrayList<>();
|
||||
list.add(new ItemDto(item_heartbeat, "心跳", "DB1.B0"));
|
||||
@@ -200,7 +217,6 @@ public class ItemProtocol {
|
||||
list.add(new ItemDto(item_to_target, "下发目标站1", "DB2.W4"));
|
||||
list.add(new ItemDto(item_to_onset, "下发起始站1", "DB2.W2"));
|
||||
list.add(new ItemDto(item_to_task, "下发任务号", "DB2.D6"));
|
||||
list.add(new ItemDto(item_to_type, "木箱长度", "DB601.W10"));
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
@@ -18,10 +18,13 @@ import org.nl.acs.device_driver.DeviceDriver;
|
||||
import org.nl.acs.device_driver.FeedLmsRealFailed;
|
||||
import org.nl.acs.device_driver.RouteableDeviceDriver;
|
||||
import org.nl.acs.device_driver.conveyor.standard_inspect_site.StandardInspectSiteDeviceDriver;
|
||||
import org.nl.acs.device_driver.conveyor.standard_ordinary_site.StandardOrdinarySiteDeviceDriver;
|
||||
import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver;
|
||||
import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
|
||||
import org.nl.acs.device_driver.one_conveyor.manipulator_cache.ManipulatorCacheDeviceDriver;
|
||||
import org.nl.acs.device_driver.storage.standard_storage.StandardStorageDeviceDriver;
|
||||
import org.nl.acs.device_driver.two_conveyor.manipulator_agv_station.ManipulatorAgvStationDeviceDriver;
|
||||
import org.nl.acs.enums.PointErrorTypeEnum;
|
||||
import org.nl.acs.ext.wms.service.AcsToWmsService;
|
||||
import org.nl.acs.ext.wms.service.impl.AcsToWmsServiceImpl;
|
||||
import org.nl.acs.history.ErrorUtil;
|
||||
@@ -100,8 +103,8 @@ public class RollUpRollerManipulatorDeviceDriver extends AbstractOpcDeviceDriver
|
||||
int to_command = 0;
|
||||
int last_to_command = 0;
|
||||
|
||||
int to_target = 0;
|
||||
int last_to_target = 0;
|
||||
String to_target = null;
|
||||
String target = null;
|
||||
|
||||
int to_onset = 0;
|
||||
int last_to_onset = 0;
|
||||
@@ -181,6 +184,7 @@ public class RollUpRollerManipulatorDeviceDriver extends AbstractOpcDeviceDriver
|
||||
y = this.itemProtocol.getY();
|
||||
to_command = this.itemProtocol.getTo_command();
|
||||
to_target = this.itemProtocol.getTo_target();
|
||||
target = this.itemProtocol.getTarget();
|
||||
to_onset = this.itemProtocol.getTo_onset();
|
||||
to_task = this.itemProtocol.getTo_task();
|
||||
to_type = this.itemProtocol.getTo_type();
|
||||
@@ -208,6 +212,19 @@ public class RollUpRollerManipulatorDeviceDriver extends AbstractOpcDeviceDriver
|
||||
} else if (error != 0) {
|
||||
this.setIserror(true);
|
||||
message = "universal_message3";
|
||||
//满入空出分配新点位
|
||||
if (error == 2 || error == 3) {
|
||||
if (task == 0 || target == null) {
|
||||
notCreateInstMessage = "管芯规格或库位为空";
|
||||
} else {
|
||||
if (error == 2) {
|
||||
errorDispose(PointErrorTypeEnum.IN.getCode());
|
||||
} else {
|
||||
errorDispose(PointErrorTypeEnum.OUT.getCode());
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
//无报警
|
||||
} else {
|
||||
this.setIsonline(true);
|
||||
@@ -273,7 +290,6 @@ public class RollUpRollerManipulatorDeviceDriver extends AbstractOpcDeviceDriver
|
||||
last_y = y;
|
||||
last_to_task = to_task;
|
||||
last_to_command = to_command;
|
||||
last_to_target = to_target;
|
||||
last_to_onset = to_onset;
|
||||
last_to_type = to_type;
|
||||
}
|
||||
@@ -317,6 +333,69 @@ public class RollUpRollerManipulatorDeviceDriver extends AbstractOpcDeviceDriver
|
||||
|
||||
}
|
||||
|
||||
private void errorDispose(Integer code) {
|
||||
Instruction instruction = checkInst();
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("target", target);
|
||||
param.put("type", code);
|
||||
param.put("task_code", instruction.getTask_code());
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(device_code)
|
||||
.content("管芯库满入或空出请求lms,参数:" + param)
|
||||
.build();
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
String response = acsToWmsService.secondaryAllocationPoint(param);
|
||||
JSONObject jo = JSON.parseObject(response);
|
||||
if (jo.getInteger("status") == 200) {
|
||||
LuceneLogDto logDto2 = LuceneLogDto.builder()
|
||||
.device_code(device_code)
|
||||
.content("管芯库满入或空出请求lms,参数,接口返回:" + jo)
|
||||
.build();
|
||||
logDto2.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto2);
|
||||
List list = new ArrayList();
|
||||
if (error == 2) {
|
||||
Map<String, Object> map1 = new HashMap<>();
|
||||
map1.put("code", "to_command");
|
||||
map1.put("value", 7);
|
||||
list.add(map1);
|
||||
Map<String, Object> map2 = new HashMap<>();
|
||||
map2.put("code", "to_new_target");
|
||||
map2.put("value", jo.getInteger("target"));
|
||||
list.add(map1);
|
||||
this.writing(list);
|
||||
}
|
||||
if (error == 3) {
|
||||
Map<String, Object> map1 = new HashMap<>();
|
||||
map1.put("code", "to_command");
|
||||
map1.put("value", 8);
|
||||
list.add(map1);
|
||||
Map<String, Object> map2 = new HashMap<>();
|
||||
map2.put("code", "to_new_target");
|
||||
map2.put("value", jo.getInteger("target"));
|
||||
list.add(map1);
|
||||
this.writing(list);
|
||||
}
|
||||
this.actionRequireSucess = true;
|
||||
} else {
|
||||
LuceneLogDto logDto2 = LuceneLogDto.builder()
|
||||
.device_code(device_code)
|
||||
.content("管芯库满入或空出请求lms,返回参数:" + jo)
|
||||
.build();
|
||||
logDto2.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto2);
|
||||
List list = new ArrayList();
|
||||
Map<String, Object> map1 = new HashMap<>();
|
||||
map1.put("code", "to_command");
|
||||
map1.put("value", 99);
|
||||
list.add(map1);
|
||||
this.writing(list);
|
||||
throw new BadRequestException("管芯库满入或空出请求lms返回失败");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void updateInstructionStatus() {
|
||||
Date date = new Date();
|
||||
if (date.getTime() - this.instruction_update_time.getTime() < (long) this.instruction_update_time_out) {
|
||||
@@ -393,45 +472,53 @@ public class RollUpRollerManipulatorDeviceDriver extends AbstractOpcDeviceDriver
|
||||
String startDeviceCode = getDeviceCodeList.get(i);
|
||||
//先查指令
|
||||
List<TaskDto> taskDtoInstruction = taskserver.queryTaskByDeviceCodeAndStatus2(startDeviceCode);
|
||||
List<TaskDto> taskDtoStream = taskDtoInstruction.stream().sorted(Comparator.comparing(TaskDto::getCreate_time)).collect(Collectors.toList());
|
||||
if (CollUtil.isNotEmpty(taskDtoStream)) {
|
||||
if (CollUtil.isNotEmpty(taskDtoInstruction)) {
|
||||
List<TaskDto> taskDtoStream = taskDtoInstruction.stream().sorted(Comparator.comparing(TaskDto::getCreate_time)).collect(Collectors.toList());
|
||||
TaskDto taskDtoIns = taskDtoStream.get(0);
|
||||
if (TaskTypeEnum.Truss_Task.getIndex().equals(taskDtoIns.getTask_type())) {
|
||||
Instruction instruction = instructionService.findByTaskcodeAndStatus(taskDtoIns.getTask_code());
|
||||
StandardInspectSiteDeviceDriver standardInspectSiteDeviceDriver;
|
||||
ManipulatorAgvStationDeviceDriver manipulatorAgvStationDeviceDriver;
|
||||
String start_device_code = taskDtoIns.getStart_device_code();
|
||||
String start_point_code = taskDtoIns.getStart_point_code();
|
||||
String next_point_code = taskDtoIns.getNext_point_code();
|
||||
String next_device_code = taskDtoIns.getNext_device_code();
|
||||
Device startDevice = deviceAppService.findDeviceByCode(start_device_code);
|
||||
Device nextDevice = deviceAppService.findDeviceByCode(next_device_code);
|
||||
String next_addr = nextDevice.getExtraValue().get("address").toString();
|
||||
String start_addr = startDevice.getExtraValue().get("address").toString();
|
||||
// 起点不是行架对接位就是货位
|
||||
if (startDevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
|
||||
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) startDevice.getDeviceDriver();
|
||||
if (startDevice.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) {
|
||||
manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) startDevice.getDeviceDriver();
|
||||
if (ObjectUtil.isEmpty(start_addr)) {
|
||||
notCreateInstMessage = "未设置电气调度号!";
|
||||
throw new BadRequestException("设备:" + startDevice.getDevice_code() + "未设置电气调度号!");
|
||||
}
|
||||
if (standardInspectSiteDeviceDriver.getMove() != 1) {
|
||||
notCreateInstMessage = "手动创建指令未下发电气信号原因->取货位-收卷锟对接位:" + standardInspectSiteDeviceDriver.getDevicecode() + "无货,无法下发指令!指令号:" + instruction.getInstruction_code();
|
||||
if (manipulatorAgvStationDeviceDriver.getMove() != 1) {
|
||||
notCreateInstMessage = "手动创建指令未下发电气信号原因->取货位-收卷锟对接位:" + manipulatorAgvStationDeviceDriver.getMove() + "无货,无法下发指令!指令号:" + instruction.getInstruction_code();
|
||||
return false;
|
||||
}
|
||||
}else {
|
||||
start_addr = getStorageCell(start_device_code);
|
||||
}
|
||||
if (startDevice.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
|
||||
if (ObjectUtil.isEmpty(start_addr)) {
|
||||
notCreateInstMessage = "未设置电气调度号!";
|
||||
throw new BadRequestException("设备:" + startDevice.getDevice_code() + "未设置电气调度号!");
|
||||
}
|
||||
}
|
||||
|
||||
if (nextDevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
|
||||
|
||||
|
||||
if (nextDevice.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
|
||||
if (ObjectUtil.isEmpty(next_addr)) {
|
||||
notCreateInstMessage = "未设置电气调度号!";
|
||||
throw new BadRequestException("设备:" + nextDevice.getDevice_code() + "未设置电气调度号!");
|
||||
}
|
||||
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) nextDevice.getDeviceDriver();
|
||||
if (standardInspectSiteDeviceDriver.getMove() != 0) {
|
||||
notCreateInstMessage = "手动创建指令未下发电气信号原因->放货位-收卷锟对接位:" + standardInspectSiteDeviceDriver.getDevicecode() + "有货,无法下发指令!指令号:" + instruction.getInstruction_code();
|
||||
}
|
||||
if (nextDevice.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) {
|
||||
manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) nextDevice.getDeviceDriver();
|
||||
if ( manipulatorAgvStationDeviceDriver.getMove() != 0) {
|
||||
notCreateInstMessage = "手动创建指令未下发电气信号原因->放货位-收卷锟对接位:" + manipulatorAgvStationDeviceDriver.getMove() + "有货,无法下发指令!任务号:" + instruction.getInstruction_code();
|
||||
return false;
|
||||
}
|
||||
}else {
|
||||
next_addr = getStorageCell(start_device_code);
|
||||
}
|
||||
Map<String, Object> map1 = new HashMap<>();
|
||||
Map<String, Object> map2 = new HashMap<>();
|
||||
@@ -456,44 +543,49 @@ public class RollUpRollerManipulatorDeviceDriver extends AbstractOpcDeviceDriver
|
||||
String next_device_code = taskDto.getNext_device_code();
|
||||
String start_device_code2 = taskDto.getStart_device_code2();
|
||||
String next_device_code2 = taskDto.getNext_device_code2();
|
||||
String start_point_code = taskDto.getStart_point_code();
|
||||
String next_point_code = taskDto.getNext_point_code();
|
||||
Device startDevice = deviceAppService.findDeviceByCode(start_device_code);
|
||||
Device nextDevice = deviceAppService.findDeviceByCode(next_device_code);
|
||||
String start_addr = startDevice.getExtraValue().get("address").toString();
|
||||
String next_addr = nextDevice.getExtraValue().get("address").toString();
|
||||
StandardInspectSiteDeviceDriver standardInspectSiteDeviceDriver;
|
||||
ManipulatorAgvStationDeviceDriver manipulatorAgvStationDeviceDriver;
|
||||
// 起点不是行架对接位就是货位
|
||||
if (startDevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
|
||||
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) startDevice.getDeviceDriver();
|
||||
if (startDevice.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) {
|
||||
manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) startDevice.getDeviceDriver();
|
||||
if (ObjectUtil.isEmpty(start_addr)) {
|
||||
notCreateInstMessage = "未设置电气调度号!";
|
||||
throw new BadRequestException("设备:" + startDevice.getDevice_code() + "未设置电气调度号!");
|
||||
}
|
||||
if (standardInspectSiteDeviceDriver.getMove() != 1) {
|
||||
notCreateInstMessage = "手动创建指令未下发电气信号原因->取货位-收卷锟对接位:" + standardInspectSiteDeviceDriver.getDevicecode() + "无货,无法下发指令!任务号:" + taskDto.getTask_code();
|
||||
if ( manipulatorAgvStationDeviceDriver.getMove() != 1) {
|
||||
notCreateInstMessage = "手动创建指令未下发电气信号原因->取货位-收卷锟对接位:" + manipulatorAgvStationDeviceDriver.getMove() + "无货,无法下发指令!任务号:" + taskDto.getTask_code();
|
||||
return false;
|
||||
}
|
||||
}else {
|
||||
start_addr = getStorageCell(start_device_code);
|
||||
}
|
||||
if (startDevice.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
|
||||
if (ObjectUtil.isEmpty(start_addr)) {
|
||||
notCreateInstMessage = "未设置电气调度号!";
|
||||
throw new BadRequestException("设备:" + startDevice.getDevice_code() + "未设置电气调度号!");
|
||||
}
|
||||
}
|
||||
|
||||
if (nextDevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
|
||||
if (nextDevice.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
|
||||
if (ObjectUtil.isEmpty(next_addr)) {
|
||||
notCreateInstMessage = "未设置电气调度号!";
|
||||
throw new BadRequestException("设备:" + nextDevice.getDevice_code() + "未设置电气调度号!");
|
||||
}
|
||||
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) nextDevice.getDeviceDriver();
|
||||
if (standardInspectSiteDeviceDriver.getMove() != 0) {
|
||||
notCreateInstMessage = "手动创建指令未下发电气信号原因->放货位-收卷锟对接位:" + standardInspectSiteDeviceDriver.getDevicecode() + "有货,无法下发指令!任务号:" + taskDto.getTask_code();
|
||||
}
|
||||
|
||||
if (nextDevice.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) {
|
||||
manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) nextDevice.getDeviceDriver();
|
||||
if ( manipulatorAgvStationDeviceDriver.getMove() != 0) {
|
||||
notCreateInstMessage = "手动创建指令未下发电气信号原因->放货位-收卷锟对接位:" + manipulatorAgvStationDeviceDriver.getMove() + "有货,无法下发指令!任务号:" + taskDto.getTask_code();
|
||||
return false;
|
||||
}
|
||||
}else {
|
||||
next_addr = getStorageCell(start_device_code);
|
||||
}
|
||||
|
||||
String taskid = taskDto.getTask_id();
|
||||
String taskcode = taskDto.getTask_code();
|
||||
String start_point_code = taskDto.getStart_point_code();
|
||||
String next_point_code = taskDto.getNext_point_code();
|
||||
String route_plan_code = taskDto.getRoute_plan_code();
|
||||
Instruction instdto = new Instruction();
|
||||
packageData(instdto, route_plan_code, taskid, taskcode, start_device_code, next_device_code, start_point_code, next_point_code, start_device_code2, next_device_code2);
|
||||
@@ -537,17 +629,7 @@ public class RollUpRollerManipulatorDeviceDriver extends AbstractOpcDeviceDriver
|
||||
|
||||
}
|
||||
|
||||
private String getStorageCell(String start_device_code) {
|
||||
StorageCell storageCell = new LambdaQueryChainWrapper<>(storageCellMapper)
|
||||
.eq(StorageCell::getStorage_code, start_device_code)
|
||||
.one();
|
||||
|
||||
if (ObjectUtil.isEmpty(storageCell)) {
|
||||
notCreateInstMessage = "货位信息为空!";
|
||||
throw new BadRequestException("设备:" + start_device_code + "货位信息为空!");
|
||||
}
|
||||
return storageCell.getX() + storageCell.getY() + storageCell.getZ();
|
||||
}
|
||||
|
||||
private void packageData(Instruction instdto, String route_plan_code, String taskid, String taskcode, String start_device_code, String next_device_code, String start_point_code, String next_point_code, String start_device_code2, String next_device_code2) {
|
||||
instdto.setInstruction_id(IdUtil.simpleUUID());
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
package org.nl.acs.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import org.nl.common.enums.CodeBiEnum;
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum PointErrorTypeEnum {
|
||||
|
||||
/* 旧邮箱修改邮箱 */
|
||||
IN(1, "满入"),
|
||||
|
||||
/* 通过邮箱修改密码 */
|
||||
OUT(2, "空出");
|
||||
|
||||
private final Integer code;
|
||||
private final String description;
|
||||
|
||||
public static CodeBiEnum find(Integer code) {
|
||||
for (CodeBiEnum value : CodeBiEnum.values()) {
|
||||
if (code.equals(value.getCode())) {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -216,4 +216,6 @@ public interface AcsToWmsService {
|
||||
void actionFinishRequest2(JSONObject jsonObject);
|
||||
|
||||
String outHotTaskApply(JSONObject apply);
|
||||
|
||||
void applyOvenGantryTask(JSONObject jsonObject);
|
||||
}
|
||||
|
||||
@@ -788,6 +788,39 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyOvenGantryTask(JSONObject jsonObject) {
|
||||
HttpResponse execute = null;
|
||||
try {
|
||||
String wmsurl = paramService.findByCode(AcsConfig.WMSURL).getValue();
|
||||
AddressDto addressDto = addressService.findByCode("applyOvenGantryTask");
|
||||
String url = wmsurl + addressDto.getMethods_url();
|
||||
try {
|
||||
execute = HttpRequest.post(url)
|
||||
.body(String.valueOf(jsonObject))
|
||||
.execute();
|
||||
} catch (Exception e) {
|
||||
String msg = e.getMessage();
|
||||
log.info("applyOvenGantryTask-----输出参数{}", msg);
|
||||
//网络不通
|
||||
LuceneLogDto luceneLogDto1 = new LuceneLogDto(4,"applyOvenGantryTask", String.valueOf(execute.getStatus()),
|
||||
String.valueOf(jsonObject),
|
||||
String.valueOf(execute.body()), jsonObject.getString("task_code") + "申请烘箱行架任务反馈失败");
|
||||
luceneLogService.interfaceExecuteLog(luceneLogDto1);
|
||||
}
|
||||
log.info("applyOvenGantryTask - 申请烘箱行架任务完成反馈{}", jsonObject);
|
||||
LuceneLogDto luceneLogDto = new LuceneLogDto(4,"applyOvenGantryTask", "",
|
||||
String.valueOf(jsonObject),
|
||||
"", jsonObject.getString("task_code") + "申请烘箱行架任务完成反馈");
|
||||
luceneLogService.interfaceExecuteLog(luceneLogDto);
|
||||
} catch (Exception e) {
|
||||
LuceneLogDto luceneLogDto = new LuceneLogDto(4,"applyOvenGantryTask", String.valueOf(execute.getStatus()),
|
||||
JSON.toJSONString(execute.body()),
|
||||
String.valueOf(execute.body()), jsonObject.getString("task_code") + "申请烘箱行架任务反馈失败");
|
||||
luceneLogService.interfaceExecuteLog(luceneLogDto);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public HttpResponse callShaftFromCache(JSONObject param) {
|
||||
|
||||
@@ -455,7 +455,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
||||
if (device.getDeviceDriver() instanceof AgvNdcTwoDeviceDriver) {
|
||||
agvNdcTwoDeviceDriver = (AgvNdcTwoDeviceDriver) device.getDeviceDriver();
|
||||
int phase = agvNdcTwoDeviceDriver.getPhase();
|
||||
if (phase == 0x03 || phase == 0x05 || phase == 0x08 ) {
|
||||
if (phase == 0x03 || phase == 0x05 || phase == 0x08) {
|
||||
StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver;
|
||||
Device devicePointDriver = deviceAppService.findDeviceByCode(device_code);
|
||||
if (devicePointDriver.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
|
||||
@@ -536,7 +536,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
||||
InflatableShaftLibraryDeviceDriver inflatableShaftLibraryDeviceDriver;
|
||||
HongXiangStationDeviceDriver hongXiangStationDeviceDriver;
|
||||
LampThreecolorDeviceDriver lampThreecolorDeviceDriver;
|
||||
BeltConveyorDeviceDriver beltConveyorDeviceDriver ;
|
||||
BeltConveyorDeviceDriver beltConveyorDeviceDriver;
|
||||
WasteFoilWeighingStationDriver wasteFoilWeighingStationDriver;
|
||||
FoldDiscSiteDeviceDriver foldDiscSiteDeviceDriver;
|
||||
if (device.getDeviceDriver() instanceof HongXiangStationDeviceDriver) {
|
||||
@@ -548,7 +548,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
||||
lampThreecolorDeviceDriver.writing(code, value);
|
||||
}
|
||||
if (device.getDeviceDriver() instanceof BeltConveyorDeviceDriver) {
|
||||
beltConveyorDeviceDriver=(BeltConveyorDeviceDriver) device.getDeviceDriver();
|
||||
beltConveyorDeviceDriver = (BeltConveyorDeviceDriver) device.getDeviceDriver();
|
||||
beltConveyorDeviceDriver.writing(code, value);
|
||||
}
|
||||
if (device.getDeviceDriver() instanceof InflatableShaftLibraryDeviceDriver) {
|
||||
@@ -615,11 +615,11 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
||||
wasteFoilWeighingStationDriver.writing("to_command", "6");
|
||||
Thread.sleep(1000); //休眠1秒
|
||||
while (wasteFoilWeighingStationDriver.getMode() == 6) {
|
||||
jo.put("currentWeight", wasteFoilWeighingStationDriver.getWeight());//当前重量
|
||||
jo.put("lastWeight", wasteFoilWeighingStationDriver.getOld_weight());//上一次重量
|
||||
jo.put("weightGap", wasteFoilWeighingStationDriver.getGap_weight());//重量差
|
||||
break;
|
||||
}
|
||||
jo.put("currentWeight", wasteFoilWeighingStationDriver.getWeight());//当前重量
|
||||
jo.put("lastWeight", wasteFoilWeighingStationDriver.getOld_weight());//上一次重量
|
||||
jo.put("weightGap", wasteFoilWeighingStationDriver.getGap_weight());//重量差
|
||||
break;
|
||||
}
|
||||
wasteFoilWeighingStationDriver.writing("to_command", "0");
|
||||
}
|
||||
//称重确认信号
|
||||
@@ -627,10 +627,10 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
||||
wasteFoilWeighingStationDriver.writing("to_command", "7");
|
||||
Thread.sleep(1000); //休眠1秒
|
||||
while (wasteFoilWeighingStationDriver.getMode() == 7) {
|
||||
jo.put("currentWeight", wasteFoilWeighingStationDriver.getWeight());//当前重量
|
||||
jo.put("lastWeight", wasteFoilWeighingStationDriver.getOld_weight());//上一次重量
|
||||
jo.put("weightGap", wasteFoilWeighingStationDriver.getGap_weight());//重量差
|
||||
break;
|
||||
jo.put("currentWeight", wasteFoilWeighingStationDriver.getWeight());//当前重量
|
||||
jo.put("lastWeight", wasteFoilWeighingStationDriver.getOld_weight());//上一次重量
|
||||
jo.put("weightGap", wasteFoilWeighingStationDriver.getGap_weight());//重量差
|
||||
break;
|
||||
}
|
||||
wasteFoilWeighingStationDriver.writing("to_command", "0");
|
||||
}
|
||||
@@ -662,60 +662,61 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
||||
.build();
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
JSONArray datas = JSONArray.parseArray(jsonObject);
|
||||
JSONObject data = JSONObject.parseObject(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_barcode1 = data.getString("to_barcode1");
|
||||
String to_barcode2 = data.getString("to_barcode2");
|
||||
String to_barcode3 = data.getString("to_barcode3");
|
||||
String to_barcode4 = data.getString("to_barcode4");
|
||||
String to_barcode5 = data.getString("to_barcode5");
|
||||
String to_target1 = data.getString("to_target1");
|
||||
String to_target2 = data.getString("to_target2");
|
||||
String to_target3 = data.getString("to_target3");
|
||||
String to_target4 = data.getString("to_target4");
|
||||
String to_target5 = data.getString("to_target5");
|
||||
Device device = deviceAppService.findDeviceByCode(device_code);
|
||||
if (ObjectUtil.isEmpty(device)) {
|
||||
throw new Exception("未找到对应设备:" + device_code);
|
||||
String device_code = data.getString("device_code");
|
||||
String to_barcode1 = data.getString("barcode1");
|
||||
String to_barcode2 = data.getString("barcode2");
|
||||
String to_barcode3 = data.getString("barcode3");
|
||||
String to_barcode4 = data.getString("barcode4");
|
||||
String to_barcode5 = data.getString("barcode5");
|
||||
String to_target1 = data.getString("target1");
|
||||
String to_target2 = data.getString("target2");
|
||||
String to_target3 = data.getString("target3");
|
||||
String to_target4 = data.getString("target4");
|
||||
String to_target5 = data.getString("target5");
|
||||
String num = data.getString("num");
|
||||
Device device = deviceAppService.findDeviceByCode(device_code);
|
||||
if (ObjectUtil.isEmpty(device)) {
|
||||
throw new Exception("未找到对应设备:" + device_code);
|
||||
}
|
||||
PipeCoreRackStationDeviceDriver pipeCoreRackStationDeviceDriver;
|
||||
if (device.getDeviceDriver() instanceof PipeCoreRackStationDeviceDriver) {
|
||||
pipeCoreRackStationDeviceDriver = (PipeCoreRackStationDeviceDriver) device.getDeviceDriver();
|
||||
if (ObjectUtil.isEmpty(to_barcode1)) {
|
||||
map.put("to_barcode1", to_barcode1);
|
||||
}
|
||||
PipeCoreRackStationDeviceDriver pipeCoreRackStationDeviceDriver;
|
||||
if (device.getDeviceDriver() instanceof PipeCoreRackStationDeviceDriver) {
|
||||
pipeCoreRackStationDeviceDriver = (PipeCoreRackStationDeviceDriver) device.getDeviceDriver();
|
||||
if (ObjectUtil.isEmpty(to_barcode1)){
|
||||
map.put("to_barcode1", to_barcode1);
|
||||
}
|
||||
if (ObjectUtil.isEmpty(to_barcode2)){
|
||||
map.put("to_barcode2", to_barcode2);
|
||||
}
|
||||
if (ObjectUtil.isEmpty(to_barcode3)){
|
||||
map.put("to_barcode3", to_barcode3);
|
||||
}
|
||||
if (ObjectUtil.isEmpty(to_barcode4)){
|
||||
map.put("to_barcode4", to_barcode4);
|
||||
}
|
||||
if (ObjectUtil.isEmpty(to_barcode5)){
|
||||
map.put("to_barcode5", to_barcode5);
|
||||
}
|
||||
if (ObjectUtil.isEmpty(to_target1)){
|
||||
map.put("to_target1", to_target1);
|
||||
}
|
||||
if (ObjectUtil.isEmpty(to_target2)){
|
||||
map.put("to_target2", to_target2);
|
||||
}
|
||||
if (ObjectUtil.isEmpty(to_target3)){
|
||||
map.put("to_target3", to_target3);
|
||||
}
|
||||
if (ObjectUtil.isEmpty(to_target4)){
|
||||
map.put("to_target4", to_target4);
|
||||
}
|
||||
if (ObjectUtil.isEmpty(to_target5)){
|
||||
map.put("to_target5", to_target5);
|
||||
}
|
||||
pipeCoreRackStationDeviceDriver.writing(map);
|
||||
if (ObjectUtil.isEmpty(to_barcode2)) {
|
||||
map.put("to_barcode2", to_barcode2);
|
||||
}
|
||||
if (ObjectUtil.isEmpty(to_barcode3)) {
|
||||
map.put("to_barcode3", to_barcode3);
|
||||
}
|
||||
if (ObjectUtil.isEmpty(to_barcode4)) {
|
||||
map.put("to_barcode4", to_barcode4);
|
||||
}
|
||||
if (ObjectUtil.isEmpty(to_barcode5)) {
|
||||
map.put("to_barcode5", to_barcode5);
|
||||
}
|
||||
if (ObjectUtil.isEmpty(to_target1)) {
|
||||
map.put("to_target1", to_target1);
|
||||
}
|
||||
if (ObjectUtil.isEmpty(to_target2)) {
|
||||
map.put("to_target2", to_target2);
|
||||
}
|
||||
if (ObjectUtil.isEmpty(to_target3)) {
|
||||
map.put("to_target3", to_target3);
|
||||
}
|
||||
if (ObjectUtil.isEmpty(to_target4)) {
|
||||
map.put("to_target4", to_target4);
|
||||
}
|
||||
if (ObjectUtil.isEmpty(to_target5)) {
|
||||
map.put("to_target5", to_target5);
|
||||
}
|
||||
if (ObjectUtil.isEmpty(num)) {
|
||||
map.put("to_num", num);
|
||||
}
|
||||
pipeCoreRackStationDeviceDriver.writing(map);
|
||||
}
|
||||
JSONObject resultJson = new JSONObject();
|
||||
resultJson.put("status", HttpStatus.OK.value());
|
||||
@@ -913,8 +914,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
||||
jo.put("qty", foldDiscSiteDeviceDriver.getQty());
|
||||
jo.put("container_type", foldDiscSiteDeviceDriver.getContainer_type());
|
||||
jo.put("error", foldDiscSiteDeviceDriver.getError());
|
||||
}
|
||||
else if (device.getDeviceDriver() instanceof InflatableShaftLibraryDeviceDriver) {
|
||||
} else if (device.getDeviceDriver() instanceof InflatableShaftLibraryDeviceDriver) {
|
||||
inflatableShaftLibraryDeviceDriver = (InflatableShaftLibraryDeviceDriver) device.getDeviceDriver();
|
||||
jo.put("device_code", parent_device_code);
|
||||
jo.put("move", inflatableShaftLibraryDeviceDriver.getMove());
|
||||
|
||||
@@ -2,7 +2,6 @@ package org.nl.acs.instruction.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.collection.ListUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
@@ -19,8 +18,6 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.nl.acs.AcsConfig;
|
||||
import org.nl.acs.agv.server.MagicAgvService;
|
||||
import org.nl.acs.agv.server.NDCAgvService;
|
||||
import org.nl.acs.agv.server.XianGongAgvService;
|
||||
import org.nl.acs.auto.initial.ApplicationAutoInitial;
|
||||
@@ -31,6 +28,8 @@ import org.nl.acs.device.service.DeviceService;
|
||||
import org.nl.acs.device.service.impl.DeviceServiceImpl;
|
||||
import org.nl.acs.device_driver.DeviceDriver;
|
||||
import org.nl.acs.device_driver.DeviceDriverDefination;
|
||||
import org.nl.acs.device_driver.autodoor.lift_door.LiftDoorDeviceDriver;
|
||||
import org.nl.acs.device_driver.conveyor.standard_ordinary_site.StandardOrdinarySiteDeviceDriver;
|
||||
import org.nl.acs.device_driver.two_conveyor.hongxiang_device.HongXiangConveyorDeviceDriver;
|
||||
import org.nl.acs.ext.wms.liKuData.*;
|
||||
import org.nl.acs.ext.wms.service.AcsToLiKuService;
|
||||
@@ -417,8 +416,8 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
||||
dto.setCompound_inst_data(task.getCompound_task_data());
|
||||
}
|
||||
}
|
||||
dto.setCreate_by(ObjectUtil.isNotEmpty(currentUsername) ? currentUsername : dto.getStart_device_code()+":自动创建");
|
||||
dto.setUpdate_by(ObjectUtil.isNotEmpty(currentUsername) ? currentUsername : dto.getStart_device_code()+":自动创建");
|
||||
dto.setCreate_by(ObjectUtil.isNotEmpty(currentUsername) ? currentUsername : dto.getStart_device_code() + ":自动创建");
|
||||
dto.setUpdate_by(ObjectUtil.isNotEmpty(currentUsername) ? currentUsername : dto.getStart_device_code() + ":自动创建");
|
||||
dto.setUpdate_time(now);
|
||||
dto.setCreate_time(now);
|
||||
dto.setStart_parent_code(task.getStart_parent_code());
|
||||
@@ -465,6 +464,8 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
||||
log.info("sendAgvInstToNDC 指令校验:" + dto.getInstruction_code() + ",inst_type:" + dto.getInstruction_type()
|
||||
+ ",inst_system_type:" + dto.getAgv_system_type());
|
||||
}
|
||||
// 如果是二楼到一楼的agv任务需要分配电梯点位
|
||||
allocationLift(dto);
|
||||
ndcAgvService.sendAgvInstToNDC(task.getAgv_system_type(), dto);
|
||||
} catch (Exception e) {
|
||||
dto.setSend_status("2");
|
||||
@@ -531,6 +532,24 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
||||
instructions.add(dto);
|
||||
}
|
||||
|
||||
private void allocationLift(Instruction dto) {
|
||||
StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver;
|
||||
|
||||
Device deviceByCode = deviceAppService.findDeviceByCode(dto.getNext_device_code());
|
||||
if (deviceByCode.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
|
||||
standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) deviceByCode.getDeviceDriver();
|
||||
List<String> linkDeviceCode = standardOrdinarySiteDeviceDriver.getExtraDeviceCodes("link_device_code");
|
||||
if (linkDeviceCode.size() > 1) {
|
||||
Device lift1 = deviceAppService.findDeviceByCode(linkDeviceCode.get(0));
|
||||
Device lift2 = deviceAppService.findDeviceByCode(linkDeviceCode.get(1));
|
||||
if (lift1.getDeviceDriver() instanceof LiftDoorDeviceDriver && lift2.getDeviceDriver() instanceof LiftDoorDeviceDriver){
|
||||
// if (lift1.getDeviceDriver().get)
|
||||
dto.setNext_device_code(lift1.getDevice_code());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void create2(Instruction dto) throws Exception {
|
||||
@@ -594,8 +613,8 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
||||
dto.setCompound_inst_data(task.getCompound_task_data());
|
||||
}
|
||||
}
|
||||
dto.setCreate_by(ObjectUtil.isNotEmpty(currentUsername) ? currentUsername : dto.getStart_device_code()+"手动创建");
|
||||
dto.setUpdate_by(ObjectUtil.isNotEmpty(currentUsername) ? currentUsername : dto.getStart_device_code()+"手动创建");
|
||||
dto.setCreate_by(ObjectUtil.isNotEmpty(currentUsername) ? currentUsername : dto.getStart_device_code() + "手动创建");
|
||||
dto.setUpdate_by(ObjectUtil.isNotEmpty(currentUsername) ? currentUsername : dto.getStart_device_code() + "手动创建");
|
||||
dto.setUpdate_time(now);
|
||||
dto.setCreate_time(now);
|
||||
dto.setStart_parent_code(task.getStart_parent_code());
|
||||
@@ -765,7 +784,6 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
||||
Device nextdevice = appService.findDeviceByCode(dto.getNext_device_code());
|
||||
|
||||
|
||||
|
||||
if (!ObjectUtils.isEmpty(nextdevice.getExtraValue().get("link_three_lamp"))) {
|
||||
String lamd_device = nextdevice.getExtraValue().get("link_three_lamp").toString();
|
||||
Device lamddevice = appService.findDeviceByCode(lamd_device);
|
||||
@@ -1921,7 +1939,7 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
||||
|
||||
@Override
|
||||
public List<Instruction> findByCodeAndExcute(String next_code) {
|
||||
List<Instruction> instructionList = instructions.stream().filter(item -> item.getNext_device_code().equals(next_code) ).collect(Collectors.toList());
|
||||
List<Instruction> instructionList = instructions.stream().filter(item -> item.getNext_device_code().equals(next_code)).collect(Collectors.toList());
|
||||
|
||||
return instructionList;
|
||||
}
|
||||
|
||||
@@ -127,6 +127,7 @@ public class DeviceExecuteAutoRun extends AbstractAutoRunnable {
|
||||
if (!this.runs.keySet().contains(deviceDriver.getDeviceCode())) {
|
||||
this.runs.put(deviceDriver.getDeviceCode(), runnable);
|
||||
}
|
||||
|
||||
runnable.setIndex(this.runs);
|
||||
this.executorService.execute(runnable);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user