优化0127
This commit is contained in:
@@ -198,7 +198,7 @@ public class DdjThread implements Runnable {
|
||||
}
|
||||
}
|
||||
//正常下发
|
||||
if (ddj.getYxxf() == 1 && ddj.getCzfs() == 5 && ddj.getSbzt() == 0) {
|
||||
if (ddj.getYxxf() == 1 && ddj.getCzfs() == 5 && ddj.getSbzt() == 0 ) {
|
||||
Long rwh = ddj.getRwh();
|
||||
DdjDeviceExecutionQueue ddjDeviceExecutionQueueRunningParam = new DdjDeviceExecutionQueue();
|
||||
ddjDeviceExecutionQueueRunningParam.setDdjxf("1");
|
||||
|
||||
@@ -171,7 +171,7 @@ public class Floor1BothWayOutSsjThread implements Runnable {
|
||||
MydoJob mydoJob = mydoJobService.selectMydoJobByExitList1(exitList, roadwayId);
|
||||
MydoJob inJob = mydoJobService.selectMydoJobByEntranceList1(entrance_id);
|
||||
if (ObjUtil.isNotNull(mydoJob) && deviceSsj.getKx() == 1 && ssj.getKx() == 0
|
||||
&& ObjUtil.isNull(inJob) && inOutSsj.getInOrOut() == 1 ) {
|
||||
&& ObjUtil.isNull(inJob) && inOutSsj.getInOrOut() == 1 && deviceSsj.getTaskNo() == 0) {
|
||||
//所有线体为空闲 并且存在出库作业 并且不存在入库作业
|
||||
BasCargoSpace basCargoSpace = basCargoSpaceService.selectBasCargoSpaceByWmsCargoSpaceId(mydoJob.getCargoSpaceId());
|
||||
if (ObjUtil.isNull(basCargoSpace)) {
|
||||
@@ -203,6 +203,7 @@ public class Floor1BothWayOutSsjThread implements Runnable {
|
||||
mydoJob.setStatus(TASK_STATUS_RUNNING);
|
||||
mydoJob.setExecutionPhase(TASK_EP_DDJ);
|
||||
mydoJob.setStartTime(DateUtil.formatDateTime(DateUtil.date()));
|
||||
mydoJob.setExitId(entrance_id);
|
||||
mydoJobService.updateMydoJob(mydoJob);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,36 +73,67 @@ public class Floor1SingleSsjThread implements Runnable {
|
||||
public void run() {
|
||||
init();
|
||||
while (isRun) {
|
||||
for (String type : ssjCodeList.keySet()) {
|
||||
//一楼单向巷道口
|
||||
if ("outRoadwaySsj".equals(type)) {
|
||||
for (String ssjCode : ssjCodeList.get(type)) {
|
||||
try {
|
||||
if (PlcSsjRead.deviceSsjMap.containsKey(ssjCode)) {
|
||||
dispatch(PlcSsjRead.deviceSsjMap.get(ssjCode));
|
||||
} else {
|
||||
log.error("设备不存在 ssjCode{}", ssjCode);
|
||||
}
|
||||
} catch (RuntimeException e) {
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
try {
|
||||
if (PlcSsjRead.deviceSsjMap.containsKey("L2001")) {
|
||||
dispatch(PlcSsjRead.deviceSsjMap.get("L2001"));
|
||||
} else {
|
||||
log.error("设备不存在 ssjCode{}", "L2001");
|
||||
}
|
||||
if (PlcSsjRead.deviceSsjMap.containsKey("L2007")) {
|
||||
dispatch(PlcSsjRead.deviceSsjMap.get("L2007"));
|
||||
} else {
|
||||
log.error("设备不存在 ssjCode{}", "L2007");
|
||||
}
|
||||
if (PlcSsjRead.deviceSsjMap.containsKey("L2002")) {
|
||||
dispatch2(PlcSsjRead.deviceSsjMap.get("L2002"));
|
||||
} else {
|
||||
log.error("设备不存在 ssjCode{}", "L2002");
|
||||
}
|
||||
if (PlcSsjRead.deviceSsjMap.containsKey("L2008")) {
|
||||
dispatch2(PlcSsjRead.deviceSsjMap.get("L2008"));
|
||||
} else {
|
||||
log.error("设备不存在 ssjCode{}", "L2008");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
if ("outSsj".equals(type)) {
|
||||
for (String ssjCode : ssjCodeList.get(type)) {
|
||||
try {
|
||||
if (PlcSsjRead.deviceSsjMap.containsKey(ssjCode)) {
|
||||
dispatch2(PlcSsjRead.deviceSsjMap.get(ssjCode));
|
||||
} else {
|
||||
log.error("设备不存在 ssjCode{}", ssjCode);
|
||||
}
|
||||
} catch (RuntimeException e) {
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (RuntimeException e) {
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// for (String type : ssjCodeList.keySet()) {
|
||||
// //一楼单向巷道口
|
||||
// if ("outRoadwaySsj".equals(type)) {
|
||||
// for (String ssjCode : ssjCodeList.get(type)) {
|
||||
// try {
|
||||
// if (PlcSsjRead.deviceSsjMap.containsKey(ssjCode)) {
|
||||
// dispatch(PlcSsjRead.deviceSsjMap.get(ssjCode));
|
||||
// } else {
|
||||
// log.error("设备不存在 ssjCode{}", ssjCode);
|
||||
// }
|
||||
// } catch (RuntimeException e) {
|
||||
// log.error(e.getMessage(), e);
|
||||
// }
|
||||
//
|
||||
// }
|
||||
// }
|
||||
// if ("outSsj".equals(type)) {
|
||||
// for (String ssjCode : ssjCodeList.get(type)) {
|
||||
// try {
|
||||
// if (PlcSsjRead.deviceSsjMap.containsKey(ssjCode)) {
|
||||
// dispatch2(PlcSsjRead.deviceSsjMap.get(ssjCode));
|
||||
// } else {
|
||||
// log.error("设备不存在 ssjCode{}", ssjCode);
|
||||
// }
|
||||
// } catch (RuntimeException e) {
|
||||
// log.error(e.getMessage(), e);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
try {
|
||||
Thread.sleep(1500);
|
||||
} catch (InterruptedException e) {
|
||||
@@ -149,15 +180,19 @@ public class Floor1SingleSsjThread implements Runnable {
|
||||
*/
|
||||
public void dispatch(DeviceSsj ssj) {
|
||||
//如果入库请求1 并且 托盘码不为空
|
||||
if (ssj.getKx() == 1) {
|
||||
if (ssj.getKx() == 1 && ssj.getTaskNo() == 0) {
|
||||
List<String> exitList = new ArrayList<>();
|
||||
exitList.add("1");
|
||||
String roadwayId = "";
|
||||
String entrance_id = "";
|
||||
if("L2001".equals(ssj.getDeviceCode())){
|
||||
roadwayId = "1";
|
||||
entrance_id = "L2002";
|
||||
|
||||
}
|
||||
if("L2007".equals(ssj.getDeviceCode())){
|
||||
roadwayId = "2";
|
||||
entrance_id = "L2008";
|
||||
}
|
||||
MydoJob mydoJob = mydoJobService.selectMydoJobByExitList1(exitList,roadwayId);
|
||||
if (ObjUtil.isNotNull(mydoJob)) {
|
||||
@@ -192,6 +227,7 @@ public class Floor1SingleSsjThread implements Runnable {
|
||||
mydoJob.setStatus(TASK_STATUS_RUNNING);
|
||||
mydoJob.setExecutionPhase(TASK_EP_DDJ);
|
||||
mydoJob.setStartTime(DateUtil.formatDateTime(DateUtil.date()));
|
||||
mydoJob.setExitId(entrance_id);
|
||||
mydoJobService.updateMydoJob(mydoJob);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user