Compare commits
10 Commits
91ea5339a5
...
3071eb1543
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3071eb1543 | ||
|
|
14d3321b68 | ||
|
|
f6696e0b60 | ||
|
|
8eb2bcc592 | ||
|
|
036ee35af3 | ||
|
|
d2d871baf1 | ||
|
|
6c2d8fcb0f | ||
|
|
5dcb72148e | ||
|
|
4e0d329e6d | ||
|
|
50534dc3be |
@@ -38,14 +38,15 @@
|
||||
</dependency>
|
||||
|
||||
<!-- Mysql驱动包 -->
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
</dependency>
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>mysql</groupId>-->
|
||||
<!-- <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>
|
||||
|
||||
<!-- 核心模块-->
|
||||
|
||||
@@ -15,6 +15,7 @@ import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
|
||||
@EnableScheduling
|
||||
@EnableAsync
|
||||
@MapperScan("com.**.mapper")
|
||||
public class RuoYiApplication
|
||||
{
|
||||
public static void main(String[] args)
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
package com.ruoyi.api.controller;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.ruoyi.api.domain.agv.agvCallback.AgvCallbackRequest;
|
||||
import com.ruoyi.api.domain.agv.agvCallback.AgvCallbackResponse;
|
||||
import com.ruoyi.api.domain.agv.cancelTask.CancelTaskRequest;
|
||||
import com.ruoyi.api.domain.agv.cancelTask.CancelTaskResponse;
|
||||
import com.ruoyi.api.service.IApiService;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
@@ -27,6 +31,7 @@ public class AgvController extends BaseController {
|
||||
@Autowired
|
||||
private IAgvQueueService agvQueueService;
|
||||
|
||||
|
||||
/**
|
||||
* agv执行状态返回接口
|
||||
* @param request
|
||||
@@ -38,7 +43,6 @@ public class AgvController extends BaseController {
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* agv搬运作业
|
||||
* @param param{
|
||||
@@ -76,4 +80,33 @@ public class AgvController extends BaseController {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 前端手动操作完成/取消AGV作业时,请求rcs,取消当前AGV正执行的作业
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/cancelTask")
|
||||
public AjaxResult cancelTask(@RequestBody Map<String, String> param) {
|
||||
AgvQueue agvQueue = agvQueueService.selectAgvQueueByTaskCode(param.get("taskCode"));
|
||||
|
||||
if(agvQueue==null){
|
||||
return AjaxResult.error("AGV任务队列不存在!");
|
||||
}else{
|
||||
CancelTaskRequest cancelTaskRequest = new CancelTaskRequest();
|
||||
cancelTaskRequest.setReqCode(IdUtil.fastSimpleUUID());
|
||||
cancelTaskRequest.setReqTime(DateUtil.formatDateTime(DateUtil.date()));
|
||||
cancelTaskRequest.setTaskCode(agvQueue.getTaskCode());
|
||||
|
||||
//取消rcs中指定的agv任务
|
||||
CancelTaskResponse cancelTaskResponse = apiService.cancelTask(cancelTaskRequest);
|
||||
|
||||
if(cancelTaskResponse.getCode() == 0 && "成功".equals(cancelTaskResponse.getMessage()) && cancelTaskResponse.getReqCode() == cancelTaskRequest.getReqCode()){
|
||||
return AjaxResult.success("AGV任务队列取消成功!", cancelTaskResponse);
|
||||
}
|
||||
|
||||
return AjaxResult.error("取消RCS-AGV任务队列失败!");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -39,25 +39,29 @@ public class ScreenController extends BaseController {
|
||||
|
||||
// 静态初始化输送机编号数组
|
||||
static {
|
||||
// 1区域输送机编号
|
||||
// 区域输送机编号
|
||||
AREA_SSJ_CODES.put(1, Arrays.asList(
|
||||
"L2007", "L2008", "L2005", "L2006", "L2013"
|
||||
));
|
||||
|
||||
// 2区域输送机编号
|
||||
AREA_SSJ_CODES.put(2, Arrays.asList(
|
||||
"L2003", "L2004", "L2012", "L2001", "L2002"
|
||||
));
|
||||
|
||||
// 3区域输送机编号
|
||||
AREA_SSJ_CODES.put(3, Arrays.asList(
|
||||
"L1001", "L1002", "L1011"
|
||||
));
|
||||
|
||||
// 4区域输送机编号
|
||||
AREA_SSJ_CODES.put(4, Arrays.asList(
|
||||
"L1003", "L1004", "L1012"
|
||||
"L1001", "G1004"
|
||||
));
|
||||
// // 1区域输送机编号
|
||||
// AREA_SSJ_CODES.put(1, Arrays.asList(
|
||||
// "L2007", "L2008", "L2005", "L2006", "L2013"
|
||||
// ));
|
||||
//
|
||||
// // 2区域输送机编号
|
||||
// AREA_SSJ_CODES.put(2, Arrays.asList(
|
||||
// "L2003", "L2004", "L2012", "L2001", "L2002"
|
||||
// ));
|
||||
//
|
||||
// // 3区域输送机编号
|
||||
// AREA_SSJ_CODES.put(3, Arrays.asList(
|
||||
// "L1001", "L1002", "L1011"
|
||||
// ));
|
||||
//
|
||||
// // 4区域输送机编号
|
||||
// AREA_SSJ_CODES.put(4, Arrays.asList(
|
||||
// "L1003", "L1004", "L1012"
|
||||
// ));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -21,7 +21,7 @@ public class Wcs2WmsController {
|
||||
private IWcsPortService wcsPortService;
|
||||
|
||||
/**
|
||||
* 接收出库任务
|
||||
* 接收wms出库任务
|
||||
*
|
||||
* @param receiveOutJob
|
||||
* @return
|
||||
@@ -75,4 +75,5 @@ public class Wcs2WmsController {
|
||||
return apiService.updateWcsPort(wcsPort);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -8,7 +8,20 @@ import lombok.NoArgsConstructor;
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class JobParam {
|
||||
/**
|
||||
* 作业号
|
||||
*/
|
||||
private String jobId;
|
||||
|
||||
/**
|
||||
* 托盘号
|
||||
*/
|
||||
private String trayCode;
|
||||
|
||||
/**
|
||||
* 任务号
|
||||
*/
|
||||
private String taskNo;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -8,13 +8,48 @@ import lombok.NoArgsConstructor;
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class ReceiveJob {
|
||||
/**
|
||||
* 任务号
|
||||
*/
|
||||
private String taskNo;
|
||||
|
||||
/**
|
||||
* 货位
|
||||
*/
|
||||
private String cargoSpaceId;
|
||||
|
||||
/**
|
||||
* 出口
|
||||
*/
|
||||
private String exitId;
|
||||
|
||||
/**
|
||||
* 托盘号
|
||||
*/
|
||||
private String trayCode;
|
||||
|
||||
/**
|
||||
* 入口
|
||||
*/
|
||||
private String entranceId;
|
||||
|
||||
/**
|
||||
* 任务类型
|
||||
*/
|
||||
private String inOrOut;
|
||||
|
||||
/**
|
||||
* 作业号
|
||||
*/
|
||||
private String jobId;
|
||||
|
||||
/**
|
||||
* 巷道号
|
||||
*/
|
||||
private String roadwayId;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String departmentId;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.ruoyi.api.domain.wcs2wms.exception;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class TaskExceptionRequest {
|
||||
|
||||
/**
|
||||
* 任务号
|
||||
*/
|
||||
private String taskNo;
|
||||
|
||||
/**
|
||||
* 异常类型
|
||||
*/
|
||||
private int exceptionType;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.ruoyi.api.domain.wcs2wms.stockin;
|
||||
|
||||
public class StockinReceive {
|
||||
|
||||
/**
|
||||
* wms下发任务号
|
||||
*/
|
||||
private String taskNo;
|
||||
|
||||
/**
|
||||
* WMS分配的目标库位编号
|
||||
*/
|
||||
private String cargoSpaceId;
|
||||
|
||||
/**
|
||||
* 巷道编号
|
||||
*/
|
||||
private String roadwayId;
|
||||
|
||||
/**
|
||||
* 作业单ID
|
||||
*/
|
||||
private String jobId;
|
||||
|
||||
/**
|
||||
* 入出库标识
|
||||
*/
|
||||
private String inOrOut;
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.ruoyi.api.domain.wcs2wms.stockin;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 入库请求参数
|
||||
* (扫码失败、超重、超高时,WCS 仍调用此接口传递异常信息,WMS 记录异常但不返回任务号)
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class StockinRequest {
|
||||
|
||||
/**
|
||||
* 托盘号
|
||||
*/
|
||||
private String trayCode;
|
||||
|
||||
/**
|
||||
* 重量
|
||||
*/
|
||||
private int weight;
|
||||
|
||||
/**
|
||||
* 货物高度
|
||||
*/
|
||||
private int height;
|
||||
|
||||
/**
|
||||
* 异常信息
|
||||
*/
|
||||
private String errorInfo;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.ruoyi.api.domain.wcs2wms.taskFinish;
|
||||
|
||||
public class TaskFinishRequest {
|
||||
|
||||
/**
|
||||
* 任务号
|
||||
*/
|
||||
private String taskNo;
|
||||
|
||||
/**
|
||||
* 作业单ID
|
||||
*/
|
||||
private String jobId;
|
||||
|
||||
/**
|
||||
* 完成类型枚举值
|
||||
* 1-入库完成 2-出库完成
|
||||
*/
|
||||
private String type;
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package com.ruoyi.api.domain.wcs2wms.taskFinish;
|
||||
|
||||
public class taskFinishReceive {
|
||||
}
|
||||
@@ -11,8 +11,10 @@ import com.ruoyi.api.domain.agv.genAgvSchedulingTask.GenAgvSchedulingTaskRequest
|
||||
import com.ruoyi.api.domain.agv.genAgvSchedulingTask.GenAgvSchedulingTaskResponse;
|
||||
import com.ruoyi.api.domain.wcs2wms.JobParam;
|
||||
import com.ruoyi.api.domain.wcs2wms.ReceiveJob;
|
||||
import com.ruoyi.api.domain.wcs2wms.exception.TaskExceptionRequest;
|
||||
import com.ruoyi.bas.port.domain.WcsPort;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.exception.job.TaskException;
|
||||
import com.ruoyi.job.domain.MydoJob;
|
||||
import com.ruoyi.queue.agv.domain.AgvQueue;
|
||||
import org.aspectj.weaver.loadtime.Aj;
|
||||
@@ -42,12 +44,12 @@ public interface IApiService
|
||||
*/
|
||||
public AgvQueue createAgvQueue(String code1,String code2,String wmsTrayCode,String taskCode,String wmsTaskType,String traySize,String wmsTaskNo);
|
||||
|
||||
/**
|
||||
* 取消AGV任务
|
||||
*
|
||||
* @param cancelTaskRequest
|
||||
* @return
|
||||
*/
|
||||
/**
|
||||
* 取消AGV任务
|
||||
*
|
||||
* @param cancelTaskRequest
|
||||
* @return
|
||||
*/
|
||||
public CancelTaskResponse cancelTask(CancelTaskRequest cancelTaskRequest);
|
||||
|
||||
/**
|
||||
@@ -115,6 +117,13 @@ public interface IApiService
|
||||
*/
|
||||
AjaxResult reAssign(JobParam jobParam);
|
||||
|
||||
/**
|
||||
* 放货有货 (参数类型TaskExceptionRequest)
|
||||
* @param taskExceptionRequest
|
||||
* @return
|
||||
*/
|
||||
AjaxResult reAssign(TaskExceptionRequest taskExceptionRequest);
|
||||
|
||||
/**
|
||||
* 取货无货,重新分配单据
|
||||
* @param jobParam
|
||||
@@ -122,11 +131,23 @@ public interface IApiService
|
||||
*/
|
||||
AjaxResult reMaterial(JobParam jobParam);
|
||||
|
||||
/**
|
||||
* 取货无货(参数类型TaskExceptionRequest)
|
||||
* @param taskExceptionRequest
|
||||
* @return
|
||||
*/
|
||||
AjaxResult reMaterial(TaskExceptionRequest taskExceptionRequest);
|
||||
|
||||
/**
|
||||
* 入库请求生成作业
|
||||
*/
|
||||
public AjaxResult createInMydoJob(Map<String, Object> param);
|
||||
|
||||
/**
|
||||
* 入库请求作业异常反馈(扫码失败、外形、称重等异常)
|
||||
*/
|
||||
public AjaxResult createInMydoJobException(Map<String, Object> param);
|
||||
|
||||
public AjaxResult selectMydoJobByNoTrayCode(Map<String, Object> param);
|
||||
|
||||
AjaxResult receiveOutMydoJob(ReceiveJob receiveOutJob);
|
||||
@@ -136,4 +157,11 @@ public interface IApiService
|
||||
AjaxResult selectMydoJobByTrayCodeAndEntranceId(HashMap<String, Object> paramMap);
|
||||
|
||||
AjaxResult deleteAgvTray(AgvQueue agvQueue);
|
||||
|
||||
AjaxResult requestWmsSpace(MydoJob mydoJob);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ import com.ruoyi.api.domain.agv.genAgvSchedulingTask.GenAgvSchedulingTaskRespons
|
||||
import com.ruoyi.api.domain.agv.genAgvSchedulingTask.PositionCodeData;
|
||||
import com.ruoyi.api.domain.wcs2wms.JobParam;
|
||||
import com.ruoyi.api.domain.wcs2wms.ReceiveJob;
|
||||
import com.ruoyi.api.domain.wcs2wms.exception.TaskExceptionRequest;
|
||||
import com.ruoyi.api.service.IApiService;
|
||||
import com.ruoyi.bas.cargospace.service.IBasCargoSpaceService;
|
||||
import com.ruoyi.bas.port.domain.WcsPort;
|
||||
@@ -210,6 +211,7 @@ public class ApiServiceImpl implements IApiService {
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 取消ctu任务
|
||||
*
|
||||
@@ -236,6 +238,11 @@ public class ApiServiceImpl implements IApiService {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 异常重分(参数类型JobParam)
|
||||
* @param jobParam
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult reAssign(JobParam jobParam) {
|
||||
RequestLog requestLog = requestLogService.getRequestLog(RE_ASSIGN_URL, "重新分配货位", JSONUtil.toJsonStr(jobParam));
|
||||
@@ -250,6 +257,30 @@ public class ApiServiceImpl implements IApiService {
|
||||
return AjaxResult.error();
|
||||
}
|
||||
|
||||
/**
|
||||
* 异常重分(参数类型TaskExceptionRequest)
|
||||
* @param taskExceptionRequest
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult reAssign(TaskExceptionRequest taskExceptionRequest) {
|
||||
RequestLog requestLog = requestLogService.getRequestLog(WMS_TASK_EXCEPTION, "入库异常-重新分配货位", JSONUtil.toJsonStr(taskExceptionRequest));
|
||||
if ("1".equals(requestLog.getIsSuccessful())){
|
||||
InterfaceReceive bean = JSONUtil.toBean(requestLog.getResponseBody(), InterfaceReceive.class);
|
||||
MydoJob wmsMydoJob = BeanUtil.toBean(bean.getData(), MydoJob.class);
|
||||
MydoJob mydoJob = mydoJobService.selectMydoJobByJobId(wmsMydoJob.getJobId());
|
||||
mydoJob.setCargoSpaceId(wmsMydoJob.getCargoSpaceId());
|
||||
mydoJobService.updateMydoJob(mydoJob);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
return AjaxResult.error();
|
||||
}
|
||||
|
||||
/**
|
||||
* 出库异常作废(参数类型jobParam)
|
||||
* @param jobParam
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult reMaterial(JobParam jobParam) {
|
||||
RequestLog requestLog = requestLogService.getRequestLog(RE_MATERIAL_URL, "重新分配物料", JSONUtil.toJsonStr(jobParam));
|
||||
@@ -259,6 +290,22 @@ public class ApiServiceImpl implements IApiService {
|
||||
return AjaxResult.error();
|
||||
}
|
||||
|
||||
/**
|
||||
* 出库异常作废(参数类型TaskExceptionRequest)
|
||||
* @param taskExceptionRequest
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult reMaterial(TaskExceptionRequest taskExceptionRequest) {
|
||||
RequestLog requestLog = requestLogService.getRequestLog(WMS_TASK_EXCEPTION, "出库无货异常-任务作废", JSONUtil.toJsonStr(taskExceptionRequest));
|
||||
if ("1".equals(requestLog.getIsSuccessful())){
|
||||
return AjaxResult.success();
|
||||
}
|
||||
return AjaxResult.error();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 生成agv队列----临时修改起终点
|
||||
@@ -279,9 +326,21 @@ public class ApiServiceImpl implements IApiService {
|
||||
agvQueue.setReqTime(DateUtil.formatDateTime(DateUtil.date()));
|
||||
agvQueue.setAgvType("AGV");
|
||||
agvQueue.setPositionCode1(code1);
|
||||
agvQueue.setPositionCode2(code2);
|
||||
if("4".equals(traySize) && "L1001".equals(code2)){
|
||||
agvQueue.setPositionCode2("L1001-1");
|
||||
}else{
|
||||
agvQueue.setPositionCode2(code2);
|
||||
}
|
||||
|
||||
agvQueue.setTaskType("A22");
|
||||
agvQueue.setCtnrType("1");
|
||||
//rcslite开启托盘自动调整位置后 - 测试一巷道放货区分托盘类型
|
||||
if (traySize == "2" || traySize == "3") {
|
||||
agvQueue.setCtnrType("3");
|
||||
}else{
|
||||
agvQueue.setCtnrType("1");
|
||||
}
|
||||
|
||||
agvQueue.setCtnrCode(traySize);
|
||||
agvQueue.setCtnrNum("0");
|
||||
agvQueue.setTaskMode("0");
|
||||
@@ -296,6 +355,7 @@ public class ApiServiceImpl implements IApiService {
|
||||
return agvQueue;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 取消AGV任务
|
||||
*
|
||||
@@ -309,6 +369,7 @@ public class ApiServiceImpl implements IApiService {
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 继续agv任务
|
||||
*
|
||||
@@ -321,7 +382,7 @@ public class ApiServiceImpl implements IApiService {
|
||||
continueTaskRequest.setReqCode(IdUtil.fastSimpleUUID());
|
||||
continueTaskRequest.setReqTime(DateUtil.formatDateTime(DateUtil.date()));
|
||||
continueTaskRequest.setTaskCode(agvQueue.getTaskCode());
|
||||
RequestLog requestLog = requestLogService.getRequestLog(CONTINUE_TASK_URL, "继续执行任务", JSONUtil.toJsonStr(continueTaskRequest));
|
||||
RequestLog requestLog = requestLogService.getRequestLog2(CONTINUE_TASK_URL, "继续执行任务", JSONUtil.toJsonStr(continueTaskRequest));
|
||||
if ("1".equals(requestLog.getIsSuccessful())) {
|
||||
return AjaxResult.success();
|
||||
} else {
|
||||
@@ -353,9 +414,31 @@ public class ApiServiceImpl implements IApiService {
|
||||
return genAgvSchedulingTask(genAgvSchedulingTaskRequest);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 请求wms获取入库任务参数
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult createInMydoJob(Map<String, Object> param) {
|
||||
RequestLog requestLog = requestLogService.getRequestLog(CREATE_IN_MYDO_JOB_URL, "入库请求生成作业", JSONUtil.toJsonStr(param));
|
||||
RequestLog requestLog = requestLogService.getRequestLog(WMS_STOCKIN_MYDOJOB, "入库请求生成作业", JSONUtil.toJsonStr(param));
|
||||
if ("1".equals(requestLog.getIsSuccessful())) {
|
||||
InterfaceReceive bean = JSONUtil.toBean(requestLog.getResponseBody(), InterfaceReceive.class);
|
||||
return AjaxResult.success(bean.getData());
|
||||
} else {
|
||||
return AjaxResult.error();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 入库请求作业异常反馈(扫码失败、外形、称重等异常)
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult createInMydoJobException(Map<String, Object> param) {
|
||||
RequestLog requestLog = requestLogService.getRequestLog(WMS_STOCKIN_MYDOJOB, "入库异常反馈", JSONUtil.toJsonStr(param));
|
||||
if ("1".equals(requestLog.getIsSuccessful())) {
|
||||
InterfaceReceive bean = JSONUtil.toBean(requestLog.getResponseBody(), InterfaceReceive.class);
|
||||
return AjaxResult.success(bean.getData());
|
||||
@@ -367,21 +450,36 @@ public class ApiServiceImpl implements IApiService {
|
||||
|
||||
@Override
|
||||
public AjaxResult receiveOutMydoJob(ReceiveJob receiveOutJob) {
|
||||
|
||||
//检查任务是否存在,避免重复生成
|
||||
MydoJob job = new MydoJob();
|
||||
job.setTaskNo(receiveOutJob.getTaskNo());
|
||||
List<MydoJob> tasks = mydoJobService.selectMydoJobList(job);
|
||||
|
||||
//校验:任务已存在
|
||||
if (tasks.size() != 0) {
|
||||
log.info("【请求异常】wms下发出库任务失败,该任务已存在,单号:{},任务号:{}", receiveOutJob.getJobId(), receiveOutJob.getTaskNo());
|
||||
return AjaxResult.error("【请求异常】wms下发出库任务失败,该任务已存在,单号:" + receiveOutJob.getJobId() + ",任务号:" + receiveOutJob.getTaskNo());
|
||||
}
|
||||
|
||||
//生成出库作业
|
||||
MydoJob mydoJob = new MydoJob();
|
||||
mydoJob.setJobId(receiveOutJob.getJobId());
|
||||
mydoJob.setTaskNo(receiveOutJob.getTaskNo());
|
||||
mydoJob.setCargoSpaceId(receiveOutJob.getCargoSpaceId());
|
||||
mydoJob.setExitId(receiveOutJob.getExitId());
|
||||
mydoJob.setExitId("G1004");
|
||||
mydoJob.setInOrOut(receiveOutJob.getInOrOut());
|
||||
mydoJob.setStatus("1");
|
||||
mydoJob.setPriority(Long.valueOf(10));
|
||||
mydoJob.setTrayCode(receiveOutJob.getTrayCode());
|
||||
mydoJob.setRoadwayId(receiveOutJob.getRoadwayId());
|
||||
mydoJob.setCreateTime(DateUtils.getNowDate());
|
||||
mydoJob.setExecutionPhase(TASK_EP_CREATE);
|
||||
mydoJob.setTraySize(receiveOutJob.getDepartmentId());
|
||||
// mydoJob.setTraySize(receiveOutJob.getDepartmentId());
|
||||
int i = mydoJobService.insertMydoJob(mydoJob);
|
||||
if (i > 0) {
|
||||
return AjaxResult.success();
|
||||
return AjaxResult.success(
|
||||
"【请求成功】wms下发出库作业,作业单号:" + receiveOutJob.getJobId() + ",任务号:" + receiveOutJob.getTaskNo() + ",出库货位:" + receiveOutJob.getCargoSpaceId());
|
||||
}else{
|
||||
return AjaxResult.error();
|
||||
}
|
||||
@@ -403,7 +501,13 @@ public class ApiServiceImpl implements IApiService {
|
||||
return AjaxResult.error();
|
||||
}
|
||||
}
|
||||
//todo 新增agv站点
|
||||
|
||||
/**
|
||||
* AGV站点映射
|
||||
* @param agvQueue
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult deleteAgvTray(AgvQueue agvQueue) {
|
||||
Map<String, String> paramMap = new HashMap<>();
|
||||
@@ -417,10 +521,13 @@ public class ApiServiceImpl implements IApiService {
|
||||
if("L1003".equals(agvQueue.getPositionCode2())){
|
||||
paramMap.put("stgBinCode", "JT000206001013");
|
||||
}
|
||||
if("L1001-1".equals(agvQueue.getPositionCode2())){
|
||||
paramMap.put("stgBinCode", "JT000407001013");
|
||||
}
|
||||
// paramMap.put("binName", agvQueue.getPositionCode2());
|
||||
paramMap.put("indBind", "0");
|
||||
|
||||
RequestLog requestLog = requestLogService.getRequestLog(DELETE_BIN_URL, "AGV解绑容器", JSONUtil.toJsonStr(paramMap));
|
||||
RequestLog requestLog = requestLogService.getRequestLog2(DELETE_BIN_URL, "AGV解绑容器", JSONUtil.toJsonStr(paramMap));
|
||||
if ("1".equals(requestLog.getIsSuccessful())) {
|
||||
log.info("站点:"+agvQueue.getPositionCode2()+"{}AGV容器解绑成功!");
|
||||
return AjaxResult.success();
|
||||
@@ -430,6 +537,17 @@ public class ApiServiceImpl implements IApiService {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult requestWmsSpace(MydoJob mydoJob) {
|
||||
RequestLog requestLog = requestLogService.getRequestLog(REQUEST_IN_SPACE_URL, "入库请求分货位", JSONUtil.toJsonStr(mydoJob));
|
||||
if ("1".equals(requestLog.getIsSuccessful())) {
|
||||
InterfaceReceive bean = JSONUtil.toBean(requestLog.getResponseBody(), InterfaceReceive.class);
|
||||
return AjaxResult.success(bean.getData());
|
||||
} else {
|
||||
return AjaxResult.error();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public AjaxResult selectMydoJobByNoTrayCode(Map<String, Object> param) {
|
||||
@@ -457,4 +575,7 @@ public class ApiServiceImpl implements IApiService {
|
||||
return AjaxResult.error();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -115,7 +115,7 @@ public class RequestLogServiceImpl implements IRequestLogService
|
||||
* @return requestLog
|
||||
*/
|
||||
@Override
|
||||
public RequestLog getRequestLog(String url, String endPoint,String param) {
|
||||
public RequestLog getRequestLog(String url, String endPoint, String param) {
|
||||
RequestLog requestLog = new RequestLog();
|
||||
Date requestTime = new Date();
|
||||
requestLog.setRequestTime(DateUtil.format(requestTime, "yyyy-MM-dd HH:mm:ss"));
|
||||
@@ -157,7 +157,7 @@ public class RequestLogServiceImpl implements IRequestLogService
|
||||
}
|
||||
|
||||
@Override
|
||||
public RequestLog getRequestLog2(String url, String endPoint,String param) {
|
||||
public RequestLog getRequestLog2(String url, String endPoint, String param) {
|
||||
RequestLog requestLog = new RequestLog();
|
||||
Date requestTime = new Date();
|
||||
requestLog.setRequestTime(DateUtil.format(requestTime, "yyyy-MM-dd HH:mm:ss"));
|
||||
|
||||
@@ -60,4 +60,13 @@ public interface IBasCargoSpaceService
|
||||
public int deleteBasCargoSpaceByCargoSpaceId(String cargoSpaceId);
|
||||
|
||||
BasCargoSpace selectBasCargoSpaceByWmsCargoSpaceId(String cargoSpaceId);
|
||||
|
||||
|
||||
/**
|
||||
* 清空【出库无货】的异常库存 - 重置为空货位状态
|
||||
* @param cargoSpaceId
|
||||
* @return
|
||||
*/
|
||||
public int resetCargoSpaceByStockoutException(String cargoSpaceId);
|
||||
|
||||
}
|
||||
|
||||
@@ -95,4 +95,21 @@ public class BasCargoSpaceServiceImpl implements IBasCargoSpaceService
|
||||
public BasCargoSpace selectBasCargoSpaceByWmsCargoSpaceId(String cargoSpaceId) {
|
||||
return basCargoSpaceMapper.selectBasCargoSpaceByWmsCargoSpaceId(cargoSpaceId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 清空【出库无货】的异常库存
|
||||
* @param cargoSpaceId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public int resetCargoSpaceByStockoutException(String cargoSpaceId){
|
||||
//清空该异常货位库存信息
|
||||
BasCargoSpace cargoSpace = new BasCargoSpace();
|
||||
cargoSpace.setTrayCode("");
|
||||
cargoSpace.setStatus("1");
|
||||
cargoSpace.setCargoSpaceId(cargoSpaceId);
|
||||
return basCargoSpaceMapper.updateBasCargoSpace(cargoSpace);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ public class Constant {
|
||||
public static final String WMS_BASE_URL = "http://192.168.58.10:8082/api2wms/";
|
||||
public static final String RCS_BASE_URL = "http://192.168.58.101:8182/rcms/services/rest/hikRpcService/";
|
||||
|
||||
//#region AGV接口url
|
||||
public static final String GEN_AGV_SCHEDULING_TASK = RCS_BASE_URL+"genAgvSchedulingTask";
|
||||
public static final String CANCEL_TASK_URL = RCS_BASE_URL+"cancelTask";
|
||||
public static final String CONTINUE_TASK_URL = RCS_BASE_URL+"continueTask";
|
||||
@@ -17,6 +18,25 @@ public class Constant {
|
||||
public static final String RE_ASSIGN_URL = WMS_BASE_URL+"reAssign";
|
||||
public static final String RE_MATERIAL_URL = WMS_BASE_URL+"reMaterial";
|
||||
public static final String REQUEST_ENTER_URL = WMS_BASE_URL+"requestEnterByTrayCodeAndEntranceId";
|
||||
public static final String REQUEST_IN_SPACE_URL = WMS_BASE_URL+"requestInSpace";
|
||||
|
||||
//#endregion
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 向wms请求入库url
|
||||
*/
|
||||
public static final String WMS_STOCKIN_MYDOJOB = WMS_BASE_URL + "wcs/inbound/info";
|
||||
|
||||
/**
|
||||
* 向wms请求任务回传url
|
||||
*/
|
||||
public static final String WMS_TASK_FINISH = WMS_BASE_URL + "wcs/task/complete";
|
||||
|
||||
/**
|
||||
* 异常信息回传url
|
||||
*/
|
||||
public static final String WMS_TASK_EXCEPTION = WMS_BASE_URL + "wcs/exception/report";
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.ruoyi.common;
|
||||
|
||||
/**
|
||||
* 输送机报警
|
||||
*/
|
||||
public class ConvException {
|
||||
|
||||
/**
|
||||
* 外形检测异常
|
||||
*/
|
||||
public static final int CHECK_SIZE_EXCEPTION = 0;
|
||||
|
||||
|
||||
/**
|
||||
* 超重
|
||||
*/
|
||||
public static final int CHECK_OVERWEIGHT_EXCEPTION = 1;
|
||||
|
||||
/**
|
||||
* 扫码异常
|
||||
*/
|
||||
public static final int CHECK_BARCODE_EXCEPTION = 2;
|
||||
|
||||
/**
|
||||
* 输送机非自动
|
||||
*/
|
||||
public static final int CHECK_MODE_EXCEPTION = 3;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.ruoyi.common;
|
||||
|
||||
/**
|
||||
* 异常任务
|
||||
*/
|
||||
public class TaskExceptionType {
|
||||
|
||||
/**
|
||||
* 任务异常 - 入库放货有货
|
||||
*/
|
||||
public static final int TASK_EXCEPTION_STOCKIN_OCCUPIED = 1;
|
||||
|
||||
/**
|
||||
* 任务异常 - 出库取货无货
|
||||
*/
|
||||
public static final int TASK_EXCEPTION_STOCKOUT_EMPTY = 2;
|
||||
|
||||
|
||||
}
|
||||
@@ -5,11 +5,11 @@ public class TaskType {
|
||||
/**
|
||||
* 堆垛机任务类型
|
||||
*/
|
||||
//1-二楼双向
|
||||
//1-二楼入出
|
||||
public static final int DDJ_RWLX_1 = 1;
|
||||
//2-一楼单向
|
||||
//2-一楼出库
|
||||
public static final int DDJ_RWLX_2 = 2;
|
||||
//3-一楼双向
|
||||
//3-一楼入库
|
||||
public static final int DDJ_RWLX_3 = 3;
|
||||
|
||||
}
|
||||
|
||||
@@ -101,4 +101,15 @@ public class MsgDdjController extends BaseController
|
||||
{
|
||||
return toAjax(msgDdjService.deleteMsgDdjByIds(ids));
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/getStackerStatus/{id}")
|
||||
public MsgDdj getStackerStatus(@PathVariable Long id){
|
||||
if (id == 1) {
|
||||
return msgDdjService.selectMsgDdjById(id);
|
||||
}else{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -74,6 +74,9 @@ public class DeviceSsj extends BaseEntity
|
||||
@Excel(name = "任务号")
|
||||
private int taskNo;
|
||||
|
||||
/**
|
||||
* 输送机报警
|
||||
*/
|
||||
@Excel(name = "异常")
|
||||
private int exception;
|
||||
|
||||
@@ -87,4 +90,19 @@ public class DeviceSsj extends BaseEntity
|
||||
|
||||
private int taskNo2;
|
||||
|
||||
/**
|
||||
* 出入库模式
|
||||
*/
|
||||
private int inOrOut;
|
||||
|
||||
/**
|
||||
* 托盘高度
|
||||
*/
|
||||
private int height;
|
||||
|
||||
/**
|
||||
* 称重
|
||||
*/
|
||||
private int weight;
|
||||
|
||||
}
|
||||
|
||||
@@ -4,14 +4,7 @@ import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
@@ -113,4 +106,12 @@ public class MydoJobController extends BaseController
|
||||
{
|
||||
return toAjax(mydoJobService.deleteMydoJobByJobIds(jobIds));
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasAnyPermi('job:mydoJob:OuthandFinish')")
|
||||
@Log(title = "出库手动完成", businessType = BusinessType.OTHER)
|
||||
@RequestMapping("/OuthandFinish")
|
||||
public AjaxResult manualCompleted(@RequestParam("jobIds")String[] jobIds)
|
||||
{
|
||||
return mydoJobService.OuthandFinish(jobIds);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,6 +58,14 @@ public interface MydoJobMapper
|
||||
*/
|
||||
public int deleteMydoJobByJobId(String jobId);
|
||||
|
||||
/**
|
||||
* 删除作业信息
|
||||
*
|
||||
* @param taskNo 任务号主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMydoJobByTaskNo(String taskNo);
|
||||
|
||||
/**
|
||||
* 批量删除作业信息
|
||||
*
|
||||
@@ -70,7 +78,8 @@ public interface MydoJobMapper
|
||||
|
||||
void InvalidMydoJob(HashMap<String, Object> map);
|
||||
|
||||
MydoJob selectMydoJobByExitList(@Param("exitList") List<String> exitList);
|
||||
MydoJob selectMydoJobByExitList(@Param("exitList") List<String> exitList );
|
||||
MydoJob selectMydoJobByExitList1(@Param("exitId") String exitId ,@Param("roadwayId") String roadwayId);
|
||||
|
||||
void insertHistory(String jobId);
|
||||
|
||||
@@ -85,4 +94,10 @@ public interface MydoJobMapper
|
||||
List<MydoJob> getInJobByEntrance(@Param("exitList") List<String> exitList);
|
||||
|
||||
MydoJob selectJobByTaskNo(String taskNo);
|
||||
|
||||
MydoJob selectMydoJobByEntranceList1(@Param("entranceId") String entranceId);
|
||||
|
||||
List<MydoJob> getInJobByEntranceId(@Param("entranceId") String exitId);
|
||||
|
||||
MydoJob selectMydoJobByExitId(@Param("exitId") String exitId);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.ruoyi.job.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.job.domain.MydoJob;
|
||||
|
||||
/**
|
||||
@@ -66,6 +68,7 @@ public interface IMydoJobService
|
||||
boolean InvalidMydoJob(Long rwh, Integer id);
|
||||
|
||||
MydoJob selectMydoJobByExitList(List<String> exitList);
|
||||
MydoJob selectMydoJobByExitList1(String exitId,String roadwayId);
|
||||
|
||||
void insertHistory(String jobId);
|
||||
|
||||
@@ -80,4 +83,14 @@ public interface IMydoJobService
|
||||
List<MydoJob> getInJobByEntrance(List<String> exitList);
|
||||
|
||||
MydoJob selectJobByTaskNo(String taskNo);
|
||||
|
||||
MydoJob selectMydoJobByEntranceList1(String entranceId);
|
||||
|
||||
AjaxResult OuthandFinish(String[] jobIds);
|
||||
|
||||
public AjaxResult ManuelTaskFinish(String[] taskNos);
|
||||
|
||||
List<MydoJob> getInJobByEntranceId(String exitId);
|
||||
|
||||
MydoJob selectMydoJobByExitId(String exitId);
|
||||
}
|
||||
|
||||
@@ -1,11 +1,15 @@
|
||||
package com.ruoyi.job.service.impl;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import cn.hutool.core.convert.Convert;
|
||||
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 org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.job.mapper.MydoJobMapper;
|
||||
@@ -23,6 +27,8 @@ public class MydoJobServiceImpl implements IMydoJobService
|
||||
{
|
||||
@Autowired
|
||||
private MydoJobMapper mydoJobMapper;
|
||||
@Autowired
|
||||
private IJobCallBackService jobCallBackService;
|
||||
|
||||
/**
|
||||
* 查询作业信息
|
||||
@@ -70,6 +76,8 @@ public class MydoJobServiceImpl implements IMydoJobService
|
||||
@Override
|
||||
public int updateMydoJob(MydoJob mydoJob)
|
||||
{
|
||||
long priority = mydoJob.getPriority();
|
||||
mydoJob.setPriority(Math.abs(priority));
|
||||
return mydoJobMapper.updateMydoJob(mydoJob);
|
||||
}
|
||||
|
||||
@@ -82,6 +90,9 @@ public class MydoJobServiceImpl implements IMydoJobService
|
||||
@Override
|
||||
public int deleteMydoJobByJobIds(String[] jobIds)
|
||||
{
|
||||
for (String jobId : jobIds) {
|
||||
mydoJobMapper.insertHistory(jobId);
|
||||
}
|
||||
return mydoJobMapper.deleteMydoJobByJobIds(jobIds);
|
||||
}
|
||||
|
||||
@@ -122,7 +133,7 @@ public class MydoJobServiceImpl implements IMydoJobService
|
||||
map.put("v_rwh", rwh);
|
||||
map.put("v_ddj_id", id);
|
||||
mydoJobMapper.InvalidMydoJob(map);
|
||||
if (Convert.toInt(map.get("v_result"))==10){
|
||||
if (Convert.toInt(map.get("v_result")) == 10){
|
||||
return true;
|
||||
}else {
|
||||
throw new RuntimeException(map.get("v_result").toString());
|
||||
@@ -130,10 +141,15 @@ public class MydoJobServiceImpl implements IMydoJobService
|
||||
}
|
||||
|
||||
@Override
|
||||
public MydoJob selectMydoJobByExitList(List<String> exitList) {
|
||||
public MydoJob selectMydoJobByExitList(List<String> exitList ) {
|
||||
return mydoJobMapper.selectMydoJobByExitList(exitList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MydoJob selectMydoJobByExitList1(String exitId ,String roadwayId) {
|
||||
return mydoJobMapper.selectMydoJobByExitList1(exitId,roadwayId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void insertHistory(String jobId) {
|
||||
mydoJobMapper.insertHistory(jobId);
|
||||
@@ -149,6 +165,83 @@ public class MydoJobServiceImpl implements IMydoJobService
|
||||
return mydoJobMapper.selectMydoJobByEntranceList(entranceList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MydoJob selectMydoJobByEntranceList1(String entranceId) {
|
||||
return mydoJobMapper.selectMydoJobByEntranceList1(entranceId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 手动处理同一【作业单号】的作业
|
||||
* 如果【jobid】和【taskno】是一对多的情况,使用上一个方法<OuthandFinish>手动完成作业会导致整个【jobid】单据完成回传
|
||||
* @param jobIds
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult OuthandFinish(String[] jobIds) {
|
||||
//获取所有符合【任务单号】的作业
|
||||
for (String jobId : jobIds) {
|
||||
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.setMydojobId(mydoJob.getJobId());
|
||||
jobCallBack.setStatus("0");
|
||||
jobCallBack.setTaskNo(Convert.toLong(mydoJob.getTaskNo()));
|
||||
jobCallBack.setCreateTime(new Date());
|
||||
jobCallBack.setSpare1("0");
|
||||
jobCallBackService.insertJobCallBack(jobCallBack);
|
||||
mydoJobMapper.deleteMydoJobByJobId(jobId);
|
||||
}
|
||||
|
||||
return AjaxResult.success("操作成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 手动处理指定批量【任务号】的作业
|
||||
* @param taskNos
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult ManuelTaskFinish(String[] taskNos) {
|
||||
//todo 需要确定【jobid】是否由wms下发
|
||||
// 如果【jobid】和【taskno】是一对多的情况,使用上一个方法<OuthandFinish>手动完成作业会导致整个【jobid】单据完成回传
|
||||
// 如果【jobid】和【taskno】是一对一的情况,则直接使用<OuthandFinish>方法手动完成即可
|
||||
//获取所有符合【任务号】的作业
|
||||
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());
|
||||
jobCallBack.setSpare1("0");
|
||||
jobCallBackService.insertJobCallBack(jobCallBack);
|
||||
mydoJobMapper.deleteMydoJobByTaskNo(taskNo);
|
||||
}
|
||||
|
||||
return AjaxResult.success("操作成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MydoJob> getInJobByEntranceId(String exitId) {
|
||||
return mydoJobMapper.getInJobByEntranceId(exitId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MydoJob selectMydoJobByExitId(String exitId) {
|
||||
return mydoJobMapper.selectMydoJobByExitId(exitId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MydoJob> selectMydoJobFinishList(MydoJob mydoJob) {
|
||||
return mydoJobMapper.selectMydoJobFinishList(mydoJob);
|
||||
|
||||
@@ -70,4 +70,6 @@ public interface AgvQueueMapper
|
||||
void insertHistory(String reqCode);
|
||||
|
||||
AgvQueue selectAgvQueueByWmsTask(@Param("wmsTaskNo") int wmsTaskNo);
|
||||
|
||||
List<AgvQueue> selectAgvQueueList1(AgvQueue agvQueue);
|
||||
}
|
||||
|
||||
@@ -73,4 +73,6 @@ public interface IAgvQueueService
|
||||
void insertHistory(String reqCode);
|
||||
|
||||
AgvQueue selectAgvQueueByWmsTask(int taskNo);
|
||||
|
||||
List<AgvQueue> selectAgvQueueList1(AgvQueue agvQueue);
|
||||
}
|
||||
|
||||
@@ -43,6 +43,12 @@ public class AgvQueueServiceImpl implements IAgvQueueService
|
||||
return agvQueueMapper.selectAgvQueueList(agvQueue);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AgvQueue> selectAgvQueueList1(AgvQueue agvQueue)
|
||||
{
|
||||
return agvQueueMapper.selectAgvQueueList1(agvQueue);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增AGV任务队列
|
||||
*
|
||||
|
||||
@@ -88,9 +88,11 @@ public class DdjDeviceExecutionQueueController extends BaseController
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody DdjDeviceExecutionQueue ddjDeviceExecutionQueue)
|
||||
{
|
||||
ddjDeviceExecutionQueue.setDdjxf("0");
|
||||
return toAjax(ddjDeviceExecutionQueueService.updateDdjDeviceExecutionQueue(ddjDeviceExecutionQueue));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除堆垛机执行队列
|
||||
*/
|
||||
|
||||
@@ -43,6 +43,7 @@ public interface DdjDeviceExecutionQueueMapper
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDdjDeviceExecutionQueue(DdjDeviceExecutionQueue ddjDeviceExecutionQueue);
|
||||
public int updateDdjDeviceExecutionQueue1(DdjDeviceExecutionQueue ddjDeviceExecutionQueue);
|
||||
|
||||
/**
|
||||
* 删除堆垛机执行队列
|
||||
|
||||
@@ -67,6 +67,8 @@ public class DdjDeviceExecutionQueueServiceImpl implements IDdjDeviceExecutionQu
|
||||
return ddjDeviceExecutionQueueMapper.updateDdjDeviceExecutionQueue(ddjDeviceExecutionQueue);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 批量删除堆垛机执行队列
|
||||
*
|
||||
|
||||
@@ -12,12 +12,8 @@ import com.ruoyi.schedule.plcRead.ssj.PlcSsjRead;
|
||||
import com.ruoyi.common.domain.CustomThread;
|
||||
import com.ruoyi.schedule.scheduleTask.ddj.DdjThread;
|
||||
import com.ruoyi.schedule.scheduleTask.monit.MonitoringThread;
|
||||
import com.ruoyi.schedule.scheduleTask.ssj.floor1.Floor1BothWayInSsjThread;
|
||||
import com.ruoyi.schedule.scheduleTask.ssj.floor1.Floor1BothWayOutSsjThread;
|
||||
import com.ruoyi.schedule.scheduleTask.ssj.floor1.Floor1SingleSsjThread;
|
||||
import com.ruoyi.schedule.scheduleTask.ssj.floor2.Floor2InOutSsjThread;
|
||||
import com.ruoyi.schedule.scheduleTask.ssj.floor2.Floor2RoadWaySsjThread;
|
||||
import com.ruoyi.schedule.scheduleTask.ssj.floor2.LineSsjThread;
|
||||
import com.ruoyi.schedule.scheduleTask.ssj.PortConvThread;
|
||||
import com.ruoyi.schedule.scheduleTask.ssj.RoadConvThread;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -27,7 +23,6 @@ import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.OutputStream;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.net.Socket;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@@ -39,14 +34,11 @@ public class ScheduleThread {
|
||||
|
||||
public CustomThread<PlcSsjRead> plcSsjReadCustomThread;
|
||||
public CustomThread<PlcDdj1Read> plcDdj1ReadCustomThread;
|
||||
public CustomThread<PlcDdj2Read> plcDdj2ReadCustomThread;
|
||||
// public CustomThread<PlcDdj2Read> plcDdj2ReadCustomThread;
|
||||
|
||||
public CustomThread<PortConvThread> portConvCustomThread;
|
||||
public CustomThread<RoadConvThread> roadConvCustomThread;
|
||||
|
||||
public CustomThread<Floor1BothWayInSsjThread> floor1BothWayInSsjCustomThread;
|
||||
public CustomThread<Floor1BothWayOutSsjThread> floor1BothWayOutSsjCustomThread;
|
||||
public CustomThread<Floor1SingleSsjThread> floor1SingleSsjCustomThread;
|
||||
public CustomThread<Floor2InOutSsjThread> floor2InSsjCustomThread;
|
||||
public CustomThread<Floor2RoadWaySsjThread> floor2OutSsjCustomThread;
|
||||
public CustomThread<LineSsjThread> lineSsjCustomThread;
|
||||
public CustomThread<MonitoringThread> monitoringCustomThread;
|
||||
public CustomThread<DdjThread> ddj1CustomThread;
|
||||
@Autowired
|
||||
@@ -68,6 +60,9 @@ public class ScheduleThread {
|
||||
//调度初始化
|
||||
scheduleInit();
|
||||
log.info("调度服务执行成功");
|
||||
|
||||
startAllThread();
|
||||
startAllThread2();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -77,23 +72,11 @@ public class ScheduleThread {
|
||||
MonitoringThread monitoringThread = new MonitoringThread();
|
||||
monitoringCustomThread = new CustomThread<MonitoringThread>(new Thread(monitoringThread), monitoringThread);
|
||||
|
||||
Floor1BothWayInSsjThread floor1BothWayInSsjThread = new Floor1BothWayInSsjThread();
|
||||
floor1BothWayInSsjCustomThread = new CustomThread<Floor1BothWayInSsjThread>(new Thread(floor1BothWayInSsjThread), floor1BothWayInSsjThread);
|
||||
PortConvThread portConvThread = new PortConvThread();
|
||||
portConvCustomThread = new CustomThread<PortConvThread>(new Thread(portConvThread), portConvThread);
|
||||
|
||||
Floor1BothWayOutSsjThread floor1BothWayOutSsjThread = new Floor1BothWayOutSsjThread();
|
||||
floor1BothWayOutSsjCustomThread = new CustomThread<Floor1BothWayOutSsjThread>(new Thread(floor1BothWayOutSsjThread), floor1BothWayOutSsjThread);
|
||||
|
||||
Floor1SingleSsjThread floor1SingleSsjThread = new Floor1SingleSsjThread();
|
||||
floor1SingleSsjCustomThread = new CustomThread<Floor1SingleSsjThread>(new Thread(floor1SingleSsjThread), floor1SingleSsjThread);
|
||||
|
||||
Floor2InOutSsjThread floor2InSsjThread = new Floor2InOutSsjThread();
|
||||
floor2InSsjCustomThread = new CustomThread<Floor2InOutSsjThread>(new Thread(floor2InSsjThread), floor2InSsjThread);
|
||||
|
||||
LineSsjThread lineSsjThread = new LineSsjThread();
|
||||
lineSsjCustomThread = new CustomThread<LineSsjThread>(new Thread(lineSsjThread), lineSsjThread);
|
||||
|
||||
Floor2RoadWaySsjThread floor2OutSsjThread = new Floor2RoadWaySsjThread();
|
||||
floor2OutSsjCustomThread = new CustomThread<Floor2RoadWaySsjThread>(new Thread(floor2OutSsjThread), floor2OutSsjThread);
|
||||
RoadConvThread roadConvThread = new RoadConvThread();
|
||||
roadConvCustomThread = new CustomThread<RoadConvThread>(new Thread(roadConvThread), roadConvThread);
|
||||
|
||||
DdjThread ddj1Thread = new DdjThread();
|
||||
ddj1CustomThread = new CustomThread<DdjThread>(new Thread(ddj1Thread), ddj1Thread);
|
||||
@@ -116,7 +99,7 @@ public class ScheduleThread {
|
||||
|
||||
//获取堆垛机
|
||||
ConcurrentHashMap<String, MsgDdj> ddj1List = new ConcurrentHashMap<>();
|
||||
ConcurrentHashMap<String, MsgDdj> ddj2List = new ConcurrentHashMap<>();
|
||||
// ConcurrentHashMap<String, MsgDdj> ddj2List = new ConcurrentHashMap<>();
|
||||
List<MsgDdj> msgDdjs = msgDdjService.selectMsgDdjList(new MsgDdj());
|
||||
for (MsgDdj msgDdj : msgDdjs) {
|
||||
msgDdj.setPlcDbReadAddress(msgDdj.getPlcDbReadAddress());
|
||||
@@ -128,13 +111,13 @@ public class ScheduleThread {
|
||||
ddj1List.put("ddj1", msgDdj);
|
||||
PlcDdj1Read.deviceDdjMap = ddj1List;
|
||||
break;
|
||||
case 2:
|
||||
PlcDdj2Read plcDdj2Read = new PlcDdj2Read(msgDdj, new PlcConnectInfo(msgDdj.getIp(), Convert.toInt(msgDdj.getPort())));
|
||||
Thread plcDdj2ReadThread = new Thread(plcDdj2Read);
|
||||
plcDdj2ReadCustomThread = new CustomThread<PlcDdj2Read>(plcDdj2ReadThread, plcDdj2Read);
|
||||
ddj2List.put("ddj2", msgDdj);
|
||||
PlcDdj2Read.deviceDdjMap = ddj2List;
|
||||
break;
|
||||
// case 2:
|
||||
// PlcDdj2Read plcDdj2Read = new PlcDdj2Read(msgDdj, new PlcConnectInfo(msgDdj.getIp(), Convert.toInt(msgDdj.getPort())));
|
||||
// Thread plcDdj2ReadThread = new Thread(plcDdj2Read);
|
||||
// plcDdj2ReadCustomThread = new CustomThread<PlcDdj2Read>(plcDdj2ReadThread, plcDdj2Read);
|
||||
// ddj2List.put("ddj2", msgDdj);
|
||||
// PlcDdj2Read.deviceDdjMap = ddj2List;
|
||||
// break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -145,7 +128,7 @@ public class ScheduleThread {
|
||||
public void startAllThread() {
|
||||
plcSsjReadCustomThread.getThread().start();
|
||||
plcDdj1ReadCustomThread.getThread().start();
|
||||
plcDdj2ReadCustomThread.getThread().start();
|
||||
// plcDdj2ReadCustomThread.getThread().start();
|
||||
isRun = true;
|
||||
}
|
||||
|
||||
@@ -154,12 +137,8 @@ public class ScheduleThread {
|
||||
*/
|
||||
public void startAllThread2() {
|
||||
monitoringCustomThread.thread.start();
|
||||
floor1BothWayInSsjCustomThread.thread.start();
|
||||
floor1BothWayOutSsjCustomThread.thread.start();
|
||||
floor1SingleSsjCustomThread.thread.start();
|
||||
floor2InSsjCustomThread.thread.start();
|
||||
lineSsjCustomThread.thread.start();
|
||||
floor2OutSsjCustomThread.thread.start();
|
||||
portConvCustomThread.thread.start();
|
||||
roadConvCustomThread.thread.start();
|
||||
ddj1CustomThread.thread.start();
|
||||
isRun2 = true;
|
||||
}
|
||||
@@ -170,7 +149,7 @@ public class ScheduleThread {
|
||||
public void stopAllThread() {
|
||||
plcSsjReadCustomThread.runnable.isRun = false;
|
||||
plcDdj1ReadCustomThread.runnable.isRun = false;
|
||||
plcDdj2ReadCustomThread.runnable.isRun = false;
|
||||
// plcDdj2ReadCustomThread.runnable.isRun = false;
|
||||
plcReadInit();
|
||||
isRun = false;
|
||||
}
|
||||
@@ -180,12 +159,9 @@ public class ScheduleThread {
|
||||
*/
|
||||
public void stopAllThread2() {
|
||||
monitoringCustomThread.runnable.isRun = false;
|
||||
floor1BothWayInSsjCustomThread.runnable.isRun = false;
|
||||
floor1BothWayOutSsjCustomThread.runnable.isRun = false;
|
||||
floor1SingleSsjCustomThread.runnable.isRun = false;
|
||||
floor2InSsjCustomThread.runnable.isRun = false;
|
||||
lineSsjCustomThread.runnable.isRun = false;
|
||||
floor2OutSsjCustomThread.runnable.isRun = false;
|
||||
portConvCustomThread.runnable.isRun = false;
|
||||
roadConvCustomThread.runnable.isRun = false;
|
||||
|
||||
ddj1CustomThread.runnable.isRun = false;
|
||||
scheduleInit();
|
||||
isRun2 = false;
|
||||
@@ -216,11 +192,11 @@ public class ScheduleThread {
|
||||
|
||||
// String code = sendWeight("192.168.56.33", 2002);
|
||||
// System.err.println(code);
|
||||
String pp = "MODEL:EX-1203 COLOR:9005 SERIAL:QT25C1879 V:220 Hz:50 PH:1 N.W.:207kg G.W.:238kg @:9781C52TQ$S0T0T0T3T0U7T0$7005280MA0A@";
|
||||
String ss = "MODEL:TR-360 COLOR:7016 SERIAL:QT25C1899 V:380 Hz:50 PH:3 N.W.:231kg G.W.:261kg @:9981C52TQ$S0T0U5RDS2S3S6T0T3T0U7T0$4105230IF0A@";
|
||||
System.err.println(pp);
|
||||
System.err.println(pp.length());
|
||||
System.err.println(ss.length());
|
||||
// String pp = "MODEL:EX-1203 COLOR:9005 SERIAL:QT25C1879 V:220 Hz:50 PH:1 N.W.:207kg G.W.:238kg @:9781C52TQ$S0T0T0T3T0U7T0$7005280MA0A@";
|
||||
// String ss = "MODEL:TR-360 COLOR:7016 SERIAL:QT25C1899 V:380 Hz:50 PH:3 N.W.:231kg G.W.:261kg @:9981C52TQ$S0T0U5RDS2S3S6T0T3T0U7T0$4105230IF0A@";
|
||||
// System.err.println(pp);
|
||||
// System.err.println(pp.length());
|
||||
// System.err.println(ss.length());
|
||||
}
|
||||
|
||||
public static String sendWeight(String ip, int por) {
|
||||
|
||||
@@ -53,16 +53,10 @@ public class PlcSsjRead implements Runnable {
|
||||
DeviceSsj ssjDevice = deviceSsjMap.get(ssjCode);
|
||||
switch (ssjDevice.getType()) {
|
||||
case "1":
|
||||
readPlcSmSsj(ssjDevice);
|
||||
readPlcInOutSsj(ssjDevice);//出入口输送机
|
||||
break;
|
||||
case "2":
|
||||
readPlcInOutSsj(ssjDevice);
|
||||
break;
|
||||
case "3":
|
||||
readPlcOtherSsj(ssjDevice);
|
||||
break;
|
||||
case "4":
|
||||
readPlcRoadWaySsj(ssjDevice);
|
||||
readPlcRoadWaySsj(ssjDevice);//巷道输送机
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -81,6 +75,7 @@ public class PlcSsjRead implements Runnable {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 其他输送机
|
||||
*
|
||||
@@ -97,22 +92,6 @@ public class PlcSsjRead implements Runnable {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 巷道输送机
|
||||
*
|
||||
* @param ssjDevice
|
||||
*/
|
||||
private void readPlcRoadWaySsj(DeviceSsj ssjDevice) {
|
||||
OperateResultExOne<byte[]> read2 = readWriteNet.Read(ssjDevice.getPlcDbReadAddress(), Short.parseShort("10"));
|
||||
String ddsx1 = "0";
|
||||
if (read2.IsSuccess) {
|
||||
ddsx1 = SoftBasic.ByteToHexString(read2.Content);
|
||||
ssjDevice.setDw(ParseUtil.optInt(0, ddsx1));
|
||||
ssjDevice.setKx(ParseUtil.optInt(2, ddsx1));
|
||||
ssjDevice.setTaskNo(ParseUtil.optDInt(4, ddsx1));
|
||||
ssjDevice.setSszt(ParseUtil.optInt(8, ddsx1));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 入出库输送机
|
||||
@@ -134,6 +113,25 @@ public class PlcSsjRead implements Runnable {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 巷道输送机
|
||||
*
|
||||
* @param ssjDevice
|
||||
*/
|
||||
private void readPlcRoadWaySsj(DeviceSsj ssjDevice) {
|
||||
OperateResultExOne<byte[]> read2 = readWriteNet.Read(ssjDevice.getPlcDbReadAddress(), Short.parseShort("10"));
|
||||
String ddsx1 = "0";
|
||||
if (read2.IsSuccess) {
|
||||
ddsx1 = SoftBasic.ByteToHexString(read2.Content);
|
||||
ssjDevice.setDw(ParseUtil.optInt(0, ddsx1));
|
||||
ssjDevice.setKx(ParseUtil.optInt(2, ddsx1));
|
||||
ssjDevice.setTaskNo(ParseUtil.optDInt(4, ddsx1));
|
||||
ssjDevice.setSszt(ParseUtil.optInt(8, ddsx1));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 产线输送机
|
||||
*
|
||||
@@ -150,6 +148,7 @@ public class PlcSsjRead implements Runnable {
|
||||
ssjDevice.setSszt(ParseUtil.optInt(8, ddsx1));
|
||||
ssjDevice.setRkqq(ParseUtil.optInt(10, ddsx1));
|
||||
ssjDevice.setTraySize(ParseUtil.optInt(12, ddsx1));
|
||||
ssjDevice.setInOrOut(ParseUtil.optInt(24, ddsx1));
|
||||
ssjDevice.setException(ParseUtil.optInt(28, ddsx1));
|
||||
|
||||
String trayCodeReadAddress="";
|
||||
@@ -183,20 +182,8 @@ public class PlcSsjRead implements Runnable {
|
||||
ssjDevice.setAllowPut(ParseUtil.optInt(0, ddsx1));
|
||||
}
|
||||
}
|
||||
if(!"".equals(trayCodeReadAddress)){
|
||||
OperateResultExOne<byte[]> trayCodeRead = readWriteNet.Read(trayCodeReadAddress, Short.parseShort("200"));
|
||||
if (trayCodeRead.IsSuccess){
|
||||
byte[] content = trayCodeRead.Content;
|
||||
//去除bytes中
|
||||
ssjDevice.setTrayCode(ParseUtil.filterAndConvert(trayCodeRead.Content));
|
||||
// if("L2004".equals(ssjDevice.getDeviceCode())){
|
||||
// ssjDevice.setTrayCode("gMODEL:1 COLOR:1 SERIAL:2 V:1 Hz:1 PH:1 N.W.:1 G.W.:1 ITEM_CODE:12345 @:1$S0T0S1T0S1T0S1T0$40001015202@");
|
||||
// }else{
|
||||
// ssjDevice.setTrayCode("gMODEL:1 COLOR:1 SERIAL:1 V:1 Hz:1 PH:1 N.W.:1 G.W.:1 ITEM_CODE:123456 @:1$S0T0S1T0S1T0S1T0$40001015202@");
|
||||
// }
|
||||
}
|
||||
}
|
||||
OperateResultExOne<byte[]> agvSsjTask = readWriteNet.Read("DB501.280", Short.parseShort("8"));
|
||||
|
||||
OperateResultExOne<byte[]> agvSsjTask = readWriteNet.Read("DB501.280", Short.parseShort("16"));
|
||||
String ddsx2 = "0";
|
||||
if (agvSsjTask.IsSuccess) {
|
||||
ddsx2 = SoftBasic.ByteToHexString(agvSsjTask.Content);
|
||||
@@ -206,6 +193,12 @@ public class PlcSsjRead implements Runnable {
|
||||
if("L1003".equals(ssjDevice.getDeviceCode())){
|
||||
ssjDevice.setTaskNo2(ParseUtil.optDInt(4, ddsx2));
|
||||
}
|
||||
if("L2004".equals(ssjDevice.getDeviceCode())){
|
||||
ssjDevice.setTaskNo2(ParseUtil.optDInt(8, ddsx2));
|
||||
}
|
||||
if("L2006".equals(ssjDevice.getDeviceCode())){
|
||||
ssjDevice.setTaskNo2(ParseUtil.optDInt(12, ddsx2));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,16 +1,19 @@
|
||||
package com.ruoyi.schedule.scheduleTask.ddj;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjUtil;
|
||||
import com.ruoyi.api.domain.wcs2wms.JobParam;
|
||||
import com.ruoyi.api.domain.wcs2wms.exception.TaskExceptionRequest;
|
||||
import com.ruoyi.api.service.IApiService;
|
||||
import com.ruoyi.bas.cargospace.domain.BasCargoSpace;
|
||||
import com.ruoyi.bas.cargospace.service.IBasCargoSpaceService;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.utils.spring.SpringUtils;
|
||||
import com.ruoyi.device.ddj.domain.MsgDdj;
|
||||
import com.ruoyi.device.ssj.service.IDeviceSsjService;
|
||||
import com.ruoyi.job.domain.MydoJob;
|
||||
import com.ruoyi.job.service.IMydoJobService;
|
||||
import com.ruoyi.queue.ddj.domain.DdjDeviceExecutionQueue;
|
||||
@@ -25,6 +28,9 @@ import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import static com.ruoyi.common.TaskExceptionType.TASK_EXCEPTION_STOCKIN_OCCUPIED;
|
||||
import static com.ruoyi.common.TaskExceptionType.TASK_EXCEPTION_STOCKOUT_EMPTY;
|
||||
|
||||
|
||||
@Slf4j
|
||||
public class DdjThread implements Runnable {
|
||||
@@ -37,6 +43,7 @@ public class DdjThread implements Runnable {
|
||||
private IMydoJobService mydoJobService;
|
||||
private IBasCargoSpaceService basCargoSpaceService;
|
||||
|
||||
|
||||
public boolean isRun = true;
|
||||
|
||||
|
||||
@@ -45,7 +52,7 @@ public class DdjThread implements Runnable {
|
||||
ddjCodeList = new HashMap<>();
|
||||
ArrayList<String> ddjCodes = new ArrayList<>();
|
||||
ddjCodes.add("ddj1");
|
||||
ddjCodes.add("ddj2");
|
||||
// ddjCodes.add("ddj2");
|
||||
ddjCodeList.put("ddj", ddjCodes);
|
||||
|
||||
apiService = SpringUtils.getBean(IApiService.class);
|
||||
@@ -69,9 +76,9 @@ public class DdjThread implements Runnable {
|
||||
ddjTask(PlcDdj1Read.deviceDdjMap.get(ddjCode));
|
||||
}
|
||||
//PlcDdj2Read.deviceDdjMap.containsKey(ddjCode)
|
||||
if ("ddj2".equals(ddjCode)) {
|
||||
ddjTask(PlcDdj2Read.deviceDdjMap.get(ddjCode));
|
||||
}
|
||||
// if ("ddj2".equals(ddjCode)) {
|
||||
// ddjTask(PlcDdj2Read.deviceDdjMap.get(ddjCode));
|
||||
// }
|
||||
} catch (RuntimeException e) {
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
@@ -89,16 +96,21 @@ public class DdjThread implements Runnable {
|
||||
}
|
||||
|
||||
private void ddjTask(MsgDdj ddj) {
|
||||
/*
|
||||
第一部分
|
||||
/* --------------------------------------【1 处理已经完成的作业】--------------------------------------
|
||||
堆垛机线程进来后第一件事先进行堆垛机正执行任务的账务处理
|
||||
以防存在漏处理,没处理的情况发生
|
||||
*/
|
||||
if (ddj.getCzfs() == 5 && ddj.getSbzt() == 0 && ddj.getJdbz() == 5) {
|
||||
|
||||
// 检查当前堆垛机参数 - 是否有执行中的作业
|
||||
// 1.联机自动【5】 2.设备状态【0】 3.执行阶段【0】【5】(无执行中的任务)
|
||||
if (ddj.getCzfs() == 5 && ddj.getSbzt() == 0 && (ddj.getJdbz() == 5 || ddj.getJdbz() == 0)) {
|
||||
Long rwh = ddj.getRwh();
|
||||
|
||||
//完成作业
|
||||
MydoJob mydoJob = mydoJobService.selectMydoJobByTaskNo(rwh);
|
||||
DdjDeviceExecutionQueue ddjDeviceExecutionQueue = ddjDeviceExecutionQueueService.selectDdjDeviceExecutionQueueByRwh(rwh,ddj.getId());
|
||||
|
||||
//满足上述条件,表示该任务已完成-执行任务回传
|
||||
if (mydoJob != null && ddjDeviceExecutionQueue != null) {
|
||||
//回传完成信号
|
||||
ddjTaskFinish(rwh, ddj.getId());
|
||||
@@ -106,15 +118,14 @@ public class DdjThread implements Runnable {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
第二部分
|
||||
跟踪队列执行阶段
|
||||
*/
|
||||
//-------------------------------------- 【2 更新执行阶段】 --------------------------------------
|
||||
|
||||
// 1.联机自动【5】 2.设备状态 - 运行中【1】 3.执行阶段【2】
|
||||
if (ddj.getCzfs() == 5 && ddj.getSbzt() == 1 && ddj.getJdbz() == 2) {
|
||||
//根据堆垛机上任务号,修改任务执行阶段
|
||||
Long rwh = ddj.getRwh();
|
||||
DdjDeviceExecutionQueue ddjDeviceExecutionQueue = ddjDeviceExecutionQueueService.selectDdjDeviceExecutionQueueByRwh(rwh, ddj.getId());
|
||||
if (ddjDeviceExecutionQueue != null) {
|
||||
if (ddjDeviceExecutionQueue != null && !"1".equals(ddjDeviceExecutionQueue.getSpare1())) {
|
||||
//修改队列执行阶段
|
||||
ddjDeviceExecutionQueue.setRwzt(ddj.getJdbz());
|
||||
ddjDeviceExecutionQueue.setSpare1("1");
|
||||
@@ -122,65 +133,88 @@ public class DdjThread implements Runnable {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
第三部分
|
||||
放货有货,重新分配货位
|
||||
*/
|
||||
/* -------------------------------------- 【3 放货有货,重新分配货位】-------------------------------------- */
|
||||
|
||||
// 1.联机自动【5】 2.设备状态-放货有货【1052】 3.执行阶段【0】【5】(无执行中的任务)
|
||||
if (ddj.getCzfs() == 5 && ddj.getSbzt() == 1052 && ddj.getJdbz() < 5 && ddj.getYxxf() == 1) {
|
||||
//判断堆垛机上任务是否已重分,若未重分,则调用接口,请求重分货位
|
||||
|
||||
// 判断堆垛机上任务是否已重分,若未重分,则调用接口,请求重分货位
|
||||
Long rwh = ddj.getRwh();
|
||||
|
||||
//获取堆垛机正在执行中的任务和队列
|
||||
MydoJob mydoJob = mydoJobService.selectMydoJobByTaskNo(rwh);
|
||||
DdjDeviceExecutionQueue ddjDeviceExecutionQueue = ddjDeviceExecutionQueueService.selectDdjDeviceExecutionQueueByRwh(rwh, ddj.getId());
|
||||
|
||||
//更新异常类型【FaultFlag】-1
|
||||
if ("0".equals(mydoJob.getFaultFlag()) && "1".equals(ddjDeviceExecutionQueue.getSpare1())) {
|
||||
mydoJob.setStatus("1");
|
||||
mydoJobService.updateMydoJob(mydoJob);
|
||||
AjaxResult ajaxResult = apiService.reAssign(new JobParam(mydoJob.getJobId(), null, null));
|
||||
|
||||
//向wms请求重分接口
|
||||
// todo-在此商定每种异常类型对应的值
|
||||
AjaxResult ajaxResult = apiService.reAssign(new TaskExceptionRequest(mydoJob.getTaskNo(),TASK_EXCEPTION_STOCKIN_OCCUPIED));
|
||||
if (ajaxResult.isSuccess()){
|
||||
//获取返回的新货位
|
||||
MydoJob mydoJobReAssign = BeanUtil.toBean(ajaxResult.get("data"), MydoJob.class);
|
||||
|
||||
//更新任务参数
|
||||
mydoJob = mydoJobService.selectMydoJobByTaskNo(rwh);
|
||||
mydoJob.setCargoSpaceId(mydoJobReAssign.getCargoSpaceId());
|
||||
mydoJob.setFaultFlag("2");
|
||||
mydoJobService.updateMydoJob(mydoJob);
|
||||
|
||||
//获取重分的货位重新向堆垛机下发任务
|
||||
BasCargoSpace basCargoSpace = basCargoSpaceService.selectBasCargoSpaceByWmsCargoSpaceId(mydoJob.getCargoSpaceId());
|
||||
ddjDeviceExecutionQueue.setMbph(basCargoSpace.getThePlatoon());
|
||||
ddjDeviceExecutionQueue.setMblh(basCargoSpace.getTheColumn());
|
||||
ddjDeviceExecutionQueue.setMbch(basCargoSpace.getTheFloor());
|
||||
ddjDeviceExecutionQueue.setSpare1("0");
|
||||
ddjDeviceExecutionQueue.setDdjxf("0");
|
||||
ddjDeviceExecutionQueueService.updateDdjDeviceExecutionQueue(ddjDeviceExecutionQueue);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
第四部分
|
||||
取货无货,重新分配单据
|
||||
*/
|
||||
|
||||
// -------------------------------------- 4 取货无货,作废当前任务,重新分配单据 --------------------------------------
|
||||
|
||||
// 1.联机自动【5】 2.设备状态-取货无货【1053】 3.执行阶段【<5】(任务执行中)
|
||||
if (ddj.getCzfs() == 5 && ddj.getSbzt() == 1053 && ddj.getJdbz() < 5) {
|
||||
Long rwh = ddj.getRwh();
|
||||
MydoJob mydoJob = mydoJobService.selectMydoJobByTaskNo(rwh);
|
||||
|
||||
//无货异常处理
|
||||
DdjDeviceExecutionQueue ddjDeviceExecutionQueue = ddjDeviceExecutionQueueService.selectDdjDeviceExecutionQueueByRwh(rwh,ddj.getId());
|
||||
|
||||
//找到对应任务 调用api接口 取货无货,重新分配单据
|
||||
if (ObjUtil.isNotNull(ddjDeviceExecutionQueue)) {
|
||||
AjaxResult ajaxResult = apiService.reMaterial(new JobParam(rwh.toString(), null, null));
|
||||
//向wms返回异常信息
|
||||
AjaxResult ajaxResult = apiService.reMaterial(new TaskExceptionRequest(mydoJob.getTaskNo(),TASK_EXCEPTION_STOCKOUT_EMPTY));
|
||||
if (ajaxResult.isSuccess()) {
|
||||
//作废作业
|
||||
InvalidMydoJob(rwh, ddj.getId());
|
||||
//删除队列
|
||||
ddjDeviceExecutionQueueService.deleteDdjDeviceExecutionQueueByUuid(ddjDeviceExecutionQueue.getUuid());
|
||||
|
||||
//重置【取货无货】的出库异常货位库存信息
|
||||
// basCargoSpaceService.resetCargoSpaceByStockoutException(mydoJob.getCargoSpaceId());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
第五部分
|
||||
堆垛机任务下发
|
||||
*/
|
||||
// -------------------------------------- 5 下发堆垛机任务 --------------------------------------
|
||||
|
||||
//重分货位后重下
|
||||
if (ddj.getYxxf() == 1 && ddj.getCzfs() == 5 && ddj.getSbzt() == 1052) {
|
||||
Long rwh = ddj.getRwh();
|
||||
//查询作业
|
||||
|
||||
//查询执行中的作业
|
||||
MydoJob mydoJob = mydoJobService.selectMydoJobByTaskNo(rwh);
|
||||
|
||||
//该任务存在且【FaultFlag】为 2-已重分完成
|
||||
if (ObjUtil.isNotNull(mydoJob) && "2".equals(mydoJob.getFaultFlag())) {
|
||||
|
||||
//判断任务是否重分完成
|
||||
DdjDeviceExecutionQueue ddjDeviceExecutionQueue = ddjDeviceExecutionQueueService.selectDdjDeviceExecutionQueueByRwh(rwh,ddj.getId());
|
||||
if (ObjUtil.isNotNull(ddjDeviceExecutionQueue) && "0".equals(ddjDeviceExecutionQueue.getSpare1())) {
|
||||
if (ObjUtil.isNotNull(ddjDeviceExecutionQueue) && "0".equals(ddjDeviceExecutionQueue.getDdjxf())) {
|
||||
|
||||
//重新下发堆垛机任务
|
||||
int i = issuedDDJTask(ddj.getId(), ddjDeviceExecutionQueue);
|
||||
if (i == 1) {
|
||||
@@ -190,15 +224,17 @@ public class DdjThread implements Runnable {
|
||||
ddjDeviceExecutionQueueService.updateDdjDeviceExecutionQueue(ddjDeviceExecutionQueue);
|
||||
mydoJob.setFaultFlag("0");
|
||||
mydoJobService.updateMydoJob(mydoJob);
|
||||
log.info("托盘堆垛机重新下发任务成功 rwh:{}", rwh);
|
||||
log.info("堆垛机放货目标有货,重分货位下发任务成功 rwh:{}", rwh);
|
||||
} else {
|
||||
log.error("托盘堆垛机重新下发任务失败!!!!!!!");
|
||||
log.error("堆垛机放货目标有货,重分货位下发任务失败!!!!!!!");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//正常下发
|
||||
if (ddj.getYxxf() == 1 && ddj.getCzfs() == 5 && ddj.getSbzt() == 0) {
|
||||
if (ddj.getYxxf() == 1 && ddj.getCzfs() == 5 && ddj.getSbzt() == 0 ) {
|
||||
//检查是否有正在执行的堆垛机队列
|
||||
Long rwh = ddj.getRwh();
|
||||
DdjDeviceExecutionQueue ddjDeviceExecutionQueueRunningParam = new DdjDeviceExecutionQueue();
|
||||
ddjDeviceExecutionQueueRunningParam.setDdjxf("1");
|
||||
@@ -215,6 +251,7 @@ public class DdjThread implements Runnable {
|
||||
ddjDeviceExecutionQueueParam.setDdjxf("0");
|
||||
ddjDeviceExecutionQueueParam.setDevId(ddj.getId());
|
||||
List<DdjDeviceExecutionQueue> ddjDeviceExecutionQueues = ddjDeviceExecutionQueueService.selectDdjDeviceExecutionQueueList(ddjDeviceExecutionQueueParam);
|
||||
|
||||
//取堆垛机队列中,生成时间最早的执行队列下发
|
||||
if (CollUtil.isNotEmpty(ddjDeviceExecutionQueues)) {
|
||||
DdjDeviceExecutionQueue ddjDeviceExecutionQueue = ddjDeviceExecutionQueues.get(0);
|
||||
@@ -224,9 +261,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("堆垛机下发任务成功 rwh:{}", ddjDeviceExecutionQueue.getRwh());
|
||||
} else {
|
||||
log.error("托盘堆垛机下发任务失败!!!!!!!");
|
||||
log.error("堆垛机下发任务失败!!!!!!!");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -280,4 +317,6 @@ public class DdjThread implements Runnable {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -87,46 +87,46 @@ public class MonitoringThread implements Runnable {
|
||||
}
|
||||
}
|
||||
}
|
||||
for (String ddjCode : PlcDdj2Read.deviceDdjMap.keySet()) {
|
||||
MsgDdj msgDdj = PlcDdj2Read.deviceDdjMap.get(ddjCode);
|
||||
msgDdjService.updateMsgDdj(msgDdj);
|
||||
|
||||
if (msgDdj.getSbzt() > 1000) {
|
||||
BasFaultRecord param = new BasFaultRecord();
|
||||
param.setTaskNo(msgDdj.getRwh() + "");
|
||||
param.setDeviceId(String.valueOf(msgDdj.getId()));
|
||||
param.setDeviceType("DDJ");
|
||||
param.setFault(msgDdj.getSbzt() + "");
|
||||
param.setJobId("0");
|
||||
List<BasFaultRecord> basFaultRecords = basFaultRecordService.selectBasFaultRecordList(param);
|
||||
if (CollUtil.isEmpty(basFaultRecords)) {
|
||||
BasFaultRecord faultRecord = new BasFaultRecord();
|
||||
faultRecord.setId(IdUtil.fastSimpleUUID());
|
||||
faultRecord.setDeviceId(String.valueOf(msgDdj.getId()));
|
||||
faultRecord.setDeviceName(msgDdj.getName());
|
||||
faultRecord.setDeviceType("DDJ");
|
||||
faultRecord.setJobId("0");
|
||||
faultRecord.setTaskNo(msgDdj.getRwh() + "");
|
||||
faultRecord.setFault(msgDdj.getSbzt() + "");
|
||||
faultRecord.setStartTime(DateUtil.formatDateTime(DateUtil.date()));
|
||||
//faultRecord.setWarehouseId(mydoJob.getWarehouseId());
|
||||
basFaultRecordService.insertBasFaultRecord(faultRecord);
|
||||
}
|
||||
}
|
||||
if (msgDdj.getSbzt() < 1000 && msgDdj.getCzfs() == 5){
|
||||
BasFaultRecord param = new BasFaultRecord();
|
||||
param.setDeviceId(String.valueOf(msgDdj.getId()));
|
||||
param.setDeviceType("DDJ");
|
||||
param.setJobId("0");
|
||||
List<BasFaultRecord> basFaultRecords = basFaultRecordService.selectBasFaultRecordList(param);
|
||||
if (CollUtil.isNotEmpty(basFaultRecords)) {
|
||||
BasFaultRecord faultRecord = basFaultRecords.get(0);
|
||||
faultRecord.setJobId("1");
|
||||
faultRecord.setFinishTime(DateUtil.formatDateTime(DateUtil.date()));
|
||||
basFaultRecordService.updateBasFaultRecord(faultRecord);
|
||||
}
|
||||
}
|
||||
}
|
||||
// for (String ddjCode : PlcDdj2Read.deviceDdjMap.keySet()) {
|
||||
// MsgDdj msgDdj = PlcDdj2Read.deviceDdjMap.get(ddjCode);
|
||||
// msgDdjService.updateMsgDdj(msgDdj);
|
||||
//
|
||||
// if (msgDdj.getSbzt() > 1000) {
|
||||
// BasFaultRecord param = new BasFaultRecord();
|
||||
// param.setTaskNo(msgDdj.getRwh() + "");
|
||||
// param.setDeviceId(String.valueOf(msgDdj.getId()));
|
||||
// param.setDeviceType("DDJ");
|
||||
// param.setFault(msgDdj.getSbzt() + "");
|
||||
// param.setJobId("0");
|
||||
// List<BasFaultRecord> basFaultRecords = basFaultRecordService.selectBasFaultRecordList(param);
|
||||
// if (CollUtil.isEmpty(basFaultRecords)) {
|
||||
// BasFaultRecord faultRecord = new BasFaultRecord();
|
||||
// faultRecord.setId(IdUtil.fastSimpleUUID());
|
||||
// faultRecord.setDeviceId(String.valueOf(msgDdj.getId()));
|
||||
// faultRecord.setDeviceName(msgDdj.getName());
|
||||
// faultRecord.setDeviceType("DDJ");
|
||||
// faultRecord.setJobId("0");
|
||||
// faultRecord.setTaskNo(msgDdj.getRwh() + "");
|
||||
// faultRecord.setFault(msgDdj.getSbzt() + "");
|
||||
// faultRecord.setStartTime(DateUtil.formatDateTime(DateUtil.date()));
|
||||
// //faultRecord.setWarehouseId(mydoJob.getWarehouseId());
|
||||
// basFaultRecordService.insertBasFaultRecord(faultRecord);
|
||||
// }
|
||||
// }
|
||||
// if (msgDdj.getSbzt() < 1000 && msgDdj.getCzfs() == 5){
|
||||
// BasFaultRecord param = new BasFaultRecord();
|
||||
// param.setDeviceId(String.valueOf(msgDdj.getId()));
|
||||
// param.setDeviceType("DDJ");
|
||||
// param.setJobId("0");
|
||||
// List<BasFaultRecord> basFaultRecords = basFaultRecordService.selectBasFaultRecordList(param);
|
||||
// if (CollUtil.isNotEmpty(basFaultRecords)) {
|
||||
// BasFaultRecord faultRecord = basFaultRecords.get(0);
|
||||
// faultRecord.setJobId("1");
|
||||
// faultRecord.setFinishTime(DateUtil.formatDateTime(DateUtil.date()));
|
||||
// basFaultRecordService.updateBasFaultRecord(faultRecord);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
try {
|
||||
Thread.sleep(1500);
|
||||
} catch (InterruptedException e) {
|
||||
|
||||
@@ -1,28 +1,23 @@
|
||||
package com.ruoyi.schedule.scheduleTask.ssj.floor2;
|
||||
package com.ruoyi.schedule.scheduleTask.ssj;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.ruoyi.api.service.IApiService;
|
||||
import com.ruoyi.bas.port.domain.WcsPort;
|
||||
import com.ruoyi.bas.port.service.IWcsPortService;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.domain.SendData;
|
||||
import com.ruoyi.common.utils.spring.SpringUtils;
|
||||
import com.ruoyi.device.ssj.domain.DeviceSsj;
|
||||
import com.ruoyi.job.domain.MydoJob;
|
||||
import com.ruoyi.job.service.IMydoJobService;
|
||||
import com.ruoyi.queue.agv.domain.AgvQueue;
|
||||
import com.ruoyi.queue.agv.service.IAgvQueueService;
|
||||
import com.ruoyi.schedule.plcRead.ssj.PlcSsjRead;
|
||||
import com.ruoyi.schedule.plcRead.util.Tools;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import static com.ruoyi.common.TaskStatusCode.*;
|
||||
import static com.ruoyi.schedule.plcRead.ssj.PlcSsjRead.*;
|
||||
@@ -32,7 +27,7 @@ import static com.ruoyi.schedule.plcRead.ssj.PlcSsjRead.*;
|
||||
* 生产线线程 检测到位+托盘条码+托盘大小 请求wms生成入库作业 。 循环作业表,检测有没有出库作业 ,生成agv搬运作业。
|
||||
*/
|
||||
@Slf4j
|
||||
public class LineSsjThread implements Runnable {
|
||||
public class LineConvThread implements Runnable {
|
||||
public HashMap<String, List<String>> ssjCodeList;
|
||||
|
||||
private IApiService apiService;
|
||||
@@ -99,8 +94,10 @@ public class LineSsjThread implements Runnable {
|
||||
//查作业,入如果已经有了,直接下发输送线
|
||||
MydoJob mydoJob = new MydoJob();
|
||||
mydoJob.setInOrOut("1");
|
||||
String[] split = SsjDevice.getTrayCode().split(" ");
|
||||
String serial = split[2].substring(7);
|
||||
String trayCode = SsjDevice.getTrayCode();
|
||||
//String[] split = trayCode.split("\\s+");
|
||||
String serial = findFirst(PATTERNS.get("SERIAL"), trayCode);
|
||||
|
||||
mydoJob.setTrayCode(serial);
|
||||
mydoJob.setEntranceId("G1005");
|
||||
mydoJob.setFlag("0");
|
||||
@@ -134,6 +131,7 @@ public class LineSsjThread implements Runnable {
|
||||
mydoJob2.setCreateTime(new Date());
|
||||
mydoJob2.setTraySize(Convert.toStr(SsjDevice.getTraySize()));
|
||||
mydoJob2.setFaultFlag("0");
|
||||
mydoJob2.setPriority(Long.valueOf(10));
|
||||
mydoJobService.insertMydoJob(mydoJob2);
|
||||
int i = writeToSsj(SsjDevice.getPlcDbWriteAddress(), mydoJob2.getTaskNo(), Integer.parseInt(mydoJob2.getTraySize()), 1);
|
||||
if (i == 1) {
|
||||
@@ -153,27 +151,12 @@ public class LineSsjThread implements Runnable {
|
||||
* 8, "没有可用货位!"
|
||||
* 9, "创建工艺入库单失败!"
|
||||
*/
|
||||
//超大,给plc下发错误信息,AGV搬到缓存区 其余人工处理
|
||||
// if ((Integer) ajaxResult.get("code") == 5) {
|
||||
// int i = writeToSsj(SsjDevice.getPlcDbWriteAddress(), "2222", 1, 1);
|
||||
// if (i == 1) {
|
||||
// log.info("G1005产线输送机下发超大托盘处理成功");
|
||||
// }
|
||||
// createMoveToPort(SsjDevice);
|
||||
// } else {
|
||||
// int i = writeToSsj(SsjDevice.getPlcDbWriteAddress(), "99", Integer.parseInt(ajaxResult.get("code").toString()), 2);
|
||||
// if (i == 1) {
|
||||
// log.info("G1005产线输送机下发错误信息成功");
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (SsjDevice.getRkqq() == 1 && StrUtil.isBlank(SsjDevice.getTrayCode()) &&
|
||||
SsjDevice.getTraySize() != 0 && SsjDevice.getTaskNo() < 1000) {
|
||||
|
||||
//log.info("设备:{} 位置:{} 条码:{} 托盘大小:{}", SsjDevice.getDeviceCode(), "产线", SsjDevice.getTrayCode(), SsjDevice.getTraySize());
|
||||
//查wcs有没作业,有下发给输送机任务号,覆盖任务号
|
||||
MydoJob mydoJob = new MydoJob();
|
||||
mydoJob.setInOrOut("1");
|
||||
@@ -184,7 +167,6 @@ public class LineSsjThread implements Runnable {
|
||||
List<MydoJob> mydoJobs = mydoJobService.selectInOrOutMydoJobList(mydoJob);
|
||||
if (!mydoJobs.isEmpty()) {
|
||||
mydoJob = mydoJobs.get(0);
|
||||
|
||||
int i = writeToSsj(SsjDevice.getPlcDbWriteAddress(), mydoJob.getTaskNo(), 1, 1);
|
||||
if (i == 1) {
|
||||
mydoJob.setExecutionPhase(TASK_EP_LINE_SSJ);
|
||||
@@ -206,6 +188,7 @@ public class LineSsjThread implements Runnable {
|
||||
mydoJob2.setCreateTime(new Date());
|
||||
mydoJob2.setTraySize(Convert.toStr(SsjDevice.getTraySize()));
|
||||
mydoJob2.setFaultFlag("0");
|
||||
mydoJob2.setPriority(Long.valueOf(10));
|
||||
mydoJobService.insertMydoJob(mydoJob2);
|
||||
int i = writeToSsj(SsjDevice.getPlcDbWriteAddress(), mydoJob2.getTaskNo(), 1, 1);
|
||||
if (i == 1) {
|
||||
@@ -219,19 +202,6 @@ public class LineSsjThread implements Runnable {
|
||||
//超大,给plc下发错误信息,等待人工处理
|
||||
//托盘大小对不上,给plc下发错误信息,等待人工处理
|
||||
//码不对,给plc下发错误信息,等待人工处理
|
||||
|
||||
// if ((Integer) ajaxResult.get("code") == 5) {
|
||||
// int i = writeToSsj(SsjDevice.getPlcDbWriteAddress(), "2222", 1, 1);
|
||||
// if (i == 1) {
|
||||
// log.info("G1005产线输送机下发错误信息成功");
|
||||
// }
|
||||
// createMoveToPort(SsjDevice);
|
||||
// } else {
|
||||
// int i = writeToSsj(SsjDevice.getPlcDbWriteAddress(), "99", Integer.parseInt(ajaxResult.get("code").toString()), 2);
|
||||
// if (i == 1) {
|
||||
// log.info("G1005产线输送机下发错误信息成功");
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -241,10 +211,10 @@ public class LineSsjThread implements Runnable {
|
||||
|
||||
//log.info("设备:{} 位置:{} 条码:{} 托盘大小:{}", SsjDevice.getDeviceCode(), "产线收到wcs任务号", SsjDevice.getTrayCode(), SsjDevice.getTraySize());
|
||||
//任务号查wcs作业,查巷道,看目标输送线是否空闲,查是否有出库作业,生成agv队列
|
||||
|
||||
MydoJob mydoJob = mydoJobService.selectMydoJobByTaskNo(Convert.toLong(SsjDevice.getTaskNo()));
|
||||
String deviceCode = "";
|
||||
if (mydoJob != null) {
|
||||
|
||||
if ("1".equals(mydoJob.getRoadwayId())) {
|
||||
deviceCode = "L1001";
|
||||
} else {
|
||||
@@ -270,14 +240,14 @@ public class LineSsjThread implements Runnable {
|
||||
agvQueueService.updateAgvQueue(agvQueue);
|
||||
}
|
||||
}
|
||||
if("0".equals(agvQueue.getStatus())){
|
||||
if ("0".equals(agvQueue.getStatus())) {
|
||||
apiService.requestAgvQueue(agvQueue);
|
||||
}
|
||||
} else {
|
||||
if ("1".equals(mydoJob.getStatus())) {
|
||||
HashMap<String, String> paramMap = new HashMap<>();
|
||||
paramMap.put("trayCode", mydoJob.getTrayCode());
|
||||
paramMap.put("taskCode",mydoJob.getJobId());
|
||||
paramMap.put("taskCode", mydoJob.getJobId());
|
||||
//todo 与agv对点
|
||||
paramMap.put("startPoint", "G1005");
|
||||
paramMap.put("endPoint", deviceCode);
|
||||
@@ -305,17 +275,18 @@ public class LineSsjThread implements Runnable {
|
||||
agvQueueService.updateAgvQueue(agvQueue);
|
||||
}
|
||||
}
|
||||
if("0".equals(agvQueue.getStatus())){
|
||||
if ("0".equals(agvQueue.getStatus())) {
|
||||
apiService.requestAgvQueue(agvQueue);
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
HashMap<String, String> paramMap = new HashMap<>();
|
||||
String[] split = SsjDevice.getTrayCode().split(" ");
|
||||
String serial = split[2].substring(7);
|
||||
String trayCode = SsjDevice.getTrayCode();
|
||||
//String[] split = trayCode.split("\\s+");
|
||||
String serial = findFirst(PATTERNS.get("SERIAL"), trayCode);
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS");
|
||||
String taskCode = "BY" + sdf.format(new Date());
|
||||
paramMap.put("trayCode", serial);
|
||||
paramMap.put("taskCode",taskCode);
|
||||
paramMap.put("taskCode", taskCode);
|
||||
//todo 与agv对点
|
||||
paramMap.put("startPoint", "G1005");
|
||||
paramMap.put("endPoint", "");
|
||||
@@ -341,36 +312,26 @@ public class LineSsjThread implements Runnable {
|
||||
|
||||
}
|
||||
|
||||
private static final Map<String, Pattern> PATTERNS = createPatterns();
|
||||
|
||||
void createMoveToPort(DeviceSsj SsjDevice) {
|
||||
WcsPort wcsPort = new WcsPort();
|
||||
wcsPort.setStatus("1");
|
||||
List<WcsPort> wcsPorts = wcsPortService.selectWcsPortList(wcsPort);
|
||||
List<AgvQueue> agvQueues = agvQueueService.selectAgvQueueList(new AgvQueue());
|
||||
//检查agvQueues中是否有任何一个positionCode2是wcsPorts中的portCode
|
||||
boolean hasMatchingPort = agvQueues.stream()
|
||||
.map(AgvQueue::getPositionCode2)
|
||||
.anyMatch(positionCode2 -> wcsPorts.stream()
|
||||
.map(WcsPort::getPortCode)
|
||||
.anyMatch(portCode -> portCode.equals(positionCode2)));
|
||||
private static Map<String, Pattern> createPatterns() {
|
||||
Map<String, Pattern> map = new LinkedHashMap<>();
|
||||
map.put("MODEL", Pattern.compile("MODEL:([^\\s]+)", Pattern.CASE_INSENSITIVE));
|
||||
map.put("COLOR", Pattern.compile("COLOR:([^\\s]+)", Pattern.CASE_INSENSITIVE));
|
||||
map.put("SERIAL", Pattern.compile("SERIAL:([^\\s]+)", Pattern.CASE_INSENSITIVE));
|
||||
map.put("V", Pattern.compile("V:([^\\s]+)", Pattern.CASE_INSENSITIVE));
|
||||
map.put("Hz", Pattern.compile("Hz:([^\\s]+)", Pattern.CASE_INSENSITIVE));
|
||||
map.put("PH", Pattern.compile("PH:([^\\s]+)", Pattern.CASE_INSENSITIVE));
|
||||
map.put("NW", Pattern.compile("N\\.W\\.:([^\\s]+)", Pattern.CASE_INSENSITIVE));
|
||||
map.put("GW", Pattern.compile("G\\.W\\.:([^\\s]+)", Pattern.CASE_INSENSITIVE));
|
||||
map.put("ITEM_CODE", Pattern.compile("ITEM_CODE:([^\\s]+)", Pattern.CASE_INSENSITIVE));
|
||||
map.put("@", Pattern.compile("@:([^\\s]+)", Pattern.CASE_INSENSITIVE));
|
||||
return map;
|
||||
}
|
||||
|
||||
if (hasMatchingPort == false) {
|
||||
|
||||
if (!wcsPorts.isEmpty()) {
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
// map.put("trayCode", mydoJob.getTrayCode());
|
||||
map.put("taskNo", StrUtil.uuid());
|
||||
//todo 与agv对点
|
||||
map.put("startPoint", "G1005");
|
||||
map.put("endPoint", wcsPorts.get(0).getPortCode());
|
||||
map.put("traySize", "5");
|
||||
// map.put("wmsTaskNo", mydoJob.getTaskNo());
|
||||
AjaxResult ajaxResult1 = apiService.receiveAgvMoveJob(map);
|
||||
if (ajaxResult1.isSuccess()) {
|
||||
log.info("G1005产线生成作业失败,AGV下发搬运至缓存点任务成功:{}", ajaxResult1.get("data"));
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
private static String findFirst(Pattern pattern, String input) {
|
||||
if (pattern == null || input == null) return null;
|
||||
Matcher m = pattern.matcher(input);
|
||||
return m.find() ? m.group(1) : null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,344 @@
|
||||
package com.ruoyi.schedule.scheduleTask.ssj;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import com.ruoyi.api.service.IApiService;
|
||||
import com.ruoyi.bas.cargospace.domain.BasCargoSpace;
|
||||
import com.ruoyi.bas.cargospace.service.IBasCargoSpaceService;
|
||||
import com.ruoyi.common.ConvException;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.utils.spring.SpringUtils;
|
||||
import com.ruoyi.device.ssj.domain.DeviceSsj;
|
||||
import com.ruoyi.job.domain.JobCallBack;
|
||||
import com.ruoyi.job.domain.MydoJob;
|
||||
import com.ruoyi.job.service.IJobCallBackService;
|
||||
import com.ruoyi.job.service.IMydoJobService;
|
||||
import com.ruoyi.queue.agv.domain.AgvQueue;
|
||||
import com.ruoyi.queue.agv.service.IAgvQueueService;
|
||||
import com.ruoyi.schedule.plcRead.ssj.PlcSsjRead;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import static com.ruoyi.common.TaskStatusCode.*;
|
||||
import static com.ruoyi.schedule.plcRead.ssj.PlcSsjRead.writeToSsj;
|
||||
import static com.ruoyi.schedule.plcRead.ssj.PlcSsjRead.writeToSsjQH;
|
||||
|
||||
/**
|
||||
* 出入口输送线线程
|
||||
*/
|
||||
@Slf4j
|
||||
public class PortConvThread implements Runnable {
|
||||
|
||||
public HashMap<String, List<String>> ssjCodeList;
|
||||
|
||||
private IApiService apiService;
|
||||
private IAgvQueueService agvQueueService;
|
||||
private IMydoJobService mydoJobService;
|
||||
private IJobCallBackService jobCallBackService;
|
||||
private IBasCargoSpaceService cargoSpaceService;
|
||||
|
||||
public boolean isRun = true;
|
||||
|
||||
|
||||
public void init() {
|
||||
ssjCodeList = new HashMap<>();
|
||||
ArrayList<String> ssjCodes = new ArrayList<>();
|
||||
ssjCodes.add("G1004");
|
||||
// ssjCodes.add("L1003");
|
||||
ssjCodeList.put("portConv", ssjCodes);
|
||||
apiService = SpringUtils.getBean(IApiService.class);
|
||||
agvQueueService = SpringUtils.getBean(IAgvQueueService.class);
|
||||
mydoJobService = SpringUtils.getBean(IMydoJobService.class);
|
||||
jobCallBackService = SpringUtils.getBean(IJobCallBackService.class);
|
||||
log.info("初始化服务 {},{}", apiService, agvQueueService);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
init();
|
||||
while (isRun) {
|
||||
for (String type : ssjCodeList.keySet()) {
|
||||
switch (type) {
|
||||
case "portConv":
|
||||
//入库口
|
||||
for (String ssjCode : ssjCodeList.get(type)) {
|
||||
try {
|
||||
if (PlcSsjRead.deviceSsjMap.containsKey(ssjCode)) {
|
||||
inDispatch(PlcSsjRead.deviceSsjMap.get(ssjCode));
|
||||
// inDispatch1(PlcSsjRead.deviceSsjMap.get(ssjCode));
|
||||
} else {
|
||||
log.error("设备不存在 ssjCode:{}", ssjCode);
|
||||
}
|
||||
} catch (RuntimeException e) {
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
try {
|
||||
Thread.sleep(1500);
|
||||
} catch (InterruptedException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void inDispatch(DeviceSsj inSsjDevice) {
|
||||
switch (inSsjDevice.getInOrOut()) {
|
||||
//---------------------------入库模式---------------------------
|
||||
case 1:
|
||||
//---------------------------入口取输送机(叉车取放货位置)---------------------------
|
||||
//输送机【非空闲】、【输送到位】、【条码不为空】、有【入库请求】
|
||||
if (inSsjDevice.getKx() != 1 && inSsjDevice.getDw() == 1) {
|
||||
AjaxResult ajaxResult;
|
||||
|
||||
//请求参数
|
||||
HashMap<String, Object> paramMap = new HashMap<>();
|
||||
paramMap.put("trayCode", inSsjDevice.getTrayCode());//托盘条码
|
||||
int height = inSsjDevice.getHeight();
|
||||
int weight = inSsjDevice.getWeight();
|
||||
paramMap.put("weight", weight);//重量
|
||||
paramMap.put("height", height);//高度
|
||||
|
||||
//入库口异常校验
|
||||
switch (inSsjDevice.getException()) {
|
||||
|
||||
//外形检测异常
|
||||
case ConvException.CHECK_SIZE_EXCEPTION:
|
||||
paramMap.put("errorInfo", "外形检测异常-货物超高");
|
||||
ajaxResult = apiService.createInMydoJobException(paramMap);
|
||||
if (ajaxResult.isSuccess()) {
|
||||
//向输送机下发退回
|
||||
int i = writeToSsj(inSsjDevice.getPlcDbWriteAddress(), "99", 99, 1);
|
||||
}
|
||||
return;
|
||||
|
||||
//超重检测
|
||||
case ConvException.CHECK_OVERWEIGHT_EXCEPTION:
|
||||
paramMap.put("errorInfo", "外形检测异常-货物超重");
|
||||
ajaxResult = apiService.createInMydoJobException(paramMap);
|
||||
if (ajaxResult.isSuccess()) {
|
||||
//向输送机下发退回
|
||||
int i = writeToSsj(inSsjDevice.getPlcDbWriteAddress(), "99", 99, 1);
|
||||
}
|
||||
return;
|
||||
|
||||
//扫码异常
|
||||
case ConvException.CHECK_BARCODE_EXCEPTION:
|
||||
if (inSsjDevice.getTrayCode() == "") {
|
||||
paramMap.put("errorInfo", "条码扫描失败:扫描结果为空");
|
||||
ajaxResult = apiService.createInMydoJobException(paramMap);
|
||||
}else{
|
||||
//条码格式校验
|
||||
paramMap.put("errorInfo", "条码扫描异常:格式错误");
|
||||
ajaxResult = apiService.createInMydoJobException(paramMap);
|
||||
}
|
||||
if (ajaxResult.isSuccess()) {
|
||||
//向输送机下发退回
|
||||
int i = writeToSsj(inSsjDevice.getPlcDbWriteAddress(), "99", 99, 1);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
//校验:有【入库请求】再请求获取wcs任务
|
||||
if (inSsjDevice.getRkqq() != 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
//校验:当前条码任务已存在
|
||||
MydoJob job = new MydoJob();
|
||||
job.setTrayCode(inSsjDevice.getTrayCode());
|
||||
if (mydoJobService.selectMydoJobList(job).size() > 0) {
|
||||
log.warn("【生成wcs任务异常】该托盘号已有作业,托盘条码:{}",inSsjDevice.getTrayCode());
|
||||
return;
|
||||
}
|
||||
|
||||
//校验:当前条码已有库存
|
||||
BasCargoSpace cargoSpace = new BasCargoSpace();
|
||||
cargoSpace.setTrayCode(inSsjDevice.getTrayCode());
|
||||
if (cargoSpaceService.selectBasCargoSpaceList(cargoSpace).size() > 0) {
|
||||
log.warn("【生成wcs任务异常】该托盘号已有库存,托盘条码:{}",inSsjDevice.getTrayCode());
|
||||
return;
|
||||
}
|
||||
|
||||
//请求生成wcs任务
|
||||
ajaxResult = apiService.createInMydoJob(paramMap);
|
||||
if (ajaxResult.isSuccess()) {
|
||||
//获取wms下发的任务号和分配货位
|
||||
MydoJob mydoJob = BeanUtil.toBean(ajaxResult.get("data"), MydoJob.class);
|
||||
|
||||
//todo 校验wms分配的货位(排列层)是否合法
|
||||
if (mydoJob.getCargoSpaceId() == null) {
|
||||
log.info("【请求参数异常】分配货位:null,托盘条码:{}",inSsjDevice.getTrayCode());
|
||||
return;
|
||||
}else{
|
||||
|
||||
}
|
||||
|
||||
mydoJob.setStatus("1");
|
||||
mydoJob.setInOrOut("1");
|
||||
mydoJob.setExecutionPhase(TASK_EP_CREATE);
|
||||
mydoJob.setCreateTime(new Date());
|
||||
// mydoJob.setTraySize(Convert.toStr(inSsjDevice.getTraySize()));
|
||||
mydoJob.setFaultFlag("0");
|
||||
mydoJob.setPriority(Long.valueOf(10));
|
||||
|
||||
//拿到正常作业,插到wcs作业表,下发给输送机任务号,覆盖任务号
|
||||
if (mydoJobService.insertMydoJob(mydoJob) == 1) {
|
||||
log.info("请求生成wcs作业成功,wms下发任务单号:{}, 任务号:{},托盘条码:{},分配货位:{}", mydoJob.getJobId(), mydoJob.getTaskNo(), mydoJob.getTrayCode(), mydoJob.getCargoSpaceId());
|
||||
}else{
|
||||
//向输送机下发任务号
|
||||
int i = writeToSsj(inSsjDevice.getPlcDbWriteAddress(), mydoJob.getTaskNo(), Integer.parseInt(mydoJob.getTraySize()), 1);
|
||||
if (i == 1) {
|
||||
//写入成功则更新执行阶段
|
||||
mydoJob.setExecutionPhase(TASK_EP_LINE_SSJ);
|
||||
mydoJobService.updateMydoJob(mydoJob);
|
||||
log.info("G1004入口输送机下发任务号成功:{}", mydoJob.getTaskNo());
|
||||
}
|
||||
}
|
||||
|
||||
}else{
|
||||
//请求生成wcs任务失败
|
||||
//todo 向输送机下发退回
|
||||
int i = writeToSsj(inSsjDevice.getPlcDbWriteAddress(), "99", 99, 1);
|
||||
|
||||
//todo 接口调用失败处理
|
||||
log.info("【请求入库】请求生成wcs作业失败退回,请重试");
|
||||
|
||||
}
|
||||
}
|
||||
break;
|
||||
//---------------------------出库模式---------------------------
|
||||
case 2:
|
||||
//出库到位
|
||||
if (inSsjDevice.getDw() == 1 && inSsjDevice.getTaskNo() > 0) {
|
||||
//查询该出库任务
|
||||
MydoJob mydoJob = mydoJobService.selectMydoJobByTaskNo(Convert.toLong(inSsjDevice.getTaskNo()));
|
||||
if (mydoJob != null && Integer.parseInt(mydoJob.getInOrOut()) > 20) {
|
||||
log.info("设备:{} 位置:{} 任务号:{} 出库到位", "输送线:", inSsjDevice.getDeviceCode(), mydoJob.getTaskNo());
|
||||
mydoJobService.insertHistory(mydoJob.getJobId());
|
||||
mydoJobService.deleteMydoJobByJobId(mydoJob.getJobId());
|
||||
JobCallBack jobCallBack = new JobCallBack();
|
||||
jobCallBack.setType("2");
|
||||
jobCallBack.setMydojobId(mydoJob.getJobId());
|
||||
jobCallBack.setStatus("0");
|
||||
jobCallBack.setTaskNo(Convert.toLong(mydoJob.getTaskNo()));
|
||||
jobCallBack.setCreateTime(new Date());
|
||||
jobCallBack.setSpare1("0");
|
||||
jobCallBackService.insertJobCallBack(jobCallBack);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public void inDispatch1(DeviceSsj ssjDevice) {
|
||||
//有入库请求就肯定是电气的任务号的作业
|
||||
if(StrUtil.isNotBlank(ssjDevice.getTrayCode()) && ssjDevice.getRkqq()==1 && ssjDevice.getTaskNo()<1000){
|
||||
//,如果有正执行的出库作业退回
|
||||
MydoJob mydoJobParam = new MydoJob();
|
||||
mydoJobParam.setInOut("2");
|
||||
mydoJobParam.setStatus("3");
|
||||
mydoJobParam.setExitId(ssjDevice.getDeviceCode());
|
||||
List<MydoJob> outMydoJobList = mydoJobService.selectInOrOutMydoJobList(mydoJobParam);
|
||||
if(!outMydoJobList.isEmpty()){
|
||||
//todo 去向不明朗
|
||||
int i = writeToSsj(ssjDevice.getPlcDbWriteAddress(),"99",2,2);
|
||||
if (i == 1) {
|
||||
log.info(ssjDevice.getDeviceCode()+"有正执行的出库作业退回" );
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
MydoJob mydoJob = new MydoJob();
|
||||
mydoJob.setInOrOut("1");
|
||||
// mydoJob.setStatus("1");
|
||||
String trayCode = ssjDevice.getTrayCode();
|
||||
//String[] split = trayCode.split("\\s+");
|
||||
String serial = findFirst(PATTERNS.get("SERIAL"), trayCode);
|
||||
mydoJob.setTrayCode(serial);
|
||||
mydoJob.setEntranceId(ssjDevice.getDeviceCode());
|
||||
List<MydoJob> mydoJobs = mydoJobService.selectMydoJobList(mydoJob);
|
||||
if(!mydoJobs.isEmpty()){
|
||||
MydoJob mydoJob1 = mydoJobs.get(0);
|
||||
int i = writeToSsj(ssjDevice.getPlcDbWriteAddress(),mydoJob1.getTaskNo(),1,1);
|
||||
if (i == 1) {
|
||||
mydoJob1.setExecutionPhase(TASK_EP_SSJ);
|
||||
mydoJob1.setStatus("3");
|
||||
mydoJobService.updateMydoJob(mydoJob1);
|
||||
log.info(ssjDevice.getDeviceCode()+"输送机下发任务号成功:{}" , mydoJob1.getTaskNo());
|
||||
}
|
||||
}else{
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
map.put("trayCode",ssjDevice.getTrayCode());
|
||||
map.put("entranceId",ssjDevice.getDeviceCode());
|
||||
map.put("floor", "2");
|
||||
AjaxResult ajaxResult = apiService.selectMydoJobByTrayCodeAndEntranceId(map);
|
||||
if(ajaxResult.isSuccess()){
|
||||
MydoJob mydoJob2 = BeanUtil.toBean(ajaxResult.get("data"), MydoJob.class);
|
||||
mydoJob2.setStatus("1");
|
||||
mydoJob2.setExecutionPhase(TASK_EP_CREATE);
|
||||
mydoJob2.setCreateTime(new Date());
|
||||
mydoJob2.setFaultFlag("0");
|
||||
mydoJob2.setPriority(Long.valueOf(10));
|
||||
mydoJobService.insertMydoJob(mydoJob2);
|
||||
int i = writeToSsj(ssjDevice.getPlcDbWriteAddress(),mydoJob2.getTaskNo(),1,1);
|
||||
if (i == 1) {
|
||||
mydoJob2.setExecutionPhase(TASK_EP_SSJ);
|
||||
mydoJob2.setStatus("3");
|
||||
mydoJobService.updateMydoJob(mydoJob2);
|
||||
log.info(ssjDevice.getDeviceCode()+"输送机下发任务号成功:{}" , mydoJob2.getTaskNo());
|
||||
}
|
||||
}else{
|
||||
//todo 去向不明朗
|
||||
int i = writeToSsj(ssjDevice.getPlcDbWriteAddress(),"99",2,2);
|
||||
if (i == 1) {
|
||||
log.info(ssjDevice.getDeviceCode()+"输送机没取到作业下发输送线" );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static final Map<String, Pattern> PATTERNS = createPatterns();
|
||||
|
||||
private static Map<String, Pattern> createPatterns() {
|
||||
Map<String, Pattern> map = new LinkedHashMap<>();
|
||||
map.put("MODEL", Pattern.compile("MODEL:([^\\s]+)", Pattern.CASE_INSENSITIVE));
|
||||
map.put("COLOR", Pattern.compile("COLOR:([^\\s]+)", Pattern.CASE_INSENSITIVE));
|
||||
map.put("SERIAL", Pattern.compile("SERIAL:([^\\s]+)", Pattern.CASE_INSENSITIVE));
|
||||
map.put("V", Pattern.compile("V:([^\\s]+)", Pattern.CASE_INSENSITIVE));
|
||||
map.put("Hz", Pattern.compile("Hz:([^\\s]+)", Pattern.CASE_INSENSITIVE));
|
||||
map.put("PH", Pattern.compile("PH:([^\\s]+)", Pattern.CASE_INSENSITIVE));
|
||||
map.put("NW", Pattern.compile("N\\.W\\.:([^\\s]+)", Pattern.CASE_INSENSITIVE));
|
||||
map.put("GW", Pattern.compile("G\\.W\\.:([^\\s]+)", Pattern.CASE_INSENSITIVE));
|
||||
map.put("ITEM_CODE", Pattern.compile("ITEM_CODE:([^\\s]+)", Pattern.CASE_INSENSITIVE));
|
||||
map.put("@", Pattern.compile("@:([^\\s]+)", Pattern.CASE_INSENSITIVE));
|
||||
return map;
|
||||
}
|
||||
|
||||
private static String findFirst(Pattern pattern, String input) {
|
||||
if (pattern == null || input == null) return null;
|
||||
Matcher m = pattern.matcher(input);
|
||||
return m.find() ? m.group(1) : null;
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.ruoyi.schedule.scheduleTask.ssj.floor2;
|
||||
package com.ruoyi.schedule.scheduleTask.ssj;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
@@ -8,12 +9,12 @@ 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.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.utils.spring.SpringUtils;
|
||||
import com.ruoyi.job.domain.JobCallBack;
|
||||
import com.ruoyi.device.ssj.domain.DeviceSsj;
|
||||
import com.ruoyi.job.domain.MydoJob;
|
||||
import com.ruoyi.job.service.IMydoJobService;
|
||||
import com.ruoyi.queue.agv.service.IAgvQueueService;
|
||||
import com.ruoyi.device.ssj.domain.DeviceSsj;
|
||||
import com.ruoyi.queue.ddj.domain.DdjDeviceExecutionQueue;
|
||||
import com.ruoyi.queue.ddj.service.IDdjDeviceExecutionQueueService;
|
||||
import com.ruoyi.schedule.plcRead.ssj.PlcSsjRead;
|
||||
@@ -22,14 +23,13 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import java.util.*;
|
||||
|
||||
import static com.ruoyi.common.TaskStatusCode.*;
|
||||
import static com.ruoyi.common.TaskType.*;
|
||||
import static com.ruoyi.common.TaskType.DDJ_RWLX_2;
|
||||
import static com.ruoyi.common.TaskType.DDJ_RWLX_1;
|
||||
|
||||
/**
|
||||
* 二楼出库线程 检测当前巷道有没有入库作业,没有作业,生成堆垛机出库队列
|
||||
* 巷道口输送机(堆垛机取放位)线程 检测当前巷道有没有入库作业,没有作业,生成堆垛机出库队列
|
||||
*/
|
||||
@Slf4j
|
||||
public class Floor2RoadWaySsjThread implements Runnable {
|
||||
public class RoadConvThread implements Runnable {
|
||||
|
||||
public HashMap<String, List<String>> ssjCodeList;
|
||||
private final Map<String, List<Integer>> roadwayMap = new HashMap<>();
|
||||
@@ -44,17 +44,17 @@ public class Floor2RoadWaySsjThread implements Runnable {
|
||||
public void init() {
|
||||
ssjCodeList = new HashMap<>();
|
||||
ArrayList<String> ssjCodes = new ArrayList<>();
|
||||
ssjCodes.add("L1002");
|
||||
ssjCodes.add("L1004");
|
||||
ssjCodeList.put("roadwaySsj", ssjCodes);
|
||||
// ssjCodes.add("L1002");
|
||||
ssjCodes.add("L1001");
|
||||
ssjCodeList.put("roadConv", ssjCodes);
|
||||
apiService = SpringUtils.getBean(IApiService.class);
|
||||
agvQueueService = SpringUtils.getBean(IAgvQueueService.class);
|
||||
mydoJobService = SpringUtils.getBean(IMydoJobService.class);
|
||||
basCargoSpaceService = SpringUtils.getBean(IBasCargoSpaceService.class);
|
||||
ddjDeviceExecutionQueueService = SpringUtils.getBean(IDdjDeviceExecutionQueueService.class);
|
||||
//初始化巷道口 排 列 层
|
||||
roadwayMap.put("L1002", Arrays.asList(2, 0, 1));
|
||||
roadwayMap.put("L1004", Arrays.asList(4, 0, 1));
|
||||
roadwayMap.put("L1001", Arrays.asList(2, 0, 1));
|
||||
// roadwayMap.put("L1004", Arrays.asList(4, 0, 1));
|
||||
log.info("初始化服务 {},{}", apiService, agvQueueService);
|
||||
}
|
||||
|
||||
@@ -63,9 +63,8 @@ public class Floor2RoadWaySsjThread implements Runnable {
|
||||
init();
|
||||
while (isRun){
|
||||
for (String type : ssjCodeList.keySet()) {
|
||||
|
||||
switch ( type){
|
||||
case "roadwaySsj":
|
||||
switch (type){
|
||||
case "roadConv":
|
||||
//生产线入库
|
||||
for (String ssjCode : ssjCodeList.get(type)) {
|
||||
try {
|
||||
@@ -92,61 +91,85 @@ public class Floor2RoadWaySsjThread implements Runnable {
|
||||
|
||||
|
||||
public void inDispatch(DeviceSsj roadSsjDevice) {
|
||||
//如果到位,且任务号大于0
|
||||
//巷道口到位,且任务号大于1000
|
||||
if (roadSsjDevice.getDw()==1 && roadSsjDevice.getTaskNo()>1000) {
|
||||
MydoJob mydoJob = mydoJobService.selectMydoJobByTaskNo(Convert.toLong(roadSsjDevice.getTaskNo()));
|
||||
if (ObjUtil.isNotNull(mydoJob) && mydoJob.getExecutionPhase().equals(TASK_EP_SSJ)) {
|
||||
mydoJob.setExecutionPhase(TASK_EP_ROADWAY_SSJ);
|
||||
mydoJobService.updateMydoJob(mydoJob);
|
||||
}
|
||||
if (ObjUtil.isNotNull(mydoJob) && mydoJob.getExecutionPhase().equals(TASK_EP_ROADWAY_SSJ)) {
|
||||
List<DdjDeviceExecutionQueue> ddjDeviceExecutionQueues = ddjDeviceExecutionQueueService.selectDdjDeviceExecutionQueueListByRwlx(DDJ_RWLX_1, Convert.toInt(mydoJob.getRoadwayId()));
|
||||
BasCargoSpace basCargoSpace = basCargoSpaceService.selectBasCargoSpaceByWmsCargoSpaceId(mydoJob.getCargoSpaceId());
|
||||
List<Integer> pclList = roadwayMap.get(roadSsjDevice.getDeviceCode());
|
||||
if (CollUtil.isEmpty(ddjDeviceExecutionQueues) && ObjUtil.isNotNull(basCargoSpace) && 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(pclList.get(0));
|
||||
ddjDeviceExecutionQueue.setYlh(pclList.get(1));
|
||||
ddjDeviceExecutionQueue.setYch(pclList.get(2));
|
||||
ddjDeviceExecutionQueue.setMbph(Convert.toInt(basCargoSpace.getThePlatoon()));
|
||||
ddjDeviceExecutionQueue.setMblh(Convert.toInt(basCargoSpace.getTheColumn()));
|
||||
ddjDeviceExecutionQueue.setMbch(Convert.toInt(basCargoSpace.getTheFloor()));
|
||||
ddjDeviceExecutionQueue.setDdjxf("0");
|
||||
ddjDeviceExecutionQueue.setMlfs(5);
|
||||
ddjDeviceExecutionQueue.setSpare1(mydoJob.getTraySize());
|
||||
ddjDeviceExecutionQueue.setScsj(DateUtil.formatDateTime(DateUtil.date()));
|
||||
ddjDeviceExecutionQueue.setRwlx(DDJ_RWLX_1);
|
||||
ddjDeviceExecutionQueueService.insertDdjDeviceExecutionQueue(ddjDeviceExecutionQueue);
|
||||
if(ObjUtil.isNotNull(mydoJob)){
|
||||
if(mydoJob.getCargoSpaceId() == null || "".equals(mydoJob.getCargoSpaceId())){
|
||||
AjaxResult ajaxResult = apiService.requestWmsSpace(mydoJob);
|
||||
if(ajaxResult.isSuccess()){
|
||||
BasCargoSpace space = BeanUtil.toBean(ajaxResult.get("data"), BasCargoSpace.class);
|
||||
String cargoSpaceId = space.getCargoSpaceId();
|
||||
mydoJob.setCargoSpaceId(cargoSpaceId);
|
||||
mydoJobService.updateMydoJob(mydoJob);
|
||||
}
|
||||
}
|
||||
if(mydoJob.getCargoSpaceId()!=null && !"".equals(mydoJob.getCargoSpaceId())){
|
||||
if(mydoJob.getExecutionPhase().equals(TASK_EP_SSJ)){
|
||||
mydoJob.setExecutionPhase(TASK_EP_ROADWAY_SSJ);
|
||||
mydoJobService.updateMydoJob(mydoJob);
|
||||
}
|
||||
if (ObjUtil.isNotNull(mydoJob) && mydoJob.getExecutionPhase().equals(TASK_EP_ROADWAY_SSJ)
|
||||
&& Convert.toInt(mydoJob.getInOrOut()) < 20) {
|
||||
List<DdjDeviceExecutionQueue> ddjDeviceExecutionQueues = ddjDeviceExecutionQueueService.selectDdjDeviceExecutionQueueListByRwlx(DDJ_RWLX_1, Convert.toInt(mydoJob.getRoadwayId()));
|
||||
BasCargoSpace basCargoSpace = basCargoSpaceService.selectBasCargoSpaceByWmsCargoSpaceId(mydoJob.getCargoSpaceId());
|
||||
List<Integer> pclList = roadwayMap.get(roadSsjDevice.getDeviceCode());
|
||||
if (CollUtil.isEmpty(ddjDeviceExecutionQueues) && ObjUtil.isNotNull(basCargoSpace) && 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(pclList.get(0));
|
||||
ddjDeviceExecutionQueue.setYlh(pclList.get(1));
|
||||
ddjDeviceExecutionQueue.setYch(pclList.get(2));
|
||||
ddjDeviceExecutionQueue.setMbph(Convert.toInt(basCargoSpace.getThePlatoon()));
|
||||
ddjDeviceExecutionQueue.setMblh(Convert.toInt(basCargoSpace.getTheColumn()));
|
||||
ddjDeviceExecutionQueue.setMbch(Convert.toInt(basCargoSpace.getTheFloor()));
|
||||
ddjDeviceExecutionQueue.setDdjxf("0");
|
||||
ddjDeviceExecutionQueue.setMlfs(5);
|
||||
ddjDeviceExecutionQueue.setSpare1(mydoJob.getTraySize());
|
||||
ddjDeviceExecutionQueue.setScsj(DateUtil.formatDateTime(DateUtil.date()));
|
||||
ddjDeviceExecutionQueue.setRwlx(DDJ_RWLX_1);
|
||||
ddjDeviceExecutionQueueService.insertDdjDeviceExecutionQueue(ddjDeviceExecutionQueue);
|
||||
|
||||
mydoJob.setExecutionPhase(TASK_EP_DDJ);
|
||||
mydoJobService.updateMydoJob(mydoJob);
|
||||
mydoJob.setExecutionPhase(TASK_EP_DDJ);
|
||||
mydoJobService.updateMydoJob(mydoJob);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(roadSsjDevice.getKx()==1 && roadSsjDevice.getTaskNo() == 0){
|
||||
List<String> exitList = new ArrayList<>();
|
||||
// List<String> exitList = new ArrayList<>();
|
||||
// if("L1002".equals(roadSsjDevice.getDeviceCode())){
|
||||
// exitList.add("L1001");
|
||||
// }
|
||||
// if("L1004".equals(roadSsjDevice.getDeviceCode())){
|
||||
// exitList.add("L1003");
|
||||
// }
|
||||
// List<MydoJob> inList = mydoJobService.getInJobByEntrance(exitList);
|
||||
String exitId = "";
|
||||
if("L1002".equals(roadSsjDevice.getDeviceCode())){
|
||||
exitList.add("l1001");
|
||||
exitId = "L1001";
|
||||
}
|
||||
if("L1004".equals(roadSsjDevice.getDeviceCode())){
|
||||
exitList.add("l1003");
|
||||
exitId = "L1003";
|
||||
}
|
||||
List<MydoJob> inList = mydoJobService.getInJobByEntrance(exitList);
|
||||
|
||||
List<MydoJob> inList = mydoJobService.getInJobByEntranceId(exitId);
|
||||
if(inList.size() == 0){
|
||||
MydoJob mydoJob = mydoJobService.selectMydoJobByExitList(exitList);
|
||||
// MydoJob mydoJob = mydoJobService.selectMydoJobByExitList(exitList);
|
||||
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<DdjDeviceExecutionQueue> list = ddjDeviceExecutionQueueService.selectDdjDeviceExecutionQueueListByRwlx(DDJ_RWLX_1, Convert.toInt(mydoJob.getRoadwayId()));
|
||||
List<Integer> pclList = roadwayMap.get(roadSsjDevice.getDeviceCode());
|
||||
if (CollUtil.isEmpty(list) && CollUtil.isNotEmpty(pclList)) {
|
||||
DdjDeviceExecutionQueue ddjDeviceExecutionQueue = new DdjDeviceExecutionQueue();
|
||||
@@ -177,7 +200,7 @@ public class Floor2RoadWaySsjThread implements Runnable {
|
||||
}
|
||||
}
|
||||
}else{
|
||||
log.info("当前出口"+ exitList+"存在入库任务,无法出库!");
|
||||
log.info("当前出口"+ exitId+"存在入库任务,无法出库!");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,254 +0,0 @@
|
||||
package com.ruoyi.schedule.scheduleTask.ssj.floor1;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.ObjUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.ruoyi.api.service.IApiService;
|
||||
import com.ruoyi.bas.cargospace.domain.BasCargoSpace;
|
||||
import com.ruoyi.bas.cargospace.service.IBasCargoSpaceService;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.utils.spring.SpringUtils;
|
||||
import com.ruoyi.device.ssj.domain.DeviceSsj;
|
||||
import com.ruoyi.job.domain.MydoJob;
|
||||
import com.ruoyi.job.service.IMydoJobService;
|
||||
import com.ruoyi.queue.ddj.domain.DdjDeviceExecutionQueue;
|
||||
import com.ruoyi.queue.ddj.service.IDdjDeviceExecutionQueueService;
|
||||
import com.ruoyi.schedule.plcRead.ssj.PlcSsjRead;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import static com.ruoyi.common.TaskStatusCode.*;
|
||||
import static com.ruoyi.common.TaskType.DDJ_RWLX_3;
|
||||
import static com.ruoyi.schedule.plcRead.ssj.PlcSsjRead.writeToSsj;
|
||||
|
||||
/**
|
||||
* 一楼双向线体入库线程 条码+到位+无出库作业 下发去向+任务号 有出库作业就下发退回
|
||||
*/
|
||||
|
||||
@Slf4j
|
||||
public class Floor1BothWayInSsjThread implements Runnable {
|
||||
|
||||
public HashMap<String, DeviceSsj> ssjCodeList;
|
||||
|
||||
private IApiService apiService;
|
||||
private IMydoJobService mydoJobService;
|
||||
private IBasCargoSpaceService basCargoSpaceService;
|
||||
private IDdjDeviceExecutionQueueService ddjDeviceExecutionQueueService;
|
||||
private final Map<String, List<Integer>> roadwayMap = new HashMap<>();
|
||||
private final Map<String, String> exitRoadwayMap = new HashMap<>();
|
||||
|
||||
|
||||
public boolean isRun = true;
|
||||
|
||||
|
||||
public void init() {
|
||||
ssjCodeList = new HashMap<>();
|
||||
ssjCodeList.put("roadway1", PlcSsjRead.deviceSsjMap.get("L2003"));
|
||||
ssjCodeList.put("roadway2", PlcSsjRead.deviceSsjMap.get("L2005"));
|
||||
ssjCodeList.put("in1", PlcSsjRead.deviceSsjMap.get("L2004"));
|
||||
ssjCodeList.put("in2", PlcSsjRead.deviceSsjMap.get("L2006"));
|
||||
|
||||
|
||||
apiService = SpringUtils.getBean(IApiService.class);
|
||||
mydoJobService = SpringUtils.getBean(IMydoJobService.class);
|
||||
basCargoSpaceService = SpringUtils.getBean(IBasCargoSpaceService.class);
|
||||
ddjDeviceExecutionQueueService = SpringUtils.getBean(IDdjDeviceExecutionQueueService.class);
|
||||
|
||||
|
||||
//初始化巷道口 排 列 层
|
||||
roadwayMap.put("L2003", Arrays.asList(2, 47, 1));
|
||||
roadwayMap.put("L2005", Arrays.asList(3, 70, 1));
|
||||
|
||||
exitRoadwayMap.put("L2003", "L2004");
|
||||
exitRoadwayMap.put("L2005", "L2006");
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
init();
|
||||
while (isRun) {
|
||||
|
||||
for (String type : ssjCodeList.keySet()) {
|
||||
switch (type) {
|
||||
case "roadway1":
|
||||
case "roadway2":
|
||||
dispatch1(ssjCodeList.get(type));
|
||||
break;
|
||||
case "in1":
|
||||
case "in2":
|
||||
dispatch2(ssjCodeList.get(type));
|
||||
break;
|
||||
}
|
||||
}
|
||||
try {
|
||||
Thread.sleep(1500);
|
||||
} catch (InterruptedException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void dispatch1(DeviceSsj ssj) {
|
||||
if (ssj.getDw() == 1 && ssj.getTaskNo() > 1000) {
|
||||
int taskNo = ssj.getTaskNo();
|
||||
MydoJob mydoJob = mydoJobService.selectMydoJobByTaskNo(Convert.toLong(taskNo));
|
||||
if (ObjUtil.isNotNull(mydoJob) && TASK_STATUS_CREATE.equals(mydoJob.getStatus()) && TASK_EP_SSJ.equals(mydoJob.getExecutionPhase()) && Convert.toInt(mydoJob.getInOrOut()) < 20) {
|
||||
//修改作业执行状态
|
||||
mydoJob.setStatus(TASK_STATUS_RUNNING);
|
||||
mydoJob.setStartTime(DateUtil.formatDateTime(DateUtil.date()));
|
||||
mydoJobService.updateMydoJob(mydoJob);
|
||||
}
|
||||
if (ObjUtil.isNotNull(mydoJob) && mydoJob.getExecutionPhase().equals(TASK_EP_SSJ)) {
|
||||
mydoJob.setExecutionPhase(TASK_EP_ROADWAY_SSJ);
|
||||
mydoJobService.updateMydoJob(mydoJob);
|
||||
}
|
||||
if (ObjUtil.isNotNull(mydoJob) && mydoJob.getExecutionPhase().equals(TASK_EP_ROADWAY_SSJ)) {
|
||||
List<DdjDeviceExecutionQueue> ddjDeviceExecutionQueues = ddjDeviceExecutionQueueService.selectDdjDeviceExecutionQueueListByRwlx(DDJ_RWLX_3, Convert.toInt(mydoJob.getRoadwayId()));
|
||||
BasCargoSpace basCargoSpace = basCargoSpaceService.selectBasCargoSpaceByWmsCargoSpaceId(mydoJob.getCargoSpaceId());
|
||||
List<Integer> pclList = roadwayMap.get(ssj.getDeviceCode());
|
||||
if (CollUtil.isEmpty(ddjDeviceExecutionQueues) && ObjUtil.isNotNull(basCargoSpace) && 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(pclList.get(0));
|
||||
ddjDeviceExecutionQueue.setYlh(pclList.get(1));
|
||||
ddjDeviceExecutionQueue.setYch(pclList.get(2));
|
||||
ddjDeviceExecutionQueue.setMbph(Convert.toInt(basCargoSpace.getThePlatoon()));
|
||||
ddjDeviceExecutionQueue.setMblh(Convert.toInt(basCargoSpace.getTheColumn()));
|
||||
ddjDeviceExecutionQueue.setMbch(Convert.toInt(basCargoSpace.getTheFloor()));
|
||||
ddjDeviceExecutionQueue.setDdjxf("0");
|
||||
ddjDeviceExecutionQueue.setMlfs(5);
|
||||
ddjDeviceExecutionQueue.setSpare1(mydoJob.getTraySize());
|
||||
ddjDeviceExecutionQueue.setScsj(DateUtil.formatDateTime(DateUtil.date()));
|
||||
ddjDeviceExecutionQueue.setRwlx(DDJ_RWLX_3);
|
||||
ddjDeviceExecutionQueueService.insertDdjDeviceExecutionQueue(ddjDeviceExecutionQueue);
|
||||
|
||||
mydoJob.setExecutionPhase(TASK_EP_DDJ);
|
||||
mydoJobService.updateMydoJob(mydoJob);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void dispatch2(DeviceSsj ssj) {
|
||||
if (ssj.getRkqq() == 1 && ssj.getTaskNo() > 0 && ssj.getTaskNo() < 1000 ) {
|
||||
//先检测有没有出库作业,有出库作业直接退回
|
||||
MydoJob outMydoJob = mydoJobService.selectRunningMydoJobByExitList(Collections.singletonList(ssj.getDeviceCode()));
|
||||
// || StrUtil.isEmpty(ssj.getTrayCode())
|
||||
if (ObjUtil.isNotNull(outMydoJob)) {
|
||||
//下发去向 和任务号
|
||||
int i = writeToSsj(ssj.getPlcDbWriteAddress(), "99", 2, 2);
|
||||
if (i == 1) {
|
||||
log.info("当前输送机有出库任务下发退回 rwh:{},qx:{},trayCode:{}", ssj.getTaskNo(), 2, ssj.getTrayCode());
|
||||
}
|
||||
} else {
|
||||
if (StrUtil.isNotBlank(ssj.getTrayCode())) {
|
||||
MydoJob param = new MydoJob();
|
||||
param.setEntranceId(ssj.getDeviceCode());
|
||||
String[] split = ssj.getTrayCode().split(" ");
|
||||
String serial = split[2].substring(7);
|
||||
param.setTrayCode(serial);
|
||||
List<MydoJob> mydoJobs = mydoJobService.selectMydoJobList(param);
|
||||
MydoJob inJob = null;
|
||||
if (CollUtil.isNotEmpty(mydoJobs)) {
|
||||
inJob = mydoJobs.get(0);
|
||||
} else {
|
||||
//根据托盘码请求入库作业
|
||||
HashMap<String, Object> paramMap = new HashMap<>();
|
||||
paramMap.put("trayCode", ssj.getTrayCode());
|
||||
paramMap.put("floor", "1");
|
||||
paramMap.put("entranceId",ssj.getDeviceCode());
|
||||
AjaxResult result = apiService.selectMydoJobByTrayCodeAndEntranceId(paramMap);
|
||||
if (result.isSuccess()) {
|
||||
inJob = BeanUtil.toBean(result.get("data"), MydoJob.class);
|
||||
inJob.setStatus(TASK_STATUS_CREATE);
|
||||
inJob.setExecutionPhase(TASK_EP_CREATE);
|
||||
inJob.setFaultFlag("0");
|
||||
mydoJobService.insertMydoJob(inJob);
|
||||
log.info("托盘码请求作业成功, rwh:{},trayCode:{}", ssj.getTaskNo(), ssj.getTrayCode());
|
||||
}else{
|
||||
//下发去向 和任务号
|
||||
int i = writeToSsj(ssj.getPlcDbWriteAddress(), "99", 2, 2);
|
||||
if (i == 1) {
|
||||
log.info("托盘码请求作业失败, rwh:{},qx:{},trayCode:{}", ssj.getTaskNo(), 2, ssj.getTrayCode());
|
||||
}
|
||||
}
|
||||
}
|
||||
if (inJob != null) {
|
||||
//下发去向 和任务号
|
||||
int i = writeToSsj(ssj.getPlcDbWriteAddress(), inJob.getTaskNo(), 1, 1);
|
||||
if (i == 1) {
|
||||
inJob.setStatus(TASK_STATUS_RUNNING);
|
||||
inJob.setExecutionPhase(TASK_EP_SSJ);
|
||||
inJob.setStartTime(DateUtil.formatDateTime(DateUtil.date()));
|
||||
inJob.setTargetRoadwayId(Convert.toStr(1));
|
||||
mydoJobService.updateMydoJob(inJob);
|
||||
log.info("托盘码请求作业成功,下发任务号 rwh:{},qx:{},trayCode:{}", ssj.getTaskNo(), 1, ssj.getTrayCode());
|
||||
}
|
||||
}else{
|
||||
//下发去向 和任务号
|
||||
int i = writeToSsj(ssj.getPlcDbWriteAddress(), "99", 2, 2);
|
||||
if (i == 1) {
|
||||
log.info("托盘码请求作业失败,下发回退 rwh:{},qx:{},trayCode:{}", ssj.getTaskNo(), 2, ssj.getTrayCode());
|
||||
}
|
||||
}
|
||||
}else {
|
||||
//查询下发的任务
|
||||
MydoJob param = new MydoJob();
|
||||
ArrayList<String> epList = new ArrayList<>();
|
||||
epList.add(TASK_EP_CREATE);
|
||||
epList.add(TASK_EP_SSJ);
|
||||
param.setEpList(epList);
|
||||
param.setStatus(TASK_STATUS_CREATE);
|
||||
param.setEntranceId(ssj.getDeviceCode());
|
||||
List<MydoJob> mydoJobs = mydoJobService.selectMydoJobList(param);
|
||||
if (CollUtil.isNotEmpty(mydoJobs)){
|
||||
//已请求wms,生成任务,二次下发
|
||||
MydoJob mydoJob = mydoJobs.get(0);
|
||||
int i = writeToSsj(ssj.getPlcDbWriteAddress(),mydoJob.getTaskNo(),1,1);
|
||||
if (i == 1) {
|
||||
mydoJob.setExecutionPhase(TASK_EP_SSJ);
|
||||
mydoJobService.updateMydoJob(mydoJob);
|
||||
log.info("{}无条码请求作业,二次下发任务号{}:",ssj.getDeviceCode(),mydoJob.getTaskNo());
|
||||
}
|
||||
}else {
|
||||
//不存在扫不到托盘码的任务
|
||||
HashMap<String, Object> paramMap = new HashMap<>();
|
||||
paramMap.put("entranceId",ssj.getDeviceCode());
|
||||
AjaxResult ajaxResult = apiService.selectMydoJobByNoTrayCode(paramMap);
|
||||
if (ajaxResult.isSuccess()) {
|
||||
MydoJob mydoJob2 = BeanUtil.toBean(ajaxResult.get("data"), MydoJob.class);
|
||||
mydoJob2.setExecutionPhase(TASK_EP_CREATE);
|
||||
mydoJob2.setFaultFlag("0");
|
||||
mydoJobService.insertMydoJob(mydoJob2);
|
||||
int i = writeToSsj(ssj.getPlcDbWriteAddress(),mydoJob2.getTaskNo(),1,1);
|
||||
if (i == 1) {
|
||||
mydoJob2.setExecutionPhase(TASK_EP_SSJ);
|
||||
mydoJobService.updateMydoJob(mydoJob2);
|
||||
log.info("{}无条码请求作业成功,下发任务号{}:",ssj.getDeviceCode(),mydoJob2.getTaskNo());
|
||||
}
|
||||
} else if (ajaxResult.isError()) {
|
||||
//超大,给plc下发错误信息,等待人工处理
|
||||
//托盘大小对不上,给plc下发错误信息,等待人工处理
|
||||
//码不对,给plc下发错误信息,等待人工处理
|
||||
int i = writeToSsj(ssj.getPlcDbWriteAddress(), "99", Integer.parseInt(ajaxResult.get("code").toString()), 2);
|
||||
if (i == 1) {
|
||||
log.info("{}无条码请求作业失败,下发退回{}:",ssj.getDeviceCode(),Integer.parseInt(ajaxResult.get("code").toString()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,187 +0,0 @@
|
||||
package com.ruoyi.schedule.scheduleTask.ssj.floor1;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
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.utils.spring.SpringUtils;
|
||||
import com.ruoyi.device.ssj.domain.DeviceSsj;
|
||||
import com.ruoyi.job.domain.JobCallBack;
|
||||
import com.ruoyi.job.domain.MydoJob;
|
||||
import com.ruoyi.job.service.IJobCallBackService;
|
||||
import com.ruoyi.job.service.IMydoJobService;
|
||||
import com.ruoyi.queue.agv.service.IAgvQueueService;
|
||||
import com.ruoyi.queue.ddj.domain.DdjDeviceExecutionQueue;
|
||||
import com.ruoyi.queue.ddj.service.IDdjDeviceExecutionQueueService;
|
||||
import com.ruoyi.schedule.plcRead.ssj.PlcSsjRead;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import static com.ruoyi.common.TaskStatusCode.*;
|
||||
import static com.ruoyi.common.TaskType.DDJ_RWLX_3;
|
||||
|
||||
/**
|
||||
* 一楼双向线体出库线程 循环盘点出库作业+巷道口空闲+出库线体全部空闲+无入库作业 生成堆垛机出库队列
|
||||
*/
|
||||
|
||||
@Slf4j
|
||||
public class Floor1BothWayOutSsjThread implements Runnable {
|
||||
|
||||
public HashMap<String, List<DeviceSsj>> ssjCodeList;
|
||||
|
||||
private IMydoJobService mydoJobService;
|
||||
private IBasCargoSpaceService basCargoSpaceService;
|
||||
private IDdjDeviceExecutionQueueService ddjDeviceExecutionQueueService;
|
||||
private final Map<String,List<Integer>> roadwayMap = new HashMap<>();
|
||||
private IJobCallBackService jobCallBackService;
|
||||
|
||||
private final Map<String,DeviceSsj> roadwayOutMap = new HashMap<>();
|
||||
|
||||
|
||||
public boolean isRun = true;
|
||||
|
||||
|
||||
public void init() {
|
||||
ssjCodeList = new HashMap<>();
|
||||
ArrayList<DeviceSsj> roadway1 = new ArrayList<>();
|
||||
roadway1.add(PlcSsjRead.deviceSsjMap.get("L2003"));
|
||||
roadway1.add(PlcSsjRead.deviceSsjMap.get("L2004"));
|
||||
roadwayOutMap.put("L2003", PlcSsjRead.deviceSsjMap.get("L2004"));
|
||||
ssjCodeList.put("roadway1", roadway1);
|
||||
ArrayList<DeviceSsj> roadway2 = new ArrayList<>();
|
||||
roadway2.add(PlcSsjRead.deviceSsjMap.get("L2005"));
|
||||
roadway2.add(PlcSsjRead.deviceSsjMap.get("L2006"));
|
||||
roadwayOutMap.put("L2005", PlcSsjRead.deviceSsjMap.get("L2006"));
|
||||
ssjCodeList.put("roadway2", roadway2);
|
||||
ArrayList<DeviceSsj> ou1 = new ArrayList<>();
|
||||
ou1.add(PlcSsjRead.deviceSsjMap.get("L2004"));
|
||||
ssjCodeList.put("ou1", ou1);
|
||||
ArrayList<DeviceSsj> out2 = new ArrayList<>();
|
||||
out2.add(PlcSsjRead.deviceSsjMap.get("L2006"));
|
||||
ssjCodeList.put("out2", out2);
|
||||
|
||||
|
||||
|
||||
mydoJobService = SpringUtils.getBean(IMydoJobService.class);
|
||||
basCargoSpaceService = SpringUtils.getBean(IBasCargoSpaceService.class);
|
||||
ddjDeviceExecutionQueueService = SpringUtils.getBean(IDdjDeviceExecutionQueueService.class);
|
||||
jobCallBackService = SpringUtils.getBean(IJobCallBackService.class);
|
||||
|
||||
|
||||
//初始化巷道口 排 列 层
|
||||
roadwayMap.put("L2003",Arrays.asList(2,47,1));
|
||||
roadwayMap.put("L2005",Arrays.asList(3,70,1));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
init();
|
||||
while (isRun){
|
||||
for (String type : ssjCodeList.keySet()) {
|
||||
|
||||
switch (type){
|
||||
case "roadway1":
|
||||
case "roadway2":
|
||||
dispatch(ssjCodeList.get(type));
|
||||
break;
|
||||
case "out1":
|
||||
case "out2":
|
||||
dispatch1(ssjCodeList.get(type));
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
try {
|
||||
Thread.sleep(1500);
|
||||
} catch (InterruptedException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void dispatch1(List<DeviceSsj> ssjList) {
|
||||
for (DeviceSsj ssj : ssjList) {
|
||||
|
||||
if (ssj.getDw()==1 && ssj.getTaskNo()>0){
|
||||
MydoJob mydoJob = mydoJobService.selectMydoJobByTaskNo(Convert.toLong(ssj.getTaskNo()));
|
||||
if (ObjUtil.isNotNull(mydoJob) && mydoJob.getExecutionPhase().equals(TASK_EP_ROADWAY_SSJ)) {
|
||||
mydoJob.setExecutionPhase(TASK_EP_SSJ);
|
||||
mydoJobService.updateMydoJob(mydoJob);
|
||||
}
|
||||
if (ObjUtil.isNotNull(mydoJob) && mydoJob.getExecutionPhase().equals(TASK_EP_SSJ)) {
|
||||
JobCallBack jobCallBack = new JobCallBack();
|
||||
jobCallBack.setType("2");
|
||||
jobCallBack.setMydojobId(mydoJob.getJobId());
|
||||
jobCallBack.setStatus("0");
|
||||
jobCallBack.setTaskNo(Convert.toLong(mydoJob.getTaskNo()));
|
||||
jobCallBack.setCreateTime(new Date());
|
||||
jobCallBack.setSpare1("0");
|
||||
jobCallBackService.insertJobCallBack(jobCallBack);
|
||||
|
||||
log.info("完成任务 taskNo{} ", mydoJob.getTaskNo());
|
||||
mydoJob.setStatus(TASK_STATUS_FINISH);
|
||||
mydoJob.setExecutionPhase(TASK_EP_WMS_FINISH);
|
||||
mydoJob.setFinishTime(DateUtil.formatDateTime(new Date()));
|
||||
mydoJobService.updateMydoJob(mydoJob);
|
||||
mydoJobService.insertHistory(mydoJob.getJobId());
|
||||
mydoJobService.deleteMydoJobByJobId(mydoJob.getJobId());
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 出库堆垛机队列生成
|
||||
*/
|
||||
public void dispatch(List<DeviceSsj> ssjList) {
|
||||
DeviceSsj deviceSsj = roadwayOutMap.get(ssjList.get(0).getDeviceCode());
|
||||
MydoJob pdOutJob = mydoJobService.selectMydoJobByExitList(Collections.singletonList(deviceSsj.getDeviceCode()));
|
||||
MydoJob inJob = mydoJobService.selectMydoJobByEntranceList(Collections.singletonList(deviceSsj.getDeviceCode()));
|
||||
boolean allKx = ssjList.stream().allMatch(ssj -> ssj.getKx() == 1);
|
||||
if (ObjUtil.isNotNull(pdOutJob) && allKx && ObjUtil.isNull(inJob)) {
|
||||
//所有线体为空闲 并且存在出库作业 并且不存在入库作业
|
||||
BasCargoSpace basCargoSpace = basCargoSpaceService.selectBasCargoSpaceByWmsCargoSpaceId(pdOutJob.getCargoSpaceId());
|
||||
if (ObjUtil.isNull(basCargoSpace)){
|
||||
log.error("货位不存在 cargoSpaceId{}",pdOutJob.getCargoSpaceId());
|
||||
}else {
|
||||
//生成队列
|
||||
List<DdjDeviceExecutionQueue> list = ddjDeviceExecutionQueueService.selectDdjDeviceExecutionQueueListByRwlx(DDJ_RWLX_3,Convert.toInt(pdOutJob.getRoadwayId()));
|
||||
List<Integer> pclList = roadwayMap.get(ssjList.get(0).getDeviceCode());
|
||||
if (CollUtil.isEmpty(list) && CollUtil.isNotEmpty(pclList)){
|
||||
DdjDeviceExecutionQueue ddjDeviceExecutionQueue = new DdjDeviceExecutionQueue();
|
||||
ddjDeviceExecutionQueue.setUuid(IdUtil.simpleUUID());
|
||||
ddjDeviceExecutionQueue.setRwh(Convert.toLong(pdOutJob.getTaskNo()));
|
||||
ddjDeviceExecutionQueue.setDevName(pdOutJob.getRoadwayId());
|
||||
ddjDeviceExecutionQueue.setDevId(Convert.toInt(pdOutJob.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(pdOutJob.getTraySize());
|
||||
ddjDeviceExecutionQueue.setScsj(DateUtil.formatDateTime(DateUtil.date()));
|
||||
ddjDeviceExecutionQueue.setRwlx(DDJ_RWLX_3);
|
||||
ddjDeviceExecutionQueueService.insertDdjDeviceExecutionQueue(ddjDeviceExecutionQueue);
|
||||
|
||||
pdOutJob.setStatus(TASK_STATUS_RUNNING);
|
||||
pdOutJob.setExecutionPhase(TASK_EP_DDJ);
|
||||
pdOutJob.setStartTime(DateUtil.formatDateTime(DateUtil.date()));
|
||||
mydoJobService.updateMydoJob(pdOutJob);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,196 +0,0 @@
|
||||
package com.ruoyi.schedule.scheduleTask.ssj.floor1;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
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.utils.spring.SpringUtils;
|
||||
import com.ruoyi.device.ssj.domain.DeviceSsj;
|
||||
import com.ruoyi.job.domain.JobCallBack;
|
||||
import com.ruoyi.job.domain.MydoJob;
|
||||
import com.ruoyi.job.service.IJobCallBackService;
|
||||
import com.ruoyi.job.service.IMydoJobService;
|
||||
import com.ruoyi.queue.ddj.domain.DdjDeviceExecutionQueue;
|
||||
import com.ruoyi.queue.ddj.service.IDdjDeviceExecutionQueueService;
|
||||
import com.ruoyi.schedule.plcRead.ssj.PlcSsjRead;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import static com.ruoyi.common.TaskStatusCode.*;
|
||||
import static com.ruoyi.common.TaskType.DDJ_RWLX_2;
|
||||
|
||||
/**
|
||||
* 一楼单向出库线程 循环出库作业+巷道口空闲 生成堆垛机出库队列
|
||||
*/
|
||||
@Slf4j
|
||||
public class Floor1SingleSsjThread implements Runnable {
|
||||
|
||||
public HashMap<String, List<String>> ssjCodeList;
|
||||
private IMydoJobService mydoJobService;
|
||||
public boolean isRun = true;
|
||||
private final Map<String, String> exitRoadwayMap = new HashMap<>();
|
||||
private IDdjDeviceExecutionQueueService ddjDeviceExecutionQueueService;
|
||||
private IBasCargoSpaceService basCargoSpaceService;
|
||||
private final Map<String, List<Integer>> roadwayMap = new HashMap<>();
|
||||
private IJobCallBackService jobCallBackService;
|
||||
|
||||
|
||||
public void init() {
|
||||
//设置要循环的输送机
|
||||
ssjCodeList = new HashMap<>();
|
||||
ArrayList<String> outRoadwaySsjList = new ArrayList<>();
|
||||
outRoadwaySsjList.add("L2001");
|
||||
outRoadwaySsjList.add("L2007");
|
||||
ssjCodeList.put("outRoadwaySsj", outRoadwaySsjList);
|
||||
ArrayList<String> outSsjList = new ArrayList<>();
|
||||
outSsjList.add("L2002");
|
||||
outSsjList.add("L2008");
|
||||
ssjCodeList.put("outSsj", outSsjList);
|
||||
|
||||
|
||||
//初始化服务
|
||||
mydoJobService = SpringUtils.getBean(IMydoJobService.class);
|
||||
ddjDeviceExecutionQueueService = SpringUtils.getBean(IDdjDeviceExecutionQueueService.class);
|
||||
basCargoSpaceService = SpringUtils.getBean(IBasCargoSpaceService.class);
|
||||
jobCallBackService = SpringUtils.getBean(IJobCallBackService.class);
|
||||
|
||||
|
||||
//初始化出口和巷道口映射关系
|
||||
exitRoadwayMap.put("L2001", "L2002");
|
||||
exitRoadwayMap.put("L2007", "L2008");
|
||||
|
||||
//初始化巷道口 排 列 层
|
||||
roadwayMap.put("L2001", Arrays.asList(1, 47, 1));
|
||||
roadwayMap.put("L2007", Arrays.asList(4, 70, 1));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
init();
|
||||
while (isRun) {
|
||||
for (String type : ssjCodeList.keySet()) {
|
||||
//一楼单向巷道口
|
||||
if ("outRoadwaySsj".equals(type)) {
|
||||
for (String ssjCode : ssjCodeList.get(type)) {
|
||||
try {
|
||||
if (PlcSsjRead.deviceSsjMap.containsKey(ssjCode)) {
|
||||
dispatch(PlcSsjRead.deviceSsjMap.get(ssjCode));
|
||||
} else {
|
||||
log.error("设备不存在 ssjCode{}", ssjCode);
|
||||
}
|
||||
} catch (RuntimeException e) {
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
if ("outSsj".equals(type)) {
|
||||
for (String ssjCode : ssjCodeList.get(type)) {
|
||||
try {
|
||||
if (PlcSsjRead.deviceSsjMap.containsKey(ssjCode)) {
|
||||
dispatch2(PlcSsjRead.deviceSsjMap.get(ssjCode));
|
||||
} else {
|
||||
log.error("设备不存在 ssjCode{}", ssjCode);
|
||||
}
|
||||
} catch (RuntimeException e) {
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
try {
|
||||
Thread.sleep(1500);
|
||||
} catch (InterruptedException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 一楼单向出库口调度
|
||||
*
|
||||
* @param ssj 输送机
|
||||
*/
|
||||
private void dispatch2(DeviceSsj ssj) {
|
||||
if (ssj.getDw() == 1 && ssj.getTaskNo() > 0) {
|
||||
MydoJob mydoJob = mydoJobService.selectMydoJobByTaskNo(Convert.toLong(ssj.getTaskNo()));
|
||||
if (ObjUtil.isNotNull(mydoJob)) {
|
||||
mydoJob.setExecutionPhase(TASK_EP_SSJ);
|
||||
mydoJobService.updateMydoJob(mydoJob);
|
||||
JobCallBack jobCallBack = new JobCallBack();
|
||||
jobCallBack.setType("2");
|
||||
jobCallBack.setMydojobId(mydoJob.getJobId());
|
||||
jobCallBack.setStatus("0");
|
||||
jobCallBack.setTaskNo(Convert.toLong(mydoJob.getTaskNo()));
|
||||
jobCallBack.setCreateTime(new Date());
|
||||
jobCallBack.setSpare1("0");
|
||||
jobCallBackService.insertJobCallBack(jobCallBack);
|
||||
log.info("完成任务 taskNo{} ", mydoJob.getTaskNo());
|
||||
mydoJob.setStatus(TASK_STATUS_FINISH);
|
||||
mydoJob.setFinishTime(DateUtil.formatDateTime(new Date()));
|
||||
mydoJob.setExecutionPhase(TASK_EP_WMS_FINISH);
|
||||
mydoJobService.updateMydoJob(mydoJob);
|
||||
mydoJobService.insertHistory(mydoJob.getJobId());
|
||||
mydoJobService.deleteMydoJobByJobId(mydoJob.getJobId());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 一楼单向巷道口调度
|
||||
*
|
||||
* @param ssj 输送机
|
||||
*/
|
||||
public void dispatch(DeviceSsj ssj) {
|
||||
//如果入库请求1 并且 托盘码不为空
|
||||
if (ssj.getKx() == 1) {
|
||||
String exitId = exitRoadwayMap.get(ssj.getDeviceCode());
|
||||
List<String> exitList = new ArrayList<>();
|
||||
exitList.add(exitId);
|
||||
MydoJob mydoJob = mydoJobService.selectMydoJobByExitList(exitList);
|
||||
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(ssj.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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,303 +0,0 @@
|
||||
package com.ruoyi.schedule.scheduleTask.ssj.floor2;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.ruoyi.api.service.IApiService;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.utils.spring.SpringUtils;
|
||||
import com.ruoyi.device.ssj.domain.DeviceSsj;
|
||||
import com.ruoyi.job.domain.JobCallBack;
|
||||
import com.ruoyi.job.domain.MydoJob;
|
||||
import com.ruoyi.job.service.IJobCallBackService;
|
||||
import com.ruoyi.job.service.IMydoJobService;
|
||||
import com.ruoyi.queue.agv.domain.AgvQueue;
|
||||
import com.ruoyi.queue.agv.service.IAgvQueueService;
|
||||
import com.ruoyi.schedule.plcRead.ssj.PlcSsjRead;
|
||||
import io.swagger.models.auth.In;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import static com.ruoyi.common.TaskStatusCode.*;
|
||||
import static com.ruoyi.common.utils.Threads.sleep;
|
||||
import static com.ruoyi.schedule.plcRead.ssj.PlcSsjRead.writeToSsj;
|
||||
import static com.ruoyi.schedule.plcRead.ssj.PlcSsjRead.writeToSsjQH;
|
||||
|
||||
/**
|
||||
* 二楼出入口输送线线程
|
||||
*/
|
||||
@Slf4j
|
||||
public class Floor2InOutSsjThread implements Runnable {
|
||||
|
||||
public HashMap<String, List<String>> ssjCodeList;
|
||||
|
||||
private IApiService apiService;
|
||||
private IAgvQueueService agvQueueService;
|
||||
private IMydoJobService mydoJobService;
|
||||
private IJobCallBackService jobCallBackService;
|
||||
|
||||
public boolean isRun = true;
|
||||
|
||||
|
||||
public void init() {
|
||||
ssjCodeList = new HashMap<>();
|
||||
ArrayList<String> ssjCodes = new ArrayList<>();
|
||||
ssjCodes.add("L1001");
|
||||
ssjCodes.add("L1003");
|
||||
ssjCodeList.put("inout", ssjCodes);
|
||||
apiService = SpringUtils.getBean(IApiService.class);
|
||||
agvQueueService = SpringUtils.getBean(IAgvQueueService.class);
|
||||
mydoJobService = SpringUtils.getBean(IMydoJobService.class);
|
||||
jobCallBackService = SpringUtils.getBean(IJobCallBackService.class);
|
||||
log.info("初始化服务 {},{}", apiService, agvQueueService);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
init();
|
||||
while (isRun) {
|
||||
for (String type : ssjCodeList.keySet()) {
|
||||
|
||||
switch (type) {
|
||||
case "inout":
|
||||
//入库口
|
||||
for (String ssjCode : ssjCodeList.get(type)) {
|
||||
try {
|
||||
if (PlcSsjRead.deviceSsjMap.containsKey(ssjCode)) {
|
||||
inDispatch(PlcSsjRead.deviceSsjMap.get(ssjCode));
|
||||
inDispatch1(PlcSsjRead.deviceSsjMap.get(ssjCode));
|
||||
} else {
|
||||
log.error("设备不存在 ssjCode{}", ssjCode);
|
||||
}
|
||||
} catch (RuntimeException e) {
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
try {
|
||||
Thread.sleep(1500);
|
||||
} catch (InterruptedException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void inDispatch(DeviceSsj inSsjDevice) {
|
||||
//如果输送机空闲
|
||||
if (inSsjDevice.getKx() == 1) {
|
||||
AgvQueue agvQueue = new AgvQueue();
|
||||
|
||||
//临时处理 收到AGV取货完成,给放货输送机下发切换导向
|
||||
agvQueue.setStatus("5");//请求放货
|
||||
//agvQueue.setStatus("4");
|
||||
//todo 与agv对点
|
||||
agvQueue.setPositionCode2(inSsjDevice.getDeviceCode());
|
||||
List<AgvQueue> agvQueues = agvQueueService.selectAgvQueueList(agvQueue);
|
||||
//不允许放货 等着
|
||||
if (!agvQueues.isEmpty() && inSsjDevice.getAllowPut() == 0 && "L1001".equals(inSsjDevice.getDeviceCode())) {
|
||||
//下发输送线切换导向 DB未知
|
||||
int i = writeToSsjQH("DB802.106", Integer.parseInt(agvQueues.get(0).getCtnrCode()));
|
||||
if (i == 1) {
|
||||
log.info("输送机{}下发切换导向{}成功", inSsjDevice.getDeviceCode(), agvQueues.get(0).getCtnrCode());
|
||||
}
|
||||
}
|
||||
if (!agvQueues.isEmpty() && inSsjDevice.getAllowPut() == 0 && "L1003".equals(inSsjDevice.getDeviceCode())) {
|
||||
//下发输送线切换导向 DB未知
|
||||
int i = writeToSsjQH("DB802.118", Integer.parseInt(agvQueues.get(0).getCtnrCode()));
|
||||
if (i == 1) {
|
||||
log.info("输送机{}下发切换导向{}成功", inSsjDevice.getDeviceCode(), agvQueues.get(0).getCtnrCode());
|
||||
}
|
||||
}
|
||||
|
||||
//允许放货
|
||||
if (!agvQueues.isEmpty() && inSsjDevice.getAllowPut() == 2) {
|
||||
log.info("设备:{} 位置:{} 任务号:{} 请求放货成功", inSsjDevice.getDeviceCode(), "输送线", agvQueues.get(0).getWmsTaskNo());
|
||||
AjaxResult ajaxResult = apiService.continueTask(agvQueues.get(0));
|
||||
if (ajaxResult.isSuccess()) {
|
||||
log.info("下发agv允许放货成功" + agvQueues.get(0).getWmsTaskNo());
|
||||
agvQueues.get(0).setStatus("6");
|
||||
agvQueueService.updateAgvQueue(agvQueues.get(0));
|
||||
}
|
||||
}
|
||||
}
|
||||
//入库下发输送线
|
||||
if (inSsjDevice.getKx() == 0 && inSsjDevice.getTaskNo() == 0) {
|
||||
AgvQueue agvQueue = new AgvQueue();
|
||||
agvQueue.setStatus("7"); //end
|
||||
//todo 与agv对点
|
||||
agvQueue.setPositionCode2(inSsjDevice.getDeviceCode());
|
||||
List<AgvQueue> agvQueues = agvQueueService.selectAgvQueueList(agvQueue);
|
||||
if (!agvQueues.isEmpty()) {
|
||||
//解绑AGV容器
|
||||
apiService.deleteAgvTray(agvQueues.get(0));
|
||||
sleep(10000);
|
||||
if("L1001".equals(inSsjDevice.getDeviceCode())) {
|
||||
int i = writeToSsj("DB802.100", agvQueues.get(0).getWmsTaskNo(), 2,Integer.parseInt(agvQueues.get(0).getCtnrCode()));
|
||||
if (i == 1) {
|
||||
log.info("输送机{}AGV放货完成下发任务号{}成功", inSsjDevice.getDeviceCode(), agvQueues.get(0).getWmsTaskNo());
|
||||
|
||||
}
|
||||
}
|
||||
if("L1003".equals(inSsjDevice.getDeviceCode())) {
|
||||
int i = writeToSsj("DB802.112", agvQueues.get(0).getWmsTaskNo(), 2,Integer.parseInt(agvQueues.get(0).getCtnrCode()));
|
||||
if (i == 1) {
|
||||
log.info("输送机{}AGV放货完成下发任务号{}成功", inSsjDevice.getDeviceCode(), agvQueues.get(0).getWmsTaskNo());
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(inSsjDevice.getKx() == 0 && inSsjDevice.getTaskNo2() > 0){
|
||||
AgvQueue agvQueue = new AgvQueue();
|
||||
agvQueue.setStatus("7"); //end
|
||||
//todo 与agv对点
|
||||
agvQueue.setPositionCode2(inSsjDevice.getDeviceCode());
|
||||
List<AgvQueue> agvQueues = agvQueueService.selectAgvQueueList(agvQueue);
|
||||
if(agvQueues.size() > 0){
|
||||
MydoJob mydoJob = mydoJobService.selectMydoJobByJobId(agvQueues.get(0).getTaskCode());
|
||||
mydoJob.setExecutionPhase(TASK_EP_SSJ);
|
||||
mydoJobService.updateMydoJob(mydoJob);
|
||||
agvQueueService.insertHistory(agvQueues.get(0).getReqCode());
|
||||
agvQueueService.deleteAgvQueueByReqCode(agvQueues.get(0).getReqCode());
|
||||
}
|
||||
}
|
||||
//出库到位
|
||||
if (inSsjDevice.getDw() == 1 && inSsjDevice.getTaskNo() > 0) {
|
||||
|
||||
MydoJob mydoJob = mydoJobService.selectMydoJobByTaskNo(Convert.toLong(inSsjDevice.getTaskNo()));
|
||||
if (mydoJob != null && Integer.parseInt(mydoJob.getInOrOut()) > 20) {
|
||||
log.info("设备:{} 位置:{} 任务号:{} 出库到位", "输送线", inSsjDevice.getDeviceCode(), mydoJob.getTaskNo());
|
||||
mydoJobService.insertHistory(mydoJob.getJobId());
|
||||
mydoJobService.deleteMydoJobByJobId(mydoJob.getJobId());
|
||||
JobCallBack jobCallBack = new JobCallBack();
|
||||
jobCallBack.setType("2");
|
||||
jobCallBack.setMydojobId(mydoJob.getJobId());
|
||||
jobCallBack.setStatus("0");
|
||||
jobCallBack.setTaskNo(Convert.toLong(mydoJob.getTaskNo()));
|
||||
jobCallBack.setCreateTime(new Date());
|
||||
jobCallBack.setSpare1("0");
|
||||
jobCallBackService.insertJobCallBack(jobCallBack);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void inDispatch1(DeviceSsj ssjDevice) {
|
||||
//有入库请求就肯定是电气的任务号的作业
|
||||
if(StrUtil.isNotBlank(ssjDevice.getTrayCode()) && ssjDevice.getRkqq()==1 && ssjDevice.getTaskNo()<1000){
|
||||
//,如果有正执行的出库作业退回
|
||||
MydoJob mydoJobParam = new MydoJob();
|
||||
mydoJobParam.setInOut("2");
|
||||
mydoJobParam.setStatus("3");
|
||||
mydoJobParam.setExitId(ssjDevice.getDeviceCode());
|
||||
List<MydoJob> outMydoJobList = mydoJobService.selectInOrOutMydoJobList(mydoJobParam);
|
||||
if(!outMydoJobList.isEmpty()){
|
||||
//todo 去向不明朗
|
||||
int i = writeToSsj(ssjDevice.getPlcDbWriteAddress(),"99",2,2);
|
||||
if (i == 1) {
|
||||
log.info(ssjDevice.getDeviceCode()+"有正执行的出库作业退回" );
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
MydoJob mydoJob = new MydoJob();
|
||||
mydoJob.setInOrOut("1");
|
||||
// mydoJob.setStatus("1");
|
||||
String[] split = ssjDevice.getTrayCode().split(" ");
|
||||
String serial = split[2].substring(7);
|
||||
mydoJob.setTrayCode(serial);
|
||||
mydoJob.setEntranceId(ssjDevice.getDeviceCode());
|
||||
List<MydoJob> mydoJobs = mydoJobService.selectMydoJobList(mydoJob);
|
||||
if(!mydoJobs.isEmpty()){
|
||||
MydoJob mydoJob1 = mydoJobs.get(0);
|
||||
int i = writeToSsj(ssjDevice.getPlcDbWriteAddress(),mydoJob1.getTaskNo(),1,1);
|
||||
if (i == 1) {
|
||||
mydoJob1.setExecutionPhase(TASK_EP_SSJ);
|
||||
mydoJob1.setStatus("3");
|
||||
mydoJobService.updateMydoJob(mydoJob1);
|
||||
log.info(ssjDevice.getDeviceCode()+"输送机下发任务号成功:{}" , mydoJob1.getTaskNo());
|
||||
}
|
||||
}else{
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
map.put("trayCode",ssjDevice.getTrayCode());
|
||||
map.put("entranceId",ssjDevice.getDeviceCode());
|
||||
map.put("floor", "2");
|
||||
AjaxResult ajaxResult = apiService.selectMydoJobByTrayCodeAndEntranceId(map);
|
||||
if(ajaxResult.isSuccess()){
|
||||
MydoJob mydoJob2 = BeanUtil.toBean(ajaxResult.get("data"), MydoJob.class);
|
||||
mydoJob2.setStatus("1");
|
||||
mydoJob2.setExecutionPhase(TASK_EP_CREATE);
|
||||
mydoJob2.setCreateTime(new Date());
|
||||
mydoJob2.setFaultFlag("0");
|
||||
mydoJobService.insertMydoJob(mydoJob2);
|
||||
int i = writeToSsj(ssjDevice.getPlcDbWriteAddress(),mydoJob2.getTaskNo(),1,1);
|
||||
if (i == 1) {
|
||||
mydoJob2.setExecutionPhase(TASK_EP_SSJ);
|
||||
mydoJob2.setStatus("3");
|
||||
mydoJobService.updateMydoJob(mydoJob2);
|
||||
log.info(ssjDevice.getDeviceCode()+"输送机下发任务号成功:{}" , mydoJob2.getTaskNo());
|
||||
}
|
||||
}else{
|
||||
//todo 去向不明朗
|
||||
int i = writeToSsj(ssjDevice.getPlcDbWriteAddress(),"99",2,2);
|
||||
if (i == 1) {
|
||||
log.info(ssjDevice.getDeviceCode()+"输送机没取到作业下发输送线" );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(StrUtil.isBlank(ssjDevice.getTrayCode()) && ssjDevice.getRkqq()==1 && ssjDevice.getTaskNo()<1000){
|
||||
|
||||
MydoJob mydoJob1 = new MydoJob();
|
||||
mydoJob1.setInOrOut("1");
|
||||
mydoJob1.setEntranceId(ssjDevice.getDeviceCode());
|
||||
// mydoJob1.setStatus("1");
|
||||
List<MydoJob> mydoJobs = mydoJobService.selectInOrOutMydoJobList(mydoJob1);
|
||||
if(!mydoJobs.isEmpty()){
|
||||
MydoJob mydoJob2 = mydoJobs.get(0);
|
||||
int i = writeToSsj(ssjDevice.getPlcDbWriteAddress(),mydoJob2.getTaskNo(),1,1);
|
||||
if (i == 1) {
|
||||
mydoJob2.setExecutionPhase(TASK_EP_SSJ);
|
||||
mydoJob2.setStatus("3");
|
||||
mydoJobService.updateMydoJob(mydoJob2);
|
||||
log.info(ssjDevice.getDeviceCode()+"输送机下发任务号成功:" + mydoJob2.getTaskNo());
|
||||
}
|
||||
|
||||
}else{
|
||||
HashMap<String, Object> paramMap = new HashMap<>();
|
||||
paramMap.put("size", ssjDevice.getTraySize());
|
||||
paramMap.put("entranceId", ssjDevice.getDeviceCode());
|
||||
AjaxResult ajaxResult = apiService.selectMydoJobByNoTrayCode(paramMap);
|
||||
if(ajaxResult.isSuccess()){
|
||||
MydoJob mydoJob2 = BeanUtil.toBean(ajaxResult.get("data"), MydoJob.class) ;
|
||||
mydoJob2.setStatus("1");
|
||||
mydoJob2.setExecutionPhase(TASK_EP_CREATE);
|
||||
mydoJob2.setCreateTime(new Date());
|
||||
mydoJob2.setFaultFlag("0");
|
||||
mydoJobService.insertMydoJob(mydoJob2);
|
||||
int i = writeToSsj(ssjDevice.getPlcDbWriteAddress(),mydoJob2.getTaskNo(),1,1);
|
||||
if (i == 1) {
|
||||
mydoJob2.setExecutionPhase(TASK_EP_SSJ);
|
||||
mydoJob2.setStatus("3");
|
||||
mydoJobService.updateMydoJob(mydoJob2);
|
||||
log.info(ssjDevice.getDeviceCode()+"输送机下发任务号成功:" + mydoJob2.getTaskNo());
|
||||
}
|
||||
}else{
|
||||
int i = writeToSsj(ssjDevice.getPlcDbWriteAddress(), "99", Integer.parseInt(ajaxResult.get("code").toString()), 2);
|
||||
if (i == 1) {
|
||||
log.info(ssjDevice.getDeviceCode()+"输送机下发错误信息成功");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,12 +6,20 @@ spring:
|
||||
druid:
|
||||
#主数据信息
|
||||
master:
|
||||
# url: jdbc:sqlserver://172.16.2.170:1433;databaseName=FT517-WCS;
|
||||
# 本地工控机
|
||||
# url: jdbc:sqlserver://172.16.4.12:1433;databaseName=FT517-WCS;encrypt=true;trustServerCertificate=true;
|
||||
# username: sa
|
||||
# password: Flrd0914.
|
||||
url: jdbc:sqlserver://192.168.58.10:1433;databaseName=FT517-wcs;
|
||||
|
||||
# 本机
|
||||
url: jdbc:sqlserver://localhost:1433;databaseName=FT568-wcs;encrypt=true;trustServerCertificate=true;
|
||||
username: sa
|
||||
password: www.123.com
|
||||
password: 123456
|
||||
|
||||
# 生产
|
||||
# url: jdbc:sqlserver://192.168.58.10:1433;databaseName=FT568-wcs;encrypt=true;trustServerCertificate=true;
|
||||
# username: sa
|
||||
# password: www.123.com
|
||||
|
||||
# 从库数据源
|
||||
slave:
|
||||
|
||||
@@ -66,9 +66,10 @@ spring:
|
||||
# 热部署开关
|
||||
enabled: true
|
||||
# redis 配置
|
||||
redis:
|
||||
spring.redis:
|
||||
# 地址
|
||||
host: 192.168.58.10
|
||||
host: 127.0.0.1
|
||||
# host: 172.16.4.12
|
||||
# 端口,默认为6379
|
||||
port: 6379
|
||||
# 数据库索引
|
||||
@@ -95,7 +96,7 @@ token:
|
||||
# 令牌密钥
|
||||
secret: abcdefghijklmnopqrstuvwxyz
|
||||
# 令牌有效期(默认30分钟)
|
||||
expireTime: 30
|
||||
expireTime: 10080
|
||||
|
||||
# MyBatis配置
|
||||
mybatis:
|
||||
|
||||
@@ -26,7 +26,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectAgvQueueVo">
|
||||
select req_code, req_time, position_code_1, position_code_2, task_type, ctnr_type, ctnr_code, ctnr_num, task_mode, priority, agv_type, request, finish_time, wms_traycode, wms_task_no,status,task_code,wms_task_type from agv_queue
|
||||
select req_code, req_time, position_code_1, position_code_2, task_type, ctnr_type, ctnr_code,
|
||||
ctnr_num, task_mode, priority, agv_type, request, finish_time, wms_traycode, wms_task_no,
|
||||
status,task_code,wms_task_type from agv_queue
|
||||
</sql>
|
||||
|
||||
<select id="selectAgvQueueList" parameterType="AgvQueue" resultMap="AgvQueueResult">
|
||||
@@ -53,6 +55,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
order by req_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectAgvQueueList1" parameterType="AgvQueue" resultMap="AgvQueueResult">
|
||||
select * from agv_queue where status=#{status} and position_code_2 like concat('%',#{positionCode2},'%')
|
||||
</select>
|
||||
<select id="selectAgvQueueByReqCode" parameterType="String" resultMap="AgvQueueResult">
|
||||
<include refid="selectAgvQueueVo"/>
|
||||
where req_code = #{reqCode}
|
||||
|
||||
@@ -36,21 +36,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<select id="selectDeviceSsjList" parameterType="DeviceSsj" resultMap="DeviceSsjResult">
|
||||
<include refid="selectDeviceSsjVo"/>
|
||||
<where>
|
||||
<if test="deviceCode != null and deviceCode != ''"> and device_code = #{deviceCode }</if>
|
||||
<if test="name != null and name != ''"> and name = #{name }</if>
|
||||
<if test="type != null and type != ''"> and type = #{type}</if>
|
||||
<if test="ipAddress != null and ipAddress != ''"> and ip_address = #{ipAddress}</if>
|
||||
<if test="plcDbReadAddress != null and plcDbReadAddress != ''"> and plc_db_read_address = #{plcDbReadAddress}</if>
|
||||
<if test="isActive != null and isActive != ''"> and is_active = #{isActive}</if>
|
||||
<if test="plcDbWriteAddress != null and plcDbWriteAddress != ''"> and plc_db_write_address = #{plcDbWriteAddress}</if>
|
||||
<if test="rkqq != null and rkqq != ''"> and rkqq = #{rkqq}</if>
|
||||
<if test="kx != null and kx != ''"> and kx = #{kx}</if>
|
||||
<if test="dw != null and dw != ''"> and dw = #{dw}</if>
|
||||
<if test="trayCode != null and trayCode != ''"> and tray_code = #{trayCode}</if>
|
||||
<if test="taskNo != null and taskNo != ''"> and task_no = #{taskNo}</if>
|
||||
<if test="exception != null and exception != ''"> and exception = #{exception}</if>
|
||||
<if test="traySize != null and traySize != ''"> and tray_size = #{traySize}</if>
|
||||
<if test="allowPut != null and allowPut != ''"> and allow_put = #{allowPut}</if>
|
||||
<if test="deviceCode != null and deviceCode != ''"> and device_code = #{deviceCode}</if>
|
||||
<if test="name != null and name != ''"> and name = #{name}</if>
|
||||
<if test="type != null and type != ''"> and type = #{type}</if>
|
||||
<if test="ipAddress != null and ipAddress != ''"> and ip_address = #{ipAddress}</if>
|
||||
<if test="plcDbReadAddress != null and plcDbReadAddress != ''"> and plc_db_read_address = #{plcDbReadAddress}</if>
|
||||
<if test="isActive != null and isActive != ''"> and is_active = #{isActive}</if>
|
||||
<if test="plcDbWriteAddress != null and plcDbWriteAddress != ''"> and plc_db_write_address = #{plcDbWriteAddress}</if>
|
||||
<if test="rkqq != null and rkqq != ''"> and rkqq = #{rkqq}</if>
|
||||
<if test="kx != null and kx != ''"> and kx = #{kx}</if>
|
||||
<if test="dw != null and dw != ''"> and dw = #{dw}</if>
|
||||
<if test="trayCode != null and trayCode != ''"> and tray_code = #{trayCode}</if>
|
||||
<if test="taskNo != null and taskNo != ''"> and task_no = #{taskNo}</if>
|
||||
<if test="exception != null and exception != ''"> and exception = #{exception}</if>
|
||||
<if test="traySize != null and traySize != ''"> and tray_size = #{traySize}</if>
|
||||
<if test="allowPut != null and allowPut != ''"> and allow_put = #{allowPut}</if>
|
||||
|
||||
</where>
|
||||
</select>
|
||||
|
||||
@@ -111,7 +111,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</foreach>
|
||||
and in_or_out > 20
|
||||
and status = 1 and execution_phase= 0
|
||||
order by priority desc,create_time
|
||||
order by priority asc,create_time
|
||||
</select>
|
||||
|
||||
<select id="selectMydoJobByExitList1" resultMap="MydoJobResult">
|
||||
select TOP 1 job_id, status, task_no, roadway_id, cargo_space_id, target_roadway_id, target_cargo_space_id, priority, execution_phase, in_or_out, create_time, start_time, finish_time, entrance_id, exit_id, warehouse_id, fault_flag,flag,tray_code,tray_size from mydo_job_wcs
|
||||
where exit_id = #{exitId}
|
||||
and roadway_id = #{roadwayId}
|
||||
and in_or_out > 20
|
||||
and status = 1 and execution_phase= 0
|
||||
order by priority asc,create_time
|
||||
</select>
|
||||
|
||||
<insert id="insertMydoJob" parameterType="MydoJob">
|
||||
@@ -197,6 +206,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
delete from mydo_job_wcs where job_id = #{jobId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteMydoJobByTaskNo" parameterType="String">
|
||||
delete from mydo_job_wcs where task_no = #{taskNo}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteMydoJobByJobIds" parameterType="String">
|
||||
delete from mydo_job_wcs where job_id in
|
||||
<foreach item="jobId" collection="array" open="(" separator="," close=")">
|
||||
@@ -237,8 +250,31 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
#{item}
|
||||
</foreach>
|
||||
and in_or_out <= 20 and status = 3
|
||||
order by priority desc,create_time desc
|
||||
order by priority asc,create_time asc
|
||||
</select>
|
||||
|
||||
<select id="selectMydoJobByEntranceList1" resultMap="MydoJobResult">
|
||||
select TOP 1 job_id, status, task_no, roadway_id, cargo_space_id, target_roadway_id, target_cargo_space_id, priority, execution_phase, in_or_out, create_time, start_time, finish_time, entrance_id, exit_id, warehouse_id, fault_flag,flag, tray_code from mydo_job_wcs
|
||||
where entrance_id = #{entranceId}
|
||||
and in_or_out <= 20 and status = 3
|
||||
order by priority asc,create_time asc
|
||||
</select>
|
||||
|
||||
<select id="getInJobByEntranceId" parameterType="java.lang.String" resultMap="MydoJobResult">
|
||||
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 from mydo_job_wcs
|
||||
where entrance_id = #{entranceId}
|
||||
and in_or_out <= 20 and status = 3
|
||||
order by priority asc,create_time asc
|
||||
</select>
|
||||
|
||||
<select id="selectMydoJobByExitId" parameterType="java.lang.String" resultMap="MydoJobResult">
|
||||
select TOP 1 job_id, status, task_no, roadway_id, cargo_space_id, target_roadway_id, target_cargo_space_id, priority, execution_phase, in_or_out, create_time, start_time, finish_time, entrance_id, exit_id, warehouse_id, fault_flag,flag, tray_code from mydo_job_wcs
|
||||
where exit_id = #{exitId}
|
||||
and in_or_out > 20
|
||||
and status = 1 and execution_phase= 0
|
||||
order by priority asc,create_time asc
|
||||
</select>
|
||||
|
||||
<select id="selectMydoJobFinishList" resultMap="MydoJobResult">
|
||||
<include refid="selectMydoJobFinishVo"/>
|
||||
<where>
|
||||
@@ -270,7 +306,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</foreach>
|
||||
and in_or_out > 20
|
||||
and status = 3
|
||||
order by priority desc,create_time
|
||||
order by priority asc,create_time
|
||||
</select>
|
||||
|
||||
<select id="getInJobByEntrance" resultMap="MydoJobResult">
|
||||
|
||||
@@ -148,6 +148,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
where uuid = #{uuid}
|
||||
</update>
|
||||
|
||||
|
||||
<delete id="deleteDdjDeviceExecutionQueueByUuid" parameterType="String">
|
||||
delete from ddj_device_execution_queue where uuid = #{uuid}
|
||||
</delete>
|
||||
|
||||
@@ -51,3 +51,13 @@ export function delMydoJob(jobId) {
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
export function handFinish(jobIds) {
|
||||
return request({
|
||||
url: '/job/mydoJob/OuthandFinish',
|
||||
method: 'get',
|
||||
params: { jobIds: jobIds }
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -49,4 +49,5 @@ export function delDdj(uuid) {
|
||||
url: '/queue/ddj/' + uuid,
|
||||
method: 'delete'
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
@@ -54,6 +54,20 @@
|
||||
</el-form>
|
||||
|
||||
|
||||
<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="handleDelete"
|
||||
v-hasPermi="['agv:queue:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
<el-table v-loading="loading" :data="queueList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="请求编号" align="center" prop="reqCode" />
|
||||
@@ -63,12 +77,12 @@
|
||||
<el-table-column label="任务类型" align="center" prop="taskType" />
|
||||
<el-table-column label="容器类型" align="center" prop="ctnrType" />
|
||||
<el-table-column label="容器编号" align="center" prop="ctnrCode" />
|
||||
<el-table-column label="容器数量" align="center" prop="ctnrNum" />
|
||||
<el-table-column label="任务模式" align="center" prop="taskMode" />
|
||||
<!-- <el-table-column label="容器数量" align="center" prop="ctnrNum" />-->
|
||||
<!-- <el-table-column label="任务模式" align="center" prop="taskMode" />-->
|
||||
<el-table-column label="优先级" align="center" prop="priority" />
|
||||
<el-table-column label="设备类型" align="center" prop="agvType" />
|
||||
<el-table-column label="继续请求" align="center" prop="request" />
|
||||
<el-table-column label="结束时间" align="center" prop="finishTime" />
|
||||
<!-- <el-table-column label="继续请求" align="center" prop="request" />-->
|
||||
<!-- <el-table-column label="结束时间" align="center" prop="finishTime" />-->
|
||||
<el-table-column label="wms托盘码" align="center" prop="wmsTraycode" />
|
||||
<el-table-column label="wms任务号" align="center" prop="wmsTaskNo" />
|
||||
<el-table-column label="任务单号" align="center" prop="taskCode" />
|
||||
@@ -82,6 +96,25 @@
|
||||
<dict-tag :options="dict.type.wms_task_type" :value="scope.row.wmsTaskType"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<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="['agv:queue:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['agv:queue:remove']"
|
||||
>删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
@@ -91,8 +124,20 @@
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="请求编号" prop="reqCode">
|
||||
<el-input v-model="form.reqCode" placeholder="请输入请求编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-input v-model="form.status" placeholder="请修改状态" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -9,10 +9,10 @@
|
||||
<div class="table-card">
|
||||
<div class="table-header">
|
||||
<span class="table-title">堆垛机监控</span>
|
||||
<el-tag type="success" size="mini">总计: 6 台</el-tag>
|
||||
<el-tag type="success" size="mini">总计: 1 台</el-tag>
|
||||
</div>
|
||||
<el-table :data="ddjData" size="mini" style="width: 100%">
|
||||
<el-table-column label="id" align="center" prop="id"/>
|
||||
<el-table-column label="堆垛机编号" align="center" prop="id"/>
|
||||
<el-table-column label="堆垛机名称" align="center" prop="name"/>
|
||||
<el-table-column label="当前巷道" align="center" prop="dqxd"/>
|
||||
<el-table-column label="任务号" align="center" prop="rwh"/>
|
||||
@@ -49,58 +49,22 @@
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<div class="floor-title">二层</div>
|
||||
<div class="floor-title">输送线</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20" class="table-container">
|
||||
<!-- 表格1:入库输送机 -->
|
||||
<el-col :span="8" class="table-col">
|
||||
<!-- 表格2:入出库输送机 -->
|
||||
<el-col :span="12" class="table-col">
|
||||
<div class="table-card">
|
||||
<div class="table-header">
|
||||
<span class="table-title">产线输送机</span>
|
||||
<el-tag type="success" size="mini">{{ table1Data.length }}台</el-tag>
|
||||
</div>
|
||||
<el-table :data="table1Data" size="mini" style="width: 100%">
|
||||
<el-table-column label="设备编码" prop="deviceCode"/>
|
||||
<!-- <el-table-column label="设备名称" prop="name"/>-->
|
||||
<el-table-column label="任务号" prop="taskNo"/>
|
||||
<el-table-column label="到位" prop="dw">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.ssj_dw" :value="scope.row.dw"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="空闲" prop="kx">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.ssj_kx" :value="scope.row.kx"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" prop="exception">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.ssj_ex" :value="scope.row.exception"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="托盘尺寸" prop="traySize" >
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.tray_size" :value="scope.row.traySize"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="托盘码" prop="trayCode" width="600" />
|
||||
|
||||
</el-table>
|
||||
</div>
|
||||
</el-col>
|
||||
|
||||
<!-- 表格2:出库输送机 -->
|
||||
<el-col :span="8" class="table-col">
|
||||
<div class="table-card">
|
||||
<div class="table-header">
|
||||
<span class="table-title">入出库口输送机</span>
|
||||
<span class="table-title">入出库输送机</span>
|
||||
<el-tag type="success" size="mini">{{ table2Data.length }}台</el-tag>
|
||||
</div>
|
||||
<el-table :data="table2Data" size="mini" style="width: 100%">
|
||||
<el-table-column label="设备编码" prop="deviceCode"/>
|
||||
<!-- <el-table-column label="设备名称" prop="name"/>-->
|
||||
<el-table-column label="任务号" prop="taskNo"/>
|
||||
<el-table-column label="托盘条码" prop="trayCode"/>
|
||||
<el-table-column label="到位" prop="dw">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.ssj_dw" :value="scope.row.dw"/>
|
||||
@@ -111,9 +75,9 @@
|
||||
<dict-tag :options="dict.type.ssj_kx" :value="scope.row.kx"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" prop="exception">
|
||||
<el-table-column label="状态" prop="sszt">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.ssj_ex" :value="scope.row.exception"/>
|
||||
<dict-tag :options="dict.type.ssj_ex" :value="scope.row.sszt"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="允许放货" prop="allowPut" >
|
||||
@@ -125,8 +89,8 @@
|
||||
</div>
|
||||
</el-col>
|
||||
|
||||
<!-- 表格3:分拣输送机 -->
|
||||
<el-col :span="8" class="table-col">
|
||||
<!-- 表格3:巷道口输送机 -->
|
||||
<el-col :span="12" class="table-col">
|
||||
<div class="table-card">
|
||||
<div class="table-header">
|
||||
<span class="table-title">巷道口输送机</span>
|
||||
@@ -146,9 +110,9 @@
|
||||
<dict-tag :options="dict.type.ssj_kx" :value="scope.row.kx"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" prop="exception">
|
||||
<el-table-column label="状态" prop="sszt">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.ssj_ex" :value="scope.row.exception"/>
|
||||
<dict-tag :options="dict.type.ssj_ex" :value="scope.row.sszt"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
@@ -158,31 +122,12 @@
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20" class="table-container">
|
||||
<el-col :span="24" class="table-col">
|
||||
<div class="table-card">
|
||||
<div class="table-header">
|
||||
<span class="table-title">AGV</span>
|
||||
<el-tag type="success" size="mini">{{ agvData.length }}台</el-tag>
|
||||
</div>
|
||||
<el-table :data="agvData" size="mini" style="width: 100%">
|
||||
<el-table-column label="设备编码" align="center" prop="deviceCode" />
|
||||
<el-table-column label="设备名称" align="center" prop="name" />
|
||||
<el-table-column label="状态" align="center" prop="status" />
|
||||
<el-table-column label="起点" align="center" prop="spare1" />
|
||||
<el-table-column label="终点" align="center" prop="spare2" />
|
||||
<el-table-column label="任务号" align="center" prop="taskNo" />
|
||||
<el-table-column label="执行阶段" align="center" prop="zxjd" />
|
||||
</el-table>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<div class="floor-title">一层</div>
|
||||
<el-col :span="24" v-if="isNone">
|
||||
<div class="floor-title">巷道口输送机</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20" class="table-container">
|
||||
<el-row :gutter="20" class="table-container" v-if="isNone">
|
||||
<!-- 表格4:提升机 -->
|
||||
<el-col :span="8" class="table-col">
|
||||
<div class="table-card">
|
||||
@@ -204,9 +149,9 @@
|
||||
<dict-tag :options="dict.type.ssj_kx" :value="scope.row.kx"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" prop="exception">
|
||||
<el-table-column label="状态" prop="sszt">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.ssj_ex" :value="scope.row.exception"/>
|
||||
<dict-tag :options="dict.type.ssj_ex" :value="scope.row.sszt"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="托盘码" prop="trayCode" width="600"/>
|
||||
@@ -237,9 +182,9 @@
|
||||
<dict-tag :options="dict.type.ssj_kx" :value="scope.row.kx"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" prop="exception">
|
||||
<el-table-column label="状态" prop="sszt">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.ssj_ex" :value="scope.row.exception"/>
|
||||
<dict-tag :options="dict.type.ssj_ex" :value="scope.row.sszt"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
@@ -268,9 +213,9 @@
|
||||
<dict-tag :options="dict.type.ssj_kx" :value="scope.row.kx"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" prop="exception">
|
||||
<el-table-column label="状态" prop="sszt">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.ssj_ex" :value="scope.row.exception"/>
|
||||
<dict-tag :options="dict.type.ssj_ex" :value="scope.row.sszt"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -291,7 +236,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'],
|
||||
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'],
|
||||
data() {
|
||||
return {
|
||||
// 查询参数
|
||||
@@ -308,14 +253,16 @@ export default {
|
||||
table6Data: [], // 旋转台
|
||||
ddjData: [], // 汇总统计
|
||||
agvData: [], // AGV
|
||||
timer: null
|
||||
timer: null,
|
||||
|
||||
isNone: false
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.initMockData()
|
||||
},
|
||||
mounted() {
|
||||
this.timer = setInterval(() => {x
|
||||
this.timer = setInterval(() => {
|
||||
this.initMockData();
|
||||
}, 1000); // 每1秒刷新一次
|
||||
},
|
||||
@@ -330,12 +277,15 @@ export default {
|
||||
this.ddjData = response.rows
|
||||
})
|
||||
listSsj(this.queryParams).then(response => {
|
||||
this.table1Data = response.rows.filter(item => item.deviceCode === 'G1005')
|
||||
this.table2Data = response.rows.filter(item => item.deviceCode === 'L1001' || item.deviceCode === 'L1003')
|
||||
this.table3Data = response.rows.filter(item => item.deviceCode === 'L1002' || item.deviceCode === 'L1004')
|
||||
this.table4Data = response.rows.filter(item => item.deviceCode === 'L2004' || item.deviceCode === 'L2006')
|
||||
this.table5Data = response.rows.filter(item => item.deviceCode === 'L2002' || item.deviceCode === 'L2008')
|
||||
this.table6Data = response.rows.filter(item => item.deviceCode === 'L2001' || item.deviceCode === 'L2003' || item.deviceCode === 'L2005' || item.deviceCode === 'L2007')
|
||||
// this.table1Data = response.rows.filter(item => item.deviceCode === 'G1005')
|
||||
this.table1Data = response.rows.filter(item => item.deviceCode === 'G1004')
|
||||
// this.table2Data = response.rows.filter(item => item.deviceCode === 'L1001' || item.deviceCode === 'L1003')
|
||||
// this.table3Data = response.rows.filter(item => item.deviceCode === 'L1002' || item.deviceCode === 'L1004')
|
||||
// this.table4Data = response.rows.filter(item => item.deviceCode === 'L2004' || item.deviceCode === 'L2006')
|
||||
// this.table5Data = response.rows.filter(item => item.deviceCode === 'L2002' || item.deviceCode === 'L2008')
|
||||
// this.table6Data = response.rows.filter(item => item.deviceCode === 'L2001' || item.deviceCode === 'L2003' || item.deviceCode === 'L2005' || item.deviceCode === 'L2007')
|
||||
this.table1Data = response.rows.filter(item => item.deviceCode === 'L1001')
|
||||
|
||||
})
|
||||
listDeviceCar(this.queryParams).then(response => {
|
||||
this.agvData = response.rows;
|
||||
|
||||
@@ -19,14 +19,14 @@
|
||||
/>
|
||||
</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>-->
|
||||
<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="货位ID" prop="cargoSpaceId">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.cargoSpaceId"-->
|
||||
@@ -129,51 +129,20 @@
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<!-- <el-row :gutter="10" class="mb8">-->
|
||||
<!-- <el-col :span="1.5">-->
|
||||
<!-- <el-button-->
|
||||
<!-- type="primary"-->
|
||||
<!-- plain-->
|
||||
<!-- icon="el-icon-plus"-->
|
||||
<!-- size="mini"-->
|
||||
<!-- @click="handleAdd"-->
|
||||
<!-- v-hasPermi="['job:mydoJob:add']"-->
|
||||
<!-- >新增</el-button>-->
|
||||
<!-- </el-col>-->
|
||||
<!-- <el-col :span="1.5">-->
|
||||
<!-- <el-button-->
|
||||
<!-- type="success"-->
|
||||
<!-- plain-->
|
||||
<!-- icon="el-icon-edit"-->
|
||||
<!-- size="mini"-->
|
||||
<!-- :disabled="single"-->
|
||||
<!-- @click="handleUpdate"-->
|
||||
<!-- v-hasPermi="['job:mydoJob:edit']"-->
|
||||
<!-- >修改</el-button>-->
|
||||
<!-- </el-col>-->
|
||||
<!-- <el-col :span="1.5">-->
|
||||
<!-- <el-button-->
|
||||
<!-- type="danger"-->
|
||||
<!-- plain-->
|
||||
<!-- icon="el-icon-delete"-->
|
||||
<!-- size="mini"-->
|
||||
<!-- :disabled="multiple"-->
|
||||
<!-- @click="handleDelete"-->
|
||||
<!-- v-hasPermi="['job:mydoJob:remove']"-->
|
||||
<!-- >删除</el-button>-->
|
||||
<!-- </el-col>-->
|
||||
<!-- <el-col :span="1.5">-->
|
||||
<!-- <el-button-->
|
||||
<!-- type="warning"-->
|
||||
<!-- plain-->
|
||||
<!-- icon="el-icon-download"-->
|
||||
<!-- size="mini"-->
|
||||
<!-- @click="handleExport"-->
|
||||
<!-- v-hasPermi="['job:mydoJob:export']"-->
|
||||
<!-- >导出</el-button>-->
|
||||
<!-- </el-col>-->
|
||||
<!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>-->
|
||||
<!-- </el-row>-->
|
||||
<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-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="mydoJobList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
@@ -186,8 +155,8 @@
|
||||
<el-table-column label="任务号" align="center" prop="taskNo" />
|
||||
<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="targetRoadwayId" />
|
||||
<!-- <el-table-column label="优先级" align="center" prop="priority" />-->
|
||||
<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"/>
|
||||
@@ -229,49 +198,33 @@
|
||||
/>
|
||||
|
||||
<!-- 添加或修改作业信息对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<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="请输入任务号" />
|
||||
<el-input v-model="form.taskNo" placeholder="请输入任务号" style="width: 220px"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="巷道ID" prop="roadwayId">
|
||||
<el-input v-model="form.roadwayId" placeholder="请输入巷道ID" />
|
||||
</el-form-item>
|
||||
<el-form-item label="货位ID" prop="cargoSpaceId">
|
||||
<el-input v-model="form.cargoSpaceId" placeholder="请输入货位ID" />
|
||||
</el-form-item>
|
||||
<el-form-item label="去向" prop="targetRoadwayId">
|
||||
<el-input v-model="form.targetRoadwayId" placeholder="请输入去向" />
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="目标货位ID" prop="targetCargoSpaceId">
|
||||
<el-input v-model="form.targetCargoSpaceId" placeholder="请输入目标货位ID" />
|
||||
</el-form-item>-->
|
||||
<el-form-item label="优先级" prop="priority">
|
||||
<el-input v-model="form.priority" placeholder="请输入优先级" />
|
||||
<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>
|
||||
</el-form-item>
|
||||
<el-form-item label="执行阶段" prop="executionPhase">
|
||||
<el-input v-model="form.executionPhase" placeholder="请输入执行阶段" />
|
||||
<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-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="任务类型" prop="inOrOut">
|
||||
<el-input v-model="form.inOrOut" placeholder="请输入任务类型" />
|
||||
</el-form-item>
|
||||
<el-form-item label="开始时间" prop="startTime">
|
||||
<el-input v-model="form.startTime" placeholder="请输入开始时间" />
|
||||
</el-form-item>
|
||||
<el-form-item label="结束时间" prop="finishTime">
|
||||
<el-input v-model="form.finishTime" placeholder="请输入结束时间" />
|
||||
</el-form-item>
|
||||
<el-form-item label="入口ID" prop="entranceId">
|
||||
<el-input v-model="form.entranceId" placeholder="请输入入口ID" />
|
||||
</el-form-item>
|
||||
<el-form-item label="出口ID" prop="exitId">
|
||||
<el-input v-model="form.exitId" placeholder="请输入出口ID" />
|
||||
</el-form-item>
|
||||
<el-form-item label="仓库ID" prop="warehouseId">
|
||||
<el-input v-model="form.warehouseId" placeholder="请输入仓库ID" />
|
||||
</el-form-item>
|
||||
<el-form-item label="重分标志" prop="faultFlag">
|
||||
<el-input v-model="form.faultFlag" placeholder="请输入重分标志" />
|
||||
<el-form-item label="优先级" prop="priority">
|
||||
<el-input v-model="form.priority" placeholder="请输入优先级" type="number" style="width: 220px"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
@@ -283,7 +236,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {listMydoJob, getMydoJob, delMydoJob, addMydoJob, updateMydoJob, listMydoJobFinish} from "@/api/job/mydoJob"
|
||||
import {listMydoJob, getMydoJob, delMydoJob, addMydoJob, updateMydoJob, listMydoJobFinish,handFinish} from "@/api/job/mydoJob"
|
||||
|
||||
export default {
|
||||
name: "MydoJob",
|
||||
@@ -326,7 +279,8 @@ export default {
|
||||
entranceId: null,
|
||||
exitId: null,
|
||||
warehouseId: null,
|
||||
faultFlag: null
|
||||
faultFlag: null,
|
||||
trayCode: null
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
@@ -387,7 +341,8 @@ export default {
|
||||
entranceId: null,
|
||||
exitId: null,
|
||||
warehouseId: null,
|
||||
faultFlag: null
|
||||
faultFlag: null,
|
||||
trayCode: null
|
||||
}
|
||||
this.resetForm("form")
|
||||
},
|
||||
@@ -450,9 +405,25 @@ export default {
|
||||
return delMydoJob(jobIds)
|
||||
}).then(() => {
|
||||
this.getList()
|
||||
this.$modal.msgSuccess("删除成功")
|
||||
this.$modal.msgSuccess("操作成功")
|
||||
}).catch(() => {})
|
||||
},
|
||||
OuthandFinish() {
|
||||
|
||||
if (this.ids.length === 0) {
|
||||
this.$modal.msgError("请选择需要手动完成的任务");
|
||||
return;
|
||||
}
|
||||
|
||||
console.log(this.ids.join(','))
|
||||
|
||||
this.$modal.confirm('是否确认手动完成选中的任务?').then(() => {
|
||||
return handFinish(this.ids.join(','));
|
||||
}).then(() => {
|
||||
this.$modal.msgSuccess("手动完成成功");
|
||||
this.getList();
|
||||
}).catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('job/mydoJob/export', {
|
||||
|
||||
@@ -159,16 +159,6 @@
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['queue:ddj:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
@@ -178,7 +168,7 @@
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['queue:ddj:edit']"
|
||||
>修改</el-button>
|
||||
>重新下发</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
@@ -191,16 +181,6 @@
|
||||
v-hasPermi="['queue:ddj:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['queue:ddj:export']"
|
||||
>导出</el-button>
|
||||
</el-col>-->
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
@@ -259,70 +239,70 @@
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改堆垛机执行队列对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="任务号" prop="rwh">
|
||||
<el-input v-model="form.rwh" placeholder="请输入任务号" />
|
||||
</el-form-item>
|
||||
<!-- 添加或修改堆垛机执行队列对话框-->
|
||||
<!-- <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>-->
|
||||
<!-- <el-form ref="form" :model="form" :rules="rules" label-width="80px">-->
|
||||
<!-- <el-form-item label="任务号" prop="rwh">-->
|
||||
<!-- <el-input v-model="form.rwh" placeholder="请输入任务号" />-->
|
||||
<!-- </el-form-item>-->
|
||||
|
||||
<el-form-item label="设备id" prop="devId">
|
||||
<el-input v-model="form.devId" placeholder="请输入设备id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="任务状态" prop="rwzt">
|
||||
<el-input v-model="form.rwzt" placeholder="请输入任务状态" />
|
||||
</el-form-item>
|
||||
<el-form-item label="原排" prop="yph">
|
||||
<el-input v-model="form.yph" placeholder="请输入原排" />
|
||||
</el-form-item>
|
||||
<el-form-item label="原列" prop="ylh">
|
||||
<el-input v-model="form.ylh" placeholder="请输入原列" />
|
||||
</el-form-item>
|
||||
<el-form-item label="原层" prop="ych">
|
||||
<el-input v-model="form.ych" placeholder="请输入原层" />
|
||||
</el-form-item>
|
||||
<el-form-item label="目标排" prop="mbph">
|
||||
<el-input v-model="form.mbph" placeholder="请输入目标排" />
|
||||
</el-form-item>
|
||||
<el-form-item label="目标列" prop="mblh">
|
||||
<el-input v-model="form.mblh" placeholder="请输入目标列" />
|
||||
</el-form-item>
|
||||
<el-form-item label="目标层" prop="mbch">
|
||||
<el-input v-model="form.mbch" placeholder="请输入目标层" />
|
||||
</el-form-item>
|
||||
<el-form-item label="堆垛机下发" prop="ddjxf">
|
||||
<el-input v-model="form.ddjxf" placeholder="请输入堆垛机下发" />
|
||||
</el-form-item>
|
||||
<el-form-item label="任务类型" prop="rwlx">
|
||||
<el-input v-model="form.rwlx" placeholder="请输入任务类型" />
|
||||
</el-form-item>
|
||||
<el-form-item label="生成时间" prop="scsj">
|
||||
<el-input v-model="form.scsj" placeholder="请输入生成时间" />
|
||||
</el-form-item>
|
||||
<el-form-item label="下发时间" prop="xfsj">
|
||||
<el-input v-model="form.xfsj" placeholder="请输入下发时间" />
|
||||
</el-form-item>
|
||||
<el-form-item label="结束时间" prop="jssj">
|
||||
<el-input v-model="form.jssj" placeholder="请输入结束时间" />
|
||||
</el-form-item>
|
||||
<el-form-item label="命令方式" prop="mlfs">
|
||||
<el-input v-model="form.mlfs" placeholder="请输入命令方式" />
|
||||
</el-form-item>
|
||||
<el-form-item label="${comment}" prop="spare1">
|
||||
<el-input v-model="form.spare1" placeholder="请输入${comment}" />
|
||||
</el-form-item>
|
||||
<el-form-item label="${comment}" prop="spare2">
|
||||
<el-input v-model="form.spare2" placeholder="请输入${comment}" />
|
||||
</el-form-item>
|
||||
<el-form-item label="${comment}" prop="spare3">
|
||||
<el-input v-model="form.spare3" placeholder="请输入${comment}" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!-- <el-form-item label="设备id" prop="devId">-->
|
||||
<!-- <el-input v-model="form.devId" placeholder="请输入设备id" />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="任务状态" prop="rwzt">-->
|
||||
<!-- <el-input v-model="form.rwzt" placeholder="请输入任务状态" />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="原排" prop="yph">-->
|
||||
<!-- <el-input v-model="form.yph" placeholder="请输入原排" />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="原列" prop="ylh">-->
|
||||
<!-- <el-input v-model="form.ylh" placeholder="请输入原列" />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="原层" prop="ych">-->
|
||||
<!-- <el-input v-model="form.ych" placeholder="请输入原层" />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="目标排" prop="mbph">-->
|
||||
<!-- <el-input v-model="form.mbph" placeholder="请输入目标排" />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="目标列" prop="mblh">-->
|
||||
<!-- <el-input v-model="form.mblh" placeholder="请输入目标列" />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="目标层" prop="mbch">-->
|
||||
<!-- <el-input v-model="form.mbch" placeholder="请输入目标层" />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="堆垛机下发" prop="ddjxf">-->
|
||||
<!-- <el-input v-model="form.ddjxf" placeholder="请输入堆垛机下发" />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="任务类型" prop="rwlx">-->
|
||||
<!-- <el-input v-model="form.rwlx" placeholder="请输入任务类型" />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="生成时间" prop="scsj">-->
|
||||
<!-- <el-input v-model="form.scsj" placeholder="请输入生成时间" />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="下发时间" prop="xfsj">-->
|
||||
<!-- <el-input v-model="form.xfsj" placeholder="请输入下发时间" />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="结束时间" prop="jssj">-->
|
||||
<!-- <el-input v-model="form.jssj" placeholder="请输入结束时间" />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="命令方式" prop="mlfs">-->
|
||||
<!-- <el-input v-model="form.mlfs" placeholder="请输入命令方式" />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="${comment}" prop="spare1">-->
|
||||
<!-- <el-input v-model="form.spare1" placeholder="请输入${comment}" />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="${comment}" prop="spare2">-->
|
||||
<!-- <el-input v-model="form.spare2" placeholder="请输入${comment}" />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="${comment}" prop="spare3">-->
|
||||
<!-- <el-input v-model="form.spare3" placeholder="请输入${comment}" />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </el-form>-->
|
||||
<!-- <div slot="footer" class="dialog-footer">-->
|
||||
<!-- <el-button type="primary" @click="submitForm">确 定</el-button>-->
|
||||
<!-- <el-button @click="cancel">取 消</el-button>-->
|
||||
<!-- </div>-->
|
||||
<!-- </el-dialog>-->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -466,13 +446,27 @@ export default {
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset()
|
||||
const uuid = row.uuid || this.ids
|
||||
getDdj(uuid).then(response => {
|
||||
this.form = response.data
|
||||
this.open = true
|
||||
this.title = "修改堆垛机执行队列"
|
||||
})
|
||||
this.$modal.confirm('是否确认重新下发?').then(() => {
|
||||
// 只处理第一个选中的
|
||||
const uuids = row.uuid || this.ids
|
||||
console.log(uuids)
|
||||
|
||||
if (uuids.length > 0) {
|
||||
// 假设DdjDeviceExecutionQueue对象有uuid字段
|
||||
const data = {
|
||||
uuid: uuids[0]
|
||||
// 可能需要的其他字段...
|
||||
};
|
||||
return updateDdj(data);
|
||||
} else {
|
||||
return Promise.reject('请选择要重新下发的记录');
|
||||
}
|
||||
}).then(() => {
|
||||
this.$modal.msgSuccess("重新下发成功");
|
||||
this.getList();
|
||||
}).catch((error) => {
|
||||
console.error(error);
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
@@ -480,7 +474,7 @@ export default {
|
||||
if (valid) {
|
||||
if (this.form.uuid != null) {
|
||||
updateDdj(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功")
|
||||
this.$modal.msgSuccess("下发成功")
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
@@ -504,6 +498,19 @@ export default {
|
||||
this.$modal.msgSuccess("删除成功")
|
||||
}).catch(() => {})
|
||||
},
|
||||
/**重新下发 */
|
||||
// OuthandFinish() {
|
||||
// if (this.ids.length === 0) {
|
||||
// this.$modal.msgError("请选择需要重新下发的任务");
|
||||
// return;
|
||||
// }
|
||||
// this.$modal.confirm('是否确认重新下发?').then(() => {
|
||||
// return handFinish(this.ids.join(','));
|
||||
// }).then(() => {
|
||||
// this.$modal.msgSuccess("重新下发成功");
|
||||
// this.getList();
|
||||
// }).catch(() => {});
|
||||
// },
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('queue/ddj/export', {
|
||||
|
||||
Reference in New Issue
Block a user