This commit is contained in:
张怡蓉
2025-12-12 11:30:01 +08:00
parent b58f025d13
commit b270075760

View File

@@ -111,13 +111,6 @@ public class Floor2InOutSsjThread implements Runnable {
agvQueue.setPositionCode2(inSsjDevice.getDeviceCode());
List<AgvQueue> agvQueues = agvQueueService.selectAgvQueueList(agvQueue);
//不允许放货 等着
// if (!agvQueues.isEmpty() && inSsjDevice.getAllowPut() == 0) {
//如果有这个输送机口的agv队列并请求放货(状态为6)
// int i = writeToSsj(inSsjDevice.getPlcDbWriteAddress(), "0", Integer.parseInt(agvQueues.get(0).getCtnrType()),1);
// if (i == 1) {
// log.info(inSsjDevice.getDeviceCode() + "输送机下发请求放货异常成功");
// }
// }
//允许放货
if (!agvQueues.isEmpty() && inSsjDevice.getAllowPut() == 1) {
log.info("设备:{} 位置:{} 任务号:{} 请求放货成功", inSsjDevice.getDeviceCode(), "输送线", agvQueues.get(0).getTaskCode());
@@ -140,14 +133,23 @@ public class Floor2InOutSsjThread implements Runnable {
int i = writeToSsj(inSsjDevice.getPlcDbWriteAddress(), agvQueues.get(0).getWmsTaskNo(), 1,1);
if (i == 1) {
log.info("输送机{}下发任务号{}成功", inSsjDevice.getDeviceCode(), agvQueues.get(0).getWmsTaskNo());
}
}
}
if(inSsjDevice.getKx() == 0 && inSsjDevice.getTaskNo() > 0){
AgvQueue agvQueue = new AgvQueue();
agvQueue.setStatus("7"); //end
//todo 与agv对点
agvQueue.setPositionCode2(inSsjDevice.getDeviceCode());
List<AgvQueue> agvQueues = agvQueueService.selectAgvQueueList(agvQueue);
MydoJob mydoJob = mydoJobService.selectMydoJobByJobId(agvQueues.get(0).getTaskCode());
mydoJob.setExecutionPhase(TASK_EP_SSJ);
mydoJobService.updateMydoJob(mydoJob);
agvQueueService.insertHistory(agvQueues.get(0).getReqCode());
agvQueueService.deleteAgvQueueByReqCode(agvQueues.get(0).getReqCode());
}
}
}
//出库到位
if (inSsjDevice.getDw() == 1 && inSsjDevice.getTaskNo() > 0) {
@@ -182,18 +184,22 @@ public class Floor2InOutSsjThread implements Runnable {
if (i == 1) {
log.info(ssjDevice.getDeviceCode()+"有正执行的出库作业退回" );
}
return;
}
MydoJob mydoJob = new MydoJob();
mydoJob.setInOrOut("1");
// mydoJob.setStatus("1");
mydoJob.setEntranceId(ssjDevice.getDeviceCode());
// mydoJob.setExecutionPhase("0");
String[] split = ssjDevice.getTrayCode().split(" ");
String serial = split[2].substring(7);
mydoJob.setTrayCode(serial);
mydoJob.setFlag("1");
List<MydoJob> mydoJobs = mydoJobService.selectMydoJobList(mydoJob);
if(!mydoJobs.isEmpty()){
MydoJob mydoJob1 = mydoJobs.get(0);
if(mydoJob1.getStatus().equals("1") && mydoJob1.getExecutionPhase().equals("0")){
int i = writeToSsj(ssjDevice.getPlcDbWriteAddress(),mydoJob1.getTaskNo(),1,1);
if (i == 1) {
mydoJob1.setExecutionPhase(TASK_EP_SSJ);
@@ -201,7 +207,7 @@ public class Floor2InOutSsjThread implements Runnable {
mydoJobService.updateMydoJob(mydoJob1);
log.info(ssjDevice.getDeviceCode()+"输送机下发任务号成功:{}" , mydoJob1.getTaskNo());
}
}
}else{
HashMap<String, Object> map = new HashMap<>();
@@ -217,6 +223,7 @@ public class Floor2InOutSsjThread implements Runnable {
int i = writeToSsj(ssjDevice.getPlcDbWriteAddress(),mydoJob2.getTaskNo(),1,1);
if (i == 1) {
mydoJob2.setExecutionPhase(TASK_EP_SSJ);
mydoJob2.setStatus("3");
mydoJobService.updateMydoJob(mydoJob2);
log.info(ssjDevice.getDeviceCode()+"输送机下发任务号成功:{}" , mydoJob2.getTaskNo());
}