feat: 任务对象定义
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
package org.nl.extInterface.wms.data;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 基础VO对象
|
||||
* @Author: liyongde
|
||||
* @Date: 2026/7/29 16:32
|
||||
*/
|
||||
@Data
|
||||
public class AcsBaseReqVO implements Serializable {
|
||||
/**
|
||||
* 请求号: traceId
|
||||
*/
|
||||
private String traceId;
|
||||
|
||||
/**
|
||||
*
|
||||
* 时间
|
||||
*/
|
||||
private Long timestamp;
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package org.nl.extInterface.wms.data.req;
|
||||
|
||||
import lombok.Data;
|
||||
import org.nl.extInterface.wms.data.AcsBaseReqVO;
|
||||
|
||||
/**
|
||||
* 检测任务是否可以删除
|
||||
* @Author: liyongde
|
||||
* @Date: 2026/7/30 9:45
|
||||
*/
|
||||
@Data
|
||||
public class OperateCheckReqVO extends AcsBaseReqVO {
|
||||
/**
|
||||
* 任务标识
|
||||
*/
|
||||
private Long taskId;
|
||||
|
||||
/**
|
||||
* 任务编码
|
||||
*/
|
||||
private String taskCode;
|
||||
|
||||
/**
|
||||
* 操作类型
|
||||
*/
|
||||
private String operationType;
|
||||
|
||||
/**
|
||||
* 生产区域
|
||||
*/
|
||||
private String productArea;
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
package org.nl.extInterface.wms.data.req;
|
||||
|
||||
import lombok.Data;
|
||||
import org.nl.extInterface.wms.data.AcsBaseReqVO;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 下发给ACS的实体
|
||||
* @Author: liyongde
|
||||
* @Date: 2026/7/29 16:33
|
||||
*/
|
||||
@Data
|
||||
public class TaskIssueReqVO extends AcsBaseReqVO {
|
||||
/**
|
||||
* 任务标识
|
||||
*/
|
||||
private Long taskId;
|
||||
/**
|
||||
* 任务编码
|
||||
*/
|
||||
private String taskCode;
|
||||
/**
|
||||
* 取货点1
|
||||
*/
|
||||
private String startDeviceCode;
|
||||
/**
|
||||
* 放货点1
|
||||
*/
|
||||
private String nextDeviceCode;
|
||||
/**
|
||||
* 取货点2
|
||||
*/
|
||||
private String startDeviceCode2;
|
||||
/**
|
||||
* 放货点2
|
||||
*/
|
||||
private String nextDeviceCode2;
|
||||
/**
|
||||
* 优先级
|
||||
*/
|
||||
private String priority;
|
||||
/**
|
||||
* 载具号
|
||||
*/
|
||||
private String vehicleCode;
|
||||
/**
|
||||
* 载具号2
|
||||
*/
|
||||
private String vehicleCode2;
|
||||
/**
|
||||
* 任务类型
|
||||
*/
|
||||
private String taskType;
|
||||
/**
|
||||
* Agv系统类型
|
||||
*/
|
||||
private String agvSystemType;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* 扩展参数
|
||||
*/
|
||||
private Map<String, Object> payload;
|
||||
/**
|
||||
* 生产区域
|
||||
*/
|
||||
private String productArea;
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package org.nl.extInterface.wms.data.resp;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
*
|
||||
* @Author: liyongde
|
||||
* @Date: 2026/7/30 9:53
|
||||
*/
|
||||
@Data
|
||||
public class OperateCheckRespVO {
|
||||
/**
|
||||
* 是否允许操作
|
||||
*/
|
||||
private Boolean enableOperate;
|
||||
|
||||
/**
|
||||
* 不允许操作的原因
|
||||
*/
|
||||
private String message;
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package org.nl.extInterface.wms.data.resp;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* ACS 任务下发响应
|
||||
* @Author: liyongde
|
||||
* @Date: 2026/7/29 16:29
|
||||
*/
|
||||
@Data
|
||||
public class TaskIssueResultRespVO {
|
||||
/**
|
||||
* 下发失败的任务
|
||||
*/
|
||||
private List<FailedTask> failedTasks;
|
||||
|
||||
/**
|
||||
* ACS 失败任务明细
|
||||
*/
|
||||
@Data
|
||||
public static class FailedTask {
|
||||
|
||||
/**
|
||||
* 任务标识
|
||||
*/
|
||||
private Long taskId;
|
||||
|
||||
/**
|
||||
* 错误信息
|
||||
*/
|
||||
private String errorMessage;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -2,11 +2,24 @@
|
||||
package org.nl.extInterface.wms.rest;
|
||||
|
||||
|
||||
import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.base.ResponseData;
|
||||
import org.nl.extInterface.log.InterfaceLog;
|
||||
import org.nl.extInterface.wms.data.req.OperateCheckReqVO;
|
||||
import org.nl.extInterface.wms.data.req.TaskIssueReqVO;
|
||||
import org.nl.extInterface.wms.data.resp.OperateCheckRespVO;
|
||||
import org.nl.extInterface.wms.data.resp.TaskIssueResultRespVO;
|
||||
import org.nl.extInterface.wms.service.WmsToAcsService;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* @author ludj
|
||||
@@ -14,8 +27,22 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
**/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/api/wmsToAcs")
|
||||
@RequestMapping("/acs-api/wms-to-acs")
|
||||
@Slf4j
|
||||
public class WmsToAcsController {
|
||||
private final WmsToAcsService wmsToAcsService;
|
||||
|
||||
@PostMapping("/issue-task")
|
||||
@SaIgnore
|
||||
@InterfaceLog(direction = "WMS->ACS", description = "ACS接收WMS任务")
|
||||
public ResponseEntity<TaskIssueResultRespVO> issueTask(@RequestBody List<TaskIssueReqVO> tasks) {
|
||||
return ResponseData.build(wmsToAcsService.issueTask(tasks));
|
||||
}
|
||||
|
||||
@PostMapping("/check-enable-operate")
|
||||
@SaIgnore
|
||||
@InterfaceLog(direction = "WMS->ACS", description = "检测任务是否可以操作")
|
||||
public ResponseEntity<OperateCheckRespVO> checkEnableOperate(@RequestBody OperateCheckReqVO task) {
|
||||
return ResponseData.build(wmsToAcsService.checkEnableOperate(task));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,19 @@
|
||||
package org.nl.extInterface.wms.service;
|
||||
|
||||
|
||||
import org.nl.extInterface.wms.data.req.OperateCheckReqVO;
|
||||
import org.nl.extInterface.wms.data.req.TaskIssueReqVO;
|
||||
import org.nl.extInterface.wms.data.resp.OperateCheckRespVO;
|
||||
import org.nl.extInterface.wms.data.resp.TaskIssueResultRespVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface WmsToAcsService {
|
||||
|
||||
/**
|
||||
* WMS 下发任务
|
||||
*/
|
||||
TaskIssueResultRespVO issueTask(List<TaskIssueReqVO> tasks);
|
||||
|
||||
OperateCheckRespVO checkEnableOperate(OperateCheckReqVO task);
|
||||
}
|
||||
|
||||
@@ -2,14 +2,32 @@ package org.nl.extInterface.wms.service.impl;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.extInterface.wms.data.req.OperateCheckReqVO;
|
||||
import org.nl.extInterface.wms.data.req.TaskIssueReqVO;
|
||||
import org.nl.extInterface.wms.data.resp.OperateCheckRespVO;
|
||||
import org.nl.extInterface.wms.data.resp.TaskIssueResultRespVO;
|
||||
import org.nl.extInterface.wms.service.WmsToAcsService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class WmsToAcsServiceImpl implements WmsToAcsService {
|
||||
|
||||
@Override
|
||||
public TaskIssueResultRespVO issueTask(List<TaskIssueReqVO> tasks) {
|
||||
// todo
|
||||
TaskIssueResultRespVO response = new TaskIssueResultRespVO();
|
||||
return response;
|
||||
}
|
||||
|
||||
@Override
|
||||
public OperateCheckRespVO checkEnableOperate(OperateCheckReqVO task) {
|
||||
// todo 检测任务能否取消或者完成,取消和完成判断逻辑一样,不需要管他,先判断指令是否存在,存在则显示不允许操作,
|
||||
// 原因是任务执行中,如果没有指令只有任务,也是不允许操作,原因是ACS存在任务
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,9 +8,9 @@ spring:
|
||||
druid:
|
||||
db-type: com.alibaba.druid.pool.DruidDataSource
|
||||
driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
|
||||
url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:stand_acs_kit}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true
|
||||
url: jdbc:log4jdbc:mysql://${DB_HOST:192.168.81.251}:${DB_PORT:3306}/${DB_NAME:huachuang_acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true
|
||||
username: ${DB_USER:root}
|
||||
password: ${DB_PWD:password}
|
||||
password: ${DB_PWD:P@ssw0rd.}
|
||||
# password: ${DB_PWD:p@ssw0rd}
|
||||
# 初始连接数
|
||||
initial-size: 20
|
||||
|
||||
@@ -12,7 +12,7 @@ https://juejin.cn/post/6844903775631572999
|
||||
<contextName>nlAdmin</contextName>
|
||||
<property name="log.charset" value="utf-8"/>
|
||||
<property name="log.pattern"
|
||||
value="%black(%contextName-) %red(%d{yyyy-MM-dd HH:mm:ss.SSS}) %green([%thread]) %highlight(%-5level) %boldMagenta(%logger{36}) - %gray(%msg%n)"/>
|
||||
value="%black(%contextName-) %red(%d{yyyy-MM-dd HH:mm:ss.SSS}) %green([%thread]) %highlight(%-5level) %boldMagenta(%logger{36}) - %cyan(%msg%n)"/>
|
||||
<springProperty scope="context" name="logPath" source="logging.file.path" defaultValue="logs"/>
|
||||
<property name="SYSTEM_NAME" value="${systemName}"/>
|
||||
<!--定义日志文件的存储地址 勿在 LogBack 的配置中使用相对路径-->
|
||||
|
||||
@@ -36,12 +36,14 @@
|
||||
"@logicflow/core": "1.2.1",
|
||||
"@logicflow/extension": "1.2.1",
|
||||
"@riophae/vue-treeselect": "0.4.0",
|
||||
"@vxe-ui/core": "^4.4.18",
|
||||
"af-table-column": "^1.0.3",
|
||||
"ansi_up": "^5.1.0",
|
||||
"axios": "0.18.1",
|
||||
"clipboard": "^2.0.4",
|
||||
"codemirror": "^5.49.2",
|
||||
"connect": "3.6.6",
|
||||
"dom-zindex": "^1.0.7",
|
||||
"echarts": "^4.2.1",
|
||||
"echarts-gl": "^1.1.1",
|
||||
"echarts-wordcloud": "^1.1.3",
|
||||
@@ -134,5 +136,8 @@
|
||||
"browserslist": [
|
||||
"> 1%",
|
||||
"last 2 versions"
|
||||
]
|
||||
],
|
||||
"volta": {
|
||||
"node": "14.21.3"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user