Compare commits
43 Commits
741fe220d8
...
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 |
@@ -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();
|
||||
|
||||
/**
|
||||
* 新增接口记录
|
||||
*
|
||||
|
||||
@@ -23,9 +23,12 @@ 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;
|
||||
@@ -45,7 +48,8 @@ import java.util.Map;
|
||||
|
||||
import static com.ruoyi.common.Constant.*;
|
||||
import static com.ruoyi.common.ConvType.CONV_STOCKOUT;
|
||||
import static com.ruoyi.common.TaskStatusCode.TASK_EP_CREATED;
|
||||
import static com.ruoyi.common.TaskStatusCode.*;
|
||||
import static com.ruoyi.common.TaskType.STOCKIN;
|
||||
|
||||
/**
|
||||
* 接口记录Service业务层处理
|
||||
@@ -65,7 +69,8 @@ public class ApiServiceImpl implements IApiService {
|
||||
private IMydoJobService mydoJobService;
|
||||
@Autowired
|
||||
private IWcsPortService wcsPortService;
|
||||
|
||||
@Autowired
|
||||
private IBasCargoSpaceService basCargoSpaceService;
|
||||
|
||||
|
||||
/**
|
||||
@@ -247,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()));
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -490,40 +517,98 @@ public class ApiServiceImpl implements IApiService {
|
||||
requestLog.setIsSuccessful("1");
|
||||
requestLogService.insertRequestLog(requestLog);
|
||||
|
||||
//检查任务是否存在,避免重复生成
|
||||
MydoJob job = new MydoJob();
|
||||
job.setWmsTaskNo(stockoutReceive.getTaskCode());
|
||||
List<MydoJob> tasks = mydoJobService.selectMydoJobList(job);
|
||||
// -------------------------检查推送的任务参数-------------------------
|
||||
log.info(
|
||||
"【wms推送出库】请求码:{},wms任务号:{},推送出库货位:{},推送类型:{}",stockoutReceive.getReqCode(), stockoutReceive.getTaskCode(), stockoutReceive.getSiteCode(), stockoutReceive.getTaskTypeCode()
|
||||
);
|
||||
|
||||
//校验:任务已存在
|
||||
if (tasks.size() != 0) {
|
||||
log.info("【请求异常】wms下发出库任务失败,该任务已存在,任务号:{}", stockoutReceive.getTaskCode());
|
||||
return AjaxResult.error("【请求异常】wms下发出库任务失败,任务号:" + stockoutReceive.getTaskCode());
|
||||
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());
|
||||
mydoJob.setCargoSpaceId(stockoutReceive.getSiteCode());
|
||||
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_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();
|
||||
}
|
||||
@@ -620,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() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -60,6 +60,16 @@ public class RequestLogServiceImpl implements IRequestLogService
|
||||
return requestLogMapper.selectRequestLogList(requestLog);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取最新的请求记录
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public RequestLog selectRequestLogByLatestTask()
|
||||
{
|
||||
return requestLogMapper.selectRequestLogByLatestTask();
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增接口记录
|
||||
*
|
||||
@@ -240,7 +250,7 @@ public class RequestLogServiceImpl implements IRequestLogService
|
||||
// String resStr = HttpUtil.post(url, param, header, 3000);
|
||||
String resStr = HttpRequest.post(url)
|
||||
.body(param)
|
||||
.header("X-Service-Secret", HEADER_TOKEN)
|
||||
.header("X-Service-Secret", HEADER_TOKEN) // 向wms请求头必需添加的token
|
||||
.execute()
|
||||
.body();
|
||||
requestLog.setResponseBody(resStr);
|
||||
|
||||
@@ -4,7 +4,7 @@ package com.ruoyi.common;
|
||||
public class Constant {
|
||||
|
||||
public static final String LOCAL_URL = "http://127.0.0.1:8084";
|
||||
public static final String WMS_BASE_URL = "http://10.88.10.69:8290/service";
|
||||
public static final String WMS_BASE_URL = "http://10.88.10.69: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";
|
||||
|
||||
@@ -27,6 +27,11 @@ public class TaskStatusCode {
|
||||
*/
|
||||
public static final String TASK_STATUS_FINISH = "4";
|
||||
|
||||
/**
|
||||
* 任务状态-手动完成
|
||||
*/
|
||||
public static final String TASK_STATUS_FINISH_MANUAL = "4";
|
||||
|
||||
/**
|
||||
* 任务状态-作废
|
||||
*/
|
||||
@@ -52,7 +57,7 @@ public class TaskStatusCode {
|
||||
public static final String TASK_EP_AGV = "2";
|
||||
|
||||
/**
|
||||
* 任务执行阶段 入口输送机
|
||||
* 任务执行阶段 入口输送机输送到位
|
||||
*/
|
||||
public static final String TASK_EP_SSJ = "3";
|
||||
|
||||
@@ -84,7 +89,7 @@ public class TaskStatusCode {
|
||||
/**
|
||||
* 任务执行阶段 任务超时-自动结束当前任务
|
||||
*/
|
||||
public static final String TASK_EP_DDJ_FINISH_TIMEOUT = "6_TIMEOUT_FINISH";
|
||||
public static final String TASK_EP_DDJ_FINISH_TIMEOUT = "6";
|
||||
|
||||
/**
|
||||
* 入库异常 - 放货有货
|
||||
|
||||
@@ -10,6 +10,16 @@ public class TaskType {
|
||||
*/
|
||||
public static final int STACKER_TYPE_DEFAULT = 0;
|
||||
|
||||
/**
|
||||
* 常规入库
|
||||
*/
|
||||
public static final String STOCKIN = "1";
|
||||
|
||||
/**
|
||||
* 常规出库
|
||||
*/
|
||||
public static final String STOCKOUT = "2";
|
||||
|
||||
/**
|
||||
* 1-二楼入出
|
||||
*/
|
||||
|
||||
@@ -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,13 +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));
|
||||
}
|
||||
|
||||
@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));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
/** 任务状态 */
|
||||
|
||||
@@ -119,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,9 +88,9 @@ 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);
|
||||
|
||||
@@ -102,6 +98,8 @@ public interface IMydoJobService
|
||||
|
||||
MydoJob selectMydoJobByWmsTaskNo(String wmsTaskNo);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取本地生成作业号
|
||||
* @param type RK-入库 CK-出库
|
||||
@@ -116,4 +114,6 @@ public interface IMydoJobService
|
||||
*/
|
||||
String getTaskNo(String type);
|
||||
|
||||
List<MydoJob> selectMydoJobUnionList(MydoJob mydoJob);
|
||||
|
||||
}
|
||||
|
||||
@@ -4,12 +4,16 @@ 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;
|
||||
@@ -19,6 +23,8 @@ import com.ruoyi.job.mapper.MydoJobMapper;
|
||||
import com.ruoyi.job.domain.MydoJob;
|
||||
import com.ruoyi.job.service.IMydoJobService;
|
||||
|
||||
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.*;
|
||||
|
||||
/**
|
||||
@@ -37,6 +43,8 @@ public class MydoJobServiceImpl implements IMydoJobService
|
||||
private IJobCallBackService jobCallBackService;
|
||||
@Autowired
|
||||
private IDdjDeviceExecutionQueueService ddjDeviceExecutionQueueService;
|
||||
@Autowired
|
||||
private IDdjDeviceExecutionQueueFinishService ddjDeviceExecutionQueueServiceFinishService;
|
||||
|
||||
/**
|
||||
* 查询作业信息
|
||||
@@ -99,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);
|
||||
}
|
||||
@@ -113,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);
|
||||
}
|
||||
|
||||
@@ -142,8 +186,6 @@ public class MydoJobServiceImpl implements IMydoJobService
|
||||
deleteMydoJobByJobId(task.getJobId());
|
||||
ddjDeviceExecutionQueueService.deleteDdjDeviceExecutionQueueByTaskNo(task.getTaskNo());
|
||||
|
||||
log.info("【堆垛机入库】堆垛机:"+ task.getRoadwayId() +"任务完成,任务号:"+ rwh);
|
||||
|
||||
JobCallBack jobCallBack = new JobCallBack();
|
||||
jobCallBack.setType(Integer.valueOf(task.getInOrOut()) < 20 ? "1" : "2");
|
||||
jobCallBack.setMydoJobId(task.getJobId());
|
||||
@@ -163,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 {
|
||||
@@ -170,6 +215,7 @@ public class MydoJobServiceImpl implements IMydoJobService
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public MydoJob selectMydoJobByExitList(List<String> exitList ) {
|
||||
return mydoJobMapper.selectMydoJobByExitList(exitList);
|
||||
@@ -202,30 +248,25 @@ 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");
|
||||
}else{
|
||||
jobCallBack.setType("1");
|
||||
}
|
||||
jobCallBack.setTaskTypeCode(WMS_TASK_TYPE_FINISH);//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()));
|
||||
@@ -237,41 +278,58 @@ public class MydoJobServiceImpl implements IMydoJobService
|
||||
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("操作成功");
|
||||
}
|
||||
@@ -339,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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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(18, ddsx));
|
||||
msgDdj.setCurrentColumn(ParseUtil.optInt(18, ddsx));
|
||||
msgDdj.setCurrentFloor(ParseUtil.optInt(18, ddsx));
|
||||
msgDdj.setCurrentRow(ParseUtil.optInt(12, ddsx));
|
||||
msgDdj.setCurrentColumn(ParseUtil.optInt(14, ddsx));
|
||||
msgDdj.setCurrentFloor(ParseUtil.optInt(16, ddsx));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -110,7 +110,7 @@ public class PlcSsjRead implements Runnable {
|
||||
ssjDevice.setRkqq(ParseUtil.optInt(10, ddsx1));
|
||||
ssjDevice.setHeight(ParseUtil.optInt(12, ddsx1));
|
||||
ssjDevice.setTraySize(ParseUtil.optInt(12, ddsx1)); //此处不修改device_ssj表,把托盘尺寸值当作高度使用
|
||||
ssjDevice.setTrayCode(ParseUtil.optString(14, ddsx1));
|
||||
ssjDevice.setTrayCode(ParseUtil.optString(14, ddsx1).replaceAll("\\s", ""));
|
||||
ssjDevice.setMode(ParseUtil.optInt(24, ddsx1));//todo 输送机操作模式
|
||||
ssjDevice.setException(ParseUtil.optInt(28, ddsx1));
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ public class ParseUtil {
|
||||
*/
|
||||
|
||||
public static String optString(int start, String data) {
|
||||
byte[] bytes = SoftBasic.HexStringToBytes(data.substring(start * 2, (start + 10) * 2));
|
||||
byte[] bytes = SoftBasic.HexStringToBytes(data.substring(start * 2, (start + 7) * 2));
|
||||
return Tools.bytetostringtool(bytes);
|
||||
}
|
||||
|
||||
|
||||
@@ -18,12 +18,16 @@ 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 {
|
||||
@@ -39,13 +43,16 @@ public class TaskHandler {
|
||||
@Autowired
|
||||
private IDdjDeviceExecutionQueueService ddjDeviceExecutionQueueService;
|
||||
|
||||
|
||||
private static final int DEFAULTTIMEINTERVAL = 2000;
|
||||
|
||||
|
||||
/**
|
||||
* 处理未正常移除的【堆垛机执行完成】或【出库到位】的遗留任务
|
||||
*/
|
||||
// @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_FINISH).build()
|
||||
);
|
||||
@@ -57,31 +64,67 @@ public class TaskHandler {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 【手动作废】 - 查询并处理标记为已经作废的任务
|
||||
*/
|
||||
//@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)
|
||||
@Scheduled(fixedDelay = 3000)
|
||||
public void jobCallBack() {
|
||||
jobCallBackService.jobCallBack();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 入库异常 - 【放货有货】处理方法
|
||||
* 【入库异常-请求重分】 - 【放货有货】处理方法
|
||||
*/
|
||||
@Scheduled(fixedDelay = 2000)
|
||||
@Scheduled(fixedDelay = DEFAULTTIMEINTERVAL)
|
||||
public void stockinExceptionHandler() {
|
||||
List<MydoJob> jobs = mydoJobService.selectInOrOutMydoJobList(
|
||||
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);//todo 不知道填什么
|
||||
taskExceptionRequest.setTaskTypeCode(WMS_TASK_TYPE_EXCEPTION);//wms自定义文本
|
||||
taskExceptionRequest.setReqCode(UUID.randomUUID().toString().replace("-", ""));
|
||||
taskExceptionRequest.setAdverseCauses("当前位置已有货物,盘点后重新分配货位");
|
||||
|
||||
@@ -103,7 +146,9 @@ public class TaskHandler {
|
||||
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());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -112,12 +157,13 @@ public class TaskHandler {
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 出库异常 - 【取货无货】处理方法
|
||||
* 【出库异常】 - 【取货无货】处理方法
|
||||
*/
|
||||
@Scheduled(fixedDelay = 2000)
|
||||
@Scheduled(fixedDelay = DEFAULTTIMEINTERVAL)
|
||||
public void stockoutExceptionHandler() {
|
||||
List<MydoJob> jobs = mydoJobService.selectInOrOutMydoJobList(
|
||||
List<MydoJob> jobs = mydoJobService.selectMydoJobList(
|
||||
new MydoJob().builder().executionPhase(TASK_EXCEPTION_PICK).build()
|
||||
);
|
||||
|
||||
@@ -138,6 +184,10 @@ public class TaskHandler {
|
||||
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());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -146,30 +196,53 @@ public class TaskHandler {
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 入库重分完成 - 堆垛机重新下发
|
||||
* 【入库异常-重分完成】 - 堆垛机重新下发
|
||||
*/
|
||||
@Scheduled(fixedDelay = 2000)
|
||||
@Scheduled(fixedDelay = DEFAULTTIMEINTERVAL)
|
||||
public void sendTaskForStacker(){
|
||||
List<MydoJob> jobs = mydoJobService.selectInOrOutMydoJobList(
|
||||
List<MydoJob> jobs = mydoJobService.selectMydoJobList(
|
||||
new MydoJob().builder().executionPhase(TASK_EXCEPTION_PUT_REASSIGN).build()
|
||||
);
|
||||
|
||||
if (!jobs.isEmpty()) {
|
||||
for (MydoJob job : jobs) {
|
||||
//获取重分的货位重新向堆垛机下发任务
|
||||
BasCargoSpace basCargoSpace = basCargoSpaceService.selectBasCargoSpaceByWmsCargoSpaceId(job.getCargoSpaceId());
|
||||
DdjDeviceExecutionQueue ddjDeviceExecutionQueue =
|
||||
ddjDeviceExecutionQueueService.selectDdjDeviceExecutionQueueByRwh(Long.valueOf(job.getTaskNo()), Integer.valueOf(job.getRoadwayId()));
|
||||
ddjDeviceExecutionQueue.setMbph(basCargoSpace.getThePlatoon());
|
||||
ddjDeviceExecutionQueue.setMblh(basCargoSpace.getTheColumn());
|
||||
ddjDeviceExecutionQueue.setMbch(basCargoSpace.getTheFloor());
|
||||
ddjDeviceExecutionQueue.setDdjxf("0");
|
||||
ddjDeviceExecutionQueueService.updateDdjDeviceExecutionQueue(ddjDeviceExecutionQueue);
|
||||
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(){
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ public class DdjThread implements Runnable {
|
||||
}
|
||||
}
|
||||
try {
|
||||
Thread.sleep(1500);
|
||||
Thread.sleep(3000);
|
||||
} catch (InterruptedException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
@@ -123,7 +123,7 @@ public class DdjThread implements Runnable {
|
||||
mydoJobService.updateMydoJob(mydoJob);
|
||||
//回传完成信号 - 方法在存储过程【proc_mydojob_finish】中
|
||||
ddjTaskFinish(rwh, ddj.getId());
|
||||
log.info("【堆垛机入库】堆垛机:"+ddj.getId()+"任务完成,任务号:"+ddj.getRwh());
|
||||
log.info("【堆垛机执行】堆垛机编号:" + ddj.getId() + " 执行完成,任务结束,任务号:"+ddj.getRwh());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -167,6 +167,7 @@ public class DdjThread implements Runnable {
|
||||
//把执行阶段标记为【入库放货有货】的异常
|
||||
mydoJob.setExecutionPhase(TASK_EXCEPTION_PUT);
|
||||
mydoJobService.updateMydoJob(mydoJob);
|
||||
log.info("【入库异常】堆垛机放货时目标位置有货,异常货位:{},任务号:{}", mydoJob.getCargoSpaceId(), rwh);
|
||||
}
|
||||
|
||||
// //上报异常 - 向wms请求重分接口
|
||||
@@ -227,6 +228,7 @@ public class DdjThread implements Runnable {
|
||||
//把执行阶段标记为【出库取货无货】的异常
|
||||
mydoJob.setExecutionPhase(TASK_EXCEPTION_PICK);
|
||||
mydoJobService.updateMydoJob(mydoJob);
|
||||
log.info("【出库异常】堆垛机取货时目标位置无货,异常货位:{},任务号:{}", mydoJob.getCargoSpaceId(), rwh);
|
||||
}
|
||||
|
||||
|
||||
@@ -281,7 +283,7 @@ public class DdjThread implements Runnable {
|
||||
ddjDeviceExecutionQueueService.updateDdjDeviceExecutionQueue(ddjDeviceExecutionQueue);
|
||||
mydoJob.setFaultFlag("0");
|
||||
mydoJobService.updateMydoJob(mydoJob);
|
||||
log.info("【入库异常】堆垛机放货目标有货,重分货位下发堆垛机任务成功 rwh:{}", rwh);
|
||||
log.info("【入库异常】重分货位下发堆垛机任务成功,当前任务号:{}", rwh);
|
||||
} else {
|
||||
log.error("【入库异常】重分货位 - 下发堆垛机任务失败!!!!!!!");
|
||||
}
|
||||
@@ -291,6 +293,7 @@ public class DdjThread implements Runnable {
|
||||
|
||||
//正常下发
|
||||
if (ddj.getYxxf() == 1 && ddj.getSbzt() == 0 ) {
|
||||
|
||||
//检查是否有正在执行的堆垛机队列
|
||||
Long rwh = ddj.getRwh();
|
||||
DdjDeviceExecutionQueue ddjDeviceExecutionQueueRunningParam = new DdjDeviceExecutionQueue();
|
||||
@@ -299,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;
|
||||
}
|
||||
|
||||
@@ -318,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("【堆垛机执行】执行异常, 堆垛机下发任务失败!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,11 +2,14 @@ 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.core.domain.AjaxResult;
|
||||
@@ -29,6 +32,7 @@ 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.schedule.plcRead.ssj.PlcSsjRead.writeToSsj;
|
||||
|
||||
@@ -46,6 +50,7 @@ public class PortConvThread implements Runnable {
|
||||
private IMydoJobService mydoJobService;
|
||||
private IJobCallBackService jobCallBackService;
|
||||
private IBasCargoSpaceService basCargoSpaceService;
|
||||
private IRequestLogService requestLogService;
|
||||
|
||||
|
||||
public boolean isRun = true;
|
||||
@@ -62,6 +67,7 @@ public class PortConvThread implements Runnable {
|
||||
mydoJobService = SpringUtils.getBean(IMydoJobService.class);
|
||||
jobCallBackService = SpringUtils.getBean(IJobCallBackService.class);
|
||||
basCargoSpaceService = SpringUtils.getBean(IBasCargoSpaceService.class);
|
||||
requestLogService = SpringUtils.getBean(IRequestLogService.class);
|
||||
// log.info("初始化服务 {},{}", apiService, agvQueueService);
|
||||
}
|
||||
|
||||
@@ -95,7 +101,7 @@ public class PortConvThread implements Runnable {
|
||||
}
|
||||
}
|
||||
try {
|
||||
Thread.sleep(1500);
|
||||
Thread.sleep(3000);
|
||||
} catch (InterruptedException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
@@ -116,11 +122,16 @@ public class PortConvThread implements Runnable {
|
||||
// inSsjDevice.setException(0);
|
||||
// inSsjDevice.setRkqq(1);
|
||||
|
||||
//更新入库任务阶段
|
||||
updateMydoJob(inSsjDevice);
|
||||
//输送机状态
|
||||
if (!convChecked(inSsjDevice)) return;
|
||||
|
||||
//请求wms获取入库任务
|
||||
requestMydoJob(inSsjDevice);
|
||||
|
||||
//更新入库任务阶段
|
||||
updateMydoJob(inSsjDevice);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -133,11 +144,13 @@ public class PortConvThread implements Runnable {
|
||||
|
||||
boolean flag = false;
|
||||
//---------------------------入口取输送机(叉车取放货位置)---------------------------
|
||||
//输送机【非空闲】、【输送到位】、【入库请求?】
|
||||
if (inSsjDevice.getKx() != 0) return flag;
|
||||
//输送机【条码】空
|
||||
if (inSsjDevice.getTrayCode() == "" || inSsjDevice.getTrayCode() == null) return flag;
|
||||
|
||||
//【入库请求】,表示输送到位和空闲
|
||||
if (inSsjDevice.getRkqq() != 1) return flag;
|
||||
|
||||
//【输送高度】
|
||||
if (inSsjDevice.getHeight() == 0) return flag;
|
||||
|
||||
return true;
|
||||
@@ -150,7 +163,27 @@ public class PortConvThread implements Runnable {
|
||||
*/
|
||||
private void requestMydoJob(DeviceSsj inSsjDevice){
|
||||
|
||||
if (!convChecked(inSsjDevice)) return;
|
||||
//请求成功已经生成该任务则不继续执行
|
||||
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 = "";
|
||||
|
||||
@@ -160,16 +193,13 @@ public class PortConvThread implements Runnable {
|
||||
HashMap<String, Object> paramMap = new HashMap<>();
|
||||
paramMap.put("taskTypeCode", WMS_TASK_TYPE_STOCKIN);//wms自定义的任务类型编号
|
||||
paramMap.put("reqCode", UUID.randomUUID().toString());//请求码
|
||||
paramMap.put("cntCode", inSsjDevice.getTrayCode());//容器编号
|
||||
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);//高度
|
||||
paramMap.put("adverseCauses", errorMessage);
|
||||
|
||||
// if (inSsjDevice.getException() > 0){
|
||||
// log.warn("【入库异常】{}",errorMessage);
|
||||
// }
|
||||
|
||||
//-----------------警告校验:条码已有库存-----------------
|
||||
BasCargoSpace cargoSpace = new BasCargoSpace();
|
||||
@@ -178,6 +208,7 @@ public class PortConvThread implements Runnable {
|
||||
log.warn("【警告】该托盘号已有库存,托盘条码:{}",inSsjDevice.getTrayCode());
|
||||
}
|
||||
|
||||
|
||||
/*-----------------请求生成wcs任务----------------- */
|
||||
ajaxResult = apiService.createMydoJobForStockin(paramMap);
|
||||
if (ajaxResult.isSuccess()) {
|
||||
@@ -186,11 +217,12 @@ public class PortConvThread implements Runnable {
|
||||
StockinReceive result = BeanUtil.toBean(ajaxResult.get("data"), StockinReceive.class);
|
||||
|
||||
//校验:wms分配的货位(排列层)是否合法
|
||||
if (result.getSiteCode() == null || result.getSiteCode().isEmpty()) {
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -216,16 +248,18 @@ public class PortConvThread implements Runnable {
|
||||
//如果还没有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", 2, 1);
|
||||
|
||||
//todo 接口调用失败处理
|
||||
// 接口调用失败处理
|
||||
log.info("【入库请求】请求生成wcs作业失败退回,请检查网络或请求参数,请求内容:{}", JSON.toJSONString(paramMap));
|
||||
log.info("【错误信息】{}", requestLogService.selectRequestLogByLatestTask().getErrorDetails());
|
||||
|
||||
// 请求生成wcs任务失败
|
||||
// 向输送机下发退回
|
||||
int i = writeToSsj(inSsjDevice.getPlcDbWriteAddress(), "99", 2, 1);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -236,12 +270,10 @@ public class PortConvThread implements Runnable {
|
||||
*/
|
||||
private void updateMydoJob(DeviceSsj inSsjDevice){
|
||||
|
||||
if (!convChecked(inSsjDevice)) return;
|
||||
|
||||
//检查是否有已经创建成功的任务(请求成功的入库任务) - 更新到下一个执行阶段
|
||||
MydoJob mydoJobStockin = new MydoJob().builder()
|
||||
.trayCode(inSsjDevice.getTrayCode())
|
||||
.status(TASK_EP_CREATED)
|
||||
.status(TASK_STATUS_CREATED)
|
||||
.executionPhase(TASK_EP_CREATED)
|
||||
.build();
|
||||
if(!mydoJobService.selectMydoJobList(mydoJobStockin).isEmpty()){
|
||||
@@ -254,8 +286,9 @@ public class PortConvThread implements Runnable {
|
||||
//写入成功则更新执行阶段
|
||||
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());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -264,6 +297,7 @@ public class PortConvThread implements Runnable {
|
||||
|
||||
/**
|
||||
* 输送机出库到位 - 任务出库完成
|
||||
* 出库完成在升降位置,即【TD1001】判断完成
|
||||
* @param outSsjDevice
|
||||
*/
|
||||
private void finishStockoutMydoJob(DeviceSsj outSsjDevice){
|
||||
@@ -272,7 +306,7 @@ public class PortConvThread implements Runnable {
|
||||
//查询该出库任务
|
||||
MydoJob mydoJob = mydoJobService.selectMydoJobByTaskNo(Convert.toLong(outSsjDevice.getTaskNo()));
|
||||
if (mydoJob != null && Integer.parseInt(mydoJob.getInOrOut()) > 20) {
|
||||
log.info("【出库到位】设备:{},位置:{},任务号:{},出库到位", "输送线:", outSsjDevice.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()));
|
||||
@@ -292,6 +326,9 @@ public class PortConvThread implements Runnable {
|
||||
|
||||
/**
|
||||
* 从 MOXA NPort 5110(TCP Server 模式)读取单次称重值
|
||||
* ************测试方法************
|
||||
* ************测试方法************
|
||||
* ************测试方法************
|
||||
*
|
||||
* @param moxaIp MOXA 设备 IP(如 "192.168.1.200")
|
||||
* @param moxaPort MOXA 配置的 TCP 端口(如 4001)
|
||||
@@ -422,10 +459,18 @@ 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,8 +23,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import static com.ruoyi.common.ConvType.CONV_ROAD_1;
|
||||
import static com.ruoyi.common.ConvType.CONV_STOCKOUT;
|
||||
import static com.ruoyi.common.ConvType.*;
|
||||
import static com.ruoyi.common.TaskStatusCode.*;
|
||||
import static com.ruoyi.common.TaskType.*;
|
||||
|
||||
@@ -174,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 = CONV_STOCKOUT;
|
||||
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">
|
||||
<!-- 过滤的级别 -->
|
||||
@@ -57,6 +59,29 @@
|
||||
</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">
|
||||
<file>${log.path}/sys-user.log</file>
|
||||
@@ -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>
|
||||
|
||||
@@ -45,7 +45,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
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>
|
||||
|
||||
@@ -38,6 +38,54 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
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>
|
||||
@@ -297,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>
|
||||
@@ -311,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
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -18,7 +18,6 @@ import lombok.*;
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@ToString
|
||||
@Builder
|
||||
public class BaseEntity implements Serializable
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@@ -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