输送线
This commit is contained in:
@@ -6,28 +6,26 @@ 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.service.RoadCacheService;
|
||||
import com.ruoyi.common.domain.SendData2;
|
||||
import com.ruoyi.device.srgv.domain.DeviceSrgv;
|
||||
import com.ruoyi.device.ssj.domain.DeviceSsj;
|
||||
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;
|
||||
import com.ruoyi.queue.srgv.domain.WcsSrgvQueue;
|
||||
import com.ruoyi.queue.srgv.domain.WcsSrgvQueueFinish;
|
||||
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.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.ruoyi.schedule.plcRead.srgv.PlcSrgvRead.deviceSrgvMap;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
@Slf4j
|
||||
public class BaseSRgvThread implements Runnable, SRgvThreadInterface {
|
||||
@@ -44,9 +42,6 @@ public class BaseSRgvThread implements Runnable, SRgvThreadInterface {
|
||||
|
||||
public ISrgvChargingJobService srgvChargingJobMapper;
|
||||
|
||||
public IMydoJobService mydoJobService;
|
||||
|
||||
public RoadCacheService roadCacheService;
|
||||
|
||||
|
||||
public void init() {
|
||||
@@ -57,9 +52,9 @@ public class BaseSRgvThread implements Runnable, SRgvThreadInterface {
|
||||
|
||||
init();
|
||||
while (isRun) {
|
||||
for (String type : sRgvCodeList.keySet()) {
|
||||
for (String code : sRgvCodeList.keySet()) {
|
||||
|
||||
for (DeviceSrgv deviceSrgv : sRgvCodeList.get(type)) {
|
||||
for (DeviceSrgv deviceSrgv : sRgvCodeList.get(code)) {
|
||||
try {
|
||||
if (ObjUtil.isNotNull(deviceSrgv)) {
|
||||
//循环所有楼层
|
||||
@@ -765,16 +760,43 @@ public class BaseSRgvThread implements Runnable, SRgvThreadInterface {
|
||||
* @return
|
||||
*/
|
||||
private boolean finishTaskByQueue(String currSite, WcsSrgvQueue wcsSrgvQueue, int floor) {
|
||||
if (currSite.equals(wcsSrgvQueue.getEndSite())){
|
||||
//当前在放货站点
|
||||
WcsPort param = new WcsPort();
|
||||
param.setPortCode(currSite);
|
||||
List<WcsPort> wcsPorts = wcsPortService.selectWcsPortList(param);
|
||||
if (CollUtil.isNotEmpty(wcsPorts)){
|
||||
WcsPort wcsPort = wcsPorts.get(0);
|
||||
if ("2".equals(wcsPort.getPortType()) || "1".equals(wcsPort.getPortType())) {
|
||||
return true;
|
||||
int result = 0;
|
||||
|
||||
//当前在放货站点
|
||||
if(Objects.equals(currSite,wcsSrgvQueue.getEndSite())){
|
||||
//如果,放货站点是提升机,记录提升机中转点
|
||||
WcsPort wcsPort=new WcsPort();
|
||||
wcsPort.setSpare4(currSite);
|
||||
List<WcsPort> wcsPorts = wcsPortService.selectWcsPortList(wcsPort);
|
||||
if(!wcsPorts.isEmpty()){
|
||||
for(WcsPort wcsPort1:wcsPorts){
|
||||
//出库任务、移库出库任务
|
||||
WcsPort wcsPort2 = new WcsPort();
|
||||
wcsPort2.setId(wcsPort1.getId());
|
||||
wcsPort2.setStatus("1");//占用
|
||||
wcsPort2.setSpare1(wcsSrgvQueue.getTaskNo());//任务号
|
||||
|
||||
wcsPort2.setSpare5("2");//出库 默认
|
||||
//换层移库的货
|
||||
|
||||
if("21".equals(wcsSrgvQueue.getDefault05())){
|
||||
//12代表换层移库的托盘
|
||||
wcsPort2.setSpare5("4");//换层
|
||||
// wcsTransitPoint1.setProductType("2");
|
||||
}
|
||||
int i=wcsPortService.updateWcsPort(wcsPort2);
|
||||
|
||||
|
||||
}
|
||||
|
||||
}else if(Objects.equals(currSite,wcsSrgvQueue.getEndSite()) && "2".equals(wcsSrgvQueue.getDefault02())){
|
||||
//同层移库
|
||||
String default02 = wcsSrgvQueue.getDefault02();
|
||||
if(Objects.equals(default02,"4")){
|
||||
//todo 完成队列,处理货位
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user