2026.2.4
This commit is contained in:
@@ -130,4 +130,6 @@ public interface IApiService
|
|||||||
AjaxResult selectMydoJobByTrayCodeAndEntranceId(HashMap<String, Object> paramMap);
|
AjaxResult selectMydoJobByTrayCodeAndEntranceId(HashMap<String, Object> paramMap);
|
||||||
|
|
||||||
AjaxResult allotSpace(JobParam jobParam);
|
AjaxResult allotSpace(JobParam jobParam);
|
||||||
|
|
||||||
|
AjaxResult JobFinish(Map<String, Object> param);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -138,6 +138,10 @@ public class ApiServiceImpl implements IApiService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 处理agv状态返回
|
* 处理agv状态返回
|
||||||
*
|
*
|
||||||
@@ -332,6 +336,7 @@ public class ApiServiceImpl implements IApiService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AjaxResult createInMydoJob(Map<String, Object> param) {
|
public AjaxResult createInMydoJob(Map<String, Object> param) {
|
||||||
|
// 访问请求路径,生成入库作业 ,如果生成返回信息
|
||||||
RequestLog requestLog = requestLogService.getRequestLog(CREATE_IN_MYDO_JOB_URL, "入库请求生成作业", JSONUtil.toJsonStr(param));
|
RequestLog requestLog = requestLogService.getRequestLog(CREATE_IN_MYDO_JOB_URL, "入库请求生成作业", JSONUtil.toJsonStr(param));
|
||||||
if ("1".equals(requestLog.getIsSuccessful())) {
|
if ("1".equals(requestLog.getIsSuccessful())) {
|
||||||
InterfaceReceive bean = JSONUtil.toBean(requestLog.getResponseBody(), InterfaceReceive.class);
|
InterfaceReceive bean = JSONUtil.toBean(requestLog.getResponseBody(), InterfaceReceive.class);
|
||||||
@@ -366,7 +371,23 @@ public class ApiServiceImpl implements IApiService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AjaxResult receiveInMydoJob(ReceiveJob receiveInJob) {
|
public AjaxResult receiveInMydoJob(ReceiveJob receiveInJob) {
|
||||||
return null;
|
MydoJob mydoJob = new MydoJob();
|
||||||
|
mydoJob.setJobId(receiveInJob.getJobId());
|
||||||
|
mydoJob.setTaskNo(receiveInJob.getTaskNo());
|
||||||
|
mydoJob.setCargoSpaceId(receiveInJob.getCargoSpaceId());
|
||||||
|
mydoJob.setExitId(receiveInJob.getExitId());
|
||||||
|
mydoJob.setInOrOut(receiveInJob.getInOrOut());
|
||||||
|
mydoJob.setStatus("1");
|
||||||
|
mydoJob.setTrayCode(receiveInJob.getTrayCode());
|
||||||
|
mydoJob.setRoadwayId(receiveInJob.getRoadwayId());
|
||||||
|
mydoJob.setCreateTime(DateUtils.getNowDate());
|
||||||
|
mydoJob.setExecutionPhase("0");
|
||||||
|
int i = mydoJobService.insertMydoJob(mydoJob);
|
||||||
|
if (i > 0) {
|
||||||
|
return AjaxResult.success();
|
||||||
|
}else{
|
||||||
|
return AjaxResult.error();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -396,4 +417,17 @@ public class ApiServiceImpl implements IApiService {
|
|||||||
public AjaxResult allotSpace(JobParam jobParam) {
|
public AjaxResult allotSpace(JobParam jobParam) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AjaxResult JobFinish(Map<String, Object> param) {
|
||||||
|
RequestLog requestLog = requestLogService.getRequestLog(JOB_FINISH_URL, "入库出任务过账", JSONUtil.toJsonStr(param));
|
||||||
|
if ("1".equals(requestLog.getIsSuccessful())) {
|
||||||
|
InterfaceReceive bean = JSONUtil.toBean(requestLog.getResponseBody(), InterfaceReceive.class);
|
||||||
|
return AjaxResult.success(bean.getData());
|
||||||
|
} else {
|
||||||
|
return AjaxResult.error();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ public class RoadCacheServiceImpl implements RoadCacheService {
|
|||||||
for (WcsSrgvMap wcsSrgvMap : wcsSrgvMaps) {
|
for (WcsSrgvMap wcsSrgvMap : wcsSrgvMaps) {
|
||||||
maps.put(wcsSrgvMap.getSiteId(), wcsSrgvMap);
|
maps.put(wcsSrgvMap.getSiteId(), wcsSrgvMap);
|
||||||
}
|
}
|
||||||
param.setAxy("7,7");
|
param.setAxy("11,9");
|
||||||
List<WcsSrgvMap> tsjMap = wcsSrgvMapMapper.selectWcsSrgvMapList(param);
|
List<WcsSrgvMap> tsjMap = wcsSrgvMapMapper.selectWcsSrgvMapList(param);
|
||||||
for (WcsSrgvMap wcsSrgvMap : tsjMap) {
|
for (WcsSrgvMap wcsSrgvMap : tsjMap) {
|
||||||
maps.put("tsj",wcsSrgvMap);
|
maps.put("tsj",wcsSrgvMap);
|
||||||
@@ -59,10 +59,13 @@ public class RoadCacheServiceImpl implements RoadCacheService {
|
|||||||
//3.锁定离线小车当前位置
|
//3.锁定离线小车当前位置
|
||||||
lockedOfflineCarCurrSite(maps, deviceSrgv);
|
lockedOfflineCarCurrSite(maps, deviceSrgv);
|
||||||
|
|
||||||
int[][] mapsInt = new int[29][11];
|
int[][] mapsInt = new int[50][50];
|
||||||
for (String site : maps.keySet()) {
|
for (String site : maps.keySet()) {
|
||||||
WcsSrgvMap wcsSrgvMap = maps.get(site);
|
WcsSrgvMap wcsSrgvMap = maps.get(site);
|
||||||
mapsInt[wcsSrgvMap.getX()][wcsSrgvMap.getY()] = wcsSrgvMap.getValue();
|
mapsInt[wcsSrgvMap.getX()][wcsSrgvMap.getY()] = wcsSrgvMap.getValue();
|
||||||
|
if (wcsSrgvMap.getAxy().equals("11,8")){
|
||||||
|
System.err.println(wcsSrgvMap.getValue());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return mapsInt;
|
return mapsInt;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -86,4 +86,8 @@ public class DeviceSsj extends BaseEntity
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ public class JobCallBackController extends BaseController
|
|||||||
return toAjax(jobCallBackService.deleteJobCallBackByIds(ids));
|
return toAjax(jobCallBackService.deleteJobCallBackByIds(ids));
|
||||||
}
|
}
|
||||||
|
|
||||||
//@Scheduled(fixedDelay=1500)
|
@Scheduled(fixedDelay=1500)
|
||||||
public void jobCallBack() {
|
public void jobCallBack() {
|
||||||
jobCallBackService.jobCallBack();
|
jobCallBackService.jobCallBack();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -71,8 +71,13 @@ public class ScheduleThread {
|
|||||||
//读取信息初始化
|
//读取信息初始化
|
||||||
plcReadInit();
|
plcReadInit();
|
||||||
//调度初始化
|
//调度初始化
|
||||||
|
|
||||||
|
|
||||||
scheduleInit();
|
scheduleInit();
|
||||||
log.info("调度服务执行成功");
|
log.info("调度服务执行成功");
|
||||||
|
// startAllThread();
|
||||||
|
// startAllThread2();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -115,7 +120,7 @@ public class ScheduleThread {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// plc输送机读取线程
|
// plc输送机读取线程
|
||||||
PlcSsjRead plcSsjRead = new PlcSsjRead(ssjList, new PlcConnectInfo("127.0.0.1", 102));
|
PlcSsjRead plcSsjRead = new PlcSsjRead(ssjList, new PlcConnectInfo("192.168.200.41", 102));
|
||||||
Thread plcSsjReadThread = new Thread(plcSsjRead);
|
Thread plcSsjReadThread = new Thread(plcSsjRead);
|
||||||
plcSsjReadCustomThread = new CustomThread<PlcSsjRead>(plcSsjReadThread, plcSsjRead);
|
plcSsjReadCustomThread = new CustomThread<PlcSsjRead>(plcSsjReadThread, plcSsjRead);
|
||||||
|
|
||||||
@@ -151,7 +156,7 @@ public class ScheduleThread {
|
|||||||
for (DeviceTsj deviceTsj : deviceTsjs) {
|
for (DeviceTsj deviceTsj : deviceTsjs) {
|
||||||
tsjList.put(deviceTsj.getId().toString(), deviceTsj);
|
tsjList.put(deviceTsj.getId().toString(), deviceTsj);
|
||||||
}
|
}
|
||||||
PlcTsjRead plcTsjRead = new PlcTsjRead(tsjList,new PlcConnectInfo("127.0.0.1", 102));
|
PlcTsjRead plcTsjRead = new PlcTsjRead(tsjList,new PlcConnectInfo("192.168.200.41", 102));
|
||||||
Thread plcTsjReadThread = new Thread(plcTsjRead);
|
Thread plcTsjReadThread = new Thread(plcTsjRead);
|
||||||
plcTsjReadCustomThread = new CustomThread<>(plcTsjReadThread, plcTsjRead);
|
plcTsjReadCustomThread = new CustomThread<>(plcTsjReadThread, plcTsjRead);
|
||||||
|
|
||||||
@@ -161,7 +166,7 @@ public class ScheduleThread {
|
|||||||
for (DeviceCdz deviceCdz : deviceCdzs) {
|
for (DeviceCdz deviceCdz : deviceCdzs) {
|
||||||
cdzList.put(deviceCdz.getId().toString(), deviceCdz);
|
cdzList.put(deviceCdz.getId().toString(), deviceCdz);
|
||||||
}
|
}
|
||||||
PlcCdzRead plcCdzRead = new PlcCdzRead(cdzList,new PlcConnectInfo("127.0.0.1", 102));
|
PlcCdzRead plcCdzRead = new PlcCdzRead(cdzList,new PlcConnectInfo("192.168.200.41", 102));
|
||||||
Thread plcCdzReadThread = new Thread(plcCdzRead);
|
Thread plcCdzReadThread = new Thread(plcCdzRead);
|
||||||
plcCdzReadCustomThread = new CustomThread<>(plcCdzReadThread, plcCdzRead);
|
plcCdzReadCustomThread = new CustomThread<>(plcCdzReadThread, plcCdzRead);
|
||||||
|
|
||||||
@@ -187,10 +192,10 @@ public class ScheduleThread {
|
|||||||
*/
|
*/
|
||||||
public void startAllThread2() {
|
public void startAllThread2() {
|
||||||
monitoringCustomThread.thread.start();
|
monitoringCustomThread.thread.start();
|
||||||
//ssjThreadCustomThread.thread.start();
|
ssjThreadCustomThread.thread.start();
|
||||||
//tsjThreadCustomThread.thread.start();
|
tsjThreadCustomThread.thread.start();
|
||||||
//sRgvThreadCustomThread.thread.start();
|
sRgvThreadCustomThread.thread.start();
|
||||||
//cdzThreadCustomThread.thread.start();
|
cdzThreadCustomThread.thread.start();
|
||||||
|
|
||||||
isRun2 = true;
|
isRun2 = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import HslCommunication.Core.Types.OperateResult;
|
|||||||
import HslCommunication.Core.Types.OperateResultExOne;
|
import HslCommunication.Core.Types.OperateResultExOne;
|
||||||
import HslCommunication.ModBus.ModbusTcpNet;
|
import HslCommunication.ModBus.ModbusTcpNet;
|
||||||
import cn.hutool.core.convert.Convert;
|
import cn.hutool.core.convert.Convert;
|
||||||
|
import com.alibaba.druid.support.spring.stat.annotation.Stat;
|
||||||
import com.ruoyi.common.domain.PlcConnectInfo;
|
import com.ruoyi.common.domain.PlcConnectInfo;
|
||||||
import com.ruoyi.device.srgv.domain.DeviceSrgv;
|
import com.ruoyi.device.srgv.domain.DeviceSrgv;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@@ -34,18 +35,18 @@ public class PlcSrgvRead implements Runnable {
|
|||||||
this.station = (byte) 1;
|
this.station = (byte) 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean Write(String address, int[] value){
|
|
||||||
|
|
||||||
//OperateResult write = modbusTcpNet.Write(address, value);
|
|
||||||
return true;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public synchronized boolean Write(String address, int[] value) {
|
||||||
|
OperateResult write = modbusTcpNet.Write(address, value);
|
||||||
|
return write.IsSuccess;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean Write(String address, short[] value){
|
public synchronized boolean Write(String address, short[] value) {
|
||||||
|
|
||||||
//OperateResult write = modbusTcpNet.Write(address, value);
|
OperateResult write = modbusTcpNet.Write(address, value);
|
||||||
return true;
|
return write.IsSuccess;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -88,19 +89,31 @@ public class PlcSrgvRead implements Runnable {
|
|||||||
|
|
||||||
//单字
|
//单字
|
||||||
private void setValueByByte1(byte[] content, DeviceSrgv agvData) {
|
private void setValueByByte1(byte[] content, DeviceSrgv agvData) {
|
||||||
|
// agvData.setTaskType(0);
|
||||||
agvData.setTaskType(Convert.toInt(byteTransform.TransInt16(content, 0)));
|
agvData.setTaskType(Convert.toInt(byteTransform.TransInt16(content, 0)));
|
||||||
|
// agvData.setBattery(0);
|
||||||
agvData.setBattery(Convert.toInt(byteTransform.TransInt16(content, 2)));
|
agvData.setBattery(Convert.toInt(byteTransform.TransInt16(content, 2)));
|
||||||
|
// agvData.setWorkMode(0);
|
||||||
agvData.setWorkMode(Convert.toInt(byteTransform.TransInt16(content, 4)));
|
agvData.setWorkMode(Convert.toInt(byteTransform.TransInt16(content, 4)));
|
||||||
|
// agvData.setAlarm(0);
|
||||||
agvData.setAlarm(Convert.toInt(byteTransform.TransInt16(content, 6)));
|
agvData.setAlarm(Convert.toInt(byteTransform.TransInt16(content, 6)));
|
||||||
|
// agvData.setStatus(0);
|
||||||
agvData.setStatus(Convert.toInt(byteTransform.TransInt16(content, 8)));
|
agvData.setStatus(Convert.toInt(byteTransform.TransInt16(content, 8)));
|
||||||
//接收完成标志
|
//接收完成标志
|
||||||
// agvData.setFinish(Convert.toInt(byteTransform.TransInt16(content, 10)));
|
// agvData.setFinish(Convert.toInt(byteTransform.TransInt16(content, 10)));
|
||||||
|
// agvData.setFinish(0);
|
||||||
agvData.setFinish(Convert.toInt(byteTransform.TransInt16(content, 12)));
|
agvData.setFinish(Convert.toInt(byteTransform.TransInt16(content, 12)));
|
||||||
|
// agvData.setChargeFlag(0);
|
||||||
agvData.setChargeFlag(Convert.toInt(byteTransform.TransInt16(content, 14)));
|
agvData.setChargeFlag(Convert.toInt(byteTransform.TransInt16(content, 14)));
|
||||||
|
// agvData.setWorkPhase(0);
|
||||||
agvData.setWorkPhase(Convert.toInt(byteTransform.TransInt16(content, 16)));
|
agvData.setWorkPhase(Convert.toInt(byteTransform.TransInt16(content, 16)));
|
||||||
|
// agvData.setAllowSend(0);
|
||||||
agvData.setAllowSend(Convert.toInt(byteTransform.TransInt16(content, 18)));
|
agvData.setAllowSend(Convert.toInt(byteTransform.TransInt16(content, 18)));
|
||||||
|
// agvData.setSsjRequest(0);
|
||||||
agvData.setSsjRequest(Convert.toInt(byteTransform.TransInt16(content, 20)));
|
agvData.setSsjRequest(Convert.toInt(byteTransform.TransInt16(content, 20)));
|
||||||
|
// agvData.setSpare2("0");
|
||||||
agvData.setSpare2(String.valueOf(Convert.toInt(byteTransform.TransInt16(content, 22))));
|
agvData.setSpare2(String.valueOf(Convert.toInt(byteTransform.TransInt16(content, 22))));
|
||||||
|
// agvData.setChangeLayer(0);
|
||||||
agvData.setChangeLayer(Convert.toInt(byteTransform.TransInt16(content, 24)));//换层标志
|
agvData.setChangeLayer(Convert.toInt(byteTransform.TransInt16(content, 24)));//换层标志
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -108,12 +121,16 @@ public class PlcSrgvRead implements Runnable {
|
|||||||
private void setValueByByte2(byte[] content, DeviceSrgv agvData) {
|
private void setValueByByte2(byte[] content, DeviceSrgv agvData) {
|
||||||
byteTransform.setDataFormat(DataFormat.CDAB);
|
byteTransform.setDataFormat(DataFormat.CDAB);
|
||||||
// TODO 注意双字反转
|
// TODO 注意双字反转
|
||||||
|
// agvData.setTaskNo(0);
|
||||||
agvData.setTaskNo(byteTransform.TransInt32(content, 0));
|
agvData.setTaskNo(byteTransform.TransInt32(content, 0));
|
||||||
//log.info("=====小车{}读取到SRGV任务号:{}=======",agvData.getDeviceId(), agvData.getTaskNo());
|
//log.info("=====小车{}读取到SRGV任务号:{}=======",agvData.getDeviceId(), agvData.getTaskNo());
|
||||||
|
// agvData.setSrcSite("000000");
|
||||||
agvData.setSrcSite(String.format("%06d", byteTransform.TransInt32(content, 4)));
|
agvData.setSrcSite(String.format("%06d", byteTransform.TransInt32(content, 4)));
|
||||||
//log.info("=====小车{}读取到SRGV源站点:{}=======",agvData.getDeviceId(), agvData.getSrcSite());
|
//log.info("=====小车{}读取到SRGV源站点:{}=======",agvData.getDeviceId(), agvData.getSrcSite());
|
||||||
|
// agvData.setTarSite("000000");
|
||||||
agvData.setTarSite(String.format("%06d", byteTransform.TransInt32(content, 8)));
|
agvData.setTarSite(String.format("%06d", byteTransform.TransInt32(content, 8)));
|
||||||
//log.info("=====小车{}读取到SRGV目标站点:{}=======",agvData.getDeviceId(), agvData.getTarSite());
|
//log.info("=====小车{}读取到SRGV目标站点:{}=======",agvData.getDeviceId(), agvData.getTarSite());
|
||||||
|
// agvData.setCurrSite("000000");
|
||||||
agvData.setCurrSite(String.format("%06d", byteTransform.TransInt32(content, 12)));
|
agvData.setCurrSite(String.format("%06d", byteTransform.TransInt32(content, 12)));
|
||||||
//log.info("=====小车{}读取到SRGV当前站点:{}=======",agvData.getDeviceId(), agvData.getCurrSite());
|
//log.info("=====小车{}读取到SRGV当前站点:{}=======",agvData.getDeviceId(), agvData.getCurrSite());
|
||||||
|
|
||||||
@@ -124,6 +141,7 @@ public class PlcSrgvRead implements Runnable {
|
|||||||
|
|
||||||
public void ConnectServer() {
|
public void ConnectServer() {
|
||||||
modbusTcpNet = new ModbusTcpNet();//创建一个Modbus对象
|
modbusTcpNet = new ModbusTcpNet();//创建一个Modbus对象
|
||||||
|
log.info("创建连接对象,IP{}", this.ip);
|
||||||
try {
|
try {
|
||||||
modbusTcpNet.setIpAddress(this.ip);
|
modbusTcpNet.setIpAddress(this.ip);
|
||||||
modbusTcpNet.setPort(this.port);
|
modbusTcpNet.setPort(this.port);
|
||||||
|
|||||||
@@ -57,12 +57,15 @@ public class PlcSsjRead implements Runnable {
|
|||||||
DeviceSsj ssjDevice = deviceSsjMap.get(ssjCode);
|
DeviceSsj ssjDevice = deviceSsjMap.get(ssjCode);
|
||||||
switch (ssjDevice.getType()) {
|
switch (ssjDevice.getType()) {
|
||||||
case "1":
|
case "1":
|
||||||
|
// 地堆输送机
|
||||||
readPlcRoadWaySsj(ssjDevice);
|
readPlcRoadWaySsj(ssjDevice);
|
||||||
break;
|
break;
|
||||||
case "2":
|
case "3":
|
||||||
|
// 链条输送机
|
||||||
readPlcInOutSsj(ssjDevice);
|
readPlcInOutSsj(ssjDevice);
|
||||||
break;
|
break;
|
||||||
case "3":
|
case "2":
|
||||||
|
// 线体到位输送机
|
||||||
readPlcOtherSsj(ssjDevice);
|
readPlcOtherSsj(ssjDevice);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -89,13 +92,13 @@ public class PlcSsjRead implements Runnable {
|
|||||||
* @param ssjDevice
|
* @param ssjDevice
|
||||||
*/
|
*/
|
||||||
private void readPlcOtherSsj(DeviceSsj ssjDevice) {
|
private void readPlcOtherSsj(DeviceSsj ssjDevice) {
|
||||||
OperateResultExOne<byte[]> read2 = readWriteNet.Read(ssjDevice.getPlcDbReadAddress(), Short.parseShort("20"));
|
OperateResultExOne<byte[]> read2 = readWriteNet.Read(ssjDevice.getPlcDbReadAddress(), Short.parseShort("10"));
|
||||||
String ddsx1 = "0";
|
String ddsx1 = "0";
|
||||||
if (read2.IsSuccess) {
|
if (read2.IsSuccess) {
|
||||||
ddsx1 = SoftBasic.ByteToHexString(read2.Content);
|
ddsx1 = SoftBasic.ByteToHexString(read2.Content);
|
||||||
ssjDevice.setKx(ParseUtil.optInt(0, ddsx1));
|
ssjDevice.setKx(ParseUtil.optInt(4, ddsx1));
|
||||||
ssjDevice.setDw(ParseUtil.optInt(2, ddsx1));
|
ssjDevice.setDw(ParseUtil.optInt(6, ddsx1));
|
||||||
ssjDevice.setTaskNo(ParseUtil.optDInt(6, ddsx1));
|
ssjDevice.setTaskNo(ParseUtil.optDInt(0, ddsx1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -105,14 +108,16 @@ public class PlcSsjRead implements Runnable {
|
|||||||
* @param ssjDevice
|
* @param ssjDevice
|
||||||
*/
|
*/
|
||||||
private void readPlcRoadWaySsj(DeviceSsj ssjDevice) {
|
private void readPlcRoadWaySsj(DeviceSsj ssjDevice) {
|
||||||
OperateResultExOne<byte[]> read2 = readWriteNet.Read(ssjDevice.getPlcDbReadAddress(), Short.parseShort("20"));
|
OperateResultExOne<byte[]> read2 = readWriteNet.Read(ssjDevice.getPlcDbReadAddress(), Short.parseShort("10"));
|
||||||
String ddsx1 = "0";
|
String ddsx1 = "0";
|
||||||
if (read2.IsSuccess) {
|
if (read2.IsSuccess) {
|
||||||
ddsx1 = SoftBasic.ByteToHexString(read2.Content);
|
ddsx1 = SoftBasic.ByteToHexString(read2.Content);
|
||||||
ssjDevice.setKx(ParseUtil.optInt(0, ddsx1));
|
// ssjDevice.setRkqq(ParseUtil.optInt(0, ddsx1));
|
||||||
ssjDevice.setDw(ParseUtil.optInt(2, ddsx1));
|
ssjDevice.setTaskNo(ParseUtil.optDInt(0, ddsx1));
|
||||||
ssjDevice.setRkqq(ParseUtil.optInt(4, ddsx1));
|
ssjDevice.setKx(ParseUtil.optInt(4, ddsx1));
|
||||||
ssjDevice.setTaskNo(ParseUtil.optDInt(6, ddsx1));
|
ssjDevice.setDw(ParseUtil.optInt(6, ddsx1));
|
||||||
|
// ssjDevice.setTrayCode(ParseUtil.optString(14, 12, ddsx1));
|
||||||
|
// ssjDevice.setModel(ParseUtil.optInt(28, ddsx1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -122,15 +127,17 @@ public class PlcSsjRead implements Runnable {
|
|||||||
* @param ssjDevice
|
* @param ssjDevice
|
||||||
*/
|
*/
|
||||||
private void readPlcInOutSsj(DeviceSsj ssjDevice) {
|
private void readPlcInOutSsj(DeviceSsj ssjDevice) {
|
||||||
OperateResultExOne<byte[]> read2 = readWriteNet.Read(ssjDevice.getPlcDbReadAddress(), Short.parseShort("20"));
|
OperateResultExOne<byte[]> read2 = readWriteNet.Read(ssjDevice.getPlcDbReadAddress(), Short.parseShort("22"));
|
||||||
String ddsx1 = "0";
|
String ddsx1 = "0";
|
||||||
if (read2.IsSuccess) {
|
if (read2.IsSuccess) {
|
||||||
ddsx1 = SoftBasic.ByteToHexString(read2.Content);
|
ddsx1 = SoftBasic.ByteToHexString(read2.Content);
|
||||||
ssjDevice.setKx(ParseUtil.optInt(0, ddsx1));
|
ssjDevice.setTaskNo(ParseUtil.optDInt(2, ddsx1));
|
||||||
ssjDevice.setDw(ParseUtil.optInt(2, ddsx1));
|
ssjDevice.setRkqq(ParseUtil.optInt(0, ddsx1));
|
||||||
ssjDevice.setException(ParseUtil.optInt(4, ddsx1));
|
|
||||||
ssjDevice.setAllowPut(ParseUtil.optInt(6, ddsx1));
|
ssjDevice.setTrayCode(ParseUtil.optString(8, 8, ddsx1));
|
||||||
ssjDevice.setTaskNo(ParseUtil.optDInt(8, ddsx1));
|
// ssjDevice.setKx(ParseUtil.optInt(4, ddsx1));
|
||||||
|
// ssjDevice.setDw(ParseUtil.optInt(6, ddsx1));
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -172,7 +179,6 @@ public class PlcSsjRead implements Runnable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void ConnectServer() {
|
void ConnectServer() {
|
||||||
siemensS7Net = new SiemensS7Net(SiemensPLCS.S1500);
|
siemensS7Net = new SiemensS7Net(SiemensPLCS.S1500);
|
||||||
try {
|
try {
|
||||||
@@ -221,15 +227,13 @@ public class PlcSsjRead implements Runnable {
|
|||||||
public static int writeToSsj(String address, String taskNo, int qx, int completed) {
|
public static int writeToSsj(String address, String taskNo, int qx, int completed) {
|
||||||
|
|
||||||
int jym = Tools.getJYM(Integer.parseInt(taskNo), qx, completed);
|
int jym = Tools.getJYM(Integer.parseInt(taskNo), qx, completed);
|
||||||
SendData taskNoSendData = new SendData(Tools.INT, taskNo);
|
SendData taskNoSendData = new SendData(Tools.DINT, taskNo);
|
||||||
SendData qxSendData = new SendData(Tools.INT, qx);
|
SendData qxSendData = new SendData(Tools.INT, qx);
|
||||||
SendData completedSendData = new SendData(Tools.INT, completed);
|
SendData completedSendData = new SendData(Tools.INT, completed);
|
||||||
SendData jymSendData = new SendData(Tools.INT, jym);
|
SendData jymSendData = new SendData(Tools.DINT, jym);
|
||||||
byte[] bytes = Tools.sendData(taskNoSendData, qxSendData, completedSendData, jymSendData);
|
byte[] bytes = Tools.sendData(taskNoSendData, qxSendData, completedSendData, jymSendData);
|
||||||
return PlcSsjRead.WriteToSSJ(address, bytes);
|
return PlcSsjRead.WriteToSSJ(address, bytes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -68,21 +68,21 @@ public class PlcTsjRead implements Runnable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void plcRead(DeviceTsj tsjDevice) {
|
private void plcRead(DeviceTsj tsjDevice) {
|
||||||
OperateResultExOne<byte[]> read2 = readWriteNet.Read(tsjDevice.getPlcDbReadAddress(), Short.parseShort("48"));
|
OperateResultExOne<byte[]> read2 = readWriteNet.Read(tsjDevice.getPlcDbReadAddress(), Short.parseShort("22"));
|
||||||
String ddsx1 = "0";
|
String ddsx1 = "0";
|
||||||
if (read2.IsSuccess) {
|
if (read2.IsSuccess) {
|
||||||
ddsx1 = SoftBasic.ByteToHexString(read2.Content);
|
ddsx1 = SoftBasic.ByteToHexString(read2.Content);
|
||||||
tsjDevice.setCzfs(ParseUtil.optInt(2, ddsx1));
|
tsjDevice.setCzfs(ParseUtil.optInt(8, ddsx1));
|
||||||
tsjDevice.setSbzt(ParseUtil.optInt(4, ddsx1));
|
tsjDevice.setSbzt(ParseUtil.optInt(8, ddsx1));
|
||||||
tsjDevice.setRwh(Convert.toLong(ParseUtil.optDInt(6, ddsx1)));
|
tsjDevice.setRwh((long) ParseUtil.optDInt(0, ddsx1));
|
||||||
tsjDevice.setDqcs(ParseUtil.optInt(10, ddsx1));
|
tsjDevice.setDqcs(ParseUtil.optInt(14, ddsx1));
|
||||||
tsjDevice.setJdbz(ParseUtil.optInt(12, ddsx1));
|
tsjDevice.setJdbz(ParseUtil.optInt(4, ddsx1));
|
||||||
tsjDevice.setYph(ParseUtil.optInt(14, ddsx1));
|
tsjDevice.setHczt(ParseUtil.optInt(6, ddsx1));
|
||||||
tsjDevice.setYch(ParseUtil.optInt(16, ddsx1));
|
// tsjDevice.setYch(ParseUtil.optInt(16, ddsx1));
|
||||||
tsjDevice.setMbph(ParseUtil.optInt(18, ddsx1));
|
// tsjDevice.setMbph(ParseUtil.optInt(18, ddsx1));
|
||||||
tsjDevice.setMbch(ParseUtil.optInt(20, ddsx1));
|
// tsjDevice.setMbch(ParseUtil.optInt(20, ddsx1));
|
||||||
tsjDevice.setYxxf(ParseUtil.optInt(22, ddsx1));
|
tsjDevice.setYxxf(ParseUtil.optInt(16, ddsx1));
|
||||||
tsjDevice.setXtxh(ParseUtil.optInt(24, ddsx1));
|
tsjDevice.setSpare1(ParseUtil.optInt(10, ddsx1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,20 +5,27 @@ import cn.hutool.core.convert.Convert;
|
|||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import cn.hutool.core.util.ObjUtil;
|
import cn.hutool.core.util.ObjUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.ruoyi.api.domain.RequestLog;
|
||||||
|
import com.ruoyi.api.service.IApiService;
|
||||||
import com.ruoyi.bas.port.service.IWcsPortService;
|
import com.ruoyi.bas.port.service.IWcsPortService;
|
||||||
import com.ruoyi.bas.srgvmap.domain.WcsSrgvMap;
|
import com.ruoyi.bas.srgvmap.domain.WcsSrgvMap;
|
||||||
import com.ruoyi.bas.srgvmap.service.IWcsSrgvMapService;
|
import com.ruoyi.bas.srgvmap.service.IWcsSrgvMapService;
|
||||||
import com.ruoyi.bas.srgvmap.service.RoadCacheService;
|
import com.ruoyi.bas.srgvmap.service.RoadCacheService;
|
||||||
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
|
import com.ruoyi.common.domain.CustomThread;
|
||||||
import com.ruoyi.common.domain.SendData2;
|
import com.ruoyi.common.domain.SendData2;
|
||||||
import com.ruoyi.common.utils.spring.SpringUtils;
|
import com.ruoyi.common.utils.spring.SpringUtils;
|
||||||
import com.ruoyi.device.srgv.domain.DeviceSrgv;
|
import com.ruoyi.device.srgv.domain.DeviceSrgv;
|
||||||
import com.ruoyi.job.charg.domain.SrgvChargingJob;
|
import com.ruoyi.job.charg.domain.SrgvChargingJob;
|
||||||
import com.ruoyi.job.charg.service.ISrgvChargingJobService;
|
import com.ruoyi.job.charg.service.ISrgvChargingJobService;
|
||||||
|
import com.ruoyi.job.domain.JobCallBack;
|
||||||
import com.ruoyi.job.domain.MydoJob;
|
import com.ruoyi.job.domain.MydoJob;
|
||||||
import com.ruoyi.job.service.IMydoJobService;
|
import com.ruoyi.job.service.IMydoJobService;
|
||||||
|
import com.ruoyi.job.service.impl.JobCallBackServiceImpl;
|
||||||
import com.ruoyi.queue.srgv.domain.WcsSrgvQueue;
|
import com.ruoyi.queue.srgv.domain.WcsSrgvQueue;
|
||||||
import com.ruoyi.queue.srgv.service.IWcsSrgvQueueFinishService;
|
import com.ruoyi.queue.srgv.service.IWcsSrgvQueueFinishService;
|
||||||
import com.ruoyi.queue.srgv.service.IWcsSrgvQueueService;
|
import com.ruoyi.queue.srgv.service.IWcsSrgvQueueService;
|
||||||
|
import com.ruoyi.schedule.ScheduleThread;
|
||||||
import com.ruoyi.schedule.plcRead.srgv.PlcSrgvRead;
|
import com.ruoyi.schedule.plcRead.srgv.PlcSrgvRead;
|
||||||
import com.ruoyi.schedule.plcRead.srgv.roadUtil.PathFinder;
|
import com.ruoyi.schedule.plcRead.srgv.roadUtil.PathFinder;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@@ -50,7 +57,8 @@ public class BaseSRgvThread implements Runnable, SRgvThreadInterface {
|
|||||||
public IWcsSrgvMapService wcsSrgvMapService;
|
public IWcsSrgvMapService wcsSrgvMapService;
|
||||||
|
|
||||||
public RoadCacheService roadCacheService;
|
public RoadCacheService roadCacheService;
|
||||||
|
private IApiService apiService;
|
||||||
|
private JobCallBackServiceImpl jobCallBackService;
|
||||||
|
|
||||||
public void init() {
|
public void init() {
|
||||||
sRgvCodeList = new HashMap<>();
|
sRgvCodeList = new HashMap<>();
|
||||||
@@ -67,6 +75,8 @@ public class BaseSRgvThread implements Runnable, SRgvThreadInterface {
|
|||||||
mydoJobService = SpringUtils.getBean(IMydoJobService.class);
|
mydoJobService = SpringUtils.getBean(IMydoJobService.class);
|
||||||
wcsSrgvMapService = SpringUtils.getBean(IWcsSrgvMapService.class);
|
wcsSrgvMapService = SpringUtils.getBean(IWcsSrgvMapService.class);
|
||||||
roadCacheService = SpringUtils.getBean(RoadCacheService.class);
|
roadCacheService = SpringUtils.getBean(RoadCacheService.class);
|
||||||
|
apiService = SpringUtils.getBean(IApiService.class);
|
||||||
|
jobCallBackService = SpringUtils.getBean(JobCallBackServiceImpl.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -83,15 +93,15 @@ public class BaseSRgvThread implements Runnable, SRgvThreadInterface {
|
|||||||
if (ObjUtil.isNotNull(PlcSrgvRead.deviceSrgvMap.get(code))) {
|
if (ObjUtil.isNotNull(PlcSrgvRead.deviceSrgvMap.get(code))) {
|
||||||
|
|
||||||
DeviceSrgv deviceSrgv = PlcSrgvRead.deviceSrgvMap.get(code);
|
DeviceSrgv deviceSrgv = PlcSrgvRead.deviceSrgvMap.get(code);
|
||||||
|
// 小车任务下发 完成
|
||||||
sRgvTask(deviceSrgv);
|
sRgvTask(deviceSrgv);
|
||||||
|
// 入库队列
|
||||||
createCarInQueue();
|
createCarInQueue();
|
||||||
|
// 出库队列
|
||||||
createCarOutQueue();
|
createCarOutQueue();
|
||||||
|
// 充电任务
|
||||||
inCharging(deviceSrgv);
|
inCharging(deviceSrgv);
|
||||||
|
// 充电完成调离
|
||||||
outCharging(deviceSrgv);
|
outCharging(deviceSrgv);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@@ -202,7 +212,7 @@ public class BaseSRgvThread implements Runnable, SRgvThreadInterface {
|
|||||||
if (wcsSrgvQueue1 == null) {
|
if (wcsSrgvQueue1 == null) {
|
||||||
ConcurrentHashMap<String, DeviceSrgv> deviceSrgvMap = PlcSrgvRead.deviceSrgvMap;
|
ConcurrentHashMap<String, DeviceSrgv> deviceSrgvMap = PlcSrgvRead.deviceSrgvMap;
|
||||||
List<DeviceSrgv> deviceSrgvList = deviceSrgvMap.values().stream()
|
List<DeviceSrgv> deviceSrgvList = deviceSrgvMap.values().stream()
|
||||||
.filter(deviceSrgv -> deviceSrgv.getWorkMode() == 4)
|
.filter(deviceSrgv -> deviceSrgv.getWorkMode() == 5)
|
||||||
.sorted((d1, d2) -> Math.abs(Integer.parseInt(mydoJob1.getTheFloor()) - d2.getCurrFloor())
|
.sorted((d1, d2) -> Math.abs(Integer.parseInt(mydoJob1.getTheFloor()) - d2.getCurrFloor())
|
||||||
- Math.abs(Integer.parseInt(mydoJob1.getTheFloor()) - d1.getCurrFloor()))
|
- Math.abs(Integer.parseInt(mydoJob1.getTheFloor()) - d1.getCurrFloor()))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
@@ -233,8 +243,9 @@ public class BaseSRgvThread implements Runnable, SRgvThreadInterface {
|
|||||||
List<WcsSrgvMap> wcsSrgvMaps = wcsSrgvMapService.selectWcsSrgvMapList(wcsSrgvMap);
|
List<WcsSrgvMap> wcsSrgvMaps = wcsSrgvMapService.selectWcsSrgvMapList(wcsSrgvMap);
|
||||||
//取货地址
|
//取货地址
|
||||||
String cargoPickSite = wcsSrgvMaps.get(0).getSiteId();
|
String cargoPickSite = wcsSrgvMaps.get(0).getSiteId();
|
||||||
|
Integer currFloor = deviceSrgv.getCurrFloor();
|
||||||
if (deviceSrgv.getCurrFloor().equals(wcsSrgvMaps.get(0).getTheLayer())) {
|
Integer theLayer = wcsSrgvMaps.get(0).getPlcLayer();
|
||||||
|
if (Objects.equals(deviceSrgv.getCurrFloor(), wcsSrgvMaps.get(0).getPlcLayer())) {
|
||||||
//终点是巷道口到位输送线
|
//终点是巷道口到位输送线
|
||||||
endSite = cargoPickSite;
|
endSite = cargoPickSite;
|
||||||
if (cargoPickSite.equals(deviceSrgv.getCurrSite())) {
|
if (cargoPickSite.equals(deviceSrgv.getCurrSite())) {
|
||||||
@@ -251,7 +262,7 @@ public class BaseSRgvThread implements Runnable, SRgvThreadInterface {
|
|||||||
String cargoPlaceSite = wcsSrgvMaps1.get(0).getSiteId();
|
String cargoPlaceSite = wcsSrgvMaps1.get(0).getSiteId();
|
||||||
|
|
||||||
List<DeviceSrgv> sameSiteDevices = deviceSrgvMap.values().stream()
|
List<DeviceSrgv> sameSiteDevices = deviceSrgvMap.values().stream()
|
||||||
.filter(d -> d.getWorkMode() == 4
|
.filter(d -> d.getWorkMode() == 5
|
||||||
&& d.getStatus() == 1
|
&& d.getStatus() == 1
|
||||||
&& d.getCurrSite().equals(cargoPlaceSite))
|
&& d.getCurrSite().equals(cargoPlaceSite))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
@@ -343,7 +354,8 @@ public class BaseSRgvThread implements Runnable, SRgvThreadInterface {
|
|||||||
ConcurrentHashMap<String, DeviceSrgv> deviceSrgvMap = PlcSrgvRead.deviceSrgvMap;
|
ConcurrentHashMap<String, DeviceSrgv> deviceSrgvMap = PlcSrgvRead.deviceSrgvMap;
|
||||||
|
|
||||||
List<DeviceSrgv> deviceSrgvList = deviceSrgvMap.values().stream()
|
List<DeviceSrgv> deviceSrgvList = deviceSrgvMap.values().stream()
|
||||||
.filter(deviceSrgv -> deviceSrgv.getWorkMode() == 4)
|
.filter(deviceSrgv -> deviceSrgv.getWorkMode() == 5)
|
||||||
|
.filter(deviceSrgv -> deviceSrgv.getCurrFloor() > 0)
|
||||||
.sorted((d1, d2) -> d2.getCurrFloor().compareTo(d1.getCurrFloor()))
|
.sorted((d1, d2) -> d2.getCurrFloor().compareTo(d1.getCurrFloor()))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
if (!deviceSrgvList.isEmpty()) {
|
if (!deviceSrgvList.isEmpty()) {
|
||||||
@@ -394,7 +406,7 @@ public class BaseSRgvThread implements Runnable, SRgvThreadInterface {
|
|||||||
//筛选出deviceSrgvMap中deviceSrgv.getWorkMode() == 4并且deviceSrgv.getStatus() == 1并且deviceSrgv.getCurrSite() == cargoPickSite得对象,并排除掉其中deviceId与deviceSrgv.getDeviceId()相同的对象
|
//筛选出deviceSrgvMap中deviceSrgv.getWorkMode() == 4并且deviceSrgv.getStatus() == 1并且deviceSrgv.getCurrSite() == cargoPickSite得对象,并排除掉其中deviceId与deviceSrgv.getDeviceId()相同的对象
|
||||||
|
|
||||||
List<DeviceSrgv> sameSiteDevices = deviceSrgvMap.values().stream()
|
List<DeviceSrgv> sameSiteDevices = deviceSrgvMap.values().stream()
|
||||||
.filter(d -> d.getWorkMode() == 4
|
.filter(d -> d.getWorkMode() == 5
|
||||||
&& d.getStatus() == 1
|
&& d.getStatus() == 1
|
||||||
&& d.getCurrSite().equals(cargoPickSite))
|
&& d.getCurrSite().equals(cargoPickSite))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
@@ -438,8 +450,6 @@ public class BaseSRgvThread implements Runnable, SRgvThreadInterface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//生成小车取货队列
|
//生成小车取货队列
|
||||||
WcsSrgvQueue wcsSrgvQueue = new WcsSrgvQueue();
|
WcsSrgvQueue wcsSrgvQueue = new WcsSrgvQueue();
|
||||||
wcsSrgvQueue.setGuid(UUID.randomUUID().toString());
|
wcsSrgvQueue.setGuid(UUID.randomUUID().toString());
|
||||||
@@ -484,7 +494,7 @@ public class BaseSRgvThread implements Runnable, SRgvThreadInterface {
|
|||||||
}
|
}
|
||||||
for (WcsSrgvQueue wcsSrgvQueue : wcsSrgvQueues) {
|
for (WcsSrgvQueue wcsSrgvQueue : wcsSrgvQueues) {
|
||||||
String agvId = wcsSrgvQueue.getAgvId();
|
String agvId = wcsSrgvQueue.getAgvId();
|
||||||
if (agvId.equals(Convert.toStr(deviceSrgv.getDeviceId())) && deviceSrgv.getWorkMode() == 4 && deviceSrgv.getAllowSend() == 1) {
|
if (agvId.equals(Convert.toStr(deviceSrgv.getDeviceId())) && deviceSrgv.getWorkMode() == 5 && deviceSrgv.getAllowSend() == 1) {
|
||||||
String startSite = wcsSrgvQueue.getStartSite();
|
String startSite = wcsSrgvQueue.getStartSite();
|
||||||
String endSite = wcsSrgvQueue.getEndSite();
|
String endSite = wcsSrgvQueue.getEndSite();
|
||||||
String currSite = deviceSrgv.getCurrSite();
|
String currSite = deviceSrgv.getCurrSite();
|
||||||
@@ -511,7 +521,14 @@ public class BaseSRgvThread implements Runnable, SRgvThreadInterface {
|
|||||||
Integer floor = deviceSrgv.getCurrFloor();
|
Integer floor = deviceSrgv.getCurrFloor();
|
||||||
//获取当前地图
|
//获取当前地图
|
||||||
Map<String, WcsSrgvMap> arrByRoadSite = roadCacheService.getArrByRoadSite(floor);
|
Map<String, WcsSrgvMap> arrByRoadSite = roadCacheService.getArrByRoadSite(floor);
|
||||||
|
if ((wcsSrgvQueue.getDefault02().equals("1") || wcsSrgvQueue.getDefault02().equals("2") || wcsSrgvQueue.getDefault02().equals("4")) && wcsSrgvQueue.getTheFloor().equals("1") && !wcsSrgvQueue.getEndSite().equals("tsj")) {
|
||||||
|
//如果是1层 锁定提升机站点
|
||||||
|
if (CollUtil.isNotEmpty(arrByRoadSite) && arrByRoadSite.values().iterator().next().getZ() == 1) {
|
||||||
|
if (arrByRoadSite.containsKey("080501")) {
|
||||||
|
arrByRoadSite.get("080501").setValue(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
//处理地图
|
//处理地图
|
||||||
int[][] emptyMap = roadCacheService.handleMap(arrByRoadSite, deviceSrgv);
|
int[][] emptyMap = roadCacheService.handleMap(arrByRoadSite, deviceSrgv);
|
||||||
|
|
||||||
@@ -522,6 +539,7 @@ public class BaseSRgvThread implements Runnable, SRgvThreadInterface {
|
|||||||
if (shortestPath == null || shortestPath.isEmpty()) {
|
if (shortestPath == null || shortestPath.isEmpty()) {
|
||||||
//判断是否是1层 空车取货 或者 满车放货
|
//判断是否是1层 空车取货 或者 满车放货
|
||||||
if (floor == 1) {
|
if (floor == 1) {
|
||||||
|
|
||||||
if ("2".equals(wcsSrgvQueue.getDefault02()) && "tsj".equals(wcsSrgvQueue.getStartSite()) && wcsSrgvQueue.getEndSite().equals(wcsSrgvQueue.getCargoPlaceSite())) {
|
if ("2".equals(wcsSrgvQueue.getDefault02()) && "tsj".equals(wcsSrgvQueue.getStartSite()) && wcsSrgvQueue.getEndSite().equals(wcsSrgvQueue.getCargoPlaceSite())) {
|
||||||
//1层满车放货
|
//1层满车放货
|
||||||
//修改终点到出库缓存点
|
//修改终点到出库缓存点
|
||||||
@@ -571,10 +589,8 @@ public class BaseSRgvThread implements Runnable, SRgvThreadInterface {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -617,17 +633,22 @@ public class BaseSRgvThread implements Runnable, SRgvThreadInterface {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (("tsj").equals(endSite)) {
|
||||||
|
endSite = "09050" + wcsSrgvQueue.getTheFloor();
|
||||||
|
}
|
||||||
|
// if (("tsj").equals(startSite)) {
|
||||||
|
// endSite = "09050" + wcsSrgvQueue.getTheFloor();
|
||||||
|
// }
|
||||||
List<SendData2> sendDataList = new ArrayList<>();
|
List<SendData2> sendDataList = new ArrayList<>();
|
||||||
if (!trun.isEmpty()) {
|
if (!trun.isEmpty()) {
|
||||||
SendData2 path = new SendData2();
|
SendData2 path = new SendData2();
|
||||||
path.setAddress("4000");//地址
|
path.setAddress("4004");//地址
|
||||||
path.setData(startSite + "," + endSite + "," + turnBuilder);
|
path.setData(startSite + "," + endSite + "," + turnBuilder);
|
||||||
path.setType(2);
|
path.setType(2);
|
||||||
sendDataList.add(path);
|
sendDataList.add(path);
|
||||||
} else {
|
} else {
|
||||||
SendData2 path = new SendData2();
|
SendData2 path = new SendData2();
|
||||||
path.setAddress("4000");//地址
|
path.setAddress("4004");//地址
|
||||||
path.setData(startSite + "," + endSite);
|
path.setData(startSite + "," + endSite);
|
||||||
path.setType(2);
|
path.setType(2);
|
||||||
sendDataList.add(path);
|
sendDataList.add(path);
|
||||||
@@ -635,33 +656,40 @@ public class BaseSRgvThread implements Runnable, SRgvThreadInterface {
|
|||||||
|
|
||||||
|
|
||||||
//任务号、原、目标数据转换
|
//任务号、原、目标数据转换
|
||||||
String siteId = wcsSrgvQueue.getTaskNo() + "1";//+ "," + startSite + "," + endSite;
|
String siteId = wcsSrgvQueue.getTaskNo();//+ "," + startSite + "," + endSite;
|
||||||
SendData2 site = new SendData2();
|
SendData2 site = new SendData2();
|
||||||
site.setAddress("4400");
|
site.setAddress("4000");
|
||||||
site.setData(siteId);
|
site.setData(siteId);
|
||||||
site.setType(2);
|
site.setType(2);
|
||||||
sendDataList.add(site);
|
sendDataList.add(site);
|
||||||
|
|
||||||
//任务类型转换
|
//任务类型转换
|
||||||
SendData2 taskType = new SendData2();
|
SendData2 taskType = new SendData2();
|
||||||
taskType.setAddress("2200");
|
taskType.setAddress("4002");
|
||||||
taskType.setData(wcsSrgvQueue.getTaskType());
|
taskType.setData(wcsSrgvQueue.getDefault02());
|
||||||
taskType.setType(1);
|
taskType.setType(1);
|
||||||
sendDataList.add(taskType);
|
sendDataList.add(taskType);
|
||||||
|
|
||||||
//下发标志转换
|
//下发标志转换
|
||||||
SendData2 flag = new SendData2();
|
SendData2 flag = new SendData2();
|
||||||
flag.setAddress("2202");
|
flag.setAddress("4021");
|
||||||
flag.setData("1");
|
flag.setData("1");
|
||||||
flag.setType(1);
|
flag.setType(1);
|
||||||
sendDataList.add(flag);
|
sendDataList.add(flag);
|
||||||
|
|
||||||
//下发数据
|
//下发数据
|
||||||
boolean b = true;// sendCarTask(sendDataList, deviceSrgv);
|
boolean b = sendCarTask(sendDataList, deviceSrgv);
|
||||||
if (b) {
|
if (b) {
|
||||||
wcsSrgvQueue.setPathInfo(pathBuilder.toString());
|
wcsSrgvQueue.setPathInfo(pathBuilder.toString());
|
||||||
wcsSrgvQueue.setTrunPath(turnBuilder.toString());
|
wcsSrgvQueue.setTrunPath(turnBuilder.toString());
|
||||||
|
wcsSrgvQueue.setIssued("1");
|
||||||
|
wcsSrgvQueue.setExecutionStatus("3");
|
||||||
wcsSagvQueueMapper.updateWcsSrgvQueue(wcsSrgvQueue);
|
wcsSagvQueueMapper.updateWcsSrgvQueue(wcsSrgvQueue);
|
||||||
|
MydoJob mydoJob = new MydoJob();
|
||||||
|
mydoJob.setTaskNo(wcsSrgvQueue.getTaskNo());
|
||||||
|
mydoJob.setExecutionPhase("3");
|
||||||
|
mydoJob.setStatus("3");
|
||||||
|
mydoJobService.updateMydoJob(mydoJob);
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
log.error("小车下发失败 taskNo:{}", wcsSrgvQueue.getTaskNo());
|
log.error("小车下发失败 taskNo:{}", wcsSrgvQueue.getTaskNo());
|
||||||
@@ -698,7 +726,28 @@ public class BaseSRgvThread implements Runnable, SRgvThreadInterface {
|
|||||||
private boolean sendCarTask(List<SendData2> sendDataList, DeviceSrgv deviceSrgv) {
|
private boolean sendCarTask(List<SendData2> sendDataList, DeviceSrgv deviceSrgv) {
|
||||||
|
|
||||||
boolean b = true;
|
boolean b = true;
|
||||||
|
ScheduleThread scheduleThread = SpringUtils.getBean(ScheduleThread.class);
|
||||||
|
CustomThread<?> ct = null;
|
||||||
|
Integer deviceId = deviceSrgv.getDeviceId();
|
||||||
|
if (deviceId != null) {
|
||||||
|
switch (deviceId) {
|
||||||
|
case 1:
|
||||||
|
ct = scheduleThread.plcSrgvReadCustomThread1;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
ct = scheduleThread.plcSrgvReadCustomThread2;
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
ct = scheduleThread.plcSrgvReadCustomThread3;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
PlcSrgvRead plcReader = ct != null ? (PlcSrgvRead) ct.getRunnable() : null;
|
||||||
|
if (plcReader == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
for (SendData2 sendData : sendDataList) {
|
for (SendData2 sendData : sendDataList) {
|
||||||
String address = sendData.getAddress();
|
String address = sendData.getAddress();
|
||||||
String data = sendData.getData();//
|
String data = sendData.getData();//
|
||||||
@@ -713,7 +762,7 @@ public class BaseSRgvThread implements Runnable, SRgvThreadInterface {
|
|||||||
.map(String::trim)
|
.map(String::trim)
|
||||||
.mapToInt(Integer::parseInt)
|
.mapToInt(Integer::parseInt)
|
||||||
.toArray();
|
.toArray();
|
||||||
boolean write = PlcSrgvRead.Write(address, intData);
|
boolean write = plcReader.Write(address, intData);
|
||||||
|
|
||||||
if (!write) {
|
if (!write) {
|
||||||
b = false;
|
b = false;
|
||||||
@@ -735,7 +784,7 @@ public class BaseSRgvThread implements Runnable, SRgvThreadInterface {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean write = PlcSrgvRead.Write(address, shortData);
|
boolean write = plcReader.Write(address, shortData);
|
||||||
|
|
||||||
if (!write) {
|
if (!write) {
|
||||||
b = false;
|
b = false;
|
||||||
@@ -757,7 +806,7 @@ public class BaseSRgvThread implements Runnable, SRgvThreadInterface {
|
|||||||
*/
|
*/
|
||||||
private void completeCarTask(DeviceSrgv deviceSrgv) {
|
private void completeCarTask(DeviceSrgv deviceSrgv) {
|
||||||
//联机自动
|
//联机自动
|
||||||
if (deviceSrgv.getWorkMode() == 4) {
|
if (deviceSrgv.getWorkMode() == 5) {
|
||||||
if (deviceSrgv.getStatus() == 1) {
|
if (deviceSrgv.getStatus() == 1) {
|
||||||
WcsSrgvQueue param = new WcsSrgvQueue();
|
WcsSrgvQueue param = new WcsSrgvQueue();
|
||||||
param.setAgvId(Convert.toStr(deviceSrgv.getDeviceId()));
|
param.setAgvId(Convert.toStr(deviceSrgv.getDeviceId()));
|
||||||
@@ -767,14 +816,7 @@ public class BaseSRgvThread implements Runnable, SRgvThreadInterface {
|
|||||||
List<WcsSrgvQueue> wcsSagvQueues = wcsSagvQueueMapper.selectWcsSrgvQueueList(param);//查询到达目标的
|
List<WcsSrgvQueue> wcsSagvQueues = wcsSagvQueueMapper.selectWcsSrgvQueueList(param);//查询到达目标的
|
||||||
if (CollUtil.isNotEmpty(wcsSagvQueues)) {
|
if (CollUtil.isNotEmpty(wcsSagvQueues)) {
|
||||||
WcsSrgvQueue wcsSrgvQueue = wcsSagvQueues.get(0);
|
WcsSrgvQueue wcsSrgvQueue = wcsSagvQueues.get(0);
|
||||||
|
|
||||||
/*
|
|
||||||
* 1、不处理终点是提升机站点的四向车
|
|
||||||
* 2、处理终点不是提升机站点的
|
|
||||||
* */
|
|
||||||
|
|
||||||
finishTaskByQueue(deviceSrgv.getCurrSite(), wcsSrgvQueue);
|
finishTaskByQueue(deviceSrgv.getCurrSite(), wcsSrgvQueue);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -790,47 +832,43 @@ public class BaseSRgvThread implements Runnable, SRgvThreadInterface {
|
|||||||
private void finishTaskByQueue(String currSite, WcsSrgvQueue wcsSrgvQueue) {
|
private void finishTaskByQueue(String currSite, WcsSrgvQueue wcsSrgvQueue) {
|
||||||
|
|
||||||
|
|
||||||
//当前在终点
|
// 如果当前在终点
|
||||||
if (Objects.equals(currSite, wcsSrgvQueue.getEndSite())) {
|
if (Objects.equals(currSite, wcsSrgvQueue.getEndSite())) {
|
||||||
String taskType = wcsSrgvQueue.getTaskType();
|
String taskType = wcsSrgvQueue.getTaskType();
|
||||||
String cargoPickSite = wcsSrgvQueue.getCargoPickSite();
|
String cargoPickSite = wcsSrgvQueue.getCargoPickSite();
|
||||||
String cargoPlaceSite = wcsSrgvQueue.getCargoPlaceSite();
|
String cargoPlaceSite = wcsSrgvQueue.getCargoPlaceSite();
|
||||||
WcsSrgvMap wcsSrgvMap = new WcsSrgvMap();
|
WcsSrgvMap wcsSrgvMap = new WcsSrgvMap();
|
||||||
|
|
||||||
wcsSrgvMap.setRemark("outCache");
|
wcsSrgvMap.setRemark("outCache");
|
||||||
List<WcsSrgvMap> wcsSrgvMaps = wcsSrgvMapService.selectWcsSrgvMapList(wcsSrgvMap);
|
List<WcsSrgvMap> wcsSrgvMaps = wcsSrgvMapService.selectWcsSrgvMapList(wcsSrgvMap);
|
||||||
|
//当前路径地图map中如果存在小车的站点,返回true
|
||||||
if (wcsSrgvMaps.stream().anyMatch(wcsSrgvMap1 -> wcsSrgvMap1.getSiteId().equals(currSite))) {
|
if (wcsSrgvMaps.stream().anyMatch(wcsSrgvMap1 -> wcsSrgvMap1.getSiteId().equals(currSite))) {
|
||||||
//生成小车从避让点到放货/取货位置,如果是空车就到取货位置,如果是满车就到放货位置
|
//生成小车从避让点到放货/取货位置,如果是空车就到取货位置,如果是满车就到放货位置
|
||||||
wcsSrgvQueue.setExecutionStatus("4");
|
// wcsSrgvQueue.setExecutionStatus("4");
|
||||||
wcsSagvQueueMapper.insertHistory(wcsSrgvQueue.getTaskNo());
|
// wcsSagvQueueMapper.insertHistory(wcsSrgvQueue.getTaskNo());
|
||||||
wcsSrgvQueue.setIssued("0");
|
// wcsSrgvQueue.setIssued("0");
|
||||||
wcsSrgvQueue.setExecutionStatus("1");
|
// wcsSrgvQueue.setExecutionStatus("1");
|
||||||
wcsSrgvQueue.setStartSite(currSite);
|
// wcsSrgvQueue.setStartSite(currSite);
|
||||||
if("1".equals(taskType)){
|
// if ("1".equals(taskType)) {
|
||||||
wcsSrgvQueue.setEndSite(cargoPickSite);
|
// wcsSrgvQueue.setEndSite(cargoPickSite);
|
||||||
}else if("2".equals(taskType)){
|
// } else if ("2".equals(taskType)) {
|
||||||
wcsSrgvQueue.setEndSite(cargoPlaceSite);
|
// wcsSrgvQueue.setEndSite(cargoPlaceSite);
|
||||||
|
// }
|
||||||
|
// wcsSrgvQueue.setTheFloor("1");
|
||||||
|
// wcsSrgvQueue.setDefault07("1");
|
||||||
|
// wcsSagvQueueMapper.updateWcsSrgvQueue(wcsSrgvQueue);
|
||||||
|
// return;
|
||||||
}
|
}
|
||||||
wcsSrgvQueue.setTheFloor("1");
|
//空车任务 且当前车的位置和取货位置相同
|
||||||
wcsSrgvQueue.setDefault07("1");
|
|
||||||
wcsSagvQueueMapper.updateWcsSrgvQueue(wcsSrgvQueue);
|
|
||||||
return;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//空车现在位置是取货位置(移库取货,入库取货,出库取货),满车现在是放货位置
|
|
||||||
if ("1".equals(taskType) && cargoPickSite.equals(currSite)) {
|
if ("1".equals(taskType) && cargoPickSite.equals(currSite)) {
|
||||||
//修改队列起终点,下发类型,重新下发。怎么区分重新下发的类型是移库还是入库,还有可能是出库取货--》判断取货位置是否为入库点
|
|
||||||
|
|
||||||
//判断放货位置是否同一层,修改队列原层目标层,起终点
|
|
||||||
//查询放货位置层数
|
|
||||||
WcsSrgvMap wcsSrgvMapq = wcsSrgvMapService.selectWcsSrgvMapBySiteId(cargoPickSite);
|
WcsSrgvMap wcsSrgvMapq = wcsSrgvMapService.selectWcsSrgvMapBySiteId(cargoPickSite);
|
||||||
WcsSrgvMap wcsSrgvMapf = wcsSrgvMapService.selectWcsSrgvMapBySiteId(cargoPlaceSite);
|
WcsSrgvMap wcsSrgvMapf = wcsSrgvMapService.selectWcsSrgvMapBySiteId(cargoPlaceSite);
|
||||||
String endSite = "";
|
String endSite = "";
|
||||||
String xfType = "";
|
String xfType = "";
|
||||||
|
// 取货点地图和放货点地图不为空
|
||||||
if (wcsSrgvMapq != null && wcsSrgvMapf != null) {
|
if (wcsSrgvMapq != null && wcsSrgvMapf != null) {
|
||||||
|
|
||||||
if (Objects.equals(wcsSrgvMapq.getTheLayer(), wcsSrgvMapf.getTheLayer())) {
|
if (Objects.equals(wcsSrgvMapq.getTheLayer(), wcsSrgvMapf.getTheLayer())) {
|
||||||
//如果是同层,终点为放货点
|
//如果是同层,终点为放货点
|
||||||
endSite = cargoPlaceSite;
|
endSite = cargoPlaceSite;
|
||||||
@@ -848,6 +886,7 @@ public class BaseSRgvThread implements Runnable, SRgvThreadInterface {
|
|||||||
xfType = "7";//移库
|
xfType = "7";//移库
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// 更新目标点,修改执行队列
|
||||||
wcsSrgvQueue.setExecutionStatus("4");
|
wcsSrgvQueue.setExecutionStatus("4");
|
||||||
wcsSagvQueueMapper.insertHistory(wcsSrgvQueue.getTaskNo());
|
wcsSagvQueueMapper.insertHistory(wcsSrgvQueue.getTaskNo());
|
||||||
wcsSrgvQueue.setStartSite(currSite);
|
wcsSrgvQueue.setStartSite(currSite);
|
||||||
@@ -857,17 +896,36 @@ public class BaseSRgvThread implements Runnable, SRgvThreadInterface {
|
|||||||
wcsSrgvQueue.setDefault07(wcsSrgvMapf.getTheLayer().toString());
|
wcsSrgvQueue.setDefault07(wcsSrgvMapf.getTheLayer().toString());
|
||||||
wcsSrgvQueue.setIssued("0");
|
wcsSrgvQueue.setIssued("0");
|
||||||
wcsSrgvQueue.setExecutionStatus("1");
|
wcsSrgvQueue.setExecutionStatus("1");
|
||||||
|
wcsSrgvQueue.setTaskType("2");
|
||||||
wcsSagvQueueMapper.updateWcsSrgvQueue(wcsSrgvQueue);
|
wcsSagvQueueMapper.updateWcsSrgvQueue(wcsSrgvQueue);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
// 入库任务 原地址和目标地址不同,且小车当前地址和放货地址相同处理入库任务执行队列
|
||||||
} else if ("2".equals(taskType) && cargoPlaceSite.equals(currSite)) {
|
} else if ("2".equals(taskType) && cargoPlaceSite.equals(currSite)) {
|
||||||
//判断对列的任务类型
|
//判断对列的任务类型 当前只限于处理出库任务执行队列
|
||||||
switch (wcsSrgvQueue.getDefault02()) {
|
switch (wcsSrgvQueue.getDefault02()) {
|
||||||
case "1"://入库,插库存,
|
case "1"://入库,插库存,
|
||||||
//请求wms生成库存
|
//请求wms生成库存 插入回传表
|
||||||
|
MydoJob mydoJob = mydoJobService.selectMydoJobByTaskNo(Long.valueOf(wcsSrgvQueue.getTaskNo()));
|
||||||
|
if (mydoJob != null) {
|
||||||
|
JobCallBack jobCallBack = new JobCallBack();
|
||||||
|
jobCallBack.setType(wcsSrgvQueue.getDefault02());
|
||||||
|
jobCallBack.setMydojobId(mydoJob.getJobId());
|
||||||
|
jobCallBack.setStatus("0");
|
||||||
|
jobCallBack.setTaskNo(Convert.toLong(mydoJob.getTaskNo()));
|
||||||
|
jobCallBack.setCreateTime(new Date());
|
||||||
|
jobCallBackService.insertJobCallBack(jobCallBack);
|
||||||
|
mydoJobService.deleteMydoJobByJobId(mydoJob.getJobId());
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case "2":
|
||||||
|
MydoJob mydoJobOut = mydoJobService.selectMydoJobByTaskNo(Long.valueOf(wcsSrgvQueue.getTaskNo()));
|
||||||
|
if (mydoJobOut != null) {
|
||||||
|
mydoJobService.deleteMydoJobByJobId(mydoJobOut.getJobId());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
case "7"://移库,变动库存
|
case "7"://移库,变动库存
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -124,7 +124,7 @@ public class SsjThread implements Runnable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void inDispatch1(DeviceSsj deviceSsj) {
|
void inDispatch1(DeviceSsj deviceSsj) {
|
||||||
if (deviceSsj.getDw() == 1 && StrUtil.isNotBlank(deviceSsj.getTrayCode())) {
|
if (deviceSsj.getRkqq() == 1 && StrUtil.isNotBlank(deviceSsj.getTrayCode())) {
|
||||||
//todo 查是否为入库模式,不是退回,是否超重
|
//todo 查是否为入库模式,不是退回,是否超重
|
||||||
HashMap<String, Object> map = new HashMap<>();
|
HashMap<String, Object> map = new HashMap<>();
|
||||||
map.put("trayCode", deviceSsj.getTrayCode());
|
map.put("trayCode", deviceSsj.getTrayCode());
|
||||||
@@ -141,7 +141,13 @@ public class SsjThread implements Runnable {
|
|||||||
} else {
|
} else {
|
||||||
mydoJob.setEntranceId("L1005");
|
mydoJob.setEntranceId("L1005");
|
||||||
}
|
}
|
||||||
|
// 插入入库作业,并且根据作业直接下发 ,下发完毕直接修改执行阶段
|
||||||
|
MydoJob mydoJob1 = new MydoJob();
|
||||||
|
mydoJob1.setTrayCode(mydoJob.getTaskNo());
|
||||||
|
List<MydoJob> mydoJobs = mydoJobService.selectMydoJobList(mydoJob1);
|
||||||
|
if (mydoJobs.size() > 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
mydoJobService.insertMydoJob(mydoJob);
|
mydoJobService.insertMydoJob(mydoJob);
|
||||||
int i = writeToSsj(deviceSsj.getPlcDbWriteAddress(), mydoJob.getTaskNo(), 1, 1);
|
int i = writeToSsj(deviceSsj.getPlcDbWriteAddress(), mydoJob.getTaskNo(), 1, 1);
|
||||||
if (i == 1) {
|
if (i == 1) {
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ import com.ruoyi.queue.tsj.domain.TsjDeviceExecutionQueueFinish;
|
|||||||
import com.ruoyi.queue.tsj.service.ITsjDeviceExecutionQueueFinishService;
|
import com.ruoyi.queue.tsj.service.ITsjDeviceExecutionQueueFinishService;
|
||||||
import com.ruoyi.queue.tsj.service.ITsjDeviceExecutionQueueService;
|
import com.ruoyi.queue.tsj.service.ITsjDeviceExecutionQueueService;
|
||||||
import com.ruoyi.schedule.plcRead.srgv.PlcSrgvRead;
|
import com.ruoyi.schedule.plcRead.srgv.PlcSrgvRead;
|
||||||
|
import com.ruoyi.schedule.plcRead.ssj.PlcSsjRead;
|
||||||
import com.ruoyi.schedule.plcRead.tsj.PlcTsjRead;
|
import com.ruoyi.schedule.plcRead.tsj.PlcTsjRead;
|
||||||
import com.ruoyi.schedule.plcRead.util.Tools;
|
import com.ruoyi.schedule.plcRead.util.Tools;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@@ -88,8 +89,13 @@ public class TsjThread implements Runnable {
|
|||||||
*
|
*
|
||||||
* */
|
* */
|
||||||
if (czfs == 2 && sbzt == 2 && jdbz == 4 && rwh > 999) {
|
if (czfs == 2 && sbzt == 2 && jdbz == 4 && rwh > 999) {
|
||||||
createSRgvQueue(rwh);
|
createSRgvQueue(rwh, tsj);
|
||||||
}
|
}
|
||||||
|
// 提升机取货中 说明对齐当前要取货层 开始给小车下发
|
||||||
|
if (czfs == 2 && sbzt == 2 && jdbz == 2 && rwh > 999) {
|
||||||
|
createSRgvQueueTsjQd(rwh, tsj);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 2、任务完成
|
* 2、任务完成
|
||||||
*
|
*
|
||||||
@@ -111,9 +117,39 @@ public class TsjThread implements Runnable {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void createSRgvQueue(Long rwh) {
|
// 下发提升机启动
|
||||||
|
private void createSRgvQueueTsjQd(Long rwh, DeviceTsj tsj) {
|
||||||
|
for (String sRgv : PlcSrgvRead.deviceSrgvMap.keySet()) {
|
||||||
|
DeviceSrgv deviceSrgv = PlcSrgvRead.deviceSrgvMap.get(sRgv);
|
||||||
|
if (deviceSrgv.getCurrSite().equals("09050" + deviceSrgv.getCurrFloor()) && deviceSrgv.getWorkMode() == 5 && deviceSrgv.getStatus() == 2 && tsj.getHczt() == 1) {
|
||||||
|
|
||||||
|
SendData rwlxSendData = new SendData(Tools.INT, 1);
|
||||||
|
DeviceTsj deviceTsj = PlcTsjRead.deviceTsjMap.get(Convert.toStr(1));
|
||||||
|
byte[] bytes = Tools.sendData(rwlxSendData);
|
||||||
|
int i = PlcTsjRead.WriteToTSJ("DB602.56", bytes);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
// 下发提升机完成
|
||||||
|
private void createSRgvQueueTsjFinish(Long rwh, DeviceTsj tsj) {
|
||||||
|
for (String sRgv : PlcSrgvRead.deviceSrgvMap.keySet()) {
|
||||||
|
DeviceSrgv deviceSrgv = PlcSrgvRead.deviceSrgvMap.get(sRgv);
|
||||||
|
if (deviceSrgv.getCurrSite().equals("09050" + deviceSrgv.getCurrFloor()) && deviceSrgv.getWorkMode() == 5 && deviceSrgv.getStatus() == 2 && tsj.getHczt() == 1) {
|
||||||
|
|
||||||
|
SendData rwlxSendData = new SendData(Tools.INT, 1);
|
||||||
|
DeviceTsj deviceTsj = PlcTsjRead.deviceTsjMap.get(Convert.toStr(1));
|
||||||
|
byte[] bytes = Tools.sendData(rwlxSendData);
|
||||||
|
int i = PlcTsjRead.WriteToTSJ("DB602.58", bytes);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void createSRgvQueue(Long rwh, DeviceTsj tsj) {
|
||||||
WcsSrgvQueue sRgvQueueParam = new WcsSrgvQueue();
|
WcsSrgvQueue sRgvQueueParam = new WcsSrgvQueue();
|
||||||
sRgvQueueParam.setTaskNo(Convert.toStr(rwh));
|
sRgvQueueParam.setTaskNo(Convert.toStr(rwh));
|
||||||
|
sRgvQueueParam.setEndSite(Convert.toStr("tsj"));
|
||||||
List<WcsSrgvQueue> wcsSrgvQueues = wcsSrgvQueueService.selectWcsSrgvQueueList(sRgvQueueParam);
|
List<WcsSrgvQueue> wcsSrgvQueues = wcsSrgvQueueService.selectWcsSrgvQueueList(sRgvQueueParam);
|
||||||
if (CollUtil.isEmpty(wcsSrgvQueues)) {
|
if (CollUtil.isEmpty(wcsSrgvQueues)) {
|
||||||
return;
|
return;
|
||||||
@@ -131,12 +167,14 @@ public class TsjThread implements Runnable {
|
|||||||
case "1":
|
case "1":
|
||||||
//入库
|
//入库
|
||||||
//满车
|
//满车
|
||||||
startSite = "tsj";
|
// startSite="tsj";
|
||||||
|
startSite = "09050" + tsj.getDqcs();
|
||||||
endSite = wcsSrgvQueue.getCargoPlaceSite();
|
endSite = wcsSrgvQueue.getCargoPlaceSite();
|
||||||
break;
|
break;
|
||||||
case "2":
|
case "2":
|
||||||
//出库
|
//出库
|
||||||
startSite = "tsj";
|
// startSite="tsj";
|
||||||
|
startSite = "09050" + tsj.getDqcs();
|
||||||
endSite = wcsSrgvQueue.getCargoPlaceSite();
|
endSite = wcsSrgvQueue.getCargoPlaceSite();
|
||||||
break;
|
break;
|
||||||
case "3":
|
case "3":
|
||||||
@@ -174,7 +212,7 @@ public class TsjThread implements Runnable {
|
|||||||
private void createQueue(DeviceTsj tsj) {
|
private void createQueue(DeviceTsj tsj) {
|
||||||
for (String sRgv : PlcSrgvRead.deviceSrgvMap.keySet()) {
|
for (String sRgv : PlcSrgvRead.deviceSrgvMap.keySet()) {
|
||||||
DeviceSrgv deviceSrgv = PlcSrgvRead.deviceSrgvMap.get(sRgv);
|
DeviceSrgv deviceSrgv = PlcSrgvRead.deviceSrgvMap.get(sRgv);
|
||||||
if (deviceSrgv.getSsjRequest()==1 && deviceSrgv.getTaskNo()>0){
|
if (deviceSrgv.getSpare2().equals("1") && deviceSrgv.getTaskNo() > 0) {
|
||||||
//请求进入输送机
|
//请求进入输送机
|
||||||
WcsSrgvQueue sRgvQueueParam = new WcsSrgvQueue();
|
WcsSrgvQueue sRgvQueueParam = new WcsSrgvQueue();
|
||||||
sRgvQueueParam.setAgvId(Convert.toStr(deviceSrgv.getDeviceId()));
|
sRgvQueueParam.setAgvId(Convert.toStr(deviceSrgv.getDeviceId()));
|
||||||
@@ -186,7 +224,7 @@ public class TsjThread implements Runnable {
|
|||||||
WcsSrgvQueue wcsSrgvQueue = wcsSrgvQueues.get(0);
|
WcsSrgvQueue wcsSrgvQueue = wcsSrgvQueues.get(0);
|
||||||
String strFloor = wcsSrgvQueue.getTheFloor();
|
String strFloor = wcsSrgvQueue.getTheFloor();
|
||||||
String tarFloor = wcsSrgvQueue.getDefault07();
|
String tarFloor = wcsSrgvQueue.getDefault07();
|
||||||
if (!Convert.toStr(tsj.getDqcs()).equals(strFloor)) {
|
// if (!Convert.toStr(tsj.getDqcs()).equals(strFloor)) {
|
||||||
//提升机层数和取车任务层数不一致
|
//提升机层数和取车任务层数不一致
|
||||||
//todo 判断目标楼层存在不存在其他小车
|
//todo 判断目标楼层存在不存在其他小车
|
||||||
TsjDeviceExecutionQueue tsjDeviceExecutionQueue = new TsjDeviceExecutionQueue();
|
TsjDeviceExecutionQueue tsjDeviceExecutionQueue = new TsjDeviceExecutionQueue();
|
||||||
@@ -202,9 +240,10 @@ public class TsjThread implements Runnable {
|
|||||||
tsjDeviceExecutionQueue.setCreateDate(DateUtil.formatDateTime(new Date()));
|
tsjDeviceExecutionQueue.setCreateDate(DateUtil.formatDateTime(new Date()));
|
||||||
tsjDeviceExecutionQueue.setSpare1(Convert.toStr(deviceSrgv.getDeviceId()));
|
tsjDeviceExecutionQueue.setSpare1(Convert.toStr(deviceSrgv.getDeviceId()));
|
||||||
tsjDeviceExecutionQueue.setTaskType("1");
|
tsjDeviceExecutionQueue.setTaskType("1");
|
||||||
|
tsjDeviceExecutionQueue.setSendFlag("0");
|
||||||
tsjDeviceExecutionQueue.setRwlx("1");
|
tsjDeviceExecutionQueue.setRwlx("1");
|
||||||
tsjDeviceExecutionQueueService.insertTsjDeviceExecutionQueue(tsjDeviceExecutionQueue);
|
tsjDeviceExecutionQueueService.insertTsjDeviceExecutionQueue(tsjDeviceExecutionQueue);
|
||||||
}
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -213,32 +252,34 @@ public class TsjThread implements Runnable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void sendTsj() {
|
private void sendTsj() {
|
||||||
List<TsjDeviceExecutionQueue> tsjDeviceExecutionQueues = tsjDeviceExecutionQueueService.selectTsjDeviceExecutionQueueList(new TsjDeviceExecutionQueue());
|
TsjDeviceExecutionQueue tsjDeviceExecutionQueue1 = new TsjDeviceExecutionQueue();
|
||||||
|
tsjDeviceExecutionQueue1.setSendFlag("0");
|
||||||
|
List<TsjDeviceExecutionQueue> tsjDeviceExecutionQueues = tsjDeviceExecutionQueueService.selectTsjDeviceExecutionQueueList(tsjDeviceExecutionQueue1);
|
||||||
if (CollUtil.isNotEmpty(tsjDeviceExecutionQueues)) {
|
if (CollUtil.isNotEmpty(tsjDeviceExecutionQueues)) {
|
||||||
TsjDeviceExecutionQueue tsjDeviceExecutionQueue = tsjDeviceExecutionQueues.get(0);
|
TsjDeviceExecutionQueue tsjDeviceExecutionQueue = tsjDeviceExecutionQueues.get(0);
|
||||||
|
|
||||||
//提升机移动到小车楼层 需要判断目标楼层入库点位小车是否到位
|
// //提升机移动到小车楼层 需要判断目标楼层入库点位小车是否到位
|
||||||
WcsPort param = new WcsPort();
|
// WcsPort param = new WcsPort();
|
||||||
param.setPortType("1");
|
// param.setPortType("1");
|
||||||
param.setPortRegion(tsjDeviceExecutionQueue.getTarLayer());
|
// param.setPortRegion(tsjDeviceExecutionQueue.getTarLayer());
|
||||||
param.setStatus("1");
|
// param.setStatus("1");
|
||||||
param.setSpare2("1");
|
// param.setSpare2("1");
|
||||||
List<WcsPort> wcsInPorts = wcsPortService.selectWcsPortList(param);
|
// List<WcsPort> wcsInPorts = wcsPortService.selectWcsPortList(param);
|
||||||
if (CollUtil.isEmpty(wcsInPorts)) {
|
// if (CollUtil.isEmpty(wcsInPorts)) {
|
||||||
log.info("提升机任务[{}]下发 目标楼层[{}]入库点位空闲 无法下发提升机任务", tsjDeviceExecutionQueue.getTaskNo(), tsjDeviceExecutionQueue.getTarLayer());
|
// log.info("提升机任务[{}]下发 目标楼层[{}]入库点位空闲 无法下发提升机任务", tsjDeviceExecutionQueue.getTaskNo(), tsjDeviceExecutionQueue.getTarLayer());
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
//提升机承载小车到目标楼层 需要判断目标楼层出库点位是否空闲
|
// //提升机承载小车到目标楼层 需要判断目标楼层出库点位是否空闲
|
||||||
WcsPort param1 = new WcsPort();
|
// WcsPort param1 = new WcsPort();
|
||||||
param1.setPortType("1");
|
// param1.setPortType("1");
|
||||||
param1.setPortRegion(tsjDeviceExecutionQueue.getTarLayer());
|
// param1.setPortRegion(tsjDeviceExecutionQueue.getTarLayer());
|
||||||
param1.setStatus("0");
|
// param1.setStatus("0");
|
||||||
param1.setSpare2("1");
|
// param1.setSpare2("1");
|
||||||
List<WcsPort> wcsOutPorts = wcsPortService.selectWcsPortList(param1);
|
// List<WcsPort> wcsOutPorts = wcsPortService.selectWcsPortList(param1);
|
||||||
if (CollUtil.isEmpty(wcsOutPorts)) {
|
// if (CollUtil.isEmpty(wcsOutPorts)) {
|
||||||
log.info("提升机任务[{}]下发 目标楼层[{}]出库点位占用 无法下发提升机任务", tsjDeviceExecutionQueue.getTaskNo(), tsjDeviceExecutionQueue.getTarLayer());
|
// log.info("提升机任务[{}]下发 目标楼层[{}]出库点位占用 无法下发提升机任务", tsjDeviceExecutionQueue.getTaskNo(), tsjDeviceExecutionQueue.getTarLayer());
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
|
|
||||||
writeToTsj(tsjDeviceExecutionQueues.get(0));
|
writeToTsj(tsjDeviceExecutionQueues.get(0));
|
||||||
log.info("提升机任务下发 taskNo{} 任务类型:{}", tsjDeviceExecutionQueue.getTaskNo(), tsjDeviceExecutionQueue.getRwlx());
|
log.info("提升机任务下发 taskNo{} 任务类型:{}", tsjDeviceExecutionQueue.getTaskNo(), tsjDeviceExecutionQueue.getRwlx());
|
||||||
@@ -251,22 +292,58 @@ public class TsjThread implements Runnable {
|
|||||||
* @param tsjDeviceExecutionQueue
|
* @param tsjDeviceExecutionQueue
|
||||||
*/
|
*/
|
||||||
private void writeToTsj(TsjDeviceExecutionQueue tsjDeviceExecutionQueue) {
|
private void writeToTsj(TsjDeviceExecutionQueue tsjDeviceExecutionQueue) {
|
||||||
SendData taskNoSendData = new SendData(Tools.INT, Convert.toInt(tsjDeviceExecutionQueue.getTaskNo()));
|
// SendData taskNoSendData = new SendData(Tools.INT, Convert.toInt(tsjDeviceExecutionQueue.getTaskNo()));
|
||||||
SendData srcRow = new SendData(Tools.INT, Convert.toInt(tsjDeviceExecutionQueue.getSrcRow()));
|
// SendData rwlxSendData = new SendData(Tools.INT, Convert.toInt(tsjDeviceExecutionQueue.getRwlx()));
|
||||||
SendData srcLayer = new SendData(Tools.INT, Convert.toInt(tsjDeviceExecutionQueue.getSrcLayer()));
|
// SendData srcLayer = new SendData(Tools.INT, Convert.toInt(tsjDeviceExecutionQueue.getSrcLayer()));
|
||||||
SendData tarRow = new SendData(Tools.INT, Convert.toInt(tsjDeviceExecutionQueue.getTarRow()));
|
// SendData tarLayer = new SendData(Tools.INT, Convert.toInt(tsjDeviceExecutionQueue.getTarLayer()));
|
||||||
SendData tarLayer = new SendData(Tools.INT, Convert.toInt(tsjDeviceExecutionQueue.getTarLayer()));
|
// SendData completedSendData = new SendData(Tools.INT, 1);
|
||||||
SendData sendType = new SendData(Tools.INT, Convert.toInt(tsjDeviceExecutionQueue.getSendType()));
|
// int jym = Tools.getJYM(taskNoSendData.getNum2(), srcLayer.getNum2(), tarLayer.getNum2(), completedSendData.getNum2(), rwlxSendData.getNum2());
|
||||||
|
// SendData jymSendData = new SendData(Tools.INT, jym);
|
||||||
|
// byte[] bytes = Tools.sendData(taskNoSendData, srcLayer, tarLayer, completedSendData, jymSendData);
|
||||||
|
// DeviceTsj deviceTsj = PlcTsjRead.deviceTsjMap.get(Convert.toStr(tsjDeviceExecutionQueue.getDeviceId()));
|
||||||
|
// if (ObjUtil.isNotNull(deviceTsj)) {
|
||||||
|
// PlcTsjRead.WriteToTSJ(deviceTsj.getPlcDbWriteAddress(), bytes);
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
int jym = Tools.getJYM(Integer.parseInt(String.valueOf(tsjDeviceExecutionQueue.getTaskNo())), Integer.parseInt(String.valueOf(tsjDeviceExecutionQueue.getRwlx())), Integer.parseInt(String.valueOf(tsjDeviceExecutionQueue.getSrcLayer())), Integer.parseInt(String.valueOf(tsjDeviceExecutionQueue.getTarLayer())), 1);
|
||||||
|
SendData taskNoSendData = new SendData(Tools.DINT, Integer.parseInt(String.valueOf(tsjDeviceExecutionQueue.getTaskNo())));
|
||||||
|
SendData rwlxSendData = new SendData(Tools.INT, Integer.parseInt(String.valueOf(tsjDeviceExecutionQueue.getRwlx())));
|
||||||
|
SendData srcLayer = new SendData(Tools.INT, Integer.parseInt(String.valueOf(tsjDeviceExecutionQueue.getSrcLayer())));
|
||||||
|
SendData tarLayer = new SendData(Tools.INT, Integer.parseInt(String.valueOf(tsjDeviceExecutionQueue.getTarLayer())));
|
||||||
|
|
||||||
SendData completedSendData = new SendData(Tools.INT, 1);
|
SendData completedSendData = new SendData(Tools.INT, 1);
|
||||||
int jym = Tools.getJYM(taskNoSendData.getNum2(), srcRow.getNum2(), srcLayer.getNum2(), tarRow.getNum2(), tarLayer.getNum2(), sendType.getNum2(), completedSendData.getNum2());
|
|
||||||
SendData jymSendData = new SendData(Tools.INT, jym);
|
SendData jymSendData = new SendData(Tools.INT, jym);
|
||||||
byte[] bytes = Tools.sendData(taskNoSendData, srcRow, srcLayer, tarRow, tarLayer, sendType, completedSendData, jymSendData);
|
byte[] bytes = Tools.sendData(taskNoSendData, rwlxSendData, srcLayer, tarLayer, completedSendData, jymSendData);
|
||||||
|
DeviceTsj deviceTsj = PlcTsjRead.deviceTsjMap.get(Convert.toStr(tsjDeviceExecutionQueue.getDeviceId()));
|
||||||
|
int i = PlcTsjRead.WriteToTSJ(deviceTsj.getPlcDbWriteAddress(), bytes);
|
||||||
|
if (i > 0) {
|
||||||
|
tsjDeviceExecutionQueue.setSendFlag("1");
|
||||||
|
tsjDeviceExecutionQueueService.updateTsjDeviceExecutionQueue(tsjDeviceExecutionQueue);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void writeToTsjWC(TsjDeviceExecutionQueue tsjDeviceExecutionQueue) {
|
||||||
|
SendData taskNoSendData = new SendData(Tools.INT, Convert.toInt(tsjDeviceExecutionQueue.getTaskNo()));
|
||||||
|
SendData rwlxSendData = new SendData(Tools.INT, Convert.toInt(tsjDeviceExecutionQueue.getRwlx()));
|
||||||
|
// SendData srcRow = new SendData(Tools.INT, Convert.toInt(tsjDeviceExecutionQueue.getSrcRow()));
|
||||||
|
SendData srcLayer = new SendData(Tools.INT, Convert.toInt(tsjDeviceExecutionQueue.getSrcLayer()));
|
||||||
|
// SendData tarRow = new SendData(Tools.INT, Convert.toInt(tsjDeviceExecutionQueue.getTarRow()));
|
||||||
|
SendData tarLayer = new SendData(Tools.INT, Convert.toInt(tsjDeviceExecutionQueue.getTarLayer()));
|
||||||
|
|
||||||
|
SendData completedSendData = new SendData(Tools.INT, 1);
|
||||||
|
int jym = Tools.getJYM(taskNoSendData.getNum2(), srcLayer.getNum2(), tarLayer.getNum2(), completedSendData.getNum2(), rwlxSendData.getNum2());
|
||||||
|
SendData jymSendData = new SendData(Tools.INT, jym);
|
||||||
|
byte[] bytes = Tools.sendData(taskNoSendData, srcLayer, tarLayer, completedSendData, jymSendData);
|
||||||
DeviceTsj deviceTsj = PlcTsjRead.deviceTsjMap.get(Convert.toStr(tsjDeviceExecutionQueue.getDeviceId()));
|
DeviceTsj deviceTsj = PlcTsjRead.deviceTsjMap.get(Convert.toStr(tsjDeviceExecutionQueue.getDeviceId()));
|
||||||
if (ObjUtil.isNotNull(deviceTsj)) {
|
if (ObjUtil.isNotNull(deviceTsj)) {
|
||||||
PlcTsjRead.WriteToTSJ(deviceTsj.getPlcDbWriteAddress(), bytes);
|
PlcTsjRead.WriteToTSJ(deviceTsj.getPlcDbWriteAddress(), bytes);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void finishTask(Long taskNo) {
|
private void finishTask(Long taskNo) {
|
||||||
|
|
||||||
//根据任务号查询队列 修改执行状态
|
//根据任务号查询队列 修改执行状态
|
||||||
|
|||||||
@@ -6,9 +6,9 @@ spring:
|
|||||||
druid:
|
druid:
|
||||||
#主数据信息
|
#主数据信息
|
||||||
master:
|
master:
|
||||||
url: jdbc:sqlserver://172.16.2.170:1433;databaseName=FT546-wcs;
|
url: jdbc:sqlserver://127.0.0.1:1433;databaseName=FT546-WCS;
|
||||||
username: sa
|
username: sa
|
||||||
password: Flrd0914.
|
password: 123456
|
||||||
# 从库数据源
|
# 从库数据源
|
||||||
slave:
|
slave:
|
||||||
# 从数据源开关/默认关闭
|
# 从数据源开关/默认关闭
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ spring:
|
|||||||
# redis 配置
|
# redis 配置
|
||||||
redis:
|
redis:
|
||||||
# 地址
|
# 地址
|
||||||
host: 172.16.2.170
|
host: 127.0.0.1
|
||||||
# 端口,默认为6379
|
# 端口,默认为6379
|
||||||
port: 6379
|
port: 6379
|
||||||
# 数据库索引
|
# 数据库索引
|
||||||
|
|||||||
@@ -67,6 +67,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<select id="selectMydoJobByTaskNo" parameterType="String" resultMap="MydoJobResult">
|
<select id="selectMydoJobByTaskNo" parameterType="String" resultMap="MydoJobResult">
|
||||||
<include refid="selectMydoJobVo"/>
|
<include refid="selectMydoJobVo"/>
|
||||||
where task_no = #{taskNo}
|
where task_no = #{taskNo}
|
||||||
|
and execution_phase != '2'
|
||||||
</select>
|
</select>
|
||||||
<select id="ddjTaskFinish" parameterType="java.util.Map" statementType="CALLABLE">
|
<select id="ddjTaskFinish" parameterType="java.util.Map" statementType="CALLABLE">
|
||||||
{call proc_mydojob_finish(
|
{call proc_mydojob_finish(
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
|
|
||||||
<insert id="insertJobLog" parameterType="SysJobLog">
|
<insert id="insertJobLog" parameterType="SysJobLog">
|
||||||
insert into sys_job_log(
|
insert into sys_job_log(
|
||||||
<if test="jobLogId != null and jobLogId != 0">job_log_id,</if>
|
<!-- <if test="jobLogId != null and jobLogId != 0">job_log_id,</if>-->
|
||||||
<if test="jobName != null and jobName != ''">job_name,</if>
|
<if test="jobName != null and jobName != ''">job_name,</if>
|
||||||
<if test="jobGroup != null and jobGroup != ''">job_group,</if>
|
<if test="jobGroup != null and jobGroup != ''">job_group,</if>
|
||||||
<if test="invokeTarget != null and invokeTarget != ''">invoke_target,</if>
|
<if test="invokeTarget != null and invokeTarget != ''">invoke_target,</if>
|
||||||
@@ -80,7 +80,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<if test="exceptionInfo != null and exceptionInfo != ''">exception_info,</if>
|
<if test="exceptionInfo != null and exceptionInfo != ''">exception_info,</if>
|
||||||
create_time
|
create_time
|
||||||
)values(
|
)values(
|
||||||
<if test="jobLogId != null and jobLogId != 0">#{jobLogId},</if>
|
<!-- <if test="jobLogId != null and jobLogId != 0">#{jobLogId},</if>-->
|
||||||
<if test="jobName != null and jobName != ''">#{jobName},</if>
|
<if test="jobName != null and jobName != ''">#{jobName},</if>
|
||||||
<if test="jobGroup != null and jobGroup != ''">#{jobGroup},</if>
|
<if test="jobGroup != null and jobGroup != ''">#{jobGroup},</if>
|
||||||
<if test="invokeTarget != null and invokeTarget != ''">#{invokeTarget},</if>
|
<if test="invokeTarget != null and invokeTarget != ''">#{invokeTarget},</if>
|
||||||
|
|||||||
Reference in New Issue
Block a user