add:驱动优化

This commit is contained in:
2025-05-08 15:48:11 +08:00
parent 6960467f74
commit b40245f60f
24 changed files with 364 additions and 136 deletions

View File

@@ -312,8 +312,8 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
if ((manipulatorAgvStationDeviceDriver.getAction() == 1)) {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(this.getDeviceCode())
.content("agvphase:" + phase + "反馈:" + data)
.device_code(manipulatorAgvStationDeviceDriver.getDevice_code())
.content("已下发agv进入信号当前" + manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号为1,当前的指令号为:" + inst.getInstruction_code())
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
@@ -321,7 +321,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
log.info("设备{},动作信号{} ,不满足取货条件,指令号{}", manipulatorAgvStationDeviceDriver.getDeviceCode(), manipulatorAgvStationDeviceDriver.getAction(), ikey);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(manipulatorAgvStationDeviceDriver.getDeviceCode())
.content("未给agv进入信号原因是" + manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1")
.content("未给agv进入信号原因是" + manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1,当前的指令号为:" + inst.getInstruction_code())
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
@@ -566,8 +566,8 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
if (manipulatorAgvStationDeviceDriver.getAction() == 0) {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(this.getDeviceCode())
.content("agvphase:" + phase + "反馈:" + data)
.device_code(manipulatorAgvStationDeviceDriver.getDevice_code())
.content("已下发agv离开信号当前" + manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号为0,当前的指令号为:" + inst.getInstruction_code())
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
@@ -587,7 +587,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
} else {
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(manipulatorAgvStationDeviceDriver.getDevice_code())
.content("未给agv离开信号原因是" + manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为0")
.content("未给agv离开信号原因是" + manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为0,当前的指令号为:" + inst.getInstruction_code())
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
@@ -801,8 +801,8 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
if ((manipulatorAgvStationDeviceDriver.getAction() == 1)) {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(this.getDeviceCode())
.content("agvphase:" + phase + "反馈:" + data)
.device_code(manipulatorAgvStationDeviceDriver.getDevice_code())
.content("已下发agv进入信号当前" + manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号为1,当前的指令号为:" + inst.getInstruction_code())
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
@@ -810,7 +810,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
message = "设备号:" + device_code + ",动作信号:" + manipulatorAgvStationDeviceDriver.getAction() + "报警信号:" + ",指令号:" + ikey + "不满足取货条件";
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(manipulatorAgvStationDeviceDriver.getDeviceCode())
.content("未给agv进入信号原因是" + manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1")
.content("未给agv进入信号原因是" + manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1,当前的指令号为:" + inst.getInstruction_code())
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
@@ -1005,8 +1005,8 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
if ((manipulatorAgvStationDeviceDriver.getAction() == 1)) {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(this.getDeviceCode())
.content("agvphase:" + phase + "反馈:" + data)
.device_code(manipulatorAgvStationDeviceDriver.getDevice_code())
.content("已下发agv进入信号当前" + manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号为1,当前的指令号为:" + inst.getInstruction_code())
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
@@ -1014,7 +1014,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
message = "设备号:" + device_code + ",动作信号:" + manipulatorAgvStationDeviceDriver.getAction() + "报警信号:" + ",指令号:" + ikey + "不满足取货条件";
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(manipulatorAgvStationDeviceDriver.getDeviceCode())
.content("未给agv进入信号原因是" + manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1")
.content("未给agv进入信号原因是" + manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1,当前的指令号为:" + inst.getInstruction_code())
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
@@ -1032,8 +1032,8 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
if ((manipulatorAgvStationDeviceDriver.getAction() == 1)) {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(this.getDeviceCode())
.content("agvphase:" + phase + "反馈:" + data)
.device_code(manipulatorAgvStationDeviceDriver.getDevice_code())
.content("已下发agv进入信号当前" + manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号为1,当前的指令号为:" + inst.getInstruction_code())
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
@@ -1041,7 +1041,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
message = "设备号:" + device_code + ",动作信号:" + manipulatorAgvStationDeviceDriver.getAction() + "报警信号:" + ",指令号:" + ikey + "不满足取货条件";
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(manipulatorAgvStationDeviceDriver.getDeviceCode())
.content("未给agv进入信号原因是" + manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1")
.content("未给agv进入信号原因是" + manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1,当前的指令号为:" + inst.getInstruction_code())
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
@@ -1059,8 +1059,8 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
if ((manipulatorAgvStationDeviceDriver.getAction() == 1)) {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(this.getDeviceCode())
.content("agvphase:" + phase + "反馈:" + data)
.device_code(manipulatorAgvStationDeviceDriver.getDevice_code())
.content("已下发agv进入信号当前" + manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号为1,当前的指令号为:" + inst.getInstruction_code())
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
@@ -1068,7 +1068,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
message = "设备号:" + device_code + ",动作信号:" + manipulatorAgvStationDeviceDriver.getAction() + "报警信号:" + ",指令号:" + ikey + "不满足取货条件";
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(manipulatorAgvStationDeviceDriver.getDeviceCode())
.content("未给agv进入信号原因是" + manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1")
.content("未给agv进入信号原因是" + manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1,当前的指令号为:" + inst.getInstruction_code())
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
@@ -1086,8 +1086,8 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
if ((manipulatorAgvStationDeviceDriver.getAction() == 1)) {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(this.getDeviceCode())
.content("agvphase:" + phase + "反馈:" + data)
.device_code(manipulatorAgvStationDeviceDriver.getDevice_code())
.content("已下发agv进入信号当前" + manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号为1,当前的指令号为:" + inst.getInstruction_code())
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
@@ -1095,7 +1095,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
message = "设备号:" + manipulatorAgvStationDeviceDriver.getDevice_code() + ",动作信号:" + manipulatorAgvStationDeviceDriver.getAction() + "报警信号:" + ",指令号:" + ikey + "不满足取货条件";
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(manipulatorAgvStationDeviceDriver.getDeviceCode())
.content("未给agv进入信号原因是" + manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1")
.content("未给agv进入信号原因是" + manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1,当前的指令号为:" + inst.getInstruction_code())
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
@@ -1437,8 +1437,8 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
if ((manipulatorAgvStationDeviceDriver.getAction() == 1)) {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(this.getDeviceCode())
.content("agvphase:" + phase + "反馈:" + data)
.device_code(manipulatorAgvStationDeviceDriver.getDevice_code())
.content("已下发agv进入信号当前" + manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号为1,当前的指令号为:" + inst.getInstruction_code())
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
@@ -1447,7 +1447,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
log.info("设备{},动作信号{} ,不满足取货条件,指令号{}", device_code, manipulatorAgvStationDeviceDriver.getAction(), ikey);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(manipulatorAgvStationDeviceDriver.getDeviceCode())
.content("未给agv进入信号原因是" + manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1")
.content("未给agv进入信号原因是" + manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1,当前的指令号为:" + inst.getInstruction_code())
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
@@ -1664,8 +1664,8 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
if (manipulatorAgvStationDeviceDriver.getAction() == 0) {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(this.getDeviceCode())
.content("agvphase:" + phase + "反馈:" + data)
.device_code(manipulatorAgvStationDeviceDriver.getDevice_code())
.content("已下发agv离开信号当前" + manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号为0,当前的指令号为:" + inst.getInstruction_code())
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
@@ -1721,21 +1721,21 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
map.put("to_material", to_material);
map.put("to_spec", to_spec);
map.put("to_qty", to_qty);
// if ("BH_17".equals(device_code)) {
// map.put("to_material1", to_material1);
// map.put("to_spec1", to_spec1);
// map.put("to_qty1", to_qty1);
// }
// if ("BH_18".equals(device_code)) {
// map.put("to_material2", to_material1);
// map.put("to_spec2", to_spec1);
// map.put("to_qty2", to_qty1);
// }
// if ("BH_19".equals(device_code)) {
// map.put("to_material3", to_material1);
// map.put("to_spec3", to_spec1);
// map.put("to_qty3", to_qty1);
// }
if ("BH_17".equals(device_code)) {
map.put("to_material1", to_material1);
map.put("to_spec1", to_spec1);
map.put("to_qty1", to_qty1);
}
if ("BH_18".equals(device_code)) {
map.put("to_material2", to_material1);
map.put("to_spec2", to_spec1);
map.put("to_qty2", to_qty1);
}
if ("BH_19".equals(device_code)) {
map.put("to_material3", to_material1);
map.put("to_spec3", to_spec1);
map.put("to_qty3", to_qty1);
}
paperTubePickSiteDeviceDriver.writing(map);
} else {
map.put("to_command", 5);
@@ -1891,8 +1891,8 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
if ((manipulatorAgvStationDeviceDriver.getAction() == 1)) {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(this.getDeviceCode())
.content("agvphase:" + phase + "反馈:" + data)
.device_code(manipulatorAgvStationDeviceDriver.getDevice_code())
.content("已下发agv进入信号当前" + manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号为1,当前的指令号为:" + inst.getInstruction_code())
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
@@ -1901,7 +1901,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
log.info("设备{},动作信号{} ,不满足取货条件,指令号{}", device_code, manipulatorAgvStationDeviceDriver.getAction(), ikey);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(manipulatorAgvStationDeviceDriver.getDeviceCode())
.content("未给agv进入信号原因是" + manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1")
.content("未给agv进入信号原因是" + manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为1,当前的指令号为:" + inst.getInstruction_code())
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
@@ -2101,12 +2101,12 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
if (manipulatorAgvStationDeviceDriver.getAction() == 0) {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(this.getDeviceCode())
.content("agvphase:" + phase + "反馈:" + data)
.device_code(manipulatorAgvStationDeviceDriver.getDevice_code())
.content("已下发agv离开信号当前" + manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号为0,当前的指令号为:" + inst.getInstruction_code())
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
}else {
} else {
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(manipulatorAgvStationDeviceDriver.getDevice_code())
.content("未给agv离开信号原因是" + manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为0")

View File

@@ -753,6 +753,20 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements
log.error("指令创建失败!,{}", e.getMessage());
return false;
}
if ("RK1002".equals(taskdto.getStart_device_code())){
Device device = deviceAppService.findDeviceByCode("RK1003");
BeltConveyorDeviceDriver beltConveyorDeviceDriver1;
if (device.getDeviceDriver() instanceof BeltConveyorDeviceDriver) {
beltConveyorDeviceDriver1 = (BeltConveyorDeviceDriver) device.getDeviceDriver();
List list1 = new ArrayList();
Map map = new HashMap();
map.put("code", "to_command");
map.put("value", "0");
list1.add(map);
beltConveyorDeviceDriver1.writing(list1);
}
}
return updateTask(taskdto, nextdevice, instdto);
}

View File

@@ -24,6 +24,7 @@ import java.util.Map;
public interface OpcDeviceDriver extends DeviceDriver {
/**
* getOpcValueAccessor
*
* @return
*/
UnifiedDataAccessor getOpcValueAccessor();
@@ -32,6 +33,7 @@ public interface OpcDeviceDriver extends DeviceDriver {
/**
* getOpcItems
*
* @return
*/
default List<OpcItemDto> getOpcItems() {
@@ -65,6 +67,7 @@ public interface OpcDeviceDriver extends DeviceDriver {
/**
* getExtraValue
*
* @return
*/
default Map<String, Object> getExtraValue() {
@@ -73,6 +76,7 @@ public interface OpcDeviceDriver extends DeviceDriver {
/**
* getOpcServer
*
* @return
*/
default String getOpcServer() {
@@ -81,6 +85,7 @@ public interface OpcDeviceDriver extends DeviceDriver {
/**
* getDevice
*
* @return
*/
@Override
@@ -88,6 +93,7 @@ public interface OpcDeviceDriver extends DeviceDriver {
/**
* getOpcPlc
*
* @return
*/
default String getOpcPlc() {
@@ -96,11 +102,12 @@ public interface OpcDeviceDriver extends DeviceDriver {
/**
* getIntegeregerValue
*
* @param protocol
* @return
*/
default Integer getIntegeregerValue(String protocol) {
if(ObjectUtil.isEmpty(this.getValue(protocol)) && "heartbeat".equals(protocol)){
if (ObjectUtil.isEmpty(this.getValue(protocol)) && "heartbeat".equals(protocol)) {
return null;
}
return (Integer) (ObjectUtil.isEmpty(this.getValue(protocol)) ? 0 : this.getValue(protocol));
@@ -108,6 +115,7 @@ public interface OpcDeviceDriver extends DeviceDriver {
/**
* getStringgerValue
*
* @param protocol
* @return
*/
@@ -117,6 +125,7 @@ public interface OpcDeviceDriver extends DeviceDriver {
/**
* getLongValue
*
* @param protocol
* @return
*/
@@ -126,6 +135,7 @@ public interface OpcDeviceDriver extends DeviceDriver {
/**
* getByteArrayValue
*
* @param protocol
* @return
*/
@@ -135,6 +145,7 @@ public interface OpcDeviceDriver extends DeviceDriver {
/**
* getIntegerArrayValue
*
* @param protocol
* @return
*/
@@ -154,6 +165,7 @@ public interface OpcDeviceDriver extends DeviceDriver {
/**
* getFloatValue
*
* @param protocol
* @return
*/
@@ -163,6 +175,7 @@ public interface OpcDeviceDriver extends DeviceDriver {
/**
* getIntegerValue
*
* @param protocol
* @return
*/
@@ -172,6 +185,7 @@ public interface OpcDeviceDriver extends DeviceDriver {
/**
* getShortValue
*
* @param protocol
* @return
*/
@@ -181,6 +195,7 @@ public interface OpcDeviceDriver extends DeviceDriver {
/**
* getIntegeregerArrayValue
*
* @param protocol
* @return
*/
@@ -190,6 +205,7 @@ public interface OpcDeviceDriver extends DeviceDriver {
/**
* getStringValue
*
* @param protocol
* @return
*/
@@ -199,6 +215,7 @@ public interface OpcDeviceDriver extends DeviceDriver {
/**
* getValue
*
* @param protocol
* @return
*/
@@ -208,6 +225,7 @@ public interface OpcDeviceDriver extends DeviceDriver {
/**
* getItem
*
* @param item
* @return
*/
@@ -217,6 +235,7 @@ public interface OpcDeviceDriver extends DeviceDriver {
/**
* getUdwValue
*
* @param protocol
* @return
*/

View File

@@ -377,7 +377,7 @@ public class BoxStorageOutConveyorDeviceDriver extends AbstractOpcDeviceDriver i
String response = acsToWmsService.applyTowToOne(param);
JSONObject jo = JSON.parseObject(response);
message = "二楼到一楼输送线申请行架任务,返回参数:" + jo;
if (response == null || jo.getInteger("status") == 200) {
if (jo.getInteger("status") == 200) {
List list1 = new ArrayList();
Map map = new HashMap();
map.put("code", "to_command");
@@ -392,7 +392,7 @@ public class BoxStorageOutConveyorDeviceDriver extends AbstractOpcDeviceDriver i
luceneExecuteLogService.deviceExecuteLog(logDto2);
this.requireSucess = true;
} else {
this.iserror = true;
// this.iserror = true;
message = "二楼到一楼输送线申请行架任务报错,返回参数:" + jo;
LuceneLogDto logDto2 = LuceneLogDto.builder()
.device_code(device_code)

View File

@@ -804,7 +804,7 @@ public class BoxSubvolumesConveyorDeviceDriver extends AbstractOpcDeviceDriver i
.device_code(device_code)
.content("下发多个电气信号" + itemMap)
.build();
logDto.setLog_level(3);
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
}

View File

@@ -474,7 +474,7 @@ public class FinishedProductOutBindLableDeviceDriver extends AbstractOpcDeviceDr
List list = new ArrayList();
if (mode == 10 || mode == 16) {
if (mode == 10 || mode == 16 || mode == 13) {
Map map = new HashMap();
map.put("code", "to_length");
map.put("value", length);

View File

@@ -591,7 +591,7 @@ public class FoldDiscSiteDeviceDriver extends AbstractOpcDeviceDriver implements
.device_code(device_code)
.content("下发多个电气信号" + itemMap)
.build();
logDto.setLog_level(3);
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
logServer.deviceExecuteLog(device_code, "", "", "下发电气信号:" + itemMap);
try {

View File

@@ -379,8 +379,9 @@ public class BoxPackageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
Map<String, Object> map9 = new HashMap<>();
Map<String, Object> map10 = new HashMap<>();
Map<String, Object> map11 = new HashMap<>();
Map<String, Object> map12 = new HashMap<>();
try {
pushPLC(map1, map2, next_addr, map3, start_addr, map4, instruction.getInstruction_code(), interactionJsonDTO, map5, map6, map7, map8,map9,map10,map11);
pushPLC(map1, map2, next_addr, map3, start_addr, map4, instruction.getInstruction_code(), interactionJsonDTO, map5, map6, map7, map8,map9,map10,map11,map12);
} catch (Exception e) {
logServer.deviceExecuteLog(device_code, "", "", "当前设备:" + device_code + ",下发指令:"
@@ -443,7 +444,7 @@ public class BoxPackageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
.device_code(device_code)
.content(device_code+"创建指令时出现异常:" + e.getMessage())
.build();
logDto.setLog_level(2);
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
return false;
}
@@ -463,14 +464,15 @@ public class BoxPackageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
Map<String, Object> map9 = new HashMap<>();
Map<String, Object> map10 = new HashMap<>();
Map<String, Object> map11 = new HashMap<>();
Map<String, Object> map12 = new HashMap<>();
try {
pushPLC(map1, map2, next_addr, map3, start_addr, map4, instdto.getInstruction_code(), interactionJsonDTO, map5, map6, map7, map8,map9,map10, map11);
pushPLC(map1, map2, next_addr, map3, start_addr, map4, instdto.getInstruction_code(), interactionJsonDTO, map5, map6, map7, map8,map9,map10, map11,map12);
} catch (Exception e) {
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content(device_code+"创建指令时出现异常:" + e.getMessage())
.build();
logDto.setLog_level(2);
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
}
this.setRequireSucess(true);
@@ -485,7 +487,7 @@ public class BoxPackageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
}
private void pushPLC(Map<String, Object> map1, Map<String, Object> map2, String next_addr, Map<String, Object> map3, String start_addr, Map<String, Object> map4, String task, InteractionJsonDTO interactionJsonDTO, Map<String, Object> map5, Map<String, Object> map6, Map<String, Object> map7, Map<String, Object> map8,Map<String, Object> map9,Map<String, Object> map10,Map<String, Object> map11) {
private void pushPLC(Map<String, Object> map1, Map<String, Object> map2, String next_addr, Map<String, Object> map3, String start_addr, Map<String, Object> map4, String task, InteractionJsonDTO interactionJsonDTO, Map<String, Object> map5, Map<String, Object> map6, Map<String, Object> map7, Map<String, Object> map8,Map<String, Object> map9,Map<String, Object> map10,Map<String, Object> map11,Map<String, Object> map12) {
List list = new ArrayList();
map1.put("code", "to_command");
map1.put("value", 1);
@@ -532,6 +534,11 @@ public class BoxPackageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
map11.put("value", interactionJsonDTO.getHeightLevel());
list.add(map11);
}
if (ObjectUtil.isNotEmpty(interactionJsonDTO.getFrpModel())) {
map12.put("code", "frpModel");
map12.put("value", interactionJsonDTO.getFrpModel());
list.add(map12);
}
}
this.writing(list);
}
@@ -576,7 +583,7 @@ public class BoxPackageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
.device_code(device_code)
.content("下发多个电气信号" + itemMap)
.build();
logDto.setLog_level(2);
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
logServer.deviceExecuteLog(device_code, "", "", "下发电气信号:" + itemMap);
try {

View File

@@ -41,4 +41,9 @@ public class InteractionJsonDTO {
* 高度等级
*/
private String heightLevel;
/**
* 高度等级
*/
private String frpModel;
}

View File

@@ -100,6 +100,8 @@ public class ItemProtocol {
*/
public static String item_to_len = "to_len";
public static String item_frpModel = "frpModel";
private BoxPackageManipulatorDeviceDriver driver;
@@ -172,6 +174,10 @@ public class ItemProtocol {
return this.getOpcIntegerValue(item_to_len);
}
public int getFrpModel(){
return this.getOpcIntegerValue(item_frpModel);
}
Boolean isonline;
@@ -241,6 +247,7 @@ public class ItemProtocol {
list.add(new ItemDto(item_to_last_one, "下发是否最后子卷", "DB2.W14"));
list.add(new ItemDto(item_to_len, "下发子卷长度", "DB2.W16"));
list.add(new ItemDto(item_to_barcode, "下发木箱条码", "DB601.STRING1.50"));
list.add(new ItemDto(item_frpModel, "下发管芯尺寸", "DB601.STRING1.50"));
return list;
}
}

View File

@@ -395,7 +395,7 @@ public class BoxStorageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
.device_code(device_code)
.content(device_code+"创建指令时出现异常:" + e.getMessage())
.build();
logDto.setLog_level(2);
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto); return false;
}
//创建指令后修改任务状态
@@ -419,7 +419,7 @@ public class BoxStorageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
.device_code(device_code)
.content(device_code+"创建指令时出现异常:" + e.getMessage())
.build();
logDto.setLog_level(2);
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
}
this.setRequireSucess(true);

View File

@@ -453,7 +453,7 @@ public class ReturnGoodManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
.device_code(device_code)
.content(device_code+"创建指令时出现异常:" + e.getMessage())
.build();
logDto.setLog_level(2);
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto); return false;
}
//创建指令后修改任务状态
@@ -477,7 +477,7 @@ public class ReturnGoodManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
.device_code(device_code)
.content(device_code+"创建指令时出现异常:" + e.getMessage())
.build();
logDto.setLog_level(3);
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
}
this.setRequireSucess(true);
@@ -576,7 +576,7 @@ public class ReturnGoodManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
.device_code(device_code)
.content("下发多个电气信号" + itemMap)
.build();
logDto.setLog_level(3);
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
logServer.deviceExecuteLog(device_code, "", "", "下发电气信号:" + itemMap);
try {

View File

@@ -652,7 +652,7 @@ public class TrappedManipulatorManipulatorDeviceDriver extends AbstractOpcDevice
.device_code(device_code)
.content("下发多个电气信号" + itemMap)
.build();
logDto.setLog_level(3);
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
logServer.deviceExecuteLog(device_code, "", "", "下发电气信号:" + itemMap);
try {

View File

@@ -158,15 +158,15 @@ public class ItemProtocol {
list.add(new ItemDto(item_to_material, "下发物料类型", "DB2.W2"));
list.add(new ItemDto(item_to_spec, "下发物料规格", "DB2.W4"));
list.add(new ItemDto(item_to_qty, "下发物料数量", "DB2.W8"));
// list.add(new ItemDto(item_to_material1, "下发BH-17物料类型", "DB2.W2"));
// list.add(new ItemDto(item_to_spec1, "下发BH-17物料规格", "DB2.W4"));
// list.add(new ItemDto(item_to_qty1, "下发BH-17物料数量", "DB2.W8"));
// list.add(new ItemDto(item_to_material2, "下发BH-18物料类型", "DB2.W2"));
// list.add(new ItemDto(item_to_spec2, "下发BH-18物料规格", "DB2.W4"));
// list.add(new ItemDto(item_to_qty2, "下发BH-18物料数量", "DB2.W8"));
// list.add(new ItemDto(item_to_material3, "下发BH-19物料类型", "DB2.W2"));
// list.add(new ItemDto(item_to_spec3, "下发BH-19物料规格", "DB2.W4"));
// list.add(new ItemDto(item_to_qty3, "下发BH-19物料数量", "DB2.W8"));
list.add(new ItemDto(item_to_material1, "下发BH-17物料类型", "DB2.W2"));
list.add(new ItemDto(item_to_spec1, "下发BH-17物料规格", "DB2.W4"));
list.add(new ItemDto(item_to_qty1, "下发BH-17物料数量", "DB2.W8"));
list.add(new ItemDto(item_to_material2, "下发BH-18物料类型", "DB2.W2"));
list.add(new ItemDto(item_to_spec2, "下发BH-18物料规格", "DB2.W4"));
list.add(new ItemDto(item_to_qty2, "下发BH-18物料数量", "DB2.W8"));
list.add(new ItemDto(item_to_material3, "下发BH-19物料类型", "DB2.W2"));
list.add(new ItemDto(item_to_spec3, "下发BH-19物料规格", "DB2.W4"));
list.add(new ItemDto(item_to_qty3, "下发BH-19物料数量", "DB2.W8"));
return list;
}
}

View File

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

View File

@@ -1559,7 +1559,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
.device_code(device_code)
.content("下发电气信号:" + itemMap)
.build();
logDto.setLog_level(3);
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
logServer.deviceExecuteLog(device_code, "", "", "下发电气信号:" + itemMap);
try {

View File

@@ -19,17 +19,21 @@ public class ItemProtocol {
private ManipulatorAgvStationDeviceDriver driver;
public ItemProtocol(ManipulatorAgvStationDeviceDriver driver){
this.driver=driver;
public ItemProtocol(ManipulatorAgvStationDeviceDriver driver) {
this.driver = driver;
}
public int getItem_heartbeat(){
public int getItem_heartbeat() {
return this.getOpcIntegerValue(item_heartbeat);
} ;
public int getItem_mode(){
}
;
public int getItem_mode() {
return this.getOpcIntegerValue(item_mode);
}
public int getItem_action(){
public int getItem_action() {
return this.getOpcIntegerValue(item_action);
}
@@ -38,9 +42,9 @@ public class ItemProtocol {
public int getOpcIntegerValue(String protocol) {
Integer value = this.driver.getIntegeregerValue(protocol);
if(ObjectUtil.isEmpty(value)){
if (ObjectUtil.isEmpty(value)) {
isError = true;
}else if(item_heartbeat.equals(protocol)){
} else if (item_heartbeat.equals(protocol)) {
isError = false;
}
if (value == null) {

View File

@@ -865,6 +865,7 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl
});
if (ObjectUtil.isNotEmpty(itemMap)) {
this.checkcontrol(itemMap);
log.info("当前设备" + device_code + "下发电气信号:" + itemMap);
logServer.deviceExecuteLog(this.getDevice().getDevice_code(), "", "", "下发多个电气信号:" + itemMap);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)

View File

@@ -31,6 +31,12 @@ public class ItemProtocol {
//y轴坐标
public static String item_y_position = "y";
//行架中转位光电信号
public static String item_move1 = "move1";
//行架中转位光电信号
public static String item_move2 = "move2";
//下发命令
public static String item_to_command = "to_command";
//下发起始站
@@ -101,6 +107,14 @@ public class ItemProtocol {
return this.getOpcIntegerValue(item_move);
}
public int getMove1() {
return this.getOpcIntegerValue(item_move1);
}
public int getMove2() {
return this.getOpcIntegerValue(item_move2);
}
public int getAction() {
return this.getOpcIntegerValue(item_action);
}
@@ -217,9 +231,11 @@ public class ItemProtocol {
list.add(new ItemDto(item_heartbeat, "心跳", "DB11.B0"));
list.add(new ItemDto(item_mode, "工作模式", "DB11.B1"));
list.add(new ItemDto(item_move, "光电信号", "DB11.B2"));
list.add(new ItemDto(item_action, "动作信号", "DB11.B3"));
list.add(new ItemDto(item_walk_y, "走列", "DB11.B4"));
list.add(new ItemDto(item_error, "报警信号", "DB11.B5"));
list.add(new ItemDto(item_move1, "行架中转位1光电信号", "DB11.B3"));
list.add(new ItemDto(item_move2, "架中转位2光电信号", "DB11.B4"));
list.add(new ItemDto(item_action, "动作信号", "DB11.B5"));
list.add(new ItemDto(item_walk_y, "行走列", "DB11.B6"));
list.add(new ItemDto(item_error, "报警信号", "DB11.B7"));
list.add(new ItemDto(item_task, "任务号", "DB11.D6"));
list.add(new ItemDto(item_x_position, "x坐标", "DB11.REAL10"));
list.add(new ItemDto(item_y_position, "y坐标", "DB11.REAL14"));

View File

@@ -19,6 +19,7 @@ import org.nl.acs.device.service.impl.DeviceExtraServiceImpl;
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_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_manipulator.box_storage_manipulator.InteractionJsonDTO;
@@ -89,6 +90,12 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
//光电信号
int move = 0;
int lastMove = 0;
//光电信号
int move1 = 0;
int lastMove1 = 0;
//光电信号
int move2 = 0;
int lastMove2 = 0;
//动作信号
int action = 0;
int lastAction = 0;
@@ -148,9 +155,11 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
private Date instruction_update_time = new Date();
private Date apply_action_time = new Date();
private Date apply_action_time1 = new Date();
private Date apply_action_time2 = new Date();
private int instruction_update_time_out = 3000;
private int apply_action_time_out = 3000;
private int apply_action_time_out1 = 3000;
private int apply_action_time_out2 = 3000;
Integer heartbeat_tag;
private Date instruction_require_time = new Date();
@@ -198,6 +207,8 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
device_code = this.getDeviceCode();
mode = this.itemProtocol.getMode();
move = this.itemProtocol.getMove();
move1 = this.itemProtocol.getMove1();
move2 = this.itemProtocol.getMove2();
action = this.itemProtocol.getAction();
walkY = this.itemProtocol.getWalk_y();
error = this.itemProtocol.getError();
@@ -332,6 +343,53 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
}
}
//申请放货点
if (mode == 3 && action == 8) {
Date date = new Date();
if (date.getTime() - this.apply_action_time2.getTime() < (long) this.apply_action_time_out2) {
log.trace("触发时间因为小于{}毫秒,而被无视", this.apply_action_time_out2);
} else {
this.apply_action_time2 = date;
ManipulatorApplyPointRequest manipulatorApplyPointRequest = new ManipulatorApplyPointRequest();
ManipulatorApplyPointResponse manipulatorApplyPointResponse;
inst = checkInst();
if (ObjectUtil.isEmpty(inst)) {
log.info("指令号为空!");
return;
}
String task_code = inst.getTask_code();
manipulatorApplyPointRequest.setType("3");
manipulatorApplyPointRequest.setTask_code(task_code);
if (toCommand == 0 || to_putpoint == 0) {
manipulatorApplyPointResponse = acsToWmsService.manipulatorApplyPointRequest(manipulatorApplyPointRequest);
if (manipulatorApplyPointResponse.getstatus() == 200) {
LuceneLogDto logDto1 = LuceneLogDto.builder()
.device_code(device_code)
.content("向LMS申请气胀轴库放货点位返回参数" + manipulatorApplyPointResponse)
.build();
logDto1.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto1);
String put_device_code = manipulatorApplyPointResponse.getDevice_code();
Device device = deviceAppService.findDeviceByCode(put_device_code);
String to_new_putpoint = device.getExtraValue().get("address").toString();
List list = new ArrayList();
Map<String, Object> map1 = new HashMap<>();
Map<String, Object> map2 = new HashMap<>();
map1.put("code", "to_command");
map1.put("value", "8");
map2.put("code", "to_putpoint");
map2.put("value", Integer.parseInt(to_new_putpoint));
list.add(map1);
list.add(map2);
this.writing(list);
message = "申请新放货点成功";
} else {
message = "申请新放货点失败";
}
}
}
}
} catch (Exception var17) {
var17.printStackTrace();
@@ -394,6 +452,8 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
}
lastMode = mode;
lastMove = move;
lastMove1 = move1;
lastMove2 = move2;
lastAction = action;
lastWalkY = walkY;
lastError = error;
@@ -631,6 +691,21 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
continue;
}
}
if (startdevice.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver && nextdevice.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
if (move2 == 0) {
task = taskReady;
break start;
} else {
notCreateInstMessage = "就绪任务未创建指令原因->" + device_code + "的move2信号不为0";
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content("当前任务号:" + taskReady.getTask_code() + " " + device_code + "当前move值为" + move2 + "move2值应该为0")
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
continue;
}
}
}
}
@@ -752,6 +827,7 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
Map<String, Object> map26 = new HashMap<>();
Map<String, Object> map27 = new HashMap<>();
Map<String, Object> map28 = new HashMap<>();
Map<String, Object> map29 = new HashMap<>();
if (StrUtil.isNotEmpty(interaction_json) && !"".equals(interaction_json)) {
JSONObject jsonObject = JSONObject.parseObject(interaction_json);
//套管1物料
@@ -778,6 +854,7 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
Object to_spec3 = jsonObject.get("currentLeftSpec");
//拔管2规格
Object to_spec4 = jsonObject.get("currentRightSpec");
Object qzz_size = jsonObject.get("qzz_size");
//套管数量
Object to_qty1 = jsonObject.get("casingCount");
@@ -794,7 +871,7 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
list.add(map2);
// map.put("to_size", jsonObject.getString("qzz_size"));
map3.put("code", "to_size");
map3.put("value", jsonObject.getString("qzz_size"));
map3.put("value", qzz_size);
list.add(map3);
// map.put("to_barcode", jsonObject.getString("qzz_no"));
map4.put("code", "to_barcode");
@@ -942,6 +1019,13 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
map28.put("code", "to_target");
map28.put("value", nextAddr);
list.add(map28);
if (ObjectUtil.isNotEmpty(instdto.getVehicle_code())) {
String size = instdto.getVehicle_code();
String qzzsize = size.substring(size.length() - 3);
map29.put("code", "to_size");
map29.put("value", qzzsize.split("-")[0]);
list.add(map29);
}
this.writing(list);
}
}
@@ -959,12 +1043,14 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
itemMap.put(to_param, json.getString("value"));
}
}
log.info("当前设备" + device_code + "下发电气信号:" + itemMap);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content("下发多个电气信号" + itemMap)
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
logServer.deviceExecuteLog(device_code, "", "", "下发电气信号:" + itemMap);
try {
this.checkcontrol(itemMap);

View File

@@ -399,6 +399,20 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
errArr.add(json);
continue;
}
if ("RK1002".equals(task_dto.getStart_device_code())){
Device device = deviceAppService.findDeviceByCode("RK1003");
BeltConveyorDeviceDriver beltConveyorDeviceDriver1;
if (device.getDeviceDriver() instanceof BeltConveyorDeviceDriver) {
beltConveyorDeviceDriver1 = (BeltConveyorDeviceDriver) device.getDeviceDriver();
List list1 = new ArrayList();
Map map = new HashMap();
map.put("code", "to_command");
map.put("value", "55");
list1.add(map);
beltConveyorDeviceDriver1.writing(list1);
}
}
}
if (ObjectUtil.isEmpty(errArr)) {
response.setStatus(200);
@@ -722,9 +736,9 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
String to_material = data.getString("to_material");
String to_spec = data.getString("to_spec");
String to_qty = data.getString("to_qty");
// String to_material1 = data.getString("to_material1");
// String to_spec1 = data.getString("to_spec1");
// String to_qty1 = data.getString("to_qty1");
String to_material1 = data.getString("to_material1");
String to_spec1 = data.getString("to_spec1");
String to_qty1 = data.getString("to_qty1");
Device device = deviceAppService.findDeviceByCode(device_code);
if (ObjectUtil.isEmpty(device)) {
throw new Exception("未找到对应设备:" + device_code);
@@ -737,21 +751,21 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
map.put("to_material", to_material);
map.put("to_spec", to_spec);
map.put("to_qty", to_qty);
// if ("BH_17".equals(device_code)) {
// map.put("to_material1", to_material1);
// map.put("to_spec1", to_spec1);
// map.put("to_qty1", to_qty1);
// }
// if ("BH_18".equals(device_code)) {
// map.put("to_material2", to_material1);
// map.put("to_spec2", to_spec1);
// map.put("to_qty2", to_qty1);
// }
// if ("BH_19".equals(device_code)) {
// map.put("to_material3", to_material1);
// map.put("to_spec3", to_spec1);
// map.put("to_qty3", to_qty1);
// }
if ("BH_17".equals(device_code)) {
map.put("to_material1", to_material1);
map.put("to_spec1", to_spec1);
map.put("to_qty1", to_qty1);
}
if ("BH_18".equals(device_code)) {
map.put("to_material2", to_material1);
map.put("to_spec2", to_spec1);
map.put("to_qty2", to_qty1);
}
if ("BH_19".equals(device_code)) {
map.put("to_material3", to_material1);
map.put("to_spec3", to_spec1);
map.put("to_qty3", to_qty1);
}
}
log.info("下发电气信号--------------:参数" + map);

View File

@@ -176,6 +176,11 @@ public interface TaskService extends CommonService<Task> {
*/
List<TaskDto> queryAllUnfinished(Map whereJson);
/**
* 根据设备号查询未完成的任务
*/
List<TaskDto> queryUnfinishTaskByDeviceCode(String device_code);
/**
* 根据状态查询
*

View File

@@ -427,6 +427,20 @@ public class TaskServiceImpl extends CommonServiceImpl<TaskMapper, Task> impleme
return ConvertUtil.convertList(taskList, TaskDto.class);
}
@Override
public List<TaskDto> queryUnfinishTaskByDeviceCode(String device_code) {
List<TaskDto> list = new ArrayList<>();
Iterator<TaskDto> iterator = tasks.iterator();
while (iterator.hasNext()) {
TaskDto task = iterator.next();
if (task.getStart_point_code().equals(device_code)
&& (StrUtil.equals(task.getTask_status(), "0"))) {
list.add(task);
}
}
return list;
}
@Override
public TaskDto findByCode(String code) {
Task task = new LambdaQueryChainWrapper<>(taskMapper)

View File

@@ -39,11 +39,14 @@ import java.util.List;
public class CreateDDJInst {
List<String> deepSlots = Arrays.asList("L1", "L4", "L5", "L8", "L9", "L12");
/**
* 定时查询堆垛机任务
*/
public void run() {
log.info("定时查询堆垛机任务"+DateUtil.now());
log.info("定时查询堆垛机任务" + DateUtil.now());
TaskService taskserver = SpringContextHolder.getBean(TaskService.class);
InstructionService instructionService = SpringContextHolder.getBean(InstructionService.class);
RouteLineService routeLineService = SpringContextHolder.getBean(RouteLineService.class);
@@ -70,6 +73,17 @@ public class CreateDDJInst {
if (CollUtil.isNotEmpty(taskDtoList)) {
taskDtoList = sortInst(taskDtoList);
for (TaskDto taskDto : taskDtoList) {
String deviceCode = taskDto.getStart_point_code();
String prefix = deviceCode.split("-")[0];
boolean isDeepSlot = deepSlots.stream().anyMatch(prefix::equals);
if (isDeepSlot) {
String newDevice_code = forametDevice_code(deviceCode);
List<TaskDto> list = taskserver.queryUnfinishTaskByDeviceCode(newDevice_code);
if (list.size() > 0) {
log.info("该设备存在" + newDevice_code + "浅货位任务,此任务无法执行!");
continue;
}
}
Device nextDevice = null;
List<String> pathlist;
Device deviceByCode = null;
@@ -207,7 +221,7 @@ public class CreateDDJInst {
if (beltConveyorDeviceDriver.getMode() != 2 || beltConveyorDeviceDriver.getMove() == 1) {
log.error("输送机,{}未联机或执行中", next_device_code);
((BeltConveyorDeviceDriver) nextDevice.getDeviceDriver()).setNotCreateInstMessage("one_message7");
((StandardStackerDeviceDriver) deviceByCode.getDeviceDriver()).setNotCreateInstMessage("无法创建堆垛机指令的原因DDJ对接位"+next_device_code+"条件不满足!");
((StandardStackerDeviceDriver) deviceByCode.getDeviceDriver()).setNotCreateInstMessage("无法创建堆垛机指令的原因DDJ对接位" + next_device_code + "条件不满足!");
continue;
}
}
@@ -220,7 +234,7 @@ public class CreateDDJInst {
if (CollUtil.isEmpty(byDeviceCodes)) {
//判断有没有DDJ对接位出入库的指令,只判断终点
List<Instruction> byCodeAndExcute = instructionService.findByNextCode(next_device_code);
if (CollUtil.isNotEmpty(byCodeAndExcute)){
if (CollUtil.isNotEmpty(byCodeAndExcute)) {
((StandardStackerDeviceDriver) deviceByCode.getDeviceDriver()).setNotCreateInstMessage("有DDJ对接位为终点的指令");
continue;
}
@@ -292,7 +306,7 @@ public class CreateDDJInst {
int max = 0;
//非同排的路径
for (Instruction inst : insts) {
List<RouteLineDto> shortPathLines =new ArrayList<>();
List<RouteLineDto> shortPathLines = new ArrayList<>();
if (!(inst.getStart_device_code().equals(inst.getNext_device_code()))) {
shortPathLines = routeLineService.getShortPathLines(inst.getStart_device_code(), inst.getNext_device_code(),
inst.getRoute_plan_code());
@@ -300,7 +314,7 @@ public class CreateDDJInst {
log.error("没有此路由");
throw new BadRequestException("路由不通");
}
}else {
} else {
//同排路径
shortPathLines = routeLineService.getShortPathLinesByCode(inst.getStart_device_code(), inst.getRoute_plan_code());
if (CollUtil.isEmpty(shortPathLines) || shortPathLines.size() < 1) {
@@ -322,7 +336,7 @@ public class CreateDDJInst {
if (max <= Integer.parseInt(count)) {
//判断有没有DDJ对接位出入库的指令,只判断终点
List<Instruction> byCodeAndExcute = instructionService.findByNextCode(next_device_code);
if (CollUtil.isNotEmpty(byCodeAndExcute)){
if (CollUtil.isNotEmpty(byCodeAndExcute)) {
((StandardStackerDeviceDriver) deviceByCode.getDeviceDriver()).setNotCreateInstMessage("有DDJ对接位为终点的指令");
continue;
}
@@ -415,6 +429,28 @@ public class CreateDDJInst {
}
}
public String forametDevice_code(String deviceCode) {
if (deviceCode.startsWith("L1")) {
return "L2" + deviceCode.substring(2, deviceCode.length());
}
if (deviceCode.startsWith("L4")) {
return "L3" + deviceCode.substring(2, deviceCode.length());
}
if (deviceCode.startsWith("L5")) {
return "L6" + deviceCode.substring(2, deviceCode.length());
}
if (deviceCode.startsWith("L8")) {
return "L7" + deviceCode.substring(2, deviceCode.length());
}
if (deviceCode.startsWith("L9")) {
return "L10" + deviceCode.substring(2, deviceCode.length());
}
if (deviceCode.startsWith("L12")) {
return "L11" + deviceCode.substring(3, deviceCode.length());
}
return deviceCode;
}
private List<TaskDto> sortInst(List<TaskDto> taskDtos) {
Collections.sort(taskDtos, (t1, t2) -> {
//优先级从大到小