小车
This commit is contained in:
@@ -19,6 +19,10 @@ public interface WcsSrgvMapMapper
|
||||
*/
|
||||
public WcsSrgvMap selectWcsSrgvMapByGuid(String guid);
|
||||
|
||||
|
||||
|
||||
public WcsSrgvMap selectWcsSrgvMapBySiteId(String siteId);
|
||||
|
||||
/**
|
||||
* 查询小车点位地图表列表
|
||||
*
|
||||
|
||||
@@ -19,6 +19,10 @@ public interface IWcsSrgvMapService
|
||||
*/
|
||||
public WcsSrgvMap selectWcsSrgvMapByGuid(String guid);
|
||||
|
||||
|
||||
|
||||
public WcsSrgvMap selectWcsSrgvMapBySiteId(String siteId);
|
||||
|
||||
/**
|
||||
* 查询小车点位地图表列表
|
||||
*
|
||||
|
||||
@@ -31,6 +31,11 @@ public class WcsSrgvMapServiceImpl implements IWcsSrgvMapService
|
||||
return wcsSrgvMapMapper.selectWcsSrgvMapByGuid(guid);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WcsSrgvMap selectWcsSrgvMapBySiteId(String siteId) {
|
||||
return wcsSrgvMapMapper.selectWcsSrgvMapBySiteId(siteId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询小车点位地图表列表
|
||||
*
|
||||
|
||||
@@ -89,4 +89,6 @@ public class MydoJob extends BaseEntity
|
||||
private String trayCode;
|
||||
|
||||
private String inOut;
|
||||
|
||||
private String theFloor;
|
||||
}
|
||||
|
||||
@@ -23,6 +23,9 @@ public interface WcsSrgvQueueMapper
|
||||
public WcsSrgvQueue selectWcsSrgvQueueByTaskNo(String taskNo);
|
||||
|
||||
|
||||
public WcsSrgvQueue selectWcsSrgvQueueByAgvId(String agvId);
|
||||
|
||||
|
||||
/**
|
||||
* 查询四向小车任务队列列表
|
||||
*
|
||||
|
||||
@@ -22,6 +22,8 @@ public interface IWcsSrgvQueueService
|
||||
|
||||
public WcsSrgvQueue selectWcsSrgvQueueByTaskNo(String taskNo);
|
||||
|
||||
public WcsSrgvQueue selectWcsSrgvQueueByAgvId(String agvId);
|
||||
|
||||
|
||||
/**
|
||||
* 查询四向小车任务队列列表
|
||||
|
||||
@@ -45,6 +45,11 @@ public class WcsSrgvQueueServiceImpl implements IWcsSrgvQueueService
|
||||
return wcsSrgvQueueMapper.selectWcsSrgvQueueByTaskNo(taskNo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WcsSrgvQueue selectWcsSrgvQueueByAgvId(String agvId) {
|
||||
return wcsSrgvQueueMapper.selectWcsSrgvQueueByAgvId(agvId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询四向小车任务队列列表
|
||||
*
|
||||
|
||||
@@ -25,6 +25,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Slf4j
|
||||
@@ -32,7 +33,7 @@ public class BaseSRgvThread implements Runnable, SRgvThreadInterface {
|
||||
|
||||
public boolean isRun = true;
|
||||
|
||||
public HashMap<String, List<DeviceSrgv>> sRgvCodeList;
|
||||
public HashMap<String, List<String>> sRgvCodeList;
|
||||
|
||||
public HashMap<String, List<String>> ssjCodeList;
|
||||
|
||||
@@ -51,12 +52,13 @@ public class BaseSRgvThread implements Runnable, SRgvThreadInterface {
|
||||
public RoadCacheService roadCacheService;
|
||||
|
||||
|
||||
|
||||
public void init() {
|
||||
ArrayList<String> ssjCodes1 = new ArrayList<>();
|
||||
ssjCodes1.add("L1004");
|
||||
ssjCodes1.add("L1005");
|
||||
ssjCodeList.put("road", ssjCodes1);
|
||||
sRgvCodeList = new HashMap<>();
|
||||
ArrayList<String> sRgvCodes = new ArrayList<>();
|
||||
sRgvCodes.add("1");
|
||||
sRgvCodes.add("2");
|
||||
sRgvCodes.add("3");
|
||||
sRgvCodeList.put("srgv", sRgvCodes);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -64,28 +66,33 @@ public class BaseSRgvThread implements Runnable, SRgvThreadInterface {
|
||||
|
||||
init();
|
||||
while (isRun) {
|
||||
for (String code : sRgvCodeList.keySet()) {
|
||||
|
||||
for (DeviceSrgv deviceSrgv : sRgvCodeList.get(code)) {
|
||||
try {
|
||||
if (ObjUtil.isNotNull(deviceSrgv)) {
|
||||
|
||||
for (String code : sRgvCodeList.get("srgv")) {
|
||||
|
||||
try {
|
||||
if (PlcSrgvRead.deviceSrgvMap.containsKey(code)) {
|
||||
if (ObjUtil.isNotNull(PlcSrgvRead.deviceSrgvMap.get(code))) {
|
||||
|
||||
DeviceSrgv deviceSrgv = PlcSrgvRead.deviceSrgvMap.get(code);
|
||||
//循环所有楼层
|
||||
for (int i = 1; i <= 8; i++) {
|
||||
sRgvTask(deviceSrgv, i);
|
||||
}
|
||||
|
||||
createCarInQueue(deviceSrgv);
|
||||
createCarInQueue();
|
||||
|
||||
createCarOutQueue();
|
||||
|
||||
} else {
|
||||
log.error("堆垛机设备为空");
|
||||
}
|
||||
} catch (RuntimeException e) {
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
|
||||
} catch (RuntimeException e) {
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -100,12 +107,12 @@ public class BaseSRgvThread implements Runnable, SRgvThreadInterface {
|
||||
/**
|
||||
* 四向小车任务处理
|
||||
*/
|
||||
private void sRgvTask(DeviceSrgv deviceSrgv,int floor) {
|
||||
private void sRgvTask(DeviceSrgv deviceSrgv, int floor) {
|
||||
//处理队列下发
|
||||
resQueue(deviceSrgv,floor);
|
||||
resQueue(deviceSrgv, floor);
|
||||
|
||||
//小车完成队列
|
||||
completeCarTask(deviceSrgv,floor);
|
||||
completeCarTask(deviceSrgv, floor);
|
||||
|
||||
//小车发送任务
|
||||
sendTask(deviceSrgv, floor);
|
||||
@@ -121,72 +128,83 @@ public class BaseSRgvThread implements Runnable, SRgvThreadInterface {
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 生成入库小车队列
|
||||
*/
|
||||
private void createCarInQueue(DeviceSrgv deviceSrgv) {
|
||||
private void createCarInQueue() {
|
||||
MydoJob mydoJob = new MydoJob();
|
||||
mydoJob.setExecutionPhase("2");
|
||||
List<MydoJob> mydoJobs = mydoJobService.selectMydoJobList(mydoJob);
|
||||
if(!mydoJobs.isEmpty()){
|
||||
mydoJob.setInOut("1");
|
||||
List<MydoJob> mydoJobs = mydoJobService.selectInOrOutMydoJobList(mydoJob);
|
||||
if (!mydoJobs.isEmpty()) {
|
||||
MydoJob mydoJob1 = mydoJobs.get(0);
|
||||
// 查询是否有已下发的该任务号队列
|
||||
|
||||
WcsSrgvQueue wcsSrgvQueue1 = wcsSagvQueueMapper.selectWcsSrgvQueueByTaskNo(mydoJob1.getTaskNo());
|
||||
if(wcsSrgvQueue1==null){
|
||||
if (wcsSrgvQueue1 == null) {
|
||||
ConcurrentHashMap<String, DeviceSrgv> deviceSrgvMap = PlcSrgvRead.deviceSrgvMap;
|
||||
List<DeviceSrgv> deviceSrgvList = deviceSrgvMap.values().stream().filter(deviceSrgv -> deviceSrgv.getStatus() == 1 && deviceSrgv.getWorkMode() == 4).collect(Collectors.toList());
|
||||
if (!deviceSrgvList.isEmpty()) {
|
||||
DeviceSrgv deviceSrgv =null;
|
||||
for (DeviceSrgv deviceSrgv1 : deviceSrgvList) {
|
||||
WcsSrgvQueue wcsSrgvQueue = wcsSagvQueueMapper.selectWcsSrgvQueueByAgvId(deviceSrgv1.getDeviceId().toString());
|
||||
if (wcsSrgvQueue == null) {
|
||||
//如果有currFloor等于mydoJob1的theFloor的就选择,如果没有选择deviceSrgvList中currFloor最小的
|
||||
if (deviceSrgv1.getCurrFloor().toString().equals(mydoJob1.getTheFloor())) {
|
||||
deviceSrgv = deviceSrgv1;
|
||||
break; // 找到了相同楼层的直接选它
|
||||
} else if (deviceSrgv == null || deviceSrgv1.getCurrFloor() < deviceSrgv.getCurrFloor()) {
|
||||
deviceSrgv = deviceSrgv1; // 更新为更小楼层的小车
|
||||
}
|
||||
|
||||
//查询1楼是否有空闲联机自动的小车,且1楼小车不在入库站点
|
||||
String endSite="";
|
||||
String xfType="";
|
||||
}else{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
WcsPort wcsPort = new WcsPort();
|
||||
wcsPort.setPortType("4");
|
||||
wcsPort.setPortRegion("1");
|
||||
wcsPort.setPortCode(mydoJob1.getEntranceId());
|
||||
List<WcsPort> wcsPorts = wcsPortService.selectWcsPortList(wcsPort);
|
||||
//取货地址
|
||||
String cargoPickSite=wcsPorts.get(0).getSpare4();
|
||||
|
||||
if(deviceSrgv.getCurrFloor()==1 && deviceSrgv.getWorkMode()==4 && deviceSrgv.getStatus()==1 && !cargoPickSite.equals(deviceSrgv.getCurrSite())){
|
||||
//终点是巷道口到位输送线
|
||||
endSite=cargoPickSite;
|
||||
xfType="4";
|
||||
}else if(deviceSrgv.getCurrFloor()!=1 && deviceSrgv.getWorkMode()==4 && deviceSrgv.getStatus()==1){
|
||||
//终点是提升机口
|
||||
WcsPort wcsPort1 = new WcsPort();
|
||||
wcsPort1.setPortType("1");
|
||||
wcsPort1.setPortRegion(deviceSrgv.getCurrFloor().toString());
|
||||
List<WcsPort> wcsPorts1 = wcsPortService.selectWcsPortList(wcsPort1);
|
||||
endSite=wcsPorts1.get(0).getSpare4();
|
||||
xfType="8";
|
||||
}else{
|
||||
return;
|
||||
}
|
||||
//查询1楼是否有空闲联机自动的小车,且1楼小车不在入库站点
|
||||
String endSite = "";
|
||||
WcsSrgvMap wcsSrgvMap = new WcsSrgvMap();
|
||||
wcsSrgvMap.setRemark(mydoJob1.getEntranceId());
|
||||
List<WcsSrgvMap> wcsSrgvMaps = wcsSrgvMapService.selectWcsSrgvMapList(wcsSrgvMap);
|
||||
//取货地址
|
||||
String cargoPickSite = wcsSrgvMaps.get(0).getSiteId();
|
||||
|
||||
//生成小车取货队列
|
||||
WcsSrgvQueue wcsSrgvQueue = new WcsSrgvQueue();
|
||||
wcsSrgvQueue.setGuid(UUID.randomUUID().toString());
|
||||
wcsSrgvQueue.setTaskNo(mydoJob1.getTaskNo());
|
||||
wcsSrgvQueue.setTaskType("1");
|
||||
wcsSrgvQueue.setPriority(Long.parseLong("2"));
|
||||
wcsSrgvQueue.setCargo("1");
|
||||
wcsSrgvQueue.setIssued("0");
|
||||
wcsSrgvQueue.setExecutionStatus("1");
|
||||
wcsSrgvQueue.setCargoPickSite(cargoPickSite);
|
||||
WcsSrgvMap wcsSrgvMap = new WcsSrgvMap();
|
||||
wcsSrgvMap.setCargoSpaceId(mydoJob1.getCargoSpaceId());
|
||||
List<WcsSrgvMap> wcsSrgvMaps = wcsSrgvMapService.selectWcsSrgvMapList(wcsSrgvMap);
|
||||
wcsSrgvQueue.setCargoPlaceSite(wcsSrgvMaps.get(0).getSiteId());
|
||||
wcsSrgvQueue.setStartSite(deviceSrgv.getCurrSite());
|
||||
wcsSrgvQueue.setEndSite(endSite);
|
||||
wcsSrgvQueue.setTheFloor(deviceSrgv.getCurrFloor().toString());
|
||||
wcsSrgvQueue.setCreateDate(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
|
||||
wcsSrgvQueue.setAgvId(deviceSrgv.getDeviceId().toString());
|
||||
wcsSrgvQueue.setDefault02(xfType);
|
||||
wcsSrgvQueue.setDefault07("1");
|
||||
wcsSagvQueueMapper.insertWcsSrgvQueue(wcsSrgvQueue);
|
||||
if (deviceSrgv.getCurrFloor() == 1 && !cargoPickSite.equals(deviceSrgv.getCurrSite())) {
|
||||
//终点是巷道口到位输送线
|
||||
endSite = cargoPickSite;
|
||||
|
||||
} else if (deviceSrgv.getCurrFloor() != 1 ) {
|
||||
//终点是提升机
|
||||
endSite = "tsj";
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
//生成小车取货队列
|
||||
WcsSrgvQueue wcsSrgvQueue = new WcsSrgvQueue();
|
||||
wcsSrgvQueue.setGuid(UUID.randomUUID().toString());
|
||||
wcsSrgvQueue.setTaskNo(mydoJob1.getTaskNo());
|
||||
wcsSrgvQueue.setTaskType("1");
|
||||
wcsSrgvQueue.setPriority(Long.parseLong("2"));
|
||||
wcsSrgvQueue.setCargo("1");
|
||||
wcsSrgvQueue.setIssued("0");
|
||||
wcsSrgvQueue.setExecutionStatus("1");
|
||||
wcsSrgvQueue.setCargoPickSite(cargoPickSite);
|
||||
WcsSrgvMap wcsSrgvMap1 = new WcsSrgvMap();
|
||||
wcsSrgvMap1.setCargoSpaceId(mydoJob1.getCargoSpaceId());
|
||||
List<WcsSrgvMap> wcsSrgvMaps1 = wcsSrgvMapService.selectWcsSrgvMapList(wcsSrgvMap1);
|
||||
wcsSrgvQueue.setCargoPlaceSite(wcsSrgvMaps1.get(0).getSiteId());
|
||||
wcsSrgvQueue.setStartSite(deviceSrgv.getCurrSite());
|
||||
wcsSrgvQueue.setEndSite(endSite);
|
||||
wcsSrgvQueue.setTheFloor(deviceSrgv.getCurrFloor().toString());
|
||||
wcsSrgvQueue.setCreateDate(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
|
||||
wcsSrgvQueue.setAgvId(deviceSrgv.getDeviceId().toString());
|
||||
wcsSrgvQueue.setDefault02("4");
|
||||
wcsSrgvQueue.setDefault07("1");
|
||||
wcsSagvQueueMapper.insertWcsSrgvQueue(wcsSrgvQueue);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -205,7 +223,7 @@ public class BaseSRgvThread implements Runnable, SRgvThreadInterface {
|
||||
}
|
||||
for (WcsSrgvQueue wcsSrgvQueue : wcsSrgvQueues) {
|
||||
String agvId = wcsSrgvQueue.getAgvId();
|
||||
if (agvId.equals(Convert.toStr(deviceSrgv.getDeviceId())) && deviceSrgv.getWorkMode() == 5 && deviceSrgv.getAllowSend() == 1) {
|
||||
if (agvId.equals(Convert.toStr(deviceSrgv.getDeviceId())) && deviceSrgv.getWorkMode() == 4 && deviceSrgv.getAllowSend() == 1) {
|
||||
String startSite = wcsSrgvQueue.getStartSite();
|
||||
String endSite = wcsSrgvQueue.getEndSite();
|
||||
String currSite = deviceSrgv.getCurrSite();
|
||||
@@ -679,21 +697,22 @@ public class BaseSRgvThread implements Runnable, SRgvThreadInterface {
|
||||
/**
|
||||
* 小车完成队列
|
||||
*/
|
||||
private void completeCarTask(DeviceSrgv deviceSrgv,int floor) {
|
||||
if (deviceSrgv.getWorkMode()==5){
|
||||
private void completeCarTask(DeviceSrgv deviceSrgv, int floor) {
|
||||
//联机自动
|
||||
if (deviceSrgv.getWorkMode() == 4) {
|
||||
//22到达充电位置 23到达换层目标
|
||||
if (deviceSrgv.getStatus() == 1 || (deviceSrgv.getStatus() == 2 && (deviceSrgv.getWorkPhase() == 22 || deviceSrgv.getWorkPhase() == 23))) {
|
||||
if (deviceSrgv.getStatus() == 1) {
|
||||
WcsSrgvQueue param = new WcsSrgvQueue();
|
||||
param.setAgvId(Convert.toStr(deviceSrgv.getDeviceId()));
|
||||
param.setEndSite(deviceSrgv.getCurrSite());//目标点
|
||||
param.setIssued("1");
|
||||
param.setExecutionStatus("1");//
|
||||
param.setExecutionStatus("3");
|
||||
List<WcsSrgvQueue> wcsSagvQueues = wcsSagvQueueMapper.selectWcsSrgvQueueList(param);//查询到达目标的
|
||||
if (CollUtil.isNotEmpty(wcsSagvQueues)) {
|
||||
WcsSrgvQueue wcsSrgvQueue = wcsSagvQueues.get(0);
|
||||
|
||||
/*
|
||||
* 1、处理终点是提升机站点的四向车
|
||||
* 1、不处理终点是提升机站点的四向车
|
||||
* 2、处理终点不是提升机站点的
|
||||
* */
|
||||
boolean taskFinishFlag = finishTaskByQueue(deviceSrgv.getCurrSite(), wcsSrgvQueue, floor);
|
||||
@@ -719,56 +738,91 @@ public class BaseSRgvThread implements Runnable, SRgvThreadInterface {
|
||||
|
||||
/**
|
||||
* 队列完成
|
||||
*
|
||||
* @param currSite
|
||||
* @param wcsSrgvQueue
|
||||
* @param floor
|
||||
* @return
|
||||
*/
|
||||
private boolean finishTaskByQueue(String currSite, WcsSrgvQueue wcsSrgvQueue, int floor) {
|
||||
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());//任务号
|
||||
if (Objects.equals(currSite, wcsSrgvQueue.getEndSite())) {
|
||||
String taskType = wcsSrgvQueue.getTaskType();
|
||||
String cargoPickSite = wcsSrgvQueue.getCargoPickSite();
|
||||
String cargoPlaceSite = wcsSrgvQueue.getCargoPlaceSite();
|
||||
|
||||
wcsPort2.setSpare5("2");//出库 默认
|
||||
//换层移库的货
|
||||
//空车现在位置是取货位置(移库取货,入库取货,出库取货),满车现在是放货位置
|
||||
if ("1".equals(taskType) && cargoPickSite.equals(currSite)) {
|
||||
//修改队列起终点,下发类型,重新下发。怎么区分重新下发的类型是移库还是入库,还有可能是出库取货--》判断取货位置是否为入库点
|
||||
|
||||
if("21".equals(wcsSrgvQueue.getDefault05())){
|
||||
//12代表换层移库的托盘
|
||||
wcsPort2.setSpare5("4");//换层
|
||||
// wcsTransitPoint1.setProductType("2");
|
||||
//判断放货位置是否同一层,修改队列原层目标层,起终点
|
||||
//查询放货位置层数
|
||||
WcsSrgvMap wcsSrgvMapq = wcsSrgvMapService.selectWcsSrgvMapBySiteId(cargoPickSite);
|
||||
WcsSrgvMap wcsSrgvMapf = wcsSrgvMapService.selectWcsSrgvMapBySiteId(cargoPlaceSite);
|
||||
String endSite = "";
|
||||
String xfType = "";
|
||||
|
||||
if (wcsSrgvMapq != null && wcsSrgvMapf != null) {
|
||||
if (Objects.equals(wcsSrgvMapq.getTheLayer(), wcsSrgvMapf.getTheLayer())) {
|
||||
//如果是同层,终点为放货点
|
||||
endSite = cargoPlaceSite;
|
||||
} else {
|
||||
//不同层,终点为提升机
|
||||
endSite = "tsj";
|
||||
}
|
||||
int i=wcsPortService.updateWcsPort(wcsPort2);
|
||||
|
||||
if ("L1004".equals(wcsSrgvMapq.getRemark()) || "L1005".equals(wcsSrgvMapq.getRemark())) {
|
||||
xfType = "1";//入库
|
||||
} else {
|
||||
if ("L1004".equals(wcsSrgvMapf.getRemark()) || "L1005".equals(wcsSrgvMapf.getRemark())) {
|
||||
xfType = "2";//出库
|
||||
} else {
|
||||
xfType = "7";//移库
|
||||
}
|
||||
}
|
||||
wcsSrgvQueue.setExecutionStatus("4");
|
||||
wcsSagvQueueMapper.insertHistory(wcsSrgvQueue.getTaskNo());
|
||||
wcsSrgvQueue.setStartSite(currSite);
|
||||
wcsSrgvQueue.setEndSite(endSite);
|
||||
wcsSrgvQueue.setDefault02(xfType);
|
||||
wcsSrgvQueue.setTheFloor(wcsSrgvMapq.getTheLayer().toString());
|
||||
wcsSrgvQueue.setDefault07(wcsSrgvMapf.getTheLayer().toString());
|
||||
wcsSrgvQueue.setIssued("0");
|
||||
wcsSrgvQueue.setExecutionStatus("1");
|
||||
wcsSagvQueueMapper.updateWcsSrgvQueue(wcsSrgvQueue);
|
||||
|
||||
}
|
||||
|
||||
} else if ("2".equals(taskType) && cargoPlaceSite.equals(currSite)) {
|
||||
//判断对列的任务类型
|
||||
switch (wcsSrgvQueue.getDefault02()) {
|
||||
case "1"://入库,插库存,
|
||||
//请求wms生成库存
|
||||
|
||||
break;
|
||||
case "7"://移库,变动库存,删除队列,插入历史表
|
||||
|
||||
|
||||
}
|
||||
|
||||
}else if(Objects.equals(currSite,wcsSrgvQueue.getEndSite()) && "2".equals(wcsSrgvQueue.getDefault02())){
|
||||
//同层移库
|
||||
String default02 = wcsSrgvQueue.getDefault02();
|
||||
if(Objects.equals(default02,"4")){
|
||||
//todo 完成队列,处理货位
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 队列处理
|
||||
*
|
||||
* @param deviceSrgv
|
||||
*/
|
||||
private void resQueue(DeviceSrgv deviceSrgv, int floor) {
|
||||
@@ -776,7 +830,7 @@ public class BaseSRgvThread implements Runnable, SRgvThreadInterface {
|
||||
String currSite = deviceSrgv.getCurrSite();
|
||||
Integer deviceId = deviceSrgv.getDeviceId();
|
||||
|
||||
if (taskNo>999 && !"000000".equals(currSite)){
|
||||
if (taskNo > 999 && !"000000".equals(currSite)) {
|
||||
WcsSrgvQueue param = new WcsSrgvQueue();
|
||||
param.setTheFloor(Convert.toStr(floor));
|
||||
param.setTaskNo(Convert.toStr(taskNo));
|
||||
@@ -789,7 +843,7 @@ public class BaseSRgvThread implements Runnable, SRgvThreadInterface {
|
||||
|
||||
String startSite = wcsSrgvQueue.getStartSite();
|
||||
|
||||
if (!startSite.equals(currSite)){
|
||||
if (!startSite.equals(currSite)) {
|
||||
wcsSrgvQueue.setIssued("1");
|
||||
wcsSrgvQueue.setStartDate(DateUtil.now());
|
||||
wcsSagvQueueMapper.updateWcsSrgvQueue(wcsSrgvQueue);
|
||||
|
||||
@@ -65,6 +65,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
where guid = #{guid}
|
||||
</select>
|
||||
|
||||
<select id="selectWcsSrgvMapBySiteId" parameterType="String" resultMap="WcsSrgvMapResult">
|
||||
<include refid="selectWcsSrgvMapVo"/>
|
||||
where site_id = #{siteId}
|
||||
</select>
|
||||
|
||||
<insert id="insertWcsSrgvMap" parameterType="WcsSrgvMap">
|
||||
insert into wcs_srgv_map
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
|
||||
@@ -22,13 +22,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="exitId" column="exit_id" />
|
||||
<result property="warehouseId" column="warehouse_id" />
|
||||
<result property="faultFlag" column="fault_flag" />
|
||||
<result property="theFloor" column="the_floor" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectMydoJobVo">
|
||||
select job_id, status, task_no, roadway_id, cargo_space_id, target_roadway_id, target_cargo_space_id, priority, execution_phase, in_or_out, create_time, start_time, finish_time, entrance_id, exit_id, warehouse_id, fault_flag from mydo_job_wcs
|
||||
select job_id, status, task_no, roadway_id, cargo_space_id, target_roadway_id, target_cargo_space_id, priority, execution_phase, in_or_out, create_time, start_time, finish_time, entrance_id, exit_id, warehouse_id, fault_flag,the_floor from mydo_job_wcs
|
||||
</sql>
|
||||
<sql id="selectMydoJobFinishVo">
|
||||
select job_id, status, task_no, roadway_id, cargo_space_id, target_roadway_id, target_cargo_space_id, priority, execution_phase, in_or_out, create_time, start_time, finish_time, entrance_id, exit_id, warehouse_id, fault_flag from mydo_job_wcs_finish
|
||||
select job_id, status, task_no, roadway_id, cargo_space_id, target_roadway_id, target_cargo_space_id, priority, execution_phase, in_or_out, create_time, start_time, finish_time, entrance_id, exit_id, warehouse_id, fault_flag,the_floor from mydo_job_wcs_finish
|
||||
</sql>
|
||||
|
||||
<select id="selectMydoJobList" parameterType="MydoJob" resultMap="MydoJobResult">
|
||||
@@ -49,6 +50,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<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="theFloor != null and theFloor != ''"> and the_floor = #{theFloor}</if>
|
||||
|
||||
</where>
|
||||
</select>
|
||||
|
||||
@@ -79,7 +82,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
)}
|
||||
</select>
|
||||
<select id="selectMydoJobByExitList" resultMap="MydoJobResult">
|
||||
select TOP 1 job_id, status, task_no, roadway_id, cargo_space_id, target_roadway_id, target_cargo_space_id, priority, execution_phase, in_or_out, create_time, start_time, finish_time, entrance_id, exit_id, warehouse_id, fault_flag from mydo_job_wcs
|
||||
select TOP 1 job_id, status, task_no, roadway_id, cargo_space_id, target_roadway_id, target_cargo_space_id, priority, execution_phase, in_or_out, create_time, start_time, finish_time, entrance_id, exit_id, warehouse_id, fault_flag,the_floor from mydo_job_wcs
|
||||
where exit_id in
|
||||
<foreach item="item" index="index" collection="exitList" separator="," open="(" close=")">
|
||||
#{item}
|
||||
@@ -109,6 +112,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="exitId != null">exit_id,</if>
|
||||
<if test="warehouseId != null">warehouse_id,</if>
|
||||
<if test="faultFlag != null">fault_flag,</if>
|
||||
<if test="theFloor != null">the_floor,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="jobId != null">#{jobId},</if>
|
||||
@@ -128,6 +132,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="exitId != null">#{exitId},</if>
|
||||
<if test="warehouseId != null">#{warehouseId},</if>
|
||||
<if test="faultFlag != null">#{faultFlag},</if>
|
||||
<if test="theFloor != null">#{theFloor},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<insert id="insertHistory">
|
||||
@@ -154,6 +159,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="exitId != null">exit_id = #{exitId},</if>
|
||||
<if test="warehouseId != null">warehouse_id = #{warehouseId},</if>
|
||||
<if test="faultFlag != null">fault_flag = #{faultFlag},</if>
|
||||
<if test="theFloor != null">the_floor = #{theFloor},</if>
|
||||
</trim>
|
||||
where job_id = #{jobId}
|
||||
</update>
|
||||
@@ -190,10 +196,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<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>
|
||||
<if test="theFloor != null and theFloor != ''"> and the_floor = #{theFloor}</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="selectMydoJobByEntranceList" resultMap="MydoJobResult">
|
||||
select TOP 1 job_id, status, task_no, roadway_id, cargo_space_id, target_roadway_id, target_cargo_space_id, priority, execution_phase, in_or_out, create_time, start_time, finish_time, entrance_id, exit_id, warehouse_id, fault_flag from mydo_job_wcs
|
||||
select TOP 1 job_id, status, task_no, roadway_id, cargo_space_id, target_roadway_id, target_cargo_space_id, priority, execution_phase, in_or_out, create_time, start_time, finish_time, entrance_id, exit_id, warehouse_id, fault_flag,the_floor from mydo_job_wcs
|
||||
where entrance_id in
|
||||
<foreach item="item" index="index" collection="entranceList" separator="," open="(" close=")">
|
||||
#{item}
|
||||
@@ -219,10 +226,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<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="theFloor != null and theFloor != ''"> and the_floor = #{theFloor}</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="selectRunningMydoJobByExitList" resultMap="MydoJobResult">
|
||||
select TOP 1 job_id, status, task_no, roadway_id, cargo_space_id, target_roadway_id, target_cargo_space_id, priority, execution_phase, in_or_out, create_time, start_time, finish_time, entrance_id, exit_id, warehouse_id, fault_flag from mydo_job_wcs
|
||||
select TOP 1 job_id, status, task_no, roadway_id, cargo_space_id, target_roadway_id, target_cargo_space_id, priority, execution_phase, in_or_out, create_time, start_time, finish_time, entrance_id, exit_id, warehouse_id, fault_flag,the_floor from mydo_job_wcs
|
||||
where exit_id in
|
||||
<foreach item="item" index="index" collection="exitList" separator="," open="(" close=")">
|
||||
#{item}
|
||||
|
||||
@@ -78,6 +78,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
where task_no = #{taskNo}
|
||||
</select>
|
||||
|
||||
<select id="selectWcsSrgvQueueByAgvId" parameterType="String" resultMap="WcsSrgvQueueResult">
|
||||
<include refid="selectWcsSrgvQueueVo"/>
|
||||
where agv_id = #{AgvId}
|
||||
</select>
|
||||
|
||||
<insert id="insertWcsSrgvQueue" parameterType="WcsSrgvQueue">
|
||||
insert into wcs_srgv_queue
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
|
||||
Reference in New Issue
Block a user