产线入库流程修改
This commit is contained in:
@@ -92,7 +92,7 @@ public class Ddj1Thread implements Runnable {
|
||||
Long rwh = ddj.getRwh();
|
||||
//完成作业
|
||||
MydoJob mydoJob = mydoJobService.selectMydoJobByTaskNo(rwh);
|
||||
DdjDeviceExecutionQueue ddjDeviceExecutionQueue = ddjDeviceExecutionQueueService.selectDdjDeviceExecutionQueueByRwh(rwh);
|
||||
DdjDeviceExecutionQueue ddjDeviceExecutionQueue = ddjDeviceExecutionQueueService.selectDdjDeviceExecutionQueueByRwh(rwh,ddj.getId());
|
||||
if (mydoJob != null && ddjDeviceExecutionQueue != null) {
|
||||
//回传完成信号
|
||||
ddjTaskFinish(rwh, ddj.getId());
|
||||
@@ -106,7 +106,7 @@ public class Ddj1Thread implements Runnable {
|
||||
if (ddj.getCzfs() == 5 && ddj.getSbzt() == 1 && (ddj.getJdbz() == 2 || ddj.getJdbz() == 3 || ddj.getJdbz() == 4)) {
|
||||
//根据堆垛机上任务号,修改任务执行阶段
|
||||
Long rwh = ddj.getRwh();
|
||||
DdjDeviceExecutionQueue ddjDeviceExecutionQueue = ddjDeviceExecutionQueueService.selectDdjDeviceExecutionQueueByRwh(rwh);
|
||||
DdjDeviceExecutionQueue ddjDeviceExecutionQueue = ddjDeviceExecutionQueueService.selectDdjDeviceExecutionQueueByRwh(rwh, ddj.getId());
|
||||
if (ddjDeviceExecutionQueue != null) {
|
||||
//修改队列执行阶段
|
||||
ddjDeviceExecutionQueue.setRwzt(ddj.getJdbz());
|
||||
@@ -140,7 +140,7 @@ public class Ddj1Thread implements Runnable {
|
||||
if (ddj.getCzfs() == 5 && ddj.getSbzt() == 1053 && ddj.getJdbz() < 5) {
|
||||
Long rwh = ddj.getRwh();
|
||||
//无货异常处理
|
||||
DdjDeviceExecutionQueue ddjDeviceExecutionQueue = ddjDeviceExecutionQueueService.selectDdjDeviceExecutionQueueByRwh(rwh);
|
||||
DdjDeviceExecutionQueue ddjDeviceExecutionQueue = ddjDeviceExecutionQueueService.selectDdjDeviceExecutionQueueByRwh(rwh,ddj.getId());
|
||||
//找到对应任务 调用api接口 取货无货,重新分配单据
|
||||
if (ObjUtil.isNotNull(ddjDeviceExecutionQueue)) {
|
||||
AjaxResult ajaxResult = apiService.reMaterial(new JobParam(rwh.toString(), null, null));
|
||||
@@ -161,7 +161,7 @@ public class Ddj1Thread implements Runnable {
|
||||
MydoJob mydoJob = mydoJobService.selectMydoJobByTaskNo(rwh);
|
||||
if (ObjUtil.isNotNull(mydoJob) && "2".equals(mydoJob.getFaultFlag())) {
|
||||
//判断任务是否重分完成
|
||||
DdjDeviceExecutionQueue ddjDeviceExecutionQueue = ddjDeviceExecutionQueueService.selectDdjDeviceExecutionQueueByRwh(rwh);
|
||||
DdjDeviceExecutionQueue ddjDeviceExecutionQueue = ddjDeviceExecutionQueueService.selectDdjDeviceExecutionQueueByRwh(rwh,ddj.getId());
|
||||
if (ObjUtil.isNotNull(ddjDeviceExecutionQueue)) {
|
||||
//重新下发堆垛机任务
|
||||
int i = issuedDDJTask(ddj.getId(), ddjDeviceExecutionQueue);
|
||||
|
||||
@@ -1,21 +1,17 @@
|
||||
package com.ruoyi.schedule.scheduleTask.ssj.floor2;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.util.ObjUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.ruoyi.api.domain.agv.genAgvSchedulingTask.GenAgvSchedulingTaskResponse;
|
||||
import com.ruoyi.api.service.IApiService;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.domain.SendData;
|
||||
import com.ruoyi.common.utils.spring.SpringUtils;
|
||||
import com.ruoyi.device.ssj.domain.DeviceSsj;
|
||||
import com.ruoyi.job.domain.JobCallBack;
|
||||
import com.ruoyi.job.domain.MydoJob;
|
||||
import com.ruoyi.job.service.IJobCallBackService;
|
||||
import com.ruoyi.job.service.IMydoJobService;
|
||||
import com.ruoyi.queue.agv.domain.AgvQueue;
|
||||
import com.ruoyi.queue.agv.service.IAgvQueueService;
|
||||
import com.ruoyi.device.ssj.domain.DeviceSsj;
|
||||
import com.ruoyi.schedule.plcRead.ssj.PlcSsjRead;
|
||||
import com.ruoyi.schedule.plcRead.util.Tools;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -98,7 +94,7 @@ public class Floor2InSsjThread implements Runnable {
|
||||
agvQueue.setPositionCode2(inSsjDevice.getDeviceCode());
|
||||
List<AgvQueue> agvQueues = agvQueueService.selectAgvQueueList(agvQueue);
|
||||
//不允许放货
|
||||
if(agvQueues.size()!=0 && inSsjDevice.getAllowPut()==0){
|
||||
if(!agvQueues.isEmpty() && inSsjDevice.getAllowPut()==0){
|
||||
//如果有这个输送机口的agv队列并请求放货(状态为6)
|
||||
int i = writeToSsj(inSsjDevice.getPlcDbWriteAddress(),"0",Integer.valueOf(agvQueues.get(0).getCtnrType()),1);
|
||||
if(i==1){
|
||||
@@ -106,7 +102,7 @@ public class Floor2InSsjThread implements Runnable {
|
||||
}
|
||||
}
|
||||
//允许放货
|
||||
if(agvQueues.size()!=0 && inSsjDevice.getAllowPut()==1 ){
|
||||
if(!agvQueues.isEmpty() && inSsjDevice.getAllowPut()==1 ){
|
||||
log.info("设备:{} 位置:{} 任务号:{} 请求放货成功", inSsjDevice.getDeviceCode(), "输送线", agvQueues.get(0).getTaskCode());
|
||||
AjaxResult ajaxResult = apiService.continueTask(agvQueues.get(0));
|
||||
if(ajaxResult.isSuccess()) {
|
||||
@@ -117,14 +113,14 @@ public class Floor2InSsjThread implements Runnable {
|
||||
}
|
||||
|
||||
}
|
||||
//入库下发输送线
|
||||
//入库下发输送线
|
||||
if(inSsjDevice.getKx()==0 && inSsjDevice.getTaskNo()==0){
|
||||
AgvQueue agvQueue = new AgvQueue();
|
||||
agvQueue.setStatus("7"); //end
|
||||
agvQueue.setPositionCode2(inSsjDevice.getDeviceCode());
|
||||
List<AgvQueue> agvQueues = agvQueueService.selectAgvQueueList(agvQueue);
|
||||
if(agvQueues.size()!=0) {
|
||||
int i = writeToSsj(inSsjDevice.getPlcDbWriteAddress(), agvQueue.getWmsTaskNo(), 1, 1);
|
||||
if(!agvQueues.isEmpty()) {
|
||||
int i = writeToSsj(inSsjDevice.getPlcDbWriteAddress(), agvQueues.get(0).getWmsTaskNo(), 1, 1);
|
||||
if (i == 1) {
|
||||
log.info(inSsjDevice.getDeviceCode() + "输送机下发任务号成功");
|
||||
MydoJob mydoJob = mydoJobService.selectMydoJobByJobId(agvQueues.get(0).getTaskCode());
|
||||
@@ -136,7 +132,7 @@ public class Floor2InSsjThread implements Runnable {
|
||||
}
|
||||
|
||||
}
|
||||
//出库到位
|
||||
//出库到位
|
||||
if(inSsjDevice.getDw()==1 && inSsjDevice.getTaskNo()>0){
|
||||
|
||||
MydoJob mydoJob = mydoJobService.selectMydoJobByTaskNo(Convert.toLong(inSsjDevice.getTaskNo()));
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
package com.ruoyi.schedule.scheduleTask.ssj.floor2;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import com.ruoyi.api.domain.agv.continueTask.ContinueTaskResponse;
|
||||
import com.ruoyi.api.service.IApiService;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.domain.SendData;
|
||||
@@ -17,6 +16,7 @@ import com.ruoyi.schedule.plcRead.util.Tools;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
@@ -101,7 +101,7 @@ public class LineSsjThread implements Runnable {
|
||||
mydoJob = mydoJobs.get(0);
|
||||
int i = writeToSsj(SsjDevice.getPlcDbWriteAddress(),mydoJob.getTaskNo(),1,1);
|
||||
if (i == 1) {
|
||||
mydoJob.setExecutionPhase(TASK_EP_AGV);
|
||||
//mydoJob.setExecutionPhase(TASK_EP_AGV);
|
||||
mydoJobService.updateMydoJob(mydoJob);
|
||||
log.info("G1005产线输送机下发任务号成功:" + mydoJob.getTaskNo());
|
||||
}
|
||||
@@ -118,11 +118,15 @@ public class LineSsjThread implements Runnable {
|
||||
AjaxResult ajaxResult = apiService.createInMydoJob(paramMap);
|
||||
if (ajaxResult.isSuccess()) {
|
||||
//拿到正常作业,插到wcs作业表,下发给输送机任务号,覆盖任务号
|
||||
MydoJob mydoJob2 = (MydoJob) ajaxResult.get("data");
|
||||
MydoJob mydoJob2 = BeanUtil.toBean(ajaxResult.get("data"), MydoJob.class) ;
|
||||
mydoJob2.setStatus("1");
|
||||
mydoJob2.setExecutionPhase("0");
|
||||
mydoJob2.setCreateTime(new Date());
|
||||
|
||||
mydoJobService.insertMydoJob(mydoJob2);
|
||||
int i = writeToSsj(SsjDevice.getPlcDbWriteAddress(),mydoJob2.getTaskNo(),1,1);
|
||||
if (i == 1) {
|
||||
mydoJob2.setExecutionPhase("1");
|
||||
//mydoJob2.setExecutionPhase("1");
|
||||
mydoJobService.updateMydoJob(mydoJob2);
|
||||
log.info("G1005产线输送机下发任务号成功:" + mydoJob2.getTaskNo());
|
||||
}
|
||||
@@ -155,7 +159,6 @@ public class LineSsjThread implements Runnable {
|
||||
mydoJob = mydoJobs.get(0);
|
||||
int i = writeToSsj(SsjDevice.getPlcDbWriteAddress(),mydoJob.getTaskNo(),1,1);
|
||||
if (i == 1) {
|
||||
mydoJob.setExecutionPhase("1");
|
||||
mydoJobService.updateMydoJob(mydoJob);
|
||||
log.info("G1005产线输送机下发任务号成功:" + mydoJob.getTaskNo());
|
||||
}
|
||||
@@ -207,31 +210,33 @@ public class LineSsjThread implements Runnable {
|
||||
List<MydoJob> mydoJob2 = mydoJobService.selectInOrOutMydoJobList(mydoJob1);
|
||||
|
||||
|
||||
if (mydoJob2.size() == 0 && kx == 1) {
|
||||
if (mydoJob2.isEmpty() && kx == 1) {
|
||||
//查是否有队列,如果有了请求放货修改为允许放货
|
||||
AgvQueue agvQueue = agvQueueService.selectAgvQueueByTaskCode(mydoJob.getJobId());
|
||||
if (agvQueue != null && "1".equals(agvQueue.getStatus()) && "3".equals(mydoJob.getStatus()) ) {
|
||||
|
||||
AjaxResult ajaxResult = apiService.continueTask(agvQueue);
|
||||
if (ajaxResult.isSuccess()) {
|
||||
log.info("给agv下发允许取货继续任务成功"+agvQueue.getWmsTaskNo());
|
||||
agvQueue.setStatus("2");
|
||||
agvQueueService.updateAgvQueue(agvQueue);
|
||||
}
|
||||
|
||||
} else if("1".equals(mydoJob.getStatus()) && agvQueue==null){
|
||||
HashMap<String, String> paramMap = new HashMap<>();
|
||||
paramMap.put("trayCode", mydoJob.getTrayCode());
|
||||
paramMap.put("taskNo", mydoJob.getJobId());
|
||||
paramMap.put("startPoint", "G1005");
|
||||
paramMap.put("endPoint", deviceCode);
|
||||
paramMap.put("traySize",String.valueOf(SsjDevice.getTraySize()));
|
||||
paramMap.put("wmstaskNo",mydoJob.getTaskNo());
|
||||
AjaxResult ajaxResult = apiService.receiveAgvMoveJob(paramMap);
|
||||
if (ajaxResult.isSuccess()) {
|
||||
mydoJob.setStatus("3");
|
||||
mydoJob.setExecutionPhase("2");
|
||||
mydoJobService.updateMydoJob(mydoJob);
|
||||
if (agvQueue != null){
|
||||
if ("3".equals(mydoJob.getStatus()) && "1".equals(agvQueue.getStatus())){
|
||||
AjaxResult ajaxResult = apiService.continueTask(agvQueue);
|
||||
if (ajaxResult.isSuccess()) {
|
||||
log.info("给agv下发允许取货继续任务成功"+agvQueue.getWmsTaskNo());
|
||||
agvQueue.setStatus("2");
|
||||
agvQueueService.updateAgvQueue(agvQueue);
|
||||
}
|
||||
}
|
||||
}else {
|
||||
if ("1".equals(mydoJob.getStatus())){
|
||||
HashMap<String, String> paramMap = new HashMap<>();
|
||||
paramMap.put("trayCode", mydoJob.getTrayCode());
|
||||
paramMap.put("taskNo", mydoJob.getJobId());
|
||||
paramMap.put("startPoint", "G1005");
|
||||
paramMap.put("endPoint", deviceCode);
|
||||
paramMap.put("traySize",String.valueOf(SsjDevice.getTraySize()));
|
||||
paramMap.put("wmstaskNo",mydoJob.getTaskNo());
|
||||
AjaxResult ajaxResult = apiService.receiveAgvMoveJob(paramMap);
|
||||
if (ajaxResult.isSuccess()) {
|
||||
mydoJob.setStatus("3");
|
||||
mydoJob.setExecutionPhase(TASK_EP_AGV);
|
||||
mydoJobService.updateMydoJob(mydoJob);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user