Compare commits
10 Commits
1c3f1147dd
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0c0746fba6 | ||
|
|
8eb2bcc592 | ||
|
|
036ee35af3 | ||
|
|
d2d871baf1 | ||
|
|
6c2d8fcb0f | ||
|
|
5dcb72148e | ||
|
|
4e0d329e6d | ||
|
|
50534dc3be | ||
|
|
91ea5339a5 | ||
|
|
1f05708e4c |
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,7 +1,11 @@
|
||||
package com.ruoyi.api.controller;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.ruoyi.api.domain.agv.agvCallback.AgvCallbackRequest;
|
||||
import com.ruoyi.api.domain.agv.agvCallback.AgvCallbackResponse;
|
||||
import com.ruoyi.api.domain.agv.cancelTask.CancelTaskRequest;
|
||||
import com.ruoyi.api.domain.agv.cancelTask.CancelTaskResponse;
|
||||
import com.ruoyi.api.service.IApiService;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
@@ -27,6 +31,7 @@ public class AgvController extends BaseController {
|
||||
@Autowired
|
||||
private IAgvQueueService agvQueueService;
|
||||
|
||||
|
||||
/**
|
||||
* agv执行状态返回接口
|
||||
* @param request
|
||||
@@ -38,7 +43,6 @@ public class AgvController extends BaseController {
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* agv搬运作业
|
||||
* @param param{
|
||||
@@ -76,4 +80,32 @@ public class AgvController extends BaseController {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 前端手动操作完成/取消AGV作业时,请求rcs,取消当前AGV正执行的作业
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/cancelTask")
|
||||
public AjaxResult cancelTask(@RequestBody Map<String, String> param) {
|
||||
AgvQueue agvQueue = agvQueueService.selectAgvQueueByTaskCode(param.get("taskCode"));
|
||||
|
||||
if(agvQueue==null){
|
||||
return AjaxResult.error("AGV任务队列不存在!");
|
||||
}else{
|
||||
CancelTaskRequest cancelTaskRequest = new CancelTaskRequest();
|
||||
cancelTaskRequest.setReqCode(IdUtil.fastSimpleUUID());
|
||||
cancelTaskRequest.setReqTime(DateUtil.formatDateTime(DateUtil.date()));
|
||||
cancelTaskRequest.setTaskCode(agvQueue.getTaskCode());
|
||||
//取消rcs中指定的agv任务
|
||||
CancelTaskResponse cancelTaskResponse = apiService.cancelTask(cancelTaskRequest);
|
||||
if("0".equals(cancelTaskResponse.getCode())){
|
||||
agvQueueService.insertHistory(agvQueue.getReqCode());
|
||||
agvQueueService.deleteAgvQueueByReqCode(agvQueue.getReqCode());
|
||||
return AjaxResult.success("AGV任务队列取消成功!", cancelTaskResponse);
|
||||
}
|
||||
return AjaxResult.error("取消RCS-AGV任务队列失败!");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -136,4 +136,6 @@ public interface IApiService
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -33,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;
|
||||
@@ -63,7 +61,6 @@ public class ApiServiceImpl implements IApiService {
|
||||
private IBasCargoSpaceService basCargoSpaceService;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 下发agv编码
|
||||
*
|
||||
@@ -72,10 +69,10 @@ 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())) {
|
||||
AgvQueue agvQueue = agvQueueService.selectAgvQueueByTaskCode(genAgvSchedulingTaskRequest.getTaskCode());
|
||||
if(agvQueue != null){
|
||||
if (agvQueue != null) {
|
||||
agvQueue.setStatus("1");
|
||||
agvQueueService.updateAgvQueue(agvQueue);
|
||||
}
|
||||
@@ -130,7 +127,7 @@ public class ApiServiceImpl implements IApiService {
|
||||
String wmsTaskNo = param.get("wmsTaskNo");
|
||||
GenAgvSchedulingTaskResponse response = new GenAgvSchedulingTaskResponse();
|
||||
AgvQueue queue = agvQueueService.selectAgvQueueByTaskCode(param.get("taskCode"));
|
||||
if(queue == null){
|
||||
if (queue == null) {
|
||||
AgvQueue agvQueue = createAgvQueue(startPoint, endPoint, param.get("trayCode"), param.get("taskCode"), "1", traySize, wmsTaskNo);
|
||||
response = requestAgvQueue(agvQueue);
|
||||
if (response.getCode() == 0) {
|
||||
@@ -220,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());
|
||||
@@ -253,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();
|
||||
@@ -279,9 +273,21 @@ public class ApiServiceImpl implements IApiService {
|
||||
agvQueue.setReqTime(DateUtil.formatDateTime(DateUtil.date()));
|
||||
agvQueue.setAgvType("AGV");
|
||||
agvQueue.setPositionCode1(code1);
|
||||
agvQueue.setPositionCode2(code2);
|
||||
if ("4".equals(traySize) && "L1001".equals(code2)) {
|
||||
agvQueue.setPositionCode2("L1001-1");
|
||||
} else {
|
||||
agvQueue.setPositionCode2(code2);
|
||||
}
|
||||
|
||||
agvQueue.setTaskType("A22");
|
||||
agvQueue.setCtnrType("1");
|
||||
//rcslite开启托盘自动调整位置后 - 测试一巷道放货区分托盘类型
|
||||
// if (traySize == "2" || traySize == "3") {
|
||||
// agvQueue.setCtnrType("3");
|
||||
// }else{
|
||||
// agvQueue.setCtnrType("1");
|
||||
// }
|
||||
|
||||
agvQueue.setCtnrCode(traySize);
|
||||
agvQueue.setCtnrNum("0");
|
||||
agvQueue.setTaskMode("0");
|
||||
@@ -321,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 {
|
||||
@@ -367,13 +373,24 @@ 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());
|
||||
@@ -382,7 +399,7 @@ public class ApiServiceImpl implements IApiService {
|
||||
int i = mydoJobService.insertMydoJob(mydoJob);
|
||||
if (i > 0) {
|
||||
return AjaxResult.success();
|
||||
}else{
|
||||
} else {
|
||||
return AjaxResult.error();
|
||||
}
|
||||
|
||||
@@ -404,6 +421,7 @@ public class ApiServiceImpl implements IApiService {
|
||||
}
|
||||
}
|
||||
|
||||
//todo 新增agv站点
|
||||
@Override
|
||||
public AjaxResult deleteAgvTray(AgvQueue agvQueue) {
|
||||
Map<String, String> paramMap = new HashMap<>();
|
||||
@@ -411,21 +429,35 @@ public class ApiServiceImpl implements IApiService {
|
||||
paramMap.put("ctnrTyp", agvQueue.getCtnrType());
|
||||
paramMap.put("ctnrCode", agvQueue.getCtnrCode());
|
||||
|
||||
if("L1001".equals(agvQueue.getPositionCode2())){
|
||||
if ("L1001".equals(agvQueue.getPositionCode2())) {
|
||||
paramMap.put("stgBinCode", "JT000307001013");
|
||||
}
|
||||
if("L1003".equals(agvQueue.getPositionCode2())){
|
||||
if ("L1003".equals(agvQueue.getPositionCode2())) {
|
||||
paramMap.put("stgBinCode", "JT000206001013");
|
||||
}
|
||||
if ("L1001-1".equals(agvQueue.getPositionCode2())) {
|
||||
paramMap.put("stgBinCode", "JT000407001013");
|
||||
}
|
||||
// paramMap.put("binName", agvQueue.getPositionCode2());
|
||||
paramMap.put("indBind", "0");
|
||||
|
||||
RequestLog requestLog = requestLogService.getRequestLog(DELETE_BIN_URL, "AGV解绑容器", JSONUtil.toJsonStr(paramMap));
|
||||
RequestLog requestLog = requestLogService.getRequestLog2(DELETE_BIN_URL, "AGV解绑容器", JSONUtil.toJsonStr(paramMap));
|
||||
if ("1".equals(requestLog.getIsSuccessful())) {
|
||||
log.info("站点:"+agvQueue.getPositionCode2()+"{}AGV容器解绑成功!");
|
||||
log.info("站点:" + agvQueue.getPositionCode2() + "{}AGV容器解绑成功!");
|
||||
return AjaxResult.success();
|
||||
} else {
|
||||
log.info("站点:"+agvQueue.getPositionCode2()+"{}AGV容器解绑失败!");
|
||||
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();
|
||||
}
|
||||
}
|
||||
@@ -451,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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -156,6 +156,49 @@ public class RequestLogServiceImpl implements IRequestLogService
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 插入请求日志
|
||||
*
|
||||
@@ -175,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);
|
||||
}
|
||||
}
|
||||
@@ -17,6 +17,8 @@ public class Constant {
|
||||
public static final String RE_ASSIGN_URL = WMS_BASE_URL+"reAssign";
|
||||
public static final String RE_MATERIAL_URL = WMS_BASE_URL+"reMaterial";
|
||||
public static final String REQUEST_ENTER_URL = WMS_BASE_URL+"requestEnterByTrayCodeAndEntranceId";
|
||||
public static final String REQUEST_IN_SPACE_URL = WMS_BASE_URL+"requestInSpace";
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
}
|
||||
|
||||
@@ -87,4 +87,6 @@ public class DeviceSsj extends BaseEntity
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -85,4 +86,16 @@ public interface MydoJobMapper
|
||||
List<MydoJob> getInJobByEntrance(@Param("exitList") List<String> exitList);
|
||||
|
||||
MydoJob selectJobByTaskNo(String taskNo);
|
||||
|
||||
MydoJob selectMydoJobByEntranceList1(@Param("entranceId") String entranceId);
|
||||
|
||||
List<MydoJob> getInJobByEntranceId(@Param("entranceId") String exitId);
|
||||
|
||||
MydoJob selectMydoJobByExitId(@Param("exitId") String exitId);
|
||||
|
||||
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);
|
||||
|
||||
@@ -80,4 +83,18 @@ public interface IMydoJobService
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -124,7 +124,7 @@ public class JobCallBackServiceImpl implements IJobCallBackService
|
||||
param.put("taskNo", jobCallBack.getTaskNo());
|
||||
param.put("wmsType", jobCallBack.getType());
|
||||
RequestLog requestLog = apiService.finishMydoJob(param);
|
||||
if ("0".equals(requestLog.getIsSuccessful())){
|
||||
if ("1".equals(requestLog.getIsSuccessful())){
|
||||
jobCallBack.setStatus("1");
|
||||
jobCallBackMapper.updateJobCallBack(jobCallBack);
|
||||
}else{
|
||||
|
||||
@@ -1,11 +1,15 @@
|
||||
package com.ruoyi.job.service.impl;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.job.domain.JobCallBack;
|
||||
import com.ruoyi.job.service.IJobCallBackService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.job.mapper.MydoJobMapper;
|
||||
@@ -23,6 +27,8 @@ public class MydoJobServiceImpl implements IMydoJobService
|
||||
{
|
||||
@Autowired
|
||||
private MydoJobMapper mydoJobMapper;
|
||||
@Autowired
|
||||
private IJobCallBackService jobCallBackService;
|
||||
|
||||
/**
|
||||
* 查询作业信息
|
||||
@@ -70,6 +76,8 @@ public class MydoJobServiceImpl implements IMydoJobService
|
||||
@Override
|
||||
public int updateMydoJob(MydoJob mydoJob)
|
||||
{
|
||||
long priority = mydoJob.getPriority();
|
||||
mydoJob.setPriority(Math.abs(priority));
|
||||
return mydoJobMapper.updateMydoJob(mydoJob);
|
||||
}
|
||||
|
||||
@@ -82,6 +90,9 @@ public class MydoJobServiceImpl implements IMydoJobService
|
||||
@Override
|
||||
public int deleteMydoJobByJobIds(String[] jobIds)
|
||||
{
|
||||
for (String jobId : jobIds) {
|
||||
mydoJobMapper.insertHistory(jobId);
|
||||
}
|
||||
return mydoJobMapper.deleteMydoJobByJobIds(jobIds);
|
||||
}
|
||||
|
||||
@@ -130,10 +141,15 @@ public class MydoJobServiceImpl implements IMydoJobService
|
||||
}
|
||||
|
||||
@Override
|
||||
public MydoJob selectMydoJobByExitList(List<String> exitList) {
|
||||
public MydoJob selectMydoJobByExitList(List<String> exitList ) {
|
||||
return mydoJobMapper.selectMydoJobByExitList(exitList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MydoJob selectMydoJobByExitList1(String exitId ,String roadwayId) {
|
||||
return mydoJobMapper.selectMydoJobByExitList1(exitId,roadwayId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void insertHistory(String jobId) {
|
||||
mydoJobMapper.insertHistory(jobId);
|
||||
@@ -149,6 +165,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);
|
||||
|
||||
@@ -70,4 +70,6 @@ public interface AgvQueueMapper
|
||||
void insertHistory(String reqCode);
|
||||
|
||||
AgvQueue selectAgvQueueByWmsTask(@Param("wmsTaskNo") int wmsTaskNo);
|
||||
|
||||
List<AgvQueue> selectAgvQueueList1(AgvQueue agvQueue);
|
||||
}
|
||||
|
||||
@@ -73,4 +73,6 @@ public interface IAgvQueueService
|
||||
void insertHistory(String reqCode);
|
||||
|
||||
AgvQueue selectAgvQueueByWmsTask(int taskNo);
|
||||
|
||||
List<AgvQueue> selectAgvQueueList1(AgvQueue agvQueue);
|
||||
}
|
||||
|
||||
@@ -43,6 +43,12 @@ public class AgvQueueServiceImpl implements IAgvQueueService
|
||||
return agvQueueMapper.selectAgvQueueList(agvQueue);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AgvQueue> selectAgvQueueList1(AgvQueue agvQueue)
|
||||
{
|
||||
return agvQueueMapper.selectAgvQueueList1(agvQueue);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增AGV任务队列
|
||||
*
|
||||
|
||||
@@ -88,9 +88,11 @@ public class DdjDeviceExecutionQueueController extends BaseController
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody DdjDeviceExecutionQueue ddjDeviceExecutionQueue)
|
||||
{
|
||||
ddjDeviceExecutionQueue.setDdjxf("0");
|
||||
return toAjax(ddjDeviceExecutionQueueService.updateDdjDeviceExecutionQueue(ddjDeviceExecutionQueue));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除堆垛机执行队列
|
||||
*/
|
||||
|
||||
@@ -43,6 +43,7 @@ public interface DdjDeviceExecutionQueueMapper
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDdjDeviceExecutionQueue(DdjDeviceExecutionQueue ddjDeviceExecutionQueue);
|
||||
public int updateDdjDeviceExecutionQueue1(DdjDeviceExecutionQueue ddjDeviceExecutionQueue);
|
||||
|
||||
/**
|
||||
* 删除堆垛机执行队列
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,6 +68,9 @@ public class ScheduleThread {
|
||||
//调度初始化
|
||||
scheduleInit();
|
||||
log.info("调度服务执行成功");
|
||||
|
||||
//startAllThread();
|
||||
//startAllThread2();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -114,8 +114,8 @@ public class PlcDdj1Read extends Thread {
|
||||
}
|
||||
|
||||
void closeServer() {
|
||||
if (readWriteNet != null) {
|
||||
readWriteNet.ConnectClose();
|
||||
if (siemensS7Net != null) {
|
||||
siemensS7Net.ConnectClose();
|
||||
}
|
||||
setIsConnect(false);
|
||||
}
|
||||
|
||||
@@ -114,8 +114,8 @@ public class PlcDdj2Read extends Thread {
|
||||
}
|
||||
|
||||
void closeServer() {
|
||||
if (readWriteNet != null) {
|
||||
readWriteNet.ConnectClose();
|
||||
if (siemensS7Net != null) {
|
||||
siemensS7Net.ConnectClose();
|
||||
}
|
||||
setIsConnect(false);
|
||||
}
|
||||
|
||||
@@ -150,6 +150,7 @@ public class PlcSsjRead implements Runnable {
|
||||
ssjDevice.setSszt(ParseUtil.optInt(8, ddsx1));
|
||||
ssjDevice.setRkqq(ParseUtil.optInt(10, ddsx1));
|
||||
ssjDevice.setTraySize(ParseUtil.optInt(12, ddsx1));
|
||||
ssjDevice.setInOrOut(ParseUtil.optInt(24, ddsx1));
|
||||
ssjDevice.setException(ParseUtil.optInt(28, ddsx1));
|
||||
|
||||
String trayCodeReadAddress="";
|
||||
@@ -189,14 +190,9 @@ public class PlcSsjRead implements Runnable {
|
||||
byte[] content = trayCodeRead.Content;
|
||||
//去除bytes中
|
||||
ssjDevice.setTrayCode(ParseUtil.filterAndConvert(trayCodeRead.Content));
|
||||
// if("L2004".equals(ssjDevice.getDeviceCode())){
|
||||
// ssjDevice.setTrayCode("gMODEL:1 COLOR:1 SERIAL:2 V:1 Hz:1 PH:1 N.W.:1 G.W.:1 ITEM_CODE:12345 @:1$S0T0S1T0S1T0S1T0$40001015202@");
|
||||
// }else{
|
||||
// ssjDevice.setTrayCode("gMODEL:1 COLOR:1 SERIAL:1 V:1 Hz:1 PH:1 N.W.:1 G.W.:1 ITEM_CODE:123456 @:1$S0T0S1T0S1T0S1T0$40001015202@");
|
||||
// }
|
||||
}
|
||||
}
|
||||
OperateResultExOne<byte[]> agvSsjTask = readWriteNet.Read("DB501.280", Short.parseShort("8"));
|
||||
OperateResultExOne<byte[]> agvSsjTask = readWriteNet.Read("DB501.280", Short.parseShort("16"));
|
||||
String ddsx2 = "0";
|
||||
if (agvSsjTask.IsSuccess) {
|
||||
ddsx2 = SoftBasic.ByteToHexString(agvSsjTask.Content);
|
||||
@@ -206,6 +202,12 @@ public class PlcSsjRead implements Runnable {
|
||||
if("L1003".equals(ssjDevice.getDeviceCode())){
|
||||
ssjDevice.setTaskNo2(ParseUtil.optDInt(4, ddsx2));
|
||||
}
|
||||
if("L2004".equals(ssjDevice.getDeviceCode())){
|
||||
ssjDevice.setTaskNo2(ParseUtil.optDInt(8, ddsx2));
|
||||
}
|
||||
if("L2006".equals(ssjDevice.getDeviceCode())){
|
||||
ssjDevice.setTaskNo2(ParseUtil.optDInt(12, ddsx2));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -251,8 +253,8 @@ public class PlcSsjRead implements Runnable {
|
||||
}
|
||||
|
||||
void closeServer() {
|
||||
if (readWriteNet != null) {
|
||||
readWriteNet.ConnectClose();
|
||||
if (siemensS7Net != null) {
|
||||
siemensS7Net.ConnectClose();
|
||||
}
|
||||
setIsConnect(false);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
@@ -21,7 +23,10 @@ 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;
|
||||
|
||||
@@ -36,6 +41,7 @@ public class DdjThread implements Runnable {
|
||||
private IDdjDeviceExecutionQueueFinishService ddjDeviceExecutionQueueFinishService;
|
||||
private IMydoJobService mydoJobService;
|
||||
private IBasCargoSpaceService basCargoSpaceService;
|
||||
private SysDateConfigService sysDateConfigService;
|
||||
|
||||
public boolean isRun = true;
|
||||
|
||||
@@ -53,6 +59,7 @@ public class DdjThread 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,20 +69,35 @@ public class DdjThread implements Runnable {
|
||||
while (isRun) {
|
||||
for (String type : ddjCodeList.keySet()) {
|
||||
|
||||
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);
|
||||
}
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -94,14 +116,19 @@ public class DdjThread 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());
|
||||
}
|
||||
}
|
||||
@@ -114,7 +141,7 @@ public class DdjThread 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");
|
||||
@@ -131,40 +158,40 @@ public class DdjThread 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(mydoJob.getJobId(), 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());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -180,7 +207,7 @@ public class DdjThread 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) {
|
||||
@@ -190,19 +217,18 @@ public class DdjThread implements Runnable {
|
||||
ddjDeviceExecutionQueueService.updateDdjDeviceExecutionQueue(ddjDeviceExecutionQueue);
|
||||
mydoJob.setFaultFlag("0");
|
||||
mydoJobService.updateMydoJob(mydoJob);
|
||||
log.info("托盘堆垛机重新下发任务成功 rwh:{}", rwh);
|
||||
log.info("堆垛机放货目标有货,重分货位下发任务成功 rwh:{}", rwh);
|
||||
} else {
|
||||
log.error("托盘堆垛机重新下发任务失败!!!!!!!");
|
||||
log.error("堆垛机放货目标有货,重分货位下发任务失败!!!!!!!");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//正常下发
|
||||
if (ddj.getYxxf() == 1 && ddj.getCzfs() == 5 && ddj.getSbzt() == 0) {
|
||||
if (ddj.getYxxf() == 1 && ddj.getCzfs() == 5 && ddj.getSbzt() == 0 ) {
|
||||
Long rwh = ddj.getRwh();
|
||||
DdjDeviceExecutionQueue ddjDeviceExecutionQueueRunningParam = new DdjDeviceExecutionQueue();
|
||||
ddjDeviceExecutionQueueRunningParam.setDdjxf("1");
|
||||
//ddjDeviceExecutionQueueRunningParam.setSpare1("1");
|
||||
ddjDeviceExecutionQueueRunningParam.setDevId(ddj.getId());
|
||||
List<DdjDeviceExecutionQueue> ddjDeviceExecutionRunningQueues = ddjDeviceExecutionQueueService.selectDdjDeviceExecutionQueueList(ddjDeviceExecutionQueueRunningParam);
|
||||
if (CollUtil.isNotEmpty(ddjDeviceExecutionRunningQueues)) {
|
||||
@@ -224,9 +250,9 @@ public class DdjThread implements Runnable {
|
||||
ddjDeviceExecutionQueue.setXfsj(DateUtil.formatDateTime(DateUtil.date()));
|
||||
ddjDeviceExecutionQueue.setDdjxf("1");
|
||||
ddjDeviceExecutionQueueService.updateDdjDeviceExecutionQueue(ddjDeviceExecutionQueue);
|
||||
log.info("托盘堆垛机下发任务成功 rwh:{}", ddjDeviceExecutionQueue.getRwh());
|
||||
log.info("堆垛机下发任务成功 rwh:{}", ddjDeviceExecutionQueue.getRwh());
|
||||
} else {
|
||||
log.error("托盘堆垛机下发任务失败!!!!!!!");
|
||||
log.error("堆垛机下发任务失败!!!!!!!");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -269,7 +295,16 @@ public class DdjThread implements Runnable {
|
||||
int mbch = Convert.toInt(queue.getMbch());
|
||||
int mlfs = 5;
|
||||
int xfwc = 1;
|
||||
int hwlx = Convert.toInt(queue.getSpare1());
|
||||
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){
|
||||
|
||||
@@ -99,52 +99,66 @@ 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.setSpare1(mydoJob.getTraySize());
|
||||
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.getRkqq() == 1 && ssj.getTaskNo() > 0 && ssj.getTaskNo() < 1000 ) {
|
||||
if (ssj.getRkqq() == 1 && ssj.getTaskNo() > 0 && ssj.getTaskNo() < 1000 && StrUtil.isEmpty(ssj.getTrayCode())) {
|
||||
//先检测有没有出库作业,有出库作业直接退回
|
||||
MydoJob outMydoJob = mydoJobService.selectRunningMydoJobByExitList(Collections.singletonList(ssj.getDeviceCode()));
|
||||
// || StrUtil.isEmpty(ssj.getTrayCode())
|
||||
if (ObjUtil.isNotNull(outMydoJob)) {
|
||||
//下发去向 和任务号
|
||||
int i = writeToSsj(ssj.getPlcDbWriteAddress(), "99", 2, 2);
|
||||
@@ -174,6 +188,7 @@ public class Floor1BothWayInSsjThread implements Runnable {
|
||||
inJob.setStatus(TASK_STATUS_CREATE);
|
||||
inJob.setExecutionPhase(TASK_EP_CREATE);
|
||||
inJob.setFaultFlag("0");
|
||||
inJob.setPriority(Long.valueOf(10));
|
||||
mydoJobService.insertMydoJob(inJob);
|
||||
log.info("托盘码请求作业成功, rwh:{},trayCode:{}", ssj.getTaskNo(), ssj.getTrayCode());
|
||||
}else{
|
||||
@@ -202,52 +217,53 @@ public class Floor1BothWayInSsjThread implements Runnable {
|
||||
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()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 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(2,47,1));
|
||||
roadwayMap.put("L2005",Arrays.asList(3,70,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;
|
||||
@@ -108,30 +113,31 @@ 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());
|
||||
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());
|
||||
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());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -141,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()));
|
||||
@@ -169,15 +195,16 @@ public class Floor1BothWayOutSsjThread implements Runnable {
|
||||
ddjDeviceExecutionQueue.setMbch(pclList.get(2));
|
||||
ddjDeviceExecutionQueue.setDdjxf("0");
|
||||
ddjDeviceExecutionQueue.setMlfs(5);
|
||||
ddjDeviceExecutionQueue.setSpare1(pdOutJob.getTraySize());
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -73,36 +73,32 @@ public class Floor1SingleSsjThread implements Runnable {
|
||||
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();
|
||||
@@ -149,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)) {
|
||||
@@ -186,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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,13 +14,11 @@ import com.ruoyi.job.service.IMydoJobService;
|
||||
import com.ruoyi.queue.agv.domain.AgvQueue;
|
||||
import com.ruoyi.queue.agv.service.IAgvQueueService;
|
||||
import com.ruoyi.schedule.plcRead.ssj.PlcSsjRead;
|
||||
import io.swagger.models.auth.In;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import 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;
|
||||
@@ -99,20 +97,20 @@ public class Floor2InOutSsjThread implements Runnable {
|
||||
//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).getCtnrType()));
|
||||
int i = writeToSsjQH("DB802.106", Integer.parseInt(agvQueues.get(0).getCtnrCode()));
|
||||
if (i == 1) {
|
||||
log.info("输送机{}下发切换导向{}成功", inSsjDevice.getDeviceCode(), agvQueues.get(0).getCtnrType());
|
||||
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).getCtnrType()));
|
||||
int i = writeToSsjQH("DB802.118", Integer.parseInt(agvQueues.get(0).getCtnrCode()));
|
||||
if (i == 1) {
|
||||
log.info("输送机{}下发切换导向{}成功", inSsjDevice.getDeviceCode(), agvQueues.get(0).getCtnrType());
|
||||
log.info("输送机{}下发切换导向{}成功", inSsjDevice.getDeviceCode(), agvQueues.get(0).getCtnrCode());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -128,38 +126,74 @@ 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()) {
|
||||
//解绑AGV容器
|
||||
apiService.deleteAgvTray(agvQueues.get(0));
|
||||
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).getCtnrType()));
|
||||
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).getCtnrType()));
|
||||
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.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);
|
||||
List<AgvQueue> agvQueues = agvQueueService.selectAgvQueueList1(agvQueue);
|
||||
if(agvQueues.size() > 0){
|
||||
MydoJob mydoJob = mydoJobService.selectMydoJobByJobId(agvQueues.get(0).getTaskCode());
|
||||
mydoJob.setExecutionPhase(TASK_EP_SSJ);
|
||||
@@ -172,7 +206,7 @@ public class Floor2InOutSsjThread implements Runnable {
|
||||
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());
|
||||
@@ -209,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);
|
||||
@@ -235,6 +270,7 @@ public class Floor2InOutSsjThread implements Runnable {
|
||||
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) {
|
||||
@@ -253,49 +289,70 @@ public class Floor2InOutSsjThread implements Runnable {
|
||||
}
|
||||
}
|
||||
|
||||
if(StrUtil.isBlank(ssjDevice.getTrayCode()) && ssjDevice.getRkqq()==1 && ssjDevice.getTaskNo()<1000){
|
||||
// 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()+"输送机下发错误信息成功");
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
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;
|
||||
@@ -95,58 +97,77 @@ public class Floor2RoadWaySsjThread implements Runnable {
|
||||
//如果到位,且任务号大于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.setSpare1(mydoJob.getTraySize());
|
||||
ddjDeviceExecutionQueue.setScsj(DateUtil.formatDateTime(DateUtil.date()));
|
||||
ddjDeviceExecutionQueue.setRwlx(DDJ_RWLX_1);
|
||||
ddjDeviceExecutionQueueService.insertDdjDeviceExecutionQueue(ddjDeviceExecutionQueue);
|
||||
if(ObjUtil.isNotNull(mydoJob)){
|
||||
if(mydoJob.getCargoSpaceId() == null || "".equals(mydoJob.getCargoSpaceId())){
|
||||
AjaxResult ajaxResult = apiService.requestWmsSpace(mydoJob);
|
||||
if(ajaxResult.isSuccess()){
|
||||
BasCargoSpace space = BeanUtil.toBean(ajaxResult.get("data"), BasCargoSpace.class);
|
||||
String cargoSpaceId = space.getCargoSpaceId();
|
||||
mydoJob.setCargoSpaceId(cargoSpaceId);
|
||||
mydoJobService.updateMydoJob(mydoJob);
|
||||
}
|
||||
}
|
||||
if(mydoJob.getCargoSpaceId()!=null && !"".equals(mydoJob.getCargoSpaceId())){
|
||||
if(mydoJob.getExecutionPhase().equals(TASK_EP_SSJ)){
|
||||
mydoJob.setExecutionPhase(TASK_EP_ROADWAY_SSJ);
|
||||
mydoJobService.updateMydoJob(mydoJob);
|
||||
}
|
||||
if (ObjUtil.isNotNull(mydoJob) && mydoJob.getExecutionPhase().equals(TASK_EP_ROADWAY_SSJ)
|
||||
&& Convert.toInt(mydoJob.getInOrOut()) < 20) {
|
||||
List<DdjDeviceExecutionQueue> ddjDeviceExecutionQueues = ddjDeviceExecutionQueueService.selectDdjDeviceExecutionQueueListByRwlx(DDJ_RWLX_1, Convert.toInt(mydoJob.getRoadwayId()));
|
||||
BasCargoSpace basCargoSpace = basCargoSpaceService.selectBasCargoSpaceByWmsCargoSpaceId(mydoJob.getCargoSpaceId());
|
||||
List<Integer> pclList = roadwayMap.get(roadSsjDevice.getDeviceCode());
|
||||
if (CollUtil.isEmpty(ddjDeviceExecutionQueues) && ObjUtil.isNotNull(basCargoSpace) && CollUtil.isNotEmpty(pclList)) {
|
||||
DdjDeviceExecutionQueue ddjDeviceExecutionQueue = new DdjDeviceExecutionQueue();
|
||||
ddjDeviceExecutionQueue.setUuid(IdUtil.simpleUUID());
|
||||
ddjDeviceExecutionQueue.setRwh(Convert.toLong(mydoJob.getTaskNo()));
|
||||
ddjDeviceExecutionQueue.setDevName(mydoJob.getRoadwayId());
|
||||
ddjDeviceExecutionQueue.setDevId(Convert.toInt(mydoJob.getRoadwayId()));
|
||||
ddjDeviceExecutionQueue.setRwzt(0);
|
||||
ddjDeviceExecutionQueue.setYph(pclList.get(0));
|
||||
ddjDeviceExecutionQueue.setYlh(pclList.get(1));
|
||||
ddjDeviceExecutionQueue.setYch(pclList.get(2));
|
||||
ddjDeviceExecutionQueue.setMbph(Convert.toInt(basCargoSpace.getThePlatoon()));
|
||||
ddjDeviceExecutionQueue.setMblh(Convert.toInt(basCargoSpace.getTheColumn()));
|
||||
ddjDeviceExecutionQueue.setMbch(Convert.toInt(basCargoSpace.getTheFloor()));
|
||||
ddjDeviceExecutionQueue.setDdjxf("0");
|
||||
ddjDeviceExecutionQueue.setMlfs(5);
|
||||
ddjDeviceExecutionQueue.setSpare1(mydoJob.getTraySize());
|
||||
ddjDeviceExecutionQueue.setScsj(DateUtil.formatDateTime(DateUtil.date()));
|
||||
ddjDeviceExecutionQueue.setRwlx(DDJ_RWLX_1);
|
||||
ddjDeviceExecutionQueueService.insertDdjDeviceExecutionQueue(ddjDeviceExecutionQueue);
|
||||
|
||||
mydoJob.setExecutionPhase(TASK_EP_DDJ);
|
||||
mydoJobService.updateMydoJob(mydoJob);
|
||||
mydoJob.setExecutionPhase(TASK_EP_DDJ);
|
||||
mydoJobService.updateMydoJob(mydoJob);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(roadSsjDevice.getKx()==1 && roadSsjDevice.getTaskNo() == 0){
|
||||
List<String> exitList = new ArrayList<>();
|
||||
String exitId = "";
|
||||
String roadwayId = "";
|
||||
String entranceId = "G1005";
|
||||
if("L1002".equals(roadSsjDevice.getDeviceCode())){
|
||||
exitList.add("l1001");
|
||||
exitId = "L1001";
|
||||
roadwayId = "1";
|
||||
}
|
||||
if("L1004".equals(roadSsjDevice.getDeviceCode())){
|
||||
exitList.add("l1003");
|
||||
exitId = "L1003";
|
||||
roadwayId = "2";
|
||||
}
|
||||
List<MydoJob> inList = mydoJobService.getInJobByEntrance(exitList);
|
||||
if(inList.size() == 0){
|
||||
MydoJob mydoJob = mydoJobService.selectMydoJobByExitList(exitList);
|
||||
if (ObjUtil.isNotNull(mydoJob)) {
|
||||
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_2, Convert.toInt(mydoJob.getRoadwayId()));
|
||||
List<DdjDeviceExecutionQueue> list = ddjDeviceExecutionQueueService.selectDdjDeviceExecutionQueueListByRwlx(DDJ_RWLX_1, Convert.toInt(mydoJob.getRoadwayId()));
|
||||
List<Integer> pclList = roadwayMap.get(roadSsjDevice.getDeviceCode());
|
||||
if (CollUtil.isEmpty(list) && CollUtil.isNotEmpty(pclList)) {
|
||||
DdjDeviceExecutionQueue ddjDeviceExecutionQueue = new DdjDeviceExecutionQueue();
|
||||
@@ -175,11 +196,10 @@ public class Floor2RoadWaySsjThread implements Runnable {
|
||||
mydoJobService.updateMydoJob(mydoJob);
|
||||
}
|
||||
}
|
||||
}else{
|
||||
log.info("当前出口"+ exitId+"存在入库任务,无法出库!");
|
||||
}
|
||||
}else{
|
||||
log.info("当前出口"+ exitList+"存在入库任务,无法出库!");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -19,10 +19,9 @@ import com.ruoyi.schedule.plcRead.util.Tools;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import static com.ruoyi.common.TaskStatusCode.*;
|
||||
import static com.ruoyi.schedule.plcRead.ssj.PlcSsjRead.*;
|
||||
@@ -99,12 +98,13 @@ public class LineSsjThread implements Runnable {
|
||||
//查作业,入如果已经有了,直接下发输送线
|
||||
MydoJob mydoJob = new MydoJob();
|
||||
mydoJob.setInOrOut("1");
|
||||
String[] split = SsjDevice.getTrayCode().split(" ");
|
||||
String serial = split[2].substring(7);
|
||||
String trayCode = SsjDevice.getTrayCode();
|
||||
//String[] split = trayCode.split("\\s+");
|
||||
String serial = findFirst(PATTERNS.get("SERIAL"), trayCode);
|
||||
|
||||
mydoJob.setTrayCode(serial);
|
||||
mydoJob.setEntranceId("G1005");
|
||||
mydoJob.setFlag("0");
|
||||
mydoJob.setStatus("1");
|
||||
List<MydoJob> mydoJobs = mydoJobService.selectInOrOutMydoJobList(mydoJob);
|
||||
//有作业,下发输送机任务号,覆盖任务号
|
||||
if (!mydoJobs.isEmpty()) {
|
||||
@@ -134,6 +134,7 @@ public class LineSsjThread implements Runnable {
|
||||
mydoJob2.setCreateTime(new Date());
|
||||
mydoJob2.setTraySize(Convert.toStr(SsjDevice.getTraySize()));
|
||||
mydoJob2.setFaultFlag("0");
|
||||
mydoJob2.setPriority(Long.valueOf(10));
|
||||
mydoJobService.insertMydoJob(mydoJob2);
|
||||
int i = writeToSsj(SsjDevice.getPlcDbWriteAddress(), mydoJob2.getTaskNo(), Integer.parseInt(mydoJob2.getTraySize()), 1);
|
||||
if (i == 1) {
|
||||
@@ -153,27 +154,12 @@ public class LineSsjThread implements Runnable {
|
||||
* 8, "没有可用货位!"
|
||||
* 9, "创建工艺入库单失败!"
|
||||
*/
|
||||
//超大,给plc下发错误信息,AGV搬到缓存区 其余人工处理
|
||||
if ((Integer) ajaxResult.get("code") == 5) {
|
||||
int i = writeToSsj(SsjDevice.getPlcDbWriteAddress(), "2222", 1, 1);
|
||||
if (i == 1) {
|
||||
log.info("G1005产线输送机下发超大托盘处理成功");
|
||||
}
|
||||
createMoveToPort(SsjDevice);
|
||||
} else {
|
||||
int i = writeToSsj(SsjDevice.getPlcDbWriteAddress(), "99", Integer.parseInt(ajaxResult.get("code").toString()), 2);
|
||||
if (i == 1) {
|
||||
log.info("G1005产线输送机下发错误信息成功");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (SsjDevice.getRkqq() == 1 && StrUtil.isBlank(SsjDevice.getTrayCode()) &&
|
||||
SsjDevice.getTraySize() != 0 && SsjDevice.getTaskNo() < 1000) {
|
||||
|
||||
//log.info("设备:{} 位置:{} 条码:{} 托盘大小:{}", SsjDevice.getDeviceCode(), "产线", SsjDevice.getTrayCode(), SsjDevice.getTraySize());
|
||||
//查wcs有没作业,有下发给输送机任务号,覆盖任务号
|
||||
MydoJob mydoJob = new MydoJob();
|
||||
mydoJob.setInOrOut("1");
|
||||
@@ -184,7 +170,6 @@ public class LineSsjThread implements Runnable {
|
||||
List<MydoJob> mydoJobs = mydoJobService.selectInOrOutMydoJobList(mydoJob);
|
||||
if (!mydoJobs.isEmpty()) {
|
||||
mydoJob = mydoJobs.get(0);
|
||||
|
||||
int i = writeToSsj(SsjDevice.getPlcDbWriteAddress(), mydoJob.getTaskNo(), 1, 1);
|
||||
if (i == 1) {
|
||||
mydoJob.setExecutionPhase(TASK_EP_LINE_SSJ);
|
||||
@@ -206,6 +191,7 @@ public class LineSsjThread implements Runnable {
|
||||
mydoJob2.setCreateTime(new Date());
|
||||
mydoJob2.setTraySize(Convert.toStr(SsjDevice.getTraySize()));
|
||||
mydoJob2.setFaultFlag("0");
|
||||
mydoJob2.setPriority(Long.valueOf(10));
|
||||
mydoJobService.insertMydoJob(mydoJob2);
|
||||
int i = writeToSsj(SsjDevice.getPlcDbWriteAddress(), mydoJob2.getTaskNo(), 1, 1);
|
||||
if (i == 1) {
|
||||
@@ -219,19 +205,6 @@ public class LineSsjThread implements Runnable {
|
||||
//超大,给plc下发错误信息,等待人工处理
|
||||
//托盘大小对不上,给plc下发错误信息,等待人工处理
|
||||
//码不对,给plc下发错误信息,等待人工处理
|
||||
|
||||
// if ((Integer) ajaxResult.get("code") == 5) {
|
||||
// int i = writeToSsj(SsjDevice.getPlcDbWriteAddress(), "2222", 1, 1);
|
||||
// if (i == 1) {
|
||||
// log.info("G1005产线输送机下发错误信息成功");
|
||||
// }
|
||||
// createMoveToPort(SsjDevice);
|
||||
// } else {
|
||||
// int i = writeToSsj(SsjDevice.getPlcDbWriteAddress(), "99", Integer.parseInt(ajaxResult.get("code").toString()), 2);
|
||||
// if (i == 1) {
|
||||
// log.info("G1005产线输送机下发错误信息成功");
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -241,10 +214,10 @@ public class LineSsjThread implements Runnable {
|
||||
|
||||
//log.info("设备:{} 位置:{} 条码:{} 托盘大小:{}", SsjDevice.getDeviceCode(), "产线收到wcs任务号", SsjDevice.getTrayCode(), SsjDevice.getTraySize());
|
||||
//任务号查wcs作业,查巷道,看目标输送线是否空闲,查是否有出库作业,生成agv队列
|
||||
|
||||
MydoJob mydoJob = mydoJobService.selectMydoJobByTaskNo(Convert.toLong(SsjDevice.getTaskNo()));
|
||||
String deviceCode = "";
|
||||
if (mydoJob != null) {
|
||||
|
||||
if ("1".equals(mydoJob.getRoadwayId())) {
|
||||
deviceCode = "L1001";
|
||||
} else {
|
||||
@@ -270,14 +243,14 @@ public class LineSsjThread implements Runnable {
|
||||
agvQueueService.updateAgvQueue(agvQueue);
|
||||
}
|
||||
}
|
||||
if("0".equals(agvQueue.getStatus())){
|
||||
if ("0".equals(agvQueue.getStatus())) {
|
||||
apiService.requestAgvQueue(agvQueue);
|
||||
}
|
||||
} else {
|
||||
if ("1".equals(mydoJob.getStatus())) {
|
||||
HashMap<String, String> paramMap = new HashMap<>();
|
||||
paramMap.put("trayCode", mydoJob.getTrayCode());
|
||||
paramMap.put("taskCode",mydoJob.getJobId());
|
||||
paramMap.put("taskCode", mydoJob.getJobId());
|
||||
//todo 与agv对点
|
||||
paramMap.put("startPoint", "G1005");
|
||||
paramMap.put("endPoint", deviceCode);
|
||||
@@ -305,17 +278,18 @@ public class LineSsjThread implements Runnable {
|
||||
agvQueueService.updateAgvQueue(agvQueue);
|
||||
}
|
||||
}
|
||||
if("0".equals(agvQueue.getStatus())){
|
||||
if ("0".equals(agvQueue.getStatus())) {
|
||||
apiService.requestAgvQueue(agvQueue);
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
HashMap<String, String> paramMap = new HashMap<>();
|
||||
String[] split = SsjDevice.getTrayCode().split(" ");
|
||||
String serial = split[2].substring(7);
|
||||
String trayCode = SsjDevice.getTrayCode();
|
||||
//String[] split = trayCode.split("\\s+");
|
||||
String serial = findFirst(PATTERNS.get("SERIAL"), trayCode);
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS");
|
||||
String taskCode = "BY" + sdf.format(new Date());
|
||||
paramMap.put("trayCode", serial);
|
||||
paramMap.put("taskCode",taskCode);
|
||||
paramMap.put("taskCode", taskCode);
|
||||
//todo 与agv对点
|
||||
paramMap.put("startPoint", "G1005");
|
||||
paramMap.put("endPoint", "");
|
||||
@@ -341,36 +315,26 @@ public class LineSsjThread implements Runnable {
|
||||
|
||||
}
|
||||
|
||||
private static final Map<String, Pattern> PATTERNS = createPatterns();
|
||||
|
||||
void createMoveToPort(DeviceSsj SsjDevice) {
|
||||
WcsPort wcsPort = new WcsPort();
|
||||
wcsPort.setStatus("1");
|
||||
List<WcsPort> wcsPorts = wcsPortService.selectWcsPortList(wcsPort);
|
||||
List<AgvQueue> agvQueues = agvQueueService.selectAgvQueueList(new AgvQueue());
|
||||
//检查agvQueues中是否有任何一个positionCode2是wcsPorts中的portCode
|
||||
boolean hasMatchingPort = agvQueues.stream()
|
||||
.map(AgvQueue::getPositionCode2)
|
||||
.anyMatch(positionCode2 -> wcsPorts.stream()
|
||||
.map(WcsPort::getPortCode)
|
||||
.anyMatch(portCode -> portCode.equals(positionCode2)));
|
||||
private static Map<String, Pattern> createPatterns() {
|
||||
Map<String, Pattern> map = new LinkedHashMap<>();
|
||||
map.put("MODEL", Pattern.compile("MODEL:([^\\s]+)", Pattern.CASE_INSENSITIVE));
|
||||
map.put("COLOR", Pattern.compile("COLOR:([^\\s]+)", Pattern.CASE_INSENSITIVE));
|
||||
map.put("SERIAL", Pattern.compile("SERIAL:([^\\s]+)", Pattern.CASE_INSENSITIVE));
|
||||
map.put("V", Pattern.compile("V:([^\\s]+)", Pattern.CASE_INSENSITIVE));
|
||||
map.put("Hz", Pattern.compile("Hz:([^\\s]+)", Pattern.CASE_INSENSITIVE));
|
||||
map.put("PH", Pattern.compile("PH:([^\\s]+)", Pattern.CASE_INSENSITIVE));
|
||||
map.put("NW", Pattern.compile("N\\.W\\.:([^\\s]+)", Pattern.CASE_INSENSITIVE));
|
||||
map.put("GW", Pattern.compile("G\\.W\\.:([^\\s]+)", Pattern.CASE_INSENSITIVE));
|
||||
map.put("ITEM_CODE", Pattern.compile("ITEM_CODE:([^\\s]+)", Pattern.CASE_INSENSITIVE));
|
||||
map.put("@", Pattern.compile("@:([^\\s]+)", Pattern.CASE_INSENSITIVE));
|
||||
return map;
|
||||
}
|
||||
|
||||
if (hasMatchingPort == false) {
|
||||
|
||||
if (!wcsPorts.isEmpty()) {
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
// map.put("trayCode", mydoJob.getTrayCode());
|
||||
map.put("taskNo", StrUtil.uuid());
|
||||
//todo 与agv对点
|
||||
map.put("startPoint", "G1005");
|
||||
map.put("endPoint", wcsPorts.get(0).getPortCode());
|
||||
map.put("traySize", "5");
|
||||
// map.put("wmsTaskNo", mydoJob.getTaskNo());
|
||||
AjaxResult ajaxResult1 = apiService.receiveAgvMoveJob(map);
|
||||
if (ajaxResult1.isSuccess()) {
|
||||
log.info("G1005产线生成作业失败,AGV下发搬运至缓存点任务成功:{}", ajaxResult1.get("data"));
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
private static String findFirst(Pattern pattern, String input) {
|
||||
if (pattern == null || input == null) return null;
|
||||
Matcher m = pattern.matcher(input);
|
||||
return m.find() ? m.group(1) : null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,12 +6,12 @@ spring:
|
||||
druid:
|
||||
#主数据信息
|
||||
master:
|
||||
# url: jdbc:sqlserver://172.16.2.170:1433;databaseName=FT517-WCS;
|
||||
# username: sa
|
||||
# password: Flrd0914.
|
||||
url: jdbc:sqlserver://192.168.58.10:1433;databaseName=FT517-wcs;
|
||||
url: jdbc:sqlserver://172.16.4.12:1433;databaseName=FT517-wcs;encrypt=true;trustServerCertificate=true;
|
||||
username: sa
|
||||
password: www.123.com
|
||||
password: Flrd0914.
|
||||
# url: jdbc:sqlserver://192.168.58.10:1433;databaseName=FT517-wcs;;encrypt=true;trustServerCertificate=true;
|
||||
# username: sa
|
||||
# password: www.123.com
|
||||
|
||||
# 从库数据源
|
||||
slave:
|
||||
|
||||
@@ -68,7 +68,8 @@ spring:
|
||||
# redis 配置
|
||||
redis:
|
||||
# 地址
|
||||
host: 192.168.58.10
|
||||
# host: 192.168.58.10
|
||||
host: 172.16.4.12
|
||||
# 端口,默认为6379
|
||||
port: 6379
|
||||
# 数据库索引
|
||||
@@ -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}
|
||||
|
||||
@@ -111,7 +111,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</foreach>
|
||||
and in_or_out > 20
|
||||
and status = 1 and execution_phase= 0
|
||||
order by priority desc,create_time
|
||||
order by priority asc,create_time
|
||||
</select>
|
||||
|
||||
<select id="selectMydoJobByExitList1" resultMap="MydoJobResult">
|
||||
select TOP 1 job_id, status, task_no, roadway_id, cargo_space_id, target_roadway_id, target_cargo_space_id, priority, execution_phase, in_or_out, create_time, start_time, finish_time, entrance_id, exit_id, warehouse_id, fault_flag,flag,tray_code,tray_size from mydo_job_wcs
|
||||
where exit_id = #{exitId}
|
||||
and roadway_id = #{roadwayId}
|
||||
and in_or_out > 20
|
||||
and status = 1 and execution_phase= 0
|
||||
order by priority asc,create_time
|
||||
</select>
|
||||
|
||||
<insert id="insertMydoJob" parameterType="MydoJob">
|
||||
@@ -237,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>
|
||||
@@ -270,11 +302,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</foreach>
|
||||
and in_or_out > 20
|
||||
and status = 3
|
||||
order by priority desc,create_time
|
||||
order by priority asc,create_time
|
||||
</select>
|
||||
|
||||
<select id="getInJobByEntrance" resultMap="MydoJobResult">
|
||||
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
|
||||
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}
|
||||
@@ -282,4 +316,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
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>
|
||||
|
||||
|
||||
@@ -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秒刷新一次
|
||||
},
|
||||
|
||||
@@ -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', {
|
||||
|
||||
Reference in New Issue
Block a user