现场接口测试和出入库判断调整
This commit is contained in:
@@ -19,12 +19,13 @@ import com.ruoyi.api.domain.agv.genAgvSchedulingTask.PositionCodeData;
|
|||||||
import com.ruoyi.api.domain.wcs2wms.JobParam;
|
import com.ruoyi.api.domain.wcs2wms.JobParam;
|
||||||
import com.ruoyi.api.domain.wcs2wms.ReceiveJob;
|
import com.ruoyi.api.domain.wcs2wms.ReceiveJob;
|
||||||
import com.ruoyi.api.domain.wcs2wms.ResponseResult;
|
import com.ruoyi.api.domain.wcs2wms.ResponseResult;
|
||||||
|
import com.ruoyi.api.domain.wcs2wms.exception.TaskExceptionReceive;
|
||||||
import com.ruoyi.api.domain.wcs2wms.exception.TaskExceptionRequest;
|
import com.ruoyi.api.domain.wcs2wms.exception.TaskExceptionRequest;
|
||||||
import com.ruoyi.api.domain.wcs2wms.stockout.StockoutReceive;
|
import com.ruoyi.api.domain.wcs2wms.stockout.StockoutReceive;
|
||||||
import com.ruoyi.api.service.IApiService;
|
import com.ruoyi.api.service.IApiService;
|
||||||
import com.ruoyi.bas.cargospace.service.IBasCargoSpaceService;
|
|
||||||
import com.ruoyi.bas.port.domain.WcsPort;
|
import com.ruoyi.bas.port.domain.WcsPort;
|
||||||
import com.ruoyi.bas.port.service.IWcsPortService;
|
import com.ruoyi.bas.port.service.IWcsPortService;
|
||||||
|
import com.ruoyi.common.GoodsType;
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
import com.ruoyi.common.utils.DateUtils;
|
import com.ruoyi.common.utils.DateUtils;
|
||||||
import com.ruoyi.job.domain.MydoJob;
|
import com.ruoyi.job.domain.MydoJob;
|
||||||
@@ -43,7 +44,8 @@ import java.util.List;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import static com.ruoyi.common.Constant.*;
|
import static com.ruoyi.common.Constant.*;
|
||||||
import static com.ruoyi.common.TaskStatusCode.TASK_EP_CREATE;
|
import static com.ruoyi.common.ConvType.CONV_STOCKOUT;
|
||||||
|
import static com.ruoyi.common.TaskStatusCode.TASK_EP_CREATED;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 接口记录Service业务层处理
|
* 接口记录Service业务层处理
|
||||||
@@ -278,13 +280,13 @@ public class ApiServiceImpl implements IApiService {
|
|||||||
if ("1".equals(requestLog.getIsSuccessful())){
|
if ("1".equals(requestLog.getIsSuccessful())){
|
||||||
//请求获取新分配的货位
|
//请求获取新分配的货位
|
||||||
ResponseResult bean = JSONUtil.toBean(requestLog.getResponseBody(), ResponseResult.class);
|
ResponseResult bean = JSONUtil.toBean(requestLog.getResponseBody(), ResponseResult.class);
|
||||||
MydoJob wmsMydoJob = BeanUtil.toBean(bean.getResult(), MydoJob.class);
|
TaskExceptionReceive taskExceptionReceive = BeanUtil.toBean(bean.getResult(), TaskExceptionReceive.class);
|
||||||
|
|
||||||
//更新任务信息
|
//更新任务信息
|
||||||
MydoJob mydoJob = mydoJobService.selectMydoJobByJobId(wmsMydoJob.getJobId());
|
MydoJob mydoJob = mydoJobService.selectMydoJobByWmsTaskNo(taskExceptionReceive.getTaskCode());
|
||||||
mydoJob.setCargoSpaceId(wmsMydoJob.getCargoSpaceId());
|
mydoJob.setCargoSpaceId(taskExceptionReceive.getSiteCode());
|
||||||
mydoJobService.updateMydoJob(mydoJob);
|
mydoJobService.updateMydoJob(mydoJob);
|
||||||
return AjaxResult.success();
|
return AjaxResult.success(taskExceptionReceive);
|
||||||
}
|
}
|
||||||
return AjaxResult.error();
|
return AjaxResult.error();
|
||||||
}
|
}
|
||||||
@@ -504,18 +506,16 @@ public class ApiServiceImpl implements IApiService {
|
|||||||
mydoJob.setJobId(mydoJobService.getJobId("CK"));
|
mydoJob.setJobId(mydoJobService.getJobId("CK"));
|
||||||
mydoJob.setTaskNo(mydoJobService.getTaskNo("3"));
|
mydoJob.setTaskNo(mydoJobService.getTaskNo("3"));
|
||||||
mydoJob.setWmsTaskNo(stockoutReceive.getTaskCode());
|
mydoJob.setWmsTaskNo(stockoutReceive.getTaskCode());
|
||||||
//todo 可能需要解析货位 wms参数【siteCode】
|
|
||||||
mydoJob.setCargoSpaceId(stockoutReceive.getSiteCode());
|
mydoJob.setCargoSpaceId(stockoutReceive.getSiteCode());
|
||||||
mydoJob.setExitId("G1004");
|
mydoJob.setTraySize(GoodsType.TYPE_DEFAULT);//默认
|
||||||
//todo 是否需要解析wms推送的任务类型?
|
mydoJob.setExitId(CONV_STOCKOUT);
|
||||||
// mydoJob.setInOrOut(stockoutReceive.getTaskTypeCode());
|
|
||||||
mydoJob.setInOrOut("2");
|
mydoJob.setInOrOut("2");
|
||||||
mydoJob.setStatus("1");
|
mydoJob.setStatus("1");
|
||||||
mydoJob.setPriority(Long.valueOf(10));
|
mydoJob.setPriority(Long.valueOf(10));
|
||||||
//todo 可能需要查本地库存信息获取条码?
|
//todo 可能需要查本地库存信息获取条码?
|
||||||
// mydoJob.setTrayCode(receiveOutJob.getTrayCode());
|
// mydoJob.setTrayCode(receiveOutJob.getTrayCode());
|
||||||
mydoJob.setCreateTime(DateUtils.getNowDate());
|
mydoJob.setCreateTime(DateUtils.getNowDate());
|
||||||
mydoJob.setExecutionPhase(TASK_EP_CREATE);
|
mydoJob.setExecutionPhase(TASK_EP_CREATED);
|
||||||
// mydoJob.setTraySize(receiveOutJob.getDepartmentId());
|
// mydoJob.setTraySize(receiveOutJob.getDepartmentId());
|
||||||
int i = mydoJobService.insertMydoJob(mydoJob);
|
int i = mydoJobService.insertMydoJob(mydoJob);
|
||||||
// boolean success = mydoJobService.saveOrUpdate(mydoJob);
|
// boolean success = mydoJobService.saveOrUpdate(mydoJob);
|
||||||
|
|||||||
@@ -1,11 +1,15 @@
|
|||||||
package com.ruoyi.api.service.impl;
|
package com.ruoyi.api.service.impl;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import cn.hutool.core.convert.Convert;
|
import cn.hutool.core.convert.Convert;
|
||||||
import cn.hutool.core.date.DateUnit;
|
import cn.hutool.core.date.DateUnit;
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import cn.hutool.http.Header;
|
||||||
|
import cn.hutool.http.HttpRequest;
|
||||||
import cn.hutool.http.HttpUtil;
|
import cn.hutool.http.HttpUtil;
|
||||||
import cn.hutool.json.JSONUtil;
|
import cn.hutool.json.JSONUtil;
|
||||||
import com.ruoyi.api.domain.InterfaceReceive;
|
import com.ruoyi.api.domain.InterfaceReceive;
|
||||||
@@ -17,6 +21,8 @@ import com.ruoyi.api.mapper.RequestLogMapper;
|
|||||||
import com.ruoyi.api.domain.RequestLog;
|
import com.ruoyi.api.domain.RequestLog;
|
||||||
import com.ruoyi.api.service.IRequestLogService;
|
import com.ruoyi.api.service.IRequestLogService;
|
||||||
|
|
||||||
|
import static com.ruoyi.common.Constant.HEADER_TOKEN;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 接口记录Service业务层处理
|
* 接口记录Service业务层处理
|
||||||
*
|
*
|
||||||
@@ -129,7 +135,14 @@ public class RequestLogServiceImpl implements IRequestLogService
|
|||||||
requestLog.setRequestUrl(url);
|
requestLog.setRequestUrl(url);
|
||||||
Date responseTime =new Date();
|
Date responseTime =new Date();
|
||||||
try {
|
try {
|
||||||
String resStr = HttpUtil.post(url, param);
|
// String resStr = HttpUtil.post(url, param);
|
||||||
|
|
||||||
|
String resStr = HttpRequest.post(url)
|
||||||
|
.body(param)
|
||||||
|
.header("X-Service-Secret", HEADER_TOKEN)
|
||||||
|
.execute()
|
||||||
|
.body();
|
||||||
|
|
||||||
requestLog.setResponseBody(resStr);
|
requestLog.setResponseBody(resStr);
|
||||||
InterfaceReceive bean = JSONUtil.toBean(resStr, InterfaceReceive.class);
|
InterfaceReceive bean = JSONUtil.toBean(resStr, InterfaceReceive.class);
|
||||||
|
|
||||||
@@ -222,8 +235,14 @@ public class RequestLogServiceImpl implements IRequestLogService
|
|||||||
requestLog.setRequestBody(param);
|
requestLog.setRequestBody(param);
|
||||||
requestLog.setRequestUrl(url);
|
requestLog.setRequestUrl(url);
|
||||||
Date responseTime =new Date();
|
Date responseTime =new Date();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
String resStr = HttpUtil.post(url, param);
|
// String resStr = HttpUtil.post(url, param, header, 3000);
|
||||||
|
String resStr = HttpRequest.post(url)
|
||||||
|
.body(param)
|
||||||
|
.header("X-Service-Secret", HEADER_TOKEN)
|
||||||
|
.execute()
|
||||||
|
.body();
|
||||||
requestLog.setResponseBody(resStr);
|
requestLog.setResponseBody(resStr);
|
||||||
ResponseResult bean = JSONUtil.toBean(resStr, ResponseResult.class);
|
ResponseResult bean = JSONUtil.toBean(resStr, ResponseResult.class);
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,9 @@ public class Constant {
|
|||||||
public static final String WMS_BASE_URL = "http://10.88.10.69:8290/service";
|
public static final String WMS_BASE_URL = "http://10.88.10.69:8290/service";
|
||||||
public static final String RCS_BASE_URL = "http://192.168.58.101:8182/rcms/services/rest/hikRpcService/";
|
public static final String RCS_BASE_URL = "http://192.168.58.101:8182/rcms/services/rest/hikRpcService/";
|
||||||
|
|
||||||
|
public static final String HEADER_TOKEN = "fed3d1511a5a474b9e1f9c56246cb1ec";
|
||||||
|
|
||||||
|
|
||||||
//#region AGV接口url
|
//#region AGV接口url
|
||||||
public static final String GEN_AGV_SCHEDULING_TASK = RCS_BASE_URL+"genAgvSchedulingTask";
|
public static final String GEN_AGV_SCHEDULING_TASK = RCS_BASE_URL+"genAgvSchedulingTask";
|
||||||
public static final String CANCEL_TASK_URL = RCS_BASE_URL+"cancelTask";
|
public static final String CANCEL_TASK_URL = RCS_BASE_URL+"cancelTask";
|
||||||
|
|||||||
19
ruoyi-admin/src/main/java/com/ruoyi/common/ConvType.java
Normal file
19
ruoyi-admin/src/main/java/com/ruoyi/common/ConvType.java
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
package com.ruoyi.common;
|
||||||
|
|
||||||
|
public class ConvType {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 出库输送机(到位位置)
|
||||||
|
*/
|
||||||
|
public static final String CONV_STOCKOUT = "TD1001";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 入库输送机(到位位置)
|
||||||
|
*/
|
||||||
|
public static final String CONV_STOCKIN = "G1004";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 1#巷道口输送机(到位位置)
|
||||||
|
*/
|
||||||
|
public static final String CONV_ROAD_1 = "L1001";
|
||||||
|
}
|
||||||
22
ruoyi-admin/src/main/java/com/ruoyi/common/GoodsType.java
Normal file
22
ruoyi-admin/src/main/java/com/ruoyi/common/GoodsType.java
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
package com.ruoyi.common;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 货物类型
|
||||||
|
*/
|
||||||
|
public class GoodsType {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 默认
|
||||||
|
*/
|
||||||
|
public static final String TYPE_DEFAULT = "0";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 高度1
|
||||||
|
*/
|
||||||
|
public static final String TYPE_HEIGHT_1 = "1";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 高度2
|
||||||
|
*/
|
||||||
|
public static final String TYPE_HEIGHT_2 = "0";
|
||||||
|
}
|
||||||
@@ -10,7 +10,7 @@ public class TaskStatusCode {
|
|||||||
/**
|
/**
|
||||||
* 任务状态-待执行
|
* 任务状态-待执行
|
||||||
*/
|
*/
|
||||||
public static final String TASK_STATUS_CREATE = "1";
|
public static final String TASK_STATUS_CREATED = "1";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 任务状态-待执行
|
* 任务状态-待执行
|
||||||
@@ -39,7 +39,7 @@ public class TaskStatusCode {
|
|||||||
/**
|
/**
|
||||||
* 任务执行阶段 任务已生成
|
* 任务执行阶段 任务已生成
|
||||||
*/
|
*/
|
||||||
public static final String TASK_EP_CREATE = "0";
|
public static final String TASK_EP_CREATED = "0";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 任务执行阶段 产线输送到位
|
* 任务执行阶段 产线输送到位
|
||||||
@@ -76,14 +76,30 @@ public class TaskStatusCode {
|
|||||||
*/
|
*/
|
||||||
public static final String TASK_EP_SSJ_STOCKOUT_FINISH = "6";
|
public static final String TASK_EP_SSJ_STOCKOUT_FINISH = "6";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任务执行阶段 任务自动完成
|
||||||
|
*/
|
||||||
|
public static final String TASK_EP_FINISH = "6";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 任务执行阶段 任务超时-自动结束当前任务
|
* 任务执行阶段 任务超时-自动结束当前任务
|
||||||
*/
|
*/
|
||||||
public static final String TASK_EP_DDJ_FINISH_TIMEOUT = "6_TIMEOUT_FINISH";
|
public static final String TASK_EP_DDJ_FINISH_TIMEOUT = "6_TIMEOUT_FINISH";
|
||||||
|
|
||||||
public static final String TASK_EXCEPTION_PUT = "IN_FAULT";
|
/**
|
||||||
|
* 入库异常 - 放货有货
|
||||||
|
*/
|
||||||
|
public static final String TASK_EXCEPTION_PUT = "STOCKIN_FAULT";
|
||||||
|
|
||||||
public static final String TASK_EXCEPTION_PICK = "OUT_FAULT";
|
/**
|
||||||
|
* 出库异常 - 取货无货
|
||||||
|
*/
|
||||||
|
public static final String TASK_EXCEPTION_PICK = "STOCKOUT_FAULT";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 入库异常 - 重分完成
|
||||||
|
*/
|
||||||
|
public static final String TASK_EXCEPTION_PUT_REASSIGN = "STOCKIN_FAULT_REASSIGN";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 任务执行阶段 回传wms完成
|
* 任务执行阶段 回传wms完成
|
||||||
|
|||||||
@@ -5,6 +5,10 @@ package com.ruoyi.common;
|
|||||||
*/
|
*/
|
||||||
public class TaskType {
|
public class TaskType {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 默认类型
|
||||||
|
*/
|
||||||
|
public static final int STACKER_TYPE_DEFAULT = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 1-二楼入出
|
* 1-二楼入出
|
||||||
|
|||||||
@@ -8,11 +8,41 @@ public class WmsTaskTypeCode {
|
|||||||
/**
|
/**
|
||||||
* 外部wms定义的入库类型
|
* 外部wms定义的入库类型
|
||||||
*/
|
*/
|
||||||
public static final String WMS_TASK_TYPE_STOCKIN = "1";
|
public static final String WMS_TASK_TYPE_STOCKIN = "立库入库";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 外部wms定义的出库类型
|
* 外部wms定义的出库类型
|
||||||
*/
|
*/
|
||||||
public static final String WMS_TASK_TYPE_STOCKOUT = "2";
|
public static final String WMS_TASK_TYPE_STOCKOUT = "立库出库";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 外部wms定义的入库结束类型
|
||||||
|
*/
|
||||||
|
public static final String WMS_TASK_TYPE_STOCKIN_FINISH = "立库入库任务结束";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 外部wms定义的出库结束类型
|
||||||
|
*/
|
||||||
|
public static final String WMS_TASK_TYPE_STOCKOUT_FINISH = "立库出库任务结束";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 外部wms定义的任务结束类型
|
||||||
|
*/
|
||||||
|
public static final String WMS_TASK_TYPE_FINISH = "立库任务结束";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 外部wms定义的入库异常类型
|
||||||
|
*/
|
||||||
|
public static final String WMS_TASK_TYPE_STOCKIN_EXCEPTION = "立库入库异常任务-放货有货";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 外部wms定义的出库异常类型
|
||||||
|
*/
|
||||||
|
public static final String WMS_TASK_TYPE_STOCKOUT_EXCEPTION = "立库出库异常任务-取货无货";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 外部wms定义的任务异常类型
|
||||||
|
*/
|
||||||
|
public static final String WMS_TASK_TYPE_EXCEPTION = "立库异常任务";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ import static com.ruoyi.common.Constant.LOCAL_URL;
|
|||||||
* @date 2025-09-22
|
* @date 2025-09-22
|
||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/device/ddj")
|
@RequestMapping("/device/stacker")
|
||||||
public class MsgDdjController extends BaseController
|
public class MsgDdjController extends BaseController
|
||||||
{
|
{
|
||||||
@Autowired
|
@Autowired
|
||||||
@@ -148,72 +148,66 @@ public class MsgDdjController extends BaseController
|
|||||||
public AjaxResult getStackerStatus(@PathVariable Long id){
|
public AjaxResult getStackerStatus(@PathVariable Long id){
|
||||||
|
|
||||||
//返回堆垛机部分参数的状态映射
|
//返回堆垛机部分参数的状态映射
|
||||||
if (id == 1) {
|
MsgDdj msg = msgDdjService.selectMsgDdjById(id);
|
||||||
MsgDdj msg = msgDdjService.selectMsgDdjById(id);
|
if (msg == null) {
|
||||||
// StackerStatus status = new StackerStatus();
|
AjaxResult.error("【查询堆垛机状态】设备编号:" + id + ",查询超出最大索引");
|
||||||
|
|
||||||
//操作模式
|
|
||||||
String mode;
|
|
||||||
switch (msg.getCzfs()){
|
|
||||||
case 1 -> mode = "手动";
|
|
||||||
case 5 -> mode = "联机自动";
|
|
||||||
default -> mode = "其他";
|
|
||||||
}
|
|
||||||
|
|
||||||
//设备状态
|
|
||||||
String deviceStatus;
|
|
||||||
switch (msg.getSbzt()){
|
|
||||||
case 0 -> deviceStatus = "待机";
|
|
||||||
case 1 -> deviceStatus = "运行中";
|
|
||||||
default -> deviceStatus = "运行报警";
|
|
||||||
}
|
|
||||||
|
|
||||||
//执行阶段
|
|
||||||
String executionPhase;
|
|
||||||
switch (msg.getJdbz()){
|
|
||||||
case 1 -> executionPhase = "取货途中";
|
|
||||||
case 2 -> executionPhase = "取货中";
|
|
||||||
case 3 -> executionPhase = "放货途中";
|
|
||||||
case 4 -> executionPhase = "放货中";
|
|
||||||
case 5 -> executionPhase = "放货完成";
|
|
||||||
default -> executionPhase = "待机";
|
|
||||||
}
|
|
||||||
|
|
||||||
StackerStatusContent statusContent = new StackerStatusContent(
|
|
||||||
String.valueOf(id),
|
|
||||||
mode,
|
|
||||||
String.valueOf(msg.getRwh()),
|
|
||||||
deviceStatus,
|
|
||||||
msg.getHczt() > 0 ? "货叉有货" : "货叉无货",
|
|
||||||
executionPhase,
|
|
||||||
msg.getYxxf() == 1 ? "允许" : "禁止",
|
|
||||||
msg.getCurrentRow() + "排" + msg.getCurrentColumn() + "列" + msg.getCurrentFloor() + "层"
|
|
||||||
);
|
|
||||||
|
|
||||||
RequestLog requestLog = requestLogService.getRequestLog(String.valueOf(id), "获取指定堆垛机状态");
|
|
||||||
requestLog.setRequestUrl(LOCAL_URL + "/device/ddj/getStackerStatus/" + id);
|
|
||||||
requestLog.setRequestMethod("get");
|
|
||||||
requestLog.setResponseStatus("1");
|
|
||||||
requestLog.setResponseBody(JSON.toJSONString(statusContent));
|
|
||||||
requestLogService.insertRequestLog(requestLog);
|
|
||||||
|
|
||||||
// status.setId(msg.getId());
|
|
||||||
// status.setMode(msg.getCzfs());
|
|
||||||
// status.setTaskNo(msg.getRwh());
|
|
||||||
// status.setDeviceStatus(msg.getSbzt());
|
|
||||||
// status.setForkStatus(msg.getHczt());
|
|
||||||
// status.setExecutionPhase(msg.getJdbz());
|
|
||||||
// status.setPermission(msg.getYxxf());
|
|
||||||
// status.setCurrentRow(msg.getCurrentRow());
|
|
||||||
// status.setCurrentColumn(msg.getCurrentColumn());
|
|
||||||
// status.setCurrentFloor(msg.getCurrentFloor());
|
|
||||||
// status.setCurrentRoad(msg.getId());
|
|
||||||
// status.setCurrentPosition(msg.getCurrentRow() + "排" + msg.getCurrentColumn() + "列" + msg.getCurrentFloor() + "层");
|
|
||||||
|
|
||||||
return AjaxResult.success(statusContent);
|
|
||||||
}else{
|
|
||||||
return AjaxResult.error("【查询堆垛机状态】设备编号:" + id + ",查询超出最大索引");
|
|
||||||
}
|
}
|
||||||
|
//操作模式
|
||||||
|
String mode;
|
||||||
|
switch (msg.getCzfs()){
|
||||||
|
case 1 -> mode = "手动";
|
||||||
|
case 5 -> mode = "联机自动";
|
||||||
|
default -> mode = "其他";
|
||||||
|
}
|
||||||
|
//设备状态
|
||||||
|
String deviceStatus;
|
||||||
|
switch (msg.getSbzt()){
|
||||||
|
case 0 -> deviceStatus = "待机";
|
||||||
|
case 1 -> deviceStatus = "运行中";
|
||||||
|
default -> deviceStatus = "运行报警";
|
||||||
|
}
|
||||||
|
//执行阶段
|
||||||
|
String executionPhase;
|
||||||
|
switch (msg.getJdbz()){
|
||||||
|
case 1 -> executionPhase = "取货途中";
|
||||||
|
case 2 -> executionPhase = "取货中";
|
||||||
|
case 3 -> executionPhase = "放货途中";
|
||||||
|
case 4 -> executionPhase = "放货中";
|
||||||
|
case 5 -> executionPhase = "放货完成";
|
||||||
|
default -> executionPhase = "待机";
|
||||||
|
}
|
||||||
|
StackerStatusContent statusContent = new StackerStatusContent(
|
||||||
|
String.valueOf(id),
|
||||||
|
mode,
|
||||||
|
String.valueOf(msg.getRwh()),
|
||||||
|
deviceStatus,
|
||||||
|
msg.getHczt() > 0 ? "货叉有货" : "货叉无货",
|
||||||
|
executionPhase,
|
||||||
|
msg.getYxxf() == 1 ? "允许" : "禁止",
|
||||||
|
msg.getCurrentRow() + "排" + msg.getCurrentColumn() + "列" + msg.getCurrentFloor() + "层"
|
||||||
|
);
|
||||||
|
RequestLog requestLog = requestLogService.getRequestLog(String.valueOf(id), "获取指定堆垛机状态");
|
||||||
|
requestLog.setRequestUrl(LOCAL_URL + "/device/ddj/getStackerStatus/" + id);
|
||||||
|
requestLog.setRequestMethod("get");
|
||||||
|
requestLog.setResponseStatus("1");
|
||||||
|
requestLog.setResponseBody(JSON.toJSONString(statusContent));
|
||||||
|
requestLogService.insertRequestLog(requestLog);
|
||||||
|
|
||||||
|
// status.setId(msg.getId());
|
||||||
|
// status.setMode(msg.getCzfs());
|
||||||
|
// status.setTaskNo(msg.getRwh());
|
||||||
|
// status.setDeviceStatus(msg.getSbzt());
|
||||||
|
// status.setForkStatus(msg.getHczt());
|
||||||
|
// status.setExecutionPhase(msg.getJdbz());
|
||||||
|
// status.setPermission(msg.getYxxf());
|
||||||
|
// status.setCurrentRow(msg.getCurrentRow());
|
||||||
|
// status.setCurrentColumn(msg.getCurrentColumn());
|
||||||
|
// status.setCurrentFloor(msg.getCurrentFloor());
|
||||||
|
// status.setCurrentRoad(msg.getId());
|
||||||
|
// status.setCurrentPosition(msg.getCurrentRow() + "排" + msg.getCurrentColumn() + "列" + msg.getCurrentFloor() + "层");
|
||||||
|
|
||||||
|
return AjaxResult.success(statusContent);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -248,26 +242,29 @@ public class MsgDdjController extends BaseController
|
|||||||
public AjaxResult getStackerStatusEn(@PathVariable Long id){
|
public AjaxResult getStackerStatusEn(@PathVariable Long id){
|
||||||
|
|
||||||
//返回堆垛机部分参数的状态映射
|
//返回堆垛机部分参数的状态映射
|
||||||
if (id == 1) {
|
|
||||||
MsgDdj msg = msgDdjService.selectMsgDdjById(id);
|
|
||||||
|
|
||||||
StackerStatus statusContent = new StackerStatus(
|
MsgDdj msg = msgDdjService.selectMsgDdjById(id);
|
||||||
id,
|
|
||||||
msg.getCzfs(),
|
|
||||||
String.valueOf(msg.getRwh()),
|
|
||||||
msg.getSbzt(),
|
|
||||||
msg.getHczt(),
|
|
||||||
msg.getJdbz(),
|
|
||||||
msg.getYxxf(),
|
|
||||||
String.format("%02d",msg.getCurrentRow()) + String.format("%02d",msg.getCurrentColumn()) + String.format("%02d",msg.getCurrentFloor())
|
|
||||||
);
|
|
||||||
|
|
||||||
RequestLog requestLog = requestLogService.getRequestLog(String.valueOf(id), "获取指定堆垛机状态");
|
if (msg == null) {
|
||||||
requestLog.setRequestUrl(LOCAL_URL + "/device/ddj/getStackerStatus/en/" + id);
|
AjaxResult.error("【查询堆垛机状态】设备编号:" + id + ",查询超出最大索引");
|
||||||
requestLog.setRequestMethod("get");
|
}
|
||||||
requestLog.setResponseStatus("1");
|
|
||||||
requestLog.setResponseBody(JSON.toJSONString(statusContent));
|
StackerStatus statusContent = new StackerStatus(
|
||||||
requestLogService.insertRequestLog(requestLog);
|
id,
|
||||||
|
msg.getCzfs(),
|
||||||
|
String.valueOf(msg.getRwh()),
|
||||||
|
msg.getSbzt(),
|
||||||
|
msg.getHczt(),
|
||||||
|
msg.getJdbz(),
|
||||||
|
msg.getYxxf(),
|
||||||
|
String.format("%02d",msg.getCurrentRow()) + String.format("%02d",msg.getCurrentColumn()) + String.format("%02d",msg.getCurrentFloor())
|
||||||
|
);
|
||||||
|
RequestLog requestLog = requestLogService.getRequestLog(String.valueOf(id), "获取指定堆垛机状态");
|
||||||
|
requestLog.setRequestUrl(LOCAL_URL + "/device/ddj/getStackerStatus/en/" + id);
|
||||||
|
requestLog.setRequestMethod("get");
|
||||||
|
requestLog.setResponseStatus("1");
|
||||||
|
requestLog.setResponseBody(JSON.toJSONString(statusContent));
|
||||||
|
requestLogService.insertRequestLog(requestLog);
|
||||||
|
|
||||||
// status.setId(msg.getId());
|
// status.setId(msg.getId());
|
||||||
// status.setMode(msg.getCzfs());
|
// status.setMode(msg.getCzfs());
|
||||||
@@ -282,10 +279,8 @@ public class MsgDdjController extends BaseController
|
|||||||
// status.setCurrentRoad(msg.getId());
|
// status.setCurrentRoad(msg.getId());
|
||||||
// status.setCurrentPosition(msg.getCurrentRow() + "排" + msg.getCurrentColumn() + "列" + msg.getCurrentFloor() + "层");
|
// status.setCurrentPosition(msg.getCurrentRow() + "排" + msg.getCurrentColumn() + "列" + msg.getCurrentFloor() + "层");
|
||||||
|
|
||||||
return AjaxResult.success(statusContent);
|
return AjaxResult.success(statusContent);
|
||||||
}else{
|
|
||||||
return AjaxResult.error("【查询堆垛机状态】设备编号:" + id + ",查询超出最大索引");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ import static com.ruoyi.common.Constant.LOCAL_URL;
|
|||||||
* @date 2025-07-04
|
* @date 2025-07-04
|
||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/device/ssj")
|
@RequestMapping("/device/conv")
|
||||||
public class DeviceSsjController extends BaseController
|
public class DeviceSsjController extends BaseController
|
||||||
{
|
{
|
||||||
@Autowired
|
@Autowired
|
||||||
@@ -134,6 +134,11 @@ public class DeviceSsjController extends BaseController
|
|||||||
public AjaxResult getConvStatus(@PathVariable String id){
|
public AjaxResult getConvStatus(@PathVariable String id){
|
||||||
|
|
||||||
DeviceSsj msgSsj = deviceSsjService.selectDeviceSsjByDeviceCode(id);
|
DeviceSsj msgSsj = deviceSsjService.selectDeviceSsjByDeviceCode(id);
|
||||||
|
|
||||||
|
if (msgSsj == null) {
|
||||||
|
return AjaxResult.error("【查询输送机状态】设备编号:" + id + ",该设备不存在!");
|
||||||
|
}
|
||||||
|
|
||||||
ConvStatusContent status = new ConvStatusContent(
|
ConvStatusContent status = new ConvStatusContent(
|
||||||
id,
|
id,
|
||||||
msgSsj.getMode() == 1 ? "自动" : "手动",
|
msgSsj.getMode() == 1 ? "自动" : "手动",
|
||||||
@@ -145,10 +150,6 @@ public class DeviceSsjController extends BaseController
|
|||||||
String.valueOf(msgSsj.getTaskNo())
|
String.valueOf(msgSsj.getTaskNo())
|
||||||
);
|
);
|
||||||
|
|
||||||
if (msgSsj == null) {
|
|
||||||
return AjaxResult.error("【查询输送机状态】设备编号:" + id + ",该设备不存在!");
|
|
||||||
}
|
|
||||||
|
|
||||||
RequestLog requestLog = requestLogService.getRequestLog(id, "获取指定输送机状态");
|
RequestLog requestLog = requestLogService.getRequestLog(id, "获取指定输送机状态");
|
||||||
requestLog.setRequestUrl(LOCAL_URL + "/device/ssj/getConvStatus/" + id);
|
requestLog.setRequestUrl(LOCAL_URL + "/device/ssj/getConvStatus/" + id);
|
||||||
requestLog.setRequestMethod("get");
|
requestLog.setRequestMethod("get");
|
||||||
@@ -175,6 +176,11 @@ public class DeviceSsjController extends BaseController
|
|||||||
public AjaxResult getConvStatusEn(@PathVariable String id){
|
public AjaxResult getConvStatusEn(@PathVariable String id){
|
||||||
|
|
||||||
DeviceSsj msgSsj = deviceSsjService.selectDeviceSsjByDeviceCode(id);
|
DeviceSsj msgSsj = deviceSsjService.selectDeviceSsjByDeviceCode(id);
|
||||||
|
|
||||||
|
if (msgSsj == null) {
|
||||||
|
return AjaxResult.error("【查询输送机状态】设备编号:" + id + ",该设备不存在!");
|
||||||
|
}
|
||||||
|
|
||||||
ConvStatus status = new ConvStatus(
|
ConvStatus status = new ConvStatus(
|
||||||
id,
|
id,
|
||||||
msgSsj.getMode() == 1 ? "1" : "0",
|
msgSsj.getMode() == 1 ? "1" : "0",
|
||||||
@@ -183,10 +189,6 @@ public class DeviceSsjController extends BaseController
|
|||||||
msgSsj.getTaskNo()
|
msgSsj.getTaskNo()
|
||||||
);
|
);
|
||||||
|
|
||||||
if (msgSsj == null) {
|
|
||||||
return AjaxResult.error("【查询输送机状态】设备编号:" + id + ",该设备不存在!");
|
|
||||||
}
|
|
||||||
|
|
||||||
RequestLog requestLog = requestLogService.getRequestLog(id, "获取指定输送机状态");
|
RequestLog requestLog = requestLogService.getRequestLog(id, "获取指定输送机状态");
|
||||||
requestLog.setRequestUrl(LOCAL_URL + "/device/ssj/getConvStatus/en/" + id);
|
requestLog.setRequestUrl(LOCAL_URL + "/device/ssj/getConvStatus/en/" + id);
|
||||||
requestLog.setRequestMethod("get");
|
requestLog.setRequestMethod("get");
|
||||||
|
|||||||
@@ -103,6 +103,8 @@ public interface MydoJobMapper
|
|||||||
|
|
||||||
MydoJob selectMydoJobByExitId(@Param("exitId") String exitId);
|
MydoJob selectMydoJobByExitId(@Param("exitId") String exitId);
|
||||||
|
|
||||||
|
MydoJob selectMydoJobByWmsTaskNo(@Param("wmsTaskNo") String exitId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取本地生成作业号
|
* 获取本地生成作业号
|
||||||
* @param map
|
* @param map
|
||||||
|
|||||||
@@ -100,6 +100,8 @@ public interface IMydoJobService
|
|||||||
|
|
||||||
MydoJob selectMydoJobByExitId(String exitId);
|
MydoJob selectMydoJobByExitId(String exitId);
|
||||||
|
|
||||||
|
MydoJob selectMydoJobByWmsTaskNo(String wmsTaskNo);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取本地生成作业号
|
* 获取本地生成作业号
|
||||||
* @param type RK-入库 CK-出库
|
* @param type RK-入库 CK-出库
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ import com.ruoyi.common.core.domain.AjaxResult;
|
|||||||
import com.ruoyi.common.utils.DateUtils;
|
import com.ruoyi.common.utils.DateUtils;
|
||||||
import com.ruoyi.job.domain.JobCallBack;
|
import com.ruoyi.job.domain.JobCallBack;
|
||||||
import com.ruoyi.job.service.IJobCallBackService;
|
import com.ruoyi.job.service.IJobCallBackService;
|
||||||
|
import com.ruoyi.queue.ddj.service.IDdjDeviceExecutionQueueService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.scheduling.annotation.Scheduled;
|
import org.springframework.scheduling.annotation.Scheduled;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@@ -17,8 +19,7 @@ import com.ruoyi.job.mapper.MydoJobMapper;
|
|||||||
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 static com.ruoyi.common.WmsTaskTypeCode.WMS_TASK_TYPE_STOCKIN;
|
import static com.ruoyi.common.WmsTaskTypeCode.*;
|
||||||
import static com.ruoyi.common.WmsTaskTypeCode.WMS_TASK_TYPE_STOCKOUT;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 作业信息Service业务层处理
|
* 作业信息Service业务层处理
|
||||||
@@ -27,12 +28,15 @@ import static com.ruoyi.common.WmsTaskTypeCode.WMS_TASK_TYPE_STOCKOUT;
|
|||||||
* @date 2025-09-22
|
* @date 2025-09-22
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
|
@Slf4j
|
||||||
public class MydoJobServiceImpl implements IMydoJobService
|
public class MydoJobServiceImpl implements IMydoJobService
|
||||||
{
|
{
|
||||||
@Autowired
|
@Autowired
|
||||||
private MydoJobMapper mydoJobMapper;
|
private MydoJobMapper mydoJobMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
private IJobCallBackService jobCallBackService;
|
private IJobCallBackService jobCallBackService;
|
||||||
|
@Autowired
|
||||||
|
private IDdjDeviceExecutionQueueService ddjDeviceExecutionQueueService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询作业信息
|
* 查询作业信息
|
||||||
@@ -136,13 +140,17 @@ public class MydoJobServiceImpl implements IMydoJobService
|
|||||||
MydoJob task = selectMydoJobByTaskNo(rwh);
|
MydoJob task = selectMydoJobByTaskNo(rwh);
|
||||||
insertHistory(task.getJobId());
|
insertHistory(task.getJobId());
|
||||||
deleteMydoJobByJobId(task.getJobId());
|
deleteMydoJobByJobId(task.getJobId());
|
||||||
|
ddjDeviceExecutionQueueService.deleteDdjDeviceExecutionQueueByTaskNo(task.getTaskNo());
|
||||||
|
|
||||||
|
log.info("【堆垛机入库】堆垛机:"+ task.getRoadwayId() +"任务完成,任务号:"+ rwh);
|
||||||
|
|
||||||
JobCallBack jobCallBack = new JobCallBack();
|
JobCallBack jobCallBack = new JobCallBack();
|
||||||
jobCallBack.setType("2");
|
jobCallBack.setType(Integer.valueOf(task.getInOrOut()) < 20 ? "1" : "2");
|
||||||
jobCallBack.setMydoJobId(task.getJobId());
|
jobCallBack.setMydoJobId(task.getJobId());
|
||||||
jobCallBack.setStatus("0");
|
jobCallBack.setStatus("0");
|
||||||
jobCallBack.setTaskNo(Convert.toLong(task.getTaskNo()));
|
jobCallBack.setTaskNo(Convert.toLong(task.getTaskNo()));
|
||||||
jobCallBack.setCreateTime(new Date());
|
jobCallBack.setCreateTime(new Date());
|
||||||
jobCallBack.setTaskTypeCode(Integer.valueOf(task.getInOrOut()) < 20 ? WMS_TASK_TYPE_STOCKIN : WMS_TASK_TYPE_STOCKOUT);//todo ???
|
jobCallBack.setTaskTypeCode(WMS_TASK_TYPE_FINISH);
|
||||||
jobCallBack.setReqCode(UUID.randomUUID().toString().replace("-", ""));
|
jobCallBack.setReqCode(UUID.randomUUID().toString().replace("-", ""));
|
||||||
jobCallBack.setTaskCode(task.getWmsTaskNo());
|
jobCallBack.setTaskCode(task.getWmsTaskNo());
|
||||||
jobCallBackService.insertJobCallBack(jobCallBack);
|
jobCallBackService.insertJobCallBack(jobCallBack);
|
||||||
@@ -214,17 +222,16 @@ public class MydoJobServiceImpl implements IMydoJobService
|
|||||||
long jobIdNum = Long.parseLong(mydoJob.getInOrOut());
|
long jobIdNum = Long.parseLong(mydoJob.getInOrOut());
|
||||||
if (jobIdNum > 20){
|
if (jobIdNum > 20){
|
||||||
jobCallBack.setType("2");
|
jobCallBack.setType("2");
|
||||||
jobCallBack.setTaskTypeCode(WMS_TASK_TYPE_STOCKOUT);//todo wms下发的任务类型
|
|
||||||
}else{
|
}else{
|
||||||
jobCallBack.setType("1");
|
jobCallBack.setType("1");
|
||||||
jobCallBack.setTaskTypeCode(WMS_TASK_TYPE_STOCKIN);//todo wms下发的任务类型
|
|
||||||
}
|
}
|
||||||
|
jobCallBack.setTaskTypeCode(WMS_TASK_TYPE_FINISH);//todo wms下发的任务类型
|
||||||
jobCallBack.setMydoJobId(mydoJob.getJobId());
|
jobCallBack.setMydoJobId(mydoJob.getJobId());
|
||||||
jobCallBack.setStatus("0");
|
jobCallBack.setStatus("0");
|
||||||
jobCallBack.setTaskNo(Convert.toLong(mydoJob.getTaskNo()));
|
jobCallBack.setTaskNo(Convert.toLong(mydoJob.getTaskNo()));
|
||||||
jobCallBack.setCreateTime(new Date());
|
jobCallBack.setCreateTime(new Date());
|
||||||
jobCallBack.setTaskCode(mydoJob.getWmsTaskNo());
|
jobCallBack.setTaskCode(mydoJob.getWmsTaskNo());
|
||||||
|
jobCallBack.setRetry(0);
|
||||||
|
|
||||||
jobCallBack.setReqCode(UUID.randomUUID().toString());
|
jobCallBack.setReqCode(UUID.randomUUID().toString());
|
||||||
jobCallBackService.insertJobCallBack(jobCallBack);
|
jobCallBackService.insertJobCallBack(jobCallBack);
|
||||||
@@ -280,6 +287,11 @@ public class MydoJobServiceImpl implements IMydoJobService
|
|||||||
return mydoJobMapper.selectMydoJobByExitId(exitId);
|
return mydoJobMapper.selectMydoJobByExitId(exitId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MydoJob selectMydoJobByWmsTaskNo(String wmsTaskNo){
|
||||||
|
return mydoJobMapper.selectMydoJobByWmsTaskNo(wmsTaskNo);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<MydoJob> selectMydoJobFinishList(MydoJob mydoJob) {
|
public List<MydoJob> selectMydoJobFinishList(MydoJob mydoJob) {
|
||||||
return mydoJobMapper.selectMydoJobFinishList(mydoJob);
|
return mydoJobMapper.selectMydoJobFinishList(mydoJob);
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ public interface DdjDeviceExecutionQueueMapper
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int updateDdjDeviceExecutionQueue(DdjDeviceExecutionQueue ddjDeviceExecutionQueue);
|
public int updateDdjDeviceExecutionQueue(DdjDeviceExecutionQueue ddjDeviceExecutionQueue);
|
||||||
public int updateDdjDeviceExecutionQueue1(DdjDeviceExecutionQueue ddjDeviceExecutionQueue);
|
// public int updateDdjDeviceExecutionQueue1(DdjDeviceExecutionQueue ddjDeviceExecutionQueue);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除堆垛机执行队列
|
* 删除堆垛机执行队列
|
||||||
@@ -61,6 +61,14 @@ public interface DdjDeviceExecutionQueueMapper
|
|||||||
*/
|
*/
|
||||||
public int deleteDdjDeviceExecutionQueueByUuid(String uuid);
|
public int deleteDdjDeviceExecutionQueueByUuid(String uuid);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除堆垛机执行队列
|
||||||
|
*
|
||||||
|
* @param taskNo 堆垛机执行队列主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteDdjDeviceExecutionQueueByTaskNo(String taskNo);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除堆垛机执行队列
|
* 批量删除堆垛机执行队列
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -59,6 +59,14 @@ public interface IDdjDeviceExecutionQueueService
|
|||||||
*/
|
*/
|
||||||
public int deleteDdjDeviceExecutionQueueByUuids(String[] uuids);
|
public int deleteDdjDeviceExecutionQueueByUuids(String[] uuids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询任务号删除堆垛机执行队列
|
||||||
|
*
|
||||||
|
* @param taskNo 需要删除的堆垛机执行队列的任务号
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteDdjDeviceExecutionQueueByTaskNo(String taskNo);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除堆垛机执行队列信息
|
* 删除堆垛机执行队列信息
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -93,6 +93,10 @@ public class DdjDeviceExecutionQueueServiceImpl implements IDdjDeviceExecutionQu
|
|||||||
return ddjDeviceExecutionQueueMapper.deleteDdjDeviceExecutionQueueByUuids(uuids);
|
return ddjDeviceExecutionQueueMapper.deleteDdjDeviceExecutionQueueByUuids(uuids);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int deleteDdjDeviceExecutionQueueByTaskNo(String taskNo){
|
||||||
|
return ddjDeviceExecutionQueueMapper.deleteDdjDeviceExecutionQueueByTaskNo(taskNo);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除堆垛机执行队列信息
|
* 删除堆垛机执行队列信息
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -109,6 +109,7 @@ public class PlcSsjRead implements Runnable {
|
|||||||
ssjDevice.setSszt(ParseUtil.optInt(8, ddsx1));
|
ssjDevice.setSszt(ParseUtil.optInt(8, ddsx1));
|
||||||
ssjDevice.setRkqq(ParseUtil.optInt(10, ddsx1));
|
ssjDevice.setRkqq(ParseUtil.optInt(10, ddsx1));
|
||||||
ssjDevice.setHeight(ParseUtil.optInt(12, ddsx1));
|
ssjDevice.setHeight(ParseUtil.optInt(12, ddsx1));
|
||||||
|
ssjDevice.setTraySize(ParseUtil.optInt(12, ddsx1)); //此处不修改device_ssj表,把托盘尺寸值当作高度使用
|
||||||
ssjDevice.setTrayCode(ParseUtil.optString(14, ddsx1));
|
ssjDevice.setTrayCode(ParseUtil.optString(14, ddsx1));
|
||||||
ssjDevice.setMode(ParseUtil.optInt(24, ddsx1));//todo 输送机操作模式
|
ssjDevice.setMode(ParseUtil.optInt(24, ddsx1));//todo 输送机操作模式
|
||||||
ssjDevice.setException(ParseUtil.optInt(28, ddsx1));
|
ssjDevice.setException(ParseUtil.optInt(28, ddsx1));
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ public class ParseUtil {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
public static String optString(int start, String data) {
|
public static String optString(int start, String data) {
|
||||||
byte[] bytes = SoftBasic.HexStringToBytes(data.substring(start * 2, (start + 7) * 2));
|
byte[] bytes = SoftBasic.HexStringToBytes(data.substring(start * 2, (start + 10) * 2));
|
||||||
return Tools.bytetostringtool(bytes);
|
return Tools.bytetostringtool(bytes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,38 +1,53 @@
|
|||||||
package com.ruoyi.schedule.scheduleTask;
|
package com.ruoyi.schedule.scheduleTask;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import cn.hutool.core.lang.UUID;
|
||||||
|
import com.ruoyi.api.domain.wcs2wms.exception.TaskExceptionReceive;
|
||||||
|
import com.ruoyi.api.domain.wcs2wms.exception.TaskExceptionRequest;
|
||||||
|
import com.ruoyi.api.service.IApiService;
|
||||||
|
import com.ruoyi.bas.cargospace.domain.BasCargoSpace;
|
||||||
import com.ruoyi.bas.cargospace.service.IBasCargoSpaceService;
|
import com.ruoyi.bas.cargospace.service.IBasCargoSpaceService;
|
||||||
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
import com.ruoyi.job.domain.MydoJob;
|
import com.ruoyi.job.domain.MydoJob;
|
||||||
import com.ruoyi.job.service.IJobCallBackService;
|
import com.ruoyi.job.service.IJobCallBackService;
|
||||||
import com.ruoyi.job.service.IMydoJobService;
|
import com.ruoyi.job.service.IMydoJobService;
|
||||||
|
import com.ruoyi.queue.ddj.domain.DdjDeviceExecutionQueue;
|
||||||
|
import com.ruoyi.queue.ddj.service.IDdjDeviceExecutionQueueService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.scheduling.annotation.Scheduled;
|
import org.springframework.scheduling.annotation.Scheduled;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import static com.ruoyi.common.TaskExceptionType.TASK_EXCEPTION_STOCKIN_OCCUPIED;
|
||||||
import static com.ruoyi.common.TaskStatusCode.*;
|
import static com.ruoyi.common.TaskStatusCode.*;
|
||||||
|
import static com.ruoyi.common.WmsTaskTypeCode.WMS_TASK_TYPE_EXCEPTION;
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
|
@Slf4j
|
||||||
public class TaskHandler {
|
public class TaskHandler {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IMydoJobService mydoJobService;
|
private IMydoJobService mydoJobService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IJobCallBackService jobCallBackService;
|
private IJobCallBackService jobCallBackService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IBasCargoSpaceService basCargoSpaceService;
|
private IBasCargoSpaceService basCargoSpaceService;
|
||||||
|
@Autowired
|
||||||
|
private IApiService apiService;
|
||||||
|
@Autowired
|
||||||
|
private IDdjDeviceExecutionQueueService ddjDeviceExecutionQueueService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 处理未正常移除的【堆垛机执行完成】或【出库到位】的遗留任务
|
* 处理未正常移除的【堆垛机执行完成】或【出库到位】的遗留任务
|
||||||
*/
|
*/
|
||||||
@Scheduled(fixedDelay = 3000)
|
// @Scheduled(fixedDelay = 3000)
|
||||||
public void mydoJobHandler() {
|
public void mydoJobHandler() {
|
||||||
//此处 - 堆垛机执行完成【TASK_EP_DDJ_FINISH】和出库到位【TASK_EP_SSJ_STOCKOUT_FINISH】的常量值相同,均可表示任务【已完成】
|
//此处 - 堆垛机执行完成【TASK_EP_DDJ_FINISH】和出库到位【TASK_EP_SSJ_STOCKOUT_FINISH】的常量值相同,均可表示任务【已完成】
|
||||||
//用任意一种状态查询所有标记为【已完成】的任务
|
//用任意一种状态查询所有标记为【已完成】的任务
|
||||||
List<MydoJob> jobs = mydoJobService.selectMydoJobList(
|
List<MydoJob> jobs = mydoJobService.selectMydoJobList(
|
||||||
new MydoJob().builder().executionPhase(TASK_EP_DDJ_FINISH).build()
|
new MydoJob().builder().executionPhase(TASK_EP_FINISH).build()
|
||||||
);
|
);
|
||||||
if (!jobs.isEmpty()) {
|
if (!jobs.isEmpty()) {
|
||||||
for (MydoJob job : jobs) {
|
for (MydoJob job : jobs) {
|
||||||
@@ -51,14 +66,45 @@ public class TaskHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// @Scheduled(fixedDelay = 3000)
|
/**
|
||||||
|
* 入库异常 - 【放货有货】处理方法
|
||||||
|
*/
|
||||||
|
@Scheduled(fixedDelay = 2000)
|
||||||
public void stockinExceptionHandler() {
|
public void stockinExceptionHandler() {
|
||||||
List<MydoJob> jobs = mydoJobService.selectInOrOutMydoJobList(
|
List<MydoJob> jobs = mydoJobService.selectInOrOutMydoJobList(
|
||||||
new MydoJob().builder().executionPhase(TASK_EXCEPTION_PUT).build()
|
new MydoJob().builder().executionPhase(TASK_EXCEPTION_PUT).build()
|
||||||
);
|
);
|
||||||
if (!jobs.isEmpty()) {
|
if (!jobs.isEmpty()) {
|
||||||
for (MydoJob job : jobs) {
|
for (MydoJob job : jobs) {
|
||||||
|
//上报异常 - 向wms请求重分接口
|
||||||
|
TaskExceptionRequest taskExceptionRequest = new TaskExceptionRequest();
|
||||||
|
taskExceptionRequest.setTaskClass(job.getInOrOut().substring(0, 1));
|
||||||
|
taskExceptionRequest.setType(String.valueOf(TASK_EXCEPTION_STOCKIN_OCCUPIED));
|
||||||
|
taskExceptionRequest.setTaskCode(job.getWmsTaskNo());
|
||||||
|
taskExceptionRequest.setTaskTypeCode(WMS_TASK_TYPE_EXCEPTION);//todo 不知道填什么
|
||||||
|
taskExceptionRequest.setReqCode(UUID.randomUUID().toString().replace("-", ""));
|
||||||
|
taskExceptionRequest.setAdverseCauses("当前位置已有货物,盘点后重新分配货位");
|
||||||
|
|
||||||
|
AjaxResult ajaxResult = apiService.reAssign(taskExceptionRequest);
|
||||||
|
if (ajaxResult.isSuccess()){
|
||||||
|
//获取返回的任务号和新分配的货位
|
||||||
|
TaskExceptionReceive mydoJobReAssign = BeanUtil.toBean(ajaxResult.get("data"), TaskExceptionReceive.class);
|
||||||
|
|
||||||
|
MydoJob wmsJob = new MydoJob();
|
||||||
|
wmsJob.setWmsTaskNo(mydoJobReAssign.getTaskCode());
|
||||||
|
if (mydoJobService.selectMydoJobList(wmsJob).size() == 0) {
|
||||||
|
log.warn("【响应异常】该任务不存在,任务号:{}", mydoJobReAssign.getTaskCode());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
//更新任务参数
|
||||||
|
job = mydoJobService.selectMydoJobByTaskNo(Long.valueOf(job.getTaskNo()));
|
||||||
|
job.setCargoSpaceId(mydoJobReAssign.getSiteCode());
|
||||||
|
job.setExecutionPhase(TASK_EXCEPTION_PUT_REASSIGN);
|
||||||
|
job.setFaultFlag("2");
|
||||||
|
mydoJobService.updateMydoJob(job);
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -66,8 +112,10 @@ public class TaskHandler {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
// @Scheduled(fixedDelay = 3000)
|
* 出库异常 - 【取货无货】处理方法
|
||||||
|
*/
|
||||||
|
@Scheduled(fixedDelay = 2000)
|
||||||
public void stockoutExceptionHandler() {
|
public void stockoutExceptionHandler() {
|
||||||
List<MydoJob> jobs = mydoJobService.selectInOrOutMydoJobList(
|
List<MydoJob> jobs = mydoJobService.selectInOrOutMydoJobList(
|
||||||
new MydoJob().builder().executionPhase(TASK_EXCEPTION_PICK).build()
|
new MydoJob().builder().executionPhase(TASK_EXCEPTION_PICK).build()
|
||||||
@@ -75,12 +123,52 @@ public class TaskHandler {
|
|||||||
|
|
||||||
if (!jobs.isEmpty()) {
|
if (!jobs.isEmpty()) {
|
||||||
for (MydoJob job : jobs) {
|
for (MydoJob job : jobs) {
|
||||||
mydoJobService.InvalidMydoJob(Long.valueOf(job.getTaskNo()), Integer.valueOf(job.getRoadwayId()));
|
//向wms返回异常信息
|
||||||
|
TaskExceptionRequest taskExceptionRequest = new TaskExceptionRequest();
|
||||||
|
taskExceptionRequest.setTaskClass(job.getInOrOut().substring(0, 1));
|
||||||
|
taskExceptionRequest.setType(String.valueOf(TASK_EXCEPTION_STOCKIN_OCCUPIED));
|
||||||
|
taskExceptionRequest.setTaskCode(String.valueOf(job.getWmsTaskNo()));
|
||||||
|
taskExceptionRequest.setTaskTypeCode(WMS_TASK_TYPE_EXCEPTION);//todo 不知道填什么
|
||||||
|
taskExceptionRequest.setReqCode(UUID.randomUUID().toString().replace("-", ""));
|
||||||
|
taskExceptionRequest.setAdverseCauses("取货位置空,盘点后作废该任务");
|
||||||
|
|
||||||
|
AjaxResult ajaxResult = apiService.reMaterial(taskExceptionRequest);
|
||||||
|
|
||||||
|
if (ajaxResult.isSuccess()){
|
||||||
|
mydoJobService.InvalidMydoJob(Long.valueOf(job.getTaskNo()), Integer.valueOf(job.getRoadwayId()));
|
||||||
|
//清空/重置【取货无货】的出库异常货位库存信息
|
||||||
|
basCargoSpaceService.resetCargoSpaceByStockoutException(job.getCargoSpaceId());
|
||||||
|
}
|
||||||
|
|
||||||
//清空/重置【取货无货】的出库异常货位库存信息
|
|
||||||
basCargoSpaceService.resetCargoSpaceByStockoutException(job.getCargoSpaceId());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 入库重分完成 - 堆垛机重新下发
|
||||||
|
*/
|
||||||
|
@Scheduled(fixedDelay = 2000)
|
||||||
|
public void sendTaskForStacker(){
|
||||||
|
List<MydoJob> jobs = mydoJobService.selectInOrOutMydoJobList(
|
||||||
|
new MydoJob().builder().executionPhase(TASK_EXCEPTION_PUT_REASSIGN).build()
|
||||||
|
);
|
||||||
|
|
||||||
|
if (!jobs.isEmpty()) {
|
||||||
|
for (MydoJob job : jobs) {
|
||||||
|
//获取重分的货位重新向堆垛机下发任务
|
||||||
|
BasCargoSpace basCargoSpace = basCargoSpaceService.selectBasCargoSpaceByWmsCargoSpaceId(job.getCargoSpaceId());
|
||||||
|
DdjDeviceExecutionQueue ddjDeviceExecutionQueue =
|
||||||
|
ddjDeviceExecutionQueueService.selectDdjDeviceExecutionQueueByRwh(Long.valueOf(job.getTaskNo()), Integer.valueOf(job.getRoadwayId()));
|
||||||
|
ddjDeviceExecutionQueue.setMbph(basCargoSpace.getThePlatoon());
|
||||||
|
ddjDeviceExecutionQueue.setMblh(basCargoSpace.getTheColumn());
|
||||||
|
ddjDeviceExecutionQueue.setMbch(basCargoSpace.getTheFloor());
|
||||||
|
ddjDeviceExecutionQueue.setDdjxf("0");
|
||||||
|
ddjDeviceExecutionQueueService.updateDdjDeviceExecutionQueue(ddjDeviceExecutionQueue);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ import java.util.List;
|
|||||||
|
|
||||||
import static com.ruoyi.common.TaskExceptionType.TASK_EXCEPTION_STOCKIN_OCCUPIED;
|
import static com.ruoyi.common.TaskExceptionType.TASK_EXCEPTION_STOCKIN_OCCUPIED;
|
||||||
import static com.ruoyi.common.TaskStatusCode.*;
|
import static com.ruoyi.common.TaskStatusCode.*;
|
||||||
|
import static com.ruoyi.common.WmsTaskTypeCode.WMS_TASK_TYPE_EXCEPTION;
|
||||||
|
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@@ -103,16 +104,19 @@ public class DdjThread implements Runnable {
|
|||||||
以防存在漏处理,没处理的情况发生
|
以防存在漏处理,没处理的情况发生
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
//非【联机自动】状态
|
||||||
|
if (ddj.getCzfs() != 5) return;
|
||||||
|
|
||||||
// 检查当前堆垛机参数 - 是否有执行中的作业
|
// 检查当前堆垛机参数 - 是否有执行中的作业
|
||||||
// 1.联机自动【5】 2.设备状态【0】 3.执行阶段【0】【5】(无执行中的任务)
|
// 1.联机自动【5】 2.设备状态【0】 3.执行阶段【0】【5】(无执行中的任务)
|
||||||
if (ddj.getCzfs() == 5 && ddj.getSbzt() == 0 && (ddj.getJdbz() == 5 || ddj.getJdbz() == 0)) {
|
if (ddj.getSbzt() == 0 && (ddj.getJdbz() == 5 || ddj.getJdbz() == 0)) {
|
||||||
Long rwh = ddj.getRwh();
|
Long rwh = ddj.getRwh();
|
||||||
|
|
||||||
//完成作业
|
//完成作业
|
||||||
MydoJob mydoJob = mydoJobService.selectMydoJobByTaskNo(rwh);
|
MydoJob mydoJob = mydoJobService.selectMydoJobByTaskNo(rwh);
|
||||||
DdjDeviceExecutionQueue ddjDeviceExecutionQueue = ddjDeviceExecutionQueueService.selectDdjDeviceExecutionQueueByRwh(rwh,ddj.getId());
|
DdjDeviceExecutionQueue ddjDeviceExecutionQueue = ddjDeviceExecutionQueueService.selectDdjDeviceExecutionQueueByRwh(rwh,ddj.getId());
|
||||||
|
|
||||||
//满足上述条件,表示该任务已完成-执行任务回传
|
//满足上述条件(【有实时任务】且【存在堆垛机执行队列】),表示该任务已完成-执行任务回传
|
||||||
if (mydoJob != null && ddjDeviceExecutionQueue != null) {
|
if (mydoJob != null && ddjDeviceExecutionQueue != null) {
|
||||||
//标记为堆垛机执行完成
|
//标记为堆垛机执行完成
|
||||||
mydoJob.setExecutionPhase(TASK_EP_DDJ_FINISH);
|
mydoJob.setExecutionPhase(TASK_EP_DDJ_FINISH);
|
||||||
@@ -126,7 +130,7 @@ public class DdjThread implements Runnable {
|
|||||||
//-------------------------------------- 【2 更新执行阶段】 --------------------------------------
|
//-------------------------------------- 【2 更新执行阶段】 --------------------------------------
|
||||||
|
|
||||||
// 1.联机自动【5】 2.设备状态 - 运行中【1】 3.执行阶段【2】
|
// 1.联机自动【5】 2.设备状态 - 运行中【1】 3.执行阶段【2】
|
||||||
if (ddj.getCzfs() == 5 && ddj.getSbzt() == 1 && ddj.getJdbz() == 2) {
|
if (ddj.getSbzt() == 1 && ddj.getJdbz() == 2) {
|
||||||
|
|
||||||
//根据堆垛机上任务号,修改任务执行阶段
|
//根据堆垛机上任务号,修改任务执行阶段
|
||||||
Long rwh = ddj.getRwh();
|
Long rwh = ddj.getRwh();
|
||||||
@@ -141,110 +145,121 @@ public class DdjThread implements Runnable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------- 【3 放货有货,重新分配货位】-------------------------------------- */
|
/* -------------------------------------- 【3 放货有货,重新分配货位】-------------------------------------- */
|
||||||
|
// ddj.setCzfs(5);
|
||||||
|
// ddj.setSbzt(1052);
|
||||||
|
// ddj.setYxxf(1);
|
||||||
|
// ddj.setJdbz(4);
|
||||||
|
// ddj.setRwh(85015L);
|
||||||
// 1.联机自动【5】 2.设备状态-放货有货【1052】 3.执行阶段【0】【5】(无执行中的任务)
|
// 1.联机自动【5】 2.设备状态-放货有货【1052】 3.执行阶段【0】【5】(无执行中的任务)
|
||||||
if (ddj.getCzfs() == 5 && ddj.getSbzt() == 1052 && ddj.getJdbz() < 5 && ddj.getYxxf() == 1) {
|
if (ddj.getSbzt() == 1052 && ddj.getJdbz() < 5 && ddj.getYxxf() == 1) {
|
||||||
|
|
||||||
// 判断堆垛机上任务是否已重分,若未重分,则调用接口,请求重分货位
|
// 判断堆垛机上任务是否已重分,若未重分,则调用接口,请求重分货位
|
||||||
Long rwh = ddj.getRwh();
|
Long rwh = ddj.getRwh();
|
||||||
|
|
||||||
//查村正在执行中的【任务号】获取堆垛机队列
|
//查询正在执行中的【任务号】获取堆垛机队列
|
||||||
MydoJob mydoJob = mydoJobService.selectMydoJobByTaskNo(rwh);
|
MydoJob mydoJob = mydoJobService.selectMydoJobByTaskNo(rwh);
|
||||||
DdjDeviceExecutionQueue ddjDeviceExecutionQueue = ddjDeviceExecutionQueueService.selectDdjDeviceExecutionQueueByRwh(rwh, ddj.getId());
|
|
||||||
|
|
||||||
//更新异常类型【FaultFlag】-1
|
if (mydoJob != null && mydoJob.getExecutionPhase() != TASK_EXCEPTION_PUT) {
|
||||||
if ("0".equals(mydoJob.getFaultFlag()) && "1".equals(ddjDeviceExecutionQueue.getSpare1())) {
|
DdjDeviceExecutionQueue ddjDeviceExecutionQueue = ddjDeviceExecutionQueueService.selectDdjDeviceExecutionQueueByRwh(rwh, ddj.getId());
|
||||||
mydoJob.setStatus("1");
|
//更新异常类型【FaultFlag】-1
|
||||||
//把执行阶段标记为【入库放货有货】的异常
|
if ("0".equals(mydoJob.getFaultFlag()) && "1".equals(ddjDeviceExecutionQueue.getSpare1())) {
|
||||||
mydoJob.setExecutionPhase(TASK_EXCEPTION_PUT);
|
mydoJob.setStatus("1");
|
||||||
mydoJobService.updateMydoJob(mydoJob);
|
//把执行阶段标记为【入库放货有货】的异常
|
||||||
|
mydoJob.setExecutionPhase(TASK_EXCEPTION_PUT);
|
||||||
//上报异常 - 向wms请求重分接口
|
|
||||||
TaskExceptionRequest taskExceptionRequest = new TaskExceptionRequest();
|
|
||||||
taskExceptionRequest.setTaskClass(mydoJob.getInOrOut());
|
|
||||||
taskExceptionRequest.setType(String.valueOf(TASK_EXCEPTION_STOCKIN_OCCUPIED));
|
|
||||||
taskExceptionRequest.setTaskCode(mydoJob.getWmsTaskNo());
|
|
||||||
taskExceptionRequest.setTaskTypeCode("");//todo 不知道填什么
|
|
||||||
taskExceptionRequest.setReqCode(UUID.randomUUID().toString().replace("-", ""));
|
|
||||||
taskExceptionRequest.setAdverseCauses("当前位置已有货物,盘点后重新分配货位");
|
|
||||||
|
|
||||||
AjaxResult ajaxResult = apiService.reAssign(taskExceptionRequest);
|
|
||||||
if (ajaxResult.isSuccess()){
|
|
||||||
//获取返回的任务号和新分配的货位
|
|
||||||
TaskExceptionReceive mydoJobReAssign = BeanUtil.toBean(ajaxResult.get("result"), TaskExceptionReceive.class);
|
|
||||||
|
|
||||||
MydoJob wmsJob = new MydoJob();
|
|
||||||
wmsJob.setInOrOut(mydoJobReAssign.getTaskCode());
|
|
||||||
if (mydoJobService.selectMydoJobList(wmsJob).size() == 0) {
|
|
||||||
log.warn("【响应异常】该任务不存在,任务号:{}", mydoJobReAssign.getTaskCode());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
//更新任务参数
|
|
||||||
mydoJob = mydoJobService.selectMydoJobByTaskNo(rwh);
|
|
||||||
mydoJob.setCargoSpaceId(mydoJobReAssign.getSiteCode());
|
|
||||||
mydoJob.setExecutionPhase(TASK_EP_DDJ);
|
|
||||||
mydoJob.setFaultFlag("2");
|
|
||||||
mydoJobService.updateMydoJob(mydoJob);
|
mydoJobService.updateMydoJob(mydoJob);
|
||||||
|
}
|
||||||
|
|
||||||
//获取重分的货位重新向堆垛机下发任务
|
// //上报异常 - 向wms请求重分接口
|
||||||
BasCargoSpace basCargoSpace = basCargoSpaceService.selectBasCargoSpaceByWmsCargoSpaceId(mydoJob.getCargoSpaceId());
|
// TaskExceptionRequest taskExceptionRequest = new TaskExceptionRequest();
|
||||||
ddjDeviceExecutionQueue.setMbph(basCargoSpace.getThePlatoon());
|
// taskExceptionRequest.setTaskClass(mydoJob.getInOrOut().substring(0, 1));
|
||||||
ddjDeviceExecutionQueue.setMblh(basCargoSpace.getTheColumn());
|
// taskExceptionRequest.setType(String.valueOf(TASK_EXCEPTION_STOCKIN_OCCUPIED));
|
||||||
ddjDeviceExecutionQueue.setMbch(basCargoSpace.getTheFloor());
|
// taskExceptionRequest.setTaskCode(mydoJob.getWmsTaskNo());
|
||||||
ddjDeviceExecutionQueue.setDdjxf("0");
|
// taskExceptionRequest.setTaskTypeCode(WMS_TASK_TYPE_EXCEPTION);//todo 不知道填什么
|
||||||
ddjDeviceExecutionQueueService.updateDdjDeviceExecutionQueue(ddjDeviceExecutionQueue);
|
// taskExceptionRequest.setReqCode(UUID.randomUUID().toString().replace("-", ""));
|
||||||
}
|
// taskExceptionRequest.setAdverseCauses("当前位置已有货物,盘点后重新分配货位");
|
||||||
|
//
|
||||||
|
// AjaxResult ajaxResult = apiService.reAssign(taskExceptionRequest);
|
||||||
|
// if (ajaxResult.isSuccess()){
|
||||||
|
// //获取返回的任务号和新分配的货位
|
||||||
|
// TaskExceptionReceive mydoJobReAssign = BeanUtil.toBean(ajaxResult.get("result"), TaskExceptionReceive.class);
|
||||||
|
//
|
||||||
|
// MydoJob wmsJob = new MydoJob();
|
||||||
|
// wmsJob.setWmsTaskNo(mydoJobReAssign.getTaskCode());
|
||||||
|
// if (mydoJobService.selectMydoJobList(wmsJob).size() == 0) {
|
||||||
|
// log.warn("【响应异常】该任务不存在,任务号:{}", mydoJobReAssign.getTaskCode());
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// //更新任务参数
|
||||||
|
// mydoJob = mydoJobService.selectMydoJobByTaskNo(rwh);
|
||||||
|
// mydoJob.setCargoSpaceId(mydoJobReAssign.getSiteCode());
|
||||||
|
// mydoJob.setExecutionPhase(TASK_EP_DDJ);
|
||||||
|
// mydoJob.setFaultFlag("2");
|
||||||
|
// mydoJobService.updateMydoJob(mydoJob);
|
||||||
|
//
|
||||||
|
// //获取重分的货位重新向堆垛机下发任务
|
||||||
|
// BasCargoSpace basCargoSpace = basCargoSpaceService.selectBasCargoSpaceByWmsCargoSpaceId(mydoJob.getCargoSpaceId());
|
||||||
|
// ddjDeviceExecutionQueue.setMbph(basCargoSpace.getThePlatoon());
|
||||||
|
// ddjDeviceExecutionQueue.setMblh(basCargoSpace.getTheColumn());
|
||||||
|
// ddjDeviceExecutionQueue.setMbch(basCargoSpace.getTheFloor());
|
||||||
|
// ddjDeviceExecutionQueue.setDdjxf("0");
|
||||||
|
// ddjDeviceExecutionQueueService.updateDdjDeviceExecutionQueue(ddjDeviceExecutionQueue);
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// -------------------------------------- 4 取货无货,作废当前任务,重新分配单据 --------------------------------------
|
// -------------------------------------- 4 取货无货,作废当前任务,重新分配单据 --------------------------------------
|
||||||
|
|
||||||
//测试数据
|
//测试数据
|
||||||
// ddj.setCzfs(5);
|
// ddj.setCzfs(5);
|
||||||
// ddj.setSbzt(1053);
|
// ddj.setSbzt(1053);
|
||||||
// ddj.setYxxf(1);
|
// ddj.setYxxf(1);
|
||||||
// ddj.setJdbz(3);
|
// ddj.setJdbz(3);
|
||||||
// ddj.setRwh(Long.valueOf(51217));
|
// ddj.setRwh(20021L);
|
||||||
// ddj.setId(1);
|
// ddj.setId(1);
|
||||||
// 1.联机自动【5】 2.设备状态-取货无货【1053】 3.执行阶段【<5】(任务执行中)
|
// 1.联机自动【5】 2.设备状态-取货无货【1053】 3.执行阶段【<5】(任务执行中)
|
||||||
if (ddj.getCzfs() == 5 && ddj.getSbzt() == 1053 && ddj.getJdbz() < 5) {
|
if (ddj.getSbzt() == 1053 && ddj.getJdbz() < 5) {
|
||||||
Long rwh = ddj.getRwh();
|
Long rwh = ddj.getRwh();
|
||||||
MydoJob mydoJob = mydoJobService.selectMydoJobByTaskNo(rwh);
|
MydoJob mydoJob = mydoJobService.selectMydoJobByTaskNo(rwh);
|
||||||
//把执行阶段标记为【出库取货无货】的异常
|
|
||||||
mydoJob.setExecutionPhase(TASK_EXCEPTION_PICK);
|
|
||||||
mydoJobService.updateMydoJob(mydoJob);
|
|
||||||
|
|
||||||
//无货异常处理
|
if (mydoJob != null && mydoJob.getExecutionPhase() != TASK_EXCEPTION_PICK) {
|
||||||
DdjDeviceExecutionQueue ddjDeviceExecutionQueue = ddjDeviceExecutionQueueService.selectDdjDeviceExecutionQueueByRwh(rwh,ddj.getId());
|
//把执行阶段标记为【出库取货无货】的异常
|
||||||
|
mydoJob.setExecutionPhase(TASK_EXCEPTION_PICK);
|
||||||
//找到对应任务 调用api接口 取货无货,重新分配单据
|
mydoJobService.updateMydoJob(mydoJob);
|
||||||
if (ObjUtil.isNotNull(ddjDeviceExecutionQueue)) {
|
|
||||||
|
|
||||||
//向wms返回异常信息
|
|
||||||
TaskExceptionRequest taskExceptionRequest = new TaskExceptionRequest();
|
|
||||||
taskExceptionRequest.setTaskClass(mydoJob.getInOrOut());
|
|
||||||
taskExceptionRequest.setType(String.valueOf(TASK_EXCEPTION_STOCKIN_OCCUPIED));
|
|
||||||
taskExceptionRequest.setTaskCode(String.valueOf(mydoJob));
|
|
||||||
taskExceptionRequest.setTaskTypeCode("");//todo 不知道填什么
|
|
||||||
taskExceptionRequest.setReqCode(UUID.randomUUID().toString().replace("-", ""));
|
|
||||||
taskExceptionRequest.setAdverseCauses("取货位置空,盘点后作废该任务");
|
|
||||||
|
|
||||||
AjaxResult ajaxResult = apiService.reMaterial(taskExceptionRequest);
|
|
||||||
if (ajaxResult.isSuccess()) {
|
|
||||||
//作废作业
|
|
||||||
InvalidMydoJob(rwh, ddj.getId());
|
|
||||||
|
|
||||||
//清空/重置【取货无货】的出库异常货位库存信息
|
|
||||||
basCargoSpaceService.resetCargoSpaceByStockoutException(mydoJob.getCargoSpaceId());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// //无货异常处理
|
||||||
|
// DdjDeviceExecutionQueue ddjDeviceExecutionQueue = ddjDeviceExecutionQueueService.selectDdjDeviceExecutionQueueByRwh(rwh,ddj.getId());
|
||||||
|
//
|
||||||
|
// //找到对应任务 调用api接口 取货无货,重新分配单据
|
||||||
|
// if (ObjUtil.isNotNull(ddjDeviceExecutionQueue)) {
|
||||||
|
//
|
||||||
|
// //向wms返回异常信息
|
||||||
|
// TaskExceptionRequest taskExceptionRequest = new TaskExceptionRequest();
|
||||||
|
// taskExceptionRequest.setTaskClass(mydoJob.getInOrOut().substring(0, 1));
|
||||||
|
// taskExceptionRequest.setType(String.valueOf(TASK_EXCEPTION_STOCKIN_OCCUPIED));
|
||||||
|
// taskExceptionRequest.setTaskCode(String.valueOf(mydoJob));
|
||||||
|
// taskExceptionRequest.setTaskTypeCode(WMS_TASK_TYPE_EXCEPTION);//todo 不知道填什么
|
||||||
|
// taskExceptionRequest.setReqCode(UUID.randomUUID().toString().replace("-", ""));
|
||||||
|
// taskExceptionRequest.setAdverseCauses("取货位置空,盘点后作废该任务");
|
||||||
|
//
|
||||||
|
// AjaxResult ajaxResult = apiService.reMaterial(taskExceptionRequest);
|
||||||
|
// if (ajaxResult.isSuccess()) {
|
||||||
|
// //作废作业
|
||||||
|
// InvalidMydoJob(rwh, ddj.getId());
|
||||||
|
//
|
||||||
|
// //清空/重置【取货无货】的出库异常货位库存信息
|
||||||
|
// basCargoSpaceService.resetCargoSpaceByStockoutException(mydoJob.getCargoSpaceId());
|
||||||
|
// }
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
// -------------------------------------- 5 下发堆垛机任务 --------------------------------------
|
// -------------------------------------- 5 下发堆垛机任务 --------------------------------------
|
||||||
|
|
||||||
//重分货位后重下
|
//重分货位后重下
|
||||||
if (ddj.getYxxf() == 1 && ddj.getCzfs() == 5 && ddj.getSbzt() == 1052) {
|
if (ddj.getYxxf() == 1 && ddj.getSbzt() == 1052) {
|
||||||
Long rwh = ddj.getRwh();
|
Long rwh = ddj.getRwh();
|
||||||
|
|
||||||
//查询执行中的作业
|
//查询执行中的作业
|
||||||
@@ -266,16 +281,16 @@ public class DdjThread implements Runnable {
|
|||||||
ddjDeviceExecutionQueueService.updateDdjDeviceExecutionQueue(ddjDeviceExecutionQueue);
|
ddjDeviceExecutionQueueService.updateDdjDeviceExecutionQueue(ddjDeviceExecutionQueue);
|
||||||
mydoJob.setFaultFlag("0");
|
mydoJob.setFaultFlag("0");
|
||||||
mydoJobService.updateMydoJob(mydoJob);
|
mydoJobService.updateMydoJob(mydoJob);
|
||||||
log.info("【入库异常】堆垛机放货目标有货,重分货位下发任务成功 rwh:{}", rwh);
|
log.info("【入库异常】堆垛机放货目标有货,重分货位下发堆垛机任务成功 rwh:{}", rwh);
|
||||||
} else {
|
} else {
|
||||||
log.error("【出库异常】堆垛机放货目标有货,重分货位下发任务失败!!!!!!!");
|
log.error("【入库异常】重分货位 - 下发堆垛机任务失败!!!!!!!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//正常下发
|
//正常下发
|
||||||
if (ddj.getYxxf() == 1 && ddj.getCzfs() == 5 && ddj.getSbzt() == 0 ) {
|
if (ddj.getYxxf() == 1 && ddj.getSbzt() == 0 ) {
|
||||||
//检查是否有正在执行的堆垛机队列
|
//检查是否有正在执行的堆垛机队列
|
||||||
Long rwh = ddj.getRwh();
|
Long rwh = ddj.getRwh();
|
||||||
DdjDeviceExecutionQueue ddjDeviceExecutionQueueRunningParam = new DdjDeviceExecutionQueue();
|
DdjDeviceExecutionQueue ddjDeviceExecutionQueueRunningParam = new DdjDeviceExecutionQueue();
|
||||||
@@ -348,9 +363,10 @@ public class DdjThread implements Runnable {
|
|||||||
int mbch = Convert.toInt(queue.getMbch());
|
int mbch = Convert.toInt(queue.getMbch());
|
||||||
int mlfs = 5;
|
int mlfs = 5;
|
||||||
int xfwc = 1;
|
int xfwc = 1;
|
||||||
int rwlx = Convert.toInt(queue.getSpare1());
|
int hwlx = Convert.toInt(queue.getSpare1());
|
||||||
int jym = Tools.getJYM(taskNo, yph, ylh, ych, mbph, mblh, mbch, mlfs, rwlx);
|
// int hwlx = 0;//默认值
|
||||||
byte[] sendData = Tools.sendDataToDevice(taskNo, null, yph, ylh, ych, mbph, mblh, mbch, mlfs, rwlx, xfwc, jym);
|
int jym = Tools.getJYM(taskNo, yph, ylh, ych, mbph, mblh, mbch, mlfs, hwlx);
|
||||||
|
byte[] sendData = Tools.sendDataToDevice(taskNo, null, yph, ylh, ych, mbph, mblh, mbch, mlfs, hwlx, xfwc, jym);
|
||||||
if (devId==1){
|
if (devId==1){
|
||||||
return PlcDdj1Read.WriteToDDJ("DB61.0", sendData);
|
return PlcDdj1Read.WriteToDDJ("DB61.0", sendData);
|
||||||
}else {
|
}else {
|
||||||
|
|||||||
@@ -4,15 +4,14 @@ import cn.hutool.core.bean.BeanUtil;
|
|||||||
import cn.hutool.core.convert.Convert;
|
import cn.hutool.core.convert.Convert;
|
||||||
import cn.hutool.core.lang.UUID;
|
import cn.hutool.core.lang.UUID;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.alibaba.fastjson2.JSON;
|
||||||
import com.ruoyi.api.domain.wcs2wms.stockin.StockinReceive;
|
import com.ruoyi.api.domain.wcs2wms.stockin.StockinReceive;
|
||||||
import com.ruoyi.api.service.IApiService;
|
import com.ruoyi.api.service.IApiService;
|
||||||
import com.ruoyi.bas.cargospace.domain.BasCargoSpace;
|
import com.ruoyi.bas.cargospace.domain.BasCargoSpace;
|
||||||
import com.ruoyi.bas.cargospace.service.IBasCargoSpaceService;
|
import com.ruoyi.bas.cargospace.service.IBasCargoSpaceService;
|
||||||
import com.ruoyi.common.ConvException;
|
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
import com.ruoyi.common.utils.spring.SpringUtils;
|
import com.ruoyi.common.utils.spring.SpringUtils;
|
||||||
import com.ruoyi.device.ssj.domain.DeviceSsj;
|
import com.ruoyi.device.ssj.domain.DeviceSsj;
|
||||||
import com.ruoyi.job.domain.JobCallBack;
|
|
||||||
import com.ruoyi.job.domain.MydoJob;
|
import com.ruoyi.job.domain.MydoJob;
|
||||||
import com.ruoyi.job.service.IJobCallBackService;
|
import com.ruoyi.job.service.IJobCallBackService;
|
||||||
import com.ruoyi.job.service.IMydoJobService;
|
import com.ruoyi.job.service.IMydoJobService;
|
||||||
@@ -31,7 +30,6 @@ import java.util.regex.Pattern;
|
|||||||
|
|
||||||
import static com.ruoyi.common.TaskStatusCode.*;
|
import static com.ruoyi.common.TaskStatusCode.*;
|
||||||
import static com.ruoyi.common.WmsTaskTypeCode.WMS_TASK_TYPE_STOCKIN;
|
import static com.ruoyi.common.WmsTaskTypeCode.WMS_TASK_TYPE_STOCKIN;
|
||||||
import static com.ruoyi.common.WmsTaskTypeCode.WMS_TASK_TYPE_STOCKOUT;
|
|
||||||
import static com.ruoyi.schedule.plcRead.ssj.PlcSsjRead.writeToSsj;
|
import static com.ruoyi.schedule.plcRead.ssj.PlcSsjRead.writeToSsj;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -57,7 +55,7 @@ public class PortConvThread implements Runnable {
|
|||||||
ssjCodeList = new HashMap<>();
|
ssjCodeList = new HashMap<>();
|
||||||
ArrayList<String> ssjCodes = new ArrayList<>();
|
ArrayList<String> ssjCodes = new ArrayList<>();
|
||||||
ssjCodes.add("G1004");
|
ssjCodes.add("G1004");
|
||||||
// ssjCodes.add("L1003");
|
ssjCodes.add("TD1001");
|
||||||
ssjCodeList.put("portConv", ssjCodes);
|
ssjCodeList.put("portConv", ssjCodes);
|
||||||
apiService = SpringUtils.getBean(IApiService.class);
|
apiService = SpringUtils.getBean(IApiService.class);
|
||||||
// agvQueueService = SpringUtils.getBean(IAgvQueueService.class);
|
// agvQueueService = SpringUtils.getBean(IAgvQueueService.class);
|
||||||
@@ -78,8 +76,13 @@ public class PortConvThread implements Runnable {
|
|||||||
for (String ssjCode : ssjCodeList.get(type)) {
|
for (String ssjCode : ssjCodeList.get(type)) {
|
||||||
try {
|
try {
|
||||||
if (PlcSsjRead.deviceSsjMap.containsKey(ssjCode)) {
|
if (PlcSsjRead.deviceSsjMap.containsKey(ssjCode)) {
|
||||||
inDispatch(PlcSsjRead.deviceSsjMap.get(ssjCode));
|
if (ssjCode == "G1004"){
|
||||||
// inDispatch1(PlcSsjRead.deviceSsjMap.get(ssjCode));
|
inDispatch(PlcSsjRead.deviceSsjMap.get(ssjCode));
|
||||||
|
}
|
||||||
|
if (ssjCode == "TD1001"){
|
||||||
|
outDispatch(PlcSsjRead.deviceSsjMap.get(ssjCode));
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
log.error("设备不存在 ssjCode:{}", ssjCode);
|
log.error("设备不存在 ssjCode:{}", ssjCode);
|
||||||
}
|
}
|
||||||
@@ -88,6 +91,7 @@ public class PortConvThread implements Runnable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
@@ -103,42 +107,42 @@ public class PortConvThread implements Runnable {
|
|||||||
public void inDispatch(DeviceSsj inSsjDevice) {
|
public void inDispatch(DeviceSsj inSsjDevice) {
|
||||||
// 测试数据
|
// 测试数据
|
||||||
// inSsjDevice.setInOrOut(1);
|
// inSsjDevice.setInOrOut(1);
|
||||||
// inSsjDevice.setTrayCode("T888888");
|
// inSsjDevice.setTrayCode("T000004503");
|
||||||
// inSsjDevice.setTaskNo(85012);
|
// inSsjDevice.setTaskNo(777778);
|
||||||
// inSsjDevice.setKx(0);
|
// inSsjDevice.setKx(0);
|
||||||
// inSsjDevice.setDw(1);
|
// inSsjDevice.setDw(1);
|
||||||
// inSsjDevice.setHeight("1");
|
// inSsjDevice.setHeight(1);
|
||||||
// inSsjDevice.setWeight("100");
|
// inSsjDevice.setWeight("100");
|
||||||
// inSsjDevice.setException(0);
|
// inSsjDevice.setException(0);
|
||||||
// inSsjDevice.setRkqq(1);
|
// inSsjDevice.setRkqq(1);
|
||||||
|
|
||||||
//todo 是否需要校验出入库模式
|
//更新入库任务阶段
|
||||||
switch (inSsjDevice.getInOrOut()) {
|
updateMydoJob(inSsjDevice);
|
||||||
//---------------------------入库模式---------------------------
|
//请求wms获取入库任务
|
||||||
case 1:
|
requestMydoJob(inSsjDevice);
|
||||||
//---------------------------入口取输送机(叉车取放货位置)---------------------------
|
|
||||||
//输送机【非空闲】、【输送到位】、【入库请求?】
|
|
||||||
if (inSsjDevice.getKx() != 1 && inSsjDevice.getDw() == 1) {
|
|
||||||
|
|
||||||
//更新入库任务阶段
|
|
||||||
updateMydoJob(inSsjDevice);
|
|
||||||
|
|
||||||
//请求wms获取入库任务
|
|
||||||
requestMydoJob(inSsjDevice);
|
|
||||||
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
//---------------------------出库模式---------------------------
|
|
||||||
case 2:
|
|
||||||
finishStockoutMydoJob(inSsjDevice);
|
|
||||||
break;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 输送机到位判断校验
|
||||||
|
* @param inSsjDevice
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private boolean convChecked(DeviceSsj inSsjDevice){
|
||||||
|
|
||||||
|
boolean flag = false;
|
||||||
|
//---------------------------入口取输送机(叉车取放货位置)---------------------------
|
||||||
|
//输送机【非空闲】、【输送到位】、【入库请求?】
|
||||||
|
if (inSsjDevice.getKx() != 0) return flag;
|
||||||
|
|
||||||
|
if (inSsjDevice.getRkqq() != 1) return flag;
|
||||||
|
|
||||||
|
if (inSsjDevice.getHeight() == 0) return flag;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 请求wms获取wcs任务参数
|
* 请求wms获取wcs任务参数
|
||||||
@@ -146,103 +150,68 @@ public class PortConvThread implements Runnable {
|
|||||||
*/
|
*/
|
||||||
private void requestMydoJob(DeviceSsj inSsjDevice){
|
private void requestMydoJob(DeviceSsj inSsjDevice){
|
||||||
|
|
||||||
//校验:入库请求
|
if (!convChecked(inSsjDevice)) return;
|
||||||
if (inSsjDevice.getRkqq() != 1) {
|
|
||||||
return;
|
String errorMessage = "";
|
||||||
}
|
|
||||||
|
|
||||||
AjaxResult ajaxResult;
|
AjaxResult ajaxResult;
|
||||||
|
|
||||||
//请求参数
|
//初始化请求wms参数
|
||||||
HashMap<String, Object> paramMap = new HashMap<>();
|
HashMap<String, Object> paramMap = new HashMap<>();
|
||||||
paramMap.put("taskTypeCode", WMS_TASK_TYPE_STOCKIN);//todo wms自定义的任务类型编号
|
paramMap.put("taskTypeCode", WMS_TASK_TYPE_STOCKIN);//wms自定义的任务类型编号
|
||||||
paramMap.put("reqCode", UUID.randomUUID().toString());//请求码
|
paramMap.put("reqCode", UUID.randomUUID().toString());//请求码
|
||||||
paramMap.put("cntCode", inSsjDevice.getTrayCode());//容器编号
|
paramMap.put("cntCode", inSsjDevice.getTrayCode());//容器编号
|
||||||
int height = inSsjDevice.getHeight();
|
int height = inSsjDevice.getHeight();
|
||||||
// String weight = inSsjDevice.getWeight();//todo 需要直读重量或从plc读值?
|
// String weight = inSsjDevice.getWeight();//不需要直读重量或从plc读值,wms不需要该参数
|
||||||
paramMap.put("weight", getWeightByMoxa(MOXA_IP, MOXA_PORT, SO_TIMEOUT_MS));//重量
|
// paramMap.put("weight", getWeightByMoxa(MOXA_IP, MOXA_PORT, SO_TIMEOUT_MS));//重量
|
||||||
paramMap.put("altimetry", height);//高度
|
paramMap.put("altimetry", height);//高度
|
||||||
String errorMessage = "";
|
paramMap.put("adverseCauses", errorMessage);
|
||||||
|
|
||||||
|
// if (inSsjDevice.getException() > 0){
|
||||||
|
// log.warn("【入库异常】{}",errorMessage);
|
||||||
|
// }
|
||||||
|
|
||||||
//-----------------校验:入库口异常上报-----------------
|
//-----------------警告校验:条码已有库存-----------------
|
||||||
switch (inSsjDevice.getException()) {
|
|
||||||
|
|
||||||
//外形检测异常
|
|
||||||
case ConvException.CHECK_SIZE_EXCEPTION:
|
|
||||||
errorMessage = "外形检测异常-货物超高";
|
|
||||||
break;
|
|
||||||
|
|
||||||
//超重检测
|
|
||||||
case ConvException.CHECK_OVERWEIGHT_EXCEPTION:
|
|
||||||
errorMessage = "外形检测异常-货物超重";
|
|
||||||
break;
|
|
||||||
|
|
||||||
//扫码异常
|
|
||||||
case ConvException.CHECK_BARCODE_EXCEPTION:
|
|
||||||
if (inSsjDevice.getTrayCode() == "") {
|
|
||||||
errorMessage = "条码扫描失败:未扫到条码";
|
|
||||||
}else{
|
|
||||||
//todo 条码格式校验
|
|
||||||
errorMessage = "条码扫描异常:格式错误";
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (inSsjDevice.getException() > 0){
|
|
||||||
paramMap.put("adverseCauses", errorMessage);
|
|
||||||
ajaxResult = apiService.createInMydoJobException(paramMap);
|
|
||||||
if (ajaxResult.isSuccess()) {
|
|
||||||
//向输送机下发退回
|
|
||||||
int i = writeToSsj(inSsjDevice.getPlcDbWriteAddress(), "99", 99, 1);
|
|
||||||
if (i == 1) {
|
|
||||||
log.warn("【入库异常】{}",errorMessage);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//-----------------校验:条码已有库存-----------------
|
|
||||||
BasCargoSpace cargoSpace = new BasCargoSpace();
|
BasCargoSpace cargoSpace = new BasCargoSpace();
|
||||||
cargoSpace.setTrayCode(inSsjDevice.getTrayCode());
|
cargoSpace.setTrayCode(inSsjDevice.getTrayCode());
|
||||||
if (!basCargoSpaceService.selectBasCargoSpaceList(cargoSpace).isEmpty()) {
|
if (!basCargoSpaceService.selectBasCargoSpaceList(cargoSpace).isEmpty()) {
|
||||||
log.warn("【生成wcs任务异常】该托盘号已有库存,托盘条码:{}",inSsjDevice.getTrayCode());
|
log.warn("【警告】该托盘号已有库存,托盘条码:{}",inSsjDevice.getTrayCode());
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------请求生成wcs任务-----------------
|
/*-----------------请求生成wcs任务----------------- */
|
||||||
ajaxResult = apiService.createMydoJobForStockin(paramMap);
|
ajaxResult = apiService.createMydoJobForStockin(paramMap);
|
||||||
if (ajaxResult.isSuccess()) {
|
if (ajaxResult.isSuccess()) {
|
||||||
|
|
||||||
//获取wms下发的任务号和分配货位
|
//解析wms下发的响应参数(任务号和货位)
|
||||||
StockinReceive result = BeanUtil.toBean(ajaxResult.get("data"), StockinReceive.class);
|
StockinReceive result = BeanUtil.toBean(ajaxResult.get("data"), StockinReceive.class);
|
||||||
MydoJob mydoJob = new MydoJob();
|
|
||||||
mydoJob.setTrayCode(result.getCntCode());
|
|
||||||
mydoJob.setCargoSpaceId(result.getSiteCode());
|
|
||||||
mydoJob.setWmsTaskNo(result.getTaskCode());
|
|
||||||
mydoJob.setJobId(mydoJobService.getJobId("RK"));
|
|
||||||
mydoJob.setTaskNo(mydoJobService.getTaskNo("1"));
|
|
||||||
// mydoJob.setTaskNo(result.getTaskCode());//需要确定是否用获取的任务号作为wcs的任务号
|
|
||||||
|
|
||||||
//校验:wms分配的货位(排列层)是否合法
|
//校验:wms分配的货位(排列层)是否合法
|
||||||
if (result.getSiteCode() == null || result.getSiteCode().isEmpty()) {
|
if (result.getSiteCode() == null || result.getSiteCode().isEmpty()) {
|
||||||
log.info("【请求参数异常】分配货位:null,无法生成作业,托盘条码:{}",inSsjDevice.getTrayCode());
|
errorMessage = "wms下发货位错误,任务生成失败!";
|
||||||
|
paramMap.put("adverseCauses", errorMessage);
|
||||||
|
apiService.createInMydoJobException(paramMap);
|
||||||
|
log.info("【响应参数异常】分配货位:null,无法生成作业,托盘条码:{}",inSsjDevice.getTrayCode());
|
||||||
return;
|
return;
|
||||||
}else {
|
|
||||||
// mydoJob.setRoadwayId(basCargoSpaceService.selectBasCargoSpaceByWmsCargoSpaceId(mydoJob.getCargoSpaceId()).getRoadwayId());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
mydoJob.setStatus("1");
|
//初始化要生成的任务
|
||||||
mydoJob.setInOrOut("1");
|
MydoJob mydoJob = new MydoJob().builder()
|
||||||
mydoJob.setRoadwayId("1");
|
// mydoJob.setTaskNo(result.getTaskCode());//如果需要用wms下发的任务号作为wcs的任务号使用
|
||||||
mydoJob.setEntranceId("G1004");
|
.trayCode(result.getCntCode())
|
||||||
mydoJob.setExecutionPhase(TASK_EP_CREATE);
|
.cargoSpaceId(result.getSiteCode())
|
||||||
mydoJob.setCreateTime(new Date());
|
.wmsTaskNo(result.getTaskCode())
|
||||||
// mydoJob.setTraySize(Convert.toStr(inSsjDevice.getTraySize()));
|
.jobId(mydoJobService.getJobId("RK"))
|
||||||
mydoJob.setFaultFlag("0");
|
.taskNo(mydoJobService.getTaskNo("1"))
|
||||||
mydoJob.setPriority(10L);
|
.traySize(String.valueOf(inSsjDevice.getHeight()))
|
||||||
|
.status(TASK_STATUS_CREATED)
|
||||||
|
.inOrOut("1")
|
||||||
|
.roadwayId(basCargoSpaceService.selectBasCargoSpaceByWmsCargoSpaceId(result.getSiteCode()).getRoadwayId())//获取货位表货位对应的巷道号
|
||||||
|
.entranceId("G1004")
|
||||||
|
.executionPhase(TASK_EP_CREATED)
|
||||||
|
.faultFlag("0")
|
||||||
|
.priority(10L)
|
||||||
|
.build();
|
||||||
|
|
||||||
|
|
||||||
//如果还没有wcs任务 - 生成一条任务
|
//如果还没有wcs任务 - 生成一条任务
|
||||||
if (mydoJobService.selectInOrOutMydoJobList(mydoJob).isEmpty()) {
|
if (mydoJobService.selectInOrOutMydoJobList(mydoJob).isEmpty()) {
|
||||||
@@ -253,10 +222,10 @@ public class PortConvThread implements Runnable {
|
|||||||
}else{
|
}else{
|
||||||
//请求生成wcs任务失败
|
//请求生成wcs任务失败
|
||||||
//todo 向输送机下发退回
|
//todo 向输送机下发退回
|
||||||
int i = writeToSsj(inSsjDevice.getPlcDbWriteAddress(), "99", 99, 1);
|
int i = writeToSsj(inSsjDevice.getPlcDbWriteAddress(), "99", 2, 1);
|
||||||
|
|
||||||
//todo 接口调用失败处理
|
//todo 接口调用失败处理
|
||||||
log.info("【入库请求】请求生成wcs作业失败退回,请重试,响应内容:{}", ajaxResult.get("data").toString());
|
log.info("【入库请求】请求生成wcs作业失败退回,请检查网络或请求参数,请求内容:{}", JSON.toJSONString(paramMap));
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -267,39 +236,43 @@ public class PortConvThread implements Runnable {
|
|||||||
*/
|
*/
|
||||||
private void updateMydoJob(DeviceSsj inSsjDevice){
|
private void updateMydoJob(DeviceSsj inSsjDevice){
|
||||||
|
|
||||||
//检查是否有已经创建成功的任务 - 更新到下一个执行阶段
|
if (!convChecked(inSsjDevice)) return;
|
||||||
MydoJob mydoJobStockin = new MydoJob();
|
|
||||||
mydoJobStockin.setTrayCode(inSsjDevice.getTrayCode());
|
//检查是否有已经创建成功的任务(请求成功的入库任务) - 更新到下一个执行阶段
|
||||||
mydoJobStockin.setExecutionPhase(TASK_EP_CREATE);
|
MydoJob mydoJobStockin = new MydoJob().builder()
|
||||||
if(mydoJobService.selectMydoJobList(mydoJobStockin).isEmpty()){
|
.trayCode(inSsjDevice.getTrayCode())
|
||||||
//输送机扫描有条码但无任务
|
.status(TASK_EP_CREATED)
|
||||||
log.info("【异常任务】请检查条码扫描结果与托盘实际条码是否一致,扫描条码:{}", inSsjDevice.getTrayCode());
|
.executionPhase(TASK_EP_CREATED)
|
||||||
}else{
|
.build();
|
||||||
|
if(!mydoJobService.selectMydoJobList(mydoJobStockin).isEmpty()){
|
||||||
mydoJobStockin = mydoJobService.selectMydoJobList(mydoJobStockin).get(0);
|
mydoJobStockin = mydoJobService.selectMydoJobList(mydoJobStockin).get(0);
|
||||||
//如果已经生成入库任务 - 向输送机下发任务号
|
//如果已经生成入库任务 - 向输送机下发任务号
|
||||||
//todo 调整输送去向值
|
//输送去向值【1】
|
||||||
int i = writeToSsj(inSsjDevice.getPlcDbWriteAddress(), mydoJobStockin.getTaskNo(), Integer.parseInt(mydoJobStockin.getTraySize()), 1);
|
int i = writeToSsj(inSsjDevice.getPlcDbWriteAddress(), mydoJobStockin.getTaskNo(), 1, 1);
|
||||||
// int i = 1;
|
// int i = 1;
|
||||||
if (i == 1) {
|
if (i == 1) {
|
||||||
//写入成功则更新执行阶段
|
//写入成功则更新执行阶段
|
||||||
|
mydoJobStockin.setStatus(TASK_STATUS_RUNNING);
|
||||||
mydoJobStockin.setExecutionPhase(TASK_EP_SSJ);
|
mydoJobStockin.setExecutionPhase(TASK_EP_SSJ);
|
||||||
mydoJobService.updateMydoJob(mydoJobStockin);
|
mydoJobService.updateMydoJob(mydoJobStockin);
|
||||||
log.info("【更新状态】G1004入口输送机下发任务号成功:{}", mydoJobStockin.getTaskNo());
|
log.info("【更新状态】G1004入口输送机下发任务号成功:{}", mydoJobStockin.getTaskNo());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 输送机出库到位 - 任务出库完成
|
* 输送机出库到位 - 任务出库完成
|
||||||
* @param inSsjDevice
|
* @param outSsjDevice
|
||||||
*/
|
*/
|
||||||
private void finishStockoutMydoJob(DeviceSsj inSsjDevice){
|
private void finishStockoutMydoJob(DeviceSsj outSsjDevice){
|
||||||
//出库到位
|
//出库到位
|
||||||
if (inSsjDevice.getDw() == 1 && inSsjDevice.getTaskNo() > 0) {
|
if (outSsjDevice.getDw() == 1 && outSsjDevice.getTaskNo() > 0) {
|
||||||
//查询该出库任务
|
//查询该出库任务
|
||||||
MydoJob mydoJob = mydoJobService.selectMydoJobByTaskNo(Convert.toLong(inSsjDevice.getTaskNo()));
|
MydoJob mydoJob = mydoJobService.selectMydoJobByTaskNo(Convert.toLong(outSsjDevice.getTaskNo()));
|
||||||
if (mydoJob != null && Integer.parseInt(mydoJob.getInOrOut()) > 20) {
|
if (mydoJob != null && Integer.parseInt(mydoJob.getInOrOut()) > 20) {
|
||||||
log.info("【出库到位】设备:{},位置:{},任务号:{},出库到位", "输送线:", inSsjDevice.getDeviceCode(), mydoJob.getTaskNo());
|
log.info("【出库到位】设备:{},位置:{},任务号:{},出库到位", "输送线:", outSsjDevice.getDeviceCode(), mydoJob.getTaskNo());
|
||||||
mydoJob.setExecutionPhase(TASK_EP_SSJ_STOCKOUT_FINISH);
|
mydoJob.setExecutionPhase(TASK_EP_SSJ_STOCKOUT_FINISH);
|
||||||
mydoJobService.updateMydoJob(mydoJob);
|
mydoJobService.updateMydoJob(mydoJob);
|
||||||
mydoJobService.taskFinish(Long.valueOf(mydoJob.getTaskNo()));
|
mydoJobService.taskFinish(Long.valueOf(mydoJob.getTaskNo()));
|
||||||
@@ -378,6 +351,7 @@ public class PortConvThread implements Runnable {
|
|||||||
|
|
||||||
|
|
||||||
public void inDispatch1(DeviceSsj ssjDevice) {
|
public void inDispatch1(DeviceSsj ssjDevice) {
|
||||||
|
|
||||||
//有入库请求就肯定是电气的任务号的作业
|
//有入库请求就肯定是电气的任务号的作业
|
||||||
if(StrUtil.isNotBlank(ssjDevice.getTrayCode()) && ssjDevice.getRkqq()==1 && ssjDevice.getTaskNo()<1000){
|
if(StrUtil.isNotBlank(ssjDevice.getTrayCode()) && ssjDevice.getRkqq()==1 && ssjDevice.getTaskNo()<1000){
|
||||||
//,如果有正执行的出库作业退回
|
//,如果有正执行的出库作业退回
|
||||||
@@ -422,7 +396,7 @@ public class PortConvThread implements Runnable {
|
|||||||
if(ajaxResult.isSuccess()){
|
if(ajaxResult.isSuccess()){
|
||||||
MydoJob mydoJob2 = BeanUtil.toBean(ajaxResult.get("data"), MydoJob.class);
|
MydoJob mydoJob2 = BeanUtil.toBean(ajaxResult.get("data"), MydoJob.class);
|
||||||
mydoJob2.setStatus("1");
|
mydoJob2.setStatus("1");
|
||||||
mydoJob2.setExecutionPhase(TASK_EP_CREATE);
|
mydoJob2.setExecutionPhase(TASK_EP_CREATED);
|
||||||
mydoJob2.setCreateTime(new Date());
|
mydoJob2.setCreateTime(new Date());
|
||||||
mydoJob2.setFaultFlag("0");
|
mydoJob2.setFaultFlag("0");
|
||||||
mydoJob2.setPriority(10L);
|
mydoJob2.setPriority(10L);
|
||||||
@@ -446,6 +420,12 @@ public class PortConvThread implements Runnable {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void outDispatch(DeviceSsj ssjDevice) {
|
||||||
|
|
||||||
|
finishStockoutMydoJob(ssjDevice);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
private static final Map<String, Pattern> PATTERNS = createPatterns();
|
private static final Map<String, Pattern> PATTERNS = createPatterns();
|
||||||
|
|
||||||
private static Map<String, Pattern> createPatterns() {
|
private static Map<String, Pattern> createPatterns() {
|
||||||
|
|||||||
@@ -22,6 +22,8 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
|
import static com.ruoyi.common.ConvType.CONV_ROAD_1;
|
||||||
|
import static com.ruoyi.common.ConvType.CONV_STOCKOUT;
|
||||||
import static com.ruoyi.common.TaskStatusCode.*;
|
import static com.ruoyi.common.TaskStatusCode.*;
|
||||||
import static com.ruoyi.common.TaskType.*;
|
import static com.ruoyi.common.TaskType.*;
|
||||||
|
|
||||||
@@ -54,7 +56,7 @@ public class RoadConvThread implements Runnable {
|
|||||||
ddjDeviceExecutionQueueService = SpringUtils.getBean(IDdjDeviceExecutionQueueService.class);
|
ddjDeviceExecutionQueueService = SpringUtils.getBean(IDdjDeviceExecutionQueueService.class);
|
||||||
//初始化巷道口 排 列 层
|
//初始化巷道口 排 列 层
|
||||||
//todo 核对堆垛机取放位置的货位编码
|
//todo 核对堆垛机取放位置的货位编码
|
||||||
roadwayMap.put("L1001", Arrays.asList(2, 0, 1));
|
roadwayMap.put("L1001", Arrays.asList(2, 1, 1));
|
||||||
// roadwayMap.put("L1004", Arrays.asList(4, 0, 1));
|
// roadwayMap.put("L1004", Arrays.asList(4, 0, 1));
|
||||||
log.info("初始化服务 {},{}", apiService, agvQueueService);
|
log.info("初始化服务 {},{}", apiService, agvQueueService);
|
||||||
}
|
}
|
||||||
@@ -148,14 +150,17 @@ public class RoadConvThread implements Runnable {
|
|||||||
ddjDeviceExecutionQueue.setMbch(Convert.toInt(basCargoSpace.getTheFloor()));
|
ddjDeviceExecutionQueue.setMbch(Convert.toInt(basCargoSpace.getTheFloor()));
|
||||||
ddjDeviceExecutionQueue.setDdjxf("0");
|
ddjDeviceExecutionQueue.setDdjxf("0");
|
||||||
ddjDeviceExecutionQueue.setMlfs(5);
|
ddjDeviceExecutionQueue.setMlfs(5);
|
||||||
// ddjDeviceExecutionQueue.setSpare1(mydoJob.getTraySize());
|
ddjDeviceExecutionQueue.setSpare1(mydoJob.getTraySize());//货物高度
|
||||||
ddjDeviceExecutionQueue.setScsj(DateUtil.formatDateTime(DateUtil.date()));
|
ddjDeviceExecutionQueue.setScsj(DateUtil.formatDateTime(DateUtil.date()));
|
||||||
ddjDeviceExecutionQueue.setRwlx(DDJ_RWLX_3);
|
ddjDeviceExecutionQueue.setRwlx(DDJ_RWLX_3);
|
||||||
ddjDeviceExecutionQueueService.insertDdjDeviceExecutionQueue(ddjDeviceExecutionQueue);
|
ddjDeviceExecutionQueueService.insertDdjDeviceExecutionQueue(ddjDeviceExecutionQueue);
|
||||||
|
|
||||||
//下发后更新任务阶段
|
if (ddjDeviceExecutionQueueService.selectDdjDeviceExecutionQueueList(ddjDeviceExecutionQueue).size() > 0){
|
||||||
mydoJob.setExecutionPhase(TASK_EP_DDJ);
|
//下发后更新任务阶段
|
||||||
mydoJobService.updateMydoJob(mydoJob);
|
mydoJob.setExecutionPhase(TASK_EP_DDJ);
|
||||||
|
mydoJobService.updateMydoJob(mydoJob);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -172,7 +177,7 @@ public class RoadConvThread implements Runnable {
|
|||||||
if(roadSsjDevice.getKx()==1 && roadSsjDevice.getTaskNo() == 0){
|
if(roadSsjDevice.getKx()==1 && roadSsjDevice.getTaskNo() == 0){
|
||||||
|
|
||||||
//检查是否有入口是【G1004】的入库任务
|
//检查是否有入口是【G1004】的入库任务
|
||||||
String exitId = "G1004";
|
String exitId = CONV_STOCKOUT;
|
||||||
List<MydoJob> inList = mydoJobService.getInJobByEntranceId(exitId);
|
List<MydoJob> inList = mydoJobService.getInJobByEntranceId(exitId);
|
||||||
|
|
||||||
if(inList.size() == 0){
|
if(inList.size() == 0){
|
||||||
@@ -204,7 +209,7 @@ public class RoadConvThread implements Runnable {
|
|||||||
ddjDeviceExecutionQueue.setMbch(pclList.get(2));
|
ddjDeviceExecutionQueue.setMbch(pclList.get(2));
|
||||||
ddjDeviceExecutionQueue.setDdjxf("0");
|
ddjDeviceExecutionQueue.setDdjxf("0");
|
||||||
ddjDeviceExecutionQueue.setMlfs(5);
|
ddjDeviceExecutionQueue.setMlfs(5);
|
||||||
ddjDeviceExecutionQueue.setSpare1(mydoJob.getTraySize());
|
ddjDeviceExecutionQueue.setSpare1(mydoJob.getTraySize());//货物高度
|
||||||
ddjDeviceExecutionQueue.setScsj(DateUtil.formatDateTime(DateUtil.date()));
|
ddjDeviceExecutionQueue.setScsj(DateUtil.formatDateTime(DateUtil.date()));
|
||||||
ddjDeviceExecutionQueue.setRwlx(DDJ_RWLX_2);
|
ddjDeviceExecutionQueue.setRwlx(DDJ_RWLX_2);
|
||||||
ddjDeviceExecutionQueueService.insertDdjDeviceExecutionQueue(ddjDeviceExecutionQueue);
|
ddjDeviceExecutionQueueService.insertDdjDeviceExecutionQueue(ddjDeviceExecutionQueue);
|
||||||
|
|||||||
@@ -31,6 +31,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<sql id="selectMydoJobVo">
|
<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,flag,tray_code,tray_size,wms_task_no 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,flag,tray_code,tray_size,wms_task_no from mydo_job_wcs
|
||||||
</sql>
|
</sql>
|
||||||
|
<sql id="selectMydoJobVoTop">
|
||||||
|
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,flag,tray_code,tray_size,wms_task_no from mydo_job_wcs
|
||||||
|
</sql>
|
||||||
<sql id="selectMydoJobFinishVo">
|
<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,flag,tray_code,tray_size,wms_task_no 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,flag,tray_code,tray_size,wms_task_no from mydo_job_wcs_finish
|
||||||
</sql>
|
</sql>
|
||||||
@@ -273,13 +276,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectMydoJobByExitId" parameterType="java.lang.String" resultMap="MydoJobResult">
|
<select id="selectMydoJobByExitId" parameterType="java.lang.String" 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,flag, tray_code 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, wms_task_no, tray_code, tray_size, flag from mydo_job_wcs
|
||||||
where exit_id = #{exitId}
|
where exit_id = #{exitId}
|
||||||
and in_or_out > 20
|
and in_or_out = 2
|
||||||
and status = 1 and execution_phase= 0
|
and status = 1 and execution_phase= 0
|
||||||
order by priority asc,create_time asc
|
order by priority asc,create_time asc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectMydoJobByWmsTaskNo" parameterType="java.lang.String" resultMap="MydoJobResult">
|
||||||
|
<include refid="selectMydoJobVo"/>
|
||||||
|
where wms_task_no = #{wmsTaskNo}
|
||||||
|
</select>
|
||||||
|
|
||||||
<select id="selectMydoJobFinishList" resultMap="MydoJobResult">
|
<select id="selectMydoJobFinishList" resultMap="MydoJobResult">
|
||||||
<include refid="selectMydoJobFinishVo"/>
|
<include refid="selectMydoJobFinishVo"/>
|
||||||
<where>
|
<where>
|
||||||
|
|||||||
@@ -159,6 +159,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
delete from ddj_device_execution_queue where uuid = #{uuid}
|
delete from ddj_device_execution_queue where uuid = #{uuid}
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteDdjDeviceExecutionQueueByTaskNo" parameterType="String">
|
||||||
|
delete from ddj_device_execution_queue where rwh = #{taskNo}
|
||||||
|
</delete>
|
||||||
|
|
||||||
<delete id="deleteDdjDeviceExecutionQueueByUuids" parameterType="String">
|
<delete id="deleteDdjDeviceExecutionQueueByUuids" parameterType="String">
|
||||||
delete from ddj_device_execution_queue where uuid in
|
delete from ddj_device_execution_queue where uuid in
|
||||||
<foreach item="uuid" collection="array" open="(" separator="," close=")">
|
<foreach item="uuid" collection="array" open="(" separator="," close=")">
|
||||||
|
|||||||
@@ -7,12 +7,18 @@ import java.util.Map;
|
|||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Entity基类
|
* Entity基类
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@ToString
|
||||||
|
@Builder
|
||||||
public class BaseEntity implements Serializable
|
public class BaseEntity implements Serializable
|
||||||
{
|
{
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
@@ -64,7 +70,7 @@ public class BaseEntity implements Serializable
|
|||||||
|
|
||||||
public Date getCreateTime()
|
public Date getCreateTime()
|
||||||
{
|
{
|
||||||
return createTime;
|
return new Date();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCreateTime(Date createTime)
|
public void setCreateTime(Date createTime)
|
||||||
|
|||||||
Reference in New Issue
Block a user