Compare commits

...

2 Commits

Author SHA1 Message Date
涂强 f966c662f0 master备份1 4 months ago
涂强 629ae5d3b1 master备份 4 months ago
  1. 534
      acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/agv/ndctwo/AgvNdcTwoDeviceDriver.java
  2. 4
      acs2/nladmin-system/nlsso-server/src/main/java/org/nl/hand/rest/PdaController.java
  3. 7
      acs2/nladmin-system/nlsso-server/src/main/java/org/nl/hand/service/impl/PdaServiceImpl.java
  4. 2
      acs2/nladmin-system/nlsso-server/src/main/resources/config/application-dev.yml

534
acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/agv/ndctwo/AgvNdcTwoDeviceDriver.java

@ -169,17 +169,6 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
//普通站点 //普通站点
StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver; StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver;
//纸管抓取位
PaperTubePickSiteDeviceDriver paperTubePickSiteDeviceDriver;
//标准-光电检测
StandardInspectSiteDeviceDriver standardInspectSiteDeviceDriver;
//烘箱对接位
HongXiangStationDeviceDriver hongXiangStationDeviceDriver;
//行架-agv对接位
ManipulatorAgvStationDeviceDriver manipulatorAgvStationDeviceDriver;
//废箔称重位
WasteFoilWeighingStationDriver wasteFoilWeighingStationDriver;
if (phase == 0x02) { if (phase == 0x02) {
if (ObjectUtil.isEmpty(inst)) { if (ObjectUtil.isEmpty(inst)) {
@ -320,223 +309,18 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver(); standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver();
log.info("日志检查!" + device.getExtraValue().get("wait") + standardOrdinarySiteDeviceDriver.getOption()); data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
if (ObjectUtil.isNotEmpty(device.getExtraValue().get("wait")) LuceneLogDto logDto = LuceneLogDto.builder()
&& StrUtil.equals("true", device.getExtraValue().get("wait").toString())) { .device_code(this.getDeviceCode())
if (standardOrdinarySiteDeviceDriver.getOption() == 1) { .content("agvphase:" + phase + "反馈:" + data)
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); .build();
LuceneLogDto logDto = LuceneLogDto.builder() logDto.setLog_level(4);
.device_code(this.getDeviceCode()) luceneExecuteLogService.deviceExecuteLog(logDto);
.content("agvphase:" + phase + "反馈:" + data) standardOrdinarySiteDeviceDriver.setAgvphase(phase);
.build(); standardOrdinarySiteDeviceDriver.setIndex(index);
logDto.setLog_level(4); standardOrdinarySiteDeviceDriver.setInst(inst);
luceneExecuteLogService.deviceExecuteLog(logDto);
standardOrdinarySiteDeviceDriver.setAgvphase(phase);
standardOrdinarySiteDeviceDriver.setIndex(index);
standardOrdinarySiteDeviceDriver.setInst(inst);
}
} 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);
}
} }
} }
// 取货完毕
//(Itype=1、3,需要WCS反馈)
// else if (phase == 0x0A) {
// 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 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())) {
// standardOrdinarySiteDeviceDriver.setOption(0);
// } 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, 0, 0);
// standardOrdinarySiteDeviceDriver.setAgvphase(phase);
// standardOrdinarySiteDeviceDriver.setIndex(index);
// standardOrdinarySiteDeviceDriver.setInst(inst);
// 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())) {
// JSONObject jsonObject = new JSONObject();
// jsonObject.put("task_code", task_code);
// LuceneLogDto logDto1 = LuceneLogDto.builder()
// .device_code(standardOrdinarySiteDeviceDriver.getDevice_code())
// .content("取货完成反馈:" + jsonObject.toJSONString() + ";设备:" + standardOrdinarySiteDeviceDriver.getDeviceCode())
// .build();
// logDto1.setLog_level(4);
// luceneExecuteLogService.deviceExecuteLog(logDto1);
// acsToWmsService.actionFinishRequest2(jsonObject);
// }
//
// } else if (device.getDeviceDriver() instanceof HongXiangStationDeviceDriver) {
// hongXiangStationDeviceDriver = (HongXiangStationDeviceDriver) device.getDeviceDriver();
// try {
// hongXiangStationDeviceDriver.writing(0);
// } catch (Exception e) {
// e.printStackTrace();
// }
// if (hongXiangStationDeviceDriver.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 + "光电信号:" + hongXiangStationDeviceDriver.getMove() + ",指令号:" + ikey + "不满足取货条件";
// LuceneLogDto logDto = LuceneLogDto.builder()
// .device_code(this.getDeviceCode())
// .content(message)
// .build();
// logDto.setLog_level(4);
// luceneExecuteLogService.deviceExecuteLog(logDto);
// }
// } else if (device.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) {
// manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) device.getDeviceDriver();
// try {
// manipulatorAgvStationDeviceDriver.writing(3);
// } catch (Exception e) {
// e.printStackTrace();
// }
// data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
// LuceneLogDto logDto = LuceneLogDto.builder()
// .device_code(this.getDeviceCode())
// .content("agvphase:" + phase + "反馈:" + data)
// .build();
// logDto.setLog_level(4);
// luceneExecuteLogService.deviceExecuteLog(logDto);
// String task_code = inst.getTask_code();
// if (ObjectUtil.isNotEmpty(manipulatorAgvStationDeviceDriver.getDevice().getExtraValue().get("feedbackToLms"))
// && StrUtil.equals("true", manipulatorAgvStationDeviceDriver.getDevice().getExtraValue().get("feedbackToLms").toString())) {
// JSONObject jsonObject = new JSONObject();
// jsonObject.put("task_code", task_code);
// LuceneLogDto logDto1 = LuceneLogDto.builder()
// .device_code(manipulatorAgvStationDeviceDriver.getDevice_code())
// .content("取货完成反馈:" + jsonObject.toJSONString() + ";设备:" + manipulatorAgvStationDeviceDriver.getDeviceCode())
// .build();
// logDto1.setLog_level(4);
// luceneExecuteLogService.deviceExecuteLog(logDto1);
// acsToWmsService.actionFinishRequest2(jsonObject);
// }
// } else if (device.getDeviceDriver() instanceof PaperTubePickSiteDeviceDriver) {
// paperTubePickSiteDeviceDriver = (PaperTubePickSiteDeviceDriver) device.getDeviceDriver();
// try {
// paperTubePickSiteDeviceDriver.writing(3);
// } catch (Exception e) {
// e.printStackTrace();
// }
// if (paperTubePickSiteDeviceDriver.getAction() == 1
// && paperTubePickSiteDeviceDriver.getError() == 0 && paperTubePickSiteDeviceDriver.getMode() == 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 {
// message = "设备号:" + device_code + ",动作信号:" + paperTubePickSiteDeviceDriver.getAction() + "报警信号:" + paperTubePickSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件";
// LuceneLogDto logDto = LuceneLogDto.builder()
// .device_code(this.getDeviceCode())
// .content(message)
// .build();
// logDto.setLog_level(4);
// luceneExecuteLogService.deviceExecuteLog(logDto);
// }
// } else if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
// standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver();
//
// try {
// standardInspectSiteDeviceDriver.writing(1);
// } catch (Exception e) {
// e.printStackTrace();
// }
// if ((standardInspectSiteDeviceDriver.getMove() == 1 && standardInspectSiteDeviceDriver.getAction() == 1 && standardInspectSiteDeviceDriver.getError() == 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 + "光电信号:" + standardInspectSiteDeviceDriver.getMove() + ",动作信号:" + standardInspectSiteDeviceDriver.getAction() + "报警信号:" + standardInspectSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件";
// LuceneLogDto logDto = LuceneLogDto.builder()
// .device_code(this.getDeviceCode())
// .content(message)
// .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);
// }
//
// }
// 到达放货点 // 到达放货点
//(Itype=1/2/3,需要WCS反馈) //(Itype=1/2/3,需要WCS反馈)
@ -579,39 +363,8 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
} }
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver(); standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver();
log.info("日志检查!" + device.getExtraValue().get("wait") + standardOrdinarySiteDeviceDriver.getOption()); //卸货确认
if (ObjectUtil.isNotEmpty(device.getExtraValue().get("wait")) if (standardOrdinarySiteDeviceDriver.getOption() == 2) {
&& StrUtil.equals("true", device.getExtraValue().get("wait").toString())) {
if (standardOrdinarySiteDeviceDriver.getOption() == 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);
standardOrdinarySiteDeviceDriver.setAgvphase(phase);
standardOrdinarySiteDeviceDriver.setIndex(index);
standardOrdinarySiteDeviceDriver.setInst(inst);
}
} 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 if (device.getDeviceDriver() instanceof PaperTubePickSiteDeviceDriver) {
paperTubePickSiteDeviceDriver = (PaperTubePickSiteDeviceDriver) device.getDeviceDriver();
try {
paperTubePickSiteDeviceDriver.writing(4);
} catch (Exception e) {
e.printStackTrace();
}
if (paperTubePickSiteDeviceDriver.getAction() == 1
&& paperTubePickSiteDeviceDriver.getError() == 0 && paperTubePickSiteDeviceDriver.getMode() == 2) {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
LuceneLogDto logDto = LuceneLogDto.builder() LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(this.getDeviceCode()) .device_code(this.getDeviceCode())
@ -619,120 +372,18 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
.build(); .build();
logDto.setLog_level(4); logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto); luceneExecuteLogService.deviceExecuteLog(logDto);
standardOrdinarySiteDeviceDriver.setOption(0);
} else { } else {
message = "设备号:" + device_code + ",动作信号:" + paperTubePickSiteDeviceDriver.getAction() + "报警信号:" + paperTubePickSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; log.info("等待一体机进行卸货确认,设备号{},option值{}", standardOrdinarySiteDeviceDriver.getDevice_code(), standardOrdinarySiteDeviceDriver.getOption());
log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},设备状态{},不满足放货条件,指令号{}", device_code, paperTubePickSiteDeviceDriver.getMove(), paperTubePickSiteDeviceDriver.getAction() logServer.deviceExecuteLog(this.device_code, "", "", "等待一体机进行卸货确认,设备号" + device.getDevice_code() + ",指令号" + ikey);
, paperTubePickSiteDeviceDriver.getError(), paperTubePickSiteDeviceDriver.getMode(), ikey);
LuceneLogDto logDto = LuceneLogDto.builder() LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(this.getDeviceCode()) .device_code(standardOrdinarySiteDeviceDriver.getDevice_code())
.content(message) .content("等待一体机进行卸货确认,设备号" + standardOrdinarySiteDeviceDriver.getDevice_code() + ",option当前值" + standardOrdinarySiteDeviceDriver.getOption())
.build(); .build();
logDto.setLog_level(4); logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto); luceneExecuteLogService.deviceExecuteLog(logDto);
} }
} else if (device.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) {
manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) device.getDeviceDriver();
try {
manipulatorAgvStationDeviceDriver.writing(4);
} catch (Exception e) {
e.printStackTrace();
}
if ((manipulatorAgvStationDeviceDriver.getAction() == 1)) {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(this.getDeviceCode())
.content("agvphase:" + phase + "反馈:" + data)
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
} else {
message = "设备号:" + device_code + ",动作信号:" + manipulatorAgvStationDeviceDriver.getAction() + "报警信号:" + ",指令号:" + ikey + "不满足取货条件";
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();
try {
hongXiangStationDeviceDriver.writing(1);
} catch (Exception e) {
e.printStackTrace();
}
if (hongXiangStationDeviceDriver.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 + "光电信号:" + hongXiangStationDeviceDriver.getMove() + ",动作信号:" + hongXiangStationDeviceDriver.getAction() + "报警信号:" + hongXiangStationDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件";
log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},不满足取货条件,指令号{}", device_code, hongXiangStationDeviceDriver.getMove(), hongXiangStationDeviceDriver.getAction()
, hongXiangStationDeviceDriver.getError(), ikey);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(this.getDeviceCode())
.content(message)
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
}
} else if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver();
standardInspectSiteDeviceDriver.writing(1);
if ((standardInspectSiteDeviceDriver.getMove() == 0 && standardInspectSiteDeviceDriver.getAction() == 1 && standardInspectSiteDeviceDriver.getError() == 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 + "光电信号:" + standardInspectSiteDeviceDriver.getMove() + ",动作信号:" + standardInspectSiteDeviceDriver.getAction() + "报警信号:" + standardInspectSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足放货条件";
log.info("设备{}当前光电信号{},动作信号{} ,报警信号{},不满足放货条件,指令号{}", device_code, standardInspectSiteDeviceDriver.getMove(), standardInspectSiteDeviceDriver.getAction()
, standardInspectSiteDeviceDriver.getError(), ikey);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(this.getDeviceCode())
.content(message)
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
}
} else if (device.getDeviceDriver() instanceof WasteFoilWeighingStationDriver) {
wasteFoilWeighingStationDriver = (WasteFoilWeighingStationDriver) device.getDeviceDriver();
if (wasteFoilWeighingStationDriver.getMove() == 0 && wasteFoilWeighingStationDriver.getAction() == 1
&& wasteFoilWeighingStationDriver.getError() == 0 && wasteFoilWeighingStationDriver.getMode() == 2) {
try {
Map<String, Object> map = new LinkedHashMap<>();
map.put("to_command", "4");
wasteFoilWeighingStationDriver.writing(map);
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);
} catch (Exception e) {
e.printStackTrace();
}
} else {
message = "设备号:" + device_code + "光电信号:" + wasteFoilWeighingStationDriver.getMove() + ",动作信号:" + wasteFoilWeighingStationDriver.getAction() + "报警信号:" + wasteFoilWeighingStationDriver.getError() + ",指令号:" + ikey + "不满足取货条件";
log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},设备状态{},不满足取货条件,指令号{}", device_code, wasteFoilWeighingStationDriver.getMove(), wasteFoilWeighingStationDriver.getAction()
, wasteFoilWeighingStationDriver.getError(), wasteFoilWeighingStationDriver.getMode(), ikey);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(this.getDeviceCode())
.content(message)
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
}
} else { } else {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
LuceneLogDto logDto = LuceneLogDto.builder() LuceneLogDto logDto = LuceneLogDto.builder()
@ -742,7 +393,12 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
logDto.setLog_level(4); logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto); luceneExecuteLogService.deviceExecuteLog(logDto);
} }
} else if (phase == 0x4D) { }
//放货完成
//(Itype=1/2/3,需要WCS反馈)
else if (phase == 0x09) {
if (agvaddr == 0) { if (agvaddr == 0) {
agvaddr = agvaddr_copy; agvaddr = agvaddr_copy;
} }
@ -779,55 +435,23 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
log.info("未找到指令号{}对应的指令", ikey); log.info("未找到指令号{}对应的指令", ikey);
return; return;
} }
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver(); standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver();
Region region = regionService.findByCode("1"); data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
if (ObjectUtil.isNotEmpty(device.getExtraValue().get("wait")) LuceneLogDto logDto = LuceneLogDto.builder()
&& StrUtil.equals("true", device.getExtraValue().get("wait").toString()) ) { .device_code(this.getDeviceCode())
if (StrUtil.equals(region.getIs_charge(), CommonFinalParam.ZERO)) { .content("agvphase:" + phase + "反馈:" + data)
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); .build();
LuceneLogDto logDto = LuceneLogDto.builder() logDto.setLog_level(4);
.device_code(this.getDeviceCode()) luceneExecuteLogService.deviceExecuteLog(logDto);
.content("agvphase:" + phase + "反馈:" + data) standardOrdinarySiteDeviceDriver.setAgvphase(phase);
.build(); standardOrdinarySiteDeviceDriver.setIndex(index);
logDto.setLog_level(4); standardOrdinarySiteDeviceDriver.setInst(inst);
luceneExecuteLogService.deviceExecuteLog(logDto);
if (standardOrdinarySiteDeviceDriver.getOpenCount() == 0) {
region.setIs_charge("1");
region.setHas_agv("0");
regionService.updateById(region);
standardOrdinarySiteDeviceDriver.setOpenCount(standardOrdinarySiteDeviceDriver.getOpenCount() + 1);
}
if (standardOrdinarySiteDeviceDriver.getOpenCount() == 1) {
region.setIs_charge("0");
region.setHas_agv("1");
regionService.updateById(region);
standardOrdinarySiteDeviceDriver.setOpenCount(0);
}
}else {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(this.getDeviceCode())
.content(region.getRegion_name()+"被管制!")
.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 if (phase == 0x4E) { //todo 待完善
else if (phase == 0x4D) {
if (agvaddr == 0) { if (agvaddr == 0) {
agvaddr = agvaddr_copy; agvaddr = agvaddr_copy;
} }
@ -866,40 +490,9 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
} }
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver(); //通道1
Region region = regionService.findByCode("1"); Region region = regionService.findByCode("1");
if (ObjectUtil.isNotEmpty(device.getExtraValue().get("reqWms")) if (StrUtil.equals(region.getIs_charge(), CommonFinalParam.ZERO)) {
&& StrUtil.equals("true", device.getExtraValue().get("reqWms").toString())) {
if (StrUtil.equals(region.getIs_charge(), CommonFinalParam.ZERO)) {
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.getCloseCount() == 0) {
region.setIs_charge("0");
region.setHas_agv("1");
regionService.updateById(region);
standardOrdinarySiteDeviceDriver.setOpenCount(standardOrdinarySiteDeviceDriver.getOpenCount() + 1);
}
if (standardOrdinarySiteDeviceDriver.getCloseCount() == 1) {
region.setIs_charge("1");
region.setHas_agv("0");
regionService.updateById(region);
standardOrdinarySiteDeviceDriver.setCloseCount(0);
}
}else {
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(this.getDeviceCode())
.content(region.getRegion_name()+"被管制!")
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
}
} else {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
LuceneLogDto logDto = LuceneLogDto.builder() LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(this.getDeviceCode()) .device_code(this.getDeviceCode())
@ -907,14 +500,15 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
.build(); .build();
logDto.setLog_level(4); logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto); luceneExecuteLogService.deviceExecuteLog(logDto);
region.setIs_charge("1");
region.setHas_agv("1");
regionService.updateById(region);
} }
} }
} }
//todo 待完善
//放货完成 else if (phase == 0x4E) {
//(Itype=1/2/3,需要WCS反馈)
else if (phase == 0x09) {
if (agvaddr == 0) { if (agvaddr == 0) {
agvaddr = agvaddr_copy; agvaddr = agvaddr_copy;
} }
@ -951,30 +545,9 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
log.info("未找到指令号{}对应的指令", ikey); log.info("未找到指令号{}对应的指令", ikey);
return; return;
} }
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver();
//卸货确认
if (standardOrdinarySiteDeviceDriver.getOption() == 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);
standardOrdinarySiteDeviceDriver.setOption(0);
} else {
log.info("等待一体机进行卸货确认,设备号{},option值{}", standardOrdinarySiteDeviceDriver.getDevice_code(), standardOrdinarySiteDeviceDriver.getOption());
logServer.deviceExecuteLog(this.device_code, "", "", "等待一体机进行卸货确认,设备号" + device.getDevice_code() + ",指令号" + ikey);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(standardOrdinarySiteDeviceDriver.getDevice_code())
.content("等待一体机进行卸货确认,设备号" + standardOrdinarySiteDeviceDriver.getDevice_code() + ",option当前值" + standardOrdinarySiteDeviceDriver.getOption())
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
}
} else { if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
Region region = regionService.findByCode("1");
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
LuceneLogDto logDto = LuceneLogDto.builder() LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(this.getDeviceCode()) .device_code(this.getDeviceCode())
@ -982,8 +555,13 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
.build(); .build();
logDto.setLog_level(4); logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto); luceneExecuteLogService.deviceExecuteLog(logDto);
region.setIs_charge("0");
region.setHas_agv("0");
regionService.updateById(region);
} }
} else if (phase == 0x70) { }
else if (phase == 0x70) {
//x坐标 //x坐标
x = ikey; x = ikey;
LuceneLogDto logDto = LuceneLogDto.builder() LuceneLogDto logDto = LuceneLogDto.builder()
@ -1054,21 +632,9 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
last_status = status; last_status = status;
} //进入区域(phase值) } //进入区域(phase值)
else if (phase == 0x50) { else if (phase == 0x50) {
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content("agvphase:" + phase + "自动门开门")
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
} }
//离开区域(phase值) //离开区域(phase值)
else if (phase == 0x51) { else if (phase == 0x51) {
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content("agvphase:" + phase + "自动门关门")
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
} }
//上报异常信息 //上报异常信息
//(不需要WCS反馈) //(不需要WCS反馈)

4
acs2/nladmin-system/nlsso-server/src/main/java/org/nl/hand/rest/PdaController.java

@ -88,8 +88,8 @@ public class PdaController {
} }
@PostMapping("/queryTaskIds") @PostMapping("/queryTaskIds")
@Log("查询任务") @Log("查询任务")
@ApiOperation("查询任务") @ApiOperation("查询任务")
@SaIgnore @SaIgnore
//@PreAuthorize("@el.check('sect:list')") //@PreAuthorize("@el.check('sect:list')")
public ResponseEntity<Object> queryTaskIds() throws Exception { public ResponseEntity<Object> queryTaskIds() throws Exception {

7
acs2/nladmin-system/nlsso-server/src/main/java/org/nl/hand/service/impl/PdaServiceImpl.java

@ -210,7 +210,7 @@ public class PdaServiceImpl implements PdaService {
} }
JSONObject resultJson = new JSONObject(); JSONObject resultJson = new JSONObject();
Instruction instruction = instructionService.findByTaskid(dto.getTask_id(), "instruction_status <2 "); Instruction instruction = instructionService.findByTaskid(dto.getTask_id(), "instruction_status <2 ");
if (instruction!=null){ if (instruction != null) {
resultJson.put("message", "有指令未完成!"); resultJson.put("message", "有指令未完成!");
return resultJson; return resultJson;
} }
@ -240,6 +240,7 @@ public class PdaServiceImpl implements PdaService {
JSONObject obj = arr.getJSONObject(i); JSONObject obj = arr.getJSONObject(i);
JSONObject json = new JSONObject(); JSONObject json = new JSONObject();
json.put("task_id", obj.getString("task_code")); json.put("task_id", obj.getString("task_code"));
json.put("task_name", obj.getString("task_code") + " - " + obj.getString("start_device_code") + "-->" + obj.getString("next_device_code"));
result.add(json); result.add(json);
} }
return result; return result;
@ -251,7 +252,7 @@ public class PdaServiceImpl implements PdaService {
String task_code = jsonObject.getString("task_id"); String task_code = jsonObject.getString("task_id");
JSONObject resultJson = new JSONObject(); JSONObject resultJson = new JSONObject();
TaskDto dto = taskserver.findByCode(task_code); TaskDto dto = taskserver.findByCode(task_code);
if (Integer.parseInt(dto.getTask_status())==0) { if (Integer.parseInt(dto.getTask_status()) == 0) {
try { try {
taskserver.cancel(dto.getTask_id()); taskserver.cancel(dto.getTask_id());
} catch (Exception e) { } catch (Exception e) {
@ -350,7 +351,7 @@ public class PdaServiceImpl implements PdaService {
jo.put("x", agvNdcTwoDeviceDriver.getX()); jo.put("x", agvNdcTwoDeviceDriver.getX());
jo.put("y", agvNdcTwoDeviceDriver.getY()); jo.put("y", agvNdcTwoDeviceDriver.getY());
jo.put("angle", agvNdcTwoDeviceDriver.getAngle()); jo.put("angle", agvNdcTwoDeviceDriver.getAngle());
ja.put(agvNdcTwoDeviceDriver.getDevice().getDevice_code(),jo); ja.put(agvNdcTwoDeviceDriver.getDevice().getDevice_code(), jo);
} }
backja.add(ja); backja.add(ja);
} }

2
acs2/nladmin-system/nlsso-server/src/main/resources/config/application-dev.yml

@ -10,7 +10,7 @@ spring:
driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
# url: jdbc:log4jdbc:mysql://${DB_HOST:192.168.81.252}:${DB_PORT:3306}/${DB_NAME:stand_acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true # url: jdbc:log4jdbc:mysql://${DB_HOST:192.168.81.252}:${DB_PORT:3306}/${DB_NAME:stand_acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
# url: jdbc:log4jdbc:mysql://${DB_HOST:47.111.78.178}:${DB_PORT:3306}/${DB_NAME:lzhl_two_acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true # url: jdbc:log4jdbc:mysql://${DB_HOST:47.111.78.178}:${DB_PORT:3306}/${DB_NAME:lzhl_two_acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
url: jdbc:log4jdbc:mysql://${DB_HOST:localhost}:${DB_PORT:3306}/${DB_NAME:hanguodoushan}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true url: jdbc:log4jdbc:mysql://${DB_HOST:localhost}:${DB_PORT:3306}/${DB_NAME:jinbao}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true
username: ${DB_USER:root} username: ${DB_USER:root}
# password: ${DB_PWD:Root.123456} # password: ${DB_PWD:Root.123456}

Loading…
Cancel
Save