产线输送机

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

@@ -29,7 +29,7 @@ public class Wcs2WmsController {
}
/**
* 接收流利架空料箱入库任务
* 接收入库任务
*
* @param receiveInJob
* @return
@@ -39,16 +39,7 @@ public class Wcs2WmsController {
return apiService.receiveInMydoJob(receiveInJob);
}
/**
* 流利架出库确认,清空状态记录表
*
* @param jobParam
* @return
*/
@PostMapping("/outMydojobMakesure")
public AjaxResult outMydojobMakesure(@RequestBody JobParam jobParam) {
return apiService.outMydojobMakesure(jobParam);
}
/**
* 取消ctu任务

View File

@@ -132,12 +132,7 @@ public interface IApiService
*/
AjaxResult receiveInMydoJob(ReceiveJob receiveInJob);
/**
* 流利架状态清空表
* @param jobParam
* @return
*/
AjaxResult outMydojobMakesure(JobParam jobParam);
/**
* 取消ctu任务
* @param jobParam
@@ -158,4 +153,9 @@ public interface IApiService
* @return
*/
AjaxResult reAssignMydoJob2(JobParam jobParam);
/**
* 入库请求生成作业
*/
public AjaxResult createInMydoJob(Map<String, Object> param);
}

View File

@@ -259,25 +259,6 @@ public class ApiServiceImpl implements IApiService {
}
}
/**
* 流利架出库确认,清空流利架状态信息
* @param jobParam
* @return
*/
@Override
public AjaxResult outMydojobMakesure(JobParam jobParam) {
BasFluentFrame param = new BasFluentFrame();
param.setTrayCode(jobParam.getTrayCode());
List<BasFluentFrame> basFluentFrames = fluentFrameService.selectBasFluentFrameList(param);
if (CollUtil.isEmpty(basFluentFrames)){
return AjaxResult.error("无流利架信息");
}
BasFluentFrame basFluentFrame = basFluentFrames.get(0);
basFluentFrame.setTrayCode("");
basFluentFrame.setAllotNum(0L);
fluentFrameService.updateBasFluentFrame(basFluentFrame);
return AjaxResult.success();
}
/**
* 取消ctu任务
*
@@ -405,5 +386,13 @@ public class ApiServiceImpl implements IApiService {
return genAgvSchedulingTask(genAgvSchedulingTaskRequest);
}
@Override
public AjaxResult createInMydoJob(Map<String, Object> param) {
RequestLog requestLog = requestLogService.getRequestLog(CREATE_IN_MYDO_JOB_URL, "入库请求生成作业", JSONUtil.toJsonStr(param));
if ("1".equals(requestLog.getIsSuccessful())) {
return AjaxResult.success();
} else {
return AjaxResult.error();
}
}
}

View File

@@ -27,5 +27,6 @@ public class Constant {
public static final String GEN_AGV_SCHEDULING_TASK = "http://127.0.0.1:8081/rcms-dps/rest/queryAgvStatus/";
public static final String SEND_TASK_STARTED = "http://127.0.0.1:8080/api2wms/startSignal";
public static final String TAKE_COMPLETED = "http://127.0.0.1:8080/api2wms/takeCompleted";
public static final String CREATE_IN_MYDO_JOB_URL = "http://127.0.0.1:8080/api2wms/requestEnterByTrayCode";
}

View File

@@ -75,5 +75,8 @@ public class DeviceSsj extends BaseEntity
@Excel(name = "异常")
private int exception;
@Excel(name = "托盘尺寸")
private int traySize;
}

View File

@@ -87,4 +87,6 @@ public class MydoJob extends BaseEntity
private String faultFlag;
private String trayCode;
private String inOut;
}

View File

@@ -68,4 +68,6 @@ public interface MydoJobMapper
MydoJob selectMydoJobByExitList(@Param("exitList") List<String> exitList);
void insertHistory(String jobId);
List<MydoJob> selectInOrOutMydoJobList(MydoJob mydoJob);
}

View File

@@ -68,4 +68,6 @@ public interface IMydoJobService
MydoJob selectMydoJobByExitList(List<String> exitList);
void insertHistory(String jobId);
List<MydoJob> selectInOrOutMydoJobList(MydoJob mydoJob);
}

View File

@@ -136,4 +136,9 @@ public class MydoJobServiceImpl implements IMydoJobService
public void insertHistory(String jobId) {
mydoJobMapper.insertHistory(jobId);
}
@Override
public List<MydoJob> selectInOrOutMydoJobList(MydoJob mydoJob) {
return mydoJobMapper.selectInOrOutMydoJobList(mydoJob);
}
}

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搬运作业
}
}
}
}
}