Compare commits
45 Commits
9d8496eeb6
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
45f0f406f6 | ||
|
|
d6372ccc0c | ||
|
|
6f60580268 | ||
|
|
cf538247e9 | ||
|
|
e1fcfbf992 | ||
|
|
28c9ce8921 | ||
|
|
c9db39571c | ||
|
|
08ceae0454 | ||
|
|
c10fb6af1c | ||
|
|
70c2647699 | ||
|
|
4c590f515f | ||
|
|
d468c3a1a5 | ||
|
|
e77ed70162 | ||
|
|
43417820b1 | ||
|
|
135f082e16 | ||
|
|
361ec0dcb6 | ||
|
|
c3689b2a6c | ||
|
|
8b2433c5a1 | ||
|
|
5c6361217f | ||
|
|
472f94a1e8 | ||
|
|
f9e1f958bf | ||
|
|
7aa97b743b | ||
|
|
3a5c338e18 | ||
|
|
f8ea7a5561 | ||
|
|
ef4694de29 | ||
|
|
a2229cb346 | ||
|
|
50d2a924fc | ||
|
|
4436476ea3 | ||
|
|
4b1f8be0a3 | ||
|
|
666942b8f4 | ||
|
|
c48b3a4f2b | ||
|
|
4566753e09 | ||
|
|
93d7877620 | ||
|
|
6404fd8de9 | ||
|
|
014a0b830b | ||
|
|
be289748cf | ||
|
|
9ef5198f00 | ||
|
|
eafc68d1bf | ||
|
|
c30b7afab5 | ||
|
|
bb148ee7e4 | ||
|
|
671a83b493 | ||
|
|
5e9a3ad800 | ||
|
|
af7b65f6dd | ||
|
|
741fe220d8 | ||
|
|
955b94c145 |
2
pom.xml
2
pom.xml
@@ -37,7 +37,7 @@
|
||||
<spring-framework.version>5.3.39</spring-framework.version>
|
||||
<hutool.version>5.8.27</hutool.version>
|
||||
<lombok.version>1.18.30</lombok.version>
|
||||
<HslCommunication.version>3.7.0</HslCommunication.version>
|
||||
<HslCommunication.version>2.0.0</HslCommunication.version>
|
||||
<mybatis-plus.version>3.5.2</mybatis-plus.version>
|
||||
|
||||
</properties>
|
||||
|
||||
@@ -43,12 +43,17 @@
|
||||
<!-- <artifactId>mysql-connector-java</artifactId>-->
|
||||
<!-- </dependency>-->
|
||||
<!-- sql server驱动包 -->
|
||||
<dependency>
|
||||
<groupId>com.microsoft.sqlserver</groupId>
|
||||
<artifactId>mssql-jdbc</artifactId>
|
||||
<version>12.10.1.jre11</version>
|
||||
</dependency>
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>com.microsoft.sqlserver</groupId>-->
|
||||
<!-- <artifactId>mssql-jdbc</artifactId>-->
|
||||
<!-- <version>12.10.1.jre11</version>-->
|
||||
<!-- </dependency>-->
|
||||
|
||||
<dependency>
|
||||
<groupId>com.microsoft.sqlserver</groupId>
|
||||
<artifactId>mssql-jdbc</artifactId>
|
||||
<version>8.4.1.jre8</version>
|
||||
</dependency>
|
||||
<!-- 核心模块-->
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
|
||||
@@ -31,6 +31,6 @@ public class RuoYiApplication
|
||||
{
|
||||
// System.setProperty("spring.devtools.restart.enabled", "false");
|
||||
SpringApplication.run(RuoYiApplication.class, args);
|
||||
System.out.println("(♥◠‿◠)ノ゙ 福来瑞达WCS系统启动成功 ლ(´ڡ`ლ)゙ ");
|
||||
System.out.println("(♥◠‿◠)ノ゙ 福莱瑞达WCS系统启动成功 ლ(´ڡ`ლ)゙ ");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,6 +55,17 @@ public class Wcs2WmsController {
|
||||
return apiService.cancelMydoJob(jobParam);
|
||||
}
|
||||
|
||||
/**
|
||||
* @@@ FT568 - wms取消任务
|
||||
* @param wmsTaskCode
|
||||
* @return
|
||||
*/
|
||||
@DeleteMapping("/cancelJob/{wmsTaskCode}")
|
||||
public AjaxResult cancelMydoJob(@PathVariable String wmsTaskCode)
|
||||
{
|
||||
return apiService.cancelMydoJob(wmsTaskCode);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询缓存点
|
||||
|
||||
@@ -27,6 +27,12 @@ public interface RequestLogMapper
|
||||
*/
|
||||
public List<RequestLog> selectRequestLogList(RequestLog requestLog);
|
||||
|
||||
/**
|
||||
* 获取最新的任务请求响应记录
|
||||
* @return
|
||||
*/
|
||||
public RequestLog selectRequestLogByLatestTask();
|
||||
|
||||
/**
|
||||
* 新增接口记录
|
||||
*
|
||||
@@ -58,4 +64,6 @@ public interface RequestLogMapper
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRequestLogByRequestIds(Long[] requestIds);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -111,6 +111,8 @@ public interface IApiService
|
||||
*/
|
||||
AjaxResult cancelMydoJob(JobParam jobParam);
|
||||
|
||||
AjaxResult cancelMydoJob(String wmsTaskCode);
|
||||
|
||||
AjaxResult selectWcsPort(WcsPort wcsPort);
|
||||
|
||||
AjaxResult updateWcsPort(WcsPort wcsPort);
|
||||
|
||||
@@ -27,6 +27,12 @@ public interface IRequestLogService
|
||||
*/
|
||||
public List<RequestLog> selectRequestLogList(RequestLog requestLog);
|
||||
|
||||
/**
|
||||
* 获取最新的任务请求响应记录
|
||||
* @return
|
||||
*/
|
||||
public RequestLog selectRequestLogByLatestTask();
|
||||
|
||||
/**
|
||||
* 新增接口记录
|
||||
*
|
||||
@@ -70,11 +76,12 @@ public interface IRequestLogService
|
||||
|
||||
/**
|
||||
* 接收请求,并插入日志
|
||||
* @param url
|
||||
* @param param
|
||||
* @param endPoint
|
||||
* @return
|
||||
*/
|
||||
public RequestLog getRequestLog(String url, String param);
|
||||
public RequestLog getRequestLog(String param, String endPoint);
|
||||
|
||||
|
||||
RequestLog getRequestLog2(String url, String param, String endPoint);
|
||||
|
||||
|
||||
@@ -19,12 +19,16 @@ import com.ruoyi.api.domain.agv.genAgvSchedulingTask.PositionCodeData;
|
||||
import com.ruoyi.api.domain.wcs2wms.JobParam;
|
||||
import com.ruoyi.api.domain.wcs2wms.ReceiveJob;
|
||||
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.stockout.StockoutReceive;
|
||||
import com.ruoyi.api.service.IApiService;
|
||||
import com.ruoyi.bas.cargospace.domain.BasCargoSpace;
|
||||
import com.ruoyi.bas.cargospace.service.IBasCargoSpaceService;
|
||||
import com.ruoyi.bas.port.domain.WcsPort;
|
||||
import com.ruoyi.bas.port.service.IWcsPortService;
|
||||
import com.ruoyi.common.GoodsType;
|
||||
import com.ruoyi.common.TaskType;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.job.domain.MydoJob;
|
||||
@@ -43,7 +47,9 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
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.*;
|
||||
import static com.ruoyi.common.TaskType.STOCKIN;
|
||||
|
||||
/**
|
||||
* 接口记录Service业务层处理
|
||||
@@ -63,7 +69,8 @@ public class ApiServiceImpl implements IApiService {
|
||||
private IMydoJobService mydoJobService;
|
||||
@Autowired
|
||||
private IWcsPortService wcsPortService;
|
||||
|
||||
@Autowired
|
||||
private IBasCargoSpaceService basCargoSpaceService;
|
||||
|
||||
|
||||
/**
|
||||
@@ -245,6 +252,28 @@ public class ApiServiceImpl implements IApiService {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* wms删除任务(单选)
|
||||
*
|
||||
* @param wmsTaskCode
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult cancelMydoJob(String wmsTaskCode) {
|
||||
|
||||
if (wmsTaskCode == null || wmsTaskCode.equals("")) {
|
||||
return AjaxResult.error("查不到执行wms任务号的作业");
|
||||
}
|
||||
|
||||
MydoJob mydoJob = mydoJobService.selectMydoJobByWmsTaskNo(wmsTaskCode);
|
||||
if (mydoJob == null) {
|
||||
return AjaxResult.error("查不到该wms任务号正在执行中的作业,可能是已经取消或完成,请检查wcs任务状态");
|
||||
}
|
||||
|
||||
return AjaxResult.success(mydoJobService.deleteMydoJobByJobId(mydoJob.getJobId()));
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -278,13 +307,13 @@ public class ApiServiceImpl implements IApiService {
|
||||
if ("1".equals(requestLog.getIsSuccessful())){
|
||||
//请求获取新分配的货位
|
||||
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.setCargoSpaceId(wmsMydoJob.getCargoSpaceId());
|
||||
MydoJob mydoJob = mydoJobService.selectMydoJobByWmsTaskNo(taskExceptionReceive.getTaskCode());
|
||||
mydoJob.setCargoSpaceId(taskExceptionReceive.getSiteCode());
|
||||
mydoJobService.updateMydoJob(mydoJob);
|
||||
return AjaxResult.success();
|
||||
return AjaxResult.success(taskExceptionReceive);
|
||||
}
|
||||
return AjaxResult.error();
|
||||
}
|
||||
@@ -481,40 +510,105 @@ public class ApiServiceImpl implements IApiService {
|
||||
@Override
|
||||
public AjaxResult receiveOutMydoJob(StockoutReceive stockoutReceive) {
|
||||
|
||||
//检查任务是否存在,避免重复生成
|
||||
MydoJob job = new MydoJob();
|
||||
job.setWmsTaskNo(stockoutReceive.getTaskCode());
|
||||
List<MydoJob> tasks = mydoJobService.selectMydoJobList(job);
|
||||
//生成接口记录
|
||||
RequestLog requestLog = requestLogService.getRequestLog(JSONUtil.toJsonStr(stockoutReceive), "推送出库作业");
|
||||
requestLog.setResponseBody(JSONUtil.toJsonStr(AjaxResult.success()));
|
||||
requestLog.setResponseStatus("0");
|
||||
requestLog.setIsSuccessful("1");
|
||||
requestLogService.insertRequestLog(requestLog);
|
||||
|
||||
//校验:任务已存在
|
||||
if (tasks.size() != 0) {
|
||||
log.info("【请求异常】wms下发出库任务失败,该任务已存在,任务号:{}", stockoutReceive.getTaskCode());
|
||||
return AjaxResult.error("【请求异常】wms下发出库任务失败,任务号:" + stockoutReceive.getTaskCode());
|
||||
// -------------------------检查推送的任务参数-------------------------
|
||||
log.info(
|
||||
"【wms推送出库】请求码:{},wms任务号:{},推送出库货位:{},推送类型:{}",stockoutReceive.getReqCode(), stockoutReceive.getTaskCode(), stockoutReceive.getSiteCode(), stockoutReceive.getTaskTypeCode()
|
||||
);
|
||||
|
||||
BasCargoSpace cargoSpace = basCargoSpaceService.selectBasCargoSpaceByCargoSpaceId(stockoutReceive.getSiteCode());
|
||||
|
||||
// 0.检查货位参数是否合法
|
||||
if(stockoutReceive.getSiteCode() == null || stockoutReceive.getSiteCode() == ""){
|
||||
log.info("【请求错误】wms推送出库任务失败,参数错误,推送任务号:{},推送出库货位:{}", stockoutReceive.getTaskCode(), stockoutReceive.getSiteCode());
|
||||
return AjaxResult.error("【请求错误】wms推送出库任务失败,参数错误,推送任务号:{}" + stockoutReceive.getTaskCode() + ",推送出库货位:" + stockoutReceive.getSiteCode());
|
||||
}else{
|
||||
//排号检查
|
||||
if (cargoSpace.getThePlatoon() > 2 || cargoSpace.getThePlatoon() < 0){
|
||||
log.info("【请求错误】wms推送出库任务失败,参数错误,推送任务号:{},推送排:{}", stockoutReceive.getTaskCode(), cargoSpace.getThePlatoon());
|
||||
return AjaxResult.error("【请求错误】wms推送出库任务失败,错误,推送任务号:" + stockoutReceive.getTaskCode() + ",推送出库排号:" + cargoSpace.getThePlatoon() + ",仓库中不存在该位置!");
|
||||
}
|
||||
|
||||
//列号检查
|
||||
if (cargoSpace.getTheColumn() > 33 || cargoSpace.getTheColumn() < 0){
|
||||
log.info("【请求错误】wms推送出库任务失败,参数错误,推送任务号:{},推送列:{}", stockoutReceive.getTaskCode(), cargoSpace.getTheColumn());
|
||||
return AjaxResult.error("【请求错误】wms推送出库任务失败,错误,推送任务号:" + stockoutReceive.getTaskCode() + ",推送出库列号:" + cargoSpace.getTheColumn() + ",仓库中不存在该位置!");
|
||||
}
|
||||
|
||||
//层号检查
|
||||
if (cargoSpace.getTheFloor() > 6 || cargoSpace.getTheFloor() < 0){
|
||||
log.info("【请求错误】wms推送出库任务失败,参数错误,推送任务号:{},推送层:{}", stockoutReceive.getTaskCode(), cargoSpace.getThePlatoon());
|
||||
return AjaxResult.error("【请求错误】wms推送出库任务失败,错误,推送任务号:" + stockoutReceive.getTaskCode() + ",推送出库层号:" + cargoSpace.getThePlatoon() + ",仓库中不存在该位置!");
|
||||
}
|
||||
}
|
||||
|
||||
// 1.wms推送的任务号是否重复
|
||||
MydoJob job = new MydoJob().builder().wmsTaskNo(stockoutReceive.getTaskCode()).build();
|
||||
List<MydoJob> tasks = mydoJobService.selectMydoJobList(job);
|
||||
if (tasks.size() != 0) {
|
||||
log.info("【请求错误】wms下发出库任务失败,该任务已存在,推送任务号:{},推送出库货位:{}", stockoutReceive.getTaskCode(), stockoutReceive.getSiteCode());
|
||||
return AjaxResult.error("【请求错误】wms下发出库任务失败,该任务已存在,推送任务号:{}" + stockoutReceive.getTaskCode() + ",推送出库货位:" + stockoutReceive.getSiteCode());
|
||||
}
|
||||
|
||||
// 2.wms推送的出库货位是否已经有任务
|
||||
job = new MydoJob().builder().cargoSpaceId(stockoutReceive.getSiteCode()).build();
|
||||
tasks = mydoJobService.selectMydoJobList(job);
|
||||
if (tasks.size() != 0) {
|
||||
log.info("【请求错误】wms下发出库任务失败,已经存在该货位的出库任务,推送任务号:{},推送出库货位:{}", stockoutReceive.getTaskCode(), stockoutReceive.getSiteCode());
|
||||
return AjaxResult.error("【请求错误】wms下发出库任务失败,已经存在该货位的出库任务,推送任务号:{}" + stockoutReceive.getTaskCode() + ",推送出库货位:" + stockoutReceive.getSiteCode());
|
||||
}
|
||||
|
||||
// 3.是否已经有正在执行的入库任务
|
||||
// job = new MydoJob().builder().inOrOut(STOCKIN).build();
|
||||
// tasks = mydoJobService.selectMydoJobList(job);
|
||||
// if (tasks.size() > 0) {
|
||||
// log.info("【警告】wms下发出库任务失败,已经有正在执行的入库任务,请稍后重试");
|
||||
// return AjaxResult.error("【警告】wms下发出库任务失败,已经有正在执行的入库任务,请稍后重试");
|
||||
// }
|
||||
|
||||
//生成出库作业
|
||||
MydoJob mydoJob = new MydoJob();
|
||||
mydoJob.setJobId(mydoJobService.getJobId("CK"));
|
||||
mydoJob.setTaskNo(mydoJobService.getTaskNo("3"));
|
||||
mydoJob.setWmsTaskNo(stockoutReceive.getTaskCode());
|
||||
//todo 可能需要解析货位 wms参数【siteCode】
|
||||
mydoJob.setCargoSpaceId(stockoutReceive.getSiteCode());
|
||||
mydoJob.setExitId("G1004");
|
||||
//todo 是否需要解析wms推送的任务类型?
|
||||
// mydoJob.setInOrOut(stockoutReceive.getTaskTypeCode());
|
||||
mydoJob.setRoadwayId(
|
||||
basCargoSpaceService.selectBasCargoSpaceByCargoSpaceId(stockoutReceive.getSiteCode()).getRoadwayId()
|
||||
);
|
||||
mydoJob.setTraySize(GoodsType.TYPE_DEFAULT);//默认
|
||||
mydoJob.setExitId(CONV_STOCKOUT);
|
||||
mydoJob.setInOrOut("2");
|
||||
mydoJob.setStatus("1");
|
||||
mydoJob.setStatus(TASK_STATUS_CREATED);
|
||||
mydoJob.setPriority(Long.valueOf(10));
|
||||
//todo 可能需要查本地库存信息获取条码?
|
||||
// mydoJob.setTrayCode(receiveOutJob.getTrayCode());
|
||||
mydoJob.setCreateTime(DateUtils.getNowDate());
|
||||
mydoJob.setExecutionPhase(TASK_EP_CREATE);
|
||||
mydoJob.setExecutionPhase(TASK_EP_CREATED);
|
||||
// mydoJob.setTraySize(receiveOutJob.getDepartmentId());
|
||||
|
||||
if (mydoJobService.selectMydoJobByJobId(mydoJob.getJobId()) != null){
|
||||
log.info("【警告】生成作业失败,已存在的作业号:{}", mydoJob.getJobId() + "(此条可忽略)");
|
||||
return AjaxResult.error("【警告】生成作业失败,已存在的作业号:{}" + mydoJob.getJobId() + "(仅提示)");
|
||||
}
|
||||
|
||||
// if (mydoJobService.selectMydoJobByWmsTaskNo(mydoJob.getWmsTaskNo()) != null){
|
||||
// log.info("【警告】生成作业失败,已存在的作业号:{}", mydoJob.getJobId() + "(此条可忽略)");
|
||||
// return AjaxResult.error("【警告】生成作业失败,已存在的wms任务号:{}" + mydoJob.getJobId() + "(仅提示)");
|
||||
// }
|
||||
|
||||
int i = mydoJobService.insertMydoJob(mydoJob);
|
||||
// boolean success = mydoJobService.saveOrUpdate(mydoJob);
|
||||
if (i != 0) {
|
||||
requestLog.setResponseStatus("1");
|
||||
requestLogService.updateRequestLog(requestLog);
|
||||
return AjaxResult.success(
|
||||
"【请求成功】wms下发出库作业,下发任务号:" + stockoutReceive.getTaskCode() + ",出库货位:" + stockoutReceive.getSiteCode());
|
||||
"【堆垛机出库】wms下发出库作业,下发任务号:" + stockoutReceive.getTaskCode() + ",出库货位:" + stockoutReceive.getSiteCode());
|
||||
}else{
|
||||
return AjaxResult.error();
|
||||
}
|
||||
@@ -611,12 +705,8 @@ public class ApiServiceImpl implements IApiService {
|
||||
}
|
||||
}
|
||||
|
||||
@PostConstruct
|
||||
void qwe() {
|
||||
// LambdaQueryWrapper<MydoJob> queryWrapper = new LambdaQueryWrapper<>();
|
||||
// queryWrapper.eq(MydoJob::getTaskNo,"6666");
|
||||
// MydoJob mydoJob = mydoJobMapper.selectOne(queryWrapper);
|
||||
|
||||
// @PostConstruct
|
||||
void test() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,11 +1,15 @@
|
||||
package com.ruoyi.api.service.impl;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.date.DateUnit;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.http.Header;
|
||||
import cn.hutool.http.HttpRequest;
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
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.service.IRequestLogService;
|
||||
|
||||
import static com.ruoyi.common.Constant.HEADER_TOKEN;
|
||||
|
||||
/**
|
||||
* 接口记录Service业务层处理
|
||||
*
|
||||
@@ -54,6 +60,16 @@ public class RequestLogServiceImpl implements IRequestLogService
|
||||
return requestLogMapper.selectRequestLogList(requestLog);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取最新的请求记录
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public RequestLog selectRequestLogByLatestTask()
|
||||
{
|
||||
return requestLogMapper.selectRequestLogByLatestTask();
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增接口记录
|
||||
*
|
||||
@@ -129,7 +145,14 @@ public class RequestLogServiceImpl implements IRequestLogService
|
||||
requestLog.setRequestUrl(url);
|
||||
Date responseTime =new Date();
|
||||
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);
|
||||
InterfaceReceive bean = JSONUtil.toBean(resStr, InterfaceReceive.class);
|
||||
|
||||
@@ -201,6 +224,7 @@ public class RequestLogServiceImpl implements IRequestLogService
|
||||
return requestLog;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @@@ FT568 使用用户自定义的wms请求响应
|
||||
* @param url
|
||||
@@ -221,8 +245,14 @@ public class RequestLogServiceImpl implements IRequestLogService
|
||||
requestLog.setRequestBody(param);
|
||||
requestLog.setRequestUrl(url);
|
||||
Date responseTime =new Date();
|
||||
|
||||
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) // 向wms请求头必需添加的token
|
||||
.execute()
|
||||
.body();
|
||||
requestLog.setResponseBody(resStr);
|
||||
ResponseResult bean = JSONUtil.toBean(resStr, ResponseResult.class);
|
||||
|
||||
@@ -272,6 +302,8 @@ public class RequestLogServiceImpl implements IRequestLogService
|
||||
return requestLog;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @@@ FT568 将wms自定义的响应格式解析为本地响应格式(减少其他改动)
|
||||
* @param responseStr 请求响应字符串
|
||||
|
||||
@@ -3,9 +3,13 @@ package com.ruoyi.common;
|
||||
|
||||
public class Constant {
|
||||
|
||||
public static final String WMS_BASE_URL = "http://192.168.58.10:8082/api2wms";
|
||||
public static final String LOCAL_URL = "http://127.0.0.1:8084";
|
||||
public static final String WMS_BASE_URL = "http://10.88.10.69:8390/service";
|
||||
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
|
||||
public static final String GEN_AGV_SCHEDULING_TASK = RCS_BASE_URL+"genAgvSchedulingTask";
|
||||
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";
|
||||
|
||||
/**
|
||||
* 任务状态-待执行
|
||||
@@ -27,6 +27,11 @@ public class TaskStatusCode {
|
||||
*/
|
||||
public static final String TASK_STATUS_FINISH = "4";
|
||||
|
||||
/**
|
||||
* 任务状态-手动完成
|
||||
*/
|
||||
public static final String TASK_STATUS_FINISH_MANUAL = "4";
|
||||
|
||||
/**
|
||||
* 任务状态-作废
|
||||
*/
|
||||
@@ -39,7 +44,7 @@ public class TaskStatusCode {
|
||||
/**
|
||||
* 任务执行阶段 任务已生成
|
||||
*/
|
||||
public static final String TASK_EP_CREATE = "0";
|
||||
public static final String TASK_EP_CREATED = "0";
|
||||
|
||||
/**
|
||||
* 任务执行阶段 产线输送到位
|
||||
@@ -52,7 +57,7 @@ public class TaskStatusCode {
|
||||
public static final String TASK_EP_AGV = "2";
|
||||
|
||||
/**
|
||||
* 任务执行阶段 入口输送机
|
||||
* 任务执行阶段 入口输送机输送到位
|
||||
*/
|
||||
public static final String TASK_EP_SSJ = "3";
|
||||
|
||||
@@ -76,10 +81,30 @@ public class TaskStatusCode {
|
||||
*/
|
||||
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";
|
||||
|
||||
/**
|
||||
* 入库异常 - 放货有货
|
||||
*/
|
||||
public static final String TASK_EXCEPTION_PUT = "STOCKIN_FAULT";
|
||||
|
||||
/**
|
||||
* 出库异常 - 取货无货
|
||||
*/
|
||||
public static final String TASK_EXCEPTION_PICK = "STOCKOUT_FAULT";
|
||||
|
||||
/**
|
||||
* 入库异常 - 重分完成
|
||||
*/
|
||||
public static final String TASK_EXCEPTION_PUT_REASSIGN = "STOCKIN_FAULT_REASSIGN";
|
||||
|
||||
/**
|
||||
* 任务执行阶段 回传wms完成
|
||||
|
||||
@@ -5,6 +5,20 @@ package com.ruoyi.common;
|
||||
*/
|
||||
public class TaskType {
|
||||
|
||||
/**
|
||||
* 默认类型
|
||||
*/
|
||||
public static final int STACKER_TYPE_DEFAULT = 0;
|
||||
|
||||
/**
|
||||
* 常规入库
|
||||
*/
|
||||
public static final String STOCKIN = "1";
|
||||
|
||||
/**
|
||||
* 常规出库
|
||||
*/
|
||||
public static final String STOCKOUT = "2";
|
||||
|
||||
/**
|
||||
* 1-二楼入出
|
||||
|
||||
@@ -8,11 +8,41 @@ public class WmsTaskTypeCode {
|
||||
/**
|
||||
* 外部wms定义的入库类型
|
||||
*/
|
||||
public static final String WMS_TASK_TYPE_STOCKIN = "1";
|
||||
public static final String WMS_TASK_TYPE_STOCKIN = "立库入库";
|
||||
|
||||
/**
|
||||
* 外部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 = "立库异常任务";
|
||||
|
||||
}
|
||||
|
||||
@@ -3,7 +3,13 @@ package com.ruoyi.device.ddj.controller;
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.ruoyi.api.domain.RequestLog;
|
||||
import com.ruoyi.api.service.IRequestLogService;
|
||||
import com.ruoyi.device.ddj.domain.StackerStatus;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -24,6 +30,8 @@ import com.ruoyi.device.ddj.service.IMsgDdjService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
import static com.ruoyi.common.Constant.LOCAL_URL;
|
||||
|
||||
/**
|
||||
* 堆垛机状态表Controller
|
||||
*
|
||||
@@ -31,12 +39,15 @@ import com.ruoyi.common.core.page.TableDataInfo;
|
||||
* @date 2025-09-22
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/device/ddj")
|
||||
@RequestMapping("/device/stacker")
|
||||
public class MsgDdjController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IMsgDdjService msgDdjService;
|
||||
|
||||
@Autowired
|
||||
private IRequestLogService requestLogService;
|
||||
|
||||
/**
|
||||
* 查询堆垛机状态表列表
|
||||
*/
|
||||
@@ -108,7 +119,7 @@ public class MsgDdjController extends BaseController
|
||||
|
||||
|
||||
/**
|
||||
* 返回堆垛机状态的记录类型
|
||||
* 返回堆垛机状态的记录类型 - 中
|
||||
* @param id 编号
|
||||
* @param mode 操作模式
|
||||
* @param taskNo 任务号
|
||||
@@ -118,7 +129,7 @@ public class MsgDdjController extends BaseController
|
||||
* @param permission 允许下发
|
||||
* @param position 当前位置
|
||||
*/
|
||||
public record StackerStatus(
|
||||
public record StackerStatusContent(
|
||||
@JsonProperty("堆垛机编号") String id,
|
||||
@JsonProperty("操作模式") String mode,
|
||||
@JsonProperty("任务号") String taskNo,
|
||||
@@ -135,46 +146,126 @@ public class MsgDdjController extends BaseController
|
||||
*/
|
||||
@GetMapping("/getStackerStatus/{id}")
|
||||
public AjaxResult getStackerStatus(@PathVariable Long id){
|
||||
|
||||
//返回堆垛机部分参数的状态映射
|
||||
if (id == 1) {
|
||||
MsgDdj msg = msgDdjService.selectMsgDdjById(id);
|
||||
com.ruoyi.device.ddj.domain.StackerStatus status = new com.ruoyi.device.ddj.domain.StackerStatus();
|
||||
MsgDdj msg = msgDdjService.selectMsgDdjById(id);
|
||||
if (msg == null) {
|
||||
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);
|
||||
|
||||
//操作模式
|
||||
String mode = "其他";
|
||||
switch (msg.getCzfs()){
|
||||
case 1 -> mode = "手动";
|
||||
case 5 -> mode = "联机自动";
|
||||
}
|
||||
// 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() + "层");
|
||||
|
||||
//设备状态
|
||||
String deviceStatus = "待机";
|
||||
switch (msg.getSbzt()){
|
||||
case 0 -> deviceStatus = "待机";
|
||||
case 1 -> deviceStatus = "运行中";
|
||||
default -> deviceStatus = "运行报警";
|
||||
}
|
||||
return AjaxResult.success(statusContent);
|
||||
|
||||
//执行阶段
|
||||
String executionPhase = "待机";
|
||||
switch (msg.getJdbz()){
|
||||
case 1 -> executionPhase = "取货途中";
|
||||
case 2 -> executionPhase = "取货中";
|
||||
case 3 -> executionPhase = "放货途中";
|
||||
case 4 -> executionPhase = "放货中";
|
||||
case 5 -> executionPhase = "放货完成";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 返回堆垛机状态的记录类型 - 英
|
||||
* @param id 编号
|
||||
* @param mode 操作模式
|
||||
* @param taskNo 任务号
|
||||
* @param deviceStatus 设备状态
|
||||
* @param forkStatus 货叉状态
|
||||
* @param executionPhase 执行阶段
|
||||
* @param permission 允许下发
|
||||
* @param position 当前位置
|
||||
*/
|
||||
public record StackerStatus(
|
||||
Long id,
|
||||
int mode,
|
||||
String taskNo,
|
||||
int deviceStatus,
|
||||
int forkStatus,
|
||||
int executionPhase,
|
||||
int permission,
|
||||
String position){}
|
||||
|
||||
/**
|
||||
* 请求获取堆垛机状态
|
||||
* @param id 堆垛机编号
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getStackerStatus/en/{id}")
|
||||
public AjaxResult getStackerStatusEn(@PathVariable Long id){
|
||||
|
||||
//返回堆垛机部分参数的状态映射
|
||||
|
||||
MsgDdj msg = msgDdjService.selectMsgDdjById(id);
|
||||
|
||||
if (msg == null) {
|
||||
AjaxResult.error("【查询堆垛机状态】设备编号:" + id + ",查询超出最大索引");
|
||||
}
|
||||
|
||||
StackerStatus statusContent = new StackerStatus(
|
||||
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);
|
||||
|
||||
StackerStatus statusContent = new StackerStatus(
|
||||
String.valueOf(id),
|
||||
mode,
|
||||
String.valueOf(msg.getRwh()),
|
||||
deviceStatus,
|
||||
msg.getHczt() > 0 ? "货叉有货" : "货叉无货",
|
||||
executionPhase,
|
||||
msg.getYxxf() == 1 ? "允许" : "禁止",
|
||||
msg.getCurrentRow() + "排" + msg.getCurrentColumn() + "列" + msg.getCurrentFloor() + "层"
|
||||
);
|
||||
// status.setId(msg.getId());
|
||||
// status.setMode(msg.getCzfs());
|
||||
// status.setTaskNo(msg.getRwh());
|
||||
@@ -188,10 +279,9 @@ public class MsgDdjController extends BaseController
|
||||
// status.setCurrentRoad(msg.getId());
|
||||
// status.setCurrentPosition(msg.getCurrentRow() + "排" + msg.getCurrentColumn() + "列" + msg.getCurrentFloor() + "层");
|
||||
|
||||
return AjaxResult.success(statusContent);
|
||||
}else{
|
||||
return AjaxResult.error("【查询堆垛机状态】设备编号:" + id + ",查询超出最大索引");
|
||||
}
|
||||
return AjaxResult.success(statusContent);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -3,8 +3,10 @@ package com.ruoyi.device.ssj.controller;
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.ruoyi.device.ssj.domain.ConvStatus;
|
||||
import com.ruoyi.api.domain.RequestLog;
|
||||
import com.ruoyi.api.service.IRequestLogService;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@@ -24,6 +26,8 @@ import com.ruoyi.device.ssj.service.IDeviceSsjService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
import static com.ruoyi.common.Constant.LOCAL_URL;
|
||||
|
||||
/**
|
||||
* 输送机Controller
|
||||
*
|
||||
@@ -31,12 +35,15 @@ import com.ruoyi.common.core.page.TableDataInfo;
|
||||
* @date 2025-07-04
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/device/ssj")
|
||||
@RequestMapping("/device/conv")
|
||||
public class DeviceSsjController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IDeviceSsjService deviceSsjService;
|
||||
|
||||
@Autowired
|
||||
private IRequestLogService requestLogService;
|
||||
|
||||
/**
|
||||
* 查询输送机列表
|
||||
*/
|
||||
@@ -105,10 +112,13 @@ public class DeviceSsjController extends BaseController
|
||||
return toAjax(deviceSsjService.deleteDeviceSsjByIds(ids));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 返回的输送机状态
|
||||
* 返回的输送机状态 - 中
|
||||
*/
|
||||
private record ConvStatus(
|
||||
private record ConvStatusContent(
|
||||
@JsonProperty("输送机编号") String id,
|
||||
@JsonProperty("操作模式") String mode,
|
||||
@JsonProperty("占用状态") String free,
|
||||
@@ -122,6 +132,49 @@ public class DeviceSsjController extends BaseController
|
||||
*/
|
||||
@GetMapping("/getConvStatus/{id}")
|
||||
public AjaxResult getConvStatus(@PathVariable String id){
|
||||
|
||||
DeviceSsj msgSsj = deviceSsjService.selectDeviceSsjByDeviceCode(id);
|
||||
|
||||
if (msgSsj == null) {
|
||||
return AjaxResult.error("【查询输送机状态】设备编号:" + id + ",该设备不存在!");
|
||||
}
|
||||
|
||||
ConvStatusContent status = new ConvStatusContent(
|
||||
id,
|
||||
msgSsj.getMode() == 1 ? "自动" : "手动",
|
||||
msgSsj.getKx() == 1 ? "占用" : "空闲",
|
||||
msgSsj.getDw() == 1 ? "输送到位" : "未到位",
|
||||
// msgSsj.getMode() == 1 ? "1" : "0",
|
||||
// msgSsj.getKx() == 1 ? "1" : "0",
|
||||
// msgSsj.getDw() == 1 ? "1" : "0",
|
||||
String.valueOf(msgSsj.getTaskNo())
|
||||
);
|
||||
|
||||
RequestLog requestLog = requestLogService.getRequestLog(id, "获取指定输送机状态");
|
||||
requestLog.setRequestUrl(LOCAL_URL + "/device/ssj/getConvStatus/" + id);
|
||||
requestLog.setRequestMethod("get");
|
||||
requestLog.setResponseStatus("1");
|
||||
requestLog.setResponseBody(JSON.toJSONString(status));
|
||||
requestLogService.insertRequestLog(requestLog);
|
||||
|
||||
return AjaxResult.success(status);
|
||||
}
|
||||
|
||||
/**
|
||||
* 请求返回输送机状态 - 英
|
||||
* @param id 输送机编号
|
||||
* @return
|
||||
*/
|
||||
private record ConvStatus(
|
||||
String id,
|
||||
String mode,
|
||||
String free,
|
||||
String inPosition,
|
||||
int taskNo){}
|
||||
|
||||
@GetMapping("/getConvStatus/en/{id}")
|
||||
public AjaxResult getConvStatusEn(@PathVariable String id){
|
||||
|
||||
DeviceSsj msgSsj = deviceSsjService.selectDeviceSsjByDeviceCode(id);
|
||||
|
||||
if (msgSsj == null) {
|
||||
@@ -130,12 +183,19 @@ public class DeviceSsjController extends BaseController
|
||||
|
||||
ConvStatus status = new ConvStatus(
|
||||
id,
|
||||
msgSsj.getMode() == 1 ? "自动" : "手动",
|
||||
msgSsj.getKx() == 1 ? "占用" : "空闲",
|
||||
msgSsj.getDw() == 1 ? "输送到位" : "未到位",
|
||||
String.valueOf(msgSsj.getTaskNo())
|
||||
msgSsj.getMode() == 1 ? "1" : "0",
|
||||
msgSsj.getKx() == 1 ? "1" : "0",
|
||||
msgSsj.getDw() == 1 ? "1" : "0",
|
||||
msgSsj.getTaskNo()
|
||||
);
|
||||
|
||||
RequestLog requestLog = requestLogService.getRequestLog(id, "获取指定输送机状态");
|
||||
requestLog.setRequestUrl(LOCAL_URL + "/device/ssj/getConvStatus/en/" + id);
|
||||
requestLog.setRequestMethod("get");
|
||||
requestLog.setResponseStatus("1");
|
||||
requestLog.setResponseBody(JSON.toJSONString(status));
|
||||
requestLogService.insertRequestLog(requestLog);
|
||||
|
||||
return AjaxResult.success(status);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
package com.ruoyi.device.ssj.domain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.ToString;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ToString
|
||||
public class ConvStatus {
|
||||
|
||||
/**
|
||||
* 输送机编号
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 手/自动模式
|
||||
*/
|
||||
private String mode;
|
||||
|
||||
/**
|
||||
* 0-空闲 1-占用
|
||||
*/
|
||||
private String free;
|
||||
|
||||
/**
|
||||
* 0-未到位 1-到位
|
||||
*/
|
||||
private String inPosition;
|
||||
|
||||
/**
|
||||
* 任务号
|
||||
*/
|
||||
private String taskNo;
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -86,6 +86,9 @@ public class DeviceSsj extends BaseEntity
|
||||
@Excel(name="允许放货")
|
||||
private int allowPut;
|
||||
|
||||
/**
|
||||
* 输送状态
|
||||
*/
|
||||
private int sszt;
|
||||
|
||||
private int taskNo2;
|
||||
@@ -98,7 +101,7 @@ public class DeviceSsj extends BaseEntity
|
||||
/**
|
||||
* 托盘高度
|
||||
*/
|
||||
private String height;
|
||||
private int height;
|
||||
|
||||
/**
|
||||
* 称重
|
||||
|
||||
@@ -104,10 +104,5 @@ public class JobCallBackController extends BaseController
|
||||
return toAjax(jobCallBackService.deleteJobCallBackByIds(ids));
|
||||
}
|
||||
|
||||
@Scheduled(fixedDelay=3000)
|
||||
public void jobCallBack() {
|
||||
jobCallBackService.jobCallBack();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -56,6 +56,18 @@ public class MydoJobController extends BaseController
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询作业信息列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('job:mydoJob:list')")
|
||||
@GetMapping("/listUnion")
|
||||
public TableDataInfo listUnion(MydoJob mydoJob)
|
||||
{
|
||||
startPage();
|
||||
List<MydoJob> list = mydoJobService.selectMydoJobUnionList(mydoJob);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出作业信息列表
|
||||
*/
|
||||
@@ -112,30 +124,33 @@ public class MydoJobController extends BaseController
|
||||
return toAjax(mydoJobService.deleteMydoJobByJobIds(jobIds));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasAnyPermi('job:mydoJob:OuthandFinish')")
|
||||
@PreAuthorize("@ss.hasAnyPermi('job:mydoJob:outhandFinish')")
|
||||
@Log(title = "出库手动完成", businessType = BusinessType.OTHER)
|
||||
@RequestMapping("/OuthandFinish")
|
||||
@RequestMapping("/outhandFinish")
|
||||
public AjaxResult manualCompleted(@RequestParam("jobIds")String[] jobIds)
|
||||
{
|
||||
return mydoJobService.OuthandFinish(jobIds);
|
||||
return mydoJobService.outhandFinish(jobIds);
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasAnyPermi('job:mydoJob:cancelJob')")
|
||||
@Log(title = "出库作废", businessType = BusinessType.OTHER)
|
||||
@RequestMapping("/cancelJob")
|
||||
public AjaxResult cancelJob(@RequestParam("jobIds")String[] jobIds)
|
||||
{
|
||||
return toAjax(mydoJobService.deleteMydoJobByJobIds(jobIds));
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理未正常移除的【堆垛机执行完成】或【出库到位】的遗留任务
|
||||
*/
|
||||
@Scheduled(fixedDelay = 3000)
|
||||
public void mydoJobHandler() {
|
||||
//此处堆垛机执行完成-【TASK_EP_DDJ_FINISH】或出库到位-【TASK_EP_SSJ_STOCKOUT_FINISH】的常量值相同,均可表示任务【已完成】
|
||||
//用其中一种状态查询所有标记为【已完成】的任务
|
||||
List<MydoJob> jobs = mydoJobService.selectMydoJobList(
|
||||
new MydoJob().builder().executionPhase(TASK_EP_DDJ_FINISH).build()
|
||||
);
|
||||
if (!jobs.isEmpty()) {
|
||||
for (MydoJob job : jobs) {
|
||||
mydoJobService.taskFinish(Long.valueOf(job.getTaskNo()));
|
||||
}
|
||||
}
|
||||
@PreAuthorize("@ss.hasAnyPermi('job:mydoJob:resendTaskToEntrance')")
|
||||
@Log(title = "入口输送机重新下发", businessType = BusinessType.OTHER)
|
||||
@PutMapping("/resendTaskToEntrance")
|
||||
public AjaxResult resendTaskToEntrance(@RequestParam("jobId") String jobId){
|
||||
|
||||
if (jobId == null || jobId == "") return AjaxResult.error("未选择任务或选择任务异常");
|
||||
|
||||
MydoJob job = mydoJobService.selectMydoJobByJobId(jobId);
|
||||
job.setExecutionPhase("0");
|
||||
job.setStatus("1");
|
||||
return toAjax(mydoJobService.updateMydoJob(job));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -50,5 +50,9 @@ public class JobCallBack extends BaseEntity
|
||||
@Excel(name = "wms任务编号")
|
||||
private String taskCode;
|
||||
|
||||
/** 回传重试次数 */
|
||||
@Excel(name = "重试次数")
|
||||
private int retry;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.ruoyi.job.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.*;
|
||||
@@ -21,13 +22,14 @@ import java.util.List;
|
||||
@NoArgsConstructor
|
||||
@ToString
|
||||
@Builder
|
||||
//@TableName("mydo_job_wcs")
|
||||
@TableName("mydo_job_wcs")
|
||||
public class MydoJob extends BaseEntity
|
||||
{
|
||||
@TableField(exist = false)
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 任务ID */
|
||||
// @TableId
|
||||
@TableId
|
||||
private String jobId;
|
||||
|
||||
/** 任务状态 */
|
||||
|
||||
@@ -103,6 +103,8 @@ public interface MydoJobMapper
|
||||
|
||||
MydoJob selectMydoJobByExitId(@Param("exitId") String exitId);
|
||||
|
||||
MydoJob selectMydoJobByWmsTaskNo(@Param("wmsTaskNo") String exitId);
|
||||
|
||||
/**
|
||||
* 获取本地生成作业号
|
||||
* @param map
|
||||
@@ -117,4 +119,7 @@ public interface MydoJobMapper
|
||||
*/
|
||||
void getTaskNo(HashMap<String, Object> map);
|
||||
|
||||
List<MydoJob> selectMydoJobUnionList(MydoJob mydoJob);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,13 +1,9 @@
|
||||
package com.ruoyi.job.service;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.job.domain.MydoJob;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 作业信息Service接口
|
||||
@@ -92,14 +88,18 @@ public interface IMydoJobService
|
||||
|
||||
MydoJob selectMydoJobByEntranceList1(String entranceId);
|
||||
|
||||
AjaxResult OuthandFinish(String[] jobIds);
|
||||
AjaxResult outhandFinish(String[] jobIds);
|
||||
|
||||
public AjaxResult ManuelTaskFinish(String[] taskNos);
|
||||
AjaxResult ManuelTaskFinish(String taskNo);
|
||||
|
||||
List<MydoJob> getInJobByEntranceId(String exitId);
|
||||
|
||||
MydoJob selectMydoJobByExitId(String exitId);
|
||||
|
||||
MydoJob selectMydoJobByWmsTaskNo(String wmsTaskNo);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取本地生成作业号
|
||||
* @param type RK-入库 CK-出库
|
||||
@@ -114,4 +114,6 @@ public interface IMydoJobService
|
||||
*/
|
||||
String getTaskNo(String type);
|
||||
|
||||
List<MydoJob> selectMydoJobUnionList(MydoJob mydoJob);
|
||||
|
||||
}
|
||||
|
||||
@@ -121,6 +121,7 @@ public class JobCallBackServiceImpl implements IJobCallBackService
|
||||
jobCallBack.setStatus("1");
|
||||
}else{
|
||||
jobCallBack.setStatus("99");
|
||||
jobCallBack.setRetry(jobCallBack.getRetry() + 1);
|
||||
}
|
||||
jobCallBackMapper.updateJobCallBack(jobCallBack);
|
||||
}
|
||||
|
||||
@@ -4,12 +4,18 @@ import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.lang.UUID;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.job.domain.JobCallBack;
|
||||
import com.ruoyi.job.service.IJobCallBackService;
|
||||
import com.ruoyi.queue.ddj.domain.DdjDeviceExecutionQueue;
|
||||
import com.ruoyi.queue.ddj.domain.DdjDeviceExecutionQueueFinish;
|
||||
import com.ruoyi.queue.ddj.service.IDdjDeviceExecutionQueueFinishService;
|
||||
import com.ruoyi.queue.ddj.service.IDdjDeviceExecutionQueueService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -17,8 +23,9 @@ import com.ruoyi.job.mapper.MydoJobMapper;
|
||||
import com.ruoyi.job.domain.MydoJob;
|
||||
import com.ruoyi.job.service.IMydoJobService;
|
||||
|
||||
import static com.ruoyi.common.WmsTaskTypeCode.WMS_TASK_TYPE_STOCKIN;
|
||||
import static com.ruoyi.common.WmsTaskTypeCode.WMS_TASK_TYPE_STOCKOUT;
|
||||
import static com.ruoyi.common.TaskStatusCode.TASK_STATUS_FINISH_MANUAL;
|
||||
import static com.ruoyi.common.TaskStatusCode.TASK_STATUS_INVALID;
|
||||
import static com.ruoyi.common.WmsTaskTypeCode.*;
|
||||
|
||||
/**
|
||||
* 作业信息Service业务层处理
|
||||
@@ -27,12 +34,17 @@ import static com.ruoyi.common.WmsTaskTypeCode.WMS_TASK_TYPE_STOCKOUT;
|
||||
* @date 2025-09-22
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class MydoJobServiceImpl implements IMydoJobService
|
||||
{
|
||||
@Autowired
|
||||
private MydoJobMapper mydoJobMapper;
|
||||
@Autowired
|
||||
private IJobCallBackService jobCallBackService;
|
||||
@Autowired
|
||||
private IDdjDeviceExecutionQueueService ddjDeviceExecutionQueueService;
|
||||
@Autowired
|
||||
private IDdjDeviceExecutionQueueFinishService ddjDeviceExecutionQueueServiceFinishService;
|
||||
|
||||
/**
|
||||
* 查询作业信息
|
||||
@@ -95,7 +107,23 @@ public class MydoJobServiceImpl implements IMydoJobService
|
||||
public int deleteMydoJobByJobIds(String[] jobIds)
|
||||
{
|
||||
for (String jobId : jobIds) {
|
||||
MydoJob mydoJob = selectMydoJobByJobId(jobId);
|
||||
|
||||
if (mydoJob == null) continue;
|
||||
mydoJob.setStatus(TASK_STATUS_INVALID);
|
||||
updateMydoJob(mydoJob);
|
||||
mydoJobMapper.insertHistory(jobId);
|
||||
deleteMydoJobByJobId(jobId);
|
||||
|
||||
//当执行任务的【删除】操作时(特殊场景需要手动处理异常导致不需要入库时,此时不需要向回传异常)
|
||||
// 此处顺便处理对应任务号生成的堆垛机执行队列,省去sql直接表中删记录的操作
|
||||
DdjDeviceExecutionQueue queue = ddjDeviceExecutionQueueService.selectDdjDeviceExecutionQueueByTaskNo(mydoJob.getTaskNo());
|
||||
if (queue != null){
|
||||
ddjDeviceExecutionQueueService.deleteDdjDeviceExecutionQueueByTaskNo(mydoJob.getTaskNo());
|
||||
}
|
||||
|
||||
log.info("【人工操作】执行手动删除作业,作业号:{}", jobId);
|
||||
|
||||
}
|
||||
return mydoJobMapper.deleteMydoJobByJobIds(jobIds);
|
||||
}
|
||||
@@ -109,6 +137,26 @@ public class MydoJobServiceImpl implements IMydoJobService
|
||||
@Override
|
||||
public int deleteMydoJobByJobId(String jobId)
|
||||
{
|
||||
try{
|
||||
MydoJob mydoJob = selectMydoJobByJobId(jobId);
|
||||
if (mydoJob == null) return 0;
|
||||
|
||||
mydoJob.setStatus(TASK_STATUS_INVALID);
|
||||
updateMydoJob(mydoJob);
|
||||
mydoJobMapper.insertHistory(jobId);
|
||||
|
||||
//当执行任务的【删除】操作时(特殊场景需要手动处理异常导致不需要入库时,此时不需要向回传异常)
|
||||
// 此处顺便处理对应任务号生成的堆垛机执行队列,省去sql直接表中删记录的操作
|
||||
String taskNo = selectMydoJobByJobId(jobId).getTaskNo();
|
||||
if (taskNo != null || taskNo != "") {
|
||||
ddjDeviceExecutionQueueService.deleteDdjDeviceExecutionQueueByTaskNo(taskNo);
|
||||
}
|
||||
|
||||
log.info("【人工操作】执行手动删除作业,作业号:{}", jobId);
|
||||
}catch (Exception e){
|
||||
log.warn("【提示】操作失败,发生了未知错误:{}", e.getMessage());
|
||||
}
|
||||
|
||||
return mydoJobMapper.deleteMydoJobByJobId(jobId);
|
||||
}
|
||||
|
||||
@@ -136,13 +184,15 @@ public class MydoJobServiceImpl implements IMydoJobService
|
||||
MydoJob task = selectMydoJobByTaskNo(rwh);
|
||||
insertHistory(task.getJobId());
|
||||
deleteMydoJobByJobId(task.getJobId());
|
||||
ddjDeviceExecutionQueueService.deleteDdjDeviceExecutionQueueByTaskNo(task.getTaskNo());
|
||||
|
||||
JobCallBack jobCallBack = new JobCallBack();
|
||||
jobCallBack.setType("2");
|
||||
jobCallBack.setType(Integer.valueOf(task.getInOrOut()) < 20 ? "1" : "2");
|
||||
jobCallBack.setMydoJobId(task.getJobId());
|
||||
jobCallBack.setStatus("0");
|
||||
jobCallBack.setTaskNo(Convert.toLong(task.getTaskNo()));
|
||||
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.setTaskCode(task.getWmsTaskNo());
|
||||
jobCallBackService.insertJobCallBack(jobCallBack);
|
||||
@@ -155,6 +205,9 @@ public class MydoJobServiceImpl implements IMydoJobService
|
||||
map.put("v_rwh", rwh);
|
||||
map.put("v_ddj_id", id);
|
||||
mydoJobMapper.InvalidMydoJob(map);
|
||||
|
||||
log.info("【人工操作】手动作废wcs任务并移除执行中的堆垛机队列,wcs任务号:{}", rwh);
|
||||
|
||||
if (Convert.toInt(map.get("v_result")) == 10){
|
||||
return true;
|
||||
}else {
|
||||
@@ -162,6 +215,7 @@ public class MydoJobServiceImpl implements IMydoJobService
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public MydoJob selectMydoJobByExitList(List<String> exitList ) {
|
||||
return mydoJobMapper.selectMydoJobByExitList(exitList);
|
||||
@@ -194,77 +248,88 @@ public class MydoJobServiceImpl implements IMydoJobService
|
||||
|
||||
/**
|
||||
* 手动完成同一【作业单号】的作业
|
||||
* 如果【jobid】和【taskno】是一对多的情况,使用上一个方法<OuthandFinish>手动完成作业会导致整个【jobid】单据完成回传
|
||||
* @param jobIds
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult OuthandFinish(String[] jobIds) {
|
||||
public AjaxResult outhandFinish(String[] jobIds) {
|
||||
//获取所有符合【任务单号】的作业
|
||||
for (String jobId : jobIds) {
|
||||
|
||||
//todo 是否需要校验响应成功后再执行历史表操作
|
||||
//生成回传记录
|
||||
MydoJob mydoJob = mydoJobMapper.selectMydoJobByJobId(jobId);
|
||||
mydoJob.setStatus(TASK_STATUS_FINISH_MANUAL);
|
||||
updateMydoJob(mydoJob);
|
||||
|
||||
//插入历史表
|
||||
mydoJobMapper.insertHistory(jobId);
|
||||
|
||||
//生成回传记录
|
||||
MydoJob mydoJob = mydoJobMapper.selectMydoJobByJobId(jobId);
|
||||
JobCallBack jobCallBack = new JobCallBack();
|
||||
long jobIdNum = Long.parseLong(mydoJob.getInOrOut());
|
||||
if (jobIdNum > 20){
|
||||
jobCallBack.setType("2");
|
||||
jobCallBack.setTaskTypeCode(WMS_TASK_TYPE_STOCKOUT);//todo wms下发的任务类型
|
||||
}else{
|
||||
jobCallBack.setType("1");
|
||||
jobCallBack.setTaskTypeCode(WMS_TASK_TYPE_STOCKIN);//todo wms下发的任务类型
|
||||
}
|
||||
|
||||
jobCallBack.setType(mydoJob.getInOrOut());
|
||||
jobCallBack.setTaskTypeCode(WMS_TASK_TYPE_FINISH);// wms自定义的任务类型
|
||||
jobCallBack.setMydoJobId(mydoJob.getJobId());
|
||||
jobCallBack.setStatus("0");
|
||||
jobCallBack.setTaskNo(Convert.toLong(mydoJob.getTaskNo()));
|
||||
jobCallBack.setCreateTime(new Date());
|
||||
jobCallBack.setTaskCode(mydoJob.getWmsTaskNo());
|
||||
jobCallBack.setRetry(0);
|
||||
|
||||
jobCallBack.setReqCode(UUID.randomUUID().toString());
|
||||
jobCallBackService.insertJobCallBack(jobCallBack);
|
||||
|
||||
//移除实时任务
|
||||
|
||||
mydoJobMapper.deleteMydoJobByJobId(jobId);
|
||||
|
||||
log.info("【人工操作】手动完成wcs任务,wcs任务号:{},wms任务号:{}", mydoJob.getTaskNo(), mydoJob.getWmsTaskNo());
|
||||
|
||||
DdjDeviceExecutionQueue queue = ddjDeviceExecutionQueueService.selectDdjDeviceExecutionQueueByTaskNo(mydoJob.getTaskNo());
|
||||
|
||||
try {
|
||||
if (queue != null)
|
||||
{
|
||||
DdjDeviceExecutionQueueFinish queueFinish = BeanUtil.copyProperties(queue, DdjDeviceExecutionQueueFinish.class);
|
||||
|
||||
ddjDeviceExecutionQueueServiceFinishService.insertDdjDeviceExecutionQueueFinish(queueFinish);
|
||||
|
||||
ddjDeviceExecutionQueueService.deleteDdjDeviceExecutionQueueByTaskNo(mydoJob.getTaskNo());
|
||||
|
||||
log.info("【人工操作】移除堆垛机队列,wcs任务号:{}", mydoJob.getTaskNo());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return AjaxResult.success("操作成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 手动处理指定批量【任务号】的作业
|
||||
* >>需要确定【jobid】是否由wms下发
|
||||
* >>如果【jobid】和【taskno】是一对多的情况,使用上一个方法<OuthandFinish>手动完成作业会导致整个【jobid】单据完成回传
|
||||
* >>如果【jobid】和【taskno】是一对一的情况,则直接使用 <OuthandFinish> 方法手动完成即可
|
||||
* @param taskNos
|
||||
* 手动处理指定【任务号】的作业
|
||||
* @param taskNo
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult ManuelTaskFinish(String[] taskNos) {
|
||||
public AjaxResult ManuelTaskFinish(String taskNo) {
|
||||
|
||||
//获取所有符合【任务号】的作业
|
||||
for (String taskNo : taskNos) {
|
||||
MydoJob mydoJob = mydoJobMapper.selectMydoJobByTaskNo(taskNo);
|
||||
mydoJobMapper.insertHistory(mydoJob.getInOrOut());
|
||||
JobCallBack jobCallBack = new JobCallBack();
|
||||
long jobIdNum = Long.parseLong(mydoJob.getInOrOut());
|
||||
if (jobIdNum > 20) {
|
||||
jobCallBack.setType("2");
|
||||
} else {
|
||||
jobCallBack.setType("1");
|
||||
}
|
||||
jobCallBack.setMydoJobId(mydoJob.getJobId());
|
||||
jobCallBack.setStatus("0");
|
||||
jobCallBack.setTaskNo(Convert.toLong(taskNo));
|
||||
jobCallBack.setCreateTime(new Date());
|
||||
jobCallBackService.insertJobCallBack(jobCallBack);
|
||||
mydoJobMapper.deleteMydoJobByTaskNo(taskNo);
|
||||
}
|
||||
MydoJob mydoJob = mydoJobMapper.selectMydoJobByTaskNo(taskNo);
|
||||
mydoJobMapper.insertHistory(mydoJob.getInOrOut());
|
||||
JobCallBack jobCallBack = new JobCallBack();
|
||||
jobCallBack.setType(mydoJob.getInOrOut());
|
||||
jobCallBack.setTaskTypeCode(WMS_TASK_TYPE_FINISH);// wms下发的任务类型
|
||||
jobCallBack.setMydoJobId(mydoJob.getJobId());
|
||||
jobCallBack.setStatus("0");
|
||||
jobCallBack.setTaskNo(Convert.toLong(mydoJob.getTaskNo()));
|
||||
jobCallBack.setCreateTime(new Date());
|
||||
jobCallBack.setTaskCode(mydoJob.getWmsTaskNo());
|
||||
jobCallBack.setRetry(0);
|
||||
jobCallBack.setReqCode(UUID.randomUUID().toString());
|
||||
jobCallBackService.insertJobCallBack(jobCallBack);
|
||||
|
||||
mydoJobMapper.deleteMydoJobByTaskNo(taskNo);
|
||||
|
||||
|
||||
return AjaxResult.success("操作成功");
|
||||
}
|
||||
@@ -280,6 +345,11 @@ public class MydoJobServiceImpl implements IMydoJobService
|
||||
return mydoJobMapper.selectMydoJobByExitId(exitId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MydoJob selectMydoJobByWmsTaskNo(String wmsTaskNo){
|
||||
return mydoJobMapper.selectMydoJobByWmsTaskNo(wmsTaskNo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MydoJob> selectMydoJobFinishList(MydoJob mydoJob) {
|
||||
return mydoJobMapper.selectMydoJobFinishList(mydoJob);
|
||||
@@ -327,5 +397,9 @@ public class MydoJobServiceImpl implements IMydoJobService
|
||||
return map.get("v_serial").toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MydoJob> selectMydoJobUnionList(MydoJob mydoJob) {
|
||||
return mydoJobMapper.selectMydoJobUnionList(mydoJob);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ public interface DdjDeviceExecutionQueueMapper
|
||||
* @return 结果
|
||||
*/
|
||||
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);
|
||||
|
||||
/**
|
||||
* 删除堆垛机执行队列
|
||||
*
|
||||
* @param taskNo 堆垛机执行队列主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDdjDeviceExecutionQueueByTaskNo(String taskNo);
|
||||
|
||||
/**
|
||||
* 批量删除堆垛机执行队列
|
||||
*
|
||||
|
||||
@@ -59,6 +59,14 @@ public interface IDdjDeviceExecutionQueueService
|
||||
*/
|
||||
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);
|
||||
}
|
||||
|
||||
public int deleteDdjDeviceExecutionQueueByTaskNo(String taskNo){
|
||||
return ddjDeviceExecutionQueueMapper.deleteDdjDeviceExecutionQueueByTaskNo(taskNo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除堆垛机执行队列信息
|
||||
*
|
||||
|
||||
@@ -72,9 +72,9 @@ public class PlcDdj1Read extends Thread {
|
||||
msgDdj.setYxxf(ParseUtil.optInt(24, ddsx));
|
||||
msgDdj.setXtxh(ParseUtil.optInt(26, ddsx));
|
||||
|
||||
msgDdj.setCurrentRow(ParseUtil.optInt(26, ddsx));
|
||||
msgDdj.setCurrentColumn(ParseUtil.optInt(26, ddsx));
|
||||
msgDdj.setCurrentFloor(ParseUtil.optInt(26, ddsx));
|
||||
msgDdj.setCurrentRow(ParseUtil.optInt(12, ddsx));
|
||||
msgDdj.setCurrentColumn(ParseUtil.optInt(14, ddsx));
|
||||
msgDdj.setCurrentFloor(ParseUtil.optInt(16, ddsx));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -119,7 +119,8 @@ public class PlcDdj1Read extends Thread {
|
||||
|
||||
void closeServer() {
|
||||
if (readWriteNet != null) {
|
||||
readWriteNet.ConnectClose();
|
||||
// readWriteNet.ConnectClose();
|
||||
siemensS7Net.ConnectClose();
|
||||
}
|
||||
setIsConnect(false);
|
||||
}
|
||||
|
||||
@@ -119,7 +119,8 @@ public class PlcDdj2Read extends Thread {
|
||||
|
||||
void closeServer() {
|
||||
if (readWriteNet != null) {
|
||||
readWriteNet.ConnectClose();
|
||||
// readWriteNet.ConnectClose();
|
||||
siemensS7Net.ConnectClose();
|
||||
}
|
||||
setIsConnect(false);
|
||||
}
|
||||
|
||||
@@ -108,9 +108,11 @@ public class PlcSsjRead implements Runnable {
|
||||
ssjDevice.setTaskNo(ParseUtil.optDInt(4, ddsx1));
|
||||
ssjDevice.setSszt(ParseUtil.optInt(8, ddsx1));
|
||||
ssjDevice.setRkqq(ParseUtil.optInt(10, ddsx1));
|
||||
ssjDevice.setTraySize(ParseUtil.optInt(12, ddsx1));
|
||||
ssjDevice.setHeight(ParseUtil.optInt(12, ddsx1));
|
||||
ssjDevice.setTraySize(ParseUtil.optInt(12, ddsx1)); //此处不修改device_ssj表,把托盘尺寸值当作高度使用
|
||||
ssjDevice.setTrayCode(ParseUtil.optString(14, ddsx1).replaceAll("\\s", ""));
|
||||
ssjDevice.setMode(ParseUtil.optInt(24, ddsx1));//todo 输送机操作模式
|
||||
ssjDevice.setException(ParseUtil.optInt(28, ddsx1));
|
||||
ssjDevice.setMode(ParseUtil.optInt(30, ddsx1));//todo 输送机操作模式
|
||||
}
|
||||
}
|
||||
|
||||
@@ -246,7 +248,8 @@ public class PlcSsjRead implements Runnable {
|
||||
|
||||
void closeServer() {
|
||||
if (readWriteNet != null) {
|
||||
readWriteNet.ConnectClose();
|
||||
// readWriteNet.ConnectClose();
|
||||
siemensS7Net.ConnectClose();
|
||||
}
|
||||
setIsConnect(false);
|
||||
}
|
||||
@@ -254,9 +257,13 @@ public class PlcSsjRead implements Runnable {
|
||||
public static int writeToSsj(String address, String taskNo, int qx , int completed) {
|
||||
|
||||
int jym = Tools.getJYM(Integer.parseInt(taskNo), qx);
|
||||
//任务号
|
||||
SendData taskNoSendData = new SendData(Tools.DINT, taskNo);
|
||||
//去向
|
||||
SendData qxSendData = new SendData(Tools.INT, qx);
|
||||
//下发完成
|
||||
SendData completedSendData = new SendData(Tools.INT, completed);
|
||||
//校验码
|
||||
SendData jymSendData = new SendData(Tools.INT, jym);
|
||||
byte[] bytes = Tools.sendData(taskNoSendData, qxSendData, completedSendData, jymSendData);
|
||||
return PlcSsjRead.WriteToSSJ(address, bytes);
|
||||
|
||||
@@ -0,0 +1,248 @@
|
||||
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.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.job.domain.MydoJob;
|
||||
import com.ruoyi.job.service.IJobCallBackService;
|
||||
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.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
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.WmsTaskTypeCode.WMS_TASK_TYPE_EXCEPTION;
|
||||
|
||||
/**
|
||||
* 处理wcs执行作业的定时任务类
|
||||
*/
|
||||
@Component
|
||||
@Slf4j
|
||||
public class TaskHandler {
|
||||
|
||||
@Autowired
|
||||
private IMydoJobService mydoJobService;
|
||||
@Autowired
|
||||
private IJobCallBackService jobCallBackService;
|
||||
@Autowired
|
||||
private IBasCargoSpaceService basCargoSpaceService;
|
||||
@Autowired
|
||||
private IApiService apiService;
|
||||
@Autowired
|
||||
private IDdjDeviceExecutionQueueService ddjDeviceExecutionQueueService;
|
||||
|
||||
|
||||
private static final int DEFAULTTIMEINTERVAL = 2000;
|
||||
|
||||
|
||||
/**
|
||||
* 处理未正常移除的【堆垛机执行完成】或【出库到位】的遗留任务
|
||||
*/
|
||||
// @Scheduled(fixedDelay = 3000)
|
||||
public void mydoJobHandler() {
|
||||
//查询所有标记为【已完成】的任务
|
||||
List<MydoJob> jobs = mydoJobService.selectMydoJobList(
|
||||
new MydoJob().builder().executionPhase(TASK_EP_FINISH).build()
|
||||
);
|
||||
if (!jobs.isEmpty()) {
|
||||
for (MydoJob job : jobs) {
|
||||
mydoJobService.taskFinish(Long.valueOf(job.getTaskNo()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 【手动作废】 - 查询并处理标记为已经作废的任务
|
||||
*/
|
||||
//@Scheduled(fixedDelay = 3000)
|
||||
public void cancelMydoJob(){
|
||||
List<MydoJob> jobs = mydoJobService.selectMydoJobList(
|
||||
new MydoJob().builder().status(TASK_STATUS_INVALID).build()
|
||||
);
|
||||
|
||||
if (!jobs.isEmpty()) {
|
||||
for (MydoJob job : jobs) {
|
||||
mydoJobService.ManuelTaskFinish(job.getTaskNo());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 【手动完成】 - 查询并处理标记为已经手动完成的任务
|
||||
*/
|
||||
//@Scheduled(fixedDelay = 3000)
|
||||
public void finishMydoJob(){
|
||||
List<MydoJob> jobs = mydoJobService.selectMydoJobList(
|
||||
new MydoJob().builder().status(TASK_STATUS_FINISH_MANUAL).build()
|
||||
);
|
||||
|
||||
if (!jobs.isEmpty()) {
|
||||
for (MydoJob job : jobs) {
|
||||
mydoJobService.ManuelTaskFinish(job.getTaskNo());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 定时扫描未回传或回传异常的任务记录
|
||||
*/
|
||||
@Scheduled(fixedDelay = 3000)
|
||||
public void jobCallBack() {
|
||||
jobCallBackService.jobCallBack();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 【入库异常-请求重分】 - 【放货有货】处理方法
|
||||
*/
|
||||
@Scheduled(fixedDelay = DEFAULTTIMEINTERVAL)
|
||||
public void stockinExceptionHandler() {
|
||||
List<MydoJob> jobs = mydoJobService.selectMydoJobList(
|
||||
new MydoJob().builder().executionPhase(TASK_EXCEPTION_PUT).build()
|
||||
);
|
||||
|
||||
if (!jobs.isEmpty()) {
|
||||
for (MydoJob job : jobs) {
|
||||
String oldCargo = job.getCargoSpaceId();
|
||||
//上报异常 - 向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);//wms自定义文本
|
||||
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);
|
||||
log.info("【入库异常】请求wms重分货位成功,异常货位:{},新货位:{},任务号:{}", oldCargo, mydoJobReAssign.getSiteCode(), job.getTaskNo());
|
||||
}else{
|
||||
log.info("【入库异常】请求wms重分货位异常,异常上报请求失败,请咨询操作管理员,异常货位:{},当前任务号:{}", oldCargo, job.getTaskNo());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 【出库异常】 - 【取货无货】处理方法
|
||||
*/
|
||||
@Scheduled(fixedDelay = DEFAULTTIMEINTERVAL)
|
||||
public void stockoutExceptionHandler() {
|
||||
List<MydoJob> jobs = mydoJobService.selectMydoJobList(
|
||||
new MydoJob().builder().executionPhase(TASK_EXCEPTION_PICK).build()
|
||||
);
|
||||
|
||||
if (!jobs.isEmpty()) {
|
||||
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(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());
|
||||
|
||||
log.info("【出库异常】堆垛机取货时目标位置无货,当前任务已作废,异常货位:{},任务号:{}", job.getCargoSpaceId(), job.getRoadwayId());
|
||||
}else{
|
||||
log.info("【出库异常】堆垛机取货时目标位置无货,异常上报请求失败,请咨询操作管理员,异常货位:{},任务号:{}", job.getCargoSpaceId(), job.getRoadwayId());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 【入库异常-重分完成】 - 堆垛机重新下发
|
||||
*/
|
||||
@Scheduled(fixedDelay = DEFAULTTIMEINTERVAL)
|
||||
public void sendTaskForStacker(){
|
||||
List<MydoJob> jobs = mydoJobService.selectMydoJobList(
|
||||
new MydoJob().builder().executionPhase(TASK_EXCEPTION_PUT_REASSIGN).build()
|
||||
);
|
||||
|
||||
if (!jobs.isEmpty()) {
|
||||
for (MydoJob job : jobs) {
|
||||
stackerTask(job);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 更新堆垛机任务队列 - 异常盘点重新下发
|
||||
* @param mydoJob
|
||||
*/
|
||||
public void stackerTask(MydoJob mydoJob) {
|
||||
//获取重分的货位重新向堆垛机下发任务
|
||||
BasCargoSpace basCargoSpace = basCargoSpaceService.selectBasCargoSpaceByWmsCargoSpaceId(mydoJob.getCargoSpaceId());
|
||||
DdjDeviceExecutionQueue ddjDeviceExecutionQueue =
|
||||
ddjDeviceExecutionQueueService.selectDdjDeviceExecutionQueueByRwh(Long.valueOf(mydoJob.getTaskNo()), Integer.valueOf(mydoJob.getRoadwayId()));
|
||||
ddjDeviceExecutionQueue.setMbph(basCargoSpace.getThePlatoon());
|
||||
ddjDeviceExecutionQueue.setMblh(basCargoSpace.getTheColumn());
|
||||
ddjDeviceExecutionQueue.setMbch(basCargoSpace.getTheFloor());
|
||||
ddjDeviceExecutionQueue.setDdjxf("0");
|
||||
ddjDeviceExecutionQueueService.updateDdjDeviceExecutionQueue(ddjDeviceExecutionQueue);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询正在执行的堆垛机队列是否为遗留记录 - 清理遗留队列数据
|
||||
*/
|
||||
// @Scheduled(fixedDelay = 30000)
|
||||
public void clearStackerQueue(){
|
||||
// ddjDeviceExecutionQueueService.se
|
||||
}
|
||||
|
||||
@PostConstruct
|
||||
public void mpTest(){
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -31,7 +31,8 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import static com.ruoyi.common.TaskExceptionType.TASK_EXCEPTION_STOCKIN_OCCUPIED;
|
||||
import static com.ruoyi.common.TaskStatusCode.TASK_EP_DDJ_FINISH;
|
||||
import static com.ruoyi.common.TaskStatusCode.*;
|
||||
import static com.ruoyi.common.WmsTaskTypeCode.WMS_TASK_TYPE_EXCEPTION;
|
||||
|
||||
|
||||
@Slf4j
|
||||
@@ -89,7 +90,7 @@ public class DdjThread implements Runnable {
|
||||
}
|
||||
}
|
||||
try {
|
||||
Thread.sleep(1500);
|
||||
Thread.sleep(3000);
|
||||
} catch (InterruptedException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
@@ -103,30 +104,33 @@ public class DdjThread implements Runnable {
|
||||
以防存在漏处理,没处理的情况发生
|
||||
*/
|
||||
|
||||
//非【联机自动】状态
|
||||
if (ddj.getCzfs() != 5) return;
|
||||
|
||||
// 检查当前堆垛机参数 - 是否有执行中的作业
|
||||
// 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();
|
||||
|
||||
//完成作业
|
||||
MydoJob mydoJob = mydoJobService.selectMydoJobByTaskNo(rwh);
|
||||
DdjDeviceExecutionQueue ddjDeviceExecutionQueue = ddjDeviceExecutionQueueService.selectDdjDeviceExecutionQueueByRwh(rwh,ddj.getId());
|
||||
|
||||
//满足上述条件,表示该任务已完成-执行任务回传
|
||||
//满足上述条件(【有实时任务】且【存在堆垛机执行队列】),表示该任务已完成-执行任务回传
|
||||
if (mydoJob != null && ddjDeviceExecutionQueue != null) {
|
||||
//标记为堆垛机执行完成
|
||||
mydoJob.setExecutionPhase(TASK_EP_DDJ_FINISH);
|
||||
mydoJobService.updateMydoJob(mydoJob);
|
||||
//回传完成信号 - 方法在存储过程【proc_mydojob_finish】中
|
||||
ddjTaskFinish(rwh, ddj.getId());
|
||||
log.info("【堆垛机入库】堆垛机:"+ddj.getId()+"任务完成,任务号:"+ddj.getRwh());
|
||||
log.info("【堆垛机执行】堆垛机编号:" + ddj.getId() + " 执行完成,任务结束,任务号:"+ddj.getRwh());
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------- 【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();
|
||||
@@ -141,104 +145,123 @@ public class DdjThread implements Runnable {
|
||||
}
|
||||
|
||||
/* -------------------------------------- 【3 放货有货,重新分配货位】-------------------------------------- */
|
||||
|
||||
// ddj.setCzfs(5);
|
||||
// ddj.setSbzt(1052);
|
||||
// ddj.setYxxf(1);
|
||||
// ddj.setJdbz(4);
|
||||
// ddj.setRwh(85015L);
|
||||
// 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();
|
||||
|
||||
//查村正在执行中的【任务号】获取堆垛机队列
|
||||
//查询正在执行中的【任务号】获取堆垛机队列
|
||||
MydoJob mydoJob = mydoJobService.selectMydoJobByTaskNo(rwh);
|
||||
DdjDeviceExecutionQueue ddjDeviceExecutionQueue = ddjDeviceExecutionQueueService.selectDdjDeviceExecutionQueueByRwh(rwh, ddj.getId());
|
||||
|
||||
//更新异常类型【FaultFlag】-1
|
||||
if ("0".equals(mydoJob.getFaultFlag()) && "1".equals(ddjDeviceExecutionQueue.getSpare1())) {
|
||||
mydoJob.setStatus("1");
|
||||
mydoJobService.updateMydoJob(mydoJob);
|
||||
|
||||
//上报异常 - 向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.setFaultFlag("2");
|
||||
if (mydoJob != null && mydoJob.getExecutionPhase() != TASK_EXCEPTION_PUT) {
|
||||
DdjDeviceExecutionQueue ddjDeviceExecutionQueue = ddjDeviceExecutionQueueService.selectDdjDeviceExecutionQueueByRwh(rwh, ddj.getId());
|
||||
//更新异常类型【FaultFlag】-1
|
||||
if ("0".equals(mydoJob.getFaultFlag()) && "1".equals(ddjDeviceExecutionQueue.getSpare1())) {
|
||||
mydoJob.setStatus("1");
|
||||
//把执行阶段标记为【入库放货有货】的异常
|
||||
mydoJob.setExecutionPhase(TASK_EXCEPTION_PUT);
|
||||
mydoJobService.updateMydoJob(mydoJob);
|
||||
log.info("【入库异常】堆垛机放货时目标位置有货,异常货位:{},任务号:{}", mydoJob.getCargoSpaceId(), rwh);
|
||||
}
|
||||
|
||||
//获取重分的货位重新向堆垛机下发任务
|
||||
BasCargoSpace basCargoSpace = basCargoSpaceService.selectBasCargoSpaceByWmsCargoSpaceId(mydoJob.getCargoSpaceId());
|
||||
ddjDeviceExecutionQueue.setMbph(basCargoSpace.getThePlatoon());
|
||||
ddjDeviceExecutionQueue.setMblh(basCargoSpace.getTheColumn());
|
||||
ddjDeviceExecutionQueue.setMbch(basCargoSpace.getTheFloor());
|
||||
ddjDeviceExecutionQueue.setDdjxf("0");
|
||||
ddjDeviceExecutionQueueService.updateDdjDeviceExecutionQueue(ddjDeviceExecutionQueue);
|
||||
}
|
||||
// //上报异常 - 向wms请求重分接口
|
||||
// TaskExceptionRequest taskExceptionRequest = new TaskExceptionRequest();
|
||||
// taskExceptionRequest.setTaskClass(mydoJob.getInOrOut().substring(0, 1));
|
||||
// taskExceptionRequest.setType(String.valueOf(TASK_EXCEPTION_STOCKIN_OCCUPIED));
|
||||
// taskExceptionRequest.setTaskCode(mydoJob.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("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 取货无货,作废当前任务,重新分配单据 --------------------------------------
|
||||
|
||||
//测试数据
|
||||
// ddj.setCzfs(5);
|
||||
// ddj.setSbzt(1053);
|
||||
// ddj.setYxxf(1);
|
||||
// ddj.setJdbz(3);
|
||||
// ddj.setRwh(Long.valueOf(51217));
|
||||
// ddj.setRwh(20021L);
|
||||
// ddj.setId(1);
|
||||
// 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();
|
||||
MydoJob mydoJob = mydoJobService.selectMydoJobByTaskNo(rwh);
|
||||
|
||||
//无货异常处理
|
||||
DdjDeviceExecutionQueue ddjDeviceExecutionQueue = ddjDeviceExecutionQueueService.selectDdjDeviceExecutionQueueByRwh(rwh,ddj.getId());
|
||||
|
||||
//找到对应任务 调用api接口 取货无货,重新分配单据
|
||||
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());
|
||||
}
|
||||
if (mydoJob != null && mydoJob.getExecutionPhase() != TASK_EXCEPTION_PICK) {
|
||||
//把执行阶段标记为【出库取货无货】的异常
|
||||
mydoJob.setExecutionPhase(TASK_EXCEPTION_PICK);
|
||||
mydoJobService.updateMydoJob(mydoJob);
|
||||
log.info("【出库异常】堆垛机取货时目标位置无货,异常货位:{},任务号:{}", mydoJob.getCargoSpaceId(), rwh);
|
||||
}
|
||||
|
||||
|
||||
// //无货异常处理
|
||||
// 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 下发堆垛机任务 --------------------------------------
|
||||
|
||||
//重分货位后重下
|
||||
if (ddj.getYxxf() == 1 && ddj.getCzfs() == 5 && ddj.getSbzt() == 1052) {
|
||||
if (ddj.getYxxf() == 1 && ddj.getSbzt() == 1052) {
|
||||
Long rwh = ddj.getRwh();
|
||||
|
||||
//查询执行中的作业
|
||||
@@ -260,16 +283,17 @@ public class DdjThread implements Runnable {
|
||||
ddjDeviceExecutionQueueService.updateDdjDeviceExecutionQueue(ddjDeviceExecutionQueue);
|
||||
mydoJob.setFaultFlag("0");
|
||||
mydoJobService.updateMydoJob(mydoJob);
|
||||
log.info("【入库异常】堆垛机放货目标有货,重分货位下发任务成功 rwh:{}", rwh);
|
||||
log.info("【入库异常】重分货位下发堆垛机任务成功,当前任务号:{}", rwh);
|
||||
} 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();
|
||||
DdjDeviceExecutionQueue ddjDeviceExecutionQueueRunningParam = new DdjDeviceExecutionQueue();
|
||||
@@ -278,7 +302,7 @@ public class DdjThread implements Runnable {
|
||||
ddjDeviceExecutionQueueRunningParam.setDevId(ddj.getId());
|
||||
List<DdjDeviceExecutionQueue> ddjDeviceExecutionRunningQueues = ddjDeviceExecutionQueueService.selectDdjDeviceExecutionQueueList(ddjDeviceExecutionQueueRunningParam);
|
||||
if (CollUtil.isNotEmpty(ddjDeviceExecutionRunningQueues)) {
|
||||
log.error("【提示】堆垛机有正在执行的任务 {}" , ddjDeviceExecutionRunningQueues.get(0).getRwh());
|
||||
log.error("【提示】堆垛机有正在执行的队列,任务号: {},请检查该任务号的wcs作业是否已经手动处理" , ddjDeviceExecutionRunningQueues.get(0).getRwh());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -297,9 +321,9 @@ public class DdjThread implements Runnable {
|
||||
ddjDeviceExecutionQueue.setXfsj(DateUtil.formatDateTime(DateUtil.date()));
|
||||
ddjDeviceExecutionQueue.setDdjxf("1");
|
||||
ddjDeviceExecutionQueueService.updateDdjDeviceExecutionQueue(ddjDeviceExecutionQueue);
|
||||
log.info("【执行成功】堆垛机下发任务成功 rwh:{}", ddjDeviceExecutionQueue.getRwh());
|
||||
log.info("【堆垛机执行】下发任务成功,任务执行中, 任务号:{}", ddjDeviceExecutionQueue.getRwh());
|
||||
} else {
|
||||
log.error("【执行异常】堆垛机下发任务失败!!!!!!!");
|
||||
log.error("【堆垛机执行】执行异常, 堆垛机下发任务失败!");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -342,9 +366,10 @@ public class DdjThread implements Runnable {
|
||||
int mbch = Convert.toInt(queue.getMbch());
|
||||
int mlfs = 5;
|
||||
int xfwc = 1;
|
||||
int rwlx = Convert.toInt(queue.getSpare1());
|
||||
int jym = Tools.getJYM(taskNo, yph, ylh, ych, mbph, mblh, mbch, mlfs, rwlx);
|
||||
byte[] sendData = Tools.sendDataToDevice(taskNo, null, yph, ylh, ych, mbph, mblh, mbch, mlfs, rwlx, xfwc, jym);
|
||||
int hwlx = Convert.toInt(queue.getSpare1());
|
||||
// int hwlx = 0;//默认值
|
||||
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){
|
||||
return PlcDdj1Read.WriteToDDJ("DB61.0", sendData);
|
||||
}else {
|
||||
|
||||
@@ -2,17 +2,19 @@ package com.ruoyi.schedule.scheduleTask.ssj;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.lang.UUID;
|
||||
import cn.hutool.core.util.ObjUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.ruoyi.api.domain.wcs2wms.stockin.StockinReceive;
|
||||
import com.ruoyi.api.service.IApiService;
|
||||
import com.ruoyi.api.service.IRequestLogService;
|
||||
import com.ruoyi.bas.cargospace.domain.BasCargoSpace;
|
||||
import com.ruoyi.bas.cargospace.service.IBasCargoSpaceService;
|
||||
import com.ruoyi.common.ConvException;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.utils.spring.SpringUtils;
|
||||
import com.ruoyi.device.ssj.domain.DeviceSsj;
|
||||
import com.ruoyi.job.domain.JobCallBack;
|
||||
import com.ruoyi.job.domain.MydoJob;
|
||||
import com.ruoyi.job.service.IJobCallBackService;
|
||||
import com.ruoyi.job.service.IMydoJobService;
|
||||
@@ -30,8 +32,8 @@ import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import static com.ruoyi.common.TaskStatusCode.*;
|
||||
import static com.ruoyi.common.TaskType.STOCKOUT;
|
||||
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;
|
||||
|
||||
/**
|
||||
@@ -48,6 +50,7 @@ public class PortConvThread implements Runnable {
|
||||
private IMydoJobService mydoJobService;
|
||||
private IJobCallBackService jobCallBackService;
|
||||
private IBasCargoSpaceService basCargoSpaceService;
|
||||
private IRequestLogService requestLogService;
|
||||
|
||||
|
||||
public boolean isRun = true;
|
||||
@@ -57,13 +60,14 @@ public class PortConvThread implements Runnable {
|
||||
ssjCodeList = new HashMap<>();
|
||||
ArrayList<String> ssjCodes = new ArrayList<>();
|
||||
ssjCodes.add("G1004");
|
||||
// ssjCodes.add("L1003");
|
||||
ssjCodes.add("TD1001");
|
||||
ssjCodeList.put("portConv", ssjCodes);
|
||||
apiService = SpringUtils.getBean(IApiService.class);
|
||||
// agvQueueService = SpringUtils.getBean(IAgvQueueService.class);
|
||||
mydoJobService = SpringUtils.getBean(IMydoJobService.class);
|
||||
jobCallBackService = SpringUtils.getBean(IJobCallBackService.class);
|
||||
basCargoSpaceService = SpringUtils.getBean(IBasCargoSpaceService.class);
|
||||
requestLogService = SpringUtils.getBean(IRequestLogService.class);
|
||||
// log.info("初始化服务 {},{}", apiService, agvQueueService);
|
||||
}
|
||||
|
||||
@@ -78,8 +82,13 @@ public class PortConvThread implements Runnable {
|
||||
for (String ssjCode : ssjCodeList.get(type)) {
|
||||
try {
|
||||
if (PlcSsjRead.deviceSsjMap.containsKey(ssjCode)) {
|
||||
inDispatch(PlcSsjRead.deviceSsjMap.get(ssjCode));
|
||||
// inDispatch1(PlcSsjRead.deviceSsjMap.get(ssjCode));
|
||||
if (ssjCode == "G1004"){
|
||||
inDispatch(PlcSsjRead.deviceSsjMap.get(ssjCode));
|
||||
}
|
||||
if (ssjCode == "TD1001"){
|
||||
outDispatch(PlcSsjRead.deviceSsjMap.get(ssjCode));
|
||||
}
|
||||
|
||||
} else {
|
||||
log.error("设备不存在 ssjCode:{}", ssjCode);
|
||||
}
|
||||
@@ -88,10 +97,11 @@ public class PortConvThread implements Runnable {
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
try {
|
||||
Thread.sleep(1500);
|
||||
Thread.sleep(3000);
|
||||
} catch (InterruptedException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
@@ -103,42 +113,49 @@ public class PortConvThread implements Runnable {
|
||||
public void inDispatch(DeviceSsj inSsjDevice) {
|
||||
// 测试数据
|
||||
// inSsjDevice.setInOrOut(1);
|
||||
// inSsjDevice.setTrayCode("T888888");
|
||||
// inSsjDevice.setTaskNo(85012);
|
||||
// inSsjDevice.setTrayCode("T000004503");
|
||||
// inSsjDevice.setTaskNo(777778);
|
||||
// inSsjDevice.setKx(0);
|
||||
// inSsjDevice.setDw(1);
|
||||
// inSsjDevice.setHeight("1");
|
||||
// inSsjDevice.setHeight(1);
|
||||
// inSsjDevice.setWeight("100");
|
||||
// inSsjDevice.setException(0);
|
||||
// inSsjDevice.setRkqq(1);
|
||||
|
||||
//todo 是否需要校验出入库模式
|
||||
switch (inSsjDevice.getInOrOut()) {
|
||||
//---------------------------入库模式---------------------------
|
||||
case 1:
|
||||
//---------------------------入口取输送机(叉车取放货位置)---------------------------
|
||||
//输送机【非空闲】、【输送到位】、【入库请求?】
|
||||
if (inSsjDevice.getKx() != 1 && inSsjDevice.getDw() == 1) {
|
||||
//输送机状态
|
||||
if (!convChecked(inSsjDevice)) return;
|
||||
|
||||
//更新入库任务阶段
|
||||
updateMydoJob(inSsjDevice);
|
||||
//请求wms获取入库任务
|
||||
requestMydoJob(inSsjDevice);
|
||||
|
||||
//请求wms获取入库任务
|
||||
requestMydoJob(inSsjDevice);
|
||||
|
||||
}
|
||||
break;
|
||||
//---------------------------出库模式---------------------------
|
||||
case 2:
|
||||
finishStockoutMydoJob(inSsjDevice);
|
||||
break;
|
||||
|
||||
}
|
||||
//更新入库任务阶段
|
||||
updateMydoJob(inSsjDevice);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 输送机到位判断校验
|
||||
* @param inSsjDevice
|
||||
* @return
|
||||
*/
|
||||
private boolean convChecked(DeviceSsj inSsjDevice){
|
||||
|
||||
boolean flag = false;
|
||||
//---------------------------入口取输送机(叉车取放货位置)---------------------------
|
||||
//输送机【条码】空
|
||||
if (inSsjDevice.getTrayCode() == "" || inSsjDevice.getTrayCode() == null) return flag;
|
||||
|
||||
//【入库请求】,表示输送到位和空闲
|
||||
if (inSsjDevice.getRkqq() != 1) return flag;
|
||||
|
||||
//【输送高度】
|
||||
if (inSsjDevice.getHeight() == 0) return flag;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 请求wms获取wcs任务参数
|
||||
@@ -146,117 +163,103 @@ public class PortConvThread implements Runnable {
|
||||
*/
|
||||
private void requestMydoJob(DeviceSsj inSsjDevice){
|
||||
|
||||
//校验:入库请求
|
||||
if (inSsjDevice.getRkqq() != 1) {
|
||||
//请求成功已经生成该任务则不继续执行
|
||||
int count = mydoJobService.selectInOrOutMydoJobList(
|
||||
new MydoJob().builder().trayCode(inSsjDevice.getTrayCode()).build()
|
||||
).size();
|
||||
|
||||
if (count > 0) {
|
||||
log.warn("【警告】已经存在该托盘号的入库作业,无法继续执行该托盘的入库请求,请稍后重试");
|
||||
writeToSsj(inSsjDevice.getPlcDbWriteAddress(), "99", 2, 1);
|
||||
return;
|
||||
}
|
||||
|
||||
int stockoutMydoJob = mydoJobService.selectMydoJobList(
|
||||
new MydoJob().builder().inOrOut(STOCKOUT).build()
|
||||
).size();
|
||||
|
||||
if (stockoutMydoJob > 0) {
|
||||
log.warn("【警告】已经存在执行中的出库作业,无法执行入库请求,请稍后重试");
|
||||
writeToSsj(inSsjDevice.getPlcDbWriteAddress(), "99", 2, 1);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
String errorMessage = "";
|
||||
|
||||
AjaxResult ajaxResult;
|
||||
|
||||
//请求参数
|
||||
//初始化请求wms参数
|
||||
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("cntCode", inSsjDevice.getTrayCode());//容器编号
|
||||
String height = inSsjDevice.getHeight();
|
||||
// String weight = inSsjDevice.getWeight();//todo 需要直读重量或从plc读值?
|
||||
paramMap.put("weight", getWeight(MOXA_IP, MOXA_PORT, SO_TIMEOUT_MS));//重量
|
||||
paramMap.put("cntCode", inSsjDevice.getTrayCode().trim());//容器编号
|
||||
int height = inSsjDevice.getHeight();
|
||||
// String weight = inSsjDevice.getWeight();//不需要直读重量或从plc读值,wms不需要该参数
|
||||
// paramMap.put("weight", getWeightByMoxa(MOXA_IP, MOXA_PORT, SO_TIMEOUT_MS));//重量
|
||||
paramMap.put("altimetry", height);//高度
|
||||
String errorMessage = "";
|
||||
paramMap.put("adverseCauses", 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();
|
||||
cargoSpace.setTrayCode(inSsjDevice.getTrayCode());
|
||||
if (!basCargoSpaceService.selectBasCargoSpaceList(cargoSpace).isEmpty()) {
|
||||
log.warn("【生成wcs任务异常】该托盘号已有库存,托盘条码:{}",inSsjDevice.getTrayCode());
|
||||
return;
|
||||
log.warn("【警告】该托盘号已有库存,托盘条码:{}",inSsjDevice.getTrayCode());
|
||||
}
|
||||
|
||||
//-----------------请求生成wcs任务-----------------
|
||||
|
||||
/*-----------------请求生成wcs任务----------------- */
|
||||
ajaxResult = apiService.createMydoJobForStockin(paramMap);
|
||||
if (ajaxResult.isSuccess()) {
|
||||
|
||||
//获取wms下发的任务号和分配货位
|
||||
//解析wms下发的响应参数(任务号和货位)
|
||||
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分配的货位(排列层)是否合法
|
||||
if (result.getSiteCode() == null || result.getSiteCode().isEmpty()) {
|
||||
log.info("【请求参数异常】分配货位:null,无法生成作业,托盘条码:{}",inSsjDevice.getTrayCode());
|
||||
if (ObjUtil.isNull(basCargoSpaceService.selectBasCargoSpaceByCargoSpaceId(result.getSiteCode()))) {
|
||||
errorMessage = "wms下发货位错误,任务生成失败!";
|
||||
paramMap.put("adverseCauses", errorMessage);
|
||||
apiService.createInMydoJobException(paramMap);
|
||||
log.info("【响应参数异常】分配货位:null,无法生成作业,托盘条码:{}",inSsjDevice.getTrayCode());
|
||||
writeToSsj(inSsjDevice.getPlcDbWriteAddress(), "99", 2, 1);
|
||||
return;
|
||||
}else {
|
||||
// mydoJob.setRoadwayId(basCargoSpaceService.selectBasCargoSpaceByWmsCargoSpaceId(mydoJob.getCargoSpaceId()).getRoadwayId());
|
||||
}
|
||||
|
||||
mydoJob.setStatus("1");
|
||||
mydoJob.setInOrOut("1");
|
||||
mydoJob.setRoadwayId("1");
|
||||
mydoJob.setEntranceId("G1004");
|
||||
mydoJob.setExecutionPhase(TASK_EP_CREATE);
|
||||
mydoJob.setCreateTime(new Date());
|
||||
// mydoJob.setTraySize(Convert.toStr(inSsjDevice.getTraySize()));
|
||||
mydoJob.setFaultFlag("0");
|
||||
mydoJob.setPriority(10L);
|
||||
//初始化要生成的任务
|
||||
MydoJob mydoJob = new MydoJob().builder()
|
||||
// mydoJob.setTaskNo(result.getTaskCode());//如果需要用wms下发的任务号作为wcs的任务号使用
|
||||
.trayCode(result.getCntCode())
|
||||
.cargoSpaceId(result.getSiteCode())
|
||||
.wmsTaskNo(result.getTaskCode())
|
||||
.jobId(mydoJobService.getJobId("RK"))
|
||||
.taskNo(mydoJobService.getTaskNo("1"))
|
||||
.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任务 - 生成一条任务
|
||||
if (mydoJobService.selectInOrOutMydoJobList(mydoJob).isEmpty()) {
|
||||
mydoJobService.insertMydoJob(mydoJob);
|
||||
log.info("【入库请求】请求生成wcs作业成功,wms下发任务单号:{}, 任务号:{},托盘条码:{},分配货位:{}", mydoJob.getJobId(), mydoJob.getTaskNo(), mydoJob.getTrayCode(), mydoJob.getCargoSpaceId());
|
||||
log.info("【入库请求】请求生成wcs作业成功,wms任务号:{}, wcs任务号:{},托盘条码:{},分配货位:{}", mydoJob.getWmsTaskNo(), mydoJob.getTaskNo(), mydoJob.getTrayCode(), mydoJob.getCargoSpaceId());
|
||||
}
|
||||
|
||||
}else{
|
||||
//请求生成wcs任务失败
|
||||
//todo 向输送机下发退回
|
||||
int i = writeToSsj(inSsjDevice.getPlcDbWriteAddress(), "99", 99, 1);
|
||||
|
||||
//todo 接口调用失败处理
|
||||
log.info("【入库请求】请求生成wcs作业失败退回,请重试,响应内容:{}", ajaxResult.get("data").toString());
|
||||
// 接口调用失败处理
|
||||
log.info("【入库请求】请求生成wcs作业失败退回,请检查网络或请求参数,请求内容:{}", JSON.toJSONString(paramMap));
|
||||
log.info("【错误信息】{}", requestLogService.selectRequestLogByLatestTask().getErrorDetails());
|
||||
|
||||
// 请求生成wcs任务失败
|
||||
// 向输送机下发退回
|
||||
int i = writeToSsj(inSsjDevice.getPlcDbWriteAddress(), "99", 2, 1);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -267,39 +270,43 @@ public class PortConvThread implements Runnable {
|
||||
*/
|
||||
private void updateMydoJob(DeviceSsj inSsjDevice){
|
||||
|
||||
//检查是否有已经创建成功的任务 - 更新到下一个执行阶段
|
||||
MydoJob mydoJobStockin = new MydoJob();
|
||||
mydoJobStockin.setTrayCode(inSsjDevice.getTrayCode());
|
||||
mydoJobStockin.setExecutionPhase(TASK_EP_CREATE);
|
||||
if(mydoJobService.selectMydoJobList(mydoJobStockin).isEmpty()){
|
||||
//输送机扫描有条码但无任务
|
||||
log.info("【异常任务】请检查条码扫描结果与托盘实际条码是否一致,扫描条码:{}", inSsjDevice.getTrayCode());
|
||||
}else{
|
||||
//检查是否有已经创建成功的任务(请求成功的入库任务) - 更新到下一个执行阶段
|
||||
MydoJob mydoJobStockin = new MydoJob().builder()
|
||||
.trayCode(inSsjDevice.getTrayCode())
|
||||
.status(TASK_STATUS_CREATED)
|
||||
.executionPhase(TASK_EP_CREATED)
|
||||
.build();
|
||||
if(!mydoJobService.selectMydoJobList(mydoJobStockin).isEmpty()){
|
||||
mydoJobStockin = mydoJobService.selectMydoJobList(mydoJobStockin).get(0);
|
||||
//如果已经生成入库任务 - 向输送机下发任务号
|
||||
//todo 调整输送去向值
|
||||
int i = writeToSsj(inSsjDevice.getPlcDbWriteAddress(), mydoJobStockin.getTaskNo(), Integer.parseInt(mydoJobStockin.getTraySize()), 1);
|
||||
//输送去向值【1】
|
||||
int i = writeToSsj(inSsjDevice.getPlcDbWriteAddress(), mydoJobStockin.getTaskNo(), 1, 1);
|
||||
// int i = 1;
|
||||
if (i == 1) {
|
||||
//写入成功则更新执行阶段
|
||||
mydoJobStockin.setStatus(TASK_STATUS_RUNNING);
|
||||
mydoJobStockin.setExecutionPhase(TASK_EP_SSJ);
|
||||
mydoJobStockin.setStartTime(DateUtil.formatDateTime(DateUtil.date()));
|
||||
mydoJobService.updateMydoJob(mydoJobStockin);
|
||||
log.info("【更新状态】G1004入口输送机下发任务号成功:{}", mydoJobStockin.getTaskNo());
|
||||
log.info("【更新状态】G1004入口输送机下发成功,任务号:{},入库执行中", mydoJobStockin.getTaskNo());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 输送机出库到位 - 任务出库完成
|
||||
* @param inSsjDevice
|
||||
* 出库完成在升降位置,即【TD1001】判断完成
|
||||
* @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) {
|
||||
log.info("【出库到位】设备:{},位置:{},任务号:{},出库到位", "输送线:", inSsjDevice.getDeviceCode(), mydoJob.getTaskNo());
|
||||
log.info("【出库完成】去向:{},出库货位:{},任务号:{},出库到位", "任务结束", outSsjDevice.getDeviceCode(),mydoJob.getCargoSpaceId() , mydoJob.getTaskNo());
|
||||
mydoJob.setExecutionPhase(TASK_EP_SSJ_STOCKOUT_FINISH);
|
||||
mydoJobService.updateMydoJob(mydoJob);
|
||||
mydoJobService.taskFinish(Long.valueOf(mydoJob.getTaskNo()));
|
||||
@@ -319,13 +326,16 @@ public class PortConvThread implements Runnable {
|
||||
|
||||
/**
|
||||
* 从 MOXA NPort 5110(TCP Server 模式)读取单次称重值
|
||||
* ************测试方法************
|
||||
* ************测试方法************
|
||||
* ************测试方法************
|
||||
*
|
||||
* @param moxaIp MOXA 设备 IP(如 "192.168.1.200")
|
||||
* @param moxaPort MOXA 配置的 TCP 端口(如 4001)
|
||||
* @param timeout 最大等待时间(单位:毫秒),建议 2000~5000
|
||||
* @return 重量(kg),成功时为非 NaN 的 Double;失败(超时/断连/解析失败)返回 null
|
||||
*/
|
||||
public static Double getWeight(String moxaIp, int moxaPort, long timeout) {
|
||||
public static Double getWeightByMoxa(String moxaIp, int moxaPort, long timeout) {
|
||||
Socket socket = null;
|
||||
try {
|
||||
// 1️⃣ - 建立连接(带连接超时)
|
||||
@@ -378,6 +388,7 @@ public class PortConvThread implements Runnable {
|
||||
|
||||
|
||||
public void inDispatch1(DeviceSsj ssjDevice) {
|
||||
|
||||
//有入库请求就肯定是电气的任务号的作业
|
||||
if(StrUtil.isNotBlank(ssjDevice.getTrayCode()) && ssjDevice.getRkqq()==1 && ssjDevice.getTaskNo()<1000){
|
||||
//,如果有正执行的出库作业退回
|
||||
@@ -422,7 +433,7 @@ public class PortConvThread implements Runnable {
|
||||
if(ajaxResult.isSuccess()){
|
||||
MydoJob mydoJob2 = BeanUtil.toBean(ajaxResult.get("data"), MydoJob.class);
|
||||
mydoJob2.setStatus("1");
|
||||
mydoJob2.setExecutionPhase(TASK_EP_CREATE);
|
||||
mydoJob2.setExecutionPhase(TASK_EP_CREATED);
|
||||
mydoJob2.setCreateTime(new Date());
|
||||
mydoJob2.setFaultFlag("0");
|
||||
mydoJob2.setPriority(10L);
|
||||
@@ -446,6 +457,20 @@ public class PortConvThread implements Runnable {
|
||||
|
||||
}
|
||||
|
||||
public void outDispatch(DeviceSsj ssjDevice) {
|
||||
|
||||
//出库完成
|
||||
finishStockoutMydoJob(ssjDevice);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private static final Map<String, Pattern> PATTERNS = createPatterns();
|
||||
|
||||
private static Map<String, Pattern> createPatterns() {
|
||||
|
||||
@@ -9,6 +9,7 @@ import cn.hutool.core.util.ObjUtil;
|
||||
import com.ruoyi.api.service.IApiService;
|
||||
import com.ruoyi.bas.cargospace.domain.BasCargoSpace;
|
||||
import com.ruoyi.bas.cargospace.service.IBasCargoSpaceService;
|
||||
import com.ruoyi.common.TaskType;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.utils.spring.SpringUtils;
|
||||
import com.ruoyi.device.ssj.domain.DeviceSsj;
|
||||
@@ -22,6 +23,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import static com.ruoyi.common.ConvType.*;
|
||||
import static com.ruoyi.common.TaskStatusCode.*;
|
||||
import static com.ruoyi.common.TaskType.*;
|
||||
|
||||
@@ -54,7 +56,7 @@ public class RoadConvThread implements Runnable {
|
||||
ddjDeviceExecutionQueueService = SpringUtils.getBean(IDdjDeviceExecutionQueueService.class);
|
||||
//初始化巷道口 排 列 层
|
||||
//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));
|
||||
log.info("初始化服务 {},{}", apiService, agvQueueService);
|
||||
}
|
||||
@@ -148,14 +150,17 @@ public class RoadConvThread implements Runnable {
|
||||
ddjDeviceExecutionQueue.setMbch(Convert.toInt(basCargoSpace.getTheFloor()));
|
||||
ddjDeviceExecutionQueue.setDdjxf("0");
|
||||
ddjDeviceExecutionQueue.setMlfs(5);
|
||||
// ddjDeviceExecutionQueue.setSpare1(mydoJob.getTraySize());
|
||||
ddjDeviceExecutionQueue.setSpare1(mydoJob.getTraySize());//货物高度
|
||||
ddjDeviceExecutionQueue.setScsj(DateUtil.formatDateTime(DateUtil.date()));
|
||||
ddjDeviceExecutionQueue.setRwlx(DDJ_RWLX_3);
|
||||
ddjDeviceExecutionQueueService.insertDdjDeviceExecutionQueue(ddjDeviceExecutionQueue);
|
||||
|
||||
//下发后更新任务阶段
|
||||
mydoJob.setExecutionPhase(TASK_EP_DDJ);
|
||||
mydoJobService.updateMydoJob(mydoJob);
|
||||
if (ddjDeviceExecutionQueueService.selectDdjDeviceExecutionQueueList(ddjDeviceExecutionQueue).size() > 0){
|
||||
//下发后更新任务阶段
|
||||
mydoJob.setExecutionPhase(TASK_EP_DDJ);
|
||||
mydoJobService.updateMydoJob(mydoJob);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -169,59 +174,66 @@ public class RoadConvThread implements Runnable {
|
||||
private void sendStackerOut(DeviceSsj roadSsjDevice){
|
||||
//---------------------------出库任务---------------------------
|
||||
//检查巷道口输送机是否空闲
|
||||
if(roadSsjDevice.getKx()==1 && roadSsjDevice.getTaskNo() == 0){
|
||||
if(roadSsjDevice.getKx()!=1 || roadSsjDevice.getTaskNo() != 0) return;
|
||||
|
||||
//检查是否有入口是【G1004】的入库任务
|
||||
String exitId = "G1004";
|
||||
List<MydoJob> inList = mydoJobService.getInJobByEntranceId(exitId);
|
||||
//检查是否有入口是【TD1001-出库到位输送机】的入库任务 - 此处查询作用:如果已经有入库任务,则只可生成出库作业,不可生成堆垛机队列
|
||||
String exitId = CONV_STOCKOUT;
|
||||
List<MydoJob> jobs = mydoJobService.selectMydoJobList(
|
||||
new MydoJob().builder().inOrOut(STOCKIN).build()
|
||||
);
|
||||
|
||||
if(inList.size() == 0){
|
||||
if(jobs.size() != 0) {
|
||||
log.info("【提示】当前出口"+ exitId +"有正在执行的任务,无法执行堆垛机出库,请等待执行的入库任务结束");
|
||||
return;
|
||||
}
|
||||
|
||||
//检查是否有出库任务
|
||||
MydoJob mydoJob = mydoJobService.selectMydoJobByExitId(exitId);
|
||||
if (ObjUtil.isNotNull(mydoJob)) {
|
||||
//检查是否有出库任务
|
||||
MydoJob mydoJob = mydoJobService.selectMydoJobByExitId(exitId);
|
||||
if (ObjUtil.isNotNull(mydoJob)) {
|
||||
|
||||
//如果有出库任务 - 检查货位编码是否合法
|
||||
BasCargoSpace basCargoSpace = basCargoSpaceService.selectBasCargoSpaceByWmsCargoSpaceId(mydoJob.getCargoSpaceId());
|
||||
if (ObjUtil.isNull(basCargoSpace)) {
|
||||
log.error("【任务异常】货位不存在 cargoSpaceId{}", mydoJob.getCargoSpaceId());
|
||||
} else {
|
||||
//生成队列
|
||||
List<DdjDeviceExecutionQueue> list = ddjDeviceExecutionQueueService.selectDdjDeviceExecutionQueueListByRwlx(DDJ_RWLX_2, Convert.toInt(mydoJob.getRoadwayId()));
|
||||
List<Integer> pclList = roadwayMap.get(roadSsjDevice.getDeviceCode());
|
||||
if (CollUtil.isEmpty(list) && CollUtil.isNotEmpty(pclList)) {
|
||||
DdjDeviceExecutionQueue ddjDeviceExecutionQueue = new DdjDeviceExecutionQueue();
|
||||
ddjDeviceExecutionQueue.setUuid(IdUtil.simpleUUID());
|
||||
ddjDeviceExecutionQueue.setRwh(Convert.toLong(mydoJob.getTaskNo()));
|
||||
ddjDeviceExecutionQueue.setDevName(mydoJob.getRoadwayId());
|
||||
ddjDeviceExecutionQueue.setDevId(Convert.toInt(mydoJob.getRoadwayId()));
|
||||
ddjDeviceExecutionQueue.setRwzt(0);
|
||||
ddjDeviceExecutionQueue.setYph(Convert.toInt(basCargoSpace.getThePlatoon()));
|
||||
ddjDeviceExecutionQueue.setYlh(Convert.toInt(basCargoSpace.getTheColumn()));
|
||||
ddjDeviceExecutionQueue.setYch(Convert.toInt(basCargoSpace.getTheFloor()));
|
||||
ddjDeviceExecutionQueue.setMbph(pclList.get(0));
|
||||
ddjDeviceExecutionQueue.setMblh(pclList.get(1));
|
||||
ddjDeviceExecutionQueue.setMbch(pclList.get(2));
|
||||
ddjDeviceExecutionQueue.setDdjxf("0");
|
||||
ddjDeviceExecutionQueue.setMlfs(5);
|
||||
ddjDeviceExecutionQueue.setSpare1(mydoJob.getTraySize());
|
||||
ddjDeviceExecutionQueue.setScsj(DateUtil.formatDateTime(DateUtil.date()));
|
||||
ddjDeviceExecutionQueue.setRwlx(DDJ_RWLX_2);
|
||||
ddjDeviceExecutionQueueService.insertDdjDeviceExecutionQueue(ddjDeviceExecutionQueue);
|
||||
//如果有出库任务 - 检查货位编码是否合法
|
||||
BasCargoSpace basCargoSpace = basCargoSpaceService.selectBasCargoSpaceByWmsCargoSpaceId(mydoJob.getCargoSpaceId());
|
||||
if (ObjUtil.isNull(basCargoSpace)) {
|
||||
log.error("【任务异常】货位不存在 cargoSpaceId{}", mydoJob.getCargoSpaceId());
|
||||
return;
|
||||
}
|
||||
|
||||
//修改作业状态
|
||||
mydoJob.setStatus(TASK_STATUS_RUNNING);
|
||||
mydoJob.setExecutionPhase(TASK_EP_DDJ);
|
||||
mydoJob.setStartTime(DateUtil.formatDateTime(DateUtil.date()));
|
||||
mydoJobService.updateMydoJob(mydoJob);
|
||||
}
|
||||
}
|
||||
}
|
||||
}else{
|
||||
log.info("【出库警告】当前出口"+ exitId +"存在入库任务,无法出库!");
|
||||
//生成队列
|
||||
List<DdjDeviceExecutionQueue> list = ddjDeviceExecutionQueueService.selectDdjDeviceExecutionQueueListByRwlx(DDJ_RWLX_2, Convert.toInt(mydoJob.getRoadwayId()));
|
||||
List<Integer> pclList = roadwayMap.get(roadSsjDevice.getDeviceCode());
|
||||
if (CollUtil.isEmpty(list) && CollUtil.isNotEmpty(pclList)) {
|
||||
DdjDeviceExecutionQueue ddjDeviceExecutionQueue = new DdjDeviceExecutionQueue();
|
||||
ddjDeviceExecutionQueue.setUuid(IdUtil.simpleUUID());
|
||||
ddjDeviceExecutionQueue.setRwh(Convert.toLong(mydoJob.getTaskNo()));
|
||||
ddjDeviceExecutionQueue.setDevName(mydoJob.getRoadwayId());
|
||||
ddjDeviceExecutionQueue.setDevId(Convert.toInt(mydoJob.getRoadwayId()));
|
||||
ddjDeviceExecutionQueue.setRwzt(0);
|
||||
ddjDeviceExecutionQueue.setYph(Convert.toInt(basCargoSpace.getThePlatoon()));
|
||||
ddjDeviceExecutionQueue.setYlh(Convert.toInt(basCargoSpace.getTheColumn()));
|
||||
ddjDeviceExecutionQueue.setYch(Convert.toInt(basCargoSpace.getTheFloor()));
|
||||
ddjDeviceExecutionQueue.setMbph(pclList.get(0));
|
||||
ddjDeviceExecutionQueue.setMblh(pclList.get(1));
|
||||
ddjDeviceExecutionQueue.setMbch(pclList.get(2));
|
||||
ddjDeviceExecutionQueue.setDdjxf("0");
|
||||
ddjDeviceExecutionQueue.setMlfs(5);
|
||||
ddjDeviceExecutionQueue.setSpare1(mydoJob.getTraySize());//货物高度
|
||||
ddjDeviceExecutionQueue.setScsj(DateUtil.formatDateTime(DateUtil.date()));
|
||||
ddjDeviceExecutionQueue.setRwlx(DDJ_RWLX_2);
|
||||
ddjDeviceExecutionQueueService.insertDdjDeviceExecutionQueue(ddjDeviceExecutionQueue);
|
||||
//修改作业状态
|
||||
mydoJob.setStatus(TASK_STATUS_RUNNING);
|
||||
mydoJob.setExecutionPhase(TASK_EP_DDJ);
|
||||
mydoJob.setStartTime(DateUtil.formatDateTime(DateUtil.date()));
|
||||
mydoJobService.updateMydoJob(mydoJob);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -12,9 +12,9 @@ spring:
|
||||
# password: Flrd0914.
|
||||
|
||||
# 本机
|
||||
url: jdbc:sqlserver://localhost:1433;databaseName=FT568-wcs;encrypt=true;trustServerCertificate=true;
|
||||
url: jdbc:sqlserver://127.0.0.1:1433;databaseName=FT568-wcs;encrypt=true;trustServerCertificate=true;
|
||||
username: sa
|
||||
password: 123456
|
||||
password: Aa123456
|
||||
|
||||
# 生产
|
||||
# url: jdbc:sqlserver://192.168.58.10:1433;databaseName=FT568-wcs;encrypt=true;trustServerCertificate=true;
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
<charset>UTF-8</charset>
|
||||
</encoder>
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<!-- 过滤的级别 -->
|
||||
@@ -46,6 +47,7 @@
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
<charset>UTF-8</charset>
|
||||
</encoder>
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<!-- 过滤的级别 -->
|
||||
@@ -56,6 +58,29 @@
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<appender name="file_warn" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/sys-warn.log</file>
|
||||
<!-- 循环政策:基于时间创建日志文件 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 日志文件名格式 -->
|
||||
<fileNamePattern>${log.path}/sys-warn.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<!-- 日志最大的历史 60天 -->
|
||||
<maxHistory>60</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
<charset>UTF-8</charset>
|
||||
</encoder>
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<!-- 过滤的级别 -->
|
||||
<level>WARN</level>
|
||||
<!-- 匹配时的操作:接收(记录) -->
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<!-- 用户访问日志输出 -->
|
||||
<appender name="sys-user" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
@@ -83,6 +108,7 @@
|
||||
<!--系统操作日志-->
|
||||
<root level="info">
|
||||
<appender-ref ref="file_info" />
|
||||
<appender-ref ref="file_warn" />
|
||||
<appender-ref ref="file_error" />
|
||||
</root>
|
||||
|
||||
|
||||
@@ -29,6 +29,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<select id="selectRequestLogList" parameterType="RequestLog" resultMap="RequestLogResult">
|
||||
<include refid="selectRequestLogVo"/>
|
||||
<where>
|
||||
<!-- 只查最近14天 -->
|
||||
and request_time >= DATEADD(DAY, -14, CAST(GETDATE() AS DATE))
|
||||
<if test="requestTime != null and requestTime != ''"> and request_time = #{requestTime}</if>
|
||||
<if test="sourceSystem != null and sourceSystem != ''"> and source_system = #{sourceSystem}</if>
|
||||
<if test="targetSystem != null and targetSystem != ''"> and target_system = #{targetSystem}</if>
|
||||
@@ -47,6 +49,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
order by request_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectRequestLogByLatestTask" resultMap="RequestLogResult">
|
||||
select top 1 request_id, request_time, source_system, target_system, endpoint, request_url, request_method, request_headers, request_body, response_time, response_body, response_status, error_details, duration, Is_successful from request_log
|
||||
order by request_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectRequestLogByRequestId" parameterType="Long" resultMap="RequestLogResult">
|
||||
<include refid="selectRequestLogVo"/>
|
||||
where request_id = #{requestId}
|
||||
@@ -121,4 +128,5 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
#{requestId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -14,10 +14,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="reqCode" column="req_code" />
|
||||
<result property="taskTypeCode" column="task_type_code" />
|
||||
<result property="taskCode" column="task_code" />
|
||||
<result property="retry" column="retry" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectJobCallBackVo">
|
||||
select id, type, task_no, mydoJob_Id, status, create_time,req_code,task_type_code,task_code from job_call_back
|
||||
select id, type, task_no, mydoJob_Id, status, create_time, req_code, task_type_code, task_code, retry from job_call_back
|
||||
</sql>
|
||||
|
||||
<select id="selectJobCallBackList" parameterType="JobCallBack" resultMap="JobCallBackResult">
|
||||
@@ -30,6 +31,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="reqCode != null and reqCode != ''"> and req_code = #{reqCode}</if>
|
||||
<if test="taskTypeCode != null and taskTypeCode != ''"> and task_type_code = #{taskTypeCode}</if>
|
||||
<if test="taskCode != null and taskCode != ''"> and task_code = #{taskCode}</if>
|
||||
<if test="retry != null and retry != ''"> and retry = #{retry}</if>
|
||||
|
||||
</where>
|
||||
</select>
|
||||
|
||||
@@ -39,10 +42,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</select>
|
||||
<select id="selectJobCallBackListNoSuccess" resultMap="JobCallBackResult">
|
||||
<include refid="selectJobCallBackVo"/>
|
||||
where status != '1'
|
||||
where status != '1' and retry < 10
|
||||
</select>
|
||||
|
||||
<insert id="insertJobCallBack" parameterType="JobCallBack" useGeneratedKeys="true" keyProperty="id">
|
||||
<insert id="insertJobCallBack" parameterType="JobCallBack" useGeneratedKeys="false" keyProperty="id">
|
||||
insert into job_call_back
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="type != null">type,</if>
|
||||
@@ -53,6 +56,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="reqCode != null">req_code,</if>
|
||||
<if test="taskTypeCode != null">task_type_code,</if>
|
||||
<if test="taskCode != null">task_code,</if>
|
||||
<if test="retry != null">retry,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="type != null">#{type},</if>
|
||||
@@ -63,6 +67,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="reqCode != null">#{reqCode},</if>
|
||||
<if test="taskTypeCode != null">#{taskTypeCode},</if>
|
||||
<if test="taskCode != null">#{taskCode},</if>
|
||||
<if test="retry != null">#{retry},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
@@ -77,6 +82,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="reqCode != null">req_code = #{reqCode},</if>
|
||||
<if test="taskTypeCode != null">task_type_code = #{taskTypeCode},</if>
|
||||
<if test="taskCode != null">task_code = #{taskCode},</if>
|
||||
<if test="retry != null">retry = #{retry},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
@@ -93,7 +99,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</delete>
|
||||
|
||||
<select id="getTopJobCallBack" resultMap="JobCallBackResult">
|
||||
select top(1) id, type, task_no, mydoJob_Id, status, create_time,req_code,task_type_code,task_code from job_call_back
|
||||
select top(1) id, type, task_no, mydoJob_Id, status, create_time,req_code,task_type_code,task_code,retry from job_call_back
|
||||
where status = '0' and spare1 in ('0','1','2')
|
||||
order by create_time asc
|
||||
</select>
|
||||
|
||||
@@ -31,10 +31,61 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<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
|
||||
</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">
|
||||
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 id="selectMydoJobUnion">
|
||||
SELECT * FROM (
|
||||
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,'mydo_job_wcs' AS source_table
|
||||
FROM mydo_job_wcs
|
||||
UNION ALL
|
||||
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,'mydo_job_wcs_finish' AS source_table
|
||||
FROM mydo_job_wcs_finish
|
||||
)
|
||||
AS combined_jobs
|
||||
</sql>
|
||||
|
||||
<select id="selectMydoJobUnionList" parameterType="MydoJob" resultMap="MydoJobResult">
|
||||
<include refid="selectMydoJobUnion"/>
|
||||
<where>
|
||||
<if test="status != null and status != ''">and status = #{status}</if>
|
||||
<if test="taskNo != null and taskNo != ''">and task_no = #{taskNo}</if>
|
||||
<if test="roadwayId != null and roadwayId != ''">and roadway_id = #{roadwayId}</if>
|
||||
<if test="cargoSpaceId != null and cargoSpaceId != ''">and cargo_space_id = #{cargoSpaceId}</if>
|
||||
<if test="targetRoadwayId != null and targetRoadwayId != ''">and target_roadway_id = #{targetRoadwayId}
|
||||
</if>
|
||||
<if test="targetCargoSpaceId != null and targetCargoSpaceId != ''">and target_cargo_space_id =
|
||||
#{targetCargoSpaceId}
|
||||
</if>
|
||||
<if test="priority != null ">and priority = #{priority}</if>
|
||||
<if test="executionPhase != null and executionPhase != ''">and execution_phase = #{executionPhase}</if>
|
||||
<if test="inOrOut != null and inOrOut != ''">and in_or_out = #{inOrOut}</if>
|
||||
<if test="startTime != null and startTime != ''">and start_time = #{startTime}</if>
|
||||
<if test="finishTime != null and finishTime != ''">and finish_time = #{finishTime}</if>
|
||||
<if test="entranceId != null and entranceId != ''">and entrance_id = #{entranceId}</if>
|
||||
<if test="exitId != null and exitId != ''">and exit_id = #{exitId}</if>
|
||||
<if test="warehouseId != null and warehouseId != ''">and warehouse_id = #{warehouseId}</if>
|
||||
<if test="faultFlag != null and faultFlag != ''">and fault_flag = #{faultFlag}</if>
|
||||
<if test="flag != null and flag != ''">and flag = #{flag}</if>
|
||||
<if test="trayCode != null and trayCode != ''">and tray_code = #{trayCode}</if>
|
||||
<if test="traySize != null and traySize != ''">and traySize = #{tray_size}</if>
|
||||
<if test="epList != null and epList.size() > 0">
|
||||
and entrance_id in
|
||||
<foreach item="item" index="index" collection="epList" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="wmsTaskNo != null and wmsTaskNo != ''">and wms_task_no = #{wmsTaskNo}</if>
|
||||
</where>
|
||||
ORDER BY create_time DESC,finish_time DESC;
|
||||
</select>
|
||||
|
||||
<select id="selectMydoJobList" parameterType="MydoJob" resultMap="MydoJobResult">
|
||||
<include refid="selectMydoJobVo"/>
|
||||
<where>
|
||||
@@ -273,13 +324,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</select>
|
||||
|
||||
<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}
|
||||
and in_or_out > 20
|
||||
and in_or_out = 2
|
||||
and status = 1 and execution_phase= 0
|
||||
order by priority asc,create_time asc
|
||||
</select>
|
||||
|
||||
<select id="selectMydoJobByWmsTaskNo" parameterType="java.lang.String" resultMap="MydoJobResult">
|
||||
<include refid="selectMydoJobVo"/>
|
||||
where wms_task_no = #{wmsTaskNo}
|
||||
</select>
|
||||
|
||||
<select id="selectMydoJobFinishList" resultMap="MydoJobResult">
|
||||
<include refid="selectMydoJobFinishVo"/>
|
||||
<where>
|
||||
@@ -289,7 +345,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="cargoSpaceId != null and cargoSpaceId != ''"> and cargo_space_id = #{cargoSpaceId}</if>
|
||||
<if test="targetRoadwayId != null and targetRoadwayId != ''"> and target_roadway_id = #{targetRoadwayId}</if>
|
||||
<if test="targetCargoSpaceId != null and targetCargoSpaceId != ''"> and target_cargo_space_id = #{targetCargoSpaceId}</if>
|
||||
<if test="priority != null "> and priority = #{priority}</if>
|
||||
<if test="priority != null and priority != '' "> and priority = #{priority}</if>
|
||||
<if test="executionPhase != null and executionPhase != ''"> and execution_phase = #{executionPhase}</if>
|
||||
<if test="inOrOut != null and inOrOut != ''"> and in_or_out = #{inOrOut}</if>
|
||||
<if test="startTime != null and startTime != ''"> and start_time = #{startTime}</if>
|
||||
@@ -303,6 +359,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="traySize != null and traySize != ''"> and tray_size = #{traySize}</if>
|
||||
<if test="wmsTaskNo != null and wmsTaskNo != ''">and wms_task_no = #{wmsTaskNo}</if>
|
||||
</where>
|
||||
order by create_time desc
|
||||
</select>
|
||||
<select id="selectRunningMydoJobByExitList" resultMap="MydoJobResult">
|
||||
select TOP 1 job_id, status, task_no, roadway_id, cargo_space_id, target_roadway_id, target_cargo_space_id, priority, execution_phase, in_or_out, create_time, start_time, finish_time, entrance_id, exit_id, warehouse_id, fault_flag,flag,tray_size,tray_code from mydo_job_wcs
|
||||
|
||||
@@ -159,6 +159,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
delete from ddj_device_execution_queue where uuid = #{uuid}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteDdjDeviceExecutionQueueByTaskNo" parameterType="String">
|
||||
delete from ddj_device_execution_queue where rwh = #{taskNo}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteDdjDeviceExecutionQueueByUuids" parameterType="String">
|
||||
delete from ddj_device_execution_queue where uuid in
|
||||
<foreach item="uuid" collection="array" open="(" separator="," close=")">
|
||||
|
||||
@@ -146,7 +146,7 @@ public class BaseController
|
||||
*/
|
||||
protected AjaxResult toAjax(int rows)
|
||||
{
|
||||
return rows > 0 ? AjaxResult.success() : AjaxResult.error();
|
||||
return rows != 0 ? AjaxResult.success() : AjaxResult.error();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -7,12 +7,17 @@ import java.util.Map;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import lombok.*;
|
||||
|
||||
/**
|
||||
* Entity基类
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@ToString
|
||||
public class BaseEntity implements Serializable
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
@@ -64,7 +69,7 @@ public class BaseEntity implements Serializable
|
||||
|
||||
public Date getCreateTime()
|
||||
{
|
||||
return createTime;
|
||||
return new Date();
|
||||
}
|
||||
|
||||
public void setCreateTime(Date createTime)
|
||||
|
||||
@@ -119,9 +119,9 @@ public class SecurityConfig
|
||||
.antMatchers("/agv/api/**").permitAll()
|
||||
.antMatchers("/device/api/**").permitAll()
|
||||
.antMatchers("/wcs2Wms/api/**").permitAll()
|
||||
.antMatchers("/largeScreen/monitor/**").permitAll()
|
||||
.antMatchers("/largeScreen/monitor/**").permitAll();
|
||||
// 除上面外的所有请求全部需要鉴权认证
|
||||
.anyRequest().authenticated();
|
||||
// .anyRequest().authenticated();
|
||||
})
|
||||
// 添加Logout filter
|
||||
.logout(logout -> logout.logoutUrl("/logout").logoutSuccessHandler(logoutSuccessHandler))
|
||||
|
||||
@@ -2,285 +2,88 @@
|
||||
"boxRows": [
|
||||
{
|
||||
"id": "row1",
|
||||
"boxWidth": 20,
|
||||
"boxHeight": 17,
|
||||
"boxCount": 46,
|
||||
"boxWidth": 30,
|
||||
"boxHeight": 30,
|
||||
"boxCount": 33,
|
||||
"rowGap": 0
|
||||
},
|
||||
{
|
||||
"id": "row2",
|
||||
"boxWidth": 20,
|
||||
"boxHeight": 17,
|
||||
"boxCount": 46,
|
||||
"rowGap": 30
|
||||
},
|
||||
{
|
||||
"id": "row3",
|
||||
"boxWidth": 12,
|
||||
"boxHeight": 20,
|
||||
"boxCount": 69,
|
||||
"rowGap": 10
|
||||
},
|
||||
{
|
||||
"id": "row4",
|
||||
"boxWidth": 12,
|
||||
"boxHeight": 20,
|
||||
"boxCount": 69,
|
||||
"rowGap": 30
|
||||
},
|
||||
{
|
||||
"id": "row1_1",
|
||||
"boxWidth": 20,
|
||||
"boxHeight": 17,
|
||||
"boxCount": 46,
|
||||
"rowGap": 200
|
||||
},
|
||||
{
|
||||
"id": "row2_1",
|
||||
"boxWidth": 20,
|
||||
"boxHeight": 17,
|
||||
"boxCount": 46,
|
||||
"rowGap": 30
|
||||
},
|
||||
{
|
||||
"id": "row3_1",
|
||||
"boxWidth": 12,
|
||||
"boxHeight": 20,
|
||||
"boxCount": 69,
|
||||
"rowGap": 10
|
||||
},
|
||||
{
|
||||
"id": "row4_1",
|
||||
"boxWidth": 12,
|
||||
"boxHeight": 20,
|
||||
"boxCount": 69,
|
||||
"rowGap": 30
|
||||
"boxWidth": 30,
|
||||
"boxHeight": 30,
|
||||
"boxCount": 33,
|
||||
"rowGap": 40
|
||||
}
|
||||
],
|
||||
"conveyors": [
|
||||
{
|
||||
"id": "L1002",
|
||||
"width": 45,
|
||||
"height": 25,
|
||||
"rotation": 0,
|
||||
"x": 362,
|
||||
"y": 330
|
||||
},
|
||||
{
|
||||
"id": "L1001",
|
||||
"width": 45,
|
||||
"height": 25,
|
||||
"width": 80,
|
||||
"height": 30,
|
||||
"rotation": 0,
|
||||
"x": 316,
|
||||
"y": 330
|
||||
"x": 317,
|
||||
"y": 563
|
||||
},
|
||||
{
|
||||
"id": "L1011",
|
||||
"width": 30,
|
||||
"height": 25,
|
||||
"id": "G1002",
|
||||
"width": 80,
|
||||
"height": 30,
|
||||
"rotation": 0,
|
||||
"x": 285,
|
||||
"y": 330
|
||||
},
|
||||
{
|
||||
"id": "L1004",
|
||||
"width": 45,
|
||||
"height": 25,
|
||||
"rotation": 0,
|
||||
"x": 362,
|
||||
"y": 415
|
||||
},
|
||||
{
|
||||
"id": "L1003",
|
||||
"width": 45,
|
||||
"height": 25,
|
||||
"rotation": 0,
|
||||
"x": 316,
|
||||
"y": 415
|
||||
},
|
||||
{
|
||||
"id": "L1012",
|
||||
"width": 30,
|
||||
"height": 25,
|
||||
"rotation": 0,
|
||||
"x": 285,
|
||||
"y": 415
|
||||
},
|
||||
{
|
||||
"id": "L2001",
|
||||
"width": 45,
|
||||
"height": 25,
|
||||
"rotation": 0,
|
||||
"x": 1513,
|
||||
"y": 638
|
||||
},
|
||||
{
|
||||
"id": "L2002",
|
||||
"width": 45,
|
||||
"height": 25,
|
||||
"rotation": 0,
|
||||
"x": 1559,
|
||||
"y": 638
|
||||
},
|
||||
{
|
||||
"id": "L2003",
|
||||
"width": 45,
|
||||
"height": 25,
|
||||
"rotation": 0,
|
||||
"x": 1513,
|
||||
"y": 689
|
||||
},
|
||||
{
|
||||
"id": "L2004",
|
||||
"width": 45,
|
||||
"height": 25,
|
||||
"rotation": 0,
|
||||
"x": 1559,
|
||||
"y": 689
|
||||
},
|
||||
{
|
||||
"id": "L2012",
|
||||
"width": 30,
|
||||
"height": 25,
|
||||
"rotation": 0,
|
||||
"x": 1605,
|
||||
"y": 689
|
||||
},
|
||||
{
|
||||
"id": "L2005",
|
||||
"width": 45,
|
||||
"height": 25,
|
||||
"rotation": 0,
|
||||
"x": 1513,
|
||||
"y": 722
|
||||
},
|
||||
{
|
||||
"id": "L2006",
|
||||
"width": 50,
|
||||
"height": 25,
|
||||
"rotation": 0,
|
||||
"x": 1559,
|
||||
"y": 722
|
||||
},
|
||||
{
|
||||
"id": "L1013",
|
||||
"width": 25,
|
||||
"height": 25,
|
||||
"rotation": 0,
|
||||
"x": 1610,
|
||||
"y": 722
|
||||
},
|
||||
{
|
||||
"id": "L2007",
|
||||
"width": 45,
|
||||
"height": 25,
|
||||
"rotation": 0,
|
||||
"x": 1513,
|
||||
"y": 776
|
||||
},
|
||||
{
|
||||
"id": "L2008",
|
||||
"width": 45,
|
||||
"height": 25,
|
||||
"rotation": 0,
|
||||
"x": 1559,
|
||||
"y": 776
|
||||
"x": 232,
|
||||
"y": 563
|
||||
}
|
||||
],
|
||||
"stackers": [
|
||||
{
|
||||
"id": "1",
|
||||
"width": 60,
|
||||
"height": 28,
|
||||
"width": 70,
|
||||
"height": 35,
|
||||
"rotation": 0,
|
||||
"x": 441,
|
||||
"y": 302,
|
||||
"y": 522,
|
||||
"shelfId": "row1"
|
||||
},
|
||||
{
|
||||
"id": "2",
|
||||
"width": 60,
|
||||
"height": 28,
|
||||
"rotation": 0,
|
||||
"x": 441,
|
||||
"y": 388,
|
||||
"shelfId": "row3"
|
||||
}
|
||||
],
|
||||
"tracks": [
|
||||
{
|
||||
"id": "gd1",
|
||||
"width": 1230,
|
||||
"width": 1350,
|
||||
"height": 2,
|
||||
"rotation": 0,
|
||||
"x": 346,
|
||||
"y": 314
|
||||
},
|
||||
{
|
||||
"id": "gd2",
|
||||
"width": 1230,
|
||||
"height": 2,
|
||||
"rotation": 0,
|
||||
"x": 346,
|
||||
"y": 400
|
||||
},
|
||||
{
|
||||
"id": "gd1_1",
|
||||
"width": 1230,
|
||||
"height": 2,
|
||||
"rotation": 0,
|
||||
"x": 346,
|
||||
"y": 676
|
||||
},
|
||||
{
|
||||
"id": "gd2_1",
|
||||
"width": 1230,
|
||||
"height": 2,
|
||||
"rotation": 0,
|
||||
"x": 346,
|
||||
"y": 760
|
||||
"x": 240,
|
||||
"y": 539
|
||||
}
|
||||
],
|
||||
"rollerConveyors": [
|
||||
{
|
||||
"id": "G1005",
|
||||
"width": 20,
|
||||
"height": 45,
|
||||
"rotation": 90,
|
||||
"x": 376,
|
||||
"y": 463
|
||||
"id": "G1003",
|
||||
"width": 40,
|
||||
"height": 30,
|
||||
"rotation": 0,
|
||||
"x": 250,
|
||||
"y": 597
|
||||
},
|
||||
{
|
||||
"id": "G1006",
|
||||
"width": 20,
|
||||
"id": "G1004",
|
||||
"width": 40,
|
||||
"height": 45,
|
||||
"rotation": 90,
|
||||
"x": 423,
|
||||
"y": 463
|
||||
"rotation": 0,
|
||||
"x": 250,
|
||||
"y": 630
|
||||
}
|
||||
],
|
||||
"deviceDraggable": false,
|
||||
"editMode": false,
|
||||
"labels": [
|
||||
{
|
||||
"id": "bq",
|
||||
"content": "二 层",
|
||||
"fontSize": 24,
|
||||
"fontColor": "#000000",
|
||||
"bgColor": "#ffffff",
|
||||
"borderRadius": 4,
|
||||
"x": 882,
|
||||
"y": 198
|
||||
},
|
||||
{
|
||||
"id": "bq2",
|
||||
"id": "bq1",
|
||||
"content": "一 层",
|
||||
"fontSize": 24,
|
||||
"fontColor": "#000000",
|
||||
"bgColor": "#ffffff",
|
||||
"borderRadius": 4,
|
||||
"x": 882,
|
||||
"y": 562
|
||||
"y": 200
|
||||
},
|
||||
{
|
||||
"id": "bq3",
|
||||
@@ -289,38 +92,8 @@
|
||||
"fontColor": "#ffffff",
|
||||
"bgColor": "#006666",
|
||||
"borderRadius": 4,
|
||||
"x": 189,
|
||||
"y": 293
|
||||
},
|
||||
{
|
||||
"id": "bq4",
|
||||
"content": "一巷道",
|
||||
"fontSize": 16,
|
||||
"fontColor": "#ffffff",
|
||||
"bgColor": "#006666",
|
||||
"borderRadius": 4,
|
||||
"x": 189,
|
||||
"y": 658
|
||||
},
|
||||
{
|
||||
"id": "bq5",
|
||||
"content": "二巷道",
|
||||
"fontSize": 16,
|
||||
"fontColor": "#ffffff",
|
||||
"bgColor": "#006666",
|
||||
"borderRadius": 4,
|
||||
"x": 189,
|
||||
"y": 383
|
||||
},
|
||||
{
|
||||
"id": "bq6",
|
||||
"content": "二巷道",
|
||||
"fontSize": 16,
|
||||
"fontColor": "#ffffff",
|
||||
"bgColor": "#006666",
|
||||
"borderRadius": 4,
|
||||
"x": 189,
|
||||
"y": 743
|
||||
"x": 150,
|
||||
"y": 522
|
||||
}
|
||||
],
|
||||
"titleSettings": {
|
||||
@@ -335,7 +108,7 @@
|
||||
"alarmSettings": {
|
||||
"width": 700,
|
||||
"height": 40,
|
||||
"scrollSpeed": 50,
|
||||
"scrollSpeed": 20,
|
||||
"position": "bottom-center"
|
||||
},
|
||||
"apiSettings": {
|
||||
|
||||
@@ -12,8 +12,8 @@
|
||||
"ywz":"3",
|
||||
"yc":"1",
|
||||
"mbp":"2",
|
||||
"mbwz":"46",
|
||||
"mbc":"5"
|
||||
"mbwz":"33",
|
||||
"mbc":"6"
|
||||
},{
|
||||
"id":"2",
|
||||
"name":"堆垛机",
|
||||
|
||||
@@ -3,7 +3,7 @@ import request from '@/utils/request'
|
||||
// 查询堆垛机监控列表
|
||||
export function listDdj(query) {
|
||||
return request({
|
||||
url: '/device/ddj/list',
|
||||
url: '/device/stacker/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
@@ -12,7 +12,7 @@ export function listDdj(query) {
|
||||
// 查询堆垛机监控详细
|
||||
export function getDdj(id) {
|
||||
return request({
|
||||
url: '/device/ddj/' + id,
|
||||
url: '/device/stacker/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
@@ -20,7 +20,7 @@ export function getDdj(id) {
|
||||
// 新增堆垛机监控
|
||||
export function addDdj(data) {
|
||||
return request({
|
||||
url: '/device/ddj',
|
||||
url: '/device/stacker',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
@@ -29,7 +29,7 @@ export function addDdj(data) {
|
||||
// 修改堆垛机监控
|
||||
export function updateDdj(data) {
|
||||
return request({
|
||||
url: '/device/ddj',
|
||||
url: '/device/stacker',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
@@ -38,7 +38,7 @@ export function updateDdj(data) {
|
||||
// 删除堆垛机监控
|
||||
export function delDdj(id) {
|
||||
return request({
|
||||
url: '/device/ddj/' + id,
|
||||
url: '/device/stacker/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ import request from '@/utils/request'
|
||||
// 查询输送机列表
|
||||
export function listSsj(query) {
|
||||
return request({
|
||||
url: '/device/ssj/list',
|
||||
url: '/device/conv/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
@@ -12,7 +12,7 @@ export function listSsj(query) {
|
||||
// 查询输送机详细
|
||||
export function getSsj(id) {
|
||||
return request({
|
||||
url: '/device/ssj/' + id,
|
||||
url: '/device/conv/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
@@ -20,7 +20,7 @@ export function getSsj(id) {
|
||||
// 新增输送机
|
||||
export function addSsj(data) {
|
||||
return request({
|
||||
url: '/device/ssj',
|
||||
url: '/device/conv',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
@@ -29,7 +29,7 @@ export function addSsj(data) {
|
||||
// 修改输送机
|
||||
export function updateSsj(data) {
|
||||
return request({
|
||||
url: '/device/ssj',
|
||||
url: '/device/conv',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
@@ -38,7 +38,7 @@ export function updateSsj(data) {
|
||||
// 删除输送机
|
||||
export function delSsj(id) {
|
||||
return request({
|
||||
url: '/device/ssj/' + id,
|
||||
url: '/device/conv/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
@@ -18,6 +18,14 @@ export function listMydoJobFinish(query) {
|
||||
})
|
||||
}
|
||||
|
||||
export function listMydoJobUnion(query) {
|
||||
return request({
|
||||
url: '/job/mydoJob/listUnion',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询作业信息详细
|
||||
export function getMydoJob(jobId) {
|
||||
return request({
|
||||
@@ -52,12 +60,21 @@ export function delMydoJob(jobId) {
|
||||
})
|
||||
}
|
||||
|
||||
// 手动完成作业
|
||||
export function handFinish(jobIds) {
|
||||
return request({
|
||||
url: '/job/mydoJob/OuthandFinish',
|
||||
url: '/job/mydoJob/outhandFinish',
|
||||
method: 'get',
|
||||
params: { jobIds: jobIds }
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 重新向入口输送机下发任务
|
||||
export function resendTaskToEntrance(jobId) {
|
||||
return request({
|
||||
url: '/job/mydoJob/resendTaskToEntrance' + '?jobId=' + jobId,
|
||||
method: 'put',
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
@@ -75,7 +75,7 @@
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['device:api:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
</el-col> -->
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
@@ -86,6 +86,7 @@
|
||||
v-hasPermi="['device:api:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<!-- <span style="font-size:10px;line-height: 0px;vertical-align: bottom; color: darkgray;" class="text">* 仅展示14天内的数据</span> -->
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
|
||||
@@ -70,6 +70,11 @@
|
||||
<!-- <el-table-column label="设备名称" prop="name"/>-->
|
||||
<el-table-column label="任务号" prop="taskNo"/>
|
||||
<el-table-column label="托盘条码" prop="trayCode"/>
|
||||
<el-table-column label="入库请求" prop="rkqq">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.ssj_rkqq" :value="scope.row.rkqq"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="到位" prop="dw">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.ssj_dw" :value="scope.row.dw"/>
|
||||
@@ -241,7 +246,7 @@ import { listDeviceCar, getDeviceCar, delDeviceCar, addDeviceCar, updateDeviceCa
|
||||
|
||||
export default {
|
||||
name: "deviceMonitor",
|
||||
dicts: ['ddj_task_status', 'ddj_sbzt', 'ddj_czfs', 'ddj_yxxf', 'ddj_hczt', 'ssj_dw', 'ssj_kx', 'ssj_ex','ssj_allow_put','tray_size','ssj_rkqq'],
|
||||
dicts: ['ddj_task_status', 'ddj_sbzt', 'ddj_czfs', 'ddj_yxxf', 'ddj_hczt', 'ssj_rkqq', 'ssj_dw', 'ssj_kx', 'ssj_ex','ssj_allow_put','tray_size'],
|
||||
data() {
|
||||
return {
|
||||
// 查询参数
|
||||
|
||||
@@ -1,128 +1,125 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="任务号" prop="taskNo">
|
||||
<el-input
|
||||
v-model="queryParams.taskNo"
|
||||
placeholder="请输入任务号"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="90px">
|
||||
<el-form-item label="wcs任务号" prop="taskNo">
|
||||
<el-input v-model="queryParams.taskNo" placeholder="请输入wcs任务号" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="wms任务号" prop="wmsTaskNo">
|
||||
<el-input v-model="queryParams.wmsTaskNo" placeholder="请输入wms任务号" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="托盘条码" prop="trayCode">
|
||||
<el-input v-model="queryParams.trayCode" placeholder="请输入条码" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="货位ID" prop="cargoSpaceId">
|
||||
<el-input v-model="queryParams.cargoSpaceId" placeholder="请输入货位ID" clearable @keyup.enter.native="handleQuery"/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="任务状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="请选择任务状态" clearable>
|
||||
<el-option
|
||||
v-for="dict in dict.type.job_status"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
<el-option v-for="dict in dict.type.job_status" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="巷道ID" prop="roadwayId">
|
||||
<el-input
|
||||
v-model="queryParams.roadwayId"
|
||||
placeholder="请输入巷道ID"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
|
||||
<el-form-item label="任务类型" prop="inOrOut">
|
||||
<el-select v-model="queryParams.inOrOut" placeholder="请选择任务类型" clearable>
|
||||
<el-option v-for="dict in dict.type.job_type" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="货位ID" prop="cargoSpaceId">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.cargoSpaceId"-->
|
||||
<!-- placeholder="请输入货位ID"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="去向" prop="targetRoadwayId">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.targetRoadwayId"-->
|
||||
<!-- placeholder="请输入去向"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="目标货位ID" prop="targetCargoSpaceId">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.targetCargoSpaceId"-->
|
||||
<!-- placeholder="请输入目标货位ID"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="优先级" prop="priority">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.priority"-->
|
||||
<!-- placeholder="请输入优先级"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="执行阶段" prop="executionPhase">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.executionPhase"-->
|
||||
<!-- placeholder="请输入执行阶段"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="任务类型" prop="inOrOut">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.inOrOut"-->
|
||||
<!-- placeholder="请输入任务类型"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="开始时间" prop="startTime">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.startTime"-->
|
||||
<!-- placeholder="请输入开始时间"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="结束时间" prop="finishTime">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.finishTime"-->
|
||||
<!-- placeholder="请输入结束时间"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="入口ID" prop="entranceId">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.entranceId"-->
|
||||
<!-- placeholder="请输入入口ID"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="出口ID" prop="exitId">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.exitId"-->
|
||||
<!-- placeholder="请输入出口ID"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!--<!– <el-form-item label="仓库ID" prop="warehouseId">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.warehouseId"-->
|
||||
<!-- placeholder="请输入仓库ID"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="重分标志" prop="faultFlag">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.faultFlag"-->
|
||||
<!-- placeholder="请输入重分标志"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>–>-->
|
||||
|
||||
<!-- <el-form-item label="巷道ID" prop="roadwayId">
|
||||
<el-input v-model="queryParams.roadwayId" placeholder="请输入巷道ID" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item> -->
|
||||
<!-- <el-form-item label="去向" prop="targetRoadwayId">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.targetRoadwayId"-->
|
||||
<!-- placeholder="请输入去向"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="目标货位ID" prop="targetCargoSpaceId">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.targetCargoSpaceId"-->
|
||||
<!-- placeholder="请输入目标货位ID"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="优先级" prop="priority">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.priority"-->
|
||||
<!-- placeholder="请输入优先级"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="执行阶段" prop="executionPhase">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.executionPhase"-->
|
||||
<!-- placeholder="请输入执行阶段"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="任务类型" prop="inOrOut">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.inOrOut"-->
|
||||
<!-- placeholder="请输入任务类型"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="开始时间" prop="startTime">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.startTime"-->
|
||||
<!-- placeholder="请输入开始时间"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="结束时间" prop="finishTime">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.finishTime"-->
|
||||
<!-- placeholder="请输入结束时间"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="入口ID" prop="entranceId">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.entranceId"-->
|
||||
<!-- placeholder="请输入入口ID"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="出口ID" prop="exitId">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.exitId"-->
|
||||
<!-- placeholder="请输入出口ID"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!--<!– <el-form-item label="仓库ID" prop="warehouseId">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.warehouseId"-->
|
||||
<!-- placeholder="请输入仓库ID"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="重分标志" prop="faultFlag">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.faultFlag"-->
|
||||
<!-- placeholder="请输入重分标志"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>–>-->
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
@@ -131,15 +128,19 @@
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="OuthandFinish"
|
||||
v-hasPermi="['job:mydoJob:OuthandFinish']"
|
||||
>手动完成</el-button>
|
||||
<el-button type="success" plain icon="el-icon-check" size="mini" :disabled="multiple" @click="outhandFinish"
|
||||
v-hasPermi="['job:mydoJob:outhandFinish']">手动完成
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple"
|
||||
@click="cancelTask" v-hasPermi="['job:mydoJob:remove']">手动作废
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="el-icon-edit" size="mini" :disabled="single"
|
||||
@click="onResendTaskClicked" v-hasPermi="['job:mydoJob:resendTaskToEntrance']">入库重新下发
|
||||
</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
@@ -147,84 +148,64 @@
|
||||
<el-table v-loading="loading" :data="mydoJobList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="任务ID" align="center" prop="jobId" />
|
||||
<el-table-column label="任务状态" align="center" prop="status" >
|
||||
<el-table-column label="任务状态" align="center" prop="status">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.job_status" :value="scope.row.status"/>
|
||||
<dict-tag :options="dict.type.job_status" :value="scope.row.status" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="任务号" align="center" prop="taskNo" />
|
||||
<el-table-column label="wcs任务号" align="center" prop="taskNo" />
|
||||
<el-table-column label="wms任务号" align="center" prop="wmsTaskNo" />
|
||||
<el-table-column label="巷道ID" align="center" prop="roadwayId" />
|
||||
<el-table-column label="货位ID" align="center" prop="cargoSpaceId" />
|
||||
<el-table-column label="序列号" align="center" prop="trayCode" />
|
||||
<el-table-column label="优先级" align="center" prop="priority" />
|
||||
<el-table-column label="执行阶段" align="center" prop="executionPhase" >
|
||||
<el-table-column label="托盘条码" align="center" prop="trayCode" />
|
||||
<!-- <el-table-column label="优先级" align="center" prop="priority" /> -->
|
||||
<el-table-column label="执行阶段" align="center" prop="executionPhase">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.job_ep" :value="scope.row.executionPhase"/>
|
||||
<dict-tag :options="dict.type.job_ep" :value="scope.row.executionPhase" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="任务类型" align="center" prop="inOrOut">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.job_type" :value="scope.row.inOrOut" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="任务类型" align="center" prop="inOrOut" />-->
|
||||
<el-table-column label="开始时间" align="center" prop="startTime" />
|
||||
<el-table-column label="结束时间" align="center" prop="finishTime" />
|
||||
<el-table-column label="入口ID" align="center" prop="entranceId" />
|
||||
<el-table-column label="出口ID" align="center" prop="exitId" />
|
||||
<!-- <el-table-column label="仓库ID" align="center" prop="warehouseId" />-->
|
||||
<!-- <el-table-column label="重分标志" align="center" prop="faultFlag" />-->
|
||||
<!-- <el-table-column label="仓库ID" align="center" prop="warehouseId" />-->
|
||||
<!-- <el-table-column label="重分标志" align="center" prop="faultFlag" />-->
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['job:mydoJob:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['job:mydoJob:remove']"
|
||||
>删除</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['job:mydoJob:edit']">修改</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
|
||||
v-hasPermi="['job:mydoJob:remove']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
|
||||
@pagination="getList" />
|
||||
|
||||
<!-- 添加或修改作业信息对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="400px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="任务号" prop="taskNo">
|
||||
<el-input v-model="form.taskNo" placeholder="请输入任务号" style="width: 220px"/>
|
||||
<el-input v-model="form.taskNo" placeholder="请输入任务号" style="width: 220px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="form.status" placeholder="请修改状态" >
|
||||
<el-option
|
||||
v-for="dict in dict.type.job_status"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
<el-select v-model="form.status" placeholder="请修改状态">
|
||||
<el-option v-for="dict in dict.type.job_status" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="执行阶段" prop="executionPhase">
|
||||
<el-select v-model="form.executionPhase" placeholder="请修改执行阶段">
|
||||
<el-option
|
||||
v-for="dict in dict.type.job_ep"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
<el-option v-for="dict in dict.type.job_ep" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="优先级" prop="priority">
|
||||
<el-input v-model="form.priority" placeholder="请输入优先级" type="number" style="width: 220px"/>
|
||||
<el-input v-model="form.priority" placeholder="请输入优先级" type="number" style="width: 220px" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
@@ -236,11 +217,11 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {listMydoJob, getMydoJob, delMydoJob, addMydoJob, updateMydoJob, listMydoJobFinish,handFinish} from "@/api/job/mydoJob"
|
||||
import { listMydoJob, getMydoJob, delMydoJob, addMydoJob, updateMydoJob, listMydoJobFinish,listMydoJobUnion, handFinish, resendTaskToEntrance } from "@/api/job/mydoJob"
|
||||
|
||||
export default {
|
||||
name: "MydoJob",
|
||||
dicts:['job_status','job_ep'],
|
||||
dicts: ['job_status','job_type', 'job_ep'],
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
@@ -267,6 +248,7 @@ export default {
|
||||
pageSize: 10,
|
||||
status: null,
|
||||
taskNo: null,
|
||||
wmsTaskNo: null, //@@@ FT568 入库请求wms返回的任务号
|
||||
roadwayId: null,
|
||||
cargoSpaceId: null,
|
||||
targetRoadwayId: null,
|
||||
@@ -302,19 +284,27 @@ export default {
|
||||
/** 查询作业信息列表 */
|
||||
getList() {
|
||||
this.loading = true
|
||||
if ( this.queryParams.status ==='4' || this.queryParams.status ==='5'){
|
||||
listMydoJobFinish(this.queryParams).then(response => {
|
||||
|
||||
listMydoJobUnion(this.queryParams).then(response => {
|
||||
this.mydoJobList = response.rows
|
||||
this.total = response.total
|
||||
this.loading = false
|
||||
})
|
||||
}else {
|
||||
listMydoJob(this.queryParams).then(response => {
|
||||
this.mydoJobList = response.rows
|
||||
this.total = response.total
|
||||
this.loading = false
|
||||
})
|
||||
}
|
||||
|
||||
// if (this.queryParams.status === '4' || this.queryParams.status === '5'
|
||||
// || this.queryParams.status === '6') {
|
||||
// listMydoJobFinish(this.queryParams).then(response => {
|
||||
// this.mydoJobList = response.rows
|
||||
// this.total = response.total
|
||||
// this.loading = false
|
||||
// })
|
||||
// } else {
|
||||
// listMydoJob(this.queryParams).then(response => {
|
||||
// this.mydoJobList = response.rows
|
||||
// this.total = response.total
|
||||
// this.loading = false
|
||||
// })
|
||||
// }
|
||||
|
||||
},
|
||||
// 取消按钮
|
||||
@@ -328,6 +318,7 @@ export default {
|
||||
jobId: null,
|
||||
status: null,
|
||||
taskNo: null,
|
||||
wmsTaskNo: null, //@@@ FT568 入库请求wms返回的任务号
|
||||
roadwayId: null,
|
||||
cargoSpaceId: null,
|
||||
targetRoadwayId: null,
|
||||
@@ -359,7 +350,7 @@ export default {
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.jobId)
|
||||
this.single = selection.length!==1
|
||||
this.single = selection.length !== 1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
@@ -401,15 +392,33 @@ export default {
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const jobIds = row.jobId || this.ids
|
||||
this.$modal.confirm('是否确认删除作业信息编号为"' + jobIds + '"的数据项?(此操作可能影响任务回传,请和上层系统核对账目)').then(function() {
|
||||
this.$modal.confirm('是否确认删除编号为"' + jobIds + '"的任务?(此操作可能影响任务回传,需要人工向wms维护人员通知作业处理情况)').then(function () {
|
||||
return delMydoJob(jobIds)
|
||||
}).then(() => {
|
||||
this.getList()
|
||||
this.$modal.msgSuccess("操作成功")
|
||||
}).catch(() => {})
|
||||
}).catch(() => { })
|
||||
},
|
||||
OuthandFinish() {
|
||||
|
||||
cancelTask() {
|
||||
if (this.ids.length === 0) {
|
||||
this.$modal.msgError("请选择需要手动作废的任务");
|
||||
return;
|
||||
}
|
||||
console.log(this.ids.join(','))
|
||||
|
||||
this.$modal.confirm('是否确认手动作废选中的任务?').then(() => {
|
||||
return delMydoJob(this.ids.join(','))
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("手动作废成功");
|
||||
}).catch(error => {
|
||||
// console.error('手动作废失败:', error);
|
||||
// this.$modal.msgError(`手动作废失败:${error.message || '未知错误'}`);
|
||||
});
|
||||
},
|
||||
|
||||
outhandFinish() {
|
||||
if (this.ids.length === 0) {
|
||||
this.$modal.msgError("请选择需要手动完成的任务");
|
||||
return;
|
||||
@@ -422,8 +431,24 @@ export default {
|
||||
}).then(() => {
|
||||
this.$modal.msgSuccess("手动完成成功");
|
||||
this.getList();
|
||||
}).catch(() => {});
|
||||
}).catch(() => { });
|
||||
},
|
||||
|
||||
onResendTaskClicked() {
|
||||
if (!this.ids || this.ids.length === 0) {
|
||||
this.$modal.msgError("请选择需要重新下发的任务");
|
||||
return;
|
||||
}
|
||||
const jobId = this.ids[0];
|
||||
console.log(jobId)
|
||||
this.$modal.confirm('是否确认重新下发选中的任务?').then(() => {
|
||||
return resendTaskToEntrance(jobId);
|
||||
}).then(() => {
|
||||
this.$modal.msgSuccess("重新下发成功");
|
||||
this.getList();
|
||||
}).catch(() => { });
|
||||
},
|
||||
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('job/mydoJob/export', {
|
||||
|
||||
Reference in New Issue
Block a user