流利架出库逻辑
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package com.ruoyi.api.service;
|
||||
|
||||
import com.ruoyi.api.domain.RequestLog;
|
||||
import com.ruoyi.api.domain.agv.agvCallback.AgvCallbackRequest;
|
||||
import com.ruoyi.api.domain.agv.agvCallback.AgvCallbackResponse;
|
||||
import com.ruoyi.api.domain.agv.cancelTask.CancelTaskRequest;
|
||||
@@ -12,6 +13,7 @@ import com.ruoyi.api.domain.wcs2wms.MydoJob;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 接口记录Service接口
|
||||
@@ -82,4 +84,6 @@ public interface IApiService
|
||||
* @return
|
||||
*/
|
||||
AjaxResult agvMoveJob(GenAgvSchedulingTaskRequest genAgvSchedulingTaskRequest);
|
||||
|
||||
RequestLog finishMydoJob(String agvFinishUrl, String point, Map<String, Object> param);
|
||||
}
|
||||
|
||||
@@ -108,6 +108,11 @@ public class ApiServiceImpl implements IApiService {
|
||||
return AjaxResult.error(genAgvSchedulingTaskResponse.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public RequestLog finishMydoJob(String agvFinishUrl, String endPoint, Map<String, Object> param) {
|
||||
return requestLogService.getRequestLog(AGV_FINISH_URL, "agv任务完成", JSONUtil.toJsonStr(param));
|
||||
}
|
||||
|
||||
|
||||
private void agvCallbackInfo(AgvCallbackRequest request) {
|
||||
String taskCode = request.getTaskCode();
|
||||
@@ -134,9 +139,8 @@ public class ApiServiceImpl implements IApiService {
|
||||
agvQueueService.updateAgvQueue(agvQueue);
|
||||
//通知wms agv搬运阶段完成
|
||||
Map<String, Object> param = new HashMap<>();
|
||||
param.put("task_no", agvQueue.getWmsTaskNo());
|
||||
param.put("tray_code", agvQueue.getWmsTraycode());
|
||||
param.put("wms_type", agvQueue.getWmsTaskType());
|
||||
|
||||
param.put("wmsType", agvQueue.getWmsTaskType());
|
||||
if ("1".equals(agvQueue.getWmsTaskType()) || "2".equals(agvQueue.getWmsTaskType())){
|
||||
//通知wms 任务结束
|
||||
MydoJob mydoJobParam = new MydoJob();
|
||||
@@ -145,7 +149,8 @@ public class ApiServiceImpl implements IApiService {
|
||||
List<MydoJob> mydoJobList = getMydoJobList(mydoJobParam);
|
||||
if (CollUtil.isNotEmpty(mydoJobList)) {
|
||||
MydoJob mydoJob = mydoJobList.get(0);
|
||||
|
||||
param.put("taskNo", agvQueue.getWmsTaskNo());
|
||||
param.put("trayCode", agvQueue.getWmsTraycode());
|
||||
if (Convert.toInt(mydoJob.getInOrOut()) < 20) {
|
||||
//入库任务 暂无特殊逻辑
|
||||
RequestLog requestLog = requestLogService.getRequestLog(AGV_FINISH_URL, "agv任务完成", JSONUtil.toJsonStr(param));
|
||||
@@ -154,7 +159,7 @@ public class ApiServiceImpl implements IApiService {
|
||||
agvQueueService.insertHistory(agvQueue.getReqCode());
|
||||
//删除队列
|
||||
agvQueueService.deleteAgvQueueByReqCode(agvQueue.getReqCode());
|
||||
log.info("【AGV任务结束】任务号:{}", taskCode);
|
||||
log.info("【AGV入库任务结束】任务号:{}", taskCode);
|
||||
|
||||
}
|
||||
} else {
|
||||
@@ -166,15 +171,11 @@ public class ApiServiceImpl implements IApiService {
|
||||
//写入信息 取货完成
|
||||
int i = PlcRead.WriteToSSJ(deviceSsj.getPlcDbWriteAddress(), bytes);
|
||||
if (i==1){
|
||||
RequestLog requestLog = requestLogService.getRequestLog(AGV_FINISH_URL, "agv任务完成", JSONUtil.toJsonStr(param));
|
||||
if ("1".equals(requestLog.getIsSuccessful())){
|
||||
//插入历史
|
||||
agvQueueService.insertHistory(agvQueue.getReqCode());
|
||||
//删除队列
|
||||
agvQueueService.deleteAgvQueueByReqCode(agvQueue.getReqCode());
|
||||
log.info("【AGV任务结束】任务号:{}", taskCode);
|
||||
|
||||
}
|
||||
//插入历史
|
||||
agvQueueService.insertHistory(agvQueue.getReqCode());
|
||||
//删除队列
|
||||
agvQueueService.deleteAgvQueueByReqCode(agvQueue.getReqCode());
|
||||
log.info("【AGV出库任务结束】任务号:{}", taskCode);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -182,6 +183,10 @@ public class ApiServiceImpl implements IApiService {
|
||||
log.info("【AGV任务结束】任务号:{},wms不存在对应的作业", taskCode);
|
||||
}
|
||||
}else if ("3".equals(agvQueue.getWmsTaskType())){
|
||||
param.put("positionCode1", agvQueue.getPositionCode1());
|
||||
param.put("positionCode2", agvQueue.getPositionCode2());
|
||||
param.put("containerCode", agvQueue.getWmsTraycode());
|
||||
|
||||
//绑定点位和料架
|
||||
RequestLog requestLog = requestLogService.getRequestLog(AGV_FINISH_URL, "agv任务完成", JSONUtil.toJsonStr(param));
|
||||
if ("1".equals(requestLog.getIsSuccessful())){
|
||||
@@ -196,6 +201,12 @@ public class ApiServiceImpl implements IApiService {
|
||||
break;
|
||||
case "cancel":
|
||||
//任务单取消
|
||||
agvQueue.setStatus("5");
|
||||
agvQueueService.updateAgvQueue(agvQueue);
|
||||
//插入历史
|
||||
agvQueueService.insertHistory(agvQueue.getReqCode());
|
||||
//删除队列
|
||||
agvQueueService.deleteAgvQueueByReqCode(agvQueue.getReqCode());
|
||||
log.info("【AGV任务单取消】任务号:{}", taskCode);
|
||||
break;
|
||||
case "apply":
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.ruoyi.schedule.scheduleTask.ssj.bs;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.ruoyi.bas.fluent.domain.BasFluentFrame;
|
||||
import com.ruoyi.bas.fluent.service.IBasFluentFrameService;
|
||||
import com.ruoyi.common.utils.spring.SpringUtils;
|
||||
import com.ruoyi.device.agv.domain.AgvQueue;
|
||||
import com.ruoyi.device.agv.service.IAgvQueueService;
|
||||
@@ -27,6 +29,7 @@ public class BsOutSsjThread implements Runnable {
|
||||
|
||||
private IApiService apiService;
|
||||
private IAgvQueueService agvQueueService;
|
||||
private IBasFluentFrameService basFluentFrameService;
|
||||
|
||||
public boolean isRun = true;
|
||||
|
||||
@@ -37,9 +40,14 @@ public class BsOutSsjThread implements Runnable {
|
||||
ssjCodes.add("G1004");
|
||||
ssjCodes.add("G1010");
|
||||
ssjCodeList.put("ssjOut", ssjCodes);
|
||||
ArrayList<String> fluentOut = new ArrayList<>();
|
||||
fluentOut.add("fluent1");
|
||||
fluentOut.add("fluent2");
|
||||
ssjCodeList.put("fluentOut", fluentOut);
|
||||
|
||||
apiService = SpringUtils.getBean(IApiService.class);
|
||||
agvQueueService = SpringUtils.getBean(IAgvQueueService.class);
|
||||
basFluentFrameService = SpringUtils.getBean(IBasFluentFrameService.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -102,7 +110,6 @@ public class BsOutSsjThread implements Runnable {
|
||||
MydoJob mydoJobParam = new MydoJob();
|
||||
mydoJobParam.setTaskNo(queue.getWmsTaskNo());
|
||||
mydoJobParam.setTrayCode(queue.getWmsTraycode());
|
||||
mydoJobParam.setCargoSpaceId(queue.getPositionCode1());
|
||||
List<MydoJob> mydoJobList = apiService.getMydoJobList(mydoJobParam);
|
||||
if (CollUtil.isNotEmpty(mydoJobList)){
|
||||
MydoJob mydoJob = mydoJobList.get(0);
|
||||
@@ -122,7 +129,27 @@ public class BsOutSsjThread implements Runnable {
|
||||
* @param outSsjDevice
|
||||
*/
|
||||
public void fluentOutDispatch(String outSsjDevice) {
|
||||
//查询流利架货位是否
|
||||
//查询对应的作业
|
||||
AgvQueue agvQueue = new AgvQueue();
|
||||
agvQueue.setPositionCode2(outSsjDevice);
|
||||
agvQueue.setStatus("0");
|
||||
List<AgvQueue> agvQueueList = agvQueueService.selectAgvQueueList(agvQueue);
|
||||
for (AgvQueue queue : agvQueueList) {
|
||||
MydoJob mydoJobParam = new MydoJob();
|
||||
mydoJobParam.setTaskNo(queue.getWmsTaskNo());
|
||||
mydoJobParam.setTrayCode(queue.getWmsTraycode());
|
||||
List<MydoJob> mydoJobList = apiService.getMydoJobList(mydoJobParam);
|
||||
if (CollUtil.isNotEmpty(mydoJobList)){
|
||||
MydoJob mydoJob = mydoJobList.get(0);
|
||||
//修改实际流利架货位
|
||||
BasFluentFrame basFluentFrame = basFluentFrameService.selectBasFluentFrameOrderByAllotNum(mydoJob.getExitId());
|
||||
queue.setPositionCode2(basFluentFrame.getLocationName());
|
||||
agvQueueService.updateAgvQueue(queue);
|
||||
requestAgvQueue(mydoJob, queue);
|
||||
}else {
|
||||
log.info("队列 agvCode {},无对应出库作业", agvQueue.getReqCode());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -140,7 +167,7 @@ public class BsOutSsjThread implements Runnable {
|
||||
genAgvSchedulingTaskRequest.setCtnrCode("0");
|
||||
genAgvSchedulingTaskRequest.setCtnrNum("0");
|
||||
genAgvSchedulingTaskRequest.setTaskMode("0");
|
||||
genAgvSchedulingTaskRequest.setTaskCode(mydoJob.getTaskNo());
|
||||
genAgvSchedulingTaskRequest.setTaskCode(agvQueue.getTaskCode());
|
||||
genAgvSchedulingTaskRequest.setGroupId(mydoJob.getTaskNo());
|
||||
genAgvSchedulingTaskRequest.setAgvTyp("CTU");
|
||||
genAgvSchedulingTaskRequest.setPositionSelStrategy("0");
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.ruoyi.schedule.scheduleTask.ssj.bs;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.ruoyi.api.domain.RequestLog;
|
||||
import com.ruoyi.common.utils.spring.SpringUtils;
|
||||
import com.ruoyi.device.agv.service.IAgvQueueService;
|
||||
import com.ruoyi.common.core.text.Convert;
|
||||
@@ -17,6 +19,9 @@ import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static com.ruoyi.common.Constant.AGV_FINISH_URL;
|
||||
|
||||
|
||||
@Slf4j
|
||||
@@ -68,19 +73,10 @@ public class BsPickSsjTread implements Runnable{
|
||||
|
||||
public void pickDispatch(DeviceSsj pickSsjDevice) {
|
||||
if (pickSsjDevice.getDw() == 1 && pickSsjDevice.getTaskNo() > 0){
|
||||
Integer taskNo = pickSsjDevice.getTaskNo();
|
||||
MydoJob mydoJobParam = new MydoJob();
|
||||
mydoJobParam.setStatus("3");
|
||||
mydoJobParam.setTaskNo(Convert.toStr(taskNo));
|
||||
mydoJobParam.setExitId(pickSsjDevice.getDeviceCode());
|
||||
List<MydoJob> mydoJobList = apiService.getMydoJobList(mydoJobParam);
|
||||
if (CollUtil.isNotEmpty(mydoJobList)){
|
||||
MydoJob mydoJob = mydoJobList.get(0);
|
||||
if ("4".equals(mydoJob.getExecutionPhase())){
|
||||
mydoJob.setExecutionPhase("5");
|
||||
apiService.updateMydoJob(mydoJob);
|
||||
}
|
||||
}
|
||||
Map<String, Object> param = new HashMap<>();
|
||||
param.put("taskNo", pickSsjDevice.getTaskNo());
|
||||
param.put("wmsType", "2");
|
||||
RequestLog requestLog = apiService.finishMydoJob(AGV_FINISH_URL, "出库任务到达拣选口", param);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.ruoyi.schedule.scheduleTask.ssj.js;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.ruoyi.api.domain.RequestLog;
|
||||
import com.ruoyi.api.domain.wcs2wms.MydoJob;
|
||||
import com.ruoyi.api.service.IApiService;
|
||||
import com.ruoyi.common.core.text.Convert;
|
||||
@@ -17,6 +18,9 @@ import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static com.ruoyi.common.Constant.AGV_FINISH_URL;
|
||||
|
||||
|
||||
@Slf4j
|
||||
@@ -78,19 +82,10 @@ public class JsPickSsjTread implements Runnable {
|
||||
|
||||
public void pickDispatch(DeviceSsj pickSsjDevice) {
|
||||
if (pickSsjDevice.getDw() == 1 && pickSsjDevice.getTaskNo() > 0){
|
||||
Integer taskNo = pickSsjDevice.getTaskNo();
|
||||
MydoJob mydoJobParam = new MydoJob();
|
||||
mydoJobParam.setStatus("3");
|
||||
mydoJobParam.setTaskNo(Convert.toStr(taskNo));
|
||||
mydoJobParam.setExitId(pickSsjDevice.getDeviceCode());
|
||||
List<MydoJob> mydoJobList = apiService.getMydoJobList(mydoJobParam);
|
||||
if (CollUtil.isNotEmpty(mydoJobList)){
|
||||
MydoJob mydoJob = mydoJobList.get(0);
|
||||
if ("4".equals(mydoJob.getExecutionPhase())){
|
||||
mydoJob.setExecutionPhase("5");
|
||||
apiService.updateMydoJob(mydoJob);
|
||||
}
|
||||
}
|
||||
Map<String, Object> param = new HashMap<>();
|
||||
param.put("taskNo", pickSsjDevice.getTaskNo());
|
||||
param.put("wmsType", "2");
|
||||
RequestLog requestLog = apiService.finishMydoJob(AGV_FINISH_URL, "出库任务到达拣选口", param);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user