Compare commits
12 Commits
main
...
89b2fff3d1
| Author | SHA1 | Date | |
|---|---|---|---|
| 89b2fff3d1 | |||
| 72b88ed0e3 | |||
|
|
d98fe2a30c | ||
|
|
af308d7dc9 | ||
|
|
ad9f8d87fd | ||
|
|
fa9386773f | ||
|
|
cafcde4a35 | ||
|
|
24eaaa2823 | ||
|
|
24fb696a67 | ||
|
|
9b008f5fe7 | ||
|
|
03e30d1db0 | ||
|
|
9c6c32b7ed |
2
pom.xml
2
pom.xml
@@ -37,7 +37,7 @@
|
|||||||
<spring-framework.version>5.3.39</spring-framework.version>
|
<spring-framework.version>5.3.39</spring-framework.version>
|
||||||
<hutool.version>5.8.27</hutool.version>
|
<hutool.version>5.8.27</hutool.version>
|
||||||
<lombok.version>1.18.30</lombok.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>
|
<mybatis-plus.version>3.5.2</mybatis-plus.version>
|
||||||
|
|
||||||
</properties>
|
</properties>
|
||||||
|
|||||||
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,5 +1,6 @@
|
|||||||
package com.ruoyi;
|
package com.ruoyi;
|
||||||
|
|
||||||
|
import com.ruoyi.schedule.ScheduleThread;
|
||||||
import org.mybatis.spring.annotation.MapperScan;
|
import org.mybatis.spring.annotation.MapperScan;
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
@@ -7,6 +8,8 @@ import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
|||||||
import org.springframework.scheduling.annotation.EnableAsync;
|
import org.springframework.scheduling.annotation.EnableAsync;
|
||||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 启动程序
|
* 启动程序
|
||||||
*
|
*
|
||||||
@@ -17,6 +20,7 @@ import org.springframework.scheduling.annotation.EnableScheduling;
|
|||||||
@EnableAsync
|
@EnableAsync
|
||||||
public class RuoYiApplication
|
public class RuoYiApplication
|
||||||
{
|
{
|
||||||
|
|
||||||
public static void main(String[] args)
|
public static void main(String[] args)
|
||||||
{
|
{
|
||||||
// System.setProperty("spring.devtools.restart.enabled", "false");
|
// System.setProperty("spring.devtools.restart.enabled", "false");
|
||||||
|
|||||||
@@ -0,0 +1,30 @@
|
|||||||
|
package com.ruoyi.algorithm.controller;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PutMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
import com.ruoyi.algorithm.service.ITidyService;
|
||||||
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/algorithm/tidy")
|
||||||
|
public class TidyController {
|
||||||
|
@Autowired
|
||||||
|
private ITidyService tidyService;
|
||||||
|
|
||||||
|
@PreAuthorize("@ss.hasPermi('algorithm:tidy:query')")
|
||||||
|
@GetMapping("/status")
|
||||||
|
public AjaxResult status() { return AjaxResult.success(tidyService.getStatus()); }
|
||||||
|
|
||||||
|
@PreAuthorize("@ss.hasPermi('algorithm:tidy:edit')")
|
||||||
|
@PutMapping("/mode")
|
||||||
|
public AjaxResult mode(@RequestBody Map<String, String> body) {
|
||||||
|
try { return AjaxResult.success(tidyService.updateMode(body == null ? null : body.get("mode"))); }
|
||||||
|
catch (IllegalArgumentException ex) { return AjaxResult.error(ex.getMessage()); }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
package com.ruoyi.algorithm.service;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public interface ITidyService {
|
||||||
|
Map<String, Object> getStatus();
|
||||||
|
Map<String, Object> updateMode(String mode);
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
package com.ruoyi.algorithm.service.impl;
|
||||||
|
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.concurrent.atomic.AtomicReference;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.ruoyi.algorithm.service.ITidyService;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class TidyServiceImpl implements ITidyService {
|
||||||
|
private final AtomicReference<String> mode = new AtomicReference<>("AUTO");
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, Object> getStatus() {
|
||||||
|
Map<String, Object> result = new LinkedHashMap<>();
|
||||||
|
result.put("mode", mode.get());
|
||||||
|
result.put("enabled", true);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, Object> updateMode(String requestedMode) {
|
||||||
|
if (requestedMode == null || !("AUTO".equalsIgnoreCase(requestedMode) || "MANUAL".equalsIgnoreCase(requestedMode))) {
|
||||||
|
throw new IllegalArgumentException("mode must be AUTO or MANUAL");
|
||||||
|
}
|
||||||
|
mode.set(requestedMode.toUpperCase());
|
||||||
|
return getStatus();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,30 +1,43 @@
|
|||||||
package com.ruoyi.api.controller;
|
package com.ruoyi.api.controller;
|
||||||
|
|
||||||
|
import cn.hutool.json.JSONObject;
|
||||||
|
import com.mchange.v2.lang.ObjectUtils;
|
||||||
import com.ruoyi.api.domain.agv.agvCallback.AgvCallbackRequest;
|
import com.ruoyi.api.domain.agv.agvCallback.AgvCallbackRequest;
|
||||||
import com.ruoyi.api.domain.agv.agvCallback.AgvCallbackResponse;
|
import com.ruoyi.api.domain.agv.agvCallback.AgvCallbackResponse;
|
||||||
import com.ruoyi.api.service.IApiService;
|
import com.ruoyi.api.service.IApiService;
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
|
import com.ruoyi.queue.agv.service.impl.AgvQueueServiceImpl;
|
||||||
|
import com.ruoyi.system.domain.AgvContainerTask;
|
||||||
|
import com.ruoyi.system.mapper.AgvContainerTaskMapper;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.scheduling.annotation.Scheduled;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Agv操作请求
|
* Agv操作请求
|
||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/agv/api")
|
@RequestMapping("/api/agv")
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class AgvController extends BaseController {
|
public class AgvController extends BaseController {
|
||||||
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IApiService apiService;
|
private IApiService apiService;
|
||||||
|
@Autowired
|
||||||
|
private AgvQueueServiceImpl agvQueueService;
|
||||||
|
@Autowired
|
||||||
|
private AgvContainerTaskMapper agvContainerTaskMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* agv执行状态返回接口
|
* agv执行状态返回接口
|
||||||
|
*
|
||||||
* @param request
|
* @param request
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@@ -34,15 +47,14 @@ public class AgvController extends BaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* agv搬运作业
|
* agv搬运作业
|
||||||
* @param param{
|
*
|
||||||
* startPoint:起始点
|
* @param param{ startPoint:起始点
|
||||||
* endPoint:结束点
|
* endPoint:结束点
|
||||||
* containerCode:容器编号
|
* containerCode:容器编号
|
||||||
* taskNo:任务号
|
* taskNo:任务号
|
||||||
* }
|
* }
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@PostMapping("/receiveAgvMoveJob")
|
@PostMapping("/receiveAgvMoveJob")
|
||||||
@@ -50,4 +62,98 @@ public class AgvController extends BaseController {
|
|||||||
return apiService.receiveAgvMoveJob(param);
|
return apiService.receiveAgvMoveJob(param);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取AGV任务定时器
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Scheduled(fixedDelay = 5000)
|
||||||
|
public void queryAgvMoveJob() {
|
||||||
|
apiService.sendContarTask();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Scheduled(fixedDelay = 5000)
|
||||||
|
public void finishAgvMoveJob() {
|
||||||
|
AgvContainerTask agvContainerTask= agvContainerTaskMapper.selectAgvContainerFinishOne();
|
||||||
|
if (agvContainerTask!=null){
|
||||||
|
apiService.finishAgvJob(agvContainerTask.getContainer());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**任务下发
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Scheduled(fixedDelay = 1000)
|
||||||
|
public void sendAgvMoveJob() {
|
||||||
|
AgvContainerTask agvContainerTask = new AgvContainerTask();
|
||||||
|
agvContainerTask.setStatus("0");
|
||||||
|
List<AgvContainerTask> agvContainerTasks = agvContainerTaskMapper.selectAgvContainerTaskList(agvContainerTask);
|
||||||
|
if (agvContainerTasks.size() > 0) {
|
||||||
|
AgvContainerTask agvContainerTask1 = agvContainerTasks.get(0);
|
||||||
|
Map<String, String> param = new HashMap<>();
|
||||||
|
param.put("FromStation", agvContainerTask1.getStartPoint());
|
||||||
|
param.put("ToStation", agvContainerTask1.getEndPoint());
|
||||||
|
param.put("Type", agvContainerTask1.getSpare1());
|
||||||
|
param.put("OrderId", agvContainerTask1.getContainer());
|
||||||
|
// param.put("TaskGuideId", agvContainerTask1.getTaskNo());
|
||||||
|
AjaxResult ajaxResult = apiService.sendAgvCar(param);
|
||||||
|
Integer code = (Integer) ajaxResult.get("code");
|
||||||
|
if (200 == code) {
|
||||||
|
agvContainerTask1.setStatus("1");
|
||||||
|
agvContainerTaskMapper.updateAgvContainerTask(agvContainerTask1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/***
|
||||||
|
* 请求取货放货接口
|
||||||
|
* @param jsonObject
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequestMapping("/checkAllow")
|
||||||
|
public AjaxResult checkAllow(@RequestBody JSONObject jsonObject) {
|
||||||
|
// 取放货站点
|
||||||
|
String requestStation = String.valueOf(jsonObject.get("requestStation"));
|
||||||
|
// 表内主键
|
||||||
|
String orderId = String.valueOf(jsonObject.get("orderId"));
|
||||||
|
String Type = String.valueOf(jsonObject.get("type"));
|
||||||
|
|
||||||
|
HashMap<String, Object> map = new HashMap<>();
|
||||||
|
map.put("v_position", requestStation);
|
||||||
|
map.put("v_orderId", orderId);
|
||||||
|
map.put("v_type", Type);
|
||||||
|
agvQueueService.selectKx(map);
|
||||||
|
Integer vResult = (Integer) map.get("v_result");
|
||||||
|
if (vResult == 1) {
|
||||||
|
return new AjaxResult(1, Type.equals("1") ? "允许取货" : "允许放货");
|
||||||
|
} else {
|
||||||
|
return new AjaxResult(0, Type.equals("1") ? "不允许取货,请等待" : "不允许放货,请等待");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 取货放货完成返回接口
|
||||||
|
*
|
||||||
|
* @param jsonObject
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequestMapping("/completionSignal")
|
||||||
|
public AjaxResult completionSignal(@RequestBody JSONObject jsonObject) {
|
||||||
|
|
||||||
|
String orderId = String.valueOf(jsonObject.get("orderId"));
|
||||||
|
String Type = String.valueOf(jsonObject.get("type"));
|
||||||
|
|
||||||
|
|
||||||
|
agvContainerTaskMapper.updateAgvContainerTaskByOrder(orderId);
|
||||||
|
// agvContainerTaskMapper.insertAgvContainerTaskFinish(orderId);
|
||||||
|
// agvContainerTaskMapper.deleteAgvContainerTaskByContainer(orderId);
|
||||||
|
|
||||||
|
return new AjaxResult(1, "返回成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,12 @@
|
|||||||
package com.ruoyi.api.controller;
|
package com.ruoyi.api.controller;
|
||||||
|
|
||||||
|
import cn.hutool.json.JSONObject;
|
||||||
import com.ruoyi.api.domain.wcs2wms.JobParam;
|
import com.ruoyi.api.domain.wcs2wms.JobParam;
|
||||||
import com.ruoyi.api.domain.wcs2wms.ReceiveJob;
|
import com.ruoyi.api.domain.wcs2wms.ReceiveJob;
|
||||||
import com.ruoyi.api.service.IApiService;
|
import com.ruoyi.api.service.IApiService;
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.scheduling.annotation.Scheduled;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
@@ -51,6 +53,13 @@ public class Wcs2WmsController {
|
|||||||
return apiService.cancelMydoJob(jobParam);
|
return apiService.cancelMydoJob(jobParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Return a read-only snapshot of all S-RGV vehicles. */
|
||||||
|
@PostMapping("/tidyVehicleSnapshot")
|
||||||
|
public AjaxResult tidyVehicleSnapshot() {
|
||||||
|
return apiService.tidyVehicleSnapshot();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,143 +14,187 @@ import java.util.UUID;
|
|||||||
@Data
|
@Data
|
||||||
public class GenAgvSchedulingTaskRequest {
|
public class GenAgvSchedulingTaskRequest {
|
||||||
/**
|
/**
|
||||||
* 请求编号
|
* 起始站点
|
||||||
* 同一个请求重复提交, 使用同一编号
|
|
||||||
*/
|
*/
|
||||||
@NotNull
|
private String FromStation;
|
||||||
private String reqCode = UUID.randomUUID().toString();
|
|
||||||
/**
|
|
||||||
* 请求时间
|
|
||||||
* 格式: “yyyy-MM-dd HH:mm:ss”
|
|
||||||
*/
|
|
||||||
private String reqTime = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
|
|
||||||
/**
|
|
||||||
* 客户端编号
|
|
||||||
* 客户端编号,如PDA,HCWMS等
|
|
||||||
*/
|
|
||||||
private String clientCode;
|
|
||||||
/**
|
|
||||||
* 令牌号
|
|
||||||
* 由调度系统颁发
|
|
||||||
*/
|
|
||||||
private String tokenCode;
|
|
||||||
/**
|
|
||||||
* 任务类型
|
|
||||||
* 内置任务类型:
|
|
||||||
* 厂内货架搬运: F01
|
|
||||||
* 厂内货架空满交换: F02
|
|
||||||
* 辊筒搬运接驳:F03
|
|
||||||
* 厂内货架出库AGV待命:F04
|
|
||||||
* 旋转货架: F05
|
|
||||||
* 厂内电梯任务: F06
|
|
||||||
* 以下为叉车专用任务类型
|
|
||||||
* 高位货架到工作台: F11
|
|
||||||
* 工作台到高位货架: F12
|
|
||||||
* 巷道到工作台: F13
|
|
||||||
* 工作台到巷道: F14
|
|
||||||
* 高位货架到工作台(接驳) : F15
|
|
||||||
* 工作台到高位货架 (接驳) : F16
|
|
||||||
* 巷道到工作台(接驳) : F17
|
|
||||||
* 工作台到巷道(接驳) : F18
|
|
||||||
* 叉车电梯主任务: F20
|
|
||||||
*/
|
|
||||||
@NotNull
|
|
||||||
private String taskTyp;
|
|
||||||
/**
|
|
||||||
* 容器类型(叉车/CTU专用) 叉车项目必传
|
|
||||||
*/
|
|
||||||
private String ctnrTyp;
|
|
||||||
/**
|
|
||||||
* 容器编号 (叉车/CTU专用)
|
|
||||||
*/
|
|
||||||
private String ctnrCode; //
|
|
||||||
/**
|
|
||||||
* 容器数量(叉车堆叠专用),默认值1,仅记录堆叠的数量不记录堆叠的每个容器号
|
|
||||||
*/
|
|
||||||
private String ctnrNum;
|
|
||||||
/**
|
|
||||||
* 任务模式
|
|
||||||
* 0-普通move 1-出库move 2-入库move 3-移库move
|
|
||||||
*/
|
|
||||||
private String taskMode;
|
|
||||||
/**
|
|
||||||
* 工作位
|
|
||||||
* 与RCS-2000端配置的位置名称一致, 工作位名称为字母\数字\或组合
|
|
||||||
*/
|
|
||||||
private String wbCode;
|
|
||||||
/**
|
|
||||||
* 位置路径
|
|
||||||
* AGV关键路径位置集合,与任务类型中模板配置的位置路径一一对应。待现场地图部署、配置完成后可获取
|
|
||||||
*/
|
|
||||||
private List<PositionCodeData> positionCodePath;
|
|
||||||
/**
|
|
||||||
* 货架编号
|
|
||||||
* 不指定货架可以为空
|
|
||||||
*/
|
|
||||||
private String podCode;
|
|
||||||
/**
|
|
||||||
* 货架方向
|
|
||||||
* “180”,”0”,”90”,”-90” 分别对应地图的”左”,”右”,”上”,”下”
|
|
||||||
* 不指定方向可以为空
|
|
||||||
* 如果终点不是工作台或工作台未配置操作方向则货架拣货方向podDir作为终点方向
|
|
||||||
* 如果工作台配有操作方向,则系统会根据货架拣货方向podDir和工作台操作方向计算货架终点方向
|
|
||||||
*/
|
|
||||||
private String podDir;
|
|
||||||
/**
|
|
||||||
* 货架类型, 传空时表示随机找个货架
|
|
||||||
* 找空货架传参方式如下:
|
|
||||||
* -1: 代表不关心货架类型, 找到空货架即可.
|
|
||||||
* -2: 代表从工作位获取关联货架类型, 如果未配置, 只找空货架.
|
|
||||||
* 货架类型编号: 只找该货架类型的空货架
|
|
||||||
*/
|
|
||||||
private String podTyp;
|
|
||||||
/**
|
|
||||||
* 物料批次
|
|
||||||
* 物料批次或货架上的物料唯一编码,生成任务单时,货架与物料直接绑定时使用. (通过同时传podCode和materialLot来绑定或通过 wbCode 找到位置上的货架和materialLot来绑定)
|
|
||||||
* 如果是区域/策略内查找货架,可以匹配对应物料批次的货架,支持以下值:
|
|
||||||
* 0:区域/策略内查找空货架
|
|
||||||
* 1:区域/策略内查找满货架
|
|
||||||
* 其他值:查找指定物料批次对应的货架
|
|
||||||
* 巷道任务通过该字段传入特征值
|
|
||||||
*/
|
|
||||||
private String materialLot;
|
|
||||||
/**
|
|
||||||
* 优先级
|
|
||||||
* 从(1~127)级,最大优先级最高。为空时,采用任务模板的优先级
|
|
||||||
*/
|
|
||||||
private String priority;
|
|
||||||
/**
|
|
||||||
* AGV编号
|
|
||||||
* 填写表示指定某一编号的AGV执行该任务
|
|
||||||
*/
|
|
||||||
private String agvCode;
|
|
||||||
/**
|
|
||||||
* 任务单号
|
|
||||||
* 选填, 不填系统自动生成
|
|
||||||
*/
|
|
||||||
private String taskCode;
|
|
||||||
/**
|
|
||||||
* 组编号
|
|
||||||
* CTU场景下用于按组出库,同组任务优先拼车。 如业务需要任务组间或组内按顺序出库,则需调用料箱顺序出库(CTU)接口。
|
|
||||||
* 潜伏式场景下,通过组号来管理顺序出库的顺序,组号小的优先出库。
|
|
||||||
*/
|
|
||||||
private String groupId;
|
|
||||||
/**
|
|
||||||
* 设备类型
|
|
||||||
*/
|
|
||||||
private String agvTyp;
|
|
||||||
/**
|
|
||||||
* 选择策略
|
|
||||||
* 区域/策略中挑选货架以及根据物料批次挑选货架时的先进先出规则,支持以下4个值:
|
|
||||||
* 1:按照货架到达储位的时间顺序,先进先出
|
|
||||||
* 2:按照货架到达储位的时间顺序,先进后出
|
|
||||||
* 9:按照货架绑定物料批次的时间顺序,先进先出
|
|
||||||
* 10:按照货架绑定物料批次的时间顺序,先进后出
|
|
||||||
*/
|
|
||||||
private String positionSelStrategy;
|
|
||||||
/**
|
|
||||||
* 自定义数据
|
|
||||||
*/
|
|
||||||
private String data;
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 目的站点
|
||||||
|
*/
|
||||||
|
private String ToStation;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任务类型(以实际的任务类型为准)
|
||||||
|
*/
|
||||||
|
private String Type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类名
|
||||||
|
*/
|
||||||
|
private String ClassName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任务引导ID
|
||||||
|
*/
|
||||||
|
private String TaskGuideId;
|
||||||
|
/**
|
||||||
|
* 订单 ID
|
||||||
|
*/
|
||||||
|
private String OrderId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 触发ID
|
||||||
|
*/
|
||||||
|
private String TriggerId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 扩展字段4
|
||||||
|
*/
|
||||||
|
private String Extend4;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 扩展字段5
|
||||||
|
*/
|
||||||
|
private String Extend5;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 扩展字段6
|
||||||
|
*/
|
||||||
|
private String Extend6;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 扩展字段7
|
||||||
|
*/
|
||||||
|
private String Extend7;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 扩展字段8
|
||||||
|
*/
|
||||||
|
private String Extend8;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 扩展字段9
|
||||||
|
*/
|
||||||
|
private String Extend9;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任务附加信息
|
||||||
|
*/
|
||||||
|
private TaskAdditionallInfo TaskAdditionallInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任务附加信息类
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public static class TaskAdditionallInfo {
|
||||||
|
/**
|
||||||
|
* 任务ID
|
||||||
|
*/
|
||||||
|
private String TaskId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 库存ID
|
||||||
|
*/
|
||||||
|
private String StockId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任务引导ID
|
||||||
|
*/
|
||||||
|
private String TaskGuideId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 触发ID
|
||||||
|
*/
|
||||||
|
private String TriggerId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下一任务添加阶段
|
||||||
|
*/
|
||||||
|
private String NextTaskAddStage;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 链ID
|
||||||
|
*/
|
||||||
|
private String ChainId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 链类型
|
||||||
|
*/
|
||||||
|
private Integer ChainType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 链排序
|
||||||
|
*/
|
||||||
|
private Integer ChainSort;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 图号
|
||||||
|
*/
|
||||||
|
private String FigureNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 尺寸
|
||||||
|
*/
|
||||||
|
private String Size;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 箱号
|
||||||
|
*/
|
||||||
|
private String BoxNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料
|
||||||
|
*/
|
||||||
|
private String Mater;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 相关数量
|
||||||
|
*/
|
||||||
|
private Integer RelatedCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 序列号
|
||||||
|
*/
|
||||||
|
private String SerialNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 重量
|
||||||
|
*/
|
||||||
|
private String Weight;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 站点号
|
||||||
|
*/
|
||||||
|
private String StationNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 手动计数
|
||||||
|
*/
|
||||||
|
private String HandCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批次
|
||||||
|
*/
|
||||||
|
private String Batch;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 前置相关任务ID
|
||||||
|
*/
|
||||||
|
private String PreviousRelatedTaskId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下一相关任务ID
|
||||||
|
*/
|
||||||
|
private String NextRelatedTaskId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 级联任务开始
|
||||||
|
*/
|
||||||
|
private String CascadeTaskBeginning;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 级联任务结束
|
||||||
|
*/
|
||||||
|
private String CascadeTaskEnding;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,11 +10,14 @@ import lombok.NoArgsConstructor;
|
|||||||
public class ReceiveJob {
|
public class ReceiveJob {
|
||||||
private String taskNo;
|
private String taskNo;
|
||||||
private String cargoSpaceId;
|
private String cargoSpaceId;
|
||||||
|
private String targetCargoSpaceId;
|
||||||
private String exitId;
|
private String exitId;
|
||||||
private String trayCode;
|
private String trayCode;
|
||||||
private String entranceId;
|
private String entranceId;
|
||||||
private String inOrOut;
|
private String inOrOut;
|
||||||
private String jobId;
|
private String jobId;
|
||||||
private String roadwayId;
|
private String roadwayId;
|
||||||
|
private String classId;
|
||||||
|
private Long priority;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,23 @@
|
|||||||
|
package com.ruoyi.api.domain.wcs2wms;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/** Read-only vehicle status snapshot exposed to WMS. */
|
||||||
|
@Data
|
||||||
|
public class SrgvVehicleSnapshot {
|
||||||
|
private String guid;
|
||||||
|
private Integer deviceId;
|
||||||
|
private String deviceName;
|
||||||
|
private String agvStatus;
|
||||||
|
private Boolean online;
|
||||||
|
private Boolean healthy;
|
||||||
|
private Boolean idle;
|
||||||
|
private Integer taskNo;
|
||||||
|
private Integer alarm;
|
||||||
|
private Integer errMsg;
|
||||||
|
private Integer chargeFlag;
|
||||||
|
private Integer locked;
|
||||||
|
private Integer battery;
|
||||||
|
private String currSite;
|
||||||
|
private Integer currFloor;
|
||||||
|
}
|
||||||
@@ -121,6 +121,10 @@ public interface IApiService
|
|||||||
*/
|
*/
|
||||||
public AjaxResult createInMydoJob(Map<String, Object> param);
|
public AjaxResult createInMydoJob(Map<String, Object> param);
|
||||||
|
|
||||||
|
public AjaxResult sendCargoSpace(Map<String, Object> param);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public AjaxResult selectMydoJobByNoTrayCode(Map<String, Object> param);
|
public AjaxResult selectMydoJobByNoTrayCode(Map<String, Object> param);
|
||||||
|
|
||||||
AjaxResult receiveOutMydoJob(ReceiveJob receiveOutJob);
|
AjaxResult receiveOutMydoJob(ReceiveJob receiveOutJob);
|
||||||
@@ -132,4 +136,20 @@ public interface IApiService
|
|||||||
AjaxResult allotSpace(JobParam jobParam);
|
AjaxResult allotSpace(JobParam jobParam);
|
||||||
|
|
||||||
AjaxResult JobFinish(Map<String, Object> param);
|
AjaxResult JobFinish(Map<String, Object> param);
|
||||||
|
|
||||||
|
AjaxResult OutMakeSure(HashMap<String, Object> map);
|
||||||
|
|
||||||
|
void updateLed(HashMap<String, Object> objectObjectHashMap);
|
||||||
|
|
||||||
|
void updateLedError(HashMap<String, Object> objectObjectHashMap);
|
||||||
|
|
||||||
|
void sendContarTask();
|
||||||
|
|
||||||
|
AjaxResult sendAgvCar(Map<String, String> param);
|
||||||
|
|
||||||
|
AjaxResult insertAgvQuene(HashMap<String, Object> objectObjectHashMap);
|
||||||
|
|
||||||
|
void finishAgvJob(String container);
|
||||||
|
|
||||||
|
AjaxResult tidyVehicleSnapshot();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -68,6 +68,8 @@ public interface IRequestLogService
|
|||||||
*/
|
*/
|
||||||
public RequestLog getRequestLog(String url, String param, String endPoint);
|
public RequestLog getRequestLog(String url, String param, String endPoint);
|
||||||
|
|
||||||
|
public RequestLog getRequestLogAgv(String url, String endPoint, String param);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 接收请求,并插入日志
|
* 接收请求,并插入日志
|
||||||
* @param url
|
* @param url
|
||||||
@@ -75,4 +77,6 @@ public interface IRequestLogService
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public RequestLog getRequestLog(String url, String param);
|
public RequestLog getRequestLog(String url, String param);
|
||||||
|
|
||||||
|
public RequestLog getRequestLogs(String url, String param, String endPoint);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,9 @@ import com.ruoyi.api.domain.agv.genAgvSchedulingTask.GenAgvSchedulingTaskRespons
|
|||||||
import com.ruoyi.api.domain.agv.genAgvSchedulingTask.PositionCodeData;
|
import com.ruoyi.api.domain.agv.genAgvSchedulingTask.PositionCodeData;
|
||||||
import com.ruoyi.api.domain.wcs2wms.JobParam;
|
import com.ruoyi.api.domain.wcs2wms.JobParam;
|
||||||
import com.ruoyi.api.domain.wcs2wms.ReceiveJob;
|
import com.ruoyi.api.domain.wcs2wms.ReceiveJob;
|
||||||
|
import com.ruoyi.api.domain.wcs2wms.SrgvVehicleSnapshot;
|
||||||
|
import com.ruoyi.device.srgv.domain.DeviceSrgv;
|
||||||
|
import com.ruoyi.device.srgv.mapper.DeviceSrgvMapper;
|
||||||
import com.ruoyi.api.service.IApiService;
|
import com.ruoyi.api.service.IApiService;
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
import com.ruoyi.common.utils.DateUtils;
|
import com.ruoyi.common.utils.DateUtils;
|
||||||
@@ -24,6 +27,8 @@ import com.ruoyi.job.domain.MydoJob;
|
|||||||
import com.ruoyi.job.service.IMydoJobService;
|
import com.ruoyi.job.service.IMydoJobService;
|
||||||
import com.ruoyi.queue.agv.domain.AgvQueue;
|
import com.ruoyi.queue.agv.domain.AgvQueue;
|
||||||
import com.ruoyi.queue.agv.service.IAgvQueueService;
|
import com.ruoyi.queue.agv.service.IAgvQueueService;
|
||||||
|
import com.ruoyi.system.domain.AgvContainerTask;
|
||||||
|
import com.ruoyi.system.service.IAgvContainerTaskService;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@@ -51,7 +56,10 @@ public class ApiServiceImpl implements IApiService {
|
|||||||
private IAgvQueueService agvQueueService;
|
private IAgvQueueService agvQueueService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private IMydoJobService mydoJobService;
|
private IMydoJobService mydoJobService;
|
||||||
|
@Autowired
|
||||||
|
private IAgvContainerTaskService agvContainerTaskService;
|
||||||
|
@Autowired
|
||||||
|
private DeviceSrgvMapper deviceSrgvMapper;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -138,10 +146,6 @@ public class ApiServiceImpl implements IApiService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 处理agv状态返回
|
* 处理agv状态返回
|
||||||
*
|
*
|
||||||
@@ -196,26 +200,24 @@ public class ApiServiceImpl implements IApiService {
|
|||||||
public AjaxResult cancelMydoJob(JobParam jobParam) {
|
public AjaxResult cancelMydoJob(JobParam jobParam) {
|
||||||
|
|
||||||
MydoJob mydoJob = mydoJobService.selectMydoJobByTaskNo(Convert.toLong(jobParam.getTaskNo()));
|
MydoJob mydoJob = mydoJobService.selectMydoJobByTaskNo(Convert.toLong(jobParam.getTaskNo()));
|
||||||
if(mydoJob==null){
|
if (mydoJob == null) {
|
||||||
return AjaxResult.error("任务不存在");
|
return AjaxResult.error("任务不存在");
|
||||||
}
|
}
|
||||||
if("1".equals(mydoJob.getStatus())){
|
if ("1".equals(mydoJob.getStatus())) {
|
||||||
mydoJob.setStatus("5");
|
mydoJob.setStatus("5");
|
||||||
mydoJobService.insertHistory(mydoJob.getJobId());
|
mydoJobService.insertHistory(mydoJob.getJobId());
|
||||||
mydoJobService.deleteMydoJobByJobId(mydoJob.getJobId());
|
mydoJobService.deleteMydoJobByJobId(mydoJob.getJobId());
|
||||||
return AjaxResult.success();
|
return AjaxResult.success();
|
||||||
}else{
|
} else {
|
||||||
return AjaxResult.error("任务已开始");
|
return AjaxResult.error("任务已开始");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AjaxResult reAssign(JobParam jobParam) {
|
public AjaxResult reAssign(JobParam jobParam) {
|
||||||
RequestLog requestLog = requestLogService.getRequestLog(RE_ASSIGN_URL, "重新分配货位", JSONUtil.toJsonStr(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);
|
InterfaceReceive bean = JSONUtil.toBean(requestLog.getResponseBody(), InterfaceReceive.class);
|
||||||
MydoJob wmsMydoJob = BeanUtil.toBean(bean.getData(), MydoJob.class);
|
MydoJob wmsMydoJob = BeanUtil.toBean(bean.getData(), MydoJob.class);
|
||||||
MydoJob mydoJob = mydoJobService.selectMydoJobByJobId(wmsMydoJob.getJobId());
|
MydoJob mydoJob = mydoJobService.selectMydoJobByJobId(wmsMydoJob.getJobId());
|
||||||
@@ -229,7 +231,7 @@ public class ApiServiceImpl implements IApiService {
|
|||||||
@Override
|
@Override
|
||||||
public AjaxResult reMaterial(JobParam jobParam) {
|
public AjaxResult reMaterial(JobParam jobParam) {
|
||||||
RequestLog requestLog = requestLogService.getRequestLog(RE_MATERIAL_URL, "重新分配物料", JSONUtil.toJsonStr(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.success();
|
||||||
}
|
}
|
||||||
return AjaxResult.error();
|
return AjaxResult.error();
|
||||||
@@ -347,12 +349,26 @@ public class ApiServiceImpl implements IApiService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AjaxResult sendCargoSpace(Map<String, Object> param) {
|
||||||
|
// 访问请求路径,生成入库作业 ,如果生成返回信息
|
||||||
|
RequestLog requestLog = requestLogService.getRequestLog(SEND_CARGOSPACE, "请求分配货位", JSONUtil.toJsonStr(param));
|
||||||
|
if ("1".equals(requestLog.getIsSuccessful())) {
|
||||||
|
InterfaceReceive bean = JSONUtil.toBean(requestLog.getResponseBody(), InterfaceReceive.class);
|
||||||
|
return AjaxResult.success(bean.getData());
|
||||||
|
} else {
|
||||||
|
return AjaxResult.error();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AjaxResult receiveOutMydoJob(ReceiveJob receiveOutJob) {
|
public AjaxResult receiveOutMydoJob(ReceiveJob receiveOutJob) {
|
||||||
MydoJob mydoJob = new MydoJob();
|
MydoJob mydoJob = new MydoJob();
|
||||||
mydoJob.setJobId(receiveOutJob.getJobId());
|
mydoJob.setJobId(receiveOutJob.getJobId());
|
||||||
mydoJob.setTaskNo(receiveOutJob.getTaskNo());
|
mydoJob.setTaskNo(receiveOutJob.getTaskNo());
|
||||||
mydoJob.setCargoSpaceId(receiveOutJob.getCargoSpaceId());
|
mydoJob.setCargoSpaceId(receiveOutJob.getCargoSpaceId());
|
||||||
|
mydoJob.setTargetCargoSpaceId(receiveOutJob.getTargetCargoSpaceId());
|
||||||
mydoJob.setExitId(receiveOutJob.getExitId());
|
mydoJob.setExitId(receiveOutJob.getExitId());
|
||||||
mydoJob.setInOrOut(receiveOutJob.getInOrOut());
|
mydoJob.setInOrOut(receiveOutJob.getInOrOut());
|
||||||
mydoJob.setStatus("1");
|
mydoJob.setStatus("1");
|
||||||
@@ -360,10 +376,12 @@ public class ApiServiceImpl implements IApiService {
|
|||||||
mydoJob.setRoadwayId(receiveOutJob.getRoadwayId());
|
mydoJob.setRoadwayId(receiveOutJob.getRoadwayId());
|
||||||
mydoJob.setCreateTime(DateUtils.getNowDate());
|
mydoJob.setCreateTime(DateUtils.getNowDate());
|
||||||
mydoJob.setExecutionPhase("0");
|
mydoJob.setExecutionPhase("0");
|
||||||
|
mydoJob.setTheFloor(receiveOutJob.getClassId());
|
||||||
|
mydoJob.setPriority(receiveOutJob.getPriority());
|
||||||
int i = mydoJobService.insertMydoJob(mydoJob);
|
int i = mydoJobService.insertMydoJob(mydoJob);
|
||||||
if (i > 0) {
|
if (i > 0) {
|
||||||
return AjaxResult.success();
|
return AjaxResult.success();
|
||||||
}else{
|
} else {
|
||||||
return AjaxResult.error();
|
return AjaxResult.error();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -385,7 +403,7 @@ public class ApiServiceImpl implements IApiService {
|
|||||||
int i = mydoJobService.insertMydoJob(mydoJob);
|
int i = mydoJobService.insertMydoJob(mydoJob);
|
||||||
if (i > 0) {
|
if (i > 0) {
|
||||||
return AjaxResult.success();
|
return AjaxResult.success();
|
||||||
}else{
|
} else {
|
||||||
return AjaxResult.error();
|
return AjaxResult.error();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -430,4 +448,108 @@ public class ApiServiceImpl implements IApiService {
|
|||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AjaxResult OutMakeSure(HashMap<String, Object> map) {
|
||||||
|
RequestLog requestLog = requestLogService.getRequestLog(OUT_MAKE_SURE, "线边直出请求过账", JSONUtil.toJsonStr(map));
|
||||||
|
if ("1".equals(requestLog.getIsSuccessful())) {
|
||||||
|
InterfaceReceive bean = JSONUtil.toBean(requestLog.getResponseBody(), InterfaceReceive.class);
|
||||||
|
return AjaxResult.success(bean.getData());
|
||||||
|
} else {
|
||||||
|
return AjaxResult.error();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateLed(HashMap<String, Object> map) {
|
||||||
|
RequestLog requestLog = requestLogService.getRequestLog(UPDATE_LED, "出库到位更新LED", JSONUtil.toJsonStr(map));
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateLedError(HashMap<String, Object> map) {
|
||||||
|
RequestLog requestLog = requestLogService.getRequestLog(UPDATE_LED_ERROR, "更新线体报错信息", JSONUtil.toJsonStr(map));
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void sendContarTask() {
|
||||||
|
RequestLog requestLog = requestLogService.getRequestLog(QUERY_AGV_QUENE, "请求获取AGV执行队列", JSONUtil.toJsonStr(""));
|
||||||
|
if ("1".equals(requestLog.getIsSuccessful())) {
|
||||||
|
InterfaceReceive bean = JSONUtil.toBean(requestLog.getResponseBody(), InterfaceReceive.class);
|
||||||
|
AgvContainerTask bean1 = BeanUtil.toBean(bean.getData(), AgvContainerTask.class);
|
||||||
|
bean1.setStatus("0");
|
||||||
|
agvContainerTaskService.insertAgvContainerTask(bean1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AjaxResult sendAgvCar(Map<String, String> param) {
|
||||||
|
RequestLog requestLog = requestLogService.getRequestLogs(SEND_AGV_CAR, "下发AGV执行对列", JSONUtil.toJsonStr(param));
|
||||||
|
if ("1".equals(requestLog.getIsSuccessful())) {
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
|
{
|
||||||
|
return AjaxResult.error();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AjaxResult insertAgvQuene(HashMap<String, Object> param) {
|
||||||
|
RequestLog requestLog = requestLogService.getRequestLog(INSERT_AGV_QUENE, "请求自动生成AGV执行队列", JSONUtil.toJsonStr(param));
|
||||||
|
if ("1".equals(requestLog.getIsSuccessful())) {
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
|
{
|
||||||
|
return AjaxResult.error();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void finishAgvJob(String container) {
|
||||||
|
HashMap<Object, Object> objectObjectHashMap = new HashMap<>();
|
||||||
|
objectObjectHashMap.put("order", container);
|
||||||
|
RequestLog requestLog = requestLogService.getRequestLog(FINISH_AGV_QUENE, "完成AGV执行队列", JSONUtil.toJsonStr(objectObjectHashMap));
|
||||||
|
if ("1".equals(requestLog.getIsSuccessful())) {
|
||||||
|
|
||||||
|
agvContainerTaskService.deleteAgvContainerTaskByOrderId(container);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AjaxResult tidyVehicleSnapshot() {
|
||||||
|
List<DeviceSrgv> vehicles = deviceSrgvMapper.selectDeviceSrgvList(new DeviceSrgv());
|
||||||
|
List<SrgvVehicleSnapshot> snapshots = new ArrayList<>();
|
||||||
|
for (DeviceSrgv vehicle : vehicles) {
|
||||||
|
boolean online = "1".equals(vehicle.getAgvStatus());
|
||||||
|
boolean healthy = online && value(vehicle.getAlarm()) <= 1 && value(vehicle.getErrMsg()) == 0;
|
||||||
|
boolean idle = healthy && value(vehicle.getTaskNo()) == 0
|
||||||
|
&& value(vehicle.getLocked()) == 0 && value(vehicle.getChargeFlag()) == 0;
|
||||||
|
SrgvVehicleSnapshot snapshot = new SrgvVehicleSnapshot();
|
||||||
|
snapshot.setGuid(vehicle.getGuid());
|
||||||
|
snapshot.setDeviceId(vehicle.getDeviceId());
|
||||||
|
snapshot.setDeviceName(vehicle.getDeviceName());
|
||||||
|
snapshot.setAgvStatus(vehicle.getAgvStatus());
|
||||||
|
snapshot.setOnline(online);
|
||||||
|
snapshot.setHealthy(healthy);
|
||||||
|
snapshot.setIdle(idle);
|
||||||
|
snapshot.setTaskNo(vehicle.getTaskNo());
|
||||||
|
snapshot.setAlarm(vehicle.getAlarm());
|
||||||
|
snapshot.setErrMsg(vehicle.getErrMsg());
|
||||||
|
snapshot.setChargeFlag(vehicle.getChargeFlag());
|
||||||
|
snapshot.setLocked(vehicle.getLocked());
|
||||||
|
snapshot.setBattery(vehicle.getBattery());
|
||||||
|
snapshot.setCurrSite(vehicle.getCurrSite());
|
||||||
|
snapshot.setCurrFloor(vehicle.getCurrFloor());
|
||||||
|
snapshots.add(snapshot);
|
||||||
|
}
|
||||||
|
return AjaxResult.success(snapshots);
|
||||||
|
}
|
||||||
|
|
||||||
|
private int value(Integer number) {
|
||||||
|
return number == null ? 0 : number;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ import java.util.List;
|
|||||||
import cn.hutool.core.convert.Convert;
|
import cn.hutool.core.convert.Convert;
|
||||||
import cn.hutool.core.date.DateUnit;
|
import cn.hutool.core.date.DateUnit;
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import cn.hutool.http.ContentType;
|
||||||
|
import cn.hutool.http.HttpResponse;
|
||||||
import cn.hutool.http.HttpUtil;
|
import cn.hutool.http.HttpUtil;
|
||||||
import cn.hutool.json.JSONUtil;
|
import cn.hutool.json.JSONUtil;
|
||||||
import com.ruoyi.api.domain.InterfaceReceive;
|
import com.ruoyi.api.domain.InterfaceReceive;
|
||||||
@@ -24,8 +26,7 @@ import com.ruoyi.api.service.IRequestLogService;
|
|||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class RequestLogServiceImpl implements IRequestLogService
|
public class RequestLogServiceImpl implements IRequestLogService {
|
||||||
{
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private RequestLogMapper requestLogMapper;
|
private RequestLogMapper requestLogMapper;
|
||||||
|
|
||||||
@@ -36,8 +37,7 @@ public class RequestLogServiceImpl implements IRequestLogService
|
|||||||
* @return 接口记录
|
* @return 接口记录
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public RequestLog selectRequestLogByRequestId(Long requestId)
|
public RequestLog selectRequestLogByRequestId(Long requestId) {
|
||||||
{
|
|
||||||
return requestLogMapper.selectRequestLogByRequestId(requestId);
|
return requestLogMapper.selectRequestLogByRequestId(requestId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -48,8 +48,7 @@ public class RequestLogServiceImpl implements IRequestLogService
|
|||||||
* @return 接口记录
|
* @return 接口记录
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<RequestLog> selectRequestLogList(RequestLog requestLog)
|
public List<RequestLog> selectRequestLogList(RequestLog requestLog) {
|
||||||
{
|
|
||||||
return requestLogMapper.selectRequestLogList(requestLog);
|
return requestLogMapper.selectRequestLogList(requestLog);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -60,11 +59,10 @@ public class RequestLogServiceImpl implements IRequestLogService
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int insertRequestLog(RequestLog requestLog)
|
public int insertRequestLog(RequestLog requestLog) {
|
||||||
{
|
if ("1".equals(requestLog.getIsSuccessful())) {
|
||||||
if ("1".equals(requestLog.getIsSuccessful())){
|
|
||||||
return requestLogMapper.insertRequestLog(requestLog);
|
return requestLogMapper.insertRequestLog(requestLog);
|
||||||
}else {
|
} else {
|
||||||
//log.error("请求失败:" + requestLog.getErrorDetails());
|
//log.error("请求失败:" + requestLog.getErrorDetails());
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -77,8 +75,7 @@ public class RequestLogServiceImpl implements IRequestLogService
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int updateRequestLog(RequestLog requestLog)
|
public int updateRequestLog(RequestLog requestLog) {
|
||||||
{
|
|
||||||
return requestLogMapper.updateRequestLog(requestLog);
|
return requestLogMapper.updateRequestLog(requestLog);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -89,8 +86,7 @@ public class RequestLogServiceImpl implements IRequestLogService
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int deleteRequestLogByRequestIds(Long[] requestIds)
|
public int deleteRequestLogByRequestIds(Long[] requestIds) {
|
||||||
{
|
|
||||||
return requestLogMapper.deleteRequestLogByRequestIds(requestIds);
|
return requestLogMapper.deleteRequestLogByRequestIds(requestIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -101,8 +97,7 @@ public class RequestLogServiceImpl implements IRequestLogService
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int deleteRequestLogByRequestId(Long requestId)
|
public int deleteRequestLogByRequestId(Long requestId) {
|
||||||
{
|
|
||||||
return requestLogMapper.deleteRequestLogByRequestId(requestId);
|
return requestLogMapper.deleteRequestLogByRequestId(requestId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -115,7 +110,7 @@ public class RequestLogServiceImpl implements IRequestLogService
|
|||||||
* @return requestLog
|
* @return requestLog
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public RequestLog getRequestLog(String url, String endPoint,String param) {
|
public RequestLog getRequestLog(String url, String endPoint, String param) {
|
||||||
RequestLog requestLog = new RequestLog();
|
RequestLog requestLog = new RequestLog();
|
||||||
Date requestTime = new Date();
|
Date requestTime = new Date();
|
||||||
requestLog.setRequestTime(DateUtil.format(requestTime, "yyyy-MM-dd HH:mm:ss"));
|
requestLog.setRequestTime(DateUtil.format(requestTime, "yyyy-MM-dd HH:mm:ss"));
|
||||||
@@ -128,15 +123,17 @@ public class RequestLogServiceImpl implements IRequestLogService
|
|||||||
requestLog.setRequestUrl(url);
|
requestLog.setRequestUrl(url);
|
||||||
try {
|
try {
|
||||||
String resStr = HttpUtil.post(url, param);
|
String resStr = HttpUtil.post(url, param);
|
||||||
|
|
||||||
requestLog.setResponseBody(resStr);
|
requestLog.setResponseBody(resStr);
|
||||||
|
|
||||||
InterfaceReceive bean = JSONUtil.toBean(resStr, InterfaceReceive.class);
|
InterfaceReceive bean = JSONUtil.toBean(resStr, InterfaceReceive.class);
|
||||||
Date responseTime =new Date();
|
Date responseTime = new Date();
|
||||||
if (bean.getCode() == 200) {
|
if (bean.getCode() == 200) {
|
||||||
requestLog.setResponseTime(DateUtil.format(responseTime, "yyyy-MM-dd HH:mm:ss"));
|
requestLog.setResponseTime(DateUtil.format(responseTime, "yyyy-MM-dd HH:mm:ss"));
|
||||||
requestLog.setResponseStatus("1");
|
requestLog.setResponseStatus("1");
|
||||||
requestLog.setDuration(Convert.toStr(DateUtil.between(requestTime, responseTime, DateUnit.MS)));
|
requestLog.setDuration(Convert.toStr(DateUtil.between(requestTime, responseTime, DateUnit.MS)));
|
||||||
requestLog.setIsSuccessful("1");
|
requestLog.setIsSuccessful("1");
|
||||||
}else {
|
} else {
|
||||||
requestLog.setResponseStatus("0");
|
requestLog.setResponseStatus("0");
|
||||||
requestLog.setErrorDetails(bean.getMsg());
|
requestLog.setErrorDetails(bean.getMsg());
|
||||||
requestLog.setIsSuccessful("0");
|
requestLog.setIsSuccessful("0");
|
||||||
@@ -171,4 +168,46 @@ public class RequestLogServiceImpl implements IRequestLogService
|
|||||||
requestLog.setDuration(Convert.toStr(DateUtil.between(requestTime, requestTime, DateUnit.MS)));
|
requestLog.setDuration(Convert.toStr(DateUtil.between(requestTime, requestTime, DateUnit.MS)));
|
||||||
return requestLog;
|
return requestLog;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public RequestLog getRequestLogs(String url, String param, String endPoint) {
|
||||||
|
RequestLog requestLog = new RequestLog();
|
||||||
|
Date requestTime = new Date();
|
||||||
|
requestLog.setRequestTime(DateUtil.format(requestTime, "yyyy-MM-dd HH:mm:ss"));
|
||||||
|
requestLog.setSourceSystem("wcs");
|
||||||
|
requestLog.setTargetSystem("wms");
|
||||||
|
requestLog.setEndpoint(param);
|
||||||
|
requestLog.setRequestMethod("post");
|
||||||
|
requestLog.setRequestHeaders(null);
|
||||||
|
requestLog.setRequestBody(endPoint);
|
||||||
|
requestLog.setRequestUrl(url);
|
||||||
|
try {
|
||||||
|
// 链式创建POST请求,获取完整响应对象
|
||||||
|
HttpResponse response = HttpUtil.createPost(url)
|
||||||
|
.body(endPoint, "application/json") // 传入表单参数
|
||||||
|
.execute();
|
||||||
|
String body = response.body();
|
||||||
|
int status = response.getStatus();
|
||||||
|
InterfaceReceive bean = JSONUtil.toBean(body, InterfaceReceive.class);
|
||||||
|
Date responseTime = new Date();
|
||||||
|
if (status == 200) {
|
||||||
|
requestLog.setResponseTime(DateUtil.format(responseTime, "yyyy-MM-dd HH:mm:ss"));
|
||||||
|
requestLog.setResponseStatus("1");
|
||||||
|
requestLog.setDuration(Convert.toStr(DateUtil.between(requestTime, responseTime, DateUnit.MS)));
|
||||||
|
requestLog.setIsSuccessful("1");
|
||||||
|
} else {
|
||||||
|
requestLog.setResponseStatus("0");
|
||||||
|
requestLog.setErrorDetails(bean.getMsg());
|
||||||
|
requestLog.setIsSuccessful("0");
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
requestLog.setErrorDetails(e.getMessage());
|
||||||
|
requestLog.setIsSuccessful("0");
|
||||||
|
requestLog.setResponseStatus("0");
|
||||||
|
} finally {
|
||||||
|
insertRequestLog(requestLog);
|
||||||
|
}
|
||||||
|
return requestLog;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
package com.ruoyi.bas.srgvmap.mapper;
|
package com.ruoyi.bas.srgvmap.mapper;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import com.ruoyi.bas.srgvmap.domain.WcsSrgvMap;
|
import com.ruoyi.bas.srgvmap.domain.WcsSrgvMap;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 小车点位地图表Mapper接口
|
* 小车点位地图表Mapper接口
|
||||||
@@ -62,4 +64,8 @@ public interface WcsSrgvMapMapper
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteWcsSrgvMapByGuids(String[] guids);
|
public int deleteWcsSrgvMapByGuids(String[] guids);
|
||||||
|
|
||||||
|
List<WcsSrgvMap> selectNotInsite( @Param("cache") String cache,
|
||||||
|
@Param("floor") Integer floor,
|
||||||
|
@Param("sites") ArrayList<String> sites);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.ruoyi.bas.srgvmap.service;
|
package com.ruoyi.bas.srgvmap.service;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import com.ruoyi.bas.srgvmap.domain.WcsSrgvMap;
|
import com.ruoyi.bas.srgvmap.domain.WcsSrgvMap;
|
||||||
|
|
||||||
@@ -62,4 +63,6 @@ public interface IWcsSrgvMapService
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteWcsSrgvMapByGuid(String guid);
|
public int deleteWcsSrgvMapByGuid(String guid);
|
||||||
|
|
||||||
|
List<WcsSrgvMap> selectNotInsite(String cache, Integer floor, ArrayList<String> sites);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ package com.ruoyi.bas.srgvmap.service;
|
|||||||
import com.ruoyi.bas.srgvmap.domain.WcsSrgvMap;
|
import com.ruoyi.bas.srgvmap.domain.WcsSrgvMap;
|
||||||
import com.ruoyi.device.srgv.domain.DeviceSrgv;
|
import com.ruoyi.device.srgv.domain.DeviceSrgv;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
public interface RoadCacheService {
|
public interface RoadCacheService {
|
||||||
@@ -18,11 +17,13 @@ public interface RoadCacheService {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 处理地图
|
* 处理地图
|
||||||
|
*
|
||||||
* @param arrByRoadSite
|
* @param arrByRoadSite
|
||||||
* @param deviceSrgv
|
* @param deviceSrgv
|
||||||
|
* @param floor
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
int[][] handleMap(Map<String, WcsSrgvMap> arrByRoadSite, DeviceSrgv deviceSrgv);
|
int[][] handleMap(Map<String, WcsSrgvMap> arrByRoadSite, DeviceSrgv deviceSrgv, Integer floor);
|
||||||
/**
|
/**
|
||||||
* 根据x y z 获取指定位置的缓存
|
* 根据x y z 获取指定位置的缓存
|
||||||
* @param x
|
* @param x
|
||||||
|
|||||||
@@ -41,29 +41,27 @@ public class RoadCacheServiceImpl implements RoadCacheService {
|
|||||||
for (WcsSrgvMap wcsSrgvMap : wcsSrgvMaps) {
|
for (WcsSrgvMap wcsSrgvMap : wcsSrgvMaps) {
|
||||||
maps.put(wcsSrgvMap.getSiteId(), wcsSrgvMap);
|
maps.put(wcsSrgvMap.getSiteId(), wcsSrgvMap);
|
||||||
}
|
}
|
||||||
param.setAxy("11,9");
|
|
||||||
List<WcsSrgvMap> tsjMap = wcsSrgvMapMapper.selectWcsSrgvMapList(param);
|
|
||||||
for (WcsSrgvMap wcsSrgvMap : tsjMap) {
|
|
||||||
maps.put("tsj",wcsSrgvMap);
|
|
||||||
}
|
|
||||||
return maps;
|
return maps;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int[][] handleMap(Map<String, WcsSrgvMap> maps, DeviceSrgv deviceSrgv) {
|
public int[][] handleMap(Map<String, WcsSrgvMap> maps, DeviceSrgv deviceSrgv, Integer floor) {
|
||||||
|
|
||||||
//1.锁定其他车任务路径
|
//1.锁定其他车任务路径
|
||||||
lockedOtherCarQueuePath(maps, deviceSrgv);
|
lockedOtherCarQueuePath(maps, deviceSrgv);
|
||||||
//2.锁定无任务小车当前位置
|
//2.锁定无任务小车当前位置
|
||||||
lockedOtherCarCurrSite(maps, deviceSrgv);
|
// lockedOtherCarCurrSite(maps, deviceSrgv);
|
||||||
//3.锁定离线小车当前位置
|
//3.锁定离线小车当前位置
|
||||||
lockedOfflineCarCurrSite(maps, deviceSrgv);
|
lockedOfflineCarCurrSite(maps, deviceSrgv);
|
||||||
|
maps.put("tsj", maps.get("07050" + floor));
|
||||||
|
//4.锁定满货位的位置 TODO 是否存在移库影响效率
|
||||||
int[][] mapsInt = new int[50][50];
|
int[][] mapsInt = new int[50][50];
|
||||||
for (String site : maps.keySet()) {
|
for (String site : maps.keySet()) {
|
||||||
WcsSrgvMap wcsSrgvMap = maps.get(site);
|
WcsSrgvMap wcsSrgvMap = maps.get(site);
|
||||||
mapsInt[wcsSrgvMap.getX()][wcsSrgvMap.getY()] = wcsSrgvMap.getValue();
|
mapsInt[wcsSrgvMap.getX()][wcsSrgvMap.getY()] = wcsSrgvMap.getValue();
|
||||||
if (wcsSrgvMap.getAxy().equals("11,8")){
|
|
||||||
|
if (wcsSrgvMap.getAxy().equals("11,9")) {
|
||||||
System.err.println(wcsSrgvMap.getValue());
|
System.err.println(wcsSrgvMap.getValue());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -77,7 +75,7 @@ public class RoadCacheServiceImpl implements RoadCacheService {
|
|||||||
param.setY(y);
|
param.setY(y);
|
||||||
param.setZ(z);
|
param.setZ(z);
|
||||||
List<WcsSrgvMap> wcsSrgvMaps = wcsSrgvMapMapper.selectWcsSrgvMapList(param);
|
List<WcsSrgvMap> wcsSrgvMaps = wcsSrgvMapMapper.selectWcsSrgvMapList(param);
|
||||||
if (CollUtil.isNotEmpty(wcsSrgvMaps)){
|
if (CollUtil.isNotEmpty(wcsSrgvMaps)) {
|
||||||
return wcsSrgvMaps.get(0);
|
return wcsSrgvMaps.get(0);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
@@ -142,8 +140,18 @@ public class RoadCacheServiceImpl implements RoadCacheService {
|
|||||||
//添加其他小车路径列表
|
//添加其他小车路径列表
|
||||||
HashSet<String> otherCarSiteList = new HashSet<>();
|
HashSet<String> otherCarSiteList = new HashSet<>();
|
||||||
for (WcsSrgvQueue wcsSrgvQueue : otherCarQueue) {
|
for (WcsSrgvQueue wcsSrgvQueue : otherCarQueue) {
|
||||||
if (wcsSrgvQueue.getPathInfo()!=null) {
|
if (wcsSrgvQueue.getPathInfo() != null) {
|
||||||
otherCarSiteList.addAll(Arrays.asList(wcsSrgvQueue.getPathInfo().split(",")));
|
//根据小车当前点位去除已走路径 除了当前点和上一个点之外都解锁
|
||||||
|
DeviceSrgv otherCarCurrStatus = deviceSrgvService.selectDeviceSrgvByGuid(wcsSrgvQueue.getAgvId());
|
||||||
|
String currSite = otherCarCurrStatus.getCurrSite();
|
||||||
|
List<String> allSiteList = Arrays.asList(wcsSrgvQueue.getPathInfo().split(","));
|
||||||
|
int i = allSiteList.indexOf(currSite);
|
||||||
|
if (i == -1) {
|
||||||
|
i = 0;
|
||||||
|
}
|
||||||
|
List<String> resultSiteList = allSiteList.subList(i, allSiteList.size());
|
||||||
|
otherCarSiteList.addAll(resultSiteList);
|
||||||
|
//otherCarSiteList.addAll(Arrays.asList(wcsSrgvQueue.getPathInfo().split(",")));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//锁定其他小车路径
|
//锁定其他小车路径
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
package com.ruoyi.bas.srgvmap.service.impl;
|
package com.ruoyi.bas.srgvmap.service.impl;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.ruoyi.bas.srgvmap.mapper.WcsSrgvMapMapper;
|
import com.ruoyi.bas.srgvmap.mapper.WcsSrgvMapMapper;
|
||||||
@@ -14,8 +16,7 @@ import com.ruoyi.bas.srgvmap.service.IWcsSrgvMapService;
|
|||||||
* @date 2025-11-21
|
* @date 2025-11-21
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class WcsSrgvMapServiceImpl implements IWcsSrgvMapService
|
public class WcsSrgvMapServiceImpl implements IWcsSrgvMapService {
|
||||||
{
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private WcsSrgvMapMapper wcsSrgvMapMapper;
|
private WcsSrgvMapMapper wcsSrgvMapMapper;
|
||||||
|
|
||||||
@@ -26,8 +27,7 @@ public class WcsSrgvMapServiceImpl implements IWcsSrgvMapService
|
|||||||
* @return 小车点位地图表
|
* @return 小车点位地图表
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public WcsSrgvMap selectWcsSrgvMapByGuid(String guid)
|
public WcsSrgvMap selectWcsSrgvMapByGuid(String guid) {
|
||||||
{
|
|
||||||
return wcsSrgvMapMapper.selectWcsSrgvMapByGuid(guid);
|
return wcsSrgvMapMapper.selectWcsSrgvMapByGuid(guid);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -43,8 +43,7 @@ public class WcsSrgvMapServiceImpl implements IWcsSrgvMapService
|
|||||||
* @return 小车点位地图表
|
* @return 小车点位地图表
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<WcsSrgvMap> selectWcsSrgvMapList(WcsSrgvMap wcsSrgvMap)
|
public List<WcsSrgvMap> selectWcsSrgvMapList(WcsSrgvMap wcsSrgvMap) {
|
||||||
{
|
|
||||||
return wcsSrgvMapMapper.selectWcsSrgvMapList(wcsSrgvMap);
|
return wcsSrgvMapMapper.selectWcsSrgvMapList(wcsSrgvMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -55,8 +54,7 @@ public class WcsSrgvMapServiceImpl implements IWcsSrgvMapService
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int insertWcsSrgvMap(WcsSrgvMap wcsSrgvMap)
|
public int insertWcsSrgvMap(WcsSrgvMap wcsSrgvMap) {
|
||||||
{
|
|
||||||
return wcsSrgvMapMapper.insertWcsSrgvMap(wcsSrgvMap);
|
return wcsSrgvMapMapper.insertWcsSrgvMap(wcsSrgvMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -67,8 +65,7 @@ public class WcsSrgvMapServiceImpl implements IWcsSrgvMapService
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int updateWcsSrgvMap(WcsSrgvMap wcsSrgvMap)
|
public int updateWcsSrgvMap(WcsSrgvMap wcsSrgvMap) {
|
||||||
{
|
|
||||||
return wcsSrgvMapMapper.updateWcsSrgvMap(wcsSrgvMap);
|
return wcsSrgvMapMapper.updateWcsSrgvMap(wcsSrgvMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -79,8 +76,7 @@ public class WcsSrgvMapServiceImpl implements IWcsSrgvMapService
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int deleteWcsSrgvMapByGuids(String[] guids)
|
public int deleteWcsSrgvMapByGuids(String[] guids) {
|
||||||
{
|
|
||||||
return wcsSrgvMapMapper.deleteWcsSrgvMapByGuids(guids);
|
return wcsSrgvMapMapper.deleteWcsSrgvMapByGuids(guids);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -91,8 +87,12 @@ public class WcsSrgvMapServiceImpl implements IWcsSrgvMapService
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int deleteWcsSrgvMapByGuid(String guid)
|
public int deleteWcsSrgvMapByGuid(String guid) {
|
||||||
{
|
|
||||||
return wcsSrgvMapMapper.deleteWcsSrgvMapByGuid(guid);
|
return wcsSrgvMapMapper.deleteWcsSrgvMapByGuid(guid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<WcsSrgvMap> selectNotInsite(String cache, Integer floor, ArrayList<String> sites) {
|
||||||
|
return wcsSrgvMapMapper.selectNotInsite(cache, floor, sites);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,20 +4,26 @@ package com.ruoyi.common;
|
|||||||
public class Constant {
|
public class Constant {
|
||||||
|
|
||||||
public static final String WMS_BASE_URL = "http://localhost:8080/api2wms/";
|
public static final String WMS_BASE_URL = "http://localhost:8080/api2wms/";
|
||||||
public static final String RCS_BASE_URL = "http://127.0.0.1:8081/rcms-dps/rest/";
|
public static final String RCS_BASE_URL = "http://192.168.188.251:9501/";
|
||||||
|
public static final String WMS_BASE_PDA_URL = "http://localhost:8080/pda/";
|
||||||
|
|
||||||
public static final String JOB_FINISH_URL = WMS_BASE_URL+"jobFinish";
|
public static final String JOB_FINISH_URL = WMS_BASE_URL+"jobFinish";
|
||||||
public static final String CONTINUE_TASK_URL = RCS_BASE_URL+"continueTask";
|
public static final String CONTINUE_TASK_URL = RCS_BASE_URL+"continueTask";
|
||||||
public static final String CANCEL_TASK_URL = RCS_BASE_URL+"queryAgvStatus";;
|
public static final String CANCEL_TASK_URL = RCS_BASE_URL+"queryAgvStatus";;
|
||||||
public static final String GEN_AGV_SCHEDULING_TASK = RCS_BASE_URL+"genAgvSchedulingTask";;
|
public static final String GEN_AGV_SCHEDULING_TASK = RCS_BASE_URL+"genAgvSchedulingTask";;
|
||||||
public static final String CREATE_IN_MYDO_JOB_URL = WMS_BASE_URL+"requestEnterByTrayCode";
|
public static final String CREATE_IN_MYDO_JOB_URL = WMS_BASE_URL+"requestEnterByTrayCode";
|
||||||
|
public static final String SEND_CARGOSPACE = WMS_BASE_URL+"sendCargoSpace";
|
||||||
public static final String REQUEST_MYDO_JOB_URL = WMS_BASE_URL+"requestByNoTrayCode";
|
public static final String REQUEST_MYDO_JOB_URL = WMS_BASE_URL+"requestByNoTrayCode";
|
||||||
public static final String RE_ASSIGN_URL = WMS_BASE_URL+"reAssign";
|
public static final String RE_ASSIGN_URL = WMS_BASE_URL+"reAssign";
|
||||||
public static final String RE_MATERIAL_URL = WMS_BASE_URL+"reMaterial";
|
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_ENTER_URL = WMS_BASE_URL+"requestEnterByTrayCodeAndEntranceId";
|
||||||
|
public static final String OUT_MAKE_SURE=WMS_BASE_PDA_URL+"outMakeSure";
|
||||||
|
public static final String UPDATE_LED=WMS_BASE_URL+"updateLed";
|
||||||
|
public static final String QUERY_AGV_QUENE=WMS_BASE_URL+"queryAgvQuene";
|
||||||
|
public static final String FINISH_AGV_QUENE=WMS_BASE_URL+"finishAgvQuene";
|
||||||
|
public static final String SEND_AGV_CAR=RCS_BASE_URL+"api/app/agvs-task";
|
||||||
|
public static final String INSERT_AGV_QUENE=WMS_BASE_URL+"insertAgvQuene";
|
||||||
|
public static final String UPDATE_LED_ERROR=WMS_BASE_URL+"updateLedError";
|
||||||
public static final String WAREHOUSE_01 = "01";
|
public static final String WAREHOUSE_01 = "01";
|
||||||
public static final String WAREHOUSE_02 = "02";
|
public static final String WAREHOUSE_02 = "02";
|
||||||
|
|
||||||
|
|||||||
@@ -68,4 +68,6 @@ public interface DeviceCdzMapper
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<DeviceCdz> selectDeviceCdzHasSRgvList();
|
List<DeviceCdz> selectDeviceCdzHasSRgvList();
|
||||||
|
|
||||||
|
void updateDeviceCdzSpare(DeviceCdz deviceCdz);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -68,4 +68,6 @@ public interface IDeviceCdzService
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<DeviceCdz> selectDeviceCdzHasSRgvList();
|
List<DeviceCdz> selectDeviceCdzHasSRgvList();
|
||||||
|
|
||||||
|
void updateDeviceCdzSpare(DeviceCdz deviceCdz);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -100,4 +100,9 @@ public class DeviceCdzServiceImpl implements IDeviceCdzService
|
|||||||
public List<DeviceCdz> selectDeviceCdzHasSRgvList() {
|
public List<DeviceCdz> selectDeviceCdzHasSRgvList() {
|
||||||
return deviceCdzMapper.selectDeviceCdzHasSRgvList();
|
return deviceCdzMapper.selectDeviceCdzHasSRgvList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateDeviceCdzSpare(DeviceCdz deviceCdz) {
|
||||||
|
deviceCdzMapper.updateDeviceCdzSpare(deviceCdz);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -83,6 +83,8 @@ public class DeviceSsj extends BaseEntity
|
|||||||
|
|
||||||
@Excel(name="输送线模式 1-入库 2-出库")
|
@Excel(name="输送线模式 1-入库 2-出库")
|
||||||
private int model;
|
private int model;
|
||||||
|
// 报警信息
|
||||||
|
private int errorCode;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.ruoyi.job.controller;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
@@ -29,8 +30,7 @@ import com.ruoyi.common.core.page.TableDataInfo;
|
|||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/job/mydoJob")
|
@RequestMapping("/job/mydoJob")
|
||||||
public class MydoJobController extends BaseController
|
public class MydoJobController extends BaseController {
|
||||||
{
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IMydoJobService mydoJobService;
|
private IMydoJobService mydoJobService;
|
||||||
|
|
||||||
@@ -39,8 +39,7 @@ public class MydoJobController extends BaseController
|
|||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('job:mydoJob:list')")
|
@PreAuthorize("@ss.hasPermi('job:mydoJob:list')")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public TableDataInfo list(MydoJob mydoJob)
|
public TableDataInfo list(MydoJob mydoJob) {
|
||||||
{
|
|
||||||
startPage();
|
startPage();
|
||||||
List<MydoJob> list = mydoJobService.selectMydoJobList(mydoJob);
|
List<MydoJob> list = mydoJobService.selectMydoJobList(mydoJob);
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
@@ -51,10 +50,11 @@ public class MydoJobController extends BaseController
|
|||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('job:mydoJob:list')")
|
@PreAuthorize("@ss.hasPermi('job:mydoJob:list')")
|
||||||
@GetMapping("/listFinish")
|
@GetMapping("/listFinish")
|
||||||
public TableDataInfo listFinish(MydoJob mydoJob)
|
public TableDataInfo listFinish(MydoJob mydoJob) {
|
||||||
{
|
|
||||||
startPage();
|
startPage();
|
||||||
|
// mydoJob.setStatus("3");
|
||||||
List<MydoJob> list = mydoJobService.selectMydoJobFinishList(mydoJob);
|
List<MydoJob> list = mydoJobService.selectMydoJobFinishList(mydoJob);
|
||||||
|
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -64,9 +64,15 @@ public class MydoJobController extends BaseController
|
|||||||
@PreAuthorize("@ss.hasPermi('job:mydoJob:export')")
|
@PreAuthorize("@ss.hasPermi('job:mydoJob:export')")
|
||||||
@Log(title = "作业信息", businessType = BusinessType.EXPORT)
|
@Log(title = "作业信息", businessType = BusinessType.EXPORT)
|
||||||
@PostMapping("/export")
|
@PostMapping("/export")
|
||||||
public void export(HttpServletResponse response, MydoJob mydoJob)
|
public void export(HttpServletResponse response, MydoJob mydoJob) {
|
||||||
{
|
List<MydoJob> list = null;
|
||||||
List<MydoJob> list = mydoJobService.selectMydoJobList(mydoJob);
|
if (mydoJob.getStatus().equals("3")) {
|
||||||
|
list = mydoJobService.selectMydoJobList(mydoJob);
|
||||||
|
} else {
|
||||||
|
|
||||||
|
list = mydoJobService.selectMydoJobFinishList(mydoJob);
|
||||||
|
}
|
||||||
|
|
||||||
ExcelUtil<MydoJob> util = new ExcelUtil<MydoJob>(MydoJob.class);
|
ExcelUtil<MydoJob> util = new ExcelUtil<MydoJob>(MydoJob.class);
|
||||||
util.exportExcel(response, list, "作业信息数据");
|
util.exportExcel(response, list, "作业信息数据");
|
||||||
}
|
}
|
||||||
@@ -76,8 +82,7 @@ public class MydoJobController extends BaseController
|
|||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('job:mydoJob:query')")
|
@PreAuthorize("@ss.hasPermi('job:mydoJob:query')")
|
||||||
@GetMapping(value = "/{jobId}")
|
@GetMapping(value = "/{jobId}")
|
||||||
public AjaxResult getInfo(@PathVariable("jobId") String jobId)
|
public AjaxResult getInfo(@PathVariable("jobId") String jobId) {
|
||||||
{
|
|
||||||
return success(mydoJobService.selectMydoJobByJobId(jobId));
|
return success(mydoJobService.selectMydoJobByJobId(jobId));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -87,8 +92,7 @@ public class MydoJobController extends BaseController
|
|||||||
@PreAuthorize("@ss.hasPermi('job:mydoJob:add')")
|
@PreAuthorize("@ss.hasPermi('job:mydoJob:add')")
|
||||||
@Log(title = "作业信息", businessType = BusinessType.INSERT)
|
@Log(title = "作业信息", businessType = BusinessType.INSERT)
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public AjaxResult add(@RequestBody MydoJob mydoJob)
|
public AjaxResult add(@RequestBody MydoJob mydoJob) {
|
||||||
{
|
|
||||||
return toAjax(mydoJobService.insertMydoJob(mydoJob));
|
return toAjax(mydoJobService.insertMydoJob(mydoJob));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -98,8 +102,7 @@ public class MydoJobController extends BaseController
|
|||||||
@PreAuthorize("@ss.hasPermi('job:mydoJob:edit')")
|
@PreAuthorize("@ss.hasPermi('job:mydoJob:edit')")
|
||||||
@Log(title = "作业信息", businessType = BusinessType.UPDATE)
|
@Log(title = "作业信息", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping
|
@PutMapping
|
||||||
public AjaxResult edit(@RequestBody MydoJob mydoJob)
|
public AjaxResult edit(@RequestBody MydoJob mydoJob) {
|
||||||
{
|
|
||||||
return toAjax(mydoJobService.updateMydoJob(mydoJob));
|
return toAjax(mydoJobService.updateMydoJob(mydoJob));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -108,9 +111,8 @@ public class MydoJobController extends BaseController
|
|||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('job:mydoJob:remove')")
|
@PreAuthorize("@ss.hasPermi('job:mydoJob:remove')")
|
||||||
@Log(title = "作业信息", businessType = BusinessType.DELETE)
|
@Log(title = "作业信息", businessType = BusinessType.DELETE)
|
||||||
@DeleteMapping("/{jobIds}")
|
@DeleteMapping("/{jobIds}")
|
||||||
public AjaxResult remove(@PathVariable String[] jobIds)
|
public AjaxResult remove(@PathVariable String[] jobIds) {
|
||||||
{
|
|
||||||
return toAjax(mydoJobService.deleteMydoJobByJobIds(jobIds));
|
return toAjax(mydoJobService.deleteMydoJobByJobIds(jobIds));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -118,8 +120,7 @@ public class MydoJobController extends BaseController
|
|||||||
@PreAuthorize("@ss.hasPermi('job:mydoJob:manualCallback')")
|
@PreAuthorize("@ss.hasPermi('job:mydoJob:manualCallback')")
|
||||||
@Log(title = "作业信息", businessType = BusinessType.UPDATE)
|
@Log(title = "作业信息", businessType = BusinessType.UPDATE)
|
||||||
@GetMapping("/manualCallback/{jobId}")
|
@GetMapping("/manualCallback/{jobId}")
|
||||||
public AjaxResult manualCallback(@PathVariable("jobId") String jobId)
|
public AjaxResult manualCallback(@PathVariable("jobId") String jobId) {
|
||||||
{
|
|
||||||
return mydoJobService.manualCallback(jobId);
|
return mydoJobService.manualCallback(jobId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,10 +24,11 @@ public class MydoJob extends BaseEntity
|
|||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
/** 任务ID */
|
/** 任务ID */
|
||||||
|
@Excel(name = "任务ID")
|
||||||
private String jobId;
|
private String jobId;
|
||||||
|
|
||||||
/** 任务状态 */
|
/** 任务状态 */
|
||||||
@Excel(name = "任务状态")
|
@Excel(name = "任务状态",dictType = "job_status")
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
/** 任务号 */
|
/** 任务号 */
|
||||||
@@ -35,7 +36,7 @@ public class MydoJob extends BaseEntity
|
|||||||
private String taskNo;
|
private String taskNo;
|
||||||
|
|
||||||
/** 巷道ID */
|
/** 巷道ID */
|
||||||
@Excel(name = "巷道ID")
|
// @Excel(name = "巷道ID")
|
||||||
private String roadwayId;
|
private String roadwayId;
|
||||||
|
|
||||||
/** 货位ID */
|
/** 货位ID */
|
||||||
@@ -55,11 +56,11 @@ public class MydoJob extends BaseEntity
|
|||||||
private Long priority;
|
private Long priority;
|
||||||
|
|
||||||
/** 执行阶段 */
|
/** 执行阶段 */
|
||||||
@Excel(name = "执行阶段")
|
// @Excel(name = "执行阶段")
|
||||||
private String executionPhase;
|
private String executionPhase;
|
||||||
|
|
||||||
/** 任务类型 */
|
/** 任务类型 */
|
||||||
@Excel(name = "任务类型")
|
@Excel(name = "任务类型",dictType = "job_type")
|
||||||
private String inOrOut;
|
private String inOrOut;
|
||||||
|
|
||||||
/** 开始时间 */
|
/** 开始时间 */
|
||||||
@@ -83,9 +84,9 @@ public class MydoJob extends BaseEntity
|
|||||||
private String warehouseId;
|
private String warehouseId;
|
||||||
|
|
||||||
/** 重分标志 */
|
/** 重分标志 */
|
||||||
@Excel(name = "重分标志")
|
// @Excel(name = "重分标志")
|
||||||
private String faultFlag;
|
private String faultFlag;
|
||||||
|
@Excel(name = "托盘条码")
|
||||||
private String trayCode;
|
private String trayCode;
|
||||||
|
|
||||||
private String inOut;
|
private String inOut;
|
||||||
@@ -94,4 +95,5 @@ public class MydoJob extends BaseEntity
|
|||||||
|
|
||||||
private String productId;
|
private String productId;
|
||||||
private String productName;
|
private String productName;
|
||||||
|
private String classId;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -81,4 +81,26 @@ public interface MydoJobMapper
|
|||||||
List<MydoJob> selectMydoJobFinishList(MydoJob mydoJob);
|
List<MydoJob> selectMydoJobFinishList(MydoJob mydoJob);
|
||||||
|
|
||||||
MydoJob selectRunningMydoJobByExitList(@Param("exitList") List<String> exitList);
|
MydoJob selectRunningMydoJobByExitList(@Param("exitList") List<String> exitList);
|
||||||
|
|
||||||
|
List<MydoJob> selectMydoJobOut();
|
||||||
|
|
||||||
|
MydoJob selectMydoJobByTrayCode(String trayCode);
|
||||||
|
|
||||||
|
Integer selectExit(String ssj);
|
||||||
|
|
||||||
|
Integer selectMydoJobCount();
|
||||||
|
|
||||||
|
Integer selectMydoJobIn();
|
||||||
|
|
||||||
|
Integer selectMydoJobCountOut();
|
||||||
|
|
||||||
|
Integer selectByJobOut(Integer currFloor);
|
||||||
|
|
||||||
|
Integer selectByJobOutIsOne(Integer currFloor);
|
||||||
|
|
||||||
|
Integer selectMydoJobExit(String exit);
|
||||||
|
|
||||||
|
Integer selectTheFloorYk(String theFloor);
|
||||||
|
|
||||||
|
void deleteMydoJobByTaskNos(List<String> validTaskNos);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -80,4 +80,24 @@ public interface IMydoJobService
|
|||||||
MydoJob selectRunningMydoJobByExitList(List<String> strings);
|
MydoJob selectRunningMydoJobByExitList(List<String> strings);
|
||||||
|
|
||||||
AjaxResult manualCallback(String jobId);
|
AjaxResult manualCallback(String jobId);
|
||||||
|
|
||||||
|
List<MydoJob> selectMydoJobOut();
|
||||||
|
|
||||||
|
MydoJob selectMydoJobByTrayCode(String trayCode);
|
||||||
|
|
||||||
|
Integer selectExit(String ssj);
|
||||||
|
|
||||||
|
Integer selectMydoJobCount();
|
||||||
|
|
||||||
|
Integer selectMydoJobIn();
|
||||||
|
|
||||||
|
Integer selectMydoJobCountOut();
|
||||||
|
|
||||||
|
Integer selectByJobOut(Integer currFloor);
|
||||||
|
|
||||||
|
Integer selectByJobOutIsOne(Integer currFloor);
|
||||||
|
|
||||||
|
Integer selectMydoJobExit(String exit);
|
||||||
|
|
||||||
|
Integer selectTheFloorYk(String theFloor);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -173,4 +173,55 @@ public class MydoJobServiceImpl implements IMydoJobService
|
|||||||
}
|
}
|
||||||
return AjaxResult.error("手动回调失败");
|
return AjaxResult.error("手动回调失败");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<MydoJob> selectMydoJobOut() {
|
||||||
|
return mydoJobMapper.selectMydoJobOut();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MydoJob selectMydoJobByTrayCode(String trayCode) {
|
||||||
|
return mydoJobMapper.selectMydoJobByTrayCode(trayCode);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer selectExit(String ssj) {
|
||||||
|
return mydoJobMapper.selectExit(ssj);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer selectMydoJobCount() {
|
||||||
|
return mydoJobMapper.selectMydoJobCount();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer selectMydoJobIn() {
|
||||||
|
return mydoJobMapper.selectMydoJobIn();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer selectMydoJobCountOut() {
|
||||||
|
return mydoJobMapper.selectMydoJobCountOut();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer selectByJobOut(Integer currFloor) {
|
||||||
|
|
||||||
|
return mydoJobMapper.selectByJobOut(currFloor);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer selectByJobOutIsOne(Integer currFloor) {
|
||||||
|
return mydoJobMapper.selectByJobOutIsOne(currFloor);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer selectMydoJobExit(String exit) {
|
||||||
|
return mydoJobMapper.selectMydoJobExit(exit);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer selectTheFloorYk(String theFloor) {
|
||||||
|
return mydoJobMapper.selectTheFloorYk(theFloor);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.ruoyi.queue.agv.mapper;
|
package com.ruoyi.queue.agv.mapper;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import com.ruoyi.queue.agv.domain.AgvQueue;
|
import com.ruoyi.queue.agv.domain.AgvQueue;
|
||||||
|
|
||||||
@@ -66,5 +67,9 @@ public interface AgvQueueMapper
|
|||||||
*/
|
*/
|
||||||
AgvQueue selectAgvQueueByTaskCode(String taskCode);
|
AgvQueue selectAgvQueueByTaskCode(String taskCode);
|
||||||
|
|
||||||
|
AgvQueue selectAgvQueueByStatus();
|
||||||
|
|
||||||
void insertHistory(String reqCode);
|
void insertHistory(String reqCode);
|
||||||
|
|
||||||
|
void selectKx(HashMap<String, Object> map);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.ruoyi.queue.agv.service;
|
package com.ruoyi.queue.agv.service;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import com.ruoyi.queue.agv.domain.AgvQueue;
|
import com.ruoyi.queue.agv.domain.AgvQueue;
|
||||||
|
|
||||||
@@ -66,9 +67,13 @@ public interface IAgvQueueService
|
|||||||
*/
|
*/
|
||||||
AgvQueue selectAgvQueueByTaskCode(String taskCode);
|
AgvQueue selectAgvQueueByTaskCode(String taskCode);
|
||||||
|
|
||||||
|
AgvQueue selectAgvQueueByStatus();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 插入agv完成历史
|
* 插入agv完成历史
|
||||||
* @param reqCode
|
* @param reqCode
|
||||||
*/
|
*/
|
||||||
void insertHistory(String reqCode);
|
void insertHistory(String reqCode);
|
||||||
|
|
||||||
|
void selectKx(HashMap<String, Object> map);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.ruoyi.queue.agv.service.impl;
|
package com.ruoyi.queue.agv.service.impl;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@@ -96,8 +97,18 @@ public class AgvQueueServiceImpl implements IAgvQueueService
|
|||||||
return agvQueueMapper.selectAgvQueueByTaskCode(taskCode);
|
return agvQueueMapper.selectAgvQueueByTaskCode(taskCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AgvQueue selectAgvQueueByStatus() {
|
||||||
|
return agvQueueMapper.selectAgvQueueByStatus();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void insertHistory(String reqCode) {
|
public void insertHistory(String reqCode) {
|
||||||
agvQueueMapper.insertHistory(reqCode);
|
agvQueueMapper.insertHistory(reqCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void selectKx(HashMap<String, Object> map) {
|
||||||
|
agvQueueMapper.selectKx(map);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.ruoyi.queue.srgv.mapper;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import com.ruoyi.queue.srgv.domain.WcsSrgvQueue;
|
import com.ruoyi.queue.srgv.domain.WcsSrgvQueue;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 四向小车任务队列Mapper接口
|
* 四向小车任务队列Mapper接口
|
||||||
@@ -70,4 +71,14 @@ public interface WcsSrgvQueueMapper
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteWcsSrgvQueueByGuids(String[] guids);
|
public int deleteWcsSrgvQueueByGuids(String[] guids);
|
||||||
|
|
||||||
|
String selectMinCountJob(@Param("list") List<String> outModelSSJ);
|
||||||
|
|
||||||
|
Integer selectTsj();
|
||||||
|
|
||||||
|
Integer selectByCaogoPlaceSite(String siteId);
|
||||||
|
|
||||||
|
Integer selectByEndSite();
|
||||||
|
|
||||||
|
List<String> selectTaskNosByGuids(String[] guids);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -77,4 +77,12 @@ public interface IWcsSrgvQueueService
|
|||||||
* @param taskNo
|
* @param taskNo
|
||||||
*/
|
*/
|
||||||
public WcsSrgvQueue insertHistory(String taskNo);
|
public WcsSrgvQueue insertHistory(String taskNo);
|
||||||
|
|
||||||
|
String selectMinCountJob(List<String> outModelSSJ);
|
||||||
|
|
||||||
|
Integer selectTsj();
|
||||||
|
|
||||||
|
Integer selectByCaogoPlaceSite(String siteId);
|
||||||
|
|
||||||
|
Integer selectByEndSite();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,12 @@
|
|||||||
package com.ruoyi.queue.srgv.service.impl;
|
package com.ruoyi.queue.srgv.service.impl;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import cn.hutool.core.util.ObjUtil;
|
import cn.hutool.core.util.ObjUtil;
|
||||||
|
import com.ruoyi.job.mapper.MydoJobMapper;
|
||||||
import com.ruoyi.queue.srgv.domain.WcsSrgvQueueFinish;
|
import com.ruoyi.queue.srgv.domain.WcsSrgvQueueFinish;
|
||||||
import com.ruoyi.queue.srgv.mapper.WcsSrgvQueueFinishMapper;
|
import com.ruoyi.queue.srgv.mapper.WcsSrgvQueueFinishMapper;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@@ -26,7 +28,8 @@ public class WcsSrgvQueueServiceImpl implements IWcsSrgvQueueService
|
|||||||
private WcsSrgvQueueMapper wcsSrgvQueueMapper;
|
private WcsSrgvQueueMapper wcsSrgvQueueMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
private WcsSrgvQueueFinishMapper wcsSrgvQueueFinishMapper;
|
private WcsSrgvQueueFinishMapper wcsSrgvQueueFinishMapper;
|
||||||
|
@Autowired
|
||||||
|
private MydoJobMapper mydoJobMapper;
|
||||||
/**
|
/**
|
||||||
* 查询四向小车任务队列
|
* 查询四向小车任务队列
|
||||||
*
|
*
|
||||||
@@ -100,9 +103,29 @@ public class WcsSrgvQueueServiceImpl implements IWcsSrgvQueueService
|
|||||||
@Override
|
@Override
|
||||||
public int deleteWcsSrgvQueueByGuids(String[] guids)
|
public int deleteWcsSrgvQueueByGuids(String[] guids)
|
||||||
{
|
{
|
||||||
|
if (guids == null || guids.length == 0) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
List<String> taskNos = wcsSrgvQueueMapper.selectTaskNosByGuids(guids);
|
||||||
|
deleteMydoJobsByTaskNos(taskNos);
|
||||||
return wcsSrgvQueueMapper.deleteWcsSrgvQueueByGuids(guids);
|
return wcsSrgvQueueMapper.deleteWcsSrgvQueueByGuids(guids);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void deleteMydoJobsByTaskNos(List<String> taskNos) {
|
||||||
|
if (taskNos == null || taskNos.isEmpty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
List<String> validTaskNos = new ArrayList<>();
|
||||||
|
for (String taskNo : taskNos) {
|
||||||
|
if (taskNo != null && !"".equals(taskNo)) {
|
||||||
|
validTaskNos.add(taskNo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!validTaskNos.isEmpty()) {
|
||||||
|
mydoJobMapper.deleteMydoJobByTaskNos(validTaskNos);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除四向小车任务队列信息
|
* 删除四向小车任务队列信息
|
||||||
*
|
*
|
||||||
@@ -115,6 +138,28 @@ public class WcsSrgvQueueServiceImpl implements IWcsSrgvQueueService
|
|||||||
return wcsSrgvQueueMapper.deleteWcsSrgvQueueByGuid(guid);
|
return wcsSrgvQueueMapper.deleteWcsSrgvQueueByGuid(guid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String selectMinCountJob( List<String> outModelSSJ) {
|
||||||
|
return wcsSrgvQueueMapper.selectMinCountJob(outModelSSJ) ;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer selectTsj() {
|
||||||
|
|
||||||
|
return wcsSrgvQueueMapper.selectTsj();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer selectByCaogoPlaceSite(String siteId) {
|
||||||
|
return wcsSrgvQueueMapper.selectByCaogoPlaceSite(siteId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer selectByEndSite() {
|
||||||
|
return wcsSrgvQueueMapper.selectByEndSite();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public WcsSrgvQueue insertHistory(String taskNo) {
|
public WcsSrgvQueue insertHistory(String taskNo) {
|
||||||
WcsSrgvQueue wcsSrgvQueue = wcsSrgvQueueMapper.selectWcsSrgvQueueByTaskNo(taskNo);
|
WcsSrgvQueue wcsSrgvQueue = wcsSrgvQueueMapper.selectWcsSrgvQueueByTaskNo(taskNo);
|
||||||
|
|||||||
@@ -65,4 +65,6 @@ public interface TsjDeviceExecutionQueueMapper
|
|||||||
* @return 提升机执行队列
|
* @return 提升机执行队列
|
||||||
*/
|
*/
|
||||||
TsjDeviceExecutionQueue selectTsjDeviceExecutionQueueByRwh(Long taskNo);
|
TsjDeviceExecutionQueue selectTsjDeviceExecutionQueueByRwh(Long taskNo);
|
||||||
|
|
||||||
|
Integer selectCount();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -64,4 +64,6 @@ public interface ITsjDeviceExecutionQueueService
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
TsjDeviceExecutionQueue selectTsjDeviceExecutionQueueByRwh(Long taskNo);
|
TsjDeviceExecutionQueue selectTsjDeviceExecutionQueueByRwh(Long taskNo);
|
||||||
|
|
||||||
|
Integer selectCount();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -104,5 +104,10 @@ public class TsjDeviceExecutionQueueServiceImpl implements ITsjDeviceExecutionQu
|
|||||||
return tsjDeviceExecutionQueueMapper.selectTsjDeviceExecutionQueueByRwh(taskNo);
|
return tsjDeviceExecutionQueueMapper.selectTsjDeviceExecutionQueueByRwh(taskNo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer selectCount() {
|
||||||
|
return tsjDeviceExecutionQueueMapper.selectCount();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -67,12 +67,14 @@ public class PlcCdzRead implements Runnable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void plcRead(DeviceCdz deviceCdz) {
|
private void plcRead(DeviceCdz deviceCdz) {
|
||||||
OperateResultExOne<byte[]> read2 = readWriteNet.Read(deviceCdz.getPlcDbReadAddress(), Short.parseShort("4"));
|
OperateResultExOne<byte[]> read2 = readWriteNet.Read(deviceCdz.getPlcDbReadAddress(), Short.parseShort("2"));
|
||||||
String ddsx1 = "0";
|
String ddsx1 = "0";
|
||||||
if (read2.IsSuccess) {
|
if (read2.IsSuccess) {
|
||||||
ddsx1 = SoftBasic.ByteToHexString(read2.Content);
|
ddsx1 = SoftBasic.ByteToHexString(read2.Content);
|
||||||
deviceCdz.setStatus(ParseUtil.optInt(0, ddsx1));
|
deviceCdz.setStatus(ParseUtil.optInt(0, ddsx1));
|
||||||
deviceCdz.setModel(ParseUtil.optInt(2, ddsx1));
|
// deviceCdz.setModel(ParseUtil.optInt(2, ddsx1));
|
||||||
|
}else {
|
||||||
|
log.error(read2.Message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -116,8 +118,8 @@ public class PlcCdzRead implements Runnable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void closeServer() {
|
void closeServer() {
|
||||||
if (readWriteNet != null) {
|
if (siemensS7Net != null) {
|
||||||
readWriteNet.ConnectClose();
|
siemensS7Net.ConnectClose();
|
||||||
}
|
}
|
||||||
setIsConnect(false);
|
setIsConnect(false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -123,8 +123,8 @@ public class PlcDdjRead implements Runnable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void closeServer() {
|
void closeServer() {
|
||||||
if (readWriteNet != null) {
|
if (siemensS7Net != null) {
|
||||||
readWriteNet.ConnectClose();
|
siemensS7Net.ConnectClose();
|
||||||
}
|
}
|
||||||
setIsConnect(false);
|
setIsConnect(false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -78,17 +78,39 @@ public class PlcSrgvRead implements Runnable {
|
|||||||
OperateResultExOne<byte[]> read1 = modbusTcpNet.Read("4068", (short) 15);//2400-2414
|
OperateResultExOne<byte[]> read1 = modbusTcpNet.Read("4068", (short) 15);//2400-2414
|
||||||
if (read1.IsSuccess) {
|
if (read1.IsSuccess) {
|
||||||
setValueByByte1(read1.Content, deviceSrgv);
|
setValueByByte1(read1.Content, deviceSrgv);
|
||||||
|
}else {
|
||||||
|
log.error(read1.Message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
OperateResultExOne<byte[]> read5 = modbusTcpNet.Read("4081", (short) 2);//2400-2414
|
||||||
|
if (read5.IsSuccess) {
|
||||||
|
setValueByByte5(read1.Content, deviceSrgv);
|
||||||
|
}else {
|
||||||
|
log.error(read1.Message);
|
||||||
|
}
|
||||||
|
|
||||||
//读取二段任务 小车是否接收完成1段作业
|
//读取二段任务 小车是否接收完成1段作业
|
||||||
OperateResultExOne<byte[]> read3 = modbusTcpNet.Read("1000", (short) 2);//2400-2414
|
OperateResultExOne<byte[]> read3 = modbusTcpNet.Read("1000", (short) 2);//2400-2414
|
||||||
if (read3.IsSuccess) {
|
if (read3.IsSuccess) {
|
||||||
setValueByByte3(read3.Content, deviceSrgv);
|
setValueByByte3(read3.Content, deviceSrgv);
|
||||||
|
}else {
|
||||||
|
log.error(read1.Message);
|
||||||
}
|
}
|
||||||
|
|
||||||
//读取双字
|
//读取双字
|
||||||
OperateResultExOne<byte[]> read2 = modbusTcpNet.Read("4060", (short) 8);// 4800-4807任务号、原点、目标点、当前
|
OperateResultExOne<byte[]> read2 = modbusTcpNet.Read("4060", (short) 8);// 4800-4807任务号、原点、目标点、当前
|
||||||
if (read2.IsSuccess) {
|
if (read2.IsSuccess) {
|
||||||
setValueByByte2(read2.Content, deviceSrgv);
|
setValueByByte2(read2.Content, deviceSrgv);
|
||||||
|
}else {
|
||||||
|
log.error(read1.Message);
|
||||||
|
}
|
||||||
|
|
||||||
|
// //读取双字,路径
|
||||||
|
OperateResultExOne<byte[]> read4 = modbusTcpNet.Read("6000", (short) 800);// 5000-5799 路径 400个
|
||||||
|
if (read4.IsSuccess) {
|
||||||
|
setValueByByte4(read4.Content, deviceSrgv);
|
||||||
|
}else {
|
||||||
|
log.error(read1.Message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -104,6 +126,8 @@ public class PlcSrgvRead implements Runnable {
|
|||||||
agvData.setAlarm(Convert.toInt(byteTransform.TransInt16(content, 6)));
|
agvData.setAlarm(Convert.toInt(byteTransform.TransInt16(content, 6)));
|
||||||
// agvData.setStatus(0);
|
// agvData.setStatus(0);
|
||||||
agvData.setStatus(Convert.toInt(byteTransform.TransInt16(content, 8)));
|
agvData.setStatus(Convert.toInt(byteTransform.TransInt16(content, 8)));
|
||||||
|
//载货标志
|
||||||
|
// agvData.setCargoFlag(Convert.toInt(byteTransform.TransInt32(content[1], 13)));
|
||||||
//接收完成标志
|
//接收完成标志
|
||||||
// agvData.setFinish(Convert.toInt(byteTransform.TransInt16(content, 10)));
|
// agvData.setFinish(Convert.toInt(byteTransform.TransInt16(content, 10)));
|
||||||
// agvData.setFinish(0);
|
// agvData.setFinish(0);
|
||||||
@@ -123,6 +147,15 @@ public class PlcSrgvRead implements Runnable {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void setValueByByte5(byte[] content, DeviceSrgv agvData) {
|
||||||
|
int cargoFlag = content[27] & 0xFF;
|
||||||
|
agvData.setCargoFlag(cargoFlag);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//单字
|
//单字
|
||||||
private void setValueByByte3(byte[] content, DeviceSrgv agvData) {
|
private void setValueByByte3(byte[] content, DeviceSrgv agvData) {
|
||||||
// agvData.setTaskType(0);
|
// agvData.setTaskType(0);
|
||||||
@@ -150,6 +183,29 @@ public class PlcSrgvRead implements Runnable {
|
|||||||
agvData.setCurrFloor(floor);
|
agvData.setCurrFloor(floor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void setValueByByte4(byte[] content, DeviceSrgv agvData) {
|
||||||
|
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
for (int i = 0; i < content.length; i += 4) {
|
||||||
|
// 检查剩余字节是否足够4个
|
||||||
|
if (i + 4 > content.length) break;
|
||||||
|
// TODO 注意双字反转
|
||||||
|
int value = byteTransform.TransInt32(content, i);
|
||||||
|
|
||||||
|
// 如果值为0,终止循环
|
||||||
|
if (value == 0) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
sb.append(String.format("%06d", value)).append(","); // 用逗号分隔每个int值
|
||||||
|
}
|
||||||
|
|
||||||
|
// 移除最后多余的 ","
|
||||||
|
if (sb.length() > 0) {
|
||||||
|
sb.setLength(sb.length() - 1);
|
||||||
|
}
|
||||||
|
agvData.setPath(sb.toString());
|
||||||
|
}
|
||||||
|
|
||||||
public void ConnectServer() {
|
public void ConnectServer() {
|
||||||
modbusTcpNet = new ModbusTcpNet();//创建一个Modbus对象
|
modbusTcpNet = new ModbusTcpNet();//创建一个Modbus对象
|
||||||
log.info("创建连接对象,IP{}", this.ip);
|
log.info("创建连接对象,IP{}", this.ip);
|
||||||
@@ -188,8 +244,8 @@ public class PlcSrgvRead implements Runnable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void closeServer() {
|
void closeServer() {
|
||||||
if (readWriteNet != null) {
|
if (modbusTcpNet != null) {
|
||||||
readWriteNet.ConnectClose();
|
modbusTcpNet.ConnectClose();
|
||||||
}
|
}
|
||||||
setIsConnect(false);
|
setIsConnect(false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -198,6 +198,7 @@ public class PathFinder {
|
|||||||
if (gCost[endX][endY] == Integer.MAX_VALUE) {
|
if (gCost[endX][endY] == Integer.MAX_VALUE) {
|
||||||
List<int[]> path = new ArrayList<>();
|
List<int[]> path = new ArrayList<>();
|
||||||
path.add(new int[]{-1, -1});
|
path.add(new int[]{-1, -1});
|
||||||
|
|
||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -68,6 +68,10 @@ public class PlcSsjRead implements Runnable {
|
|||||||
// 线体到位输送机
|
// 线体到位输送机
|
||||||
readPlcOtherSsj(ssjDevice);
|
readPlcOtherSsj(ssjDevice);
|
||||||
break;
|
break;
|
||||||
|
case "4":
|
||||||
|
// 线体到位输送机
|
||||||
|
readPlcInDwSsj(ssjDevice);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -86,6 +90,19 @@ public class PlcSsjRead implements Runnable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void readPlcInDwSsj(DeviceSsj ssjDevice) {
|
||||||
|
OperateResultExOne<byte[]> read2 = readWriteNet.Read(ssjDevice.getPlcDbReadAddress(), Short.parseShort("10"));
|
||||||
|
String ddsx1 = "0";
|
||||||
|
if (read2.IsSuccess) {
|
||||||
|
ddsx1 = SoftBasic.ByteToHexString(read2.Content);
|
||||||
|
ssjDevice.setKx(ParseUtil.optInt(4, ddsx1));
|
||||||
|
ssjDevice.setDw(ParseUtil.optInt(6, ddsx1));
|
||||||
|
ssjDevice.setErrorCode(ParseUtil.optInt(8,ddsx1));
|
||||||
|
ssjDevice.setTaskNo(ParseUtil.optDInt(0, ddsx1));
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 其他输送机
|
* 其他输送机
|
||||||
*
|
*
|
||||||
@@ -99,6 +116,7 @@ public class PlcSsjRead implements Runnable {
|
|||||||
ssjDevice.setKx(ParseUtil.optInt(4, ddsx1));
|
ssjDevice.setKx(ParseUtil.optInt(4, ddsx1));
|
||||||
ssjDevice.setDw(ParseUtil.optInt(6, ddsx1));
|
ssjDevice.setDw(ParseUtil.optInt(6, ddsx1));
|
||||||
ssjDevice.setTaskNo(ParseUtil.optDInt(0, ddsx1));
|
ssjDevice.setTaskNo(ParseUtil.optDInt(0, ddsx1));
|
||||||
|
ssjDevice.setModel(ParseUtil.optInt(8, ddsx1));//出入库模式 1入 2出
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -118,6 +136,8 @@ public class PlcSsjRead implements Runnable {
|
|||||||
ssjDevice.setDw(ParseUtil.optInt(6, ddsx1));
|
ssjDevice.setDw(ParseUtil.optInt(6, ddsx1));
|
||||||
// ssjDevice.setTrayCode(ParseUtil.optString(14, 12, ddsx1));
|
// ssjDevice.setTrayCode(ParseUtil.optString(14, 12, ddsx1));
|
||||||
// ssjDevice.setModel(ParseUtil.optInt(28, ddsx1));
|
// ssjDevice.setModel(ParseUtil.optInt(28, ddsx1));
|
||||||
|
}else {
|
||||||
|
log.error(read2.Message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -138,6 +158,8 @@ public class PlcSsjRead implements Runnable {
|
|||||||
// ssjDevice.setKx(ParseUtil.optInt(4, ddsx1));
|
// ssjDevice.setKx(ParseUtil.optInt(4, ddsx1));
|
||||||
// ssjDevice.setDw(ParseUtil.optInt(6, ddsx1));
|
// ssjDevice.setDw(ParseUtil.optInt(6, ddsx1));
|
||||||
|
|
||||||
|
}else {
|
||||||
|
log.error(read2.Message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -175,6 +197,8 @@ public class PlcSsjRead implements Runnable {
|
|||||||
//去除bytes中
|
//去除bytes中
|
||||||
ssjDevice.setTrayCode(ParseUtil.filterAndConvert(trayCodeRead.Content));
|
ssjDevice.setTrayCode(ParseUtil.filterAndConvert(trayCodeRead.Content));
|
||||||
}
|
}
|
||||||
|
}else {
|
||||||
|
log.error(read2.Message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -218,8 +242,8 @@ public class PlcSsjRead implements Runnable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void closeServer() {
|
void closeServer() {
|
||||||
if (readWriteNet != null) {
|
if (siemensS7Net != null) {
|
||||||
readWriteNet.ConnectClose();
|
siemensS7Net.ConnectClose();
|
||||||
}
|
}
|
||||||
setIsConnect(false);
|
setIsConnect(false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -126,8 +126,8 @@ public class PlcTsjRead implements Runnable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void closeServer() {
|
void closeServer() {
|
||||||
if (readWriteNet != null) {
|
if (siemensS7Net != null) {
|
||||||
readWriteNet.ConnectClose();
|
siemensS7Net.ConnectClose();
|
||||||
}
|
}
|
||||||
setIsConnect(false);
|
setIsConnect(false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,8 @@ import com.ruoyi.device.srgv.domain.DeviceSrgv;
|
|||||||
import com.ruoyi.device.srgv.service.IDeviceSrgvService;
|
import com.ruoyi.device.srgv.service.IDeviceSrgvService;
|
||||||
import com.ruoyi.job.charg.domain.SrgvChargingJob;
|
import com.ruoyi.job.charg.domain.SrgvChargingJob;
|
||||||
import com.ruoyi.job.charg.service.ISrgvChargingJobService;
|
import com.ruoyi.job.charg.service.ISrgvChargingJobService;
|
||||||
|
import com.ruoyi.job.mapper.MydoJobMapper;
|
||||||
|
import com.ruoyi.job.service.IMydoJobService;
|
||||||
import com.ruoyi.queue.srgv.domain.WcsSrgvQueue;
|
import com.ruoyi.queue.srgv.domain.WcsSrgvQueue;
|
||||||
import com.ruoyi.queue.srgv.service.IWcsSrgvQueueService;
|
import com.ruoyi.queue.srgv.service.IWcsSrgvQueueService;
|
||||||
import com.ruoyi.schedule.plcRead.cdz.PlcCdzRead;
|
import com.ruoyi.schedule.plcRead.cdz.PlcCdzRead;
|
||||||
@@ -21,6 +23,9 @@ import com.ruoyi.schedule.plcRead.ssj.PlcSsjRead;
|
|||||||
import com.ruoyi.schedule.plcRead.util.Tools;
|
import com.ruoyi.schedule.plcRead.util.Tools;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.format.DateTimeFormatter;
|
||||||
|
import java.time.temporal.ChronoUnit;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
@@ -32,19 +37,22 @@ public class CdzThread implements Runnable {
|
|||||||
|
|
||||||
public boolean isRun = true;
|
public boolean isRun = true;
|
||||||
|
|
||||||
private final Integer LITTLE_BETTERY = 30;
|
private final Integer LITTLE_BETTERY = 40;
|
||||||
private final Integer MIDDLE_BETTERY = 70;
|
private final Integer MIDDLE_BETTERY = 70;
|
||||||
|
private final Integer MAX_BETTERY = 90;
|
||||||
|
private final Integer JOB_BETTERY=50;
|
||||||
private ISrgvChargingJobService chargingJobService;
|
private ISrgvChargingJobService chargingJobService;
|
||||||
private IDeviceCdzService deviceCdzService;
|
private IDeviceCdzService deviceCdzService;
|
||||||
private IDeviceSrgvService deviceSrgvService;
|
private IDeviceSrgvService deviceSrgvService;
|
||||||
private IWcsSrgvQueueService wcsSrgvQueueService;
|
private IWcsSrgvQueueService wcsSrgvQueueService;
|
||||||
|
public IMydoJobService mydoJobService;
|
||||||
|
|
||||||
public void init() {
|
public void init() {
|
||||||
chargingJobService = SpringUtils.getBean(ISrgvChargingJobService.class);
|
chargingJobService = SpringUtils.getBean(ISrgvChargingJobService.class);
|
||||||
deviceCdzService = SpringUtils.getBean(IDeviceCdzService.class);
|
deviceCdzService = SpringUtils.getBean(IDeviceCdzService.class);
|
||||||
deviceSrgvService = SpringUtils.getBean(IDeviceSrgvService.class);
|
deviceSrgvService = SpringUtils.getBean(IDeviceSrgvService.class);
|
||||||
wcsSrgvQueueService = SpringUtils.getBean(IWcsSrgvQueueService.class);
|
wcsSrgvQueueService = SpringUtils.getBean(IWcsSrgvQueueService.class);
|
||||||
|
mydoJobService = SpringUtils.getBean(IMydoJobService.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -62,19 +70,32 @@ public class CdzThread implements Runnable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean isMoreThan30Min(String timeStr, String pattern) {
|
||||||
|
// 1. 创建格式化器
|
||||||
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern(pattern);
|
||||||
|
// 2. 解析字符串为时间对象
|
||||||
|
LocalDateTime targetTime = LocalDateTime.parse(timeStr, formatter);
|
||||||
|
// 3. 获取当前系统时间
|
||||||
|
LocalDateTime now = LocalDateTime.now();
|
||||||
|
// 4. 计算两个时间相差的总分钟(可正可负)
|
||||||
|
long diffMinutes = ChronoUnit.MINUTES.between(targetTime, now);
|
||||||
|
// 取绝对值:不管是过去/未来时间,只要间隔超30分钟就满足
|
||||||
|
long absDiff = Math.abs(diffMinutes);
|
||||||
|
return absDiff > 30;
|
||||||
|
}
|
||||||
|
|
||||||
void dispatch() {
|
void dispatch() {
|
||||||
|
Integer count = mydoJobService.selectMydoJobCount();
|
||||||
//获取低电量小车
|
//获取低电量小车
|
||||||
List<DeviceSrgv> littleBatterySRgv = new ArrayList<>();
|
List<DeviceSrgv> littleBatterySRgv = new ArrayList<>();
|
||||||
//获取中电量小车
|
//获取中电量小车
|
||||||
List<DeviceSrgv> middleBatterySRgv = new ArrayList<>();
|
List<DeviceSrgv> middleBatterySRgv = new ArrayList<>();
|
||||||
for (String sRgv : PlcSrgvRead.deviceSrgvMap.keySet()) {
|
for (String sRgv : PlcSrgvRead.deviceSrgvMap.keySet()) {
|
||||||
DeviceSrgv deviceSrgv = PlcSrgvRead.deviceSrgvMap.get(sRgv);
|
DeviceSrgv deviceSrgv = PlcSrgvRead.deviceSrgvMap.get(sRgv);
|
||||||
if (deviceSrgv.getWorkMode() == 5 && deviceSrgv.getStatus() != 3) {
|
if (deviceSrgv.getWorkMode() == 5 && deviceSrgv.getStatus() != 3 && deviceSrgv.getChargeFlag() != 2) {
|
||||||
if (deviceSrgv.getBattery() <= LITTLE_BETTERY) {
|
if (deviceSrgv.getBattery() <= LITTLE_BETTERY) {
|
||||||
littleBatterySRgv.add(deviceSrgv);
|
littleBatterySRgv.add(deviceSrgv);
|
||||||
} else if (deviceSrgv.getBattery() <= MIDDLE_BETTERY) {
|
} else if (deviceSrgv.getBattery() <= MIDDLE_BETTERY && isMoreThan30Min(deviceSrgv.getLastTime(),"yyyy-MM-dd HH:mm:ss")) {
|
||||||
middleBatterySRgv.add(deviceSrgv);
|
middleBatterySRgv.add(deviceSrgv);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -92,22 +113,20 @@ public class CdzThread implements Runnable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//超过30分钟自动生成充电任务
|
//超过30分钟自动生成充电任务
|
||||||
List<DeviceSrgv> deviceSrgvs = deviceSrgvService.selectDeviceSrgvList(new DeviceSrgv());
|
// List<DeviceSrgv> deviceSrgvs = deviceSrgvService.selectDeviceSrgvList(new DeviceSrgv());
|
||||||
List<DeviceSrgv> timeOutSrgvList = deviceSrgvs.stream().filter(x -> DateUtil.between(DateUtil.parse(x.getLastTime()), DateUtil.date(), DateUnit.MINUTE) > 30).collect(Collectors.toList());
|
// List<DeviceSrgv> timeOutSrgvList = deviceSrgvs.stream().filter(x -> DateUtil.between(DateUtil.parse(x.getLastTime()), DateUtil.date(), DateUnit.MINUTE) > 30).collect(Collectors.toList());
|
||||||
if (CollUtil.isNotEmpty(timeOutSrgvList)) {
|
// if (CollUtil.isNotEmpty(timeOutSrgvList)) {
|
||||||
//生成充电任务
|
// //生成充电任务
|
||||||
createChargingInJob(timeOutSrgvList);
|
// createChargingInJob(timeOutSrgvList);
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
//充电任务下发
|
//充电任务下发 查到充电任务并且充电桩未开启直接开启
|
||||||
SrgvChargingJob srgvChargingJobParam = new SrgvChargingJob();
|
SrgvChargingJob srgvChargingJobParam = new SrgvChargingJob();
|
||||||
srgvChargingJobParam.setChargingStatus("0");
|
srgvChargingJobParam.setChargingStatus("0");
|
||||||
srgvChargingJobParam.setJobType("1");
|
srgvChargingJobParam.setJobType("1");
|
||||||
srgvChargingJobParam.setJobStatus("3");
|
|
||||||
List<SrgvChargingJob> srgvChargingJobs = chargingJobService.selectSrgvChargingJobList(srgvChargingJobParam);
|
List<SrgvChargingJob> srgvChargingJobs = chargingJobService.selectSrgvChargingJobList(srgvChargingJobParam);
|
||||||
if (CollUtil.isNotEmpty(srgvChargingJobs)) {
|
if (CollUtil.isNotEmpty(srgvChargingJobs)) {
|
||||||
|
|
||||||
for (SrgvChargingJob srgvChargingJob : srgvChargingJobs) {
|
for (SrgvChargingJob srgvChargingJob : srgvChargingJobs) {
|
||||||
if ("0".equals(srgvChargingJob.getChargingStatus())) {
|
if ("0".equals(srgvChargingJob.getChargingStatus())) {
|
||||||
String chargingSite = srgvChargingJob.getChargingSite();
|
String chargingSite = srgvChargingJob.getChargingSite();
|
||||||
@@ -118,44 +137,29 @@ public class CdzThread implements Runnable {
|
|||||||
SendData qxSendData = new SendData(Tools.INT, 1);
|
SendData qxSendData = new SendData(Tools.INT, 1);
|
||||||
byte[] bytes = Tools.sendData(qxSendData);
|
byte[] bytes = Tools.sendData(qxSendData);
|
||||||
int i = PlcCdzRead.WriteToCdz(plcDbWriteAddress, bytes);
|
int i = PlcCdzRead.WriteToCdz(plcDbWriteAddress, bytes);
|
||||||
|
// 查到充电任务,并且充电桩未开启就直接开启
|
||||||
if (i == 1) {
|
if (i == 1) {
|
||||||
|
log.info("下发{" + deviceCdzs.get(0).getId() + "}号充电桩开启");
|
||||||
srgvChargingJob.setChargingStatus("2");
|
srgvChargingJob.setChargingStatus("2");
|
||||||
srgvChargingJob.setChargingDate(DateUtil.formatDateTime(DateUtil.date()));
|
srgvChargingJob.setChargingDate(DateUtil.formatDateTime(DateUtil.date()));
|
||||||
chargingJobService.updateSrgvChargingJob(srgvChargingJob);
|
chargingJobService.updateSrgvChargingJob(srgvChargingJob);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//生成断电任务 有任务且电量大于50
|
||||||
//生成断电任务 有任务且电量大于50 todo 代码无效
|
List<DeviceCdz> deviceCdzdd = deviceCdzService.selectDeviceCdzHasSRgvList();
|
||||||
WcsSrgvQueue wcsSrgvQueueParam = new WcsSrgvQueue();
|
for (DeviceCdz deviceCdz : deviceCdzdd) {
|
||||||
wcsSrgvQueueParam.setIssued("0");
|
DeviceSrgv deviceSrgv = PlcSrgvRead.deviceSrgvMap.get(deviceCdz.getSpare1());
|
||||||
List<WcsSrgvQueue> wcsSrgvQueues = wcsSrgvQueueService.selectWcsSrgvQueueList(wcsSrgvQueueParam);
|
//(deviceSrgv.getBattery() >= JOB_BETTERY && count > 0) ||
|
||||||
if (CollUtil.isNotEmpty(wcsSrgvQueues)) {
|
if (( deviceSrgv.getBattery() >= MAX_BETTERY)
|
||||||
boolean existsKxSRgv = false;
|
&& deviceSrgv.getWorkMode() == 5
|
||||||
//判断有没有空闲小车
|
&& deviceSrgv.getChargeFlag() == 2 && deviceCdz.getStatus() == 1) {
|
||||||
for (DeviceSrgv x : PlcSrgvRead.deviceSrgvMap.values()) {
|
createChargingOutJob(PlcSrgvRead.deviceSrgvMap.get(deviceCdz.getSpare1()), deviceCdz);
|
||||||
if (x.getWorkMode() == 5 && x.getStatus() == 1) {
|
|
||||||
existsKxSRgv = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!existsKxSRgv) {
|
|
||||||
List<DeviceCdz> deviceCdzs = deviceCdzService.selectDeviceCdzHasSRgvList();
|
|
||||||
if (CollUtil.isNotEmpty(deviceCdzs)) {
|
|
||||||
for (DeviceCdz deviceCdz : deviceCdzs) {
|
|
||||||
if (PlcSrgvRead.deviceSrgvMap.containsKey(deviceCdz.getSpare1())) {
|
|
||||||
DeviceSrgv deviceSrgv = PlcSrgvRead.deviceSrgvMap.get(deviceCdz.getSpare1());
|
|
||||||
if (deviceSrgv.getBattery() >= 50) {
|
|
||||||
//生成断电任务
|
|
||||||
createChargingOutJob(deviceSrgv, deviceCdz);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -166,7 +170,6 @@ public class CdzThread implements Runnable {
|
|||||||
srgvChargingJobDdParam.setJobType("2");
|
srgvChargingJobDdParam.setJobType("2");
|
||||||
List<SrgvChargingJob> srgvChargingJobDds = chargingJobService.selectSrgvChargingJobList(srgvChargingJobDdParam);
|
List<SrgvChargingJob> srgvChargingJobDds = chargingJobService.selectSrgvChargingJobList(srgvChargingJobDdParam);
|
||||||
if (CollUtil.isNotEmpty(srgvChargingJobDds)) {
|
if (CollUtil.isNotEmpty(srgvChargingJobDds)) {
|
||||||
|
|
||||||
for (SrgvChargingJob srgvChargingJob : srgvChargingJobDds) {
|
for (SrgvChargingJob srgvChargingJob : srgvChargingJobDds) {
|
||||||
if ("0".equals(srgvChargingJob.getChargingStatus())) {
|
if ("0".equals(srgvChargingJob.getChargingStatus())) {
|
||||||
String chargingSite = srgvChargingJob.getChargingSite();
|
String chargingSite = srgvChargingJob.getChargingSite();
|
||||||
@@ -178,6 +181,7 @@ public class CdzThread implements Runnable {
|
|||||||
byte[] bytes = Tools.sendData(qxSendData);
|
byte[] bytes = Tools.sendData(qxSendData);
|
||||||
int i = PlcCdzRead.WriteToCdz(plcDbWriteAddress, bytes);
|
int i = PlcCdzRead.WriteToCdz(plcDbWriteAddress, bytes);
|
||||||
if (i == 1) {
|
if (i == 1) {
|
||||||
|
log.info("下发{" + deviceCdzs.get(0).getId() + "}号充电桩关闭");
|
||||||
srgvChargingJob.setChargingStatus("1");
|
srgvChargingJob.setChargingStatus("1");
|
||||||
srgvChargingJob.setChargingDate(DateUtil.formatDateTime(DateUtil.date()));
|
srgvChargingJob.setChargingDate(DateUtil.formatDateTime(DateUtil.date()));
|
||||||
chargingJobService.updateSrgvChargingJob(srgvChargingJob);
|
chargingJobService.updateSrgvChargingJob(srgvChargingJob);
|
||||||
@@ -185,14 +189,11 @@ public class CdzThread implements Runnable {
|
|||||||
chargingJobService.insertHistory(srgvChargingJob.getGuid());
|
chargingJobService.insertHistory(srgvChargingJob.getGuid());
|
||||||
chargingJobService.deleteSrgvChargingJobByGuid(srgvChargingJob.getGuid());
|
chargingJobService.deleteSrgvChargingJobByGuid(srgvChargingJob.getGuid());
|
||||||
deviceCdzs.get(0).setSpare1(null);
|
deviceCdzs.get(0).setSpare1(null);
|
||||||
deviceCdzService.updateDeviceCdz(deviceCdzs.get(0));
|
deviceCdzService.updateDeviceCdzSpare(deviceCdzs.get(0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -207,42 +208,43 @@ public class CdzThread implements Runnable {
|
|||||||
wcsChargingJob.setAgvId(deviceSrgv.getDeviceId().toString());
|
wcsChargingJob.setAgvId(deviceSrgv.getDeviceId().toString());
|
||||||
List<SrgvChargingJob> srgvChargingJobs = chargingJobService.selectSrgvChargingJobList(wcsChargingJob);
|
List<SrgvChargingJob> srgvChargingJobs = chargingJobService.selectSrgvChargingJobList(wcsChargingJob);
|
||||||
if (CollUtil.isEmpty(srgvChargingJobs)) {
|
if (CollUtil.isEmpty(srgvChargingJobs)) {
|
||||||
List<DeviceCdz> cdzList = deviceCdzService.selectDeviceCdzListNoSRgvId();
|
DeviceCdz deviceCdz = deviceCdzService.selectDeviceCdzById(Long.valueOf(deviceSrgv.getDeviceId()));
|
||||||
if (CollUtil.isNotEmpty(cdzList)) {
|
// List<DeviceCdz> cdzList = deviceCdzService.selectDeviceCdzListNoSRgvId();
|
||||||
//寻找最接近的充电桩
|
// if (CollUtil.isNotEmpty(deviceCdz)) {
|
||||||
Integer floor = deviceSrgv.getCurrFloor();
|
//寻找最接近的充电桩
|
||||||
DeviceCdz cdz = null;
|
// Integer floor = deviceSrgv.getCurrFloor();
|
||||||
Optional<DeviceCdz> min = cdzList.stream().filter(c -> c.getSzcs().equals(floor)).min((o1, o2) -> {
|
// DeviceCdz cdz = null;
|
||||||
Integer distance1 = Math.abs(o1.getSzcs());
|
// Optional<DeviceCdz> min = cdzList.stream().min((o1, o2) -> {
|
||||||
Integer distance2 = Math.abs(o2.getSzcs());
|
// Integer distance1 = Math.abs(o1.getSzcs());
|
||||||
return distance1 - distance2;
|
// Integer distance2 = Math.abs(o2.getSzcs());
|
||||||
});
|
// return distance1 - distance2;
|
||||||
if (min.isPresent()) {
|
// });
|
||||||
cdz = min.get();
|
// if (min.isPresent()) {
|
||||||
}
|
// cdz = min.get();
|
||||||
if (ObjUtil.isNotNull(cdz)) {
|
// }
|
||||||
//生成充电任务
|
if (ObjUtil.isNotNull(deviceCdz)) {
|
||||||
SrgvChargingJob srgvChargingJobParam = new SrgvChargingJob();
|
//生成充电任务
|
||||||
srgvChargingJobParam.setAgvId(deviceSrgv.getDeviceId().toString());
|
SrgvChargingJob srgvChargingJobParam = new SrgvChargingJob();
|
||||||
srgvChargingJobParam.setChargingSite("08020" + cdz.getSzcs());
|
srgvChargingJobParam.setAgvId(deviceSrgv.getDeviceId().toString());
|
||||||
srgvChargingJobParam.setChargingId(cdz.getId().toString());
|
srgvChargingJobParam.setChargingSite("08020" + deviceCdz.getSzcs());
|
||||||
List<SrgvChargingJob> wcsChargingJobs = chargingJobService.selectSrgvChargingJobList(srgvChargingJobParam);
|
srgvChargingJobParam.setChargingId(deviceCdz.getId().toString());
|
||||||
if (CollUtil.isEmpty(wcsChargingJobs)) {
|
List<SrgvChargingJob> wcsChargingJobs = chargingJobService.selectSrgvChargingJobList(srgvChargingJobParam);
|
||||||
SrgvChargingJob scj = new SrgvChargingJob();
|
if (CollUtil.isEmpty(wcsChargingJobs)) {
|
||||||
scj.setGuid(IdUtil.fastSimpleUUID());
|
SrgvChargingJob scj = new SrgvChargingJob();
|
||||||
scj.setChargingSite(cdz.getSiteId());
|
scj.setGuid(IdUtil.fastSimpleUUID());
|
||||||
scj.setJobStatus("1");
|
scj.setChargingSite(deviceCdz.getSiteId());
|
||||||
scj.setChargingStatus("0");
|
scj.setJobStatus("1");
|
||||||
scj.setStartDate(DateUtil.now());
|
scj.setChargingStatus("0");
|
||||||
scj.setJobType("1");//到充电桩
|
scj.setStartDate(DateUtil.now());
|
||||||
scj.setAgvId(deviceSrgv.getDeviceId().toString());
|
scj.setJobType("1");//到充电桩
|
||||||
scj.setChargingId(cdz.getId().toString());
|
scj.setAgvId(deviceSrgv.getDeviceId().toString());
|
||||||
chargingJobService.insertSrgvChargingJob(scj);
|
scj.setChargingId(deviceCdz.getId().toString());
|
||||||
cdz.setSpare1(deviceSrgv.getDeviceId().toString());
|
chargingJobService.insertSrgvChargingJob(scj);
|
||||||
deviceCdzService.updateDeviceCdz(cdz);
|
deviceCdz.setSpare1(deviceSrgv.getDeviceId().toString());
|
||||||
}
|
deviceCdzService.updateDeviceCdz(deviceCdz);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -265,7 +267,7 @@ public class CdzThread implements Runnable {
|
|||||||
srgvChargingJobParamOut.setJobType("2");
|
srgvChargingJobParamOut.setJobType("2");
|
||||||
List<SrgvChargingJob> srgvChargingJobOut = chargingJobService.selectSrgvChargingJobList(srgvChargingJobParamOut);
|
List<SrgvChargingJob> srgvChargingJobOut = chargingJobService.selectSrgvChargingJobList(srgvChargingJobParamOut);
|
||||||
|
|
||||||
if (CollUtil.isNotEmpty(srgvChargingJobs)&&CollUtil.isEmpty(srgvChargingJobOut)) {
|
if (CollUtil.isNotEmpty(srgvChargingJobs) && CollUtil.isEmpty(srgvChargingJobOut)) {
|
||||||
SrgvChargingJob scj = srgvChargingJobs.get(0);
|
SrgvChargingJob scj = srgvChargingJobs.get(0);
|
||||||
|
|
||||||
//插入历史
|
//插入历史
|
||||||
|
|||||||
@@ -51,7 +51,9 @@ public class MonitoringThread implements Runnable {
|
|||||||
}
|
}
|
||||||
for (String srgvCode : PlcSrgvRead.deviceSrgvMap.keySet()) {
|
for (String srgvCode : PlcSrgvRead.deviceSrgvMap.keySet()) {
|
||||||
DeviceSrgv deviceSrgv = PlcSrgvRead.deviceSrgvMap.get(srgvCode);
|
DeviceSrgv deviceSrgv = PlcSrgvRead.deviceSrgvMap.get(srgvCode);
|
||||||
deviceSrgvService.updateDeviceSrgv(deviceSrgv);
|
if (!deviceSrgv.getCurrSite().equals("000000")){
|
||||||
|
deviceSrgvService.updateDeviceSrgv(deviceSrgv);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
for (String tsjCode : PlcTsjRead.deviceTsjMap.keySet()) {
|
for (String tsjCode : PlcTsjRead.deviceTsjMap.keySet()) {
|
||||||
DeviceTsj deviceTsj = PlcTsjRead.deviceTsjMap.get(tsjCode);
|
DeviceTsj deviceTsj = PlcTsjRead.deviceTsjMap.get(tsjCode);
|
||||||
@@ -59,6 +61,8 @@ public class MonitoringThread implements Runnable {
|
|||||||
}
|
}
|
||||||
for (String cdzCode : PlcCdzRead.deviceCdzMap.keySet()) {
|
for (String cdzCode : PlcCdzRead.deviceCdzMap.keySet()) {
|
||||||
DeviceCdz deviceCdz = PlcCdzRead.deviceCdzMap.get(cdzCode);
|
DeviceCdz deviceCdz = PlcCdzRead.deviceCdzMap.get(cdzCode);
|
||||||
|
deviceCdz.setSpare1(null);
|
||||||
|
deviceCdz.setModel(deviceCdz.getStatus());
|
||||||
deviceCdzService.updateDeviceCdz(deviceCdz);
|
deviceCdzService.updateDeviceCdz(deviceCdz);
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -46,6 +46,13 @@ public class SsjThread implements Runnable {
|
|||||||
ssjCodes2.add("L1004");
|
ssjCodes2.add("L1004");
|
||||||
ssjCodes2.add("L1005");
|
ssjCodes2.add("L1005");
|
||||||
ssjCodeList.put("road", ssjCodes2);
|
ssjCodeList.put("road", ssjCodes2);
|
||||||
|
|
||||||
|
ArrayList<String> ssjCodes4 = new ArrayList<>();
|
||||||
|
ssjCodes4.add("L1006");
|
||||||
|
ssjCodes4.add("L1003");
|
||||||
|
ssjCodeList.put("error", ssjCodes4);
|
||||||
|
|
||||||
|
|
||||||
mydoJobService = SpringUtils.getBean(IMydoJobService.class);
|
mydoJobService = SpringUtils.getBean(IMydoJobService.class);
|
||||||
jobCallBackService = SpringUtils.getBean(IJobCallBackService.class);
|
jobCallBackService = SpringUtils.getBean(IJobCallBackService.class);
|
||||||
apiService = SpringUtils.getBean(IApiService.class);
|
apiService = SpringUtils.getBean(IApiService.class);
|
||||||
@@ -97,73 +104,135 @@ public class SsjThread implements Runnable {
|
|||||||
log.error(e.getMessage(), e);
|
log.error(e.getMessage(), e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
case "error":
|
||||||
|
for (String ssjCode : ssjCodeList.get("error")) {
|
||||||
|
try {
|
||||||
|
if (PlcSsjRead.deviceSsjMap.containsKey(ssjCode)) {
|
||||||
|
inDispatchError(PlcSsjRead.deviceSsjMap.get(ssjCode));
|
||||||
|
} else {
|
||||||
|
log.error("设备不存在 ssjCode{}", ssjCode);
|
||||||
|
}
|
||||||
|
} catch (RuntimeException e) {
|
||||||
|
log.error(e.getMessage(), e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void inDispatchError(DeviceSsj deviceSsj) {
|
||||||
|
if (deviceSsj.getErrorCode() > 0) {
|
||||||
|
if (deviceSsj.getDeviceCode().equals("L1003")) {
|
||||||
|
String code = "TD1001";
|
||||||
|
String errorCode = String.valueOf(deviceSsj.getErrorCode());
|
||||||
|
HashMap<String, Object> objectObjectHashMap = new HashMap<>();
|
||||||
|
objectObjectHashMap.put("deviceCode", code);
|
||||||
|
objectObjectHashMap.put("errorCode", errorCode);
|
||||||
|
apiService.updateLedError(objectObjectHashMap);
|
||||||
|
}
|
||||||
|
if (deviceSsj.getDeviceCode().equals("L1006")) {
|
||||||
|
String code = "TD1008";
|
||||||
|
String errorCode = String.valueOf(deviceSsj.getErrorCode());
|
||||||
|
HashMap<String, Object> objectObjectHashMap = new HashMap<>();
|
||||||
|
objectObjectHashMap.put("deviceCode", code);
|
||||||
|
objectObjectHashMap.put("errorCode", errorCode);
|
||||||
|
apiService.updateLedError(objectObjectHashMap);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void inDispatch(DeviceSsj deviceSsj) {
|
void inDispatch(DeviceSsj deviceSsj) {
|
||||||
//出库到位
|
//出库到位
|
||||||
if (deviceSsj.getDw() == 1 && deviceSsj.getTaskNo() > 0) {
|
if (deviceSsj.getDw() == 1 && deviceSsj.getTaskNo() > 0) {
|
||||||
|
HashMap<String, Object> objectObjectHashMap = new HashMap<>();
|
||||||
|
objectObjectHashMap.put("deviceCode", deviceSsj.getDeviceCode());
|
||||||
|
objectObjectHashMap.put("taskNo", deviceSsj.getTaskNo());
|
||||||
|
apiService.updateLed(objectObjectHashMap);
|
||||||
|
|
||||||
MydoJob mydoJob = mydoJobService.selectMydoJobByTaskNo(Convert.toLong(deviceSsj.getTaskNo()));
|
MydoJob mydoJob = mydoJobService.selectMydoJobByTaskNo(Convert.toLong(deviceSsj.getTaskNo()));
|
||||||
if (mydoJob != null) {
|
if (mydoJob != null && mydoJob.getInOrOut().equals("22")) {
|
||||||
log.info("设备:{} 位置:{} 任务号:{} 出库到位", "输送线", deviceSsj.getDeviceCode(), mydoJob.getTaskNo());
|
// 新增agv执行队列,以及调用wms后台任务过账
|
||||||
mydoJobService.insertHistory(mydoJob.getJobId());
|
AjaxResult ajaxResult1 = apiService.insertAgvQuene(objectObjectHashMap);
|
||||||
mydoJobService.deleteMydoJobByJobId(mydoJob.getJobId());
|
if (ajaxResult1.get("code").equals("200")) {
|
||||||
JobCallBack jobCallBack = new JobCallBack();
|
HashMap<String, Object> map = new HashMap<>();
|
||||||
jobCallBack.setType("2");
|
map.put("trayCode", mydoJob.getTrayCode());
|
||||||
jobCallBack.setMydojobId(mydoJob.getJobId());
|
//拉取
|
||||||
jobCallBack.setStatus("0");
|
AjaxResult ajaxResult = apiService.OutMakeSure(map);
|
||||||
jobCallBack.setTaskNo(Convert.toLong(mydoJob.getTaskNo()));
|
if (ajaxResult.get("code").equals("200")) {
|
||||||
jobCallBack.setCreateTime(new Date());
|
mydoJobService.insertHistory(mydoJob.getJobId());
|
||||||
jobCallBackService.insertJobCallBack(jobCallBack);
|
mydoJobService.deleteMydoJobByJobId(mydoJob.getJobId());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void inDispatch1(DeviceSsj deviceSsj) {
|
void inDispatch1(DeviceSsj deviceSsj) {
|
||||||
if (deviceSsj.getRkqq() == 1 && StrUtil.isNotBlank(deviceSsj.getTrayCode())) {
|
if (deviceSsj.getRkqq() == 1 && StrUtil.isNotBlank(deviceSsj.getTrayCode().trim())) {
|
||||||
//todo 查是否为入库模式,不是退回,是否超重
|
String trayCode = deviceSsj.getTrayCode().trim();
|
||||||
HashMap<String, Object> map = new HashMap<>();
|
MydoJob getMydoJob = mydoJobService.selectMydoJobByTrayCode(trayCode);
|
||||||
map.put("trayCode", deviceSsj.getTrayCode());
|
if (getMydoJob == null && deviceSsj.getTaskNo() < 1000) {
|
||||||
//拉取
|
String exit = "";
|
||||||
AjaxResult ajaxResult = apiService.createInMydoJob(map);
|
if (deviceSsj.getDeviceCode().equals("GS1002")) {
|
||||||
if (ajaxResult.isSuccess()) {
|
exit = "L1004";
|
||||||
//拿到正常作业,插到wcs作业表,下发给输送机任务号,覆盖任务号
|
}
|
||||||
MydoJob mydoJob = BeanUtil.toBean(ajaxResult.get("data"), MydoJob.class);
|
if (deviceSsj.getDeviceCode().equals("GS1007")) {
|
||||||
mydoJob.setStatus("1");
|
exit = "L1005";
|
||||||
mydoJob.setExecutionPhase("1");
|
}
|
||||||
mydoJob.setCreateTime(new Date());
|
Integer count = mydoJobService.selectMydoJobExit(exit);
|
||||||
if ("GS1002".equals(deviceSsj.getDeviceCode())) {
|
if (count > 0) {
|
||||||
mydoJob.setEntranceId("L1004");
|
int i = writeToSsj(deviceSsj.getPlcDbWriteAddress(), "0", 2, 2);
|
||||||
|
if (i == 1) {
|
||||||
|
log.info(deviceSsj.getDeviceCode() + "有相应入口的出库作业,下发退回,去向2 条码" + deviceSsj.getTrayCode());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//todo 查是否为入库模式,不是退回,是否超重
|
||||||
|
HashMap<String, Object> map = new HashMap<>();
|
||||||
|
map.put("trayCode", deviceSsj.getTrayCode());
|
||||||
|
//拉取
|
||||||
|
AjaxResult ajaxResult = apiService.createInMydoJob(map);
|
||||||
|
if (ajaxResult.isSuccess()) {
|
||||||
|
//拿到正常作业,插到wcs作业表,下发给输送机任务号,覆盖任务号
|
||||||
|
MydoJob mydoJob = BeanUtil.toBean(ajaxResult.get("data"), MydoJob.class);
|
||||||
|
mydoJob.setStatus("1");
|
||||||
|
mydoJob.setExecutionPhase("1");
|
||||||
|
mydoJob.setCreateTime(new Date());
|
||||||
|
mydoJob.setTheFloor(mydoJob.getClassId());
|
||||||
|
mydoJob.setTrayCode(trayCode);
|
||||||
|
if ("GS1002".equals(deviceSsj.getDeviceCode())) {
|
||||||
|
mydoJob.setEntranceId("L1004");
|
||||||
|
} else {
|
||||||
|
mydoJob.setEntranceId("L1005");
|
||||||
|
}
|
||||||
|
// 插入入库作业,并且根据作业直接下发 ,下发完毕直接修改执行阶段
|
||||||
|
MydoJob mydoJob1 = new MydoJob();
|
||||||
|
mydoJob1.setTaskNo(mydoJob.getTaskNo());
|
||||||
|
mydoJob1.setTrayCode(mydoJob.getTrayCode());
|
||||||
|
List<MydoJob> mydoJobs = mydoJobService.selectMydoJobList(mydoJob1);
|
||||||
|
if (mydoJobs.size() > 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
mydoJobService.insertMydoJob(mydoJob);
|
||||||
|
int i = writeToSsj(deviceSsj.getPlcDbWriteAddress(), mydoJob.getTaskNo(), 1, 1);
|
||||||
|
if (i == 1) {
|
||||||
|
mydoJob.setStatus("3");
|
||||||
|
mydoJobService.updateMydoJob(mydoJob);
|
||||||
|
log.info(deviceSsj.getDeviceCode() + "输送机下发任务号成功:{}", mydoJob.getTaskNo());
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
mydoJob.setEntranceId("L1005");
|
int i = writeToSsj(deviceSsj.getPlcDbWriteAddress(), "0", 2, 2);
|
||||||
|
if (i == 1) {
|
||||||
|
log.info(deviceSsj.getDeviceCode() + "未查到该托盘码作业,下发退回,去向2 条码" + deviceSsj.getTrayCode());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// 插入入库作业,并且根据作业直接下发 ,下发完毕直接修改执行阶段
|
|
||||||
MydoJob mydoJob1 = new MydoJob();
|
|
||||||
mydoJob1.setTaskNo(mydoJob.getTaskNo());
|
|
||||||
List<MydoJob> mydoJobs = mydoJobService.selectMydoJobList(mydoJob1);
|
|
||||||
if (mydoJobs.size() > 0) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
mydoJobService.insertMydoJob(mydoJob);
|
|
||||||
int i = writeToSsj(deviceSsj.getPlcDbWriteAddress(), mydoJob.getTaskNo(), 1, 1);
|
|
||||||
if (i == 1) {
|
|
||||||
mydoJob.setStatus("3");
|
|
||||||
mydoJobService.updateMydoJob(mydoJob);
|
|
||||||
log.info(deviceSsj.getDeviceCode() + "输送机下发任务号成功:{}", mydoJob.getTaskNo());
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
int i = writeToSsj(deviceSsj.getPlcDbWriteAddress(), "0", 2, 2);
|
|
||||||
if (i == 1) {
|
|
||||||
log.info(deviceSsj.getDeviceCode() + "未查到该托盘码作业,下发退回,去向2");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -171,10 +240,28 @@ public class SsjThread implements Runnable {
|
|||||||
void inDispatch2(DeviceSsj deviceSsj) {
|
void inDispatch2(DeviceSsj deviceSsj) {
|
||||||
if (deviceSsj.getDw() == 1 && deviceSsj.getTaskNo() > 1000) {
|
if (deviceSsj.getDw() == 1 && deviceSsj.getTaskNo() > 1000) {
|
||||||
|
|
||||||
MydoJob mydoJob = mydoJobService.selectMydoJobByTaskNo((long) deviceSsj.getTaskNo());
|
MydoJob mydoJob1 = mydoJobService.selectMydoJobByTaskNo(Long.valueOf(deviceSsj.getTaskNo()));
|
||||||
if (mydoJob != null) {
|
if (mydoJob1 != null && mydoJob1.getCargoSpaceId() != null) {
|
||||||
mydoJob.setExecutionPhase("2");
|
return;
|
||||||
mydoJobService.updateMydoJob(mydoJob);
|
}
|
||||||
|
if (mydoJob1 != null && Integer.parseInt(mydoJob1.getInOrOut()) < 20) {
|
||||||
|
HashMap<String, Object> map = new HashMap<>();
|
||||||
|
map.put("taskNo", deviceSsj.getTaskNo());
|
||||||
|
map.put("deviceCode", deviceSsj.getDeviceCode());
|
||||||
|
//拉取
|
||||||
|
AjaxResult ajaxResult = apiService.sendCargoSpace(map);
|
||||||
|
if (ajaxResult.isSuccess()) {
|
||||||
|
MydoJob data = BeanUtil.toBean(ajaxResult.get("data"), MydoJob.class);
|
||||||
|
String cargoSpaceId = data.getCargoSpaceId();
|
||||||
|
String theFloor = data.getClassId();
|
||||||
|
MydoJob mydoJob = mydoJobService.selectMydoJobByTaskNo((long) deviceSsj.getTaskNo());
|
||||||
|
if (mydoJob != null && cargoSpaceId != null && !cargoSpaceId.equals("")) {
|
||||||
|
mydoJob.setTheFloor(theFloor);
|
||||||
|
mydoJob.setCargoSpaceId(cargoSpaceId);
|
||||||
|
mydoJob.setExecutionPhase("2");
|
||||||
|
mydoJobService.updateMydoJob(mydoJob);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ import cn.hutool.core.util.IdUtil;
|
|||||||
import cn.hutool.core.util.ObjUtil;
|
import cn.hutool.core.util.ObjUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.ruoyi.bas.port.service.IWcsPortService;
|
import com.ruoyi.bas.port.service.IWcsPortService;
|
||||||
|
import com.ruoyi.bas.srgvmap.domain.WcsSrgvMap;
|
||||||
|
import com.ruoyi.bas.srgvmap.service.IWcsSrgvMapService;
|
||||||
import com.ruoyi.common.domain.SendData;
|
import com.ruoyi.common.domain.SendData;
|
||||||
import com.ruoyi.common.utils.spring.SpringUtils;
|
import com.ruoyi.common.utils.spring.SpringUtils;
|
||||||
import com.ruoyi.device.srgv.domain.DeviceSrgv;
|
import com.ruoyi.device.srgv.domain.DeviceSrgv;
|
||||||
@@ -24,8 +26,8 @@ import com.ruoyi.schedule.plcRead.tsj.PlcTsjRead;
|
|||||||
import com.ruoyi.schedule.plcRead.util.Tools;
|
import com.ruoyi.schedule.plcRead.util.Tools;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.*;
|
||||||
import java.util.List;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class TsjThread implements Runnable {
|
public class TsjThread implements Runnable {
|
||||||
@@ -35,13 +37,18 @@ public class TsjThread implements Runnable {
|
|||||||
private ITsjDeviceExecutionQueueFinishService tsjDeviceExecutionQueueFinishService;
|
private ITsjDeviceExecutionQueueFinishService tsjDeviceExecutionQueueFinishService;
|
||||||
private IWcsPortService wcsPortService;
|
private IWcsPortService wcsPortService;
|
||||||
private IWcsSrgvQueueService wcsSrgvQueueService;
|
private IWcsSrgvQueueService wcsSrgvQueueService;
|
||||||
public IMydoJobService mydoJobService;
|
private IMydoJobService mydoJobService;
|
||||||
|
private IWcsSrgvMapService wcsSrgvMapService;
|
||||||
|
public IWcsSrgvQueueService wcsSagvQueueMapper;
|
||||||
|
|
||||||
public void init() {
|
public void init() {
|
||||||
tsjDeviceExecutionQueueService = SpringUtils.getBean(ITsjDeviceExecutionQueueService.class);
|
tsjDeviceExecutionQueueService = SpringUtils.getBean(ITsjDeviceExecutionQueueService.class);
|
||||||
tsjDeviceExecutionQueueFinishService = SpringUtils.getBean(ITsjDeviceExecutionQueueFinishService.class);
|
tsjDeviceExecutionQueueFinishService = SpringUtils.getBean(ITsjDeviceExecutionQueueFinishService.class);
|
||||||
wcsPortService = SpringUtils.getBean(IWcsPortService.class);
|
wcsPortService = SpringUtils.getBean(IWcsPortService.class);
|
||||||
wcsSrgvQueueService = SpringUtils.getBean(IWcsSrgvQueueService.class);
|
wcsSrgvQueueService = SpringUtils.getBean(IWcsSrgvQueueService.class);
|
||||||
|
wcsSrgvMapService = SpringUtils.getBean(IWcsSrgvMapService.class);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -76,7 +83,7 @@ public class TsjThread implements Runnable {
|
|||||||
* 1、下发完成 如果设备状态为 2-工作 ,触发方式 2-自动,任务号大于999,则代表任务下发完成
|
* 1、下发完成 如果设备状态为 2-工作 ,触发方式 2-自动,任务号大于999,则代表任务下发完成
|
||||||
*
|
*
|
||||||
* */
|
* */
|
||||||
if (czfs == 2 && sbzt == 2 && rwh > 999) {
|
if (czfs == 2 && sbzt == 2 && rwh > 500) {
|
||||||
// finishSend(rwh, tsj);
|
// finishSend(rwh, tsj);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -84,19 +91,28 @@ public class TsjThread implements Runnable {
|
|||||||
* 2、四向车任务生成 2-工作 ,触发方式 2-自动,任务号大于999
|
* 2、四向车任务生成 2-工作 ,触发方式 2-自动,任务号大于999
|
||||||
*
|
*
|
||||||
* */
|
* */
|
||||||
if (czfs == 2 && sbzt == 2 && jdbz == 4 && rwh > 999) {
|
if (czfs == 2 && sbzt == 2 && jdbz == 4 && rwh > 500) {
|
||||||
createSRgvQueue(rwh, tsj);
|
WcsSrgvQueue wcsSrgvQueue = wcsSrgvQueueService.selectWcsSrgvQueueByTaskNo(String.valueOf(rwh));
|
||||||
|
String agvId = wcsSrgvQueue.getAgvId();
|
||||||
|
DeviceSrgv deviceSrgv = PlcSrgvRead.deviceSrgvMap.get(agvId);
|
||||||
|
if (deviceSrgv.getCurrSite().equals("09050" + tsj.getDqcs())) {
|
||||||
|
createSRgvQueue(rwh, tsj);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// 提升机取货中 说明对齐当前要取货层 开始给小车下发
|
// 提升机取货中 说明对齐当前要取货层 开始给小车下发
|
||||||
if (czfs == 2 && sbzt == 2 && jdbz == 2 && rwh > 999) {
|
if (czfs == 2 && sbzt == 2 && jdbz == 2 && rwh > 500) {
|
||||||
createSRgvQueueTsjQd(rwh, tsj);
|
createSRgvQueueTsjQd(rwh, tsj);
|
||||||
}
|
}
|
||||||
|
// 提升机放货途中 取消当前小车的路径
|
||||||
|
if (czfs == 2 && sbzt == 2 && jdbz == 3 && rwh > 500) {
|
||||||
|
removePathCar(rwh, tsj);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 2、任务完成
|
* 2、任务完成
|
||||||
*
|
*
|
||||||
* */
|
* */
|
||||||
if (czfs == 2 && sbzt == 2 && jdbz == 5 && rwh > 999) {
|
if (czfs == 2 && sbzt == 2 && jdbz == 5 && rwh > 500) {
|
||||||
//任务完成
|
//任务完成
|
||||||
finishTask(rwh, tsj);
|
finishTask(rwh, tsj);
|
||||||
}
|
}
|
||||||
@@ -113,12 +129,20 @@ public class TsjThread implements Runnable {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void removePathCar(Long rwh, DeviceTsj tsj) {
|
||||||
|
WcsSrgvQueue wcsSrgvQueue = wcsSrgvQueueService.selectWcsSrgvQueueByTaskNo(String.valueOf(rwh));
|
||||||
|
DeviceSrgv deviceSrgv = PlcSrgvRead.deviceSrgvMap.get(wcsSrgvQueue.getAgvId());
|
||||||
|
if (!deviceSrgv.getCurrSite().equals("07050"+wcsSrgvQueue.getTheFloor()) && tsj.getHczt() == 1 && !wcsSrgvQueue.getPathInfo().isEmpty() && java.util.Arrays.asList(wcsSrgvQueue.getPathInfo().trim().replaceAll(",$", "").split(",")).contains("07050"+wcsSrgvQueue.getTheFloor())&&wcsSrgvQueue.getEndSite().equals("tsj")) {
|
||||||
|
wcsSrgvQueue.setPathInfo("");
|
||||||
|
wcsSrgvQueueService.updateWcsSrgvQueue(wcsSrgvQueue);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 下发提升机启动
|
// 下发提升机启动
|
||||||
private void createSRgvQueueTsjQd(Long rwh, DeviceTsj tsj) {
|
private void createSRgvQueueTsjQd(Long rwh, DeviceTsj tsj) {
|
||||||
for (String sRgv : PlcSrgvRead.deviceSrgvMap.keySet()) {
|
for (String sRgv : PlcSrgvRead.deviceSrgvMap.keySet()) {
|
||||||
DeviceSrgv deviceSrgv = PlcSrgvRead.deviceSrgvMap.get(sRgv);
|
DeviceSrgv deviceSrgv = PlcSrgvRead.deviceSrgvMap.get(sRgv);
|
||||||
if (deviceSrgv.getCurrSite().equals("09050" + deviceSrgv.getCurrFloor()) && deviceSrgv.getWorkMode() == 5 && deviceSrgv.getStatus() == 2 && tsj.getHczt() == 1) {
|
if ((deviceSrgv.getCurrSite().equals("09050" + deviceSrgv.getCurrFloor()) || deviceSrgv.getCurrSite().equals("10050" + deviceSrgv.getCurrFloor())) && deviceSrgv.getWorkMode() == 5 && deviceSrgv.getStatus() == 1 && tsj.getHczt() == 1) {
|
||||||
|
|
||||||
SendData rwlxSendData = new SendData(Tools.INT, 1);
|
SendData rwlxSendData = new SendData(Tools.INT, 1);
|
||||||
DeviceTsj deviceTsj = PlcTsjRead.deviceTsjMap.get(Convert.toStr(1));
|
DeviceTsj deviceTsj = PlcTsjRead.deviceTsjMap.get(Convert.toStr(1));
|
||||||
byte[] bytes = Tools.sendData(rwlxSendData);
|
byte[] bytes = Tools.sendData(rwlxSendData);
|
||||||
@@ -147,11 +171,15 @@ public class TsjThread implements Runnable {
|
|||||||
WcsSrgvQueue sRgvQueueParam = new WcsSrgvQueue();
|
WcsSrgvQueue sRgvQueueParam = new WcsSrgvQueue();
|
||||||
sRgvQueueParam.setTaskNo(Convert.toStr(rwh));
|
sRgvQueueParam.setTaskNo(Convert.toStr(rwh));
|
||||||
sRgvQueueParam.setEndSite(Convert.toStr("tsj"));
|
sRgvQueueParam.setEndSite(Convert.toStr("tsj"));
|
||||||
|
sRgvQueueParam.setIssued("1");
|
||||||
|
sRgvQueueParam.setExecutionStatus("3");
|
||||||
List<WcsSrgvQueue> wcsSrgvQueues = wcsSrgvQueueService.selectWcsSrgvQueueList(sRgvQueueParam);
|
List<WcsSrgvQueue> wcsSrgvQueues = wcsSrgvQueueService.selectWcsSrgvQueueList(sRgvQueueParam);
|
||||||
if (CollUtil.isEmpty(wcsSrgvQueues)) {
|
if (CollUtil.isEmpty(wcsSrgvQueues)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
WcsSrgvQueue wcsSrgvQueue = wcsSrgvQueueService.insertHistory(Convert.toStr(rwh));
|
WcsSrgvQueue wcsSrgvQueue = wcsSrgvQueueService.insertHistory(Convert.toStr(rwh));
|
||||||
|
String cargoPickSite = wcsSrgvQueue.getCargoPickSite();
|
||||||
|
String cargoPlaceSite = wcsSrgvQueue.getCargoPlaceSite();
|
||||||
//修改起点终点
|
//修改起点终点
|
||||||
if (ObjUtil.isNotEmpty(wcsSrgvQueue)) {
|
if (ObjUtil.isNotEmpty(wcsSrgvQueue)) {
|
||||||
wcsSrgvQueue.setCreateDate(DateUtil.formatDateTime(DateUtil.date()));
|
wcsSrgvQueue.setCreateDate(DateUtil.formatDateTime(DateUtil.date()));
|
||||||
@@ -170,12 +198,44 @@ public class TsjThread implements Runnable {
|
|||||||
break;
|
break;
|
||||||
case "2":
|
case "2":
|
||||||
//出库
|
//出库
|
||||||
// startSite="tsj";
|
|
||||||
startSite = "09050" + tsj.getDqcs();
|
startSite = "09050" + tsj.getDqcs();
|
||||||
endSite = wcsSrgvQueue.getCargoPlaceSite();
|
// 如果提升机当前层等于1 并且是出库任务,更新出库点位为出库缓存点
|
||||||
|
// Integer i = mydoJobService.selectMydoJobCountOut();
|
||||||
|
if (tsj.getDqcs() == 1 && "2".equals(wcsSrgvQueue.getDefault02())) {
|
||||||
|
WcsSrgvMap wcsSrgvMapParam = new WcsSrgvMap();
|
||||||
|
wcsSrgvMapParam.setRemark("outCache");
|
||||||
|
List<WcsSrgvMap> wcsSrgvMaps = wcsSrgvMapService.selectWcsSrgvMapList(wcsSrgvMapParam);
|
||||||
|
List<String> cacheSite = wcsSrgvMaps.stream().sorted(Comparator.comparing(WcsSrgvMap::getSiteId)).map(WcsSrgvMap::getSiteId).collect(Collectors.toList());
|
||||||
|
List<String> currentSRgvSite = new ArrayList<>();
|
||||||
|
// 判断是否有车是在一样的位置
|
||||||
|
for (String srgvCode : PlcSrgvRead.deviceSrgvMap.keySet()) {
|
||||||
|
currentSRgvSite.add(PlcSrgvRead.deviceSrgvMap.get(srgvCode).getCurrSite());
|
||||||
|
}
|
||||||
|
cacheSite.removeAll(currentSRgvSite);
|
||||||
|
if (CollUtil.isNotEmpty(cacheSite)) {
|
||||||
|
for (String cache : cacheSite) {
|
||||||
|
WcsSrgvQueue wcsSrgvQueueParam = new WcsSrgvQueue();
|
||||||
|
wcsSrgvQueueParam.setEndSite(cache);
|
||||||
|
// 判断是否有车要去这个缓存点 没有就更新
|
||||||
|
List<WcsSrgvQueue> wcsSrgvQueues1 = wcsSrgvQueueService.selectWcsSrgvQueueList(wcsSrgvQueueParam);
|
||||||
|
// WcsSrgvQueue wcsSrgvQueueParam1 = new WcsSrgvQueue();
|
||||||
|
// wcsSrgvQueueParam1.setStartSite(cache);
|
||||||
|
// // 并且从缓存点走的
|
||||||
|
// List<WcsSrgvQueue> wcsSrgvQueues2 = wcsSrgvQueueService.selectWcsSrgvQueueList(wcsSrgvQueueParam1);
|
||||||
|
if (CollUtil.isEmpty(wcsSrgvQueues1)) {
|
||||||
|
wcsSrgvQueue.setStartSite(startSite);
|
||||||
|
wcsSrgvQueue.setEndSite(cacheSite.get(0));
|
||||||
|
wcsSrgvQueue.setDefault02("7");
|
||||||
|
wcsSrgvQueueService.updateWcsSrgvQueue(wcsSrgvQueue);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
endSite = wcsSrgvQueue.getCargoPlaceSite();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case "3":
|
case "3":
|
||||||
//充电
|
|
||||||
break;
|
break;
|
||||||
case "4":
|
case "4":
|
||||||
//点到点
|
//点到点
|
||||||
@@ -192,10 +252,52 @@ public class TsjThread implements Runnable {
|
|||||||
log.info("任务类型错误");
|
log.info("任务类型错误");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case "8":
|
||||||
|
//换层任务直接变成点到点任务
|
||||||
|
switch (wcsSrgvQueue.getTaskType()) {
|
||||||
|
case "1":
|
||||||
|
WcsSrgvMap wcsSrgvMapq = wcsSrgvMapService.selectWcsSrgvMapBySiteId(cargoPickSite);
|
||||||
|
WcsSrgvMap wcsSrgvMapf = wcsSrgvMapService.selectWcsSrgvMapBySiteId(cargoPlaceSite);
|
||||||
|
if (wcsSrgvMapq != null && wcsSrgvMapf != null) {
|
||||||
|
Integer count = wcsSrgvQueueService.selectByEndSite();
|
||||||
|
List<DeviceSrgv> collect = PlcSrgvRead.deviceSrgvMap.values().stream().filter(d ->
|
||||||
|
d.getCurrSite().equals(cargoPickSite))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
if ((count > 0 || !collect.isEmpty()) && tsj.getDqcs() == 1) {
|
||||||
|
wcsSrgvQueue.setEndSite("070301");
|
||||||
|
} else {
|
||||||
|
wcsSrgvQueue.setEndSite(cargoPickSite);
|
||||||
|
}
|
||||||
|
|
||||||
|
wcsSrgvQueue.setDefault02("4");
|
||||||
|
wcsSrgvQueue.setTheFloor(wcsSrgvMapq.getTheLayer().toString());
|
||||||
|
wcsSrgvQueue.setDefault07(wcsSrgvMapf.getTheLayer().toString());
|
||||||
|
wcsSrgvQueue.setIssued("0");
|
||||||
|
wcsSrgvQueue.setExecutionStatus("1");
|
||||||
|
wcsSrgvQueue.setTaskType("1");
|
||||||
|
}
|
||||||
|
wcsSrgvQueue.setStartSite("09050" + tsj.getDqcs());
|
||||||
|
wcsSrgvQueueService.updateWcsSrgvQueue(wcsSrgvQueue);
|
||||||
|
break;
|
||||||
|
case "3":
|
||||||
|
WcsSrgvMap wcsSrgvMapq1 = wcsSrgvMapService.selectWcsSrgvMapBySiteId(cargoPickSite);
|
||||||
|
WcsSrgvMap wcsSrgvMapf1 = wcsSrgvMapService.selectWcsSrgvMapBySiteId(cargoPlaceSite);
|
||||||
|
if (wcsSrgvMapq1 != null && wcsSrgvMapf1 != null) {
|
||||||
|
wcsSrgvQueue.setEndSite(cargoPlaceSite);
|
||||||
|
wcsSrgvQueue.setDefault02("3");
|
||||||
|
wcsSrgvQueue.setTheFloor(wcsSrgvMapq1.getTheLayer().toString());
|
||||||
|
wcsSrgvQueue.setDefault07(wcsSrgvMapf1.getTheLayer().toString());
|
||||||
|
wcsSrgvQueue.setIssued("0");
|
||||||
|
wcsSrgvQueue.setExecutionStatus("1");
|
||||||
|
wcsSrgvQueue.setTaskType("3");
|
||||||
|
}
|
||||||
|
wcsSrgvQueue.setStartSite("09050" + tsj.getDqcs());
|
||||||
|
wcsSrgvQueueService.updateWcsSrgvQueue(wcsSrgvQueue);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (StrUtil.isNotEmpty(startSite) && StrUtil.isNotEmpty(endSite)) {
|
if (StrUtil.isNotEmpty(startSite) && StrUtil.isNotEmpty(endSite) && !wcsSrgvQueue.getDefault02().equals("8")) {
|
||||||
|
|
||||||
wcsSrgvQueue.setStartSite(startSite);
|
wcsSrgvQueue.setStartSite(startSite);
|
||||||
wcsSrgvQueue.setEndSite(endSite);
|
wcsSrgvQueue.setEndSite(endSite);
|
||||||
wcsSrgvQueueService.updateWcsSrgvQueue(wcsSrgvQueue);
|
wcsSrgvQueueService.updateWcsSrgvQueue(wcsSrgvQueue);
|
||||||
@@ -209,7 +311,9 @@ public class TsjThread implements Runnable {
|
|||||||
private void createQueue(DeviceTsj tsj) {
|
private void createQueue(DeviceTsj tsj) {
|
||||||
for (String sRgv : PlcSrgvRead.deviceSrgvMap.keySet()) {
|
for (String sRgv : PlcSrgvRead.deviceSrgvMap.keySet()) {
|
||||||
DeviceSrgv deviceSrgv = PlcSrgvRead.deviceSrgvMap.get(sRgv);
|
DeviceSrgv deviceSrgv = PlcSrgvRead.deviceSrgvMap.get(sRgv);
|
||||||
if (deviceSrgv.getSpare2().equals("1") && deviceSrgv.getTaskNo() > 0) {
|
Integer count = tsjDeviceExecutionQueueService.selectCount();
|
||||||
|
WcsSrgvQueue wcsSrgvQueue1 = wcsSrgvQueueService.selectWcsSrgvQueueByTaskNo(String.valueOf(deviceSrgv.getTaskNo()));
|
||||||
|
if (deviceSrgv.getSpare2().equals("1") && deviceSrgv.getTaskNo() > 0 && count == 0 && wcsSrgvQueue1.getEndSite().equals("tsj")) {
|
||||||
//请求进入输送机
|
//请求进入输送机
|
||||||
WcsSrgvQueue sRgvQueueParam = new WcsSrgvQueue();
|
WcsSrgvQueue sRgvQueueParam = new WcsSrgvQueue();
|
||||||
sRgvQueueParam.setAgvId(Convert.toStr(deviceSrgv.getDeviceId()));
|
sRgvQueueParam.setAgvId(Convert.toStr(deviceSrgv.getDeviceId()));
|
||||||
|
|||||||
@@ -0,0 +1,104 @@
|
|||||||
|
package com.ruoyi.system.controller;
|
||||||
|
|
||||||
|
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 com.ruoyi.common.annotation.Log;
|
||||||
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
|
import com.ruoyi.system.domain.AgvContainerTask;
|
||||||
|
import com.ruoyi.system.service.IAgvContainerTaskService;
|
||||||
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* agv料架搬运任务Controller
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2026-05-15
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/system/task")
|
||||||
|
public class AgvContainerTaskController extends BaseController
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private IAgvContainerTaskService agvContainerTaskService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询agv料架搬运任务列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:task:list')")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo list(AgvContainerTask agvContainerTask)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<AgvContainerTask> list = agvContainerTaskService.selectAgvContainerTaskList(agvContainerTask);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出agv料架搬运任务列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:task:export')")
|
||||||
|
@Log(title = "agv料架搬运任务", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(HttpServletResponse response, AgvContainerTask agvContainerTask)
|
||||||
|
{
|
||||||
|
List<AgvContainerTask> list = agvContainerTaskService.selectAgvContainerTaskList(agvContainerTask);
|
||||||
|
ExcelUtil<AgvContainerTask> util = new ExcelUtil<AgvContainerTask>(AgvContainerTask.class);
|
||||||
|
util.exportExcel(response, list, "agv料架搬运任务数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取agv料架搬运任务详细信息
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:task:query')")
|
||||||
|
@GetMapping(value = "/{id}")
|
||||||
|
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||||
|
{
|
||||||
|
return success(agvContainerTaskService.selectAgvContainerTaskById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增agv料架搬运任务
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:task:add')")
|
||||||
|
@Log(title = "agv料架搬运任务", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping
|
||||||
|
public AjaxResult add(@RequestBody AgvContainerTask agvContainerTask)
|
||||||
|
{
|
||||||
|
return toAjax(agvContainerTaskService.insertAgvContainerTask(agvContainerTask));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改agv料架搬运任务
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:task:edit')")
|
||||||
|
@Log(title = "agv料架搬运任务", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping
|
||||||
|
public AjaxResult edit(@RequestBody AgvContainerTask agvContainerTask)
|
||||||
|
{
|
||||||
|
return toAjax(agvContainerTaskService.updateAgvContainerTask(agvContainerTask));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除agv料架搬运任务
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:task:remove')")
|
||||||
|
@Log(title = "agv料架搬运任务", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{ids}")
|
||||||
|
public AjaxResult remove(@PathVariable Long[] ids)
|
||||||
|
{
|
||||||
|
return toAjax(agvContainerTaskService.deleteAgvContainerTaskByIds(ids));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,173 @@
|
|||||||
|
package com.ruoyi.system.domain;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
|
import com.ruoyi.common.annotation.Excel;
|
||||||
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* agv料架搬运任务对象 agv_container_task
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2026-05-15
|
||||||
|
*/
|
||||||
|
public class AgvContainerTask extends BaseEntity
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** $column.columnComment */
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/** 作业编码 */
|
||||||
|
@Excel(name = "作业编码")
|
||||||
|
private String container;
|
||||||
|
|
||||||
|
/** 起点 */
|
||||||
|
@Excel(name = "起点")
|
||||||
|
private String startPoint;
|
||||||
|
|
||||||
|
/** 终点 */
|
||||||
|
@Excel(name = "终点")
|
||||||
|
private String endPoint;
|
||||||
|
|
||||||
|
/** 开始时间 */
|
||||||
|
@Excel(name = "开始时间")
|
||||||
|
private String startTime;
|
||||||
|
|
||||||
|
/** 结束时间 */
|
||||||
|
@Excel(name = "结束时间")
|
||||||
|
private String finishTime;
|
||||||
|
|
||||||
|
/** 任务号 */
|
||||||
|
@Excel(name = "任务号")
|
||||||
|
private String taskNo;
|
||||||
|
|
||||||
|
/** 任务状态 0-创建 1-执行中 2-完成 */
|
||||||
|
@Excel(name = "任务状态 0-创建 1-执行中 2-完成")
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
/** 任务类型 */
|
||||||
|
@Excel(name = "任务类型")
|
||||||
|
private String spare1;
|
||||||
|
|
||||||
|
/** 托盘码 */
|
||||||
|
@Excel(name = "托盘码")
|
||||||
|
private String spare2;
|
||||||
|
|
||||||
|
public void setId(Long id)
|
||||||
|
{
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getId()
|
||||||
|
{
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setContainer(String container)
|
||||||
|
{
|
||||||
|
this.container = container;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getContainer()
|
||||||
|
{
|
||||||
|
return container;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStartPoint(String startPoint)
|
||||||
|
{
|
||||||
|
this.startPoint = startPoint;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStartPoint()
|
||||||
|
{
|
||||||
|
return startPoint;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEndPoint(String endPoint)
|
||||||
|
{
|
||||||
|
this.endPoint = endPoint;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEndPoint()
|
||||||
|
{
|
||||||
|
return endPoint;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStartTime(String startTime)
|
||||||
|
{
|
||||||
|
this.startTime = startTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStartTime()
|
||||||
|
{
|
||||||
|
return startTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFinishTime(String finishTime)
|
||||||
|
{
|
||||||
|
this.finishTime = finishTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFinishTime()
|
||||||
|
{
|
||||||
|
return finishTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTaskNo(String taskNo)
|
||||||
|
{
|
||||||
|
this.taskNo = taskNo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTaskNo()
|
||||||
|
{
|
||||||
|
return taskNo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStatus(String status)
|
||||||
|
{
|
||||||
|
this.status = status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStatus()
|
||||||
|
{
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSpare1(String spare1)
|
||||||
|
{
|
||||||
|
this.spare1 = spare1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSpare1()
|
||||||
|
{
|
||||||
|
return spare1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSpare2(String spare2)
|
||||||
|
{
|
||||||
|
this.spare2 = spare2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSpare2()
|
||||||
|
{
|
||||||
|
return spare2;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
.append("id", getId())
|
||||||
|
.append("container", getContainer())
|
||||||
|
.append("startPoint", getStartPoint())
|
||||||
|
.append("endPoint", getEndPoint())
|
||||||
|
.append("createTime", getCreateTime())
|
||||||
|
.append("startTime", getStartTime())
|
||||||
|
.append("finishTime", getFinishTime())
|
||||||
|
.append("taskNo", getTaskNo())
|
||||||
|
.append("status", getStatus())
|
||||||
|
.append("spare1", getSpare1())
|
||||||
|
.append("spare2", getSpare2())
|
||||||
|
.toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,68 @@
|
|||||||
|
package com.ruoyi.system.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.ruoyi.system.domain.AgvContainerTask;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* agv料架搬运任务Mapper接口
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2026-05-15
|
||||||
|
*/
|
||||||
|
public interface AgvContainerTaskMapper
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询agv料架搬运任务
|
||||||
|
*
|
||||||
|
* @param id agv料架搬运任务主键
|
||||||
|
* @return agv料架搬运任务
|
||||||
|
*/
|
||||||
|
public AgvContainerTask selectAgvContainerTaskById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询agv料架搬运任务列表
|
||||||
|
*
|
||||||
|
* @param agvContainerTask agv料架搬运任务
|
||||||
|
* @return agv料架搬运任务集合
|
||||||
|
*/
|
||||||
|
public List<AgvContainerTask> selectAgvContainerTaskList(AgvContainerTask agvContainerTask);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增agv料架搬运任务
|
||||||
|
*
|
||||||
|
* @param agvContainerTask agv料架搬运任务
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertAgvContainerTask(AgvContainerTask agvContainerTask);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改agv料架搬运任务
|
||||||
|
*
|
||||||
|
* @param agvContainerTask agv料架搬运任务
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateAgvContainerTask(AgvContainerTask agvContainerTask);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除agv料架搬运任务
|
||||||
|
*
|
||||||
|
* @param id agv料架搬运任务主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteAgvContainerTaskById(Long id);
|
||||||
|
|
||||||
|
public int deleteAgvContainerTaskByContainer(String orderId);
|
||||||
|
/**
|
||||||
|
* 批量删除agv料架搬运任务
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的数据主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteAgvContainerTaskByIds(Long[] ids);
|
||||||
|
|
||||||
|
void insertAgvContainerTaskFinish(String orderId);
|
||||||
|
|
||||||
|
void updateAgvContainerTaskByOrder(String orderId);
|
||||||
|
|
||||||
|
AgvContainerTask selectAgvContainerFinishOne();
|
||||||
|
}
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
package com.ruoyi.system.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.ruoyi.system.domain.AgvContainerTask;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* agv料架搬运任务Service接口
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2026-05-15
|
||||||
|
*/
|
||||||
|
public interface IAgvContainerTaskService
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询agv料架搬运任务
|
||||||
|
*
|
||||||
|
* @param id agv料架搬运任务主键
|
||||||
|
* @return agv料架搬运任务
|
||||||
|
*/
|
||||||
|
public AgvContainerTask selectAgvContainerTaskById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询agv料架搬运任务列表
|
||||||
|
*
|
||||||
|
* @param agvContainerTask agv料架搬运任务
|
||||||
|
* @return agv料架搬运任务集合
|
||||||
|
*/
|
||||||
|
public List<AgvContainerTask> selectAgvContainerTaskList(AgvContainerTask agvContainerTask);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增agv料架搬运任务
|
||||||
|
*
|
||||||
|
* @param agvContainerTask agv料架搬运任务
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertAgvContainerTask(AgvContainerTask agvContainerTask);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改agv料架搬运任务
|
||||||
|
*
|
||||||
|
* @param agvContainerTask agv料架搬运任务
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateAgvContainerTask(AgvContainerTask agvContainerTask);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除agv料架搬运任务
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的agv料架搬运任务主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteAgvContainerTaskByIds(Long[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除agv料架搬运任务信息
|
||||||
|
*
|
||||||
|
* @param id agv料架搬运任务主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteAgvContainerTaskById(Long id);
|
||||||
|
|
||||||
|
void deleteAgvContainerTaskByOrderId(String container);
|
||||||
|
}
|
||||||
@@ -0,0 +1,100 @@
|
|||||||
|
package com.ruoyi.system.service.impl;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.ruoyi.common.utils.DateUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.ruoyi.system.mapper.AgvContainerTaskMapper;
|
||||||
|
import com.ruoyi.system.domain.AgvContainerTask;
|
||||||
|
import com.ruoyi.system.service.IAgvContainerTaskService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* agv料架搬运任务Service业务层处理
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2026-05-15
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class AgvContainerTaskServiceImpl implements IAgvContainerTaskService
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private AgvContainerTaskMapper agvContainerTaskMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询agv料架搬运任务
|
||||||
|
*
|
||||||
|
* @param id agv料架搬运任务主键
|
||||||
|
* @return agv料架搬运任务
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public AgvContainerTask selectAgvContainerTaskById(Long id)
|
||||||
|
{
|
||||||
|
return agvContainerTaskMapper.selectAgvContainerTaskById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询agv料架搬运任务列表
|
||||||
|
*
|
||||||
|
* @param agvContainerTask agv料架搬运任务
|
||||||
|
* @return agv料架搬运任务
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<AgvContainerTask> selectAgvContainerTaskList(AgvContainerTask agvContainerTask)
|
||||||
|
{
|
||||||
|
return agvContainerTaskMapper.selectAgvContainerTaskList(agvContainerTask);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增agv料架搬运任务
|
||||||
|
*
|
||||||
|
* @param agvContainerTask agv料架搬运任务
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertAgvContainerTask(AgvContainerTask agvContainerTask)
|
||||||
|
{
|
||||||
|
agvContainerTask.setCreateTime(DateUtils.getNowDate());
|
||||||
|
return agvContainerTaskMapper.insertAgvContainerTask(agvContainerTask);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改agv料架搬运任务
|
||||||
|
*
|
||||||
|
* @param agvContainerTask agv料架搬运任务
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateAgvContainerTask(AgvContainerTask agvContainerTask)
|
||||||
|
{
|
||||||
|
return agvContainerTaskMapper.updateAgvContainerTask(agvContainerTask);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除agv料架搬运任务
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的agv料架搬运任务主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteAgvContainerTaskByIds(Long[] ids)
|
||||||
|
{
|
||||||
|
return agvContainerTaskMapper.deleteAgvContainerTaskByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除agv料架搬运任务信息
|
||||||
|
*
|
||||||
|
* @param id agv料架搬运任务主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteAgvContainerTaskById(Long id)
|
||||||
|
{
|
||||||
|
return agvContainerTaskMapper.deleteAgvContainerTaskById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteAgvContainerTaskByOrderId(String container) {
|
||||||
|
agvContainerTaskMapper.deleteAgvContainerTaskByContainer(container);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -80,7 +80,7 @@ public class GetDeviceSrgvMap {
|
|||||||
AgvDto dto = new AgvDto();
|
AgvDto dto = new AgvDto();
|
||||||
dto.setId(d.getDeviceId() == null ? "" : String.format("%04d", d.getDeviceId()));
|
dto.setId(d.getDeviceId() == null ? "" : String.format("%04d", d.getDeviceId()));
|
||||||
dto.setTaskNo(d.getTaskNo() == null ? "" : String.valueOf(d.getTaskNo()));
|
dto.setTaskNo(d.getTaskNo() == null ? "" : String.valueOf(d.getTaskNo()));
|
||||||
dto.setIsThere((d.getWorkPhase() >= 3 && d.getWorkPhase() < 6 ? "1" : "0"));
|
dto.setIsThere(d.getCargoFlag()==256?"1":"0");
|
||||||
Integer wp = d.getWorkPhase();
|
Integer wp = d.getWorkPhase();
|
||||||
String status = "0";
|
String status = "0";
|
||||||
if (wp != null) {
|
if (wp != null) {
|
||||||
@@ -90,6 +90,9 @@ public class GetDeviceSrgvMap {
|
|||||||
}
|
}
|
||||||
dto.setStatus(status);
|
dto.setStatus(status);
|
||||||
dto.setLocation(d.getCurrSite() == null ? "" : d.getCurrSite());
|
dto.setLocation(d.getCurrSite() == null ? "" : d.getCurrSite());
|
||||||
|
dto.setRow(d.getCurrSite() == null ? "" : d.getCurrSite().substring(2,4));
|
||||||
|
dto.setColumn(d.getCurrSite() == null ? "" :d.getCurrSite().substring(0,2));
|
||||||
|
dto.setLayer(d.getCurrSite() == null ? "" : d.getCurrSite().substring(4,6));
|
||||||
dto.setAlarm(d.getAlarm() == null ? "" : String.valueOf(d.getAlarm()));
|
dto.setAlarm(d.getAlarm() == null ? "" : String.valueOf(d.getAlarm()));
|
||||||
dto.setAlarmMsg(DictUtils.getDictLabel("srgv_alarm", d.getAlarm() == null ? "" : String.valueOf(d.getAlarm())));
|
dto.setAlarmMsg(DictUtils.getDictLabel("srgv_alarm", d.getAlarm() == null ? "" : String.valueOf(d.getAlarm())));
|
||||||
if (d.getTaskNo() != null && d.getTaskNo() > 0) {
|
if (d.getTaskNo() != null && d.getTaskNo() > 0) {
|
||||||
@@ -132,6 +135,9 @@ public class GetDeviceSrgvMap {
|
|||||||
private String isThere;
|
private String isThere;
|
||||||
private String status;
|
private String status;
|
||||||
private String location;
|
private String location;
|
||||||
|
private String row;
|
||||||
|
private String column;
|
||||||
|
private String layer;
|
||||||
private String alarm;
|
private String alarm;
|
||||||
private String alarmMsg;
|
private String alarmMsg;
|
||||||
private String trayCode;
|
private String trayCode;
|
||||||
|
|||||||
@@ -99,8 +99,17 @@ public class GetDeviceSsjMap {
|
|||||||
dto.setRotationDirection(calcRotationDirection(d.getTaskNo()));
|
dto.setRotationDirection(calcRotationDirection(d.getTaskNo()));
|
||||||
dto.setAlarm(String.valueOf(d.getException()));
|
dto.setAlarm(String.valueOf(d.getException()));
|
||||||
dto.setAlarmMsg(DictUtils.getDictLabel("ssj_ex", String.valueOf(d.getException())));
|
dto.setAlarmMsg(DictUtils.getDictLabel("ssj_ex", String.valueOf(d.getException())));
|
||||||
dto.setDW(String.valueOf(d.getDw()));
|
|
||||||
dto.setKX(String.valueOf(d.getKx()));
|
dto.setKX(String.valueOf(d.getKx()));
|
||||||
|
if (!dto.getTaskNo().equals("0")){
|
||||||
|
if (dto.getKX().equals("0")){
|
||||||
|
dto.setDW("1");
|
||||||
|
}else {
|
||||||
|
dto.setDW("0");
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
dto.setDW("0");
|
||||||
|
}
|
||||||
|
|
||||||
if (d.getTaskNo() > 0) {
|
if (d.getTaskNo() > 0) {
|
||||||
try {
|
try {
|
||||||
MydoJob job = mydoJobService.selectMydoJobByTaskNo(Long.valueOf(d.getTaskNo()));
|
MydoJob job = mydoJobService.selectMydoJobByTaskNo(Long.valueOf(d.getTaskNo()));
|
||||||
@@ -128,16 +137,10 @@ public class GetDeviceSsjMap {
|
|||||||
*/
|
*/
|
||||||
private String calcRotationDirection(int taskNo) {
|
private String calcRotationDirection(int taskNo) {
|
||||||
try {
|
try {
|
||||||
if (taskNo <= 0) return "0";
|
if (taskNo <= 0) {
|
||||||
MydoJob job = mydoJobService.selectMydoJobByTaskNo((long) taskNo);
|
|
||||||
if (job == null || job.getInOrOut() == null) return "0";
|
|
||||||
int val;
|
|
||||||
try {
|
|
||||||
val = Integer.parseInt(job.getInOrOut());
|
|
||||||
} catch (NumberFormatException e) {
|
|
||||||
return "0";
|
return "0";
|
||||||
}
|
}
|
||||||
return val >= 20 ? "2" : "1";
|
return taskNo <= 50000 ? "1" : "2";
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
return "0";
|
return "0";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ public class GetDeviceTsjMap {
|
|||||||
String code = entry.getKey();
|
String code = entry.getKey();
|
||||||
DeviceTsj d = entry.getValue();
|
DeviceTsj d = entry.getValue();
|
||||||
TsjDto dto = new TsjDto();
|
TsjDto dto = new TsjDto();
|
||||||
dto.setId(String.valueOf(d.getId()));
|
dto.setId("TW001");
|
||||||
dto.setLayer(d.getDqcs() == null ? "" : String.valueOf(d.getDqcs()));
|
dto.setLayer(d.getDqcs() == null ? "" : String.valueOf(d.getDqcs()));
|
||||||
dto.setTaskNo(d.getRwh() == null ? "" : String.valueOf(d.getRwh()));
|
dto.setTaskNo(d.getRwh() == null ? "" : String.valueOf(d.getRwh()));
|
||||||
dto.setZxjd(d.getJdbz() == null ? "" : String.valueOf(d.getJdbz()));
|
dto.setZxjd(d.getJdbz() == null ? "" : String.valueOf(d.getJdbz()));
|
||||||
|
|||||||
@@ -96,6 +96,7 @@ public class Wcs2wmsgetEmptyCargoSpace {
|
|||||||
dto.setTrayCode(getText(node, "trayCode"));
|
dto.setTrayCode(getText(node, "trayCode"));
|
||||||
dto.setProductCode(getText(node, "productCode"));
|
dto.setProductCode(getText(node, "productCode"));
|
||||||
dto.setProductName(getText(node, "productName"));
|
dto.setProductName(getText(node, "productName"));
|
||||||
|
dto.setCargoSpaceId(getText(node, "cargoSpaceId"));
|
||||||
return dto;
|
return dto;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -125,5 +126,6 @@ public class Wcs2wmsgetEmptyCargoSpace {
|
|||||||
private String trayCode;
|
private String trayCode;
|
||||||
private String productCode;
|
private String productCode;
|
||||||
private String productName;
|
private String productName;
|
||||||
|
private String cargoSpaceId;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,9 +6,9 @@ spring:
|
|||||||
druid:
|
druid:
|
||||||
#主数据信息
|
#主数据信息
|
||||||
master:
|
master:
|
||||||
url: jdbc:sqlserver://127.0.0.1:1433;databaseName=FT546-WCS;
|
url: jdbc:sqlserver://127.0.0.1:1433;databaseName=FT546-wcs;
|
||||||
username: sa
|
username: sa
|
||||||
password: 123456
|
password: Flrd0914.
|
||||||
# 从库数据源
|
# 从库数据源
|
||||||
slave:
|
slave:
|
||||||
# 从数据源开关/默认关闭
|
# 从数据源开关/默认关闭
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ server:
|
|||||||
# 日志配置
|
# 日志配置
|
||||||
logging:
|
logging:
|
||||||
level:
|
level:
|
||||||
com.ruoyi: debug
|
com.ruoyi: info
|
||||||
org.springframework: warn
|
org.springframework: warn
|
||||||
|
|
||||||
# 用户配置
|
# 用户配置
|
||||||
@@ -64,7 +64,7 @@ spring:
|
|||||||
devtools:
|
devtools:
|
||||||
restart:
|
restart:
|
||||||
# 热部署开关
|
# 热部署开关
|
||||||
enabled: true
|
enabled: false
|
||||||
# redis 配置
|
# redis 配置
|
||||||
redis:
|
redis:
|
||||||
# 地址
|
# 地址
|
||||||
|
|||||||
@@ -161,4 +161,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
#{guid}
|
#{guid}
|
||||||
</foreach>
|
</foreach>
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
|
<select id="selectNotInsite" resultMap="WcsSrgvMapResult">
|
||||||
|
SELECT
|
||||||
|
|
||||||
|
*
|
||||||
|
FROM
|
||||||
|
wcs_srgv_map
|
||||||
|
WHERE
|
||||||
|
remark = #{cache}
|
||||||
|
AND plc_layer = #{floor}
|
||||||
|
|
||||||
|
<if test="sites != null and sites.size() > 0">
|
||||||
|
AND site_id NOT IN
|
||||||
|
<foreach collection="sites" item="site" separator="," open="(" close=")">
|
||||||
|
#{site}
|
||||||
|
</foreach>
|
||||||
|
|
||||||
|
</if>
|
||||||
|
<if test="sites == null or sites.size() == 0">
|
||||||
|
AND 1=1
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -62,6 +62,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
where task_code = #{taskCode}
|
where task_code = #{taskCode}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectAgvQueueByStatus" resultMap="AgvQueueResult">
|
||||||
|
select top(1)* from agv_queue
|
||||||
|
where status=0
|
||||||
|
</select>
|
||||||
|
|
||||||
<insert id="insertAgvQueue" parameterType="AgvQueue">
|
<insert id="insertAgvQueue" parameterType="AgvQueue">
|
||||||
insert into agv_queue
|
insert into agv_queue
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
@@ -144,4 +149,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
#{reqCode}
|
#{reqCode}
|
||||||
</foreach>
|
</foreach>
|
||||||
</delete>
|
</delete>
|
||||||
|
<select id="selectKx" parameterType="java.util.Map" statementType="CALLABLE">
|
||||||
|
{call proc_select_kx(#{v_position,mode=IN,jdbcType=VARCHAR},
|
||||||
|
#{v_orderId,mode=IN,jdbcType=VARCHAR},
|
||||||
|
#{v_type,mode=IN,jdbcType=VARCHAR},
|
||||||
|
#{v_result,mode=OUT,jdbcType=INTEGER},
|
||||||
|
#{v_result_msg,mode=OUT,jdbcType=VARCHAR})}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -123,4 +123,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
#{id}
|
#{id}
|
||||||
</foreach>
|
</foreach>
|
||||||
</delete>
|
</delete>
|
||||||
|
<update id="updateDeviceCdzSpare" parameterType="DeviceCdz">
|
||||||
|
update device_cdz set spare1=null where id=#{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -182,7 +182,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<trim prefix="SET" suffixOverrides=",">
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
<if test="setFloor != null">set_floor = #{setFloor},</if>
|
<if test="setFloor != null">set_floor = #{setFloor},</if>
|
||||||
<if test="powerTime != null">power_time = #{powerTime},</if>
|
<if test="powerTime != null">power_time = #{powerTime},</if>
|
||||||
<if test="lastTime != null">last_time = #{lastTime},</if>
|
|
||||||
<if test="agvStatus != null">agv_status = #{agvStatus},</if>
|
<if test="agvStatus != null">agv_status = #{agvStatus},</if>
|
||||||
<if test="taskNo != null">task_no = #{taskNo},</if>
|
<if test="taskNo != null">task_no = #{taskNo},</if>
|
||||||
<if test="srcSite != null">src_site = #{srcSite},</if>
|
<if test="srcSite != null">src_site = #{srcSite},</if>
|
||||||
@@ -227,6 +227,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
<update id="updateLastTimeByAgvId" parameterType="String">
|
<update id="updateLastTimeByAgvId" parameterType="String">
|
||||||
update device_srgv set last_time =getdate() where agv_id=#{agvId}
|
update device_srgv set last_time =convert(varchar,getdate(),120) where guid=#{agvId}
|
||||||
</update>
|
</update>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -25,13 +25,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<result property="theFloor" column="the_floor" />
|
<result property="theFloor" column="the_floor" />
|
||||||
<result property="productId" column="product_id" />
|
<result property="productId" column="product_id" />
|
||||||
<result property="productName" column="product_name" />
|
<result property="productName" column="product_name" />
|
||||||
|
<result property="trayCode" column="tray_code" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectMydoJobVo">
|
<sql id="selectMydoJobVo">
|
||||||
select job_id, status, task_no, roadway_id, cargo_space_id, target_roadway_id, target_cargo_space_id, priority, execution_phase, in_or_out, create_time, start_time, finish_time, entrance_id, exit_id, warehouse_id, fault_flag,the_floor,product_id,product_name 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,the_floor,product_id,product_name,tray_code from mydo_job_wcs
|
||||||
</sql>
|
</sql>
|
||||||
<sql id="selectMydoJobFinishVo">
|
<sql id="selectMydoJobFinishVo">
|
||||||
select job_id, status, task_no, roadway_id, cargo_space_id, target_roadway_id, target_cargo_space_id, priority, execution_phase, in_or_out, create_time, start_time, finish_time, entrance_id, exit_id, warehouse_id, fault_flag,the_floor from mydo_job_wcs_finish
|
select job_id, status, task_no, roadway_id, cargo_space_id, target_roadway_id, target_cargo_space_id, priority, execution_phase, in_or_out, create_time, start_time, finish_time, entrance_id, exit_id, warehouse_id, fault_flag,the_floor,product_id,product_name,tray_code from mydo_job_wcs_finish
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectMydoJobList" parameterType="MydoJob" resultMap="MydoJobResult">
|
<select id="selectMydoJobList" parameterType="MydoJob" resultMap="MydoJobResult">
|
||||||
@@ -46,8 +47,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<if test="priority != null "> and priority = #{priority}</if>
|
<if test="priority != null "> and priority = #{priority}</if>
|
||||||
<if test="executionPhase != null and executionPhase != ''"> and execution_phase = #{executionPhase}</if>
|
<if test="executionPhase != null and executionPhase != ''"> and execution_phase = #{executionPhase}</if>
|
||||||
<if test="inOrOut != null and inOrOut != ''"> and in_or_out = #{inOrOut}</if>
|
<if test="inOrOut != null and inOrOut != ''"> and in_or_out = #{inOrOut}</if>
|
||||||
<if test="startTime != null and startTime != ''"> and start_time = #{startTime}</if>
|
<if test="startTime != null and startTime != ''"> and finish_time >= #{startTime}</if>
|
||||||
<if test="finishTime != null and finishTime != ''"> and finish_time = #{finishTime}</if>
|
<if test="finishTime != null and finishTime != ''"> and finish_time <= #{finishTime}</if>
|
||||||
<if test="entranceId != null and entranceId != ''"> and entrance_id = #{entranceId}</if>
|
<if test="entranceId != null and entranceId != ''"> and entrance_id = #{entranceId}</if>
|
||||||
<if test="exitId != null and exitId != ''"> and exit_id = #{exitId}</if>
|
<if test="exitId != null and exitId != ''"> and exit_id = #{exitId}</if>
|
||||||
<if test="warehouseId != null and warehouseId != ''"> and warehouse_id = #{warehouseId}</if>
|
<if test="warehouseId != null and warehouseId != ''"> and warehouse_id = #{warehouseId}</if>
|
||||||
@@ -55,6 +56,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<if test="theFloor != null and theFloor != ''"> and the_floor = #{theFloor}</if>
|
<if test="theFloor != null and theFloor != ''"> and the_floor = #{theFloor}</if>
|
||||||
<if test="productId != null and productId != ''"> and product_id = #{productId}</if>
|
<if test="productId != null and productId != ''"> and product_id = #{productId}</if>
|
||||||
<if test="productName != null and productName != ''"> and product_name = #{productName}</if>
|
<if test="productName != null and productName != ''"> and product_name = #{productName}</if>
|
||||||
|
<if test="trayCode != null and trayCode != ''"> and tray_code = #{trayCode}</if>
|
||||||
|
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
@@ -118,6 +120,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<if test="warehouseId != null">warehouse_id,</if>
|
<if test="warehouseId != null">warehouse_id,</if>
|
||||||
<if test="faultFlag != null">fault_flag,</if>
|
<if test="faultFlag != null">fault_flag,</if>
|
||||||
<if test="theFloor != null">the_floor,</if>
|
<if test="theFloor != null">the_floor,</if>
|
||||||
|
<if test="trayCode != null">tray_code,</if>
|
||||||
</trim>
|
</trim>
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
<if test="jobId != null">#{jobId},</if>
|
<if test="jobId != null">#{jobId},</if>
|
||||||
@@ -138,6 +141,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<if test="warehouseId != null">#{warehouseId},</if>
|
<if test="warehouseId != null">#{warehouseId},</if>
|
||||||
<if test="faultFlag != null">#{faultFlag},</if>
|
<if test="faultFlag != null">#{faultFlag},</if>
|
||||||
<if test="theFloor != null">#{theFloor},</if>
|
<if test="theFloor != null">#{theFloor},</if>
|
||||||
|
<if test="trayCode != null">#{trayCode},</if>
|
||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
<insert id="insertHistory">
|
<insert id="insertHistory">
|
||||||
@@ -225,8 +229,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<if test="priority != null "> and priority = #{priority}</if>
|
<if test="priority != null "> and priority = #{priority}</if>
|
||||||
<if test="executionPhase != null and executionPhase != ''"> and execution_phase = #{executionPhase}</if>
|
<if test="executionPhase != null and executionPhase != ''"> and execution_phase = #{executionPhase}</if>
|
||||||
<if test="inOrOut != null and inOrOut != ''"> and in_or_out = #{inOrOut}</if>
|
<if test="inOrOut != null and inOrOut != ''"> and in_or_out = #{inOrOut}</if>
|
||||||
<if test="startTime != null and startTime != ''"> and start_time = #{startTime}</if>
|
<if test="startTime != null and startTime != ''"> and finish_time >= #{startTime}</if>
|
||||||
<if test="finishTime != null and finishTime != ''"> and finish_time = #{finishTime}</if>
|
<if test="finishTime != null and finishTime != ''"> and finish_time <= #{finishTime}</if>
|
||||||
<if test="entranceId != null and entranceId != ''"> and entrance_id = #{entranceId}</if>
|
<if test="entranceId != null and entranceId != ''"> and entrance_id = #{entranceId}</if>
|
||||||
<if test="exitId != null and exitId != ''"> and exit_id = #{exitId}</if>
|
<if test="exitId != null and exitId != ''"> and exit_id = #{exitId}</if>
|
||||||
<if test="warehouseId != null and warehouseId != ''"> and warehouse_id = #{warehouseId}</if>
|
<if test="warehouseId != null and warehouseId != ''"> and warehouse_id = #{warehouseId}</if>
|
||||||
@@ -244,4 +248,86 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
and status = 3
|
and status = 3
|
||||||
order by priority desc,create_time
|
order by priority desc,create_time
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectMydoJobOut" resultMap="MydoJobResult">
|
||||||
|
WITH floor_group AS (
|
||||||
|
SELECT
|
||||||
|
b.cargo_space_id,
|
||||||
|
b.group_coding_no,
|
||||||
|
b.the_floor,
|
||||||
|
b.group_coding,
|
||||||
|
a.task_no,
|
||||||
|
a.job_id,
|
||||||
|
a.in_or_out,
|
||||||
|
a.target_cargo_space_id,
|
||||||
|
ROW_NUMBER() OVER (
|
||||||
|
PARTITION BY b.the_floor, b.group_coding_no
|
||||||
|
ORDER BY b.group_coding desc
|
||||||
|
) AS rn
|
||||||
|
FROM mydo_job_wcs a
|
||||||
|
INNER JOIN bas_cargo_space b
|
||||||
|
ON a.cargo_space_id = b.cargo_space_id
|
||||||
|
AND a.the_floor = b.the_floor
|
||||||
|
WHERE a.in_or_out >= 20
|
||||||
|
)
|
||||||
|
SELECT
|
||||||
|
cargo_space_id,
|
||||||
|
group_coding_no,
|
||||||
|
the_floor,
|
||||||
|
group_coding,
|
||||||
|
task_no,
|
||||||
|
job_id,
|
||||||
|
in_or_out,
|
||||||
|
target_cargo_space_id
|
||||||
|
FROM floor_group
|
||||||
|
WHERE rn = 1 -- ✅ 每次每层每个通道只取 1 条
|
||||||
|
ORDER BY group_coding DESC;
|
||||||
|
</select>
|
||||||
|
<select id="selectMydoJobByTrayCode" resultMap="MydoJobResult">
|
||||||
|
<include refid="selectMydoJobVo"/>
|
||||||
|
where tray_code =#{trayCode}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectExit" parameterType="string" resultType="java.lang.Integer">
|
||||||
|
select count(1) from mydo_job_wcs where in_or_out>=20 and exit_id = #{exitId}
|
||||||
|
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectMydoJobCount" resultType="java.lang.Integer">
|
||||||
|
select count(1) from mydo_job_wcs
|
||||||
|
|
||||||
|
</select>
|
||||||
|
<select id="selectMydoJobIn" resultType="java.lang.Integer">
|
||||||
|
select count(1) from mydo_job_wcs where in_or_out <20 and cargo_space_id is null and status='3' and execution_phase='1'
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectMydoJobCountOut" resultType="java.lang.Integer">
|
||||||
|
select count(1) from mydo_job_wcs where in_or_out>20
|
||||||
|
</select>
|
||||||
|
<select id="selectByJobOut" parameterType="java.lang.Integer" resultType="java.lang.Integer">
|
||||||
|
select count(1)
|
||||||
|
from mydo_job_wcs
|
||||||
|
where in_or_out > 20
|
||||||
|
and status = '1'
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectByJobOutIsOne" parameterType="java.lang.Integer" resultType="java.lang.Integer">
|
||||||
|
select count(1) from mydo_job_wcs where in_or_out>20 and status='1' and the_floor=1
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectMydoJobExit" parameterType="string" resultType="integer">
|
||||||
|
select count(1) from mydo_job_wcs where in_or_out>20 and exit_id=#{exit}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectTheFloorYk" parameterType="string" resultType="java.lang.Integer">
|
||||||
|
select count(1) from mydo_job_wcs where the_floor=#{theFloor} and in_or_out=30
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<delete id="deleteMydoJobByTaskNos">
|
||||||
|
delete from mydo_job_wcs where task_no in
|
||||||
|
<foreach item="taskNo" collection="taskNos" open="(" separator="," close=")">
|
||||||
|
#{taskNo}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -121,6 +121,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
|
|
||||||
|
<select id="selectCount" resultType="java.lang.Integer">
|
||||||
|
select count(1)
|
||||||
|
from tsj_device_execution_queue
|
||||||
|
|
||||||
|
</select>
|
||||||
|
|
||||||
<update id="updateTsjDeviceExecutionQueue" parameterType="TsjDeviceExecutionQueue">
|
<update id="updateTsjDeviceExecutionQueue" parameterType="TsjDeviceExecutionQueue">
|
||||||
update tsj_device_execution_queue
|
update tsj_device_execution_queue
|
||||||
<trim prefix="SET" suffixOverrides=",">
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
|
|
||||||
<select id="selectWcsSrgvQueueByFloor" parameterType="String" resultMap="WcsSrgvQueueResult">
|
<select id="selectWcsSrgvQueueByFloor" parameterType="String" resultMap="WcsSrgvQueueResult">
|
||||||
<include refid="selectWcsSrgvQueueVo"/>
|
<include refid="selectWcsSrgvQueueVo"/>
|
||||||
where default07 =#{theFloor}
|
where default07 =#{theFloor} and default07 !='1'
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<insert id="insertWcsSrgvQueue" parameterType="WcsSrgvQueue">
|
<insert id="insertWcsSrgvQueue" parameterType="WcsSrgvQueue">
|
||||||
@@ -192,4 +192,45 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
</foreach>
|
</foreach>
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
|
<select id="selectMinCountJob" parameterType="list" resultType="string">
|
||||||
|
<choose>
|
||||||
|
<when test="list == null or list.size() == 0">
|
||||||
|
SELECT '' AS result_site
|
||||||
|
</when>
|
||||||
|
<otherwise>
|
||||||
|
select top(1) site_id from
|
||||||
|
(select '050101' as site_id,isnull(count(1),0) as num from wcs_srgv_queue where cargo_place_site ='050101'
|
||||||
|
union
|
||||||
|
select '070101' as site_id,isnull(count(1),0) as num from wcs_srgv_queue where cargo_place_site ='070101')r
|
||||||
|
where r.site_id in
|
||||||
|
<foreach collection="list" item="site" open="(" separator="," close=")">
|
||||||
|
#{site}
|
||||||
|
</foreach>
|
||||||
|
order by num
|
||||||
|
|
||||||
|
</otherwise>
|
||||||
|
</choose>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
<select id="selectTsj" resultType="java.lang.Integer" >
|
||||||
|
select count(1) from wcs_srgv_queue where end_site='tsj'
|
||||||
|
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectByCaogoPlaceSite" resultType="java.lang.Integer" parameterType="string">
|
||||||
|
select count(1) from wcs_srgv_queue where cargo_place_site=#{siteId}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectByEndSite" resultType="java.lang.Integer" >
|
||||||
|
select count(1) from wcs_srgv_queue where end_site='070101' or end_site ='050101'
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
<select id="selectTaskNosByGuids" parameterType="String" resultType="string">
|
||||||
|
select task_no from wcs_srgv_queue where guid in
|
||||||
|
<foreach item="guid" collection="array" open="(" separator="," close=")">
|
||||||
|
#{guid}
|
||||||
|
</foreach>
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -0,0 +1,116 @@
|
|||||||
|
<?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.system.mapper.AgvContainerTaskMapper">
|
||||||
|
|
||||||
|
<resultMap type="AgvContainerTask" id="AgvContainerTaskResult">
|
||||||
|
<result property="id" column="id" />
|
||||||
|
<result property="container" column="container" />
|
||||||
|
<result property="startPoint" column="start_point" />
|
||||||
|
<result property="endPoint" column="end_point" />
|
||||||
|
<result property="createTime" column="create_time" />
|
||||||
|
<result property="startTime" column="start_time" />
|
||||||
|
<result property="finishTime" column="finish_time" />
|
||||||
|
<result property="taskNo" column="task_no" />
|
||||||
|
<result property="status" column="status" />
|
||||||
|
<result property="spare1" column="spare1" />
|
||||||
|
<result property="spare2" column="spare2" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectAgvContainerTaskVo">
|
||||||
|
select id, container, start_point, end_point, create_time, start_time, finish_time, task_no, status, spare1, spare2 from agv_container_task
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectAgvContainerTaskList" parameterType="AgvContainerTask" resultMap="AgvContainerTaskResult">
|
||||||
|
<include refid="selectAgvContainerTaskVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="container != null and container != ''"> and container = #{container}</if>
|
||||||
|
<if test="startPoint != null and startPoint != ''"> and start_point = #{startPoint}</if>
|
||||||
|
<if test="endPoint != null and endPoint != ''"> and end_point = #{endPoint}</if>
|
||||||
|
<if test="startTime != null and startTime != ''"> and start_time = #{startTime}</if>
|
||||||
|
<if test="finishTime != null and finishTime != ''"> and finish_time = #{finishTime}</if>
|
||||||
|
<if test="taskNo != null and taskNo != ''"> and task_no = #{taskNo}</if>
|
||||||
|
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||||
|
<if test="spare1 != null and spare1 != ''"> and spare1 = #{spare1}</if>
|
||||||
|
<if test="spare2 != null and spare2 != ''"> and spare2 = #{spare2}</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectAgvContainerTaskById" parameterType="Long" resultMap="AgvContainerTaskResult">
|
||||||
|
<include refid="selectAgvContainerTaskVo"/>
|
||||||
|
where id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertAgvContainerTask" parameterType="AgvContainerTask" useGeneratedKeys="true" keyProperty="id">
|
||||||
|
insert into agv_container_task
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="container != null">container,</if>
|
||||||
|
<if test="startPoint != null">start_point,</if>
|
||||||
|
<if test="endPoint != null">end_point,</if>
|
||||||
|
<if test="createTime != null">create_time,</if>
|
||||||
|
<if test="startTime != null">start_time,</if>
|
||||||
|
<if test="finishTime != null">finish_time,</if>
|
||||||
|
<if test="taskNo != null">task_no,</if>
|
||||||
|
<if test="status != null">status,</if>
|
||||||
|
<if test="spare1 != null">spare1,</if>
|
||||||
|
<if test="spare2 != null">spare2,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="container != null">#{container},</if>
|
||||||
|
<if test="startPoint != null">#{startPoint},</if>
|
||||||
|
<if test="endPoint != null">#{endPoint},</if>
|
||||||
|
<if test="createTime != null">#{createTime},</if>
|
||||||
|
<if test="startTime != null">#{startTime},</if>
|
||||||
|
<if test="finishTime != null">#{finishTime},</if>
|
||||||
|
<if test="taskNo != null">#{taskNo},</if>
|
||||||
|
<if test="status != null">#{status},</if>
|
||||||
|
<if test="spare1 != null">#{spare1},</if>
|
||||||
|
<if test="spare2 != null">#{spare2},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateAgvContainerTask" parameterType="AgvContainerTask">
|
||||||
|
update agv_container_task
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="container != null">container = #{container},</if>
|
||||||
|
<if test="startPoint != null">start_point = #{startPoint},</if>
|
||||||
|
<if test="endPoint != null">end_point = #{endPoint},</if>
|
||||||
|
<if test="createTime != null">create_time = #{createTime},</if>
|
||||||
|
<if test="startTime != null">start_time = #{startTime},</if>
|
||||||
|
<if test="finishTime != null">finish_time = #{finishTime},</if>
|
||||||
|
<if test="taskNo != null">task_no = #{taskNo},</if>
|
||||||
|
<if test="status != null">status = #{status},</if>
|
||||||
|
<if test="spare1 != null">spare1 = #{spare1},</if>
|
||||||
|
<if test="spare2 != null">spare2 = #{spare2},</if>
|
||||||
|
</trim>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteAgvContainerTaskById" parameterType="Long">
|
||||||
|
delete from agv_container_task where id = #{id}
|
||||||
|
</delete>
|
||||||
|
<delete id="deleteAgvContainerTaskByContainer" parameterType="string">
|
||||||
|
delete from agv_container_task where container = #{container}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteAgvContainerTaskByIds" parameterType="String">
|
||||||
|
delete from agv_container_task where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<select id="insertAgvContainerTaskFinish" parameterType="string">
|
||||||
|
insert into agv_container_task_finish select * from agv_container_task where container=#{orderId}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<update id="updateAgvContainerTaskByOrder" parameterType="string">
|
||||||
|
update agv_container_task set status='2' where container=#{orderId}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<select id="selectAgvContainerFinishOne" resultMap="AgvContainerTaskResult">
|
||||||
|
select top 1 * from agv_container_task where status='2'
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -26,9 +26,7 @@ public class AjaxResult extends HashMap<String, Object>
|
|||||||
/**
|
/**
|
||||||
* 初始化一个新创建的 AjaxResult 对象,使其表示一个空消息。
|
* 初始化一个新创建的 AjaxResult 对象,使其表示一个空消息。
|
||||||
*/
|
*/
|
||||||
public AjaxResult()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 初始化一个新创建的 AjaxResult 对象
|
* 初始化一个新创建的 AjaxResult 对象
|
||||||
|
|||||||
@@ -116,9 +116,10 @@ public class SecurityConfig
|
|||||||
.antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll()
|
.antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll()
|
||||||
.antMatchers("/swagger-ui.html", "/changeLanguage", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**", "/pda/**").permitAll()
|
.antMatchers("/swagger-ui.html", "/changeLanguage", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**", "/pda/**").permitAll()
|
||||||
.antMatchers("/device/operation/**").permitAll()
|
.antMatchers("/device/operation/**").permitAll()
|
||||||
.antMatchers("/agv/api/**").permitAll()
|
.antMatchers("/api/agv/**").permitAll()
|
||||||
.antMatchers("/device/api/**").permitAll()
|
.antMatchers("/device/api/**").permitAll()
|
||||||
.antMatchers("/wcs2Wms/api/**").permitAll()
|
.antMatchers("/wcs2Wms/api/**").permitAll()
|
||||||
|
.antMatchers("/agv/api/**").permitAll()
|
||||||
.antMatchers("/test/**").permitAll()
|
.antMatchers("/test/**").permitAll()
|
||||||
.antMatchers("/largeScreen/monitor/**").permitAll()
|
.antMatchers("/largeScreen/monitor/**").permitAll()
|
||||||
// 除上面外的所有请求全部需要鉴权认证
|
// 除上面外的所有请求全部需要鉴权认证
|
||||||
|
|||||||
9
ruoyi-ui/src/api/algorithm/tidy.js
Normal file
9
ruoyi-ui/src/api/algorithm/tidy.js
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
export function getTidyStatus() {
|
||||||
|
return request({ url: '/algorithm/tidy/status', method: 'get' })
|
||||||
|
}
|
||||||
|
|
||||||
|
export function updateTidyMode(mode) {
|
||||||
|
return request({ url: '/algorithm/tidy/mode', method: 'put', data: { mode } })
|
||||||
|
}
|
||||||
33
ruoyi-ui/src/views/algorithm/tidy/index.vue
Normal file
33
ruoyi-ui/src/views/algorithm/tidy/index.vue
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container tidy-page">
|
||||||
|
<el-card>
|
||||||
|
<div slot="header"><span>理货控制</span></div>
|
||||||
|
<el-switch v-model="manual" active-text="手动理货" inactive-text="自动理货" :disabled="loading || !hasEdit" @change="changeMode" />
|
||||||
|
<span class="mode-status">当前模式:{{ modeLabel }}</span>
|
||||||
|
</el-card>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { getTidyStatus, updateTidyMode } from '@/api/algorithm/tidy'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'TidyControl',
|
||||||
|
data() { return { manual: false, mode: 'AUTO', loading: false, timer: null, hasEdit: this.$auth.hasPermi('algorithm:tidy:edit') } },
|
||||||
|
computed: { modeLabel() { return this.mode === 'MANUAL' ? '手动' : '自动' } },
|
||||||
|
created() { this.refresh(); this.timer = setInterval(this.refresh, 5000) },
|
||||||
|
beforeDestroy() { if (this.timer) { clearInterval(this.timer); this.timer = null } },
|
||||||
|
methods: {
|
||||||
|
refresh() { getTidyStatus().then(res => { const data = res.data || {}; this.mode = data.mode || 'AUTO'; this.manual = this.mode === 'MANUAL' }).catch(() => {}) },
|
||||||
|
changeMode(value) {
|
||||||
|
const previous = this.mode
|
||||||
|
this.loading = true
|
||||||
|
updateTidyMode(value ? 'MANUAL' : 'AUTO').then(res => { const data = res.data || {}; this.mode = data.mode || (value ? 'MANUAL' : 'AUTO') }).catch(() => { this.manual = previous === 'MANUAL'; this.$message.error('理货模式切换失败') }).finally(() => { this.loading = false })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.mode-status { margin-left: 16px; color: #606266; }
|
||||||
|
</style>
|
||||||
@@ -157,7 +157,6 @@ export default {
|
|||||||
{ key: 'kx', label: '空闲', value: d.kx, dict: 'ssj_kx' },
|
{ key: 'kx', label: '空闲', value: d.kx, dict: 'ssj_kx' },
|
||||||
{ key: 'dw', label: '到位', value: d.dw, dict: 'ssj_dw' },
|
{ key: 'dw', label: '到位', value: d.dw, dict: 'ssj_dw' },
|
||||||
{ key: 'exception', label: '异常', value: d.exception, dict: 'ssj_ex'},
|
{ key: 'exception', label: '异常', value: d.exception, dict: 'ssj_ex'},
|
||||||
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
if (dev.kind === 'srgv') {
|
if (dev.kind === 'srgv') {
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ const CompressionPlugin = require('compression-webpack-plugin')
|
|||||||
|
|
||||||
const name = process.env.VUE_APP_TITLE || 'FORTUCKY WCS SYSTEM' // 网页标题
|
const name = process.env.VUE_APP_TITLE || 'FORTUCKY WCS SYSTEM' // 网页标题
|
||||||
|
|
||||||
const baseUrl = 'http://localhost:8081' // 后端接口地址(你的后端端口是8081)
|
const baseUrl = 'http://192.168.188.236:8081' // 后端接口地址(你的后端端口是8081)
|
||||||
|
|
||||||
const port = process.env.port || process.env.npm_config_port || 80 // 前端端口
|
const port = process.env.port || process.env.npm_config_port || 80 // 前端端口
|
||||||
|
|
||||||
@@ -18,6 +18,7 @@ module.exports = {
|
|||||||
outputDir: 'dist',
|
outputDir: 'dist',
|
||||||
assetsDir: 'static',
|
assetsDir: 'static',
|
||||||
productionSourceMap: false,
|
productionSourceMap: false,
|
||||||
|
parallel: false,
|
||||||
transpileDependencies: ['quill'],
|
transpileDependencies: ['quill'],
|
||||||
devServer: {
|
devServer: {
|
||||||
host: '0.0.0.0',
|
host: '0.0.0.0',
|
||||||
|
|||||||
Reference in New Issue
Block a user