优化0120

This commit is contained in:
zj
2026-01-20 16:45:46 +08:00
parent 6c2d8fcb0f
commit d2d871baf1
26 changed files with 335 additions and 226 deletions

View File

@@ -197,7 +197,7 @@ public class PlcSsjRead implements Runnable {
// }
}
}
OperateResultExOne<byte[]> agvSsjTask = readWriteNet.Read("DB501.280", Short.parseShort("8"));
OperateResultExOne<byte[]> agvSsjTask = readWriteNet.Read("DB501.280", Short.parseShort("16"));
String ddsx2 = "0";
if (agvSsjTask.IsSuccess) {
ddsx2 = SoftBasic.ByteToHexString(agvSsjTask.Content);
@@ -207,6 +207,12 @@ public class PlcSsjRead implements Runnable {
if("L1003".equals(ssjDevice.getDeviceCode())){
ssjDevice.setTaskNo2(ParseUtil.optDInt(4, ddsx2));
}
if("L2004".equals(ssjDevice.getDeviceCode())){
ssjDevice.setTaskNo2(ParseUtil.optDInt(8, ddsx2));
}
if("L2006".equals(ssjDevice.getDeviceCode())){
ssjDevice.setTaskNo2(ParseUtil.optDInt(12, ddsx2));
}
}
}
}

View File

@@ -53,9 +53,9 @@ public class Floor1BothWayOutSsjThread implements Runnable {
roadway2.add(PlcSsjRead.deviceSsjMap.get("L2005"));
ssjCodeList.put("roadway2", roadway2);
ArrayList<DeviceSsj> ou1 = new ArrayList<>();
ou1.add(PlcSsjRead.deviceSsjMap.get("L2004"));
ssjCodeList.put("ou1", ou1);
ArrayList<DeviceSsj> out1 = new ArrayList<>();
out1.add(PlcSsjRead.deviceSsjMap.get("L2004"));
ssjCodeList.put("out1", out1);
ArrayList<DeviceSsj> out2 = new ArrayList<>();
out2.add(PlcSsjRead.deviceSsjMap.get("L2006"));
ssjCodeList.put("out2", out2);
@@ -87,10 +87,14 @@ public class Floor1BothWayOutSsjThread implements Runnable {
switch (type) {
case "roadway1":
dispatch(ssjCodeList.get(type));
break;
case "roadway2":
dispatch(ssjCodeList.get(type));
break;
case "out1":
dispatch1(ssjCodeList.get(type));
break;
case "out2":
dispatch1(ssjCodeList.get(type));
break;
@@ -109,9 +113,9 @@ public class Floor1BothWayOutSsjThread implements Runnable {
private void dispatch1(List<DeviceSsj> ssjList) {
for (DeviceSsj ssj : ssjList) {
if (ssj.getTaskNo() > 0) {
MydoJob mydoJob = mydoJobService.selectMydoJobByTaskNo(Convert.toLong(ssj.getTaskNo()));
if(Convert.toInt(mydoJob.getInOrOut()) > 20){
if (ssj.getTaskNo2() > 0) {
MydoJob mydoJob = mydoJobService.selectMydoJobByTaskNo(Convert.toLong(ssj.getTaskNo2()));
if(mydoJob != null && Convert.toInt(mydoJob.getInOrOut()) > 20){
if (ObjUtil.isNotNull(mydoJob) && mydoJob.getExecutionPhase().equals(TASK_EP_ROADWAY_SSJ)) {
mydoJob.setExecutionPhase(TASK_EP_SSJ);
mydoJobService.updateMydoJob(mydoJob);
@@ -145,18 +149,21 @@ public class Floor1BothWayOutSsjThread implements Runnable {
public void dispatch(List<DeviceSsj> ssjList) {
DeviceSsj deviceSsj = ssjList.get(0);
DeviceSsj ssj = new DeviceSsj();
DeviceSsj inOutSsj = new DeviceSsj();
String roadwayId = "";
String entrance_id = "";
if ("L2003".equals(deviceSsj.getDeviceCode())) {
roadwayId = "1";
ssj = ssjCodeList.get("roadway1Both").get(0);
entrance_id = "L2004";
inOutSsj = PlcSsjRead.deviceSsjMap.get("L2004");
}
if("L2005".equals(deviceSsj.getDeviceCode())) {
roadwayId = "2";
ssj = ssjCodeList.get("roadway2Both").get(0);
entrance_id = "L2006";
inOutSsj = PlcSsjRead.deviceSsjMap.get("L2006");
}
List<String> exitList = new ArrayList<>();
@@ -164,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) && ssj.getInOrOut() == 1) {
&& ObjUtil.isNull(inJob) && inOutSsj.getInOrOut() == 1 ) {
//所有线体为空闲 并且存在出库作业 并且不存在入库作业
BasCargoSpace basCargoSpace = basCargoSpaceService.selectBasCargoSpaceByWmsCargoSpaceId(mydoJob.getCargoSpaceId());
if (ObjUtil.isNull(basCargoSpace)) {

View File

@@ -120,7 +120,7 @@ public class Floor1SingleSsjThread implements Runnable {
private void dispatch2(DeviceSsj ssj) {
if (ssj.getTaskNo() > 0) {
MydoJob mydoJob = mydoJobService.selectMydoJobByTaskNo(Convert.toLong(ssj.getTaskNo()));
if (ObjUtil.isNotNull(mydoJob)) {
if (ObjUtil.isNotNull(mydoJob) && Convert.toInt(mydoJob.getInOrOut()) > 20) {
mydoJob.setExecutionPhase(TASK_EP_SSJ);
mydoJobService.updateMydoJob(mydoJob);
JobCallBack jobCallBack = new JobCallBack();

View File

@@ -97,7 +97,7 @@ public class Floor2InOutSsjThread implements Runnable {
//agvQueue.setStatus("4");
//todo 与agv对点
agvQueue.setPositionCode2(inSsjDevice.getDeviceCode());
List<AgvQueue> agvQueues = agvQueueService.selectAgvQueueList(agvQueue);
List<AgvQueue> agvQueues = agvQueueService.selectAgvQueueList1(agvQueue);
//不允许放货 等着
if (!agvQueues.isEmpty() && inSsjDevice.getAllowPut() == 0 && "L1001".equals(inSsjDevice.getDeviceCode())) {
//下发输送线切换导向 DB未知
@@ -131,7 +131,7 @@ public class Floor2InOutSsjThread implements Runnable {
agvQueue.setStatus("7"); //end
//todo 与agv对点
agvQueue.setPositionCode2(inSsjDevice.getDeviceCode());
List<AgvQueue> agvQueues = agvQueueService.selectAgvQueueList(agvQueue);
List<AgvQueue> agvQueues = agvQueueService.selectAgvQueueList1(agvQueue);
if (!agvQueues.isEmpty()) {
//解绑AGV容器
apiService.deleteAgvTray(agvQueues.get(0));
@@ -162,7 +162,7 @@ public class Floor2InOutSsjThread implements Runnable {
agvQueue.setStatus("7"); //end
//todo 与agv对点
agvQueue.setPositionCode2(inSsjDevice.getDeviceCode());
List<AgvQueue> agvQueues = agvQueueService.selectAgvQueueList(agvQueue);
List<AgvQueue> agvQueues = agvQueueService.selectAgvQueueList1(agvQueue);
if(agvQueues.size() > 0){
MydoJob mydoJob = mydoJobService.selectMydoJobByJobId(agvQueues.get(0).getTaskCode());
mydoJob.setExecutionPhase(TASK_EP_SSJ);

View File

@@ -133,10 +133,10 @@ public class Floor2RoadWaySsjThread implements Runnable {
if(roadSsjDevice.getKx()==1 && roadSsjDevice.getTaskNo() == 0){
List<String> exitList = new ArrayList<>();
if("L1002".equals(roadSsjDevice.getDeviceCode())){
exitList.add("l1001");
exitList.add("L1001");
}
if("L1004".equals(roadSsjDevice.getDeviceCode())){
exitList.add("l1003");
exitList.add("L1003");
}
List<MydoJob> inList = mydoJobService.getInJobByEntrance(exitList);
if(inList.size() == 0){

View File

@@ -241,10 +241,10 @@ public class LineSsjThread implements Runnable {
//log.info("设备:{} 位置:{} 条码:{} 托盘大小:{}", SsjDevice.getDeviceCode(), "产线收到wcs任务号", SsjDevice.getTrayCode(), SsjDevice.getTraySize());
//任务号查wcs作业,查巷道,看目标输送线是否空闲,查是否有出库作业,生成agv队列
MydoJob mydoJob = mydoJobService.selectMydoJobByTaskNo(Convert.toLong(SsjDevice.getTaskNo()));
String deviceCode = "";
if (mydoJob != null) {
if ("1".equals(mydoJob.getRoadwayId())) {
deviceCode = "L1001";
} else {