Compare commits
19 Commits
7abc29bb62
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0c0746fba6 | ||
|
|
8eb2bcc592 | ||
|
|
036ee35af3 | ||
|
|
d2d871baf1 | ||
|
|
6c2d8fcb0f | ||
|
|
5dcb72148e | ||
|
|
4e0d329e6d | ||
|
|
50534dc3be | ||
|
|
91ea5339a5 | ||
|
|
1f05708e4c | ||
|
|
1c3f1147dd | ||
|
|
6f7b37c957 | ||
|
|
be26120547 | ||
|
|
96ee0854a6 | ||
|
|
2b6065d72f | ||
|
|
88d01609d8 | ||
|
|
885fab377d | ||
|
|
8c6329b191 | ||
|
|
2bc6feb754 |
2
pom.xml
2
pom.xml
@@ -37,7 +37,7 @@
|
||||
<spring-framework.version>5.3.39</spring-framework.version>
|
||||
<hutool.version>5.8.27</hutool.version>
|
||||
<lombok.version>1.18.30</lombok.version>
|
||||
<HslCommunication.version>3.7.0</HslCommunication.version>
|
||||
<HslCommunication.version>2.0.0</HslCommunication.version>
|
||||
<mybatis-plus.version>3.5.2</mybatis-plus.version>
|
||||
|
||||
</properties>
|
||||
|
||||
@@ -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>
|
||||
|
||||
<!-- 核心模块-->
|
||||
|
||||
21
ruoyi-admin/src/main/java/com/ruoyi/MyStartupRunner.java
Normal file
21
ruoyi-admin/src/main/java/com/ruoyi/MyStartupRunner.java
Normal file
@@ -0,0 +1,21 @@
|
||||
package com.ruoyi;
|
||||
|
||||
import com.ruoyi.schedule.ScheduleThread;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.CommandLineRunner;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class MyStartupRunner implements CommandLineRunner {
|
||||
|
||||
@Autowired
|
||||
private ScheduleThread scheduleThread;
|
||||
|
||||
@Override
|
||||
public void run(String... args) throws Exception {
|
||||
// 这里编写项目启动后要执行的方法逻辑
|
||||
//System.out.println("项目启动成功后自动执行此方法");
|
||||
scheduleThread.startAllThread();
|
||||
scheduleThread.startAllThread2();
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,16 @@
|
||||
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;
|
||||
import com.ruoyi.queue.agv.domain.AgvQueue;
|
||||
import com.ruoyi.queue.agv.service.IAgvQueueService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -22,6 +28,9 @@ public class AgvController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IApiService apiService;
|
||||
@Autowired
|
||||
private IAgvQueueService agvQueueService;
|
||||
|
||||
|
||||
/**
|
||||
* agv执行状态返回接口
|
||||
@@ -34,7 +43,6 @@ public class AgvController extends BaseController {
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* agv搬运作业
|
||||
* @param param{
|
||||
@@ -50,4 +58,54 @@ public class AgvController extends BaseController {
|
||||
return apiService.receiveAgvMoveJob(param);
|
||||
}
|
||||
|
||||
@PostMapping("/deleteAgvTray")
|
||||
public AjaxResult deleteAgvTray(@RequestBody Map<String, String> param) {
|
||||
AgvQueue agvQueue = agvQueueService.selectAgvQueueByTaskCode(param.get("taskCode"));
|
||||
if(agvQueue==null){
|
||||
return AjaxResult.error("AGV任务队列不存在!");
|
||||
}else{
|
||||
return apiService.deleteAgvTray(agvQueue);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@PostMapping("/continueTask")
|
||||
public AjaxResult continueTask(@RequestBody Map<String, String> param) {
|
||||
AgvQueue agvQueue = agvQueueService.selectAgvQueueByTaskCode(param.get("taskCode"));
|
||||
if(agvQueue==null){
|
||||
return AjaxResult.error("AGV任务队列不存在!");
|
||||
}else{
|
||||
return apiService.continueTask(agvQueue);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 前端手动操作完成/取消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("0".equals(cancelTaskResponse.getCode())){
|
||||
agvQueueService.insertHistory(agvQueue.getReqCode());
|
||||
agvQueueService.deleteAgvQueueByReqCode(agvQueue.getReqCode());
|
||||
return AjaxResult.success("AGV任务队列取消成功!", cancelTaskResponse);
|
||||
}
|
||||
return AjaxResult.error("取消RCS-AGV任务队列失败!");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -20,49 +20,49 @@ import com.ruoyi.job.service.IMydoJobService;
|
||||
|
||||
/**
|
||||
* 大屏接口Controller
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Anonymous
|
||||
@RestController
|
||||
@RequestMapping("/api/screen")
|
||||
public class ScreenController extends BaseController {
|
||||
|
||||
|
||||
@Autowired
|
||||
private IDeviceSsjService deviceSsjService;
|
||||
|
||||
|
||||
@Autowired
|
||||
private IMydoJobService mydoJobService;
|
||||
|
||||
|
||||
// 定义各区域输送机编号数组
|
||||
private static final Map<Integer, List<String>> AREA_SSJ_CODES = new HashMap<>();
|
||||
|
||||
|
||||
// 静态初始化输送机编号数组
|
||||
static {
|
||||
// 1区域输送机编号
|
||||
AREA_SSJ_CODES.put(1, Arrays.asList(
|
||||
"L2007","L2008","L2005","L2006","L2013"
|
||||
"L2007", "L2008", "L2005", "L2006", "L2013"
|
||||
));
|
||||
|
||||
|
||||
// 2区域输送机编号
|
||||
AREA_SSJ_CODES.put(2, Arrays.asList(
|
||||
"L2003","L2004","L2012","L2001","L2002"
|
||||
"L2003", "L2004", "L2012", "L2001", "L2002"
|
||||
));
|
||||
|
||||
|
||||
// 3区域输送机编号
|
||||
AREA_SSJ_CODES.put(3, Arrays.asList(
|
||||
"L1001","L1002","L1011"
|
||||
"L1001", "L1002", "L1011"
|
||||
));
|
||||
|
||||
|
||||
// 4区域输送机编号
|
||||
AREA_SSJ_CODES.put(4, Arrays.asList(
|
||||
"L1003","L1004","L1012"
|
||||
"L1003", "L1004", "L1012"
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据区域编号查询输送机列表
|
||||
*
|
||||
*
|
||||
* @param areaNum 区域编号(1-4)
|
||||
* @return 输送机数据列表
|
||||
*/
|
||||
@@ -71,54 +71,155 @@ public class ScreenController extends BaseController {
|
||||
if (areaNum < 1 || areaNum > 4) {
|
||||
return AjaxResult.error("区域编号必须在1-4之间");
|
||||
}
|
||||
|
||||
|
||||
// 获取该区域的输送机编号数组
|
||||
List<String> ssjCodes = AREA_SSJ_CODES.get(areaNum);
|
||||
if (ssjCodes == null || ssjCodes.isEmpty()) {
|
||||
return AjaxResult.error("未找到该区域的输送机编号配置");
|
||||
}
|
||||
|
||||
|
||||
// 查询所有输送机
|
||||
List<DeviceSsj> allSsjList = deviceSsjService.selectDeviceSsjList(null);
|
||||
|
||||
|
||||
// 根据编号数组筛选输送机
|
||||
List<DeviceSsj> filteredList = allSsjList.stream()
|
||||
.filter(ssj -> ssj.getDeviceCode() != null && ssjCodes.contains(ssj.getDeviceCode().trim()))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
|
||||
// 转换为前端需要的数据格式
|
||||
List<Map<String, Object>> resultList = new ArrayList<>();
|
||||
// 创建作业信息列表
|
||||
List<MydoJob> jobList = new ArrayList<>();
|
||||
|
||||
|
||||
for (DeviceSsj ssj : filteredList) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("id", ssj.getDeviceCode());
|
||||
map.put("name", ssj.getName());
|
||||
map.put("kx", String.valueOf(ssj.getKx()));
|
||||
map.put("dw", String.valueOf(ssj.getDw()));
|
||||
map.put("sbzt", ssj.getException());
|
||||
map.put("kx", getSsjKx(ssj.getKx()));
|
||||
map.put("dw", getSsjDw(ssj.getDw()));
|
||||
map.put("sbzt", getSSzt(ssj.getSszt()));
|
||||
// map.put("trayCode", ssj.getTrayCode());
|
||||
map.put("allowPut", String.valueOf(ssj.getAllowPut()));
|
||||
map.put("traySize", String.valueOf(ssj.getTraySize()));
|
||||
map.put("exception", String.valueOf(ssj.getException()));
|
||||
map.put("exception", getSSzt(ssj.getSszt()));
|
||||
map.put("taskNo", ssj.getTaskNo());
|
||||
resultList.add(map);
|
||||
|
||||
|
||||
// 如果taskNo大于0,查询对应的作业信息
|
||||
if (ssj.getTaskNo()> 0) {
|
||||
MydoJob job = mydoJobService.selectMydoJobByTaskNo(Long.valueOf(ssj.getTaskNo()));
|
||||
if (ssj.getTaskNo() > 0) {
|
||||
MydoJob job = mydoJobService.selectJobByTaskNo(String.valueOf(ssj.getTaskNo()));
|
||||
if (job != null) {
|
||||
if("1".equals(job.getInOrOut())){
|
||||
job.setInOrOut("生产入库");
|
||||
job.setExitId(job.getEntranceId());
|
||||
}else if("2".equals(job.getInOrOut())){
|
||||
job.setInOrOut("退货入库");
|
||||
job.setExitId(job.getEntranceId());
|
||||
}else if("3".equals(job.getInOrOut())){
|
||||
job.setInOrOut("其他入库");
|
||||
job.setExitId(job.getEntranceId());
|
||||
}else if("5".equals(job.getInOrOut())){
|
||||
job.setInOrOut("盘点入库");
|
||||
job.setExitId(job.getEntranceId());
|
||||
}else if("21".equals(job.getInOrOut())){
|
||||
job.setInOrOut("物资出库");
|
||||
}else if("26".equals(job.getInOrOut())){
|
||||
job.setInOrOut("盘点出库");
|
||||
}
|
||||
|
||||
|
||||
jobList.add(job);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 返回结果包含data和job两个字段
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
result.put("ssj", resultList);
|
||||
result.put("job", jobList);
|
||||
|
||||
|
||||
return AjaxResult.success(result);
|
||||
}
|
||||
|
||||
private String getSsjDw(int dw) {
|
||||
if(dw == 1){
|
||||
return "到位";
|
||||
}else{
|
||||
return "未到位";
|
||||
}
|
||||
}
|
||||
|
||||
private String getSsjKx(int kx) {
|
||||
if(kx == 1){
|
||||
return "空闲";
|
||||
}else{
|
||||
return "不空闲";
|
||||
}
|
||||
}
|
||||
|
||||
private String getSSzt(int sszt) {
|
||||
String msg = "";
|
||||
switch (sszt) {
|
||||
case 1:
|
||||
msg = "手动";
|
||||
break;
|
||||
case 2:
|
||||
msg = "自动";
|
||||
break;
|
||||
case 3:
|
||||
msg = "运行";
|
||||
break;
|
||||
case 4:
|
||||
msg = "输送超时";
|
||||
break;
|
||||
case 5:
|
||||
msg = "断路器跳闸";
|
||||
break;
|
||||
case 6:
|
||||
msg = "变频器报警";
|
||||
break;
|
||||
case 7:
|
||||
msg = "开关任务异常";
|
||||
break;
|
||||
case 8:
|
||||
msg = "急停";
|
||||
break;
|
||||
case 9:
|
||||
msg = "输送超界";
|
||||
break;
|
||||
}
|
||||
return msg;
|
||||
}
|
||||
|
||||
private String getBjxx(int bjxx) {
|
||||
String msg = "";
|
||||
switch (bjxx) {
|
||||
case 1:
|
||||
msg = "前超长";
|
||||
break;
|
||||
case 2:
|
||||
msg = "后超长";
|
||||
break;
|
||||
case 3:
|
||||
msg = "左超宽";
|
||||
break;
|
||||
case 4:
|
||||
msg = "右超宽";
|
||||
break;
|
||||
case 5:
|
||||
msg = "超高";
|
||||
break;
|
||||
case 6:
|
||||
msg = "无任务";
|
||||
break;
|
||||
case 7:
|
||||
msg = "未扫到条码";
|
||||
break;
|
||||
case 8:
|
||||
msg = "称重异常";
|
||||
break;
|
||||
}
|
||||
return msg;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -75,4 +75,5 @@ public class Wcs2WmsController {
|
||||
return apiService.updateWcsPort(wcsPort);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -3,11 +3,46 @@ package com.ruoyi.api.domain.agv.cancelTask;
|
||||
import com.ruoyi.api.domain.agv.ResponseBase;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class CancelTaskResponse extends ResponseBase {
|
||||
public class CancelTaskResponse implements Serializable {
|
||||
|
||||
/**
|
||||
* 请求编号
|
||||
*/
|
||||
public String reqCode;
|
||||
|
||||
/**
|
||||
* 返回码
|
||||
*/
|
||||
private String code;
|
||||
/**
|
||||
* 返回消息
|
||||
*/
|
||||
private String message;
|
||||
|
||||
public String getReqCode() {
|
||||
return reqCode;
|
||||
}
|
||||
|
||||
public void setReqCode(String reqCode) {
|
||||
this.reqCode = reqCode;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(String code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public void setMessage(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,5 +16,5 @@ public class ReceiveJob {
|
||||
private String inOrOut;
|
||||
private String jobId;
|
||||
private String roadwayId;
|
||||
|
||||
private String departmentId;
|
||||
}
|
||||
|
||||
@@ -134,4 +134,8 @@ public interface IApiService
|
||||
AjaxResult receiveInMydoJob(ReceiveJob receiveInJob);
|
||||
|
||||
AjaxResult selectMydoJobByTrayCodeAndEntranceId(HashMap<String, Object> paramMap);
|
||||
|
||||
AjaxResult deleteAgvTray(AgvQueue agvQueue);
|
||||
|
||||
AjaxResult requestWmsSpace(MydoJob mydoJob);
|
||||
}
|
||||
|
||||
@@ -75,4 +75,6 @@ public interface IRequestLogService
|
||||
* @return
|
||||
*/
|
||||
public RequestLog getRequestLog(String url, String param);
|
||||
|
||||
RequestLog getRequestLog2(String url, String param, String endPoint);
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.ruoyi.api.domain.InterfaceReceive;
|
||||
import com.ruoyi.api.domain.RequestLog;
|
||||
import com.ruoyi.api.domain.agv.agvCallback.AgvCallbackRequest;
|
||||
@@ -32,10 +33,8 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
|
||||
import static com.ruoyi.common.Constant.*;
|
||||
import static com.ruoyi.common.TaskStatusCode.TASK_EP_CREATE;
|
||||
@@ -62,7 +61,6 @@ public class ApiServiceImpl implements IApiService {
|
||||
private IBasCargoSpaceService basCargoSpaceService;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 下发agv编码
|
||||
*
|
||||
@@ -71,17 +69,19 @@ public class ApiServiceImpl implements IApiService {
|
||||
*/
|
||||
@Override
|
||||
public GenAgvSchedulingTaskResponse genAgvSchedulingTask(GenAgvSchedulingTaskRequest genAgvSchedulingTaskRequest) {
|
||||
RequestLog requestLog = requestLogService.getRequestLog(GEN_AGV_SCHEDULING_TASK, "生成AGV任务", JSONUtil.toJsonStr(genAgvSchedulingTaskRequest));
|
||||
RequestLog requestLog = requestLogService.getRequestLog2(GEN_AGV_SCHEDULING_TASK, "生成AGV任务", JSONUtil.toJsonStr(genAgvSchedulingTaskRequest));
|
||||
if ("1".equals(requestLog.getIsSuccessful())) {
|
||||
return BeanUtil.toBean(requestLog.getResponseBody(), GenAgvSchedulingTaskResponse.class);
|
||||
AgvQueue agvQueue = agvQueueService.selectAgvQueueByTaskCode(genAgvSchedulingTaskRequest.getTaskCode());
|
||||
if (agvQueue != null) {
|
||||
agvQueue.setStatus("1");
|
||||
agvQueueService.updateAgvQueue(agvQueue);
|
||||
}
|
||||
return JSON.parseObject(requestLog.getResponseBody(), GenAgvSchedulingTaskResponse.class);
|
||||
} else {
|
||||
//todo 需要调试
|
||||
GenAgvSchedulingTaskResponse response = new GenAgvSchedulingTaskResponse();
|
||||
response.setCode(500);
|
||||
response.setMessage("请求失败");
|
||||
//todo 需要调试小车请求
|
||||
response.setCode(0);
|
||||
response.setMessage("模拟测试");
|
||||
return response;
|
||||
}
|
||||
}
|
||||
@@ -125,13 +125,16 @@ public class ApiServiceImpl implements IApiService {
|
||||
String endPoint = param.get("endPoint");
|
||||
String traySize = param.get("traySize");
|
||||
String wmsTaskNo = param.get("wmsTaskNo");
|
||||
|
||||
AgvQueue agvQueue = createAgvQueue(startPoint, endPoint, param.get("trayCode"), param.get("taskNo"), "1", traySize, wmsTaskNo);
|
||||
GenAgvSchedulingTaskResponse genAgvSchedulingTaskResponse = requestAgvQueue(agvQueue);
|
||||
if (genAgvSchedulingTaskResponse.getCode() == 0) {
|
||||
return AjaxResult.success();
|
||||
GenAgvSchedulingTaskResponse response = new GenAgvSchedulingTaskResponse();
|
||||
AgvQueue queue = agvQueueService.selectAgvQueueByTaskCode(param.get("taskCode"));
|
||||
if (queue == null) {
|
||||
AgvQueue agvQueue = createAgvQueue(startPoint, endPoint, param.get("trayCode"), param.get("taskCode"), "1", traySize, wmsTaskNo);
|
||||
response = requestAgvQueue(agvQueue);
|
||||
if (response.getCode() == 0) {
|
||||
return AjaxResult.success();
|
||||
}
|
||||
}
|
||||
return AjaxResult.error(genAgvSchedulingTaskResponse.getMessage());
|
||||
return AjaxResult.error(response.getMessage());
|
||||
|
||||
}
|
||||
|
||||
@@ -143,7 +146,7 @@ public class ApiServiceImpl implements IApiService {
|
||||
*/
|
||||
@Override
|
||||
public RequestLog finishMydoJob(Map<String, Object> param) {
|
||||
return requestLogService.getRequestLog(JOB_FINISH_URL, "agv任务完成", JSONUtil.toJsonStr(param));
|
||||
return requestLogService.getRequestLog(JOB_FINISH_URL, "任务完成上报", JSONUtil.toJsonStr(param));
|
||||
}
|
||||
|
||||
|
||||
@@ -158,7 +161,7 @@ public class ApiServiceImpl implements IApiService {
|
||||
String method = request.getMethod();
|
||||
switch (method) {
|
||||
case "applyin":
|
||||
agvQueue.setStatus("1");
|
||||
agvQueue.setStatus("2");
|
||||
agvQueueService.updateAgvQueue(agvQueue);
|
||||
log.info("【AGV请求取货】任务号:{}", request.getTaskCode());
|
||||
break;
|
||||
@@ -178,7 +181,6 @@ public class ApiServiceImpl implements IApiService {
|
||||
log.info("【AGV请求放货】任务号:{}", request.getTaskCode());
|
||||
break;
|
||||
case "end":
|
||||
|
||||
agvQueue.setStatus("7");
|
||||
agvQueueService.updateAgvQueue(agvQueue);
|
||||
log.info("【AGV任务结束】任务号:{}", request.getTaskCode());
|
||||
@@ -215,26 +217,23 @@ public class ApiServiceImpl implements IApiService {
|
||||
public AjaxResult cancelMydoJob(JobParam jobParam) {
|
||||
|
||||
MydoJob mydoJob = mydoJobService.selectMydoJobByTaskNo(Convert.toLong(jobParam.getTaskNo()));
|
||||
if(mydoJob==null){
|
||||
if (mydoJob == null) {
|
||||
return AjaxResult.error("任务不存在");
|
||||
}
|
||||
if("1".equals(mydoJob.getStatus())){
|
||||
mydoJob.setStatus("5");
|
||||
mydoJobService.insertHistory(mydoJob.getJobId());
|
||||
mydoJobService.deleteMydoJobByJobId(mydoJob.getJobId());
|
||||
return AjaxResult.success();
|
||||
}else{
|
||||
return AjaxResult.error("任务已开始");
|
||||
}
|
||||
mydoJob.setStatus("5");
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
mydoJob.setFinishTime(sdf.format(new Date()));
|
||||
mydoJobService.updateMydoJob(mydoJob);
|
||||
mydoJobService.insertHistory(mydoJob.getJobId());
|
||||
mydoJobService.deleteMydoJobByJobId(mydoJob.getJobId());
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public AjaxResult reAssign(JobParam jobParam) {
|
||||
RequestLog requestLog = requestLogService.getRequestLog(RE_ASSIGN_URL, "重新分配货位", JSONUtil.toJsonStr(jobParam));
|
||||
if ("1".equals(requestLog.getIsSuccessful())){
|
||||
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());
|
||||
@@ -248,7 +247,7 @@ public class ApiServiceImpl implements IApiService {
|
||||
@Override
|
||||
public AjaxResult reMaterial(JobParam jobParam) {
|
||||
RequestLog requestLog = requestLogService.getRequestLog(RE_MATERIAL_URL, "重新分配物料", JSONUtil.toJsonStr(jobParam));
|
||||
if ("1".equals(requestLog.getIsSuccessful())){
|
||||
if ("1".equals(requestLog.getIsSuccessful())) {
|
||||
return AjaxResult.success();
|
||||
}
|
||||
return AjaxResult.error();
|
||||
@@ -256,7 +255,7 @@ public class ApiServiceImpl implements IApiService {
|
||||
|
||||
|
||||
/**
|
||||
* 生成agv队列
|
||||
* 生成agv队列----临时修改起终点
|
||||
*
|
||||
* @param code1 起点
|
||||
* @param code2 终点
|
||||
@@ -270,15 +269,26 @@ public class ApiServiceImpl implements IApiService {
|
||||
//生成ctu执行队列
|
||||
AgvQueue agvQueue = new AgvQueue();
|
||||
String reqCode = IdUtil.fastSimpleUUID();
|
||||
// String taskCode = IdUtil.fastSimpleUUID();
|
||||
agvQueue.setReqCode(reqCode);
|
||||
agvQueue.setReqTime(DateUtil.formatDateTime(DateUtil.date()));
|
||||
agvQueue.setAgvType("AGV");
|
||||
agvQueue.setPositionCode1(code1);
|
||||
agvQueue.setPositionCode2(code2);
|
||||
agvQueue.setTaskType("F01");
|
||||
agvQueue.setCtnrType(traySize);
|
||||
agvQueue.setCtnrCode("0");
|
||||
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");
|
||||
agvQueue.setPriority("10");
|
||||
@@ -317,7 +327,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 {
|
||||
@@ -337,18 +347,14 @@ public class ApiServiceImpl implements IApiService {
|
||||
|
||||
GenAgvSchedulingTaskRequest genAgvSchedulingTaskRequest = new GenAgvSchedulingTaskRequest();
|
||||
genAgvSchedulingTaskRequest.setReqCode(agvQueue.getReqCode());
|
||||
genAgvSchedulingTaskRequest.setTaskMode("0");
|
||||
genAgvSchedulingTaskRequest.setPriority("10");
|
||||
genAgvSchedulingTaskRequest.setTaskTyp("F01");
|
||||
genAgvSchedulingTaskRequest.setCtnrCode("0");
|
||||
genAgvSchedulingTaskRequest.setCtnrNum("0");
|
||||
genAgvSchedulingTaskRequest.setTaskMode("0");
|
||||
genAgvSchedulingTaskRequest.setTaskTyp(agvQueue.getTaskType());
|
||||
genAgvSchedulingTaskRequest.setCtnrTyp(agvQueue.getCtnrType());
|
||||
genAgvSchedulingTaskRequest.setCtnrCode(agvQueue.getCtnrCode());
|
||||
genAgvSchedulingTaskRequest.setTaskCode(agvQueue.getTaskCode());
|
||||
genAgvSchedulingTaskRequest.setAgvTyp("AGV");
|
||||
genAgvSchedulingTaskRequest.setPositionSelStrategy("0");
|
||||
List<PositionCodeData> positionCodePath = new ArrayList<>();
|
||||
positionCodePath.add(new PositionCodeData(agvQueue.getPositionCode1(), "0"));
|
||||
positionCodePath.add(new PositionCodeData(agvQueue.getPositionCode2(), "0"));
|
||||
positionCodePath.add(new PositionCodeData(agvQueue.getPositionCode1(), "05"));
|
||||
positionCodePath.add(new PositionCodeData(agvQueue.getPositionCode2(), "05"));
|
||||
genAgvSchedulingTaskRequest.setPositionCodePath(positionCodePath);
|
||||
return genAgvSchedulingTask(genAgvSchedulingTaskRequest);
|
||||
}
|
||||
@@ -367,21 +373,33 @@ public class ApiServiceImpl implements IApiService {
|
||||
|
||||
@Override
|
||||
public AjaxResult receiveOutMydoJob(ReceiveJob receiveOutJob) {
|
||||
List<MydoJob> outList = mydoJobService.getJobById(receiveOutJob.getJobId());
|
||||
if (outList != null && outList.size() > 0) {
|
||||
return AjaxResult.success();
|
||||
}
|
||||
MydoJob mydoJob = new MydoJob();
|
||||
mydoJob.setJobId(receiveOutJob.getJobId());
|
||||
mydoJob.setTaskNo(receiveOutJob.getTaskNo());
|
||||
mydoJob.setCargoSpaceId(receiveOutJob.getCargoSpaceId());
|
||||
mydoJob.setExitId(receiveOutJob.getExitId());
|
||||
|
||||
if ("L2002".equals(receiveOutJob.getExitId()) || "L2008".equals(receiveOutJob.getExitId())
|
||||
|| "L2004".equals(receiveOutJob.getExitId()) || "L2006".equals(receiveOutJob.getExitId())) {
|
||||
mydoJob.setExitId("1");
|
||||
} else {
|
||||
mydoJob.setExitId(receiveOutJob.getExitId());
|
||||
}
|
||||
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());
|
||||
int i = mydoJobService.insertMydoJob(mydoJob);
|
||||
if (i > 0) {
|
||||
return AjaxResult.success();
|
||||
}else{
|
||||
} else {
|
||||
return AjaxResult.error();
|
||||
}
|
||||
|
||||
@@ -403,6 +421,47 @@ public class ApiServiceImpl implements IApiService {
|
||||
}
|
||||
}
|
||||
|
||||
//todo 新增agv站点
|
||||
@Override
|
||||
public AjaxResult deleteAgvTray(AgvQueue agvQueue) {
|
||||
Map<String, String> paramMap = new HashMap<>();
|
||||
paramMap.put("reqCode", IdUtil.fastSimpleUUID());
|
||||
paramMap.put("ctnrTyp", agvQueue.getCtnrType());
|
||||
paramMap.put("ctnrCode", agvQueue.getCtnrCode());
|
||||
|
||||
if ("L1001".equals(agvQueue.getPositionCode2())) {
|
||||
paramMap.put("stgBinCode", "JT000307001013");
|
||||
}
|
||||
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.getRequestLog2(DELETE_BIN_URL, "AGV解绑容器", JSONUtil.toJsonStr(paramMap));
|
||||
if ("1".equals(requestLog.getIsSuccessful())) {
|
||||
log.info("站点:" + agvQueue.getPositionCode2() + "{}AGV容器解绑成功!");
|
||||
return AjaxResult.success();
|
||||
} else {
|
||||
log.info("站点:" + agvQueue.getPositionCode2() + "{}AGV容器解绑失败!");
|
||||
return AjaxResult.error();
|
||||
}
|
||||
}
|
||||
|
||||
@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) {
|
||||
@@ -424,10 +483,12 @@ public class ApiServiceImpl implements IApiService {
|
||||
@Override
|
||||
public AjaxResult updateWcsPort(WcsPort wcsPort) {
|
||||
int i = wcsPortService.updateWcsPort(wcsPort);
|
||||
if(i>0){
|
||||
if (i > 0) {
|
||||
return AjaxResult.success();
|
||||
}else{
|
||||
} else {
|
||||
return AjaxResult.error();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ public class RequestLogServiceImpl implements IRequestLogService
|
||||
if ("1".equals(requestLog.getIsSuccessful())){
|
||||
return requestLogMapper.insertRequestLog(requestLog);
|
||||
}else {
|
||||
//log.error("请求失败:" + requestLog.getErrorDetails());
|
||||
requestLogMapper.insertRequestLog(requestLog);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -126,32 +126,79 @@ public class RequestLogServiceImpl implements IRequestLogService
|
||||
requestLog.setRequestHeaders(null);
|
||||
requestLog.setRequestBody(param);
|
||||
requestLog.setRequestUrl(url);
|
||||
Date responseTime =new Date();
|
||||
try {
|
||||
String resStr = HttpUtil.post(url, param);
|
||||
requestLog.setResponseBody(resStr);
|
||||
InterfaceReceive bean = JSONUtil.toBean(resStr, InterfaceReceive.class);
|
||||
Date responseTime =new Date();
|
||||
if (bean.getCode() == 200) {
|
||||
requestLog.setResponseTime(DateUtil.format(responseTime, "yyyy-MM-dd HH:mm:ss"));
|
||||
requestLog.setResponseStatus("1");
|
||||
requestLog.setDuration(Convert.toStr(DateUtil.between(requestTime, responseTime, DateUnit.MS)));
|
||||
requestLog.setIsSuccessful("1");
|
||||
}else {
|
||||
requestLog.setResponseTime(DateUtil.format(responseTime, "yyyy-MM-dd HH:mm:ss"));
|
||||
requestLog.setResponseStatus("0");
|
||||
requestLog.setErrorDetails(bean.getMsg());
|
||||
requestLog.setIsSuccessful("0");
|
||||
requestLog.setDuration(Convert.toStr(DateUtil.between(requestTime, responseTime, DateUnit.MS)));
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
requestLog.setResponseTime(DateUtil.format(responseTime, "yyyy-MM-dd HH:mm:ss"));
|
||||
requestLog.setErrorDetails(e.getMessage());
|
||||
requestLog.setIsSuccessful("0");
|
||||
requestLog.setResponseStatus("0");
|
||||
requestLog.setDuration(Convert.toStr(DateUtil.between(requestTime, responseTime, DateUnit.MS)));
|
||||
} finally {
|
||||
insertRequestLog(requestLog);
|
||||
}
|
||||
return requestLog;
|
||||
}
|
||||
|
||||
@Override
|
||||
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"));
|
||||
requestLog.setSourceSystem("wcs");
|
||||
requestLog.setTargetSystem("rcs");
|
||||
requestLog.setEndpoint(endPoint);
|
||||
requestLog.setRequestMethod("post");
|
||||
requestLog.setRequestHeaders(null);
|
||||
requestLog.setRequestBody(param);
|
||||
requestLog.setRequestUrl(url);
|
||||
Date responseTime =new Date();
|
||||
try {
|
||||
String resStr = HttpUtil.post(url, param);
|
||||
requestLog.setResponseBody(resStr);
|
||||
InterfaceReceive bean = JSONUtil.toBean(resStr, InterfaceReceive.class);
|
||||
if (bean.getCode() == 0) {
|
||||
requestLog.setResponseTime(DateUtil.format(responseTime, "yyyy-MM-dd HH:mm:ss"));
|
||||
requestLog.setResponseStatus("1");
|
||||
requestLog.setDuration(Convert.toStr(DateUtil.between(requestTime, responseTime, DateUnit.MS)));
|
||||
requestLog.setIsSuccessful("1");
|
||||
}else {
|
||||
requestLog.setResponseTime(DateUtil.format(responseTime, "yyyy-MM-dd HH:mm:ss"));
|
||||
requestLog.setResponseStatus("0");
|
||||
requestLog.setErrorDetails(bean.getMsg());
|
||||
requestLog.setIsSuccessful("0");
|
||||
requestLog.setDuration(Convert.toStr(DateUtil.between(requestTime, responseTime, DateUnit.MS)));
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
requestLog.setResponseTime(DateUtil.format(responseTime, "yyyy-MM-dd HH:mm:ss"));
|
||||
requestLog.setErrorDetails(e.getMessage());
|
||||
requestLog.setIsSuccessful("0");
|
||||
requestLog.setResponseStatus("0");
|
||||
requestLog.setDuration(Convert.toStr(DateUtil.between(requestTime, responseTime, DateUnit.MS)));
|
||||
} finally {
|
||||
insertRequestLog(requestLog);
|
||||
}
|
||||
return requestLog;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 插入请求日志
|
||||
*
|
||||
@@ -171,4 +218,6 @@ public class RequestLogServiceImpl implements IRequestLogService
|
||||
requestLog.setDuration(Convert.toStr(DateUtil.between(requestTime, requestTime, DateUnit.MS)));
|
||||
return requestLog;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.ruoyi.bas.sysDateConfig.domain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class SysDateConfig implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
private String configId;
|
||||
private String sysDate;
|
||||
|
||||
public String getConfigId() {
|
||||
return configId;
|
||||
}
|
||||
|
||||
public void setConfigId(String configId) {
|
||||
this.configId = configId;
|
||||
}
|
||||
|
||||
public String getSysDate() {
|
||||
return sysDate;
|
||||
}
|
||||
|
||||
public void setSysDate(String sysDate) {
|
||||
this.sysDate = sysDate;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SysDateConfig{" +
|
||||
"configId='" + configId + '\'' +
|
||||
", sysDate='" + sysDate + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package com.ruoyi.bas.sysDateConfig.mapper;
|
||||
|
||||
import com.ruoyi.bas.sysDateConfig.domain.SysDateConfig;
|
||||
|
||||
public interface SysDateConfigMapper {
|
||||
|
||||
SysDateConfig getMsgById(String configId);
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package com.ruoyi.bas.sysDateConfig.service;
|
||||
|
||||
import com.ruoyi.bas.sysDateConfig.domain.SysDateConfig;
|
||||
|
||||
public interface SysDateConfigService {
|
||||
|
||||
SysDateConfig getMsgById(String number);
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.ruoyi.bas.sysDateConfig.service.impl;
|
||||
|
||||
import com.ruoyi.bas.sysDateConfig.domain.SysDateConfig;
|
||||
import com.ruoyi.bas.sysDateConfig.mapper.SysDateConfigMapper;
|
||||
import com.ruoyi.bas.sysDateConfig.service.SysDateConfigService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class SysDateConfigServiceImpl implements SysDateConfigService {
|
||||
|
||||
@Autowired
|
||||
private SysDateConfigMapper sysDateConfigMapper;
|
||||
|
||||
@Override
|
||||
public SysDateConfig getMsgById(String configId) {
|
||||
return sysDateConfigMapper.getMsgById(configId);
|
||||
}
|
||||
}
|
||||
@@ -3,19 +3,22 @@ package com.ruoyi.common;
|
||||
|
||||
public class Constant {
|
||||
|
||||
public static final String WMS_BASE_URL = "http://localhost:8080/api2wms/";
|
||||
public static final String RCS_BASE_URL = "http://127.0.0.1:8081/rcms-dps/rest/";
|
||||
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/";
|
||||
|
||||
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";
|
||||
public static final String DELETE_BIN_URL = RCS_BASE_URL+"bindCtnrAndBin";
|
||||
|
||||
public static final String JOB_FINISH_URL = WMS_BASE_URL+"jobFinish";
|
||||
public static final String CONTINUE_TASK_URL = RCS_BASE_URL+"continueTask";
|
||||
public static final String CANCEL_TASK_URL = RCS_BASE_URL+"queryAgvStatus";;
|
||||
public static final String GEN_AGV_SCHEDULING_TASK = RCS_BASE_URL+"genAgvSchedulingTask";;
|
||||
public static final String CREATE_IN_MYDO_JOB_URL = WMS_BASE_URL+"requestEnterByTrayCode";
|
||||
public static final String REQUEST_MYDO_JOB_URL = WMS_BASE_URL+"requestByNoTrayCode";
|
||||
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";
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
}
|
||||
|
||||
@@ -83,6 +83,10 @@ public class DeviceSsj extends BaseEntity
|
||||
@Excel(name="允许放货")
|
||||
private int allowPut;
|
||||
|
||||
private int sszt;
|
||||
|
||||
private int taskNo2;
|
||||
|
||||
private int inOrOut;
|
||||
|
||||
}
|
||||
|
||||
@@ -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,23 @@ 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);
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasAnyPermi('job:mydoJob:confirmOut')")
|
||||
@Log(title = "手动出库", businessType = BusinessType.INSERT)
|
||||
@RequestMapping("/confirmOut")
|
||||
public AjaxResult confirmOut(@RequestParam("thePlatoon")String thePlatoon,
|
||||
@RequestParam("theColumn") String theColumn,
|
||||
@RequestParam("theFloor") String theFloor,
|
||||
@RequestParam("exitId") String exitId)
|
||||
{
|
||||
return mydoJobService.confirmOut(thePlatoon,theColumn,theFloor,exitId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -94,5 +94,7 @@ public class MydoJob extends BaseEntity
|
||||
|
||||
private String flag;
|
||||
|
||||
private String traySize;
|
||||
|
||||
private List<String> epList;
|
||||
}
|
||||
|
||||
@@ -60,4 +60,6 @@ public interface JobCallBackMapper
|
||||
public int deleteJobCallBackByIds(Long[] ids);
|
||||
|
||||
List<JobCallBack> selectJobCallBackListNoSuccess();
|
||||
|
||||
List<JobCallBack> getTopJobCallBack();
|
||||
}
|
||||
|
||||
@@ -70,7 +70,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);
|
||||
|
||||
@@ -81,4 +82,20 @@ public interface MydoJobMapper
|
||||
List<MydoJob> selectMydoJobFinishList(MydoJob mydoJob);
|
||||
|
||||
MydoJob selectRunningMydoJobByExitList(@Param("exitList") List<String> exitList);
|
||||
|
||||
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);
|
||||
|
||||
List<MydoJob> getJobById(@Param("jobId") String jobId);
|
||||
|
||||
void confirmOutJob(HashMap<String, Object> map);
|
||||
|
||||
List<MydoJob> getInJobByRoadAndFloor(@Param("entranceId") String entranceId, @Param("roadwayId") String roadwayId);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -76,4 +79,22 @@ public interface IMydoJobService
|
||||
List<MydoJob> selectMydoJobFinishList(MydoJob mydoJob);
|
||||
|
||||
MydoJob selectRunningMydoJobByExitList(List<String> strings);
|
||||
|
||||
List<MydoJob> getInJobByEntrance(List<String> exitList);
|
||||
|
||||
MydoJob selectJobByTaskNo(String taskNo);
|
||||
|
||||
MydoJob selectMydoJobByEntranceList1(String entranceId);
|
||||
|
||||
AjaxResult OuthandFinish(String[] jobIds);
|
||||
|
||||
List<MydoJob> getInJobByEntranceId(String exitId);
|
||||
|
||||
MydoJob selectMydoJobByExitId(String exitId);
|
||||
|
||||
List<MydoJob> getJobById(String jobId);
|
||||
|
||||
AjaxResult confirmOut(String thePlatoon, String theColumn, String theFloor,String exitId);
|
||||
|
||||
List<MydoJob> getInJobByRoadAndFloor(String entranceId, String roadwayId);
|
||||
}
|
||||
|
||||
@@ -103,8 +103,22 @@ public class JobCallBackServiceImpl implements IJobCallBackService
|
||||
|
||||
@Override
|
||||
public void jobCallBack() {
|
||||
List<JobCallBack> jobCallBackList = jobCallBackMapper.selectJobCallBackListNoSuccess();
|
||||
for (JobCallBack jobCallBack : jobCallBackList) {
|
||||
// List<JobCallBack> jobCallBackList = jobCallBackMapper.selectJobCallBackListNoSuccess();
|
||||
// for (JobCallBack jobCallBack : jobCallBackList) {
|
||||
// Map<String, Object> param = new HashMap<>();
|
||||
// param.put("jobId", jobCallBack.getMydojobId());
|
||||
// param.put("taskNo", jobCallBack.getTaskNo());
|
||||
// param.put("wmsType", jobCallBack.getType());
|
||||
// RequestLog requestLog = apiService.finishMydoJob(param);
|
||||
// if ("1".equals(requestLog.getIsSuccessful())){
|
||||
// jobCallBack.setStatus("1");
|
||||
// jobCallBackMapper.updateJobCallBack(jobCallBack);
|
||||
// }
|
||||
// }
|
||||
|
||||
List<JobCallBack> list = jobCallBackMapper.getTopJobCallBack();
|
||||
if(list != null && list.size() > 0){
|
||||
JobCallBack jobCallBack = list.get(0);
|
||||
Map<String, Object> param = new HashMap<>();
|
||||
param.put("jobId", jobCallBack.getMydojobId());
|
||||
param.put("taskNo", jobCallBack.getTaskNo());
|
||||
@@ -113,6 +127,14 @@ public class JobCallBackServiceImpl implements IJobCallBackService
|
||||
if ("1".equals(requestLog.getIsSuccessful())){
|
||||
jobCallBack.setStatus("1");
|
||||
jobCallBackMapper.updateJobCallBack(jobCallBack);
|
||||
}else{
|
||||
if(Integer.parseInt(jobCallBack.getSpare1()) < 2){
|
||||
jobCallBack.setSpare1(String.valueOf(Integer.parseInt(jobCallBack.getSpare1())+1));
|
||||
jobCallBackMapper.updateJobCallBack(jobCallBack);
|
||||
}else{
|
||||
jobCallBack.setStatus("2");
|
||||
jobCallBackMapper.updateJobCallBack(jobCallBack);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +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;
|
||||
@@ -22,6 +27,8 @@ public class MydoJobServiceImpl implements IMydoJobService
|
||||
{
|
||||
@Autowired
|
||||
private MydoJobMapper mydoJobMapper;
|
||||
@Autowired
|
||||
private IJobCallBackService jobCallBackService;
|
||||
|
||||
/**
|
||||
* 查询作业信息
|
||||
@@ -69,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);
|
||||
}
|
||||
|
||||
@@ -81,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);
|
||||
}
|
||||
|
||||
@@ -129,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);
|
||||
@@ -148,6 +165,68 @@ public class MydoJobServiceImpl implements IMydoJobService
|
||||
return mydoJobMapper.selectMydoJobByEntranceList(entranceList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MydoJob selectMydoJobByEntranceList1(String entranceId) {
|
||||
return mydoJobMapper.selectMydoJobByEntranceList1(entranceId);
|
||||
}
|
||||
|
||||
@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("操作成功");
|
||||
}
|
||||
|
||||
@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> getJobById(String jobId) {
|
||||
return mydoJobMapper.getJobById(jobId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult confirmOut(String thePlatoon, String theColumn, String theFloor,String exitId) {
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
map.put("v_the_platoon", thePlatoon);
|
||||
map.put("v_the_column", theColumn);
|
||||
map.put("v_the_floor", theFloor);
|
||||
map.put("v_exit_id", exitId);
|
||||
mydoJobMapper.confirmOutJob(map);
|
||||
if (Convert.toInt(map.get("v_result"))==10){
|
||||
return AjaxResult.success("出库成功!");
|
||||
}else {
|
||||
return AjaxResult.error(map.get("v_resultMsg").toString());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MydoJob> getInJobByRoadAndFloor(String entranceId, String roadwayId) {
|
||||
return mydoJobMapper.getInJobByRoadAndFloor(entranceId,roadwayId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MydoJob> selectMydoJobFinishList(MydoJob mydoJob) {
|
||||
return mydoJobMapper.selectMydoJobFinishList(mydoJob);
|
||||
@@ -157,4 +236,15 @@ public class MydoJobServiceImpl implements IMydoJobService
|
||||
public MydoJob selectRunningMydoJobByExitList(List<String> exitList) {
|
||||
return mydoJobMapper.selectRunningMydoJobByExitList(exitList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MydoJob> getInJobByEntrance(List<String> exitList) {
|
||||
return mydoJobMapper.getInJobByEntrance(exitList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MydoJob selectJobByTaskNo(String taskNo) {
|
||||
return mydoJobMapper.selectJobByTaskNo(taskNo);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.ruoyi.queue.agv.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.queue.agv.domain.AgvQueue;
|
||||
import org.springframework.data.repository.query.Param;
|
||||
|
||||
/**
|
||||
* AGV任务队列Mapper接口
|
||||
@@ -67,4 +68,8 @@ public interface AgvQueueMapper
|
||||
AgvQueue selectAgvQueueByTaskCode(String taskCode);
|
||||
|
||||
void insertHistory(String reqCode);
|
||||
|
||||
AgvQueue selectAgvQueueByWmsTask(@Param("wmsTaskNo") int wmsTaskNo);
|
||||
|
||||
List<AgvQueue> selectAgvQueueList1(AgvQueue agvQueue);
|
||||
}
|
||||
|
||||
@@ -71,4 +71,8 @@ public interface IAgvQueueService
|
||||
* @param reqCode
|
||||
*/
|
||||
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任务队列
|
||||
*
|
||||
@@ -100,4 +106,9 @@ public class AgvQueueServiceImpl implements IAgvQueueService
|
||||
public void insertHistory(String reqCode) {
|
||||
agvQueueMapper.insertHistory(reqCode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AgvQueue selectAgvQueueByWmsTask(int wmsTaskNo) {
|
||||
return agvQueueMapper.selectAgvQueueByWmsTask(wmsTaskNo);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
/**
|
||||
* 删除堆垛机执行队列
|
||||
@@ -63,4 +64,8 @@ public interface DdjDeviceExecutionQueueMapper
|
||||
List<DdjDeviceExecutionQueue> selectDdjDeviceExecutionQueueListByRwlx(@Param("rwlx")Integer rwlx,@Param("devId") Integer devId);
|
||||
|
||||
DdjDeviceExecutionQueue selectDdjDeviceExecutionQueueByRwhAndXd(@Param("rwh") Long rwh, @Param("devId") Integer devId);
|
||||
|
||||
void insertFinish(DdjDeviceExecutionQueue ddjDeviceExecutionQueue);
|
||||
|
||||
void deleteQueue(DdjDeviceExecutionQueue ddjDeviceExecutionQueue);
|
||||
}
|
||||
|
||||
@@ -62,4 +62,6 @@ public interface IDdjDeviceExecutionQueueService
|
||||
DdjDeviceExecutionQueue selectDdjDeviceExecutionQueueByRwh(Long rwh,Integer devId);
|
||||
|
||||
List<DdjDeviceExecutionQueue> selectDdjDeviceExecutionQueueListByRwlx(Integer rwlx,Integer devId);
|
||||
|
||||
void delQueue(DdjDeviceExecutionQueue ddjDeviceExecutionQueue);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.ruoyi.queue.ddj.service.impl;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -67,6 +69,8 @@ public class DdjDeviceExecutionQueueServiceImpl implements IDdjDeviceExecutionQu
|
||||
return ddjDeviceExecutionQueueMapper.updateDdjDeviceExecutionQueue(ddjDeviceExecutionQueue);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 批量删除堆垛机执行队列
|
||||
*
|
||||
@@ -100,4 +104,13 @@ public class DdjDeviceExecutionQueueServiceImpl implements IDdjDeviceExecutionQu
|
||||
public List<DdjDeviceExecutionQueue> selectDdjDeviceExecutionQueueListByRwlx(Integer rwlx,Integer devId) {
|
||||
return ddjDeviceExecutionQueueMapper.selectDdjDeviceExecutionQueueListByRwlx(rwlx,devId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delQueue(DdjDeviceExecutionQueue ddjDeviceExecutionQueue) {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
ddjDeviceExecutionQueue.setRwzt(5);
|
||||
ddjDeviceExecutionQueue.setJssj(sdf.format(new Date()));
|
||||
ddjDeviceExecutionQueueMapper.insertFinish(ddjDeviceExecutionQueue);
|
||||
ddjDeviceExecutionQueueMapper.deleteQueue(ddjDeviceExecutionQueue);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,10 +6,11 @@ import com.ruoyi.device.ddj.service.IMsgDdjService;
|
||||
import com.ruoyi.device.ssj.domain.DeviceSsj;
|
||||
import com.ruoyi.device.ssj.service.IDeviceSsjService;
|
||||
import com.ruoyi.common.domain.PlcConnectInfo;
|
||||
import com.ruoyi.schedule.plcRead.ddj.PlcDdjRead;
|
||||
import com.ruoyi.schedule.plcRead.ddj.PlcDdj1Read;
|
||||
import com.ruoyi.schedule.plcRead.ddj.PlcDdj2Read;
|
||||
import com.ruoyi.schedule.plcRead.ssj.PlcSsjRead;
|
||||
import com.ruoyi.common.domain.CustomThread;
|
||||
import com.ruoyi.schedule.scheduleTask.ddj.Ddj1Thread;
|
||||
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;
|
||||
@@ -22,6 +23,12 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
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;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
@@ -31,8 +38,8 @@ import java.util.concurrent.ConcurrentHashMap;
|
||||
public class ScheduleThread {
|
||||
|
||||
public CustomThread<PlcSsjRead> plcSsjReadCustomThread;
|
||||
public CustomThread<PlcDdjRead> plcDdj1ReadCustomThread;
|
||||
public CustomThread<PlcDdjRead> plcDdj2ReadCustomThread;
|
||||
public CustomThread<PlcDdj1Read> plcDdj1ReadCustomThread;
|
||||
public CustomThread<PlcDdj2Read> plcDdj2ReadCustomThread;
|
||||
|
||||
public CustomThread<Floor1BothWayInSsjThread> floor1BothWayInSsjCustomThread;
|
||||
public CustomThread<Floor1BothWayOutSsjThread> floor1BothWayOutSsjCustomThread;
|
||||
@@ -41,7 +48,7 @@ public class ScheduleThread {
|
||||
public CustomThread<Floor2RoadWaySsjThread> floor2OutSsjCustomThread;
|
||||
public CustomThread<LineSsjThread> lineSsjCustomThread;
|
||||
public CustomThread<MonitoringThread> monitoringCustomThread;
|
||||
public CustomThread<Ddj1Thread> ddj1CustomThread;
|
||||
public CustomThread<DdjThread> ddj1CustomThread;
|
||||
@Autowired
|
||||
private IDeviceSsjService deviceSsjService;
|
||||
@Autowired
|
||||
@@ -61,6 +68,9 @@ public class ScheduleThread {
|
||||
//调度初始化
|
||||
scheduleInit();
|
||||
log.info("调度服务执行成功");
|
||||
|
||||
//startAllThread();
|
||||
//startAllThread2();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -88,8 +98,8 @@ public class ScheduleThread {
|
||||
Floor2RoadWaySsjThread floor2OutSsjThread = new Floor2RoadWaySsjThread();
|
||||
floor2OutSsjCustomThread = new CustomThread<Floor2RoadWaySsjThread>(new Thread(floor2OutSsjThread), floor2OutSsjThread);
|
||||
|
||||
Ddj1Thread ddj1Thread = new Ddj1Thread();
|
||||
ddj1CustomThread = new CustomThread<Ddj1Thread>(new Thread(ddj1Thread), ddj1Thread);
|
||||
DdjThread ddj1Thread = new DdjThread();
|
||||
ddj1CustomThread = new CustomThread<DdjThread>(new Thread(ddj1Thread), ddj1Thread);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -108,24 +118,28 @@ public class ScheduleThread {
|
||||
PlcSsjRead.deviceSsjMap = ssjList;
|
||||
|
||||
//获取堆垛机
|
||||
ConcurrentHashMap<String, MsgDdj> ddjList = new ConcurrentHashMap<>();
|
||||
ConcurrentHashMap<String, MsgDdj> ddj1List = new ConcurrentHashMap<>();
|
||||
ConcurrentHashMap<String, MsgDdj> ddj2List = new ConcurrentHashMap<>();
|
||||
List<MsgDdj> msgDdjs = msgDdjService.selectMsgDdjList(new MsgDdj());
|
||||
for (MsgDdj msgDdj : msgDdjs) {
|
||||
msgDdj.setPlcDbReadAddress(msgDdj.getPlcDbReadAddress());
|
||||
PlcDdjRead plcDdjRead = new PlcDdjRead(msgDdj, new PlcConnectInfo(msgDdj.getIp(), Convert.toInt(msgDdj.getPort())));
|
||||
Thread plcDdjReadThread = new Thread(plcDdjRead);
|
||||
switch (msgDdj.getId()){
|
||||
case 1:
|
||||
plcDdj1ReadCustomThread = new CustomThread<PlcDdjRead>(plcDdjReadThread, plcDdjRead);
|
||||
PlcDdj1Read plcDdj1Read = new PlcDdj1Read(msgDdj, new PlcConnectInfo(msgDdj.getIp(), Convert.toInt(msgDdj.getPort())));
|
||||
Thread plcDdj1ReadThread = new Thread(plcDdj1Read);
|
||||
plcDdj1ReadCustomThread = new CustomThread<PlcDdj1Read>(plcDdj1ReadThread, plcDdj1Read);
|
||||
ddj1List.put("ddj1", msgDdj);
|
||||
PlcDdj1Read.deviceDdjMap = ddj1List;
|
||||
break;
|
||||
case 2:
|
||||
plcDdj2ReadCustomThread = new CustomThread<PlcDdjRead>(plcDdjReadThread, plcDdjRead);
|
||||
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;
|
||||
}
|
||||
ddjList.put("ddj" + msgDdj.getId(), msgDdj);
|
||||
}
|
||||
PlcDdjRead.deviceDdjMap = ddjList;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -189,4 +203,75 @@ public class ScheduleThread {
|
||||
map.put("isRun2",isRun2);
|
||||
return map;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
// Socket socket = new Socket();
|
||||
// OutputStream out = null;
|
||||
// InputStream in = null;
|
||||
// try {
|
||||
//// socket.connect(new InetSocketAddress("192.168.56.32", 2002), 1000);
|
||||
//// in = socket.getInputStream();
|
||||
//// out = socket.getOutputStream();
|
||||
//
|
||||
// } catch (IOException e) {
|
||||
// throw new RuntimeException(e);
|
||||
// }
|
||||
|
||||
// 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());
|
||||
}
|
||||
|
||||
public static String sendWeight(String ip, int por) {
|
||||
|
||||
String zhi="";
|
||||
Socket socket = null;
|
||||
OutputStream os = null;
|
||||
InputStream is = null;
|
||||
try {
|
||||
//新建客户端并请求服务端的ip为localhost 端口为8088
|
||||
socket = new Socket(ip,por);
|
||||
// System.out.println("socket end ="+System.currentTimeMillis());
|
||||
//休眠3秒
|
||||
Thread.sleep(1000);
|
||||
char[] charArray = new char[500];
|
||||
//获取客户端发送的数据的输入流
|
||||
is = socket.getInputStream();
|
||||
//读取输入流
|
||||
InputStreamReader inputStreamReader = new InputStreamReader(is);
|
||||
// System.out.println("read begin =" + System.currentTimeMillis());
|
||||
int readLength = inputStreamReader.read(charArray);
|
||||
System.out.println("readLength:"+readLength);
|
||||
if (readLength != -1) {
|
||||
String newString = new String(charArray, 0, readLength);
|
||||
// System.out.println("newString:"+newString+"长度"+newString.length());
|
||||
// newString=newString.replaceAll("\r|\n", "");
|
||||
// if(newString.length()==8&&!newString.equals("=0000000")){
|
||||
// newString=newString.substring(1,8);
|
||||
// newString=newString.replaceAll("^(0+)", "");
|
||||
// zhi=newString;
|
||||
// }
|
||||
zhi = newString;
|
||||
readLength = inputStreamReader.read(charArray);
|
||||
}
|
||||
// System.out.println("read end =" + System.currentTimeMillis());
|
||||
inputStreamReader.close();
|
||||
is.close();
|
||||
socket.close();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
try {
|
||||
socket.close();
|
||||
is.close();
|
||||
os.close();
|
||||
} catch (IOException e1)
|
||||
{ e1.printStackTrace(); }
|
||||
}
|
||||
|
||||
return zhi;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,14 +10,13 @@ import cn.hutool.core.convert.Convert;
|
||||
import com.ruoyi.common.domain.HslRead;
|
||||
import com.ruoyi.common.domain.PlcConnectInfo;
|
||||
import com.ruoyi.device.ddj.domain.MsgDdj;
|
||||
import com.ruoyi.device.ssj.domain.DeviceSsj;
|
||||
import com.ruoyi.schedule.plcRead.util.ParseUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
@Slf4j
|
||||
public class PlcDdjRead extends Thread {
|
||||
public class PlcDdj1Read extends Thread {
|
||||
public static ConcurrentHashMap<String, MsgDdj> deviceDdjMap;
|
||||
public volatile boolean isRun = true;
|
||||
|
||||
@@ -28,27 +27,19 @@ public class PlcDdjRead extends Thread {
|
||||
private boolean success = false;
|
||||
private MsgDdj msgDdj;
|
||||
|
||||
public PlcDdjRead(MsgDdj msgDdj, PlcConnectInfo plcConnectInfo) {
|
||||
public PlcDdj1Read(MsgDdj msgDdj, PlcConnectInfo plcConnectInfo) {
|
||||
this.msgDdj = msgDdj;
|
||||
this.ip = plcConnectInfo.getIp();
|
||||
this.port = plcConnectInfo.getPort();
|
||||
}
|
||||
|
||||
public static int WriteToSSJ(String address, byte[] data) {
|
||||
int a = 0;
|
||||
if (readWriteNet != null) {
|
||||
a = HslRead.WriteResultRender(readWriteNet.Write(address, data), address);
|
||||
}
|
||||
return a;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
while (isRun) {
|
||||
try {
|
||||
if (IsConnect()) {
|
||||
readPlcDdj(msgDdj);
|
||||
Thread.sleep(1000);
|
||||
Thread.sleep(800);
|
||||
} else {
|
||||
reConnect();
|
||||
}
|
||||
@@ -56,7 +47,7 @@ public class PlcDdjRead extends Thread {
|
||||
Thread.currentThread().interrupt();
|
||||
return;
|
||||
} catch (Exception e) {
|
||||
log.info("********IP:" + this.ip + " port:" + this.port + "<EFBFBD><EFBFBD>ȡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>쳣 " + e.getMessage());
|
||||
log.info("********IP:" + this.ip + " port:" + this.port + "连接失败" + e.getMessage());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -119,16 +110,18 @@ public class PlcDdjRead extends Thread {
|
||||
void reConnect() {
|
||||
closeServer();
|
||||
ConnectServer();
|
||||
log.info("重新连接 SSJ-PLC");
|
||||
log.info("重新连接 DDJ1-PLC");
|
||||
}
|
||||
|
||||
void closeServer() {
|
||||
if (readWriteNet != null) {
|
||||
readWriteNet.ConnectClose();
|
||||
if (siemensS7Net != null) {
|
||||
siemensS7Net.ConnectClose();
|
||||
}
|
||||
setIsConnect(false);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static int WriteToDDJ(String address, byte[] data) {
|
||||
int a = 0;
|
||||
if (readWriteNet != null) {
|
||||
@@ -0,0 +1,132 @@
|
||||
package com.ruoyi.schedule.plcRead.ddj;
|
||||
|
||||
import HslCommunication.BasicFramework.SoftBasic;
|
||||
import HslCommunication.Core.Net.IReadWriteNet;
|
||||
import HslCommunication.Core.Types.OperateResult;
|
||||
import HslCommunication.Core.Types.OperateResultExOne;
|
||||
import HslCommunication.Profinet.Siemens.SiemensPLCS;
|
||||
import HslCommunication.Profinet.Siemens.SiemensS7Net;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import com.ruoyi.common.domain.HslRead;
|
||||
import com.ruoyi.common.domain.PlcConnectInfo;
|
||||
import com.ruoyi.device.ddj.domain.MsgDdj;
|
||||
import com.ruoyi.schedule.plcRead.util.ParseUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
@Slf4j
|
||||
public class PlcDdj2Read extends Thread {
|
||||
public static ConcurrentHashMap<String, MsgDdj> deviceDdjMap;
|
||||
public volatile boolean isRun = true;
|
||||
|
||||
public SiemensS7Net siemensS7Net = null;
|
||||
public static IReadWriteNet readWriteNet = null;
|
||||
private final String ip;
|
||||
private final int port;
|
||||
private boolean success = false;
|
||||
private MsgDdj msgDdj;
|
||||
|
||||
public PlcDdj2Read(MsgDdj msgDdj, PlcConnectInfo plcConnectInfo) {
|
||||
this.msgDdj = msgDdj;
|
||||
this.ip = plcConnectInfo.getIp();
|
||||
this.port = plcConnectInfo.getPort();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
while (isRun) {
|
||||
try {
|
||||
if (IsConnect()) {
|
||||
readPlcDdj(msgDdj);
|
||||
Thread.sleep(800);
|
||||
} else {
|
||||
reConnect();
|
||||
}
|
||||
} catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
return;
|
||||
} catch (Exception e) {
|
||||
log.info("********IP:" + this.ip + " port:" + this.port + "连接失败" + e.getMessage());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void readPlcDdj(MsgDdj msgDdj) {
|
||||
OperateResultExOne<byte[]> read2 = readWriteNet.Read(msgDdj.getPlcDbReadAddress(), Convert.toShort("38"));
|
||||
String ddsx = "0";
|
||||
if (read2.IsSuccess) {
|
||||
ddsx = SoftBasic.ByteToHexString(read2.Content);
|
||||
msgDdj.setCzfs(ParseUtil.optInt(0, ddsx));
|
||||
msgDdj.setSbzt(ParseUtil.optInt(2, ddsx));
|
||||
msgDdj.setRwh(Convert.toLong(ParseUtil.optDInt(4, ddsx)));
|
||||
msgDdj.setHczt(ParseUtil.optInt(8, ddsx));
|
||||
msgDdj.setJdbz(ParseUtil.optInt(10, ddsx));
|
||||
msgDdj.setYph(ParseUtil.optInt(12, ddsx));
|
||||
msgDdj.setYlh(ParseUtil.optInt(14, ddsx));
|
||||
msgDdj.setYch(ParseUtil.optInt(16, ddsx));
|
||||
msgDdj.setMbph(ParseUtil.optInt(18, ddsx));
|
||||
msgDdj.setMblh(ParseUtil.optInt(20, ddsx));
|
||||
msgDdj.setMbch(ParseUtil.optInt(22, ddsx));
|
||||
msgDdj.setYxxf(ParseUtil.optInt(24, ddsx));
|
||||
msgDdj.setXtxh(ParseUtil.optInt(26, ddsx));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void ConnectServer() {
|
||||
siemensS7Net = new SiemensS7Net(SiemensPLCS.S1500);
|
||||
try {
|
||||
siemensS7Net.setIpAddress(this.ip);
|
||||
siemensS7Net.setPort(this.port);
|
||||
siemensS7Net.setRack((byte) 0);
|
||||
siemensS7Net.setSlot((byte) 1);
|
||||
|
||||
OperateResult connect = siemensS7Net.ConnectServer();
|
||||
if (connect.IsSuccess) {
|
||||
setIsConnect(true);
|
||||
readWriteNet = siemensS7Net;
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
log.info("********IP:" + this.ip + " port:" + this.port + "连接失败 " + ex.getMessage());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void setIsConnect(boolean bflag) {
|
||||
if (!success) {
|
||||
success = bflag;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean IsConnect() {
|
||||
if (success) {
|
||||
return success;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void reConnect() {
|
||||
closeServer();
|
||||
ConnectServer();
|
||||
log.info("重新连接 DDJ2-PLC");
|
||||
}
|
||||
|
||||
void closeServer() {
|
||||
if (siemensS7Net != null) {
|
||||
siemensS7Net.ConnectClose();
|
||||
}
|
||||
setIsConnect(false);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static int WriteToDDJ(String address, byte[] data) {
|
||||
int a = 0;
|
||||
if (readWriteNet != null) {
|
||||
a = HslRead.WriteResultRender(readWriteNet.Write(address, data), address);
|
||||
}
|
||||
return a;
|
||||
}
|
||||
}
|
||||
@@ -66,7 +66,7 @@ public class PlcSsjRead implements Runnable {
|
||||
break;
|
||||
}
|
||||
}
|
||||
Thread.sleep(1000);
|
||||
Thread.sleep(800);
|
||||
} else {
|
||||
reConnect();
|
||||
}
|
||||
@@ -87,7 +87,7 @@ public class PlcSsjRead implements Runnable {
|
||||
* @param ssjDevice
|
||||
*/
|
||||
private void readPlcOtherSsj(DeviceSsj ssjDevice) {
|
||||
OperateResultExOne<byte[]> read2 = readWriteNet.Read(ssjDevice.getPlcDbReadAddress(), Short.parseShort("20"));
|
||||
OperateResultExOne<byte[]> read2 = readWriteNet.Read(ssjDevice.getPlcDbReadAddress(), Short.parseShort("10"));
|
||||
String ddsx1 = "0";
|
||||
if (read2.IsSuccess) {
|
||||
ddsx1 = SoftBasic.ByteToHexString(read2.Content);
|
||||
@@ -103,14 +103,14 @@ public class PlcSsjRead implements Runnable {
|
||||
* @param ssjDevice
|
||||
*/
|
||||
private void readPlcRoadWaySsj(DeviceSsj ssjDevice) {
|
||||
OperateResultExOne<byte[]> read2 = readWriteNet.Read(ssjDevice.getPlcDbReadAddress(), Short.parseShort("20"));
|
||||
OperateResultExOne<byte[]> read2 = readWriteNet.Read(ssjDevice.getPlcDbReadAddress(), Short.parseShort("10"));
|
||||
String ddsx1 = "0";
|
||||
if (read2.IsSuccess) {
|
||||
ddsx1 = SoftBasic.ByteToHexString(read2.Content);
|
||||
ssjDevice.setKx(ParseUtil.optInt(0, ddsx1));
|
||||
ssjDevice.setDw(ParseUtil.optInt(2, ddsx1));
|
||||
ssjDevice.setRkqq(ParseUtil.optInt(4, ddsx1));
|
||||
ssjDevice.setTaskNo(ParseUtil.optDInt(6, ddsx1));
|
||||
ssjDevice.setDw(ParseUtil.optInt(0, ddsx1));
|
||||
ssjDevice.setKx(ParseUtil.optInt(2, ddsx1));
|
||||
ssjDevice.setTaskNo(ParseUtil.optDInt(4, ddsx1));
|
||||
ssjDevice.setSszt(ParseUtil.optInt(8, ddsx1));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -120,16 +120,17 @@ public class PlcSsjRead implements Runnable {
|
||||
* @param ssjDevice
|
||||
*/
|
||||
private void readPlcInOutSsj(DeviceSsj ssjDevice) {
|
||||
OperateResultExOne<byte[]> read2 = readWriteNet.Read(ssjDevice.getPlcDbReadAddress(), Short.parseShort("20"));
|
||||
OperateResultExOne<byte[]> read2 = readWriteNet.Read(ssjDevice.getPlcDbReadAddress(), Short.parseShort("30"));
|
||||
String ddsx1 = "0";
|
||||
if (read2.IsSuccess) {
|
||||
ddsx1 = SoftBasic.ByteToHexString(read2.Content);
|
||||
ssjDevice.setKx(ParseUtil.optInt(0, ddsx1));
|
||||
ssjDevice.setDw(ParseUtil.optInt(2, ddsx1));
|
||||
ssjDevice.setException(ParseUtil.optInt(4, ddsx1));
|
||||
ssjDevice.setAllowPut(ParseUtil.optInt(6, ddsx1));
|
||||
ssjDevice.setTaskNo(ParseUtil.optDInt(8, ddsx1));
|
||||
|
||||
ssjDevice.setDw(ParseUtil.optInt(0, ddsx1));
|
||||
ssjDevice.setKx(ParseUtil.optInt(2, ddsx1));
|
||||
ssjDevice.setTaskNo(ParseUtil.optDInt(4, ddsx1));
|
||||
ssjDevice.setSszt(ParseUtil.optInt(8, ddsx1));
|
||||
ssjDevice.setRkqq(ParseUtil.optInt(10, ddsx1));
|
||||
ssjDevice.setTraySize(ParseUtil.optInt(12, ddsx1));
|
||||
ssjDevice.setException(ParseUtil.optInt(28, ddsx1));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -139,39 +140,74 @@ public class PlcSsjRead implements Runnable {
|
||||
* @param ssjDevice
|
||||
*/
|
||||
private void readPlcSmSsj(DeviceSsj ssjDevice) {
|
||||
OperateResultExOne<byte[]> read2 = readWriteNet.Read(ssjDevice.getPlcDbReadAddress(), Short.parseShort("220"));
|
||||
OperateResultExOne<byte[]> read2 = readWriteNet.Read(ssjDevice.getPlcDbReadAddress(), Short.parseShort("30"));
|
||||
String ddsx1 = "0";
|
||||
if (read2.IsSuccess) {
|
||||
ddsx1 = SoftBasic.ByteToHexString(read2.Content);
|
||||
ssjDevice.setKx(ParseUtil.optInt(0, ddsx1));
|
||||
ssjDevice.setDw(ParseUtil.optInt(2, ddsx1));
|
||||
ssjDevice.setRkqq(ParseUtil.optInt(4, ddsx1));
|
||||
ssjDevice.setTraySize(ParseUtil.optInt(6, ddsx1));
|
||||
ssjDevice.setTaskNo(ParseUtil.optDInt(8, ddsx1));
|
||||
ssjDevice.setDw(ParseUtil.optInt(0, ddsx1));
|
||||
ssjDevice.setKx(ParseUtil.optInt(2, ddsx1));
|
||||
ssjDevice.setTaskNo(ParseUtil.optDInt(4, ddsx1));
|
||||
ssjDevice.setSszt(ParseUtil.optInt(8, ddsx1));
|
||||
ssjDevice.setRkqq(ParseUtil.optInt(10, ddsx1));
|
||||
ssjDevice.setTraySize(ParseUtil.optInt(12, ddsx1));
|
||||
ssjDevice.setInOrOut(ParseUtil.optInt(24, ddsx1));
|
||||
ssjDevice.setException(ParseUtil.optInt(28, ddsx1));
|
||||
|
||||
String trayCodeReadAddress="";
|
||||
String allot="";
|
||||
switch (ssjDevice.getDeviceCode()){
|
||||
case "G1005":
|
||||
trayCodeReadAddress = "DB502.0";
|
||||
trayCodeReadAddress = "DB503.0";
|
||||
allot = "DB802.24";
|
||||
break;
|
||||
case "L2004":
|
||||
trayCodeReadAddress = "DB503.0";
|
||||
trayCodeReadAddress = "DB503.600";
|
||||
break;
|
||||
case "L2006":
|
||||
trayCodeReadAddress = "DB504.0";
|
||||
trayCodeReadAddress = "DB503.800";
|
||||
break;
|
||||
case "L1001":
|
||||
trayCodeReadAddress = "DB506.0";
|
||||
trayCodeReadAddress = "DB503.200";
|
||||
allot = "DB802.0";
|
||||
break;
|
||||
case "L1003":
|
||||
trayCodeReadAddress = "DB505.0";
|
||||
trayCodeReadAddress = "DB503.400";
|
||||
allot = "DB802.12";
|
||||
break;
|
||||
}
|
||||
OperateResultExOne<byte[]> trayCodeRead = readWriteNet.Read(trayCodeReadAddress, Short.parseShort("220"));
|
||||
if (trayCodeRead.IsSuccess){
|
||||
byte[] content = trayCodeRead.Content;
|
||||
//去除bytes中
|
||||
ssjDevice.setTrayCode(ParseUtil.filterAndConvert(trayCodeRead.Content));
|
||||
|
||||
if(!"".equals(allot)){
|
||||
OperateResultExOne<byte[]> agvSsj = readWriteNet.Read(allot, Short.parseShort("2"));
|
||||
if (agvSsj.IsSuccess){
|
||||
//去除bytes中
|
||||
ddsx1 = SoftBasic.ByteToHexString(agvSsj.Content);
|
||||
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));
|
||||
}
|
||||
}
|
||||
OperateResultExOne<byte[]> agvSsjTask = readWriteNet.Read("DB501.280", Short.parseShort("16"));
|
||||
String ddsx2 = "0";
|
||||
if (agvSsjTask.IsSuccess) {
|
||||
ddsx2 = SoftBasic.ByteToHexString(agvSsjTask.Content);
|
||||
if("L1001".equals(ssjDevice.getDeviceCode())){
|
||||
ssjDevice.setTaskNo2(ParseUtil.optDInt(0, ddsx2));
|
||||
}
|
||||
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));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -217,16 +253,16 @@ public class PlcSsjRead implements Runnable {
|
||||
}
|
||||
|
||||
void closeServer() {
|
||||
if (readWriteNet != null) {
|
||||
readWriteNet.ConnectClose();
|
||||
if (siemensS7Net != null) {
|
||||
siemensS7Net.ConnectClose();
|
||||
}
|
||||
setIsConnect(false);
|
||||
}
|
||||
|
||||
public static int writeToSsj(String address, String taskNo, int qx , int completed) {
|
||||
|
||||
int jym = Tools.getJYM(Integer.parseInt(taskNo), qx, completed);
|
||||
SendData taskNoSendData = new SendData(Tools.INT, taskNo);
|
||||
int jym = Tools.getJYM(Integer.parseInt(taskNo), qx);
|
||||
SendData taskNoSendData = new SendData(Tools.DINT, taskNo);
|
||||
SendData qxSendData = new SendData(Tools.INT, qx);
|
||||
SendData completedSendData = new SendData(Tools.INT, completed);
|
||||
SendData jymSendData = new SendData(Tools.INT, jym);
|
||||
@@ -234,7 +270,11 @@ public class PlcSsjRead implements Runnable {
|
||||
return PlcSsjRead.WriteToSSJ(address, bytes);
|
||||
}
|
||||
|
||||
|
||||
public static int writeToSsjQH(String address, int size) {
|
||||
SendData sizeSendData = new SendData(Tools.INT, size);
|
||||
byte[] bytes = Tools.sendData(sizeSendData);
|
||||
return PlcSsjRead.WriteToSSJ(address, bytes);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ public class Tools implements Serializable {
|
||||
|
||||
public static void main(String[] arg) {
|
||||
int jym = getJYM(1, 2, 3);
|
||||
System.out.println(jym);
|
||||
//System.out.println(jym);
|
||||
}
|
||||
|
||||
/*4、CRC-16校验码计算方法:
|
||||
@@ -58,7 +58,7 @@ public class Tools implements Serializable {
|
||||
for (int j = 0; j < 4; j++) {
|
||||
int s = j + i * 4;
|
||||
ints1[s] = son[j];
|
||||
System.out.println(Arrays.toString(ints1));
|
||||
//System.out.println(Arrays.toString(ints1));
|
||||
}
|
||||
}
|
||||
int a = 0;
|
||||
@@ -225,10 +225,10 @@ public class Tools implements Serializable {
|
||||
ints[22] = binaryTints8(printBits(a23));
|
||||
ints[23] = binaryTints8(printBits(a24));
|
||||
ints[24] = binaryTints8(printBits(a25));
|
||||
for (int anInt : ints) {
|
||||
System.out.print(anInt + " ");
|
||||
}
|
||||
System.out.println();
|
||||
// for (int anInt : ints) {
|
||||
// System.out.print(anInt + " ");
|
||||
// }
|
||||
// System.out.println();
|
||||
return BytesToInt(ints);
|
||||
}
|
||||
|
||||
|
||||
@@ -8,6 +8,8 @@ import com.ruoyi.api.domain.wcs2wms.JobParam;
|
||||
import com.ruoyi.api.service.IApiService;
|
||||
import com.ruoyi.bas.cargospace.domain.BasCargoSpace;
|
||||
import com.ruoyi.bas.cargospace.service.IBasCargoSpaceService;
|
||||
import com.ruoyi.bas.sysDateConfig.domain.SysDateConfig;
|
||||
import com.ruoyi.bas.sysDateConfig.service.SysDateConfigService;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.utils.spring.SpringUtils;
|
||||
import com.ruoyi.device.ddj.domain.MsgDdj;
|
||||
@@ -16,18 +18,21 @@ import com.ruoyi.job.service.IMydoJobService;
|
||||
import com.ruoyi.queue.ddj.domain.DdjDeviceExecutionQueue;
|
||||
import com.ruoyi.queue.ddj.service.IDdjDeviceExecutionQueueFinishService;
|
||||
import com.ruoyi.queue.ddj.service.IDdjDeviceExecutionQueueService;
|
||||
import com.ruoyi.schedule.plcRead.ddj.PlcDdjRead;
|
||||
import com.ruoyi.schedule.plcRead.ssj.PlcSsjRead;
|
||||
import com.ruoyi.schedule.plcRead.ddj.PlcDdj1Read;
|
||||
import com.ruoyi.schedule.plcRead.ddj.PlcDdj2Read;
|
||||
import com.ruoyi.schedule.plcRead.util.Tools;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Slf4j
|
||||
public class Ddj1Thread implements Runnable {
|
||||
public class DdjThread implements Runnable {
|
||||
|
||||
public HashMap<String, List<String>> ddjCodeList;
|
||||
|
||||
@@ -36,6 +41,7 @@ public class Ddj1Thread implements Runnable {
|
||||
private IDdjDeviceExecutionQueueFinishService ddjDeviceExecutionQueueFinishService;
|
||||
private IMydoJobService mydoJobService;
|
||||
private IBasCargoSpaceService basCargoSpaceService;
|
||||
private SysDateConfigService sysDateConfigService;
|
||||
|
||||
public boolean isRun = true;
|
||||
|
||||
@@ -53,6 +59,7 @@ public class Ddj1Thread implements Runnable {
|
||||
ddjDeviceExecutionQueueFinishService = SpringUtils.getBean(IDdjDeviceExecutionQueueFinishService.class);
|
||||
basCargoSpaceService = SpringUtils.getBean(IBasCargoSpaceService.class);
|
||||
mydoJobService = SpringUtils.getBean(IMydoJobService.class);
|
||||
sysDateConfigService = SpringUtils.getBean(SysDateConfigService.class);
|
||||
log.info("初始化服务 {},{},{},{}", apiService, ddjDeviceExecutionQueueService, ddjDeviceExecutionQueueFinishService,mydoJobService);
|
||||
}
|
||||
|
||||
@@ -62,18 +69,35 @@ public class Ddj1Thread implements Runnable {
|
||||
while (isRun) {
|
||||
for (String type : ddjCodeList.keySet()) {
|
||||
|
||||
if ("ddj".equals(type)) {
|
||||
for (String ddjCode : ddjCodeList.get(type)) {
|
||||
try {
|
||||
if (PlcDdjRead.deviceDdjMap.containsKey(ddjCode)) {
|
||||
ddjTask(PlcDdjRead.deviceDdjMap.get(ddjCode));
|
||||
} else {
|
||||
log.error("设备不存在 ssjCode{}", ddjCode);
|
||||
}
|
||||
} catch (RuntimeException e) {
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
SysDateConfig sysDateConfig = sysDateConfigService.getMsgById("1");
|
||||
if(sysDateConfig != null){
|
||||
String configDate = sysDateConfig.getSysDate();
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
Date inputDate = null;
|
||||
try {
|
||||
inputDate = sdf.parse(configDate);
|
||||
} catch (ParseException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
Date currentDate = new Date(); // 当前时间
|
||||
int comparison = inputDate.compareTo(currentDate);
|
||||
if(comparison > 0) {
|
||||
if ("ddj".equals(type)) {
|
||||
for (String ddjCode : ddjCodeList.get(type)) {
|
||||
try {
|
||||
if ("ddj1".equals(ddjCode)) {
|
||||
ddjTask(PlcDdj1Read.deviceDdjMap.get(ddjCode));
|
||||
}
|
||||
//PlcDdj2Read.deviceDdjMap.containsKey(ddjCode)
|
||||
if ("ddj2".equals(ddjCode)) {
|
||||
ddjTask(PlcDdj2Read.deviceDdjMap.get(ddjCode));
|
||||
}
|
||||
} catch (RuntimeException e) {
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -92,14 +116,20 @@ public class Ddj1Thread implements Runnable {
|
||||
堆垛机线程进来后第一件事先进行堆垛机正执行任务的账务处理
|
||||
以防存在漏处理,没处理的情况发生
|
||||
*/
|
||||
if (ddj.getCzfs() == 5 && ddj.getSbzt() == 0 && ddj.getJdbz() == 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) {
|
||||
if (ddjDeviceExecutionQueue != null) {
|
||||
//回传完成信号
|
||||
ddjTaskFinish(rwh, ddj.getId());
|
||||
if(mydoJob != null){
|
||||
ddjTaskFinish(rwh, ddj.getId());
|
||||
}else{
|
||||
ddjDeviceExecutionQueueService.delQueue(ddjDeviceExecutionQueue);
|
||||
}
|
||||
|
||||
log.info("堆垛机:"+ddj.getId()+"任务完成,任务号:"+ddj.getRwh());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -111,7 +141,7 @@ public class Ddj1Thread implements Runnable {
|
||||
//根据堆垛机上任务号,修改任务执行阶段
|
||||
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");
|
||||
@@ -128,40 +158,40 @@ public class Ddj1Thread implements Runnable {
|
||||
Long rwh = ddj.getRwh();
|
||||
MydoJob mydoJob = mydoJobService.selectMydoJobByTaskNo(rwh);
|
||||
DdjDeviceExecutionQueue ddjDeviceExecutionQueue = ddjDeviceExecutionQueueService.selectDdjDeviceExecutionQueueByRwh(rwh, ddj.getId());
|
||||
if ("0".equals(mydoJob.getFaultFlag()) && "1".equals(ddjDeviceExecutionQueue.getSpare1())) {
|
||||
mydoJob.setStatus("1");
|
||||
mydoJobService.updateMydoJob(mydoJob);
|
||||
AjaxResult ajaxResult = apiService.reAssign(new JobParam(rwh.toString(), null, null));
|
||||
if (ajaxResult.isSuccess()){
|
||||
mydoJob = mydoJobService.selectMydoJobByTaskNo(rwh);
|
||||
mydoJob.setFaultFlag("2");
|
||||
if(mydoJob != null && Integer.parseInt(mydoJob.getInOrOut()) < 20){
|
||||
if ("0".equals(mydoJob.getFaultFlag()) && "1".equals(ddjDeviceExecutionQueue.getSpare1())) {
|
||||
mydoJob.setStatus("1");
|
||||
mydoJobService.updateMydoJob(mydoJob);
|
||||
BasCargoSpace basCargoSpace = basCargoSpaceService.selectBasCargoSpaceByWmsCargoSpaceId(mydoJob.getCargoSpaceId());
|
||||
ddjDeviceExecutionQueue.setMbph(basCargoSpace.getThePlatoon());
|
||||
ddjDeviceExecutionQueue.setMblh(basCargoSpace.getTheColumn());
|
||||
ddjDeviceExecutionQueue.setMbch(basCargoSpace.getTheFloor());
|
||||
ddjDeviceExecutionQueue.setSpare1("0");
|
||||
ddjDeviceExecutionQueueService.updateDdjDeviceExecutionQueue(ddjDeviceExecutionQueue);
|
||||
AjaxResult ajaxResult = apiService.reAssign(new JobParam(mydoJob.getJobId(), mydoJob.getTrayCode(), mydoJob.getTaskNo()));
|
||||
if (ajaxResult.isSuccess()){
|
||||
mydoJob = mydoJobService.selectMydoJobByTaskNo(rwh);
|
||||
mydoJob.setFaultFlag("2");
|
||||
mydoJobService.updateMydoJob(mydoJob);
|
||||
BasCargoSpace basCargoSpace = basCargoSpaceService.selectBasCargoSpaceByWmsCargoSpaceId(mydoJob.getCargoSpaceId());
|
||||
ddjDeviceExecutionQueue.setMbph(basCargoSpace.getThePlatoon());
|
||||
ddjDeviceExecutionQueue.setMblh(basCargoSpace.getTheColumn());
|
||||
ddjDeviceExecutionQueue.setMbch(basCargoSpace.getTheFloor());
|
||||
ddjDeviceExecutionQueue.setDdjxf("0");
|
||||
ddjDeviceExecutionQueueService.updateDdjDeviceExecutionQueue(ddjDeviceExecutionQueue);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
第四部分
|
||||
取货无货,重新分配单据
|
||||
*/
|
||||
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));
|
||||
AjaxResult ajaxResult = apiService.reMaterial(new JobParam(mydoJob.getJobId(), mydoJob.getTrayCode(), mydoJob.getTaskNo()));
|
||||
if (ajaxResult.isSuccess()) {
|
||||
//作废作业
|
||||
InvalidMydoJob(rwh, ddj.getId());
|
||||
//删除队列
|
||||
ddjDeviceExecutionQueueService.deleteDdjDeviceExecutionQueueByUuid(ddjDeviceExecutionQueue.getUuid());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -177,7 +207,7 @@ public class Ddj1Thread implements Runnable {
|
||||
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) {
|
||||
@@ -187,19 +217,18 @@ public class Ddj1Thread 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");
|
||||
//ddjDeviceExecutionQueueRunningParam.setSpare1("1");
|
||||
ddjDeviceExecutionQueueRunningParam.setDevId(ddj.getId());
|
||||
List<DdjDeviceExecutionQueue> ddjDeviceExecutionRunningQueues = ddjDeviceExecutionQueueService.selectDdjDeviceExecutionQueueList(ddjDeviceExecutionQueueRunningParam);
|
||||
if (CollUtil.isNotEmpty(ddjDeviceExecutionRunningQueues)) {
|
||||
@@ -221,9 +250,9 @@ public class Ddj1Thread implements Runnable {
|
||||
ddjDeviceExecutionQueue.setXfsj(DateUtil.formatDateTime(DateUtil.date()));
|
||||
ddjDeviceExecutionQueue.setDdjxf("1");
|
||||
ddjDeviceExecutionQueueService.updateDdjDeviceExecutionQueue(ddjDeviceExecutionQueue);
|
||||
log.info("托盘堆垛机下发任务成功 rwh:{}", rwh);
|
||||
log.info("堆垛机下发任务成功 rwh:{}", ddjDeviceExecutionQueue.getRwh());
|
||||
} else {
|
||||
log.error("托盘堆垛机下发任务失败!!!!!!!");
|
||||
log.error("堆垛机下发任务失败!!!!!!!");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -266,12 +295,22 @@ public class Ddj1Thread implements Runnable {
|
||||
int mbch = Convert.toInt(queue.getMbch());
|
||||
int mlfs = 5;
|
||||
int xfwc = 1;
|
||||
int jym = Tools.getJYM(taskNo, yph, ylh, ych, mbph, mblh, mbch, mlfs, xfwc);
|
||||
byte[] sendData = Tools.sendDataToDevice(taskNo, null, yph, ylh, ych, mbph, mblh, mbch, mlfs, xfwc, jym);
|
||||
int hwlx = 4;
|
||||
if(queue.getSpare1() != null && !"".equals(queue.getSpare1())){
|
||||
hwlx = Convert.toInt(queue.getSpare1());
|
||||
}else{
|
||||
if(devId == 1){
|
||||
hwlx = 4;
|
||||
}else{
|
||||
hwlx = 1;
|
||||
}
|
||||
}
|
||||
int jym = Tools.getJYM(taskNo, yph, ylh, ych, mbph, mblh, mbch, mlfs, hwlx);
|
||||
byte[] sendData = Tools.sendDataToDevice(taskNo, null, yph, ylh, ych, mbph, mblh, mbch, mlfs, hwlx, xfwc, jym);
|
||||
if (devId==1){
|
||||
return PlcDdjRead.WriteToDDJ("DB61.0", sendData);
|
||||
return PlcDdj1Read.WriteToDDJ("DB61.0", sendData);
|
||||
}else {
|
||||
return PlcDdjRead.WriteToDDJ("DB61.0", sendData);
|
||||
return PlcDdj2Read.WriteToDDJ("DB61.0", sendData);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
package com.ruoyi.schedule.scheduleTask.monit;
|
||||
|
||||
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.bas.fault.domain.BasFaultRecord;
|
||||
import com.ruoyi.bas.fault.service.IBasFaultRecordService;
|
||||
import com.ruoyi.common.utils.spring.SpringUtils;
|
||||
@@ -12,9 +10,9 @@ import com.ruoyi.device.ddj.domain.MsgDdj;
|
||||
import com.ruoyi.device.ddj.service.IMsgDdjService;
|
||||
import com.ruoyi.device.ssj.domain.DeviceSsj;
|
||||
import com.ruoyi.device.ssj.service.IDeviceSsjService;
|
||||
import com.ruoyi.job.domain.MydoJob;
|
||||
import com.ruoyi.job.service.IMydoJobService;
|
||||
import com.ruoyi.schedule.plcRead.ddj.PlcDdjRead;
|
||||
import com.ruoyi.schedule.plcRead.ddj.PlcDdj1Read;
|
||||
import com.ruoyi.schedule.plcRead.ddj.PlcDdj2Read;
|
||||
import com.ruoyi.schedule.plcRead.ssj.PlcSsjRead;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@@ -49,8 +47,48 @@ public class MonitoringThread implements Runnable {
|
||||
DeviceSsj deviceSsj = PlcSsjRead.deviceSsjMap.get(ssjCode);
|
||||
deviceSsjService.updateDeviceSsj(deviceSsj);
|
||||
}
|
||||
for (String ddjCode : PlcDdjRead.deviceDdjMap.keySet()) {
|
||||
MsgDdj msgDdj = PlcDdjRead.deviceDdjMap.get(ddjCode);
|
||||
for (String ddjCode : PlcDdj1Read.deviceDdjMap.keySet()) {
|
||||
MsgDdj msgDdj = PlcDdj1Read.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) {
|
||||
|
||||
@@ -61,8 +61,8 @@ public class Floor1BothWayInSsjThread implements Runnable {
|
||||
|
||||
|
||||
//初始化巷道口 排 列 层
|
||||
roadwayMap.put("L2003", Arrays.asList(1, 1, 1));
|
||||
roadwayMap.put("L2005", Arrays.asList(1, 1, 1));
|
||||
roadwayMap.put("L2003", Arrays.asList(2, 47, 1));
|
||||
roadwayMap.put("L2005", Arrays.asList(3, 70, 1));
|
||||
|
||||
exitRoadwayMap.put("L2003", "L2004");
|
||||
exitRoadwayMap.put("L2005", "L2006");
|
||||
@@ -99,60 +99,79 @@ public class Floor1BothWayInSsjThread implements Runnable {
|
||||
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.setScsj(DateUtil.formatDateTime(DateUtil.date()));
|
||||
ddjDeviceExecutionQueue.setRwlx(DDJ_RWLX_3);
|
||||
ddjDeviceExecutionQueueService.insertDdjDeviceExecutionQueue(ddjDeviceExecutionQueue);
|
||||
|
||||
mydoJob.setExecutionPhase(TASK_EP_DDJ);
|
||||
if(ObjUtil.isNotNull(mydoJob) && Convert.toInt(mydoJob.getInOrOut()) < 20){
|
||||
if (TASK_STATUS_CREATE.equals(mydoJob.getStatus())
|
||||
&& TASK_EP_SSJ.equals(mydoJob.getExecutionPhase())) {
|
||||
//修改作业执行状态
|
||||
mydoJob.setStatus(TASK_STATUS_RUNNING);
|
||||
mydoJob.setStartTime(DateUtil.formatDateTime(DateUtil.date()));
|
||||
mydoJobService.updateMydoJob(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(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.getDw() == 1 && ssj.getTaskNo() > 0 && ssj.getTaskNo() < 1000 && ssj.getTraySize() != 0) {
|
||||
if (ssj.getRkqq() == 1 && ssj.getTaskNo() > 0 && ssj.getTaskNo() < 1000 && StrUtil.isEmpty(ssj.getTrayCode())) {
|
||||
//先检测有没有出库作业,有出库作业直接退回
|
||||
MydoJob outMydoJob = mydoJobService.selectRunningMydoJobByExitList(Collections.singletonList(ssj.getDeviceCode()));
|
||||
if (ObjUtil.isNotNull(outMydoJob) || StrUtil.isEmpty(ssj.getTrayCode())) {
|
||||
if (ObjUtil.isNotNull(outMydoJob)) {
|
||||
//下发去向 和任务号
|
||||
int i = writeToSsj(ssj.getPlcDbWriteAddress(), "0", 2, 1);
|
||||
int i = writeToSsj(ssj.getPlcDbWriteAddress(), "99", 2, 2);
|
||||
if (i == 1) {
|
||||
log.info("未检测到托盘码下发回退 rwh:{},qx:{},trayCode:{}", ssj.getTaskNo(), 1, ssj.getTrayCode());
|
||||
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)) {
|
||||
@@ -161,7 +180,6 @@ public class Floor1BothWayInSsjThread implements Runnable {
|
||||
//根据托盘码请求入库作业
|
||||
HashMap<String, Object> paramMap = new HashMap<>();
|
||||
paramMap.put("trayCode", ssj.getTrayCode());
|
||||
paramMap.put("size", ssj.getTraySize());
|
||||
paramMap.put("floor", "1");
|
||||
paramMap.put("entranceId",ssj.getDeviceCode());
|
||||
AjaxResult result = apiService.selectMydoJobByTrayCodeAndEntranceId(paramMap);
|
||||
@@ -169,9 +187,16 @@ public class Floor1BothWayInSsjThread implements Runnable {
|
||||
inJob = BeanUtil.toBean(result.get("data"), MydoJob.class);
|
||||
inJob.setStatus(TASK_STATUS_CREATE);
|
||||
inJob.setExecutionPhase(TASK_EP_CREATE);
|
||||
inJob.setFaultFlag("0");
|
||||
inJob.setPriority(Long.valueOf(10));
|
||||
mydoJobService.insertMydoJob(inJob);
|
||||
} else {
|
||||
log.info("未检测到托盘码请求入库作业 rwh:{},trayCode:{}", ssj.getTaskNo(), ssj.getTrayCode());
|
||||
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) {
|
||||
@@ -183,62 +208,63 @@ public class Floor1BothWayInSsjThread implements Runnable {
|
||||
inJob.setStartTime(DateUtil.formatDateTime(DateUtil.date()));
|
||||
inJob.setTargetRoadwayId(Convert.toStr(1));
|
||||
mydoJobService.updateMydoJob(inJob);
|
||||
log.info("入库请求下发任务号加去向 rwh:{},qx:{},trayCode:{}", ssj.getTaskNo(), 1, ssj.getTrayCode());
|
||||
log.info("托盘码请求作业成功,下发任务号 rwh:{},qx:{},trayCode:{}", ssj.getTaskNo(), 1, 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);
|
||||
}else{
|
||||
//下发去向 和任务号
|
||||
int i = writeToSsj(ssj.getPlcDbWriteAddress(), "99", 2, 2);
|
||||
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("size", ssj.getTraySize());
|
||||
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);
|
||||
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(), "0", Integer.parseInt(ajaxResult.get("code").toString()), 2);
|
||||
if (i == 1) {
|
||||
log.info("{}下发错误信号{}:",ssj.getDeviceCode(),Integer.parseInt(ajaxResult.get("code").toString()));
|
||||
}
|
||||
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()));
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import java.util.*;
|
||||
|
||||
import static com.ruoyi.common.TaskStatusCode.*;
|
||||
import static com.ruoyi.common.TaskType.DDJ_RWLX_2;
|
||||
import static com.ruoyi.common.TaskType.DDJ_RWLX_3;
|
||||
|
||||
/**
|
||||
@@ -37,12 +38,9 @@ public class Floor1BothWayOutSsjThread implements Runnable {
|
||||
private IMydoJobService mydoJobService;
|
||||
private IBasCargoSpaceService basCargoSpaceService;
|
||||
private IDdjDeviceExecutionQueueService ddjDeviceExecutionQueueService;
|
||||
private final Map<String,List<Integer>> roadwayMap = new HashMap<>();
|
||||
private final Map<String, List<Integer>> roadwayMap = new HashMap<>();
|
||||
private IJobCallBackService jobCallBackService;
|
||||
|
||||
private final Map<String,DeviceSsj> roadwayOutMap = new HashMap<>();
|
||||
|
||||
|
||||
public boolean isRun = true;
|
||||
|
||||
|
||||
@@ -50,22 +48,25 @@ public class Floor1BothWayOutSsjThread implements Runnable {
|
||||
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> out1 = new ArrayList<>();
|
||||
out1.add(PlcSsjRead.deviceSsjMap.get("L2004"));
|
||||
ssjCodeList.put("out1", out1);
|
||||
ArrayList<DeviceSsj> out2 = new ArrayList<>();
|
||||
out2.add(PlcSsjRead.deviceSsjMap.get("L2006"));
|
||||
ssjCodeList.put("out2", out2);
|
||||
|
||||
ArrayList<DeviceSsj> roadway1Both = new ArrayList<>();
|
||||
roadway1Both.add(PlcSsjRead.deviceSsjMap.get("L2001"));
|
||||
ssjCodeList.put("roadway1Both", roadway1Both);
|
||||
|
||||
ArrayList<DeviceSsj> roadway2Both = new ArrayList<>();
|
||||
roadway2Both.add(PlcSsjRead.deviceSsjMap.get("L2007"));
|
||||
ssjCodeList.put("roadway2Both", roadway2Both);
|
||||
|
||||
mydoJobService = SpringUtils.getBean(IMydoJobService.class);
|
||||
basCargoSpaceService = SpringUtils.getBean(IBasCargoSpaceService.class);
|
||||
@@ -74,22 +75,26 @@ public class Floor1BothWayOutSsjThread implements Runnable {
|
||||
|
||||
|
||||
//初始化巷道口 排 列 层
|
||||
roadwayMap.put("L2003",Arrays.asList(1,1,1));
|
||||
roadwayMap.put("L2005",Arrays.asList(1,1,1));
|
||||
roadwayMap.put("L2003", Arrays.asList(2, 47, 1));
|
||||
roadwayMap.put("L2005", Arrays.asList(3, 70, 1));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
init();
|
||||
while (isRun){
|
||||
while (isRun) {
|
||||
for (String type : ssjCodeList.keySet()) {
|
||||
|
||||
switch (type){
|
||||
switch (type) {
|
||||
case "roadway1":
|
||||
dispatch(ssjCodeList.get(type));
|
||||
break;
|
||||
case "roadway2":
|
||||
dispatch(ssjCodeList.get(type));
|
||||
break;
|
||||
case "out1":
|
||||
dispatch1(ssjCodeList.get(type));
|
||||
break;
|
||||
case "out2":
|
||||
dispatch1(ssjCodeList.get(type));
|
||||
break;
|
||||
@@ -107,29 +112,32 @@ public class Floor1BothWayOutSsjThread implements Runnable {
|
||||
|
||||
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());
|
||||
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());
|
||||
if (ssj.getTaskNo2() > 0) {
|
||||
MydoJob mydoJob = mydoJobService.selectMydoJobByTaskNo(Convert.toLong(ssj.getTaskNo2()));
|
||||
if(mydoJob != null && Convert.toInt(mydoJob.getInOrOut()) > 20){
|
||||
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());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -139,25 +147,45 @@ public class Floor1BothWayOutSsjThread implements Runnable {
|
||||
* 出库堆垛机队列生成
|
||||
*/
|
||||
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)) {
|
||||
DeviceSsj deviceSsj = ssjList.get(0);
|
||||
DeviceSsj ssj = new DeviceSsj();
|
||||
DeviceSsj inOutSsj = new DeviceSsj();
|
||||
String roadwayId = "";
|
||||
String entrance_id = "";
|
||||
if ("L2003".equals(deviceSsj.getDeviceCode())) {
|
||||
roadwayId = "1";
|
||||
ssj = ssjCodeList.get("roadway1Both").get(0);
|
||||
entrance_id = "L2004";
|
||||
inOutSsj = PlcSsjRead.deviceSsjMap.get("L2004");
|
||||
|
||||
}
|
||||
if("L2005".equals(deviceSsj.getDeviceCode())) {
|
||||
roadwayId = "2";
|
||||
ssj = ssjCodeList.get("roadway2Both").get(0);
|
||||
entrance_id = "L2006";
|
||||
inOutSsj = PlcSsjRead.deviceSsjMap.get("L2006");
|
||||
}
|
||||
|
||||
MydoJob mydoJob = mydoJobService.selectMydoJobByExitList1("1", roadwayId);
|
||||
MydoJob inJob = mydoJobService.selectMydoJobByEntranceList1(entrance_id);
|
||||
// log.info("输送线"+deviceSsj.getDeviceCode()+"空闲:"+ deviceSsj.getKx()+"任务号:"+deviceSsj.getTaskNo());
|
||||
// log.info("输送线"+inOutSsj.getDeviceCode()+"入出库模式:"+ inOutSsj.getInOrOut());
|
||||
if (ObjUtil.isNotNull(mydoJob) && deviceSsj.getKx() == 1 && ssj.getKx() == 0
|
||||
&& ObjUtil.isNull(inJob) && inOutSsj.getInOrOut() == 1 && deviceSsj.getTaskNo() == 0) {
|
||||
//所有线体为空闲 并且存在出库作业 并且不存在入库作业
|
||||
BasCargoSpace basCargoSpace = basCargoSpaceService.selectBasCargoSpaceByWmsCargoSpaceId(pdOutJob.getCargoSpaceId());
|
||||
if (ObjUtil.isNull(basCargoSpace)){
|
||||
log.error("货位不存在 cargoSpaceId{}",pdOutJob.getCargoSpaceId());
|
||||
}else {
|
||||
BasCargoSpace basCargoSpace = basCargoSpaceService.selectBasCargoSpaceByWmsCargoSpaceId(mydoJob.getCargoSpaceId());
|
||||
if (ObjUtil.isNull(basCargoSpace)) {
|
||||
log.error("货位不存在 cargoSpaceId{}", mydoJob.getCargoSpaceId());
|
||||
} else {
|
||||
//生成队列
|
||||
List<DdjDeviceExecutionQueue> list = ddjDeviceExecutionQueueService.selectDdjDeviceExecutionQueueListByRwlx(DDJ_RWLX_3,Convert.toInt(pdOutJob.getRoadwayId()));
|
||||
List<DdjDeviceExecutionQueue> list = ddjDeviceExecutionQueueService.selectDdjDeviceExecutionQueueListByRwlx(DDJ_RWLX_2, Convert.toInt(mydoJob.getRoadwayId()));
|
||||
List<Integer> pclList = roadwayMap.get(ssjList.get(0).getDeviceCode());
|
||||
if (CollUtil.isEmpty(list) && CollUtil.isNotEmpty(pclList)){
|
||||
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.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()));
|
||||
@@ -167,14 +195,16 @@ public class Floor1BothWayOutSsjThread implements Runnable {
|
||||
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_3);
|
||||
ddjDeviceExecutionQueue.setRwlx(DDJ_RWLX_2);
|
||||
ddjDeviceExecutionQueueService.insertDdjDeviceExecutionQueue(ddjDeviceExecutionQueue);
|
||||
|
||||
pdOutJob.setStatus(TASK_STATUS_RUNNING);
|
||||
pdOutJob.setExecutionPhase(TASK_EP_DDJ);
|
||||
pdOutJob.setStartTime(DateUtil.formatDateTime(DateUtil.date()));
|
||||
mydoJobService.updateMydoJob(pdOutJob);
|
||||
mydoJob.setStatus(TASK_STATUS_RUNNING);
|
||||
mydoJob.setExecutionPhase(TASK_EP_DDJ);
|
||||
mydoJob.setStartTime(DateUtil.formatDateTime(DateUtil.date()));
|
||||
mydoJob.setExitId(entrance_id);
|
||||
mydoJobService.updateMydoJob(mydoJob);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -65,44 +65,40 @@ public class Floor1SingleSsjThread implements Runnable {
|
||||
exitRoadwayMap.put("L2007", "L2008");
|
||||
|
||||
//初始化巷道口 排 列 层
|
||||
roadwayMap.put("L2001", Arrays.asList(1, 1, 1));
|
||||
roadwayMap.put("L2007", Arrays.asList(1, 1, 1));
|
||||
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);
|
||||
}
|
||||
try {
|
||||
if (PlcSsjRead.deviceSsjMap.containsKey("L2001")) {
|
||||
dispatch(PlcSsjRead.deviceSsjMap.get("L2001"));
|
||||
} else {
|
||||
log.error("设备不存在 ssjCode{}", "L2001");
|
||||
}
|
||||
if (PlcSsjRead.deviceSsjMap.containsKey("L2007")) {
|
||||
dispatch(PlcSsjRead.deviceSsjMap.get("L2007"));
|
||||
} else {
|
||||
log.error("设备不存在 ssjCode{}", "L2007");
|
||||
}
|
||||
if (PlcSsjRead.deviceSsjMap.containsKey("L2002")) {
|
||||
dispatch2(PlcSsjRead.deviceSsjMap.get("L2002"));
|
||||
} else {
|
||||
log.error("设备不存在 ssjCode{}", "L2002");
|
||||
}
|
||||
if (PlcSsjRead.deviceSsjMap.containsKey("L2008")) {
|
||||
dispatch2(PlcSsjRead.deviceSsjMap.get("L2008"));
|
||||
} else {
|
||||
log.error("设备不存在 ssjCode{}", "L2008");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (RuntimeException e) {
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
|
||||
try {
|
||||
Thread.sleep(1500);
|
||||
} catch (InterruptedException e) {
|
||||
@@ -118,9 +114,9 @@ public class Floor1SingleSsjThread implements Runnable {
|
||||
* @param ssj 输送机
|
||||
*/
|
||||
private void dispatch2(DeviceSsj ssj) {
|
||||
if (ssj.getDw() == 1 && ssj.getTaskNo() > 0) {
|
||||
if (ssj.getTaskNo() > 0) {
|
||||
MydoJob mydoJob = mydoJobService.selectMydoJobByTaskNo(Convert.toLong(ssj.getTaskNo()));
|
||||
if (ObjUtil.isNotNull(mydoJob)) {
|
||||
if (ObjUtil.isNotNull(mydoJob) && Convert.toInt(mydoJob.getInOrOut()) > 20) {
|
||||
mydoJob.setExecutionPhase(TASK_EP_SSJ);
|
||||
mydoJobService.updateMydoJob(mydoJob);
|
||||
JobCallBack jobCallBack = new JobCallBack();
|
||||
@@ -129,6 +125,7 @@ public class Floor1SingleSsjThread implements Runnable {
|
||||
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);
|
||||
@@ -148,11 +145,20 @@ public class Floor1SingleSsjThread implements Runnable {
|
||||
*/
|
||||
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 (ssj.getKx() == 1 && ssj.getTaskNo() == 0) {
|
||||
|
||||
String roadwayId = "";
|
||||
String entrance_id = "";
|
||||
if("L2001".equals(ssj.getDeviceCode())){
|
||||
roadwayId = "1";
|
||||
entrance_id = "L2002";
|
||||
|
||||
}
|
||||
if("L2007".equals(ssj.getDeviceCode())){
|
||||
roadwayId = "2";
|
||||
entrance_id = "L2008";
|
||||
}
|
||||
MydoJob mydoJob = mydoJobService.selectMydoJobByExitList1("1",roadwayId);
|
||||
if (ObjUtil.isNotNull(mydoJob)) {
|
||||
BasCargoSpace basCargoSpace = basCargoSpaceService.selectBasCargoSpaceByWmsCargoSpaceId(mydoJob.getCargoSpaceId());
|
||||
if (ObjUtil.isNull(basCargoSpace)) {
|
||||
@@ -176,6 +182,7 @@ public class Floor1SingleSsjThread implements Runnable {
|
||||
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);
|
||||
@@ -184,6 +191,7 @@ public class Floor1SingleSsjThread implements Runnable {
|
||||
mydoJob.setStatus(TASK_STATUS_RUNNING);
|
||||
mydoJob.setExecutionPhase(TASK_EP_DDJ);
|
||||
mydoJob.setStartTime(DateUtil.formatDateTime(DateUtil.date()));
|
||||
mydoJob.setExitId(entrance_id);
|
||||
mydoJobService.updateMydoJob(mydoJob);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,13 +16,13 @@ import com.ruoyi.queue.agv.service.IAgvQueueService;
|
||||
import com.ruoyi.schedule.plcRead.ssj.PlcSsjRead;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
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.writeToSsj;
|
||||
import static com.ruoyi.schedule.plcRead.ssj.PlcSsjRead.writeToSsjQH;
|
||||
|
||||
/**
|
||||
* 二楼出入口输送线线程
|
||||
@@ -73,10 +73,8 @@ public class Floor2InOutSsjThread implements Runnable {
|
||||
} catch (RuntimeException e) {
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
try {
|
||||
@@ -93,14 +91,32 @@ public class Floor2InOutSsjThread implements Runnable {
|
||||
//如果输送机空闲
|
||||
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);
|
||||
List<AgvQueue> agvQueues = agvQueueService.selectAgvQueueList1(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() == 1) {
|
||||
log.info("设备:{} 位置:{} 任务号:{} 请求放货成功", inSsjDevice.getDeviceCode(), "输送线", agvQueues.get(0).getTaskCode());
|
||||
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());
|
||||
@@ -110,38 +126,87 @@ public class Floor2InOutSsjThread implements Runnable {
|
||||
}
|
||||
}
|
||||
//入库下发输送线
|
||||
if (inSsjDevice.getKx() == 0 && inSsjDevice.getTaskNo() == 0) {
|
||||
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);
|
||||
List<AgvQueue> agvQueues = agvQueueService.selectAgvQueueList1(agvQueue);
|
||||
if (!agvQueues.isEmpty()) {
|
||||
int i = writeToSsj(inSsjDevice.getPlcDbWriteAddress(), agvQueues.get(0).getWmsTaskNo(), 1,1);
|
||||
if (i == 1) {
|
||||
log.info("输送机{}下发任务号{}成功", inSsjDevice.getDeviceCode(), agvQueues.get(0).getWmsTaskNo());
|
||||
//解绑AGV容器
|
||||
AjaxResult ajaxResult = apiService.deleteAgvTray(agvQueues.get(0));
|
||||
if(ajaxResult.isSuccess()) {
|
||||
AgvQueue agvQueue1 = agvQueues.get(0);
|
||||
agvQueue1.setStatus("8");
|
||||
agvQueueService.updateAgvQueue(agvQueue1);
|
||||
}
|
||||
|
||||
try {
|
||||
log.info("AGV放货完成,等待AGV退出输送机!");
|
||||
Thread.sleep(5000);
|
||||
log.info("AGV放货完成,AGV退出输送机结束!");
|
||||
} catch (InterruptedException e) {
|
||||
log.info("AGV放货完成,等待AGV退出输送机异常!");
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
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());
|
||||
|
||||
}
|
||||
}
|
||||
}else{
|
||||
AgvQueue agvQueue2 = new AgvQueue();
|
||||
agvQueue2.setStatus("8"); //end
|
||||
//todo 与agv对点
|
||||
agvQueue2.setPositionCode2(inSsjDevice.getDeviceCode());
|
||||
List<AgvQueue> queueList = agvQueueService.selectAgvQueueList1(agvQueue2);
|
||||
if (!queueList.isEmpty()) {
|
||||
if("L1001".equals(inSsjDevice.getDeviceCode())) {
|
||||
int i = writeToSsj("DB802.100", queueList.get(0).getWmsTaskNo(), 2,Integer.parseInt(queueList.get(0).getCtnrCode()));
|
||||
if (i == 1) {
|
||||
log.info("输送机{}AGV放货完成下发任务号{}成功", inSsjDevice.getDeviceCode(), queueList.get(0).getWmsTaskNo());
|
||||
|
||||
}
|
||||
}
|
||||
if("L1003".equals(inSsjDevice.getDeviceCode())) {
|
||||
int i = writeToSsj("DB802.112", queueList.get(0).getWmsTaskNo(), 2,Integer.parseInt(queueList.get(0).getCtnrCode()));
|
||||
if (i == 1) {
|
||||
log.info("输送机{}AGV放货完成下发任务号{}成功", inSsjDevice.getDeviceCode(), queueList.get(0).getWmsTaskNo());
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(inSsjDevice.getKx() == 0 && inSsjDevice.getTaskNo() > 0){
|
||||
if(inSsjDevice.getKx() == 0 && inSsjDevice.getTaskNo2() > 0){
|
||||
AgvQueue agvQueue = new AgvQueue();
|
||||
agvQueue.setStatus("7"); //end
|
||||
agvQueue.setStatus("8"); //end
|
||||
//todo 与agv对点
|
||||
agvQueue.setPositionCode2(inSsjDevice.getDeviceCode());
|
||||
List<AgvQueue> agvQueues = agvQueueService.selectAgvQueueList(agvQueue);
|
||||
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());
|
||||
List<AgvQueue> agvQueues = agvQueueService.selectAgvQueueList1(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) {
|
||||
if (mydoJob != null && Integer.parseInt(mydoJob.getInOrOut()) > 20) {
|
||||
log.info("设备:{} 位置:{} 任务号:{} 出库到位", "输送线", inSsjDevice.getDeviceCode(), mydoJob.getTaskNo());
|
||||
mydoJobService.insertHistory(mydoJob.getJobId());
|
||||
mydoJobService.deleteMydoJobByJobId(mydoJob.getJobId());
|
||||
@@ -151,6 +216,7 @@ public class Floor2InOutSsjThread implements Runnable {
|
||||
jobCallBack.setStatus("0");
|
||||
jobCallBack.setTaskNo(Convert.toLong(mydoJob.getTaskNo()));
|
||||
jobCallBack.setCreateTime(new Date());
|
||||
jobCallBack.setSpare1("0");
|
||||
jobCallBackService.insertJobCallBack(jobCallBack);
|
||||
}
|
||||
}
|
||||
@@ -167,7 +233,7 @@ public class Floor2InOutSsjThread implements Runnable {
|
||||
List<MydoJob> outMydoJobList = mydoJobService.selectInOrOutMydoJobList(mydoJobParam);
|
||||
if(!outMydoJobList.isEmpty()){
|
||||
//todo 去向不明朗
|
||||
int i = writeToSsj(ssjDevice.getPlcDbWriteAddress(),"0",2,2);
|
||||
int i = writeToSsj(ssjDevice.getPlcDbWriteAddress(),"99",2,2);
|
||||
if (i == 1) {
|
||||
log.info(ssjDevice.getDeviceCode()+"有正执行的出库作业退回" );
|
||||
}
|
||||
@@ -177,8 +243,9 @@ public class Floor2InOutSsjThread implements Runnable {
|
||||
MydoJob mydoJob = new MydoJob();
|
||||
mydoJob.setInOrOut("1");
|
||||
// mydoJob.setStatus("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(ssjDevice.getDeviceCode());
|
||||
List<MydoJob> mydoJobs = mydoJobService.selectMydoJobList(mydoJob);
|
||||
@@ -191,20 +258,19 @@ public class Floor2InOutSsjThread implements Runnable {
|
||||
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("size", ssjDevice.getTraySize());
|
||||
map.put("floor", "2");
|
||||
AjaxResult ajaxResult = apiService.selectMydoJobByTrayCodeAndEntranceId(map);
|
||||
if(ajaxResult.isSuccess()){
|
||||
MydoJob mydoJob2 = BeanUtil.toBean(ajaxResult.get("data"), MydoJob.class) ;
|
||||
MydoJob mydoJob2 = BeanUtil.toBean(ajaxResult.get("data"), MydoJob.class);
|
||||
mydoJob2.setStatus("1");
|
||||
mydoJob2.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) {
|
||||
@@ -215,69 +281,78 @@ public class Floor2InOutSsjThread implements Runnable {
|
||||
}
|
||||
}else{
|
||||
//todo 去向不明朗
|
||||
int i = writeToSsj(ssjDevice.getPlcDbWriteAddress(),"0",2,2);
|
||||
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());
|
||||
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(), "0", Integer.parseInt(ajaxResult.get("code").toString()), 2);
|
||||
if (i == 1) {
|
||||
log.info("G1005产线输送机下发错误信息成功");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
// 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()+"输送机下发错误信息成功");
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
|
||||
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;
|
||||
|
||||
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,6 +9,7 @@ import cn.hutool.core.util.ObjUtil;
|
||||
import com.ruoyi.api.service.IApiService;
|
||||
import com.ruoyi.bas.cargospace.domain.BasCargoSpace;
|
||||
import com.ruoyi.bas.cargospace.service.IBasCargoSpaceService;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.utils.spring.SpringUtils;
|
||||
import com.ruoyi.job.domain.JobCallBack;
|
||||
import com.ruoyi.job.domain.MydoJob;
|
||||
@@ -22,8 +24,8 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import java.util.*;
|
||||
|
||||
import static com.ruoyi.common.TaskStatusCode.*;
|
||||
import static com.ruoyi.common.TaskType.DDJ_RWLX_1;
|
||||
import static com.ruoyi.common.TaskType.DDJ_RWLX_3;
|
||||
import static com.ruoyi.common.TaskType.*;
|
||||
import static com.ruoyi.common.TaskType.DDJ_RWLX_2;
|
||||
|
||||
/**
|
||||
* 二楼出库线程 检测当前巷道有没有入库作业,没有作业,生成堆垛机出库队列
|
||||
@@ -53,8 +55,8 @@ public class Floor2RoadWaySsjThread implements Runnable {
|
||||
basCargoSpaceService = SpringUtils.getBean(IBasCargoSpaceService.class);
|
||||
ddjDeviceExecutionQueueService = SpringUtils.getBean(IDdjDeviceExecutionQueueService.class);
|
||||
//初始化巷道口 排 列 层
|
||||
roadwayMap.put("L1002", Arrays.asList(1, 1, 1));
|
||||
roadwayMap.put("L1004", Arrays.asList(1, 1, 1));
|
||||
roadwayMap.put("L1002", Arrays.asList(2, 0, 1));
|
||||
roadwayMap.put("L1004", Arrays.asList(4, 0, 1));
|
||||
log.info("初始化服务 {},{}", apiService, agvQueueService);
|
||||
}
|
||||
|
||||
@@ -77,7 +79,6 @@ public class Floor2RoadWaySsjThread implements Runnable {
|
||||
} catch (RuntimeException e) {
|
||||
log.error(e.getMessage(),e);
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -94,37 +95,109 @@ public class Floor2RoadWaySsjThread implements Runnable {
|
||||
|
||||
public void inDispatch(DeviceSsj roadSsjDevice) {
|
||||
//如果到位,且任务号大于0
|
||||
if (roadSsjDevice.getDw()==1 && roadSsjDevice.getTaskNo()>0) {
|
||||
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.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){
|
||||
String exitId = "";
|
||||
String roadwayId = "";
|
||||
String entranceId = "G1005";
|
||||
if("L1002".equals(roadSsjDevice.getDeviceCode())){
|
||||
exitId = "L1001";
|
||||
roadwayId = "1";
|
||||
}
|
||||
if("L1004".equals(roadSsjDevice.getDeviceCode())){
|
||||
exitId = "L1003";
|
||||
roadwayId = "2";
|
||||
}
|
||||
List<MydoJob> inList1 = mydoJobService.getInJobByRoadAndFloor(entranceId,roadwayId);
|
||||
List<MydoJob> inList2 = mydoJobService.getInJobByEntranceId(exitId);
|
||||
MydoJob mydoJob = mydoJobService.selectMydoJobByExitId(exitId);
|
||||
if (ObjUtil.isNotNull(mydoJob)) {
|
||||
if(inList1.size() == 0 && inList2.size() == 0){
|
||||
BasCargoSpace basCargoSpace = basCargoSpaceService.selectBasCargoSpaceByWmsCargoSpaceId(mydoJob.getCargoSpaceId());
|
||||
if (ObjUtil.isNull(basCargoSpace)) {
|
||||
log.error("货位不存在 cargoSpaceId{}", mydoJob.getCargoSpaceId());
|
||||
} else {
|
||||
//生成队列
|
||||
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();
|
||||
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_1);
|
||||
ddjDeviceExecutionQueueService.insertDdjDeviceExecutionQueue(ddjDeviceExecutionQueue);
|
||||
|
||||
//修改作业状态
|
||||
mydoJob.setStatus(TASK_STATUS_RUNNING);
|
||||
mydoJob.setExecutionPhase(TASK_EP_DDJ);
|
||||
mydoJob.setStartTime(DateUtil.formatDateTime(DateUtil.date()));
|
||||
mydoJobService.updateMydoJob(mydoJob);
|
||||
}
|
||||
}
|
||||
}else{
|
||||
log.info("当前出口"+ exitId+"存在入库任务,无法出库!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,14 +18,13 @@ import com.ruoyi.schedule.plcRead.ssj.PlcSsjRead;
|
||||
import com.ruoyi.schedule.plcRead.util.Tools;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.text.SimpleDateFormat;
|
||||
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.deviceSsjMap;
|
||||
import static com.ruoyi.schedule.plcRead.ssj.PlcSsjRead.writeToSsj;
|
||||
import static com.ruoyi.schedule.plcRead.ssj.PlcSsjRead.*;
|
||||
|
||||
/**
|
||||
* 生产线输送机
|
||||
@@ -92,29 +91,31 @@ public class LineSsjThread implements Runnable {
|
||||
|
||||
public void inDispatch(DeviceSsj SsjDevice) {
|
||||
//如果到位,扫到条码,托盘大小,执行阶段卡控一下(下发输送机后改执行阶段)
|
||||
if (SsjDevice.getDw() == 1 && StrUtil.isNotBlank(SsjDevice.getTrayCode()) && SsjDevice.getTraySize() != 0 && SsjDevice.getTaskNo() < 1000) {
|
||||
log.info("设备:{} 位置:{} 条码:{} 托盘大小:{}", SsjDevice.getDeviceCode(), "产线到位", SsjDevice.getTrayCode(), SsjDevice.getTraySize());
|
||||
if (SsjDevice.getRkqq() == 1 && StrUtil.isNotBlank(SsjDevice.getTrayCode())
|
||||
&& SsjDevice.getTraySize() != 0 && SsjDevice.getTaskNo() < 1000) {
|
||||
//log.info("设备:{} 位置:{} 条码:{} 托盘大小:{}", SsjDevice.getDeviceCode(), "产线到位", SsjDevice.getTrayCode(), SsjDevice.getTraySize());
|
||||
|
||||
//查作业,入如果已经有了,直接下发输送线
|
||||
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");
|
||||
mydoJob.setStatus("1");
|
||||
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);
|
||||
mydoJobService.updateMydoJob(mydoJob);
|
||||
log.info("G1005产线输送机下发任务号成功:" + mydoJob.getTaskNo());
|
||||
}
|
||||
int i = writeToSsj(SsjDevice.getPlcDbWriteAddress(), mydoJob.getTaskNo(), Integer.parseInt(mydoJob.getTraySize()), 1);
|
||||
if (i == 1) {
|
||||
mydoJob.setExecutionPhase(TASK_EP_LINE_SSJ);
|
||||
mydoJobService.updateMydoJob(mydoJob);
|
||||
log.info("G1005产线输送机下发任务号成功:" + mydoJob.getTaskNo());
|
||||
}
|
||||
} else {
|
||||
|
||||
//请求wms生成入库作业
|
||||
@@ -127,36 +128,38 @@ public class LineSsjThread implements Runnable {
|
||||
AjaxResult ajaxResult = apiService.createInMydoJob(paramMap);
|
||||
if (ajaxResult.isSuccess()) {
|
||||
//拿到正常作业,插到wcs作业表,下发给输送机任务号,覆盖任务号
|
||||
MydoJob mydoJob2 = BeanUtil.toBean(ajaxResult.get("data"), MydoJob.class) ;
|
||||
MydoJob mydoJob2 = BeanUtil.toBean(ajaxResult.get("data"), MydoJob.class);
|
||||
mydoJob2.setStatus("1");
|
||||
mydoJob2.setExecutionPhase(TASK_EP_CREATE);
|
||||
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);
|
||||
int i = writeToSsj(SsjDevice.getPlcDbWriteAddress(), mydoJob2.getTaskNo(), Integer.parseInt(mydoJob2.getTraySize()), 1);
|
||||
if (i == 1) {
|
||||
mydoJob2.setExecutionPhase(TASK_EP_LINE_SSJ);
|
||||
mydoJobService.updateMydoJob(mydoJob2);
|
||||
log.info("G1005产线输送机下发任务号成功:{}" , mydoJob2.getTaskNo());
|
||||
log.info("G1005产线输送机下发任务号成功:{}", mydoJob2.getTaskNo());
|
||||
}
|
||||
} else {
|
||||
//超大,给plc下发错误信息,等待人工处理
|
||||
//托盘大小对不上,给plc下发错误信息,等待人工处理
|
||||
//码不对,给plc下发错误信息,等待人工处理
|
||||
int i = writeToSsj(SsjDevice.getPlcDbWriteAddress(), "0", Integer.parseInt(ajaxResult.get("code").toString()), 2);
|
||||
if (i == 1) {
|
||||
log.info("G1005产线输送机下发错误信息成功");
|
||||
}
|
||||
//7是报工单失败,不处理
|
||||
if(!"7".equals(Integer.parseInt(ajaxResult.get("code").toString()))){
|
||||
createMoveToPort(SsjDevice);
|
||||
}
|
||||
/**
|
||||
* 1, "二维码内容错误!"
|
||||
* 2,"该序列号已有作业或库存!"
|
||||
* 3, "物料不存在!"
|
||||
* 4, "入口与托盘尺寸对应错误!"
|
||||
* 5, "超大托盘!"
|
||||
* 6, "托盘大小不匹配!"
|
||||
* 7, "巷道入库锁定!"
|
||||
* 8, "没有可用货位!"
|
||||
* 9, "创建工艺入库单失败!"
|
||||
*/
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (SsjDevice.getDw() == 1 && StrUtil.isBlank(SsjDevice.getTrayCode()) && SsjDevice.getTraySize() != 0 && SsjDevice.getTaskNo() < 1000) {
|
||||
|
||||
log.info("设备:{} 位置:{} 条码:{} 托盘大小:{}", SsjDevice.getDeviceCode(), "产线", SsjDevice.getTrayCode(), SsjDevice.getTraySize());
|
||||
if (SsjDevice.getRkqq() == 1 && StrUtil.isBlank(SsjDevice.getTrayCode()) &&
|
||||
SsjDevice.getTraySize() != 0 && SsjDevice.getTaskNo() < 1000) {
|
||||
//查wcs有没作业,有下发给输送机任务号,覆盖任务号
|
||||
MydoJob mydoJob = new MydoJob();
|
||||
mydoJob.setInOrOut("1");
|
||||
@@ -167,12 +170,11 @@ 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);
|
||||
mydoJobService.updateMydoJob(mydoJob);
|
||||
log.info("G1005产线输送机下发任务号成功:" + mydoJob.getTaskNo());
|
||||
int i = writeToSsj(SsjDevice.getPlcDbWriteAddress(), mydoJob.getTaskNo(), 1, 1);
|
||||
if (i == 1) {
|
||||
mydoJob.setExecutionPhase(TASK_EP_LINE_SSJ);
|
||||
mydoJobService.updateMydoJob(mydoJob);
|
||||
log.info("G1005产线输送机下发任务号成功:" + mydoJob.getTaskNo());
|
||||
|
||||
}
|
||||
} else {
|
||||
@@ -183,28 +185,26 @@ public class LineSsjThread implements Runnable {
|
||||
AjaxResult ajaxResult = apiService.selectMydoJobByNoTrayCode(paramMap);
|
||||
if (ajaxResult.isSuccess()) {
|
||||
MydoJob mydoJob2 = BeanUtil.toBean(ajaxResult.get("data"), MydoJob.class);
|
||||
mydoJob2.setStatus("1");
|
||||
mydoJob2.setExecutionPhase("0");
|
||||
mydoJob2.setCreateTime(new Date());
|
||||
mydoJobService.insertMydoJob(mydoJob2);
|
||||
int i = writeToSsj(SsjDevice.getPlcDbWriteAddress(),mydoJob2.getTaskNo(),1,1);
|
||||
if (i == 1) {
|
||||
mydoJob2.setExecutionPhase(TASK_EP_LINE_SSJ);
|
||||
mydoJobService.updateMydoJob(mydoJob2);
|
||||
log.info("G1005产线输送机下发任务号成功:" + mydoJob2.getTaskNo());
|
||||
if (mydoJob2 != null) {
|
||||
mydoJob2.setStatus("1");
|
||||
mydoJob2.setExecutionPhase("0");
|
||||
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) {
|
||||
mydoJob2.setExecutionPhase(TASK_EP_LINE_SSJ);
|
||||
mydoJobService.updateMydoJob(mydoJob2);
|
||||
log.info("G1005产线输送机下发任务号成功:" + mydoJob2.getTaskNo());
|
||||
}
|
||||
}
|
||||
|
||||
} else if (ajaxResult.isError()) {
|
||||
//超大,给plc下发错误信息,等待人工处理
|
||||
//托盘大小对不上,给plc下发错误信息,等待人工处理
|
||||
//码不对,给plc下发错误信息,等待人工处理
|
||||
int i = writeToSsj(SsjDevice.getPlcDbWriteAddress(), "0", Integer.parseInt(ajaxResult.get("code").toString()), 2);
|
||||
if (i == 1) {
|
||||
log.info("G1005产线输送机下发错误信息成功");
|
||||
}
|
||||
//7是报工单失败,不处理
|
||||
if(!"7".equals(Integer.parseInt(ajaxResult.get("code").toString()))){
|
||||
createMoveToPort(SsjDevice);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -212,12 +212,12 @@ public class LineSsjThread implements Runnable {
|
||||
|
||||
if (SsjDevice.getDw() == 1 && SsjDevice.getTaskNo() > 1000) {
|
||||
|
||||
log.info("设备:{} 位置:{} 条码:{} 托盘大小:{}", SsjDevice.getDeviceCode(), "产线收到wcs任务号", SsjDevice.getTrayCode(), SsjDevice.getTraySize());
|
||||
//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 {
|
||||
@@ -234,24 +234,27 @@ public class LineSsjThread implements Runnable {
|
||||
if (outMydoJobList.isEmpty() && kx == 1) {
|
||||
//查是否有队列,如果有了请求放货修改为允许放货
|
||||
AgvQueue agvQueue = agvQueueService.selectAgvQueueByTaskCode(mydoJob.getJobId());
|
||||
if (agvQueue != null){
|
||||
if ("3".equals(mydoJob.getStatus()) && "1".equals(agvQueue.getStatus())){
|
||||
if (agvQueue != null) {
|
||||
if ("3".equals(mydoJob.getStatus()) && "2".equals(agvQueue.getStatus()) && SsjDevice.getAllowPut() == 1) {
|
||||
AjaxResult ajaxResult = apiService.continueTask(agvQueue);
|
||||
if (ajaxResult.isSuccess()) {
|
||||
log.info("给agv下发允许取货继续任务成功"+agvQueue.getWmsTaskNo());
|
||||
log.info("给agv下发允许取货继续任务成功" + agvQueue.getWmsTaskNo());
|
||||
agvQueue.setStatus("2");
|
||||
agvQueueService.updateAgvQueue(agvQueue);
|
||||
}
|
||||
}
|
||||
}else {
|
||||
if ("1".equals(mydoJob.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("taskNo", mydoJob.getJobId());
|
||||
paramMap.put("trayCode", mydoJob.getTrayCode());
|
||||
paramMap.put("taskCode", mydoJob.getJobId());
|
||||
//todo 与agv对点
|
||||
paramMap.put("startPoint", "G1005");
|
||||
paramMap.put("endPoint", deviceCode);
|
||||
paramMap.put("traySize",String.valueOf(SsjDevice.getTraySize()));
|
||||
paramMap.put("traySize", mydoJob.getTraySize());
|
||||
paramMap.put("wmsTaskNo", mydoJob.getTaskNo());
|
||||
AjaxResult ajaxResult = apiService.receiveAgvMoveJob(paramMap);
|
||||
if (ajaxResult.isSuccess()) {
|
||||
@@ -262,51 +265,76 @@ public class LineSsjThread implements Runnable {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
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)));
|
||||
|
||||
if(hasMatchingPort==false){
|
||||
|
||||
if(!wcsPorts.isEmpty()){
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
// map.put("trayCode", mydoJob.getTrayCode());
|
||||
map.put("taskNo", StrUtil.uuid());
|
||||
if (SsjDevice.getDw() == 1 && SsjDevice.getTaskNo() == 2222 && SsjDevice.getTraySize() == 4) {
|
||||
AgvQueue agvQueue = agvQueueService.selectAgvQueueByWmsTask(SsjDevice.getTaskNo());
|
||||
if (agvQueue != null) {
|
||||
if ("2".equals(agvQueue.getStatus()) && SsjDevice.getAllowPut() == 1) {
|
||||
AjaxResult ajaxResult = apiService.continueTask(agvQueue);
|
||||
if (ajaxResult.isSuccess()) {
|
||||
log.info("给agv下发允许取货继续任务成功" + agvQueue.getWmsTaskNo());
|
||||
agvQueue.setStatus("2");
|
||||
agvQueueService.updateAgvQueue(agvQueue);
|
||||
}
|
||||
}
|
||||
if ("0".equals(agvQueue.getStatus())) {
|
||||
apiService.requestAgvQueue(agvQueue);
|
||||
}
|
||||
} else {
|
||||
HashMap<String, String> paramMap = new HashMap<>();
|
||||
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);
|
||||
//todo 与agv对点
|
||||
map.put("startPoint", "G1005");
|
||||
map.put("endPoint", wcsPorts.get(0).getPortCode());
|
||||
map.put("traySize",String.valueOf(SsjDevice.getTraySize()));
|
||||
// map.put("wmsTaskNo", mydoJob.getTaskNo());
|
||||
AjaxResult ajaxResult1 = apiService.receiveAgvMoveJob(map);
|
||||
if(ajaxResult1.isSuccess()){
|
||||
log.info("G1005产线生成作业失败,AGV下发搬运至缓存点任务成功:{}" , ajaxResult1.get("data"));
|
||||
|
||||
paramMap.put("startPoint", "G1005");
|
||||
paramMap.put("endPoint", "");
|
||||
paramMap.put("traySize", "5");
|
||||
paramMap.put("wmsTaskNo", "2222");
|
||||
AjaxResult ajaxResult = apiService.receiveAgvMoveJob(paramMap);
|
||||
if (ajaxResult.isSuccess()) {
|
||||
log.info("G1005超大托盘下发AGV搬运成功!");
|
||||
}
|
||||
}
|
||||
}
|
||||
if (SsjDevice.getDw() == 0 && SsjDevice.getTaskNo() > 1000 && SsjDevice.getTraySize() > 0) {
|
||||
AgvQueue agvQueue = agvQueueService.selectAgvQueueByWmsTask(SsjDevice.getTaskNo());
|
||||
if (agvQueue != null) {
|
||||
if ("4".equals(agvQueue.getStatus())) {
|
||||
int i = writeToSsjQH("DB802.122", 1);
|
||||
if (i == 1) {
|
||||
log.info("G1005产线输送机下发取货完成成功!");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,9 +6,13 @@ 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;;encrypt=true;trustServerCertificate=true;
|
||||
# username: sa
|
||||
# password: www.123.com
|
||||
|
||||
# 从库数据源
|
||||
slave:
|
||||
# 从数据源开关/默认关闭
|
||||
|
||||
@@ -16,7 +16,7 @@ ruoyi:
|
||||
# 开发环境配置
|
||||
server:
|
||||
# 服务器的HTTP端口,默认为8080
|
||||
port: 8081
|
||||
port: 8084
|
||||
servlet:
|
||||
# 应用的访问路径
|
||||
context-path: /
|
||||
@@ -68,11 +68,12 @@ spring:
|
||||
# redis 配置
|
||||
redis:
|
||||
# 地址
|
||||
host: 172.16.2.170
|
||||
# host: 192.168.58.10
|
||||
host: 172.16.4.12
|
||||
# 端口,默认为6379
|
||||
port: 6379
|
||||
# 数据库索引
|
||||
database: 1
|
||||
database: 2
|
||||
# 密码
|
||||
password: 123456
|
||||
# 连接超时时间
|
||||
@@ -95,7 +96,7 @@ token:
|
||||
# 令牌密钥
|
||||
secret: abcdefghijklmnopqrstuvwxyz
|
||||
# 令牌有效期(默认30分钟)
|
||||
expireTime: 30
|
||||
expireTime: 10080
|
||||
|
||||
# MyBatis配置
|
||||
mybatis:
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.bas.sysDateConfig.mapper.SysDateConfigMapper">
|
||||
|
||||
<resultMap type="SysDateConfig" id="SysDateConfigResult">
|
||||
<result property="configId" column="config_id" />
|
||||
<result property="sysDate" column="sys_date" />
|
||||
</resultMap>
|
||||
|
||||
<select id="getMsgById" parameterType="java.lang.String" resultType="SysDateConfig">
|
||||
select * from sys_date_config where config_id=#{configId}
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -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}
|
||||
@@ -62,6 +67,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
where task_code = #{taskCode}
|
||||
</select>
|
||||
|
||||
<select id="selectAgvQueueByWmsTask" parameterType="Integer" resultMap="AgvQueueResult">
|
||||
<include refid="selectAgvQueueVo"/>
|
||||
where wms_task_no = #{wmsTaskNo}
|
||||
</select>
|
||||
|
||||
<insert id="insertAgvQueue" parameterType="AgvQueue">
|
||||
insert into agv_queue
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
|
||||
@@ -6,8 +6,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
|
||||
<resultMap type="DeviceSsj" id="DeviceSsjResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="deviceCode " column="device_code " />
|
||||
<result property="name " column="name " />
|
||||
<result property="deviceCode" column="device_code" />
|
||||
<result property="name" column="name" />
|
||||
<result property="type" column="type" />
|
||||
<result property="ipAddress" column="ip_address" />
|
||||
<result property="plcDbReadAddress" column="plc_db_read_address" />
|
||||
@@ -24,11 +24,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="allowPut" column="allow_put" />
|
||||
<result property="ipAddress" column="ip_address" />
|
||||
<result property="port" column="port" />
|
||||
<result property="sszt" column="sszt" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectDeviceSsjVo">
|
||||
select id, device_code , name , type, plc_db_read_address, is_active, create_time, plc_db_write_address,
|
||||
rkqq, kx, dw, tray_code, task_no,exception,tray_size,allow_put,ip_address , port from device_ssj
|
||||
rkqq, kx, dw, tray_code, task_no,exception,tray_size,allow_put,ip_address , port, sszt
|
||||
from device_ssj
|
||||
</sql>
|
||||
|
||||
<select id="selectDeviceSsjList" parameterType="DeviceSsj" resultMap="DeviceSsjResult">
|
||||
@@ -103,6 +105,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="exception != null">exception = #{exception},</if>
|
||||
<if test="traySize != null">tray_size = #{traySize},</if>
|
||||
<if test="allowPut != null">allow_put = #{allowPut},</if>
|
||||
<if test="sszt != null">sszt = #{sszt},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
@@ -38,12 +38,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="requestHeaders != null and requestHeaders != ''"> and request_headers = #{requestHeaders}</if>
|
||||
<if test="requestBody != null and requestBody != ''"> and request_body like concat('%',#{requestBody},'%') </if>
|
||||
<if test="responseTime != null and responseTime != ''"> and response_time = #{responseTime}</if>
|
||||
<if test="responseBody != null and responseBody != ''"> and response_body = #{responseBody}</if>
|
||||
<if test="responseBody != null and responseBody != ''"> and response_body like concat('%',#{responseBody},'%')</if>
|
||||
<if test="responseStatus != null and responseStatus != ''"> and response_status = #{responseStatus}</if>
|
||||
<if test="errorDetails != null and errorDetails != ''"> and error_details = #{errorDetails}</if>
|
||||
<if test="errorDetails != null and errorDetails != ''"> and error_details like concat('%',#{errorDetails},'%')</if>
|
||||
<if test="duration != null and duration != ''"> and duration = #{duration}</if>
|
||||
<if test="isSuccessful != null and isSuccessful != ''"> and Is_successful = #{isSuccessful}</if>
|
||||
</where>
|
||||
order by request_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectRequestLogByRequestId" parameterType="Long" resultMap="RequestLogResult">
|
||||
|
||||
@@ -91,4 +91,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="getTopJobCallBack" resultMap="JobCallBackResult">
|
||||
select top(1) id, type, task_no, mydojob_id, status, create_time, spare1, spare2, spare3 from job_call_back
|
||||
where status = '0' and spare1 in ('0','1','2')
|
||||
order by create_time asc
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -24,13 +24,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="faultFlag" column="fault_flag" />
|
||||
<result property="flag" column="flag" />
|
||||
<result property="trayCode" column="tray_code" />
|
||||
<result property="traySize" column="tray_size" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectMydoJobVo">
|
||||
select job_id, status, task_no, roadway_id, cargo_space_id, target_roadway_id, target_cargo_space_id, priority, execution_phase, in_or_out, create_time, start_time, finish_time, entrance_id, exit_id, warehouse_id, fault_flag,flag,tray_code from mydo_job_wcs
|
||||
select job_id, status, task_no, roadway_id, cargo_space_id, target_roadway_id, target_cargo_space_id, priority, execution_phase, in_or_out, create_time, start_time, finish_time, entrance_id, exit_id, warehouse_id, fault_flag,flag,tray_code,tray_size from mydo_job_wcs
|
||||
</sql>
|
||||
<sql id="selectMydoJobFinishVo">
|
||||
select job_id, status, task_no, roadway_id, cargo_space_id, target_roadway_id, target_cargo_space_id, priority, execution_phase, in_or_out, create_time, start_time, finish_time, entrance_id, exit_id, warehouse_id, fault_flag,flag,tray_code from mydo_job_wcs_finish
|
||||
select job_id, status, task_no, roadway_id, cargo_space_id, target_roadway_id, target_cargo_space_id, priority, execution_phase, in_or_out, create_time, start_time, finish_time, entrance_id, exit_id, warehouse_id, fault_flag,flag,tray_code,tray_size from mydo_job_wcs_finish
|
||||
</sql>
|
||||
|
||||
<select id="selectMydoJobList" parameterType="MydoJob" resultMap="MydoJobResult">
|
||||
@@ -55,7 +56,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="warehouseId != null and warehouseId != ''">and warehouse_id = #{warehouseId}</if>
|
||||
<if test="faultFlag != null and faultFlag != ''">and fault_flag = #{faultFlag}</if>
|
||||
<if test="flag != null and flag != ''">and flag = #{flag}</if>
|
||||
<if test="trayCode != null and trayCode != ''">and trayCode = #{tray_code}</if>
|
||||
<if test="trayCode != null and trayCode != ''">and tray_code = #{trayCode}</if>
|
||||
<if test="traySize != null and traySize != ''">and traySize = #{tray_size}</if>
|
||||
<if test="epList != null and epList.size() > 0">
|
||||
and entrance_id in
|
||||
<foreach item="item" index="index" collection="epList" separator="," open="(" close=")">
|
||||
@@ -70,10 +72,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
where job_id = #{jobId}
|
||||
</select>
|
||||
|
||||
<select id="selectMydoJobByTaskNo" parameterType="String" resultMap="MydoJobResult">
|
||||
<include refid="selectMydoJobVo"/>
|
||||
where task_no = #{taskNo}
|
||||
<select id="selectJobByTaskNo" parameterType="String" resultMap="MydoJobResult">
|
||||
select job_id, a.status, task_no, a.roadway_id, b.cargo_space_name as 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, a.warehouse_id, fault_flag,
|
||||
flag,a.tray_code,tray_size
|
||||
from mydo_job_wcs a,bas_cargo_space b
|
||||
where a.cargo_space_id = b.cargo_space_id
|
||||
and task_no = #{taskNo}
|
||||
</select>
|
||||
|
||||
<select id="selectMydoJobByTaskNo" parameterType="String" resultMap="MydoJobResult">
|
||||
<include refid="selectMydoJobVo"/>
|
||||
where task_no = #{taskNo}
|
||||
</select>
|
||||
|
||||
<select id="ddjTaskFinish" parameterType="java.util.Map" statementType="CALLABLE">
|
||||
{call proc_mydojob_finish(
|
||||
#{v_rwh,mode=IN,jdbcType=INTEGER},
|
||||
@@ -91,14 +104,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
)}
|
||||
</select>
|
||||
<select id="selectMydoJobByExitList" resultMap="MydoJobResult">
|
||||
select TOP 1 job_id, status, task_no, roadway_id, cargo_space_id, target_roadway_id, target_cargo_space_id, priority, execution_phase, in_or_out, create_time, start_time, finish_time, entrance_id, exit_id, warehouse_id, fault_flag,flag,tray_code from mydo_job_wcs
|
||||
select TOP 1 job_id, status, task_no, roadway_id, cargo_space_id, target_roadway_id, target_cargo_space_id, priority, execution_phase, in_or_out, create_time, start_time, finish_time, entrance_id, exit_id, warehouse_id, fault_flag,flag,tray_code,tray_size from mydo_job_wcs
|
||||
where exit_id in
|
||||
<foreach item="item" index="index" collection="exitList" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
and in_or_out > 20
|
||||
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">
|
||||
@@ -123,6 +145,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="faultFlag != null">fault_flag,</if>
|
||||
<if test="flag != null">flag,</if>
|
||||
<if test="trayCode != null">tray_code,</if>
|
||||
<if test="traySize != null">tray_size,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="jobId != null">#{jobId},</if>
|
||||
@@ -144,6 +167,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="faultFlag != null">#{faultFlag},</if>
|
||||
<if test="flag != null">#{flag},</if>
|
||||
<if test="trayCode != null">#{trayCode},</if>
|
||||
<if test="traySize != null">#{traySize},</if>
|
||||
|
||||
</trim>
|
||||
</insert>
|
||||
@@ -173,6 +197,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="faultFlag != null">fault_flag = #{faultFlag},</if>
|
||||
<if test="flag != null">flag = #{flag},</if>
|
||||
<if test="trayCode != null">tray_code = #{trayCode},</if>
|
||||
<if test="traySize != null">tray_size = #{traySize},</if>
|
||||
</trim>
|
||||
where job_id = #{jobId}
|
||||
</update>
|
||||
@@ -211,6 +236,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="jobId != null and jobId != ''"> and job_id = #{jobId}</if>
|
||||
<if test="flag != null and flag != ''"> and flag = #{flag}</if>
|
||||
<if test="trayCode != null and trayCode != ''"> and tray_code = #{trayCode}</if>
|
||||
<if test="traySize != null and traySize != ''"> and tray_size = #{traySize}</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="selectMydoJobByEntranceList" resultMap="MydoJobResult">
|
||||
@@ -220,8 +246,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>
|
||||
@@ -242,16 +291,48 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="faultFlag != null and faultFlag != ''"> and fault_flag = #{faultFlag}</if>
|
||||
<if test="flag != null and flag != ''"> and flag = #{flag}</if>
|
||||
<if test="trayCode != null and trayCode != ''"> and tray_code = #{trayCode}</if>
|
||||
<if test="traySize != null and traySize != ''"> and tray_size = #{traySize}</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="selectRunningMydoJobByExitList" resultMap="MydoJobResult">
|
||||
select TOP 1 job_id, status, task_no, roadway_id, cargo_space_id, target_roadway_id, target_cargo_space_id, priority, execution_phase, in_or_out, create_time, start_time, finish_time, entrance_id, exit_id, warehouse_id, fault_flag,flag, from mydo_job_wcs
|
||||
select TOP 1 job_id, status, task_no, roadway_id, cargo_space_id, target_roadway_id, target_cargo_space_id, priority, execution_phase, in_or_out, create_time, start_time, finish_time, entrance_id, exit_id, warehouse_id, fault_flag,flag,tray_size,tray_code from mydo_job_wcs
|
||||
where exit_id in
|
||||
<foreach item="item" index="index" collection="exitList" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
and in_or_out > 20
|
||||
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">
|
||||
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_size,tray_code from mydo_job_wcs
|
||||
where entrance_id in
|
||||
<foreach item="item" index="index" collection="exitList" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
and in_or_out < 20
|
||||
and status in (1,3)
|
||||
</select>
|
||||
|
||||
<select id="getJobById" parameterType="java.lang.String" resultMap="MydoJobResult">
|
||||
select * from mydo_job_wcs where job_id=#{jobId}
|
||||
</select>
|
||||
|
||||
<select id="confirmOutJob" parameterType="java.util.Map" statementType="CALLABLE">
|
||||
{call proc_add_mydojob_hand(
|
||||
#{v_the_platoon,mode=IN,jdbcType=VARCHAR},
|
||||
#{v_the_column,mode=IN,jdbcType=VARCHAR},
|
||||
#{v_the_floor,mode=IN,jdbcType=VARCHAR},
|
||||
#{v_exit_id,mode=IN,jdbcType=VARCHAR},
|
||||
#{v_result,mode=OUT,jdbcType=INTEGER},
|
||||
#{v_resultMsg,mode=OUT,jdbcType=VARCHAR}
|
||||
)}
|
||||
</select>
|
||||
|
||||
<select id="getInJobByRoadAndFloor" parameterType="java.lang.String" resultMap="MydoJobResult">
|
||||
select * from mydo_job_wcs where in_or_out < 20 and entrance_id=#{entranceId} and roadway_id=#{roadwayId}
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -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>
|
||||
@@ -158,4 +159,56 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
#{uuid}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<insert id="insertFinish" parameterType="DdjDeviceExecutionQueue">
|
||||
insert into ddj_device_execution_queue_finish
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="uuid != null">uuid,</if>
|
||||
<if test="rwh != null">rwh,</if>
|
||||
<if test="devName != null and devName != ''">dev_name,</if>
|
||||
<if test="devId != null">dev_id,</if>
|
||||
<if test="rwzt != null">rwzt,</if>
|
||||
<if test="yph != null">yph,</if>
|
||||
<if test="ylh != null">ylh,</if>
|
||||
<if test="ych != null">ych,</if>
|
||||
<if test="mbph != null">mbph,</if>
|
||||
<if test="mblh != null">mblh,</if>
|
||||
<if test="mbch != null">mbch,</if>
|
||||
<if test="ddjxf != null">ddjxf,</if>
|
||||
<if test="rwlx != null">rwlx,</if>
|
||||
<if test="scsj != null">scsj,</if>
|
||||
<if test="xfsj != null">xfsj,</if>
|
||||
<if test="jssj != null">jssj,</if>
|
||||
<if test="mlfs != null">mlfs,</if>
|
||||
<if test="spare1 != null">spare1,</if>
|
||||
<if test="spare2 != null">spare2,</if>
|
||||
<if test="spare3 != null">spare3,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="uuid != null">#{uuid},</if>
|
||||
<if test="rwh != null">#{rwh},</if>
|
||||
<if test="devName != null and devName != ''">#{devName},</if>
|
||||
<if test="devId != null">#{devId},</if>
|
||||
<if test="rwzt != null">#{rwzt},</if>
|
||||
<if test="yph != null">#{yph},</if>
|
||||
<if test="ylh != null">#{ylh},</if>
|
||||
<if test="ych != null">#{ych},</if>
|
||||
<if test="mbph != null">#{mbph},</if>
|
||||
<if test="mblh != null">#{mblh},</if>
|
||||
<if test="mbch != null">#{mbch},</if>
|
||||
<if test="ddjxf != null">#{ddjxf},</if>
|
||||
<if test="rwlx != null">#{rwlx},</if>
|
||||
<if test="scsj != null">#{scsj},</if>
|
||||
<if test="xfsj != null">#{xfsj},</if>
|
||||
<if test="jssj != null">#{jssj},</if>
|
||||
<if test="mlfs != null">#{mlfs},</if>
|
||||
<if test="spare1 != null">#{spare1},</if>
|
||||
<if test="spare2 != null">#{spare2},</if>
|
||||
<if test="spare3 != null">#{spare3},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<delete id="deleteQueue" parameterType="DdjDeviceExecutionQueue">
|
||||
delete from ddj_device_execution_queue where uuid = #{uuid}
|
||||
</delete>
|
||||
</mapper>
|
||||
|
||||
@@ -51,3 +51,21 @@ export function delMydoJob(jobId) {
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
export function handFinish(jobIds) {
|
||||
return request({
|
||||
url: '/job/mydoJob/OuthandFinish',
|
||||
method: 'get',
|
||||
params: { jobIds: jobIds }
|
||||
})
|
||||
}
|
||||
|
||||
export function confirmOut(thePlatoon,theColumn,theFloor,exitId) {
|
||||
return request({
|
||||
url: '/job/mydoJob/confirmOut',
|
||||
method: 'post',
|
||||
params: { thePlatoon: thePlatoon, theColumn:theColumn,theFloor:theFloor,exitId:exitId}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -49,4 +49,5 @@ export function delDdj(uuid) {
|
||||
url: '/queue/ddj/' + uuid,
|
||||
method: 'delete'
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
@@ -7,17 +7,17 @@
|
||||
|
||||
<div class="right-menu">
|
||||
<template v-if="device!=='mobile'">
|
||||
<el-tooltip :content="$t('top.read')" effect="dark" placement="bottom">
|
||||
<el-button class="right-menu-item hover-effect" :type="plcReadStatus ? 'success' : 'info'" size="mini" @click="togglePlcRead">
|
||||
{{ plcReadStatus ? $t('top.stopRead') : $t('top.startRead') }}
|
||||
</el-button>
|
||||
</el-tooltip>
|
||||
<!-- <el-tooltip :content="$t('top.read')" effect="dark" placement="bottom">-->
|
||||
<!-- <el-button class="right-menu-item hover-effect" :type="plcReadStatus ? 'success' : 'info'" size="mini" @click="togglePlcRead">-->
|
||||
<!-- {{ plcReadStatus ? $t('top.stopRead') : $t('top.startRead') }}-->
|
||||
<!-- </el-button>-->
|
||||
<!-- </el-tooltip>-->
|
||||
|
||||
<el-tooltip :content="$t('top.task')" effect="dark" placement="bottom">
|
||||
<el-button class="right-menu-item hover-effect" :type="plcScheduleStatus ? 'success' : 'info'" size="mini" @click="togglePlcSchedule">
|
||||
{{ plcScheduleStatus ? $t('top.stopTask') : $t('top.startTask') }}
|
||||
</el-button>
|
||||
</el-tooltip>
|
||||
<!-- <el-tooltip :content="$t('top.task')" effect="dark" placement="bottom">-->
|
||||
<!-- <el-button class="right-menu-item hover-effect" :type="plcScheduleStatus ? 'success' : 'info'" size="mini" @click="togglePlcSchedule">-->
|
||||
<!-- {{ plcScheduleStatus ? $t('top.stopTask') : $t('top.startTask') }}-->
|
||||
<!-- </el-button>-->
|
||||
<!-- </el-tooltip>-->
|
||||
|
||||
|
||||
<search id="header-search" class="right-menu-item" />
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -1,6 +1,16 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="接口类型" prop="endpoint">
|
||||
<el-select v-model="queryParams.endpoint" placeholder="请选择接口类型" clearable>
|
||||
<el-option
|
||||
v-for="dict in dict.type.interface_endpoint"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="请求参数" prop="requestBody">
|
||||
<el-input
|
||||
v-model="queryParams.requestBody"
|
||||
@@ -88,10 +98,10 @@
|
||||
<el-table-column label="接口名称" align="left" prop="endpoint" />
|
||||
<el-table-column label="url路径" align="left" prop="requestUrl" />
|
||||
<el-table-column label="请求方式" align="left" prop="requestMethod" />
|
||||
<el-table-column label="请求头信息" align="left" prop="requestHeaders" />
|
||||
<el-table-column label="请求参数" align="left" prop="requestBody" />
|
||||
<el-table-column label="请求头信息" align="left" prop="requestHeaders"/>
|
||||
<el-table-column label="请求参数" align="left" prop="requestBody" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="响应时间" align="left" prop="responseTime" />
|
||||
<el-table-column label="响应主体" align="left" prop="responseBody" />
|
||||
<el-table-column label="响应主体" align="left" prop="responseBody" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="响应状态" align="left" prop="responseStatus" />
|
||||
<el-table-column label="错误信息" align="left" prop="errorDetails" />
|
||||
<el-table-column label="耗时" align="left" prop="duration" />
|
||||
@@ -100,7 +110,7 @@
|
||||
<dict-tag :options="dict.type.interface_status" :value="scope.row.isSuccessful"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
@@ -168,7 +178,7 @@ import { listApi, getApi, delApi, addApi, updateApi } from "@/api/device/api"
|
||||
|
||||
export default {
|
||||
name: "Api",
|
||||
dicts: ['interface_status'],
|
||||
dicts: ['interface_status','interface_endpoint'],
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
|
||||
@@ -64,6 +64,11 @@
|
||||
<el-table-column label="设备编码" prop="deviceCode"/>
|
||||
<!-- <el-table-column label="设备名称" prop="name"/>-->
|
||||
<el-table-column label="任务号" prop="taskNo"/>
|
||||
<el-table-column label="请求" prop="rkqq">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.ssj_rkqq" :value="scope.row.rkqq"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="到位" prop="dw">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.ssj_dw" :value="scope.row.dw"/>
|
||||
@@ -74,9 +79,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="traySize" >
|
||||
@@ -111,9 +116,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" >
|
||||
@@ -146,9 +151,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,25 +163,25 @@
|
||||
</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 :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>
|
||||
@@ -204,9 +209,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 +242,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 +273,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 +296,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 {
|
||||
// 查询参数
|
||||
@@ -315,7 +320,7 @@ export default {
|
||||
this.initMockData()
|
||||
},
|
||||
mounted() {
|
||||
this.timer = setInterval(() => {x
|
||||
this.timer = setInterval(() => {
|
||||
this.initMockData();
|
||||
}, 1000); // 每1秒刷新一次
|
||||
},
|
||||
|
||||
@@ -35,56 +35,60 @@
|
||||
</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="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['job:callBack: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:callBack: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:callBack: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:callBack:export']"
|
||||
>导出
|
||||
</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="jobCallBackList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center"/>
|
||||
<el-table-column label="主键" align="center" prop="id"/>
|
||||
<el-table-column label="作业ID" align="center" prop="jobId"/>
|
||||
<el-table-column label="作业ID" align="center" prop="mydojobId"/>
|
||||
<el-table-column label="任务号" align="center" prop="taskNo"/>
|
||||
<el-table-column label="任务类型" align="center" prop="type">
|
||||
<template slot-scope="scope">
|
||||
@@ -96,7 +100,7 @@
|
||||
<dict-tag :options="dict.type.call_status" :value="scope.row.status"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" align="center" prop="startTime"/>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime"/>
|
||||
<el-table-column label="失败次数" align="center" prop="spare1"/>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
@@ -132,25 +136,29 @@
|
||||
<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="id">
|
||||
<el-input v-model="form.id" placeholder="请输入主键" disabled/>
|
||||
<el-input v-model="form.id" placeholder="请输入主键" style="width: 240px" disabled/>
|
||||
</el-form-item>
|
||||
<el-form-item label="作业ID" prop="jobId">
|
||||
<el-input v-model="form.jobId" placeholder="请输入作业ID"/>
|
||||
<el-input v-model="form.mydojobId" placeholder="请输入作业ID" style="width: 240px"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="任务号" prop="taskNo">
|
||||
<el-input v-model="form.taskNo" placeholder="请输入任务号"/>
|
||||
<el-input v-model="form.taskNo" placeholder="请输入任务号" style="width: 240px"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="任务类型" prop="type">
|
||||
<el-input v-model="form.type" placeholder="请输入任务类型"/>
|
||||
<el-select v-model="form.type" placeholder="请选择任务类型" style="width: 240px">
|
||||
<el-option v-for="dict in dict.type.job_type" :key="dict.value" :label="dict.label" :value="dict.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="回传状态" prop="status">
|
||||
<el-input v-model="form.status" placeholder="请输入回传状态"/>
|
||||
<el-select v-model="form.status" placeholder="请选择回传状态" style="width: 240px">
|
||||
<el-option v-for="dict in dict.type.call_status" :key="dict.value" :label="dict.label" :value="dict.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间" prop="createTime">
|
||||
<el-input v-model="form.createTime" placeholder="请输入创建时间"/>
|
||||
<el-date-picker v-model="form.createTime" style="width: 240px" type="datetime" value-format="yyyy-MM-dd HH:mm:ss" placeholder="请输入创建时间"></el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="失败次数" prop="spare1">
|
||||
<el-input v-model="form.spare1" placeholder="请输入失败次数"/>
|
||||
<el-input v-model="form.spare1" style="width: 240px" placeholder="请输入失败次数"/>
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
|
||||
@@ -19,161 +19,54 @@
|
||||
/>
|
||||
</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="cargoSpaceId">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.cargoSpaceId"-->
|
||||
<!-- placeholder="请输入货位ID"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="去向" prop="targetRoadwayId">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.targetRoadwayId"-->
|
||||
<!-- placeholder="请输入去向"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="目标货位ID" prop="targetCargoSpaceId">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.targetCargoSpaceId"-->
|
||||
<!-- placeholder="请输入目标货位ID"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="优先级" prop="priority">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.priority"-->
|
||||
<!-- placeholder="请输入优先级"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="执行阶段" prop="executionPhase">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.executionPhase"-->
|
||||
<!-- placeholder="请输入执行阶段"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="任务类型" prop="inOrOut">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.inOrOut"-->
|
||||
<!-- placeholder="请输入任务类型"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="开始时间" prop="startTime">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.startTime"-->
|
||||
<!-- placeholder="请输入开始时间"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="结束时间" prop="finishTime">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.finishTime"-->
|
||||
<!-- placeholder="请输入结束时间"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="入口ID" prop="entranceId">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.entranceId"-->
|
||||
<!-- placeholder="请输入入口ID"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="出口ID" prop="exitId">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.exitId"-->
|
||||
<!-- placeholder="请输入出口ID"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!--<!– <el-form-item label="仓库ID" prop="warehouseId">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.warehouseId"-->
|
||||
<!-- placeholder="请输入仓库ID"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="重分标志" prop="faultFlag">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.faultFlag"-->
|
||||
<!-- placeholder="请输入重分标志"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>–>-->
|
||||
<el-form-item label="巷道ID" prop="roadwayId">
|
||||
<el-input
|
||||
v-model="queryParams.roadwayId"
|
||||
placeholder="请输入巷道ID"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="货位-排" prop="thePlatoon">
|
||||
<el-input v-model="queryParams.thePlatoon" placeholder="请输入货位-排" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item label="货位-列" prop="theColumn">
|
||||
<el-input v-model="queryParams.theColumn" placeholder="请输入货位-列" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item label="货位-层" prop="theFloor">
|
||||
<el-input v-model="queryParams.theFloor" placeholder="请输入货位-层" clearable/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</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>
|
||||
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="confirmOut"
|
||||
v-hasPermi="['job:mydoJob:confirmOut']"
|
||||
>手动出库</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 +79,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,61 +122,67 @@
|
||||
/>
|
||||
|
||||
<!-- 添加或修改作业信息对话框 -->
|
||||
<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">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 出口选择弹窗 -->
|
||||
<el-dialog title="选择出口" :visible.sync="exitDialogVisible" width="400px" append-to-body>
|
||||
<el-form ref="exitForm" :model="exitForm" :rules="exitRules" label-width="80px">
|
||||
<el-form-item label="选择出口" prop="exitId">
|
||||
<el-select v-model="exitForm.exitId" placeholder="请选择出口" clearable>
|
||||
<el-option
|
||||
v-for="item in exitOptions"
|
||||
:key="item.exitId"
|
||||
:label="item.exitName"
|
||||
:value="item.exitId"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitPointOut">确定</el-button>
|
||||
<el-button @click="cancelExit">取消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {listMydoJob, getMydoJob, delMydoJob, addMydoJob, updateMydoJob, listMydoJobFinish} from "@/api/job/mydoJob"
|
||||
import {listMydoJob, getMydoJob, delMydoJob, addMydoJob, updateMydoJob, listMydoJobFinish,handFinish,confirmOut} from "@/api/job/mydoJob"
|
||||
|
||||
export default {
|
||||
name: "MydoJob",
|
||||
@@ -326,7 +225,11 @@ export default {
|
||||
entranceId: null,
|
||||
exitId: null,
|
||||
warehouseId: null,
|
||||
faultFlag: null
|
||||
faultFlag: null,
|
||||
trayCode: null,
|
||||
thePlatoon: null,
|
||||
theColumn: null,
|
||||
theFloor: null
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
@@ -338,7 +241,25 @@ export default {
|
||||
taskNo: [
|
||||
{ required: true, message: "任务号不能为空", trigger: "blur" }
|
||||
],
|
||||
}
|
||||
},
|
||||
// 出口选择弹窗显示状态
|
||||
exitDialogVisible: false,
|
||||
// 出口表单数据
|
||||
exitForm: {
|
||||
exitId: null
|
||||
},
|
||||
// 出口表单验证规则
|
||||
exitRules: {
|
||||
exitId: [
|
||||
{required: true, message: "请选择出口", trigger: 'change'}
|
||||
]
|
||||
},
|
||||
// 出口选项
|
||||
exitOptions: [
|
||||
{exitId: '1', exitName: '一楼'},
|
||||
{exitId: '2', exitName: '二楼'},
|
||||
|
||||
],
|
||||
}
|
||||
},
|
||||
created() {
|
||||
@@ -387,7 +308,8 @@ export default {
|
||||
entranceId: null,
|
||||
exitId: null,
|
||||
warehouseId: null,
|
||||
faultFlag: null
|
||||
faultFlag: null,
|
||||
trayCode: null
|
||||
}
|
||||
this.resetForm("form")
|
||||
},
|
||||
@@ -450,9 +372,63 @@ 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(() => {});
|
||||
},
|
||||
confirmOut() {
|
||||
this.loading = true
|
||||
var thePlatoon = this.queryParams.thePlatoon;
|
||||
var theColumn = this.queryParams.theColumn;
|
||||
var theFloor = this.queryParams.theFloor;
|
||||
// 显示出口选择弹窗
|
||||
this.exitDialogVisible = true;
|
||||
this.exitForm.exitId = null;
|
||||
|
||||
if (thePlatoon == null || theColumn == null || theFloor == null) {
|
||||
this.$modal.msgError("请输入货位排列层");
|
||||
return;
|
||||
}
|
||||
},
|
||||
/** 提交指定货位出库 */
|
||||
submitPointOut() {
|
||||
this.$refs["exitForm"].validate(valid => {
|
||||
if (valid) {
|
||||
var thePlatoon = this.queryParams.thePlatoon;
|
||||
var theColumn = this.queryParams.theColumn;
|
||||
var theFloor = this.queryParams.theFloor;
|
||||
|
||||
this.$modal.confirm('是否确认手动出库该货位?').then(() => {
|
||||
return confirmOut(thePlatoon,theColumn,theFloor,this.exitForm.exitId);
|
||||
}).then(() => {
|
||||
this.$modal.msgSuccess("手动出库成功");
|
||||
this.getList();
|
||||
this.exitDialogVisible = false;
|
||||
}).catch(() => {});
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
/** 取消出口选择 */
|
||||
cancelExit() {
|
||||
this.exitDialogVisible = false;
|
||||
this.exitForm.exitId = null;
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
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', {
|
||||
|
||||
@@ -9,10 +9,10 @@ const CompressionPlugin = require('compression-webpack-plugin')
|
||||
|
||||
const name = process.env.VUE_APP_TITLE || 'FORTUCKY WCS SYSTEM' // 网页标题
|
||||
|
||||
const baseUrl = 'http://localhost:8081' // 后端接口地址(你的后端端口是8081)
|
||||
|
||||
const port = process.env.port || process.env.npm_config_port || 80 // 前端端口
|
||||
const baseUrl = 'http://localhost:8084' // 后端接口地址(你的后端端口是8081)
|
||||
|
||||
// const port = process.env.port || process.env.npm_config_port || 80 // 前端端口
|
||||
const port = 8083
|
||||
module.exports = {
|
||||
publicPath: process.env.NODE_ENV === "production" ? "/" : "/",
|
||||
outputDir: 'dist',
|
||||
|
||||
Reference in New Issue
Block a user