产线输送机
This commit is contained in:
@@ -29,7 +29,7 @@ public class Wcs2WmsController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 接收流利架空料箱入库任务
|
* 接收入库任务
|
||||||
*
|
*
|
||||||
* @param receiveInJob
|
* @param receiveInJob
|
||||||
* @return
|
* @return
|
||||||
@@ -39,16 +39,7 @@ public class Wcs2WmsController {
|
|||||||
return apiService.receiveInMydoJob(receiveInJob);
|
return apiService.receiveInMydoJob(receiveInJob);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 流利架出库确认,清空状态记录表
|
|
||||||
*
|
|
||||||
* @param jobParam
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@PostMapping("/outMydojobMakesure")
|
|
||||||
public AjaxResult outMydojobMakesure(@RequestBody JobParam jobParam) {
|
|
||||||
return apiService.outMydojobMakesure(jobParam);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 取消ctu任务
|
* 取消ctu任务
|
||||||
|
|||||||
@@ -132,12 +132,7 @@ public interface IApiService
|
|||||||
*/
|
*/
|
||||||
AjaxResult receiveInMydoJob(ReceiveJob receiveInJob);
|
AjaxResult receiveInMydoJob(ReceiveJob receiveInJob);
|
||||||
|
|
||||||
/**
|
|
||||||
* 流利架状态清空表
|
|
||||||
* @param jobParam
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
AjaxResult outMydojobMakesure(JobParam jobParam);
|
|
||||||
/**
|
/**
|
||||||
* 取消ctu任务
|
* 取消ctu任务
|
||||||
* @param jobParam
|
* @param jobParam
|
||||||
@@ -158,4 +153,9 @@ public interface IApiService
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
AjaxResult reAssignMydoJob2(JobParam jobParam);
|
AjaxResult reAssignMydoJob2(JobParam jobParam);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 入库请求生成作业
|
||||||
|
*/
|
||||||
|
public AjaxResult createInMydoJob(Map<String, Object> param);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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任务
|
* 取消ctu任务
|
||||||
*
|
*
|
||||||
@@ -405,5 +386,13 @@ public class ApiServiceImpl implements IApiService {
|
|||||||
return genAgvSchedulingTask(genAgvSchedulingTaskRequest);
|
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();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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 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 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 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";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -75,5 +75,8 @@ public class DeviceSsj extends BaseEntity
|
|||||||
@Excel(name = "异常")
|
@Excel(name = "异常")
|
||||||
private int exception;
|
private int exception;
|
||||||
|
|
||||||
|
@Excel(name = "托盘尺寸")
|
||||||
|
private int traySize;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -87,4 +87,6 @@ public class MydoJob extends BaseEntity
|
|||||||
private String faultFlag;
|
private String faultFlag;
|
||||||
|
|
||||||
private String trayCode;
|
private String trayCode;
|
||||||
|
|
||||||
|
private String inOut;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -68,4 +68,6 @@ public interface MydoJobMapper
|
|||||||
MydoJob selectMydoJobByExitList(@Param("exitList") List<String> exitList);
|
MydoJob selectMydoJobByExitList(@Param("exitList") List<String> exitList);
|
||||||
|
|
||||||
void insertHistory(String jobId);
|
void insertHistory(String jobId);
|
||||||
|
|
||||||
|
List<MydoJob> selectInOrOutMydoJobList(MydoJob mydoJob);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -68,4 +68,6 @@ public interface IMydoJobService
|
|||||||
MydoJob selectMydoJobByExitList(List<String> exitList);
|
MydoJob selectMydoJobByExitList(List<String> exitList);
|
||||||
|
|
||||||
void insertHistory(String jobId);
|
void insertHistory(String jobId);
|
||||||
|
|
||||||
|
List<MydoJob> selectInOrOutMydoJobList(MydoJob mydoJob);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -136,4 +136,9 @@ public class MydoJobServiceImpl implements IMydoJobService
|
|||||||
public void insertHistory(String jobId) {
|
public void insertHistory(String jobId) {
|
||||||
mydoJobMapper.insertHistory(jobId);
|
mydoJobMapper.insertHistory(jobId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<MydoJob> selectInOrOutMydoJobList(MydoJob mydoJob) {
|
||||||
|
return mydoJobMapper.selectInOrOutMydoJobList(mydoJob);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,13 @@
|
|||||||
package com.ruoyi.schedule.scheduleTask.ssj.floor2;
|
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.api.service.IApiService;
|
||||||
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
import com.ruoyi.common.utils.spring.SpringUtils;
|
import com.ruoyi.common.utils.spring.SpringUtils;
|
||||||
import com.ruoyi.device.ssj.domain.DeviceSsj;
|
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.queue.agv.service.IAgvQueueService;
|
||||||
import com.ruoyi.schedule.plcRead.ssj.PlcSsjRead;
|
import com.ruoyi.schedule.plcRead.ssj.PlcSsjRead;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@@ -21,6 +26,7 @@ public class LineSsjThread implements Runnable {
|
|||||||
|
|
||||||
private IApiService apiService;
|
private IApiService apiService;
|
||||||
private IAgvQueueService agvQueueService;
|
private IAgvQueueService agvQueueService;
|
||||||
|
private IMydoJobService mydoJobService;
|
||||||
|
|
||||||
public boolean isRun = true;
|
public boolean isRun = true;
|
||||||
|
|
||||||
@@ -28,9 +34,9 @@ public class LineSsjThread implements Runnable {
|
|||||||
public void init() {
|
public void init() {
|
||||||
ssjCodeList = new HashMap<>();
|
ssjCodeList = new HashMap<>();
|
||||||
ArrayList<String> ssjCodes = new ArrayList<>();
|
ArrayList<String> ssjCodes = new ArrayList<>();
|
||||||
ssjCodes.add("L1002");
|
ssjCodes.add("G1005");
|
||||||
ssjCodes.add("L1004");
|
// ssjCodes.add("L1004");
|
||||||
ssjCodeList.put("in", ssjCodes);
|
ssjCodeList.put("line", ssjCodes);
|
||||||
apiService = SpringUtils.getBean(IApiService.class);
|
apiService = SpringUtils.getBean(IApiService.class);
|
||||||
agvQueueService = SpringUtils.getBean(IAgvQueueService.class);
|
agvQueueService = SpringUtils.getBean(IAgvQueueService.class);
|
||||||
log.info("初始化服务 {},{}", apiService, agvQueueService);
|
log.info("初始化服务 {},{}", apiService, agvQueueService);
|
||||||
@@ -43,7 +49,7 @@ public class LineSsjThread implements Runnable {
|
|||||||
for (String type : ssjCodeList.keySet()) {
|
for (String type : ssjCodeList.keySet()) {
|
||||||
|
|
||||||
switch ( type){
|
switch ( type){
|
||||||
case "in":
|
case "line":
|
||||||
//生产线入库
|
//生产线入库
|
||||||
for (String ssjCode : ssjCodeList.get(type)) {
|
for (String ssjCode : ssjCodeList.get(type)) {
|
||||||
try {
|
try {
|
||||||
@@ -70,15 +76,52 @@ public class LineSsjThread implements Runnable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void inDispatch(DeviceSsj inSsjDevice) {
|
public void inDispatch(DeviceSsj SsjDevice) {
|
||||||
//如果入库请求1 并且 托盘码不为空
|
//如果到位,扫到条码,托盘大小,
|
||||||
if (inSsjDevice.getDw() == 1 && inSsjDevice.getTaskNo() > 0 && inSsjDevice.getRkqq() == 1) {
|
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搬运作业
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -158,4 +158,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
#{jobId}
|
#{jobId}
|
||||||
</foreach>
|
</foreach>
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
|
<select id="selectInOrOutMydoJobList" parameterType="MydoJob" resultMap="MydoJobResult">
|
||||||
|
<include refid="selectMydoJobVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="inOut != null and inOut != '' and inOut =='2'.toString "> and in_or_out >=20</if>
|
||||||
|
<if test="inOut != null and inOut != '' and inOut =='1'.toString "> and in_or_out < 20</if>
|
||||||
|
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||||
|
<if test="taskNo != null and taskNo != ''"> and task_no = #{taskNo}</if>
|
||||||
|
<if test="roadwayId != null and roadwayId != ''"> and roadway_id = #{roadwayId}</if>
|
||||||
|
<if test="cargoSpaceId != null and cargoSpaceId != ''"> and cargo_space_id = #{cargoSpaceId}</if>
|
||||||
|
<if test="targetRoadwayId != null and targetRoadwayId != ''"> and target_roadway_id = #{targetRoadwayId}</if>
|
||||||
|
<if test="targetCargoSpaceId != null and targetCargoSpaceId != ''"> and target_cargo_space_id = #{targetCargoSpaceId}</if>
|
||||||
|
<if test="priority != null "> and priority = #{priority}</if>
|
||||||
|
<if test="executionPhase != null and executionPhase != ''"> and execution_phase = #{executionPhase}</if>
|
||||||
|
<if test="inOrOut != null and inOrOut != ''"> and in_or_out = #{inOrOut}</if>
|
||||||
|
<if test="startTime != null and startTime != ''"> and start_time = #{startTime}</if>
|
||||||
|
<if test="finishTime != null and finishTime != ''"> and finish_time = #{finishTime}</if>
|
||||||
|
<if test="entranceId != null and entranceId != ''"> and entrance_id = #{entranceId}</if>
|
||||||
|
<if test="exitId != null and exitId != ''"> and exit_id = #{exitId}</if>
|
||||||
|
<if test="warehouseId != null and warehouseId != ''"> and warehouse_id = #{warehouseId}</if>
|
||||||
|
<if test="faultFlag != null and faultFlag != ''"> and fault_flag = #{faultFlag}</if>
|
||||||
|
<if test="jobId != null and jobId != ''"> and job_id = #{jobId}</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
Reference in New Issue
Block a user