产线输送机

This commit is contained in:
张怡蓉
2025-09-23 15:29:40 +08:00
parent 3e994bfa17
commit 48a38c0878
11 changed files with 111 additions and 49 deletions

View File

@@ -1,8 +1,13 @@
package com.ruoyi.schedule.scheduleTask.ssj.floor2;
import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpUtil;
import com.ruoyi.api.service.IApiService;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.spring.SpringUtils;
import com.ruoyi.device.ssj.domain.DeviceSsj;
import com.ruoyi.job.domain.MydoJob;
import com.ruoyi.job.service.IMydoJobService;
import com.ruoyi.queue.agv.service.IAgvQueueService;
import com.ruoyi.schedule.plcRead.ssj.PlcSsjRead;
import lombok.extern.slf4j.Slf4j;
@@ -21,6 +26,7 @@ public class LineSsjThread implements Runnable {
private IApiService apiService;
private IAgvQueueService agvQueueService;
private IMydoJobService mydoJobService;
public boolean isRun = true;
@@ -28,9 +34,9 @@ public class LineSsjThread implements Runnable {
public void init() {
ssjCodeList = new HashMap<>();
ArrayList<String> ssjCodes = new ArrayList<>();
ssjCodes.add("L1002");
ssjCodes.add("L1004");
ssjCodeList.put("in", ssjCodes);
ssjCodes.add("G1005");
// ssjCodes.add("L1004");
ssjCodeList.put("line", ssjCodes);
apiService = SpringUtils.getBean(IApiService.class);
agvQueueService = SpringUtils.getBean(IAgvQueueService.class);
log.info("初始化服务 {},{}", apiService, agvQueueService);
@@ -43,7 +49,7 @@ public class LineSsjThread implements Runnable {
for (String type : ssjCodeList.keySet()) {
switch ( type){
case "in":
case "line":
//生产线入库
for (String ssjCode : ssjCodeList.get(type)) {
try {
@@ -70,15 +76,52 @@ public class LineSsjThread implements Runnable {
}
public void inDispatch(DeviceSsj inSsjDevice) {
//如果入库请求1 并且 托盘码不为空
if (inSsjDevice.getDw() == 1 && inSsjDevice.getTaskNo() > 0 && inSsjDevice.getRkqq() == 1) {
//查询货位 排列层
//查询入口 排列层
//生成堆垛机队列
public void inDispatch(DeviceSsj SsjDevice) {
//如果到位,扫到条码,托盘大小,
if (SsjDevice.getDw() == 1 && StrUtil.isNotBlank(SsjDevice.getTrayCode()) && SsjDevice.getTraySize() !=0) {
log.info("设备:{} 位置:{} 条码:{} 托盘大小:{}",SsjDevice.getDeviceCode(),"产线",SsjDevice.getTrayCode(),SsjDevice.getTraySize());
//请求wms生成入库作业
HashMap<String, Object> paramMap = new HashMap<>();
paramMap.put("trayCode",SsjDevice.getTrayCode());
paramMap.put("size",SsjDevice.getTraySize());
paramMap.put("floor","2");
paramMap.put("extranceId","G1005");
AjaxResult ajaxResult = apiService.createInMydoJob(paramMap);
//判断结果是否成功
if(ajaxResult.isSuccess()){
log.info("请求wms生成入库作业成功,条码为:{}",SsjDevice.getTrayCode());
}else{
log.error("请求wms生成入库作业失败,条码为:{}",SsjDevice.getTrayCode());
}
}
//查这个口的入库作业,与出库作业,如果没有出库作业,且有入库作业,生成agv搬运作业
MydoJob mydoJob = new MydoJob();
mydoJob.setEntranceId("G1005");
mydoJob.setStatus("1");
mydoJob.setInOut("1");
List<MydoJob> mydoJobs = mydoJobService.selectInOrOutMydoJobList(mydoJob);
if (mydoJobs.size() > 0) {
for (MydoJob mydoJob1 : mydoJobs) {
MydoJob mydoJob2 = new MydoJob();
if ("1".equals(mydoJob1.getRoadwayId())){
mydoJob2.setExitId("L1011");
}else{
mydoJob2.setExitId("L1012");
}
mydoJob2.setInOut("2");
mydoJob2.setStatus("3");
List<MydoJob> mydoJobouts = mydoJobService.selectInOrOutMydoJobList(mydoJob2);
if (mydoJobouts.size() == 0) {
//生成agv搬运作业
}
}
}
}
}