提升机生成放货 取货SRgv队列
This commit is contained in:
@@ -5,15 +5,15 @@ import com.ruoyi.queue.srgv.domain.WcsSrgvQueue;
|
||||
|
||||
/**
|
||||
* 四向小车任务队列Service接口
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-11-21
|
||||
*/
|
||||
public interface IWcsSrgvQueueService
|
||||
public interface IWcsSrgvQueueService
|
||||
{
|
||||
/**
|
||||
* 查询四向小车任务队列
|
||||
*
|
||||
*
|
||||
* @param guid 四向小车任务队列主键
|
||||
* @return 四向小车任务队列
|
||||
*/
|
||||
@@ -25,7 +25,7 @@ public interface IWcsSrgvQueueService
|
||||
|
||||
/**
|
||||
* 查询四向小车任务队列列表
|
||||
*
|
||||
*
|
||||
* @param wcsSrgvQueue 四向小车任务队列
|
||||
* @return 四向小车任务队列集合
|
||||
*/
|
||||
@@ -33,7 +33,7 @@ public interface IWcsSrgvQueueService
|
||||
|
||||
/**
|
||||
* 新增四向小车任务队列
|
||||
*
|
||||
*
|
||||
* @param wcsSrgvQueue 四向小车任务队列
|
||||
* @return 结果
|
||||
*/
|
||||
@@ -41,7 +41,7 @@ public interface IWcsSrgvQueueService
|
||||
|
||||
/**
|
||||
* 修改四向小车任务队列
|
||||
*
|
||||
*
|
||||
* @param wcsSrgvQueue 四向小车任务队列
|
||||
* @return 结果
|
||||
*/
|
||||
@@ -49,7 +49,7 @@ public interface IWcsSrgvQueueService
|
||||
|
||||
/**
|
||||
* 批量删除四向小车任务队列
|
||||
*
|
||||
*
|
||||
* @param guids 需要删除的四向小车任务队列主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
@@ -57,9 +57,15 @@ public interface IWcsSrgvQueueService
|
||||
|
||||
/**
|
||||
* 删除四向小车任务队列信息
|
||||
*
|
||||
*
|
||||
* @param guid 四向小车任务队列主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWcsSrgvQueueByGuid(String guid);
|
||||
|
||||
/**
|
||||
* 插入历史任务
|
||||
* @param taskNo
|
||||
*/
|
||||
public WcsSrgvQueue insertHistory(String taskNo);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,12 @@
|
||||
package com.ruoyi.queue.srgv.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjUtil;
|
||||
import com.ruoyi.queue.srgv.domain.WcsSrgvQueueFinish;
|
||||
import com.ruoyi.queue.srgv.mapper.WcsSrgvQueueFinishMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.queue.srgv.mapper.WcsSrgvQueueMapper;
|
||||
@@ -9,19 +15,21 @@ import com.ruoyi.queue.srgv.service.IWcsSrgvQueueService;
|
||||
|
||||
/**
|
||||
* 四向小车任务队列Service业务层处理
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-11-21
|
||||
*/
|
||||
@Service
|
||||
public class WcsSrgvQueueServiceImpl implements IWcsSrgvQueueService
|
||||
public class WcsSrgvQueueServiceImpl implements IWcsSrgvQueueService
|
||||
{
|
||||
@Autowired
|
||||
private WcsSrgvQueueMapper wcsSrgvQueueMapper;
|
||||
@Autowired
|
||||
private WcsSrgvQueueFinishMapper wcsSrgvQueueFinishMapper;
|
||||
|
||||
/**
|
||||
* 查询四向小车任务队列
|
||||
*
|
||||
*
|
||||
* @param guid 四向小车任务队列主键
|
||||
* @return 四向小车任务队列
|
||||
*/
|
||||
@@ -39,7 +47,7 @@ public class WcsSrgvQueueServiceImpl implements IWcsSrgvQueueService
|
||||
|
||||
/**
|
||||
* 查询四向小车任务队列列表
|
||||
*
|
||||
*
|
||||
* @param wcsSrgvQueue 四向小车任务队列
|
||||
* @return 四向小车任务队列
|
||||
*/
|
||||
@@ -51,7 +59,7 @@ public class WcsSrgvQueueServiceImpl implements IWcsSrgvQueueService
|
||||
|
||||
/**
|
||||
* 新增四向小车任务队列
|
||||
*
|
||||
*
|
||||
* @param wcsSrgvQueue 四向小车任务队列
|
||||
* @return 结果
|
||||
*/
|
||||
@@ -63,7 +71,7 @@ public class WcsSrgvQueueServiceImpl implements IWcsSrgvQueueService
|
||||
|
||||
/**
|
||||
* 修改四向小车任务队列
|
||||
*
|
||||
*
|
||||
* @param wcsSrgvQueue 四向小车任务队列
|
||||
* @return 结果
|
||||
*/
|
||||
@@ -75,7 +83,7 @@ public class WcsSrgvQueueServiceImpl implements IWcsSrgvQueueService
|
||||
|
||||
/**
|
||||
* 批量删除四向小车任务队列
|
||||
*
|
||||
*
|
||||
* @param guids 需要删除的四向小车任务队列主键
|
||||
* @return 结果
|
||||
*/
|
||||
@@ -87,7 +95,7 @@ public class WcsSrgvQueueServiceImpl implements IWcsSrgvQueueService
|
||||
|
||||
/**
|
||||
* 删除四向小车任务队列信息
|
||||
*
|
||||
*
|
||||
* @param guid 四向小车任务队列主键
|
||||
* @return 结果
|
||||
*/
|
||||
@@ -96,4 +104,17 @@ public class WcsSrgvQueueServiceImpl implements IWcsSrgvQueueService
|
||||
{
|
||||
return wcsSrgvQueueMapper.deleteWcsSrgvQueueByGuid(guid);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WcsSrgvQueue insertHistory(String taskNo) {
|
||||
WcsSrgvQueue wcsSrgvQueue = wcsSrgvQueueMapper.selectWcsSrgvQueueByTaskNo(taskNo);
|
||||
if (ObjUtil.isNotNull(wcsSrgvQueue)){
|
||||
WcsSrgvQueueFinish wcsSrgvQueueFinish = new WcsSrgvQueueFinish();
|
||||
BeanUtil.copyProperties(wcsSrgvQueue,wcsSrgvQueueFinish);
|
||||
wcsSrgvQueueFinish.setFinishDate(DateUtil.formatDateTime(DateUtil.date()));
|
||||
wcsSrgvQueueFinishMapper.insertWcsSrgvQueueFinish(wcsSrgvQueueFinish);
|
||||
return wcsSrgvQueue;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,16 +4,14 @@ import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.ObjUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.ruoyi.bas.port.domain.WcsPort;
|
||||
import com.ruoyi.bas.port.service.IWcsPortService;
|
||||
import com.ruoyi.bas.srgvmap.domain.WcsSrgvMap;
|
||||
import com.ruoyi.bas.srgvmap.service.IWcsSrgvMapService;
|
||||
import com.ruoyi.bas.srgvmap.service.RoadCacheService;
|
||||
import com.ruoyi.common.domain.SendData2;
|
||||
import com.ruoyi.device.srgv.domain.DeviceSrgv;
|
||||
import com.ruoyi.job.charg.domain.SrgvChargingJob;
|
||||
import com.ruoyi.job.charg.service.ISrgvChargingJobService;
|
||||
import com.ruoyi.job.domain.MydoJob;
|
||||
import com.ruoyi.job.service.IMydoJobService;
|
||||
@@ -23,15 +21,11 @@ import com.ruoyi.queue.srgv.service.IWcsSrgvQueueFinishService;
|
||||
import com.ruoyi.queue.srgv.service.IWcsSrgvQueueService;
|
||||
import com.ruoyi.schedule.plcRead.srgv.PlcSrgvRead;
|
||||
import com.ruoyi.schedule.plcRead.srgv.roadUtil.PathFinder;
|
||||
import com.ruoyi.schedule.plcRead.ssj.PlcSsjRead;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
@Slf4j
|
||||
public class BaseSRgvThread implements Runnable, SRgvThreadInterface {
|
||||
@@ -54,6 +48,8 @@ public class BaseSRgvThread implements Runnable, SRgvThreadInterface {
|
||||
|
||||
public IWcsSrgvMapService wcsSrgvMapService;
|
||||
|
||||
public RoadCacheService roadCacheService;
|
||||
|
||||
|
||||
|
||||
public void init() {
|
||||
|
||||
@@ -6,6 +6,7 @@ import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.ObjUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.ruoyi.bas.cargospace.domain.BasCargoSpace;
|
||||
import com.ruoyi.bas.cargospace.service.IBasCargoSpaceService;
|
||||
import com.ruoyi.bas.port.domain.WcsPort;
|
||||
@@ -87,6 +88,13 @@ public class TsjThread implements Runnable {
|
||||
finishSend(rwh);
|
||||
}
|
||||
|
||||
/*
|
||||
* 2、四向车任务生成 2-工作 ,触发方式 2-自动,任务号大于999
|
||||
*
|
||||
* */
|
||||
if (czfs == 2 && sbzt == 2 && jdbz == 4 && rwh > 999) {
|
||||
createSRgvQueue(rwh);
|
||||
}
|
||||
/*
|
||||
* 2、任务完成
|
||||
*
|
||||
@@ -108,8 +116,47 @@ public class TsjThread implements Runnable {
|
||||
|
||||
}
|
||||
|
||||
private void createSRgvQueue(Long rwh) {
|
||||
WcsSrgvQueue sRgvQueueParam = new WcsSrgvQueue();
|
||||
sRgvQueueParam.setTaskNo(Convert.toStr(rwh));
|
||||
List<WcsSrgvQueue> wcsSrgvQueues = wcsSrgvQueueService.selectWcsSrgvQueueList(sRgvQueueParam);
|
||||
if (CollUtil.isEmpty(wcsSrgvQueues)) {
|
||||
return;
|
||||
}
|
||||
WcsSrgvQueue wcsSrgvQueue = wcsSrgvQueueService.insertHistory(Convert.toStr(rwh));
|
||||
//修改起点终点
|
||||
if (ObjUtil.isNotEmpty(wcsSrgvQueue)) {
|
||||
wcsSrgvQueue.setCreateDate(DateUtil.formatDateTime(DateUtil.date()));
|
||||
wcsSrgvQueue.setStartDate(null);
|
||||
wcsSrgvQueue.setIssued("0");
|
||||
wcsSrgvQueue.setExecutionStatus("0");
|
||||
String startSite = "";
|
||||
String endSite = "";
|
||||
switch (wcsSrgvQueue.getTaskType()){
|
||||
case "1":
|
||||
//空车
|
||||
startSite = "tsj";
|
||||
endSite = wcsSrgvQueue.getCargoPickSite();
|
||||
break;
|
||||
case "2":
|
||||
case "3":
|
||||
//满车或者是充电
|
||||
startSite = "tsj";
|
||||
endSite = wcsSrgvQueue.getCargoPlaceSite();
|
||||
break;
|
||||
default:
|
||||
log.info("任务类型错误");
|
||||
}
|
||||
if (StrUtil.isNotEmpty(startSite) && StrUtil.isNotEmpty(endSite)){
|
||||
wcsSrgvQueue.setStartSite(startSite);
|
||||
wcsSrgvQueue.setEndSite(endSite);
|
||||
wcsSrgvQueueService.updateWcsSrgvQueue(wcsSrgvQueue);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建卸车队列
|
||||
* 创建提升机队列
|
||||
*/
|
||||
private void createQueue(DeviceTsj tsj) {
|
||||
for (String sRgv : PlcSrgvRead.deviceSrgvMap.keySet()) {
|
||||
@@ -214,13 +261,6 @@ public class TsjThread implements Runnable {
|
||||
tsjDeviceExecutionQueueFinishService.insertTsjDeviceExecutionQueueFinish(tsjDeviceExecutionQueueFinish);
|
||||
tsjDeviceExecutionQueueService.deleteTsjDeviceExecutionQueueByGuid(tsjDeviceExecutionQueue.getGuid());
|
||||
log.info("提升机任务下发完成 taskNo{} 任务类型:{}", taskNo, "提升机任务");
|
||||
/*if ("1".equals(tsjDeviceExecutionQueue.getRwlx())) {
|
||||
//锁定提升机承载
|
||||
DeviceTsj deviceTsj = deviceTsjService.selectDeviceTsjById(tsjDeviceExecutionQueue.getDeviceId());
|
||||
deviceTsj.setSpare1(1);
|
||||
deviceTsjService.updateDeviceTsj(deviceTsj);
|
||||
log.info("提升机任务锁定提升机承载 taskNo{} 任务类型:{}", taskNo, "提升机任务");
|
||||
}*/
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user