Merge remote-tracking branch 'refs/remotes/origin/feature/20260727/lms-rawfoil' into huachuang_ls
# Conflicts: # nl-framework/nl-spring-boot-starter-execute/src/main/java/cn/code/nl/framework/execute/biz/api/lms/LmsTaskCommonApi.java # nl-framework/nl-spring-boot-starter-execute/src/main/java/cn/code/nl/framework/execute/biz/api/wms/WmsTaskCommonApi.java # nl-gateway/src/main/resources/application-dev.yaml # nl-module-base/nl-module-base-server/src/main/resources/application-dev.yaml # nl-module-infra/nl-module-infra-server/src/main/resources/application-dev.yaml # nl-module-lms/nl-module-lms-server/src/main/java/cn/code/nl/module/lms/demo/DemoApi.java # nl-module-system/nl-module-system-server/src/main/resources/application-dev.yaml
This commit is contained in:
@@ -31,6 +31,11 @@
|
||||
<artifactId>nl-module-infra-server</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.nl.cloud</groupId>
|
||||
<artifactId>nl-module-base-server</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.nl.cloud</groupId>
|
||||
<artifactId>nl-module-lms-server</artifactId>
|
||||
@@ -41,6 +46,16 @@
|
||||
<artifactId>nl-module-task-server</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.nl.cloud</groupId>
|
||||
<artifactId>nl-module-wms-server</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.nl.cloud</groupId>
|
||||
<artifactId>nl-module-base-server</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 会员中心。默认注释,保证编译速度 -->
|
||||
<!-- <dependency>-->
|
||||
@@ -184,6 +199,12 @@
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
||||
@@ -52,9 +52,9 @@ spring:
|
||||
password: root123
|
||||
slave: # 模拟从库,可根据自己需要修改 # 模拟从库,可根据自己需要修改
|
||||
lazy: true # 开启懒加载,保证启动速度
|
||||
url: jdbc:mysql://192.168.81.193:3306/huachuang_lms_dev?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true # MySQL Connector/J 8.X 连接的示例
|
||||
url: jdbc:mysql://192.168.10.41:3306/huachuang_lms_dev?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true # MySQL Connector/J 8.X 连接的示例
|
||||
username: root
|
||||
password: root123
|
||||
password: root
|
||||
|
||||
# Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优
|
||||
data:
|
||||
@@ -78,9 +78,6 @@ xxl:
|
||||
|
||||
--- #################### 消息队列相关 ####################
|
||||
|
||||
# rocketmq 配置项,对应 RocketMQProperties 配置类
|
||||
rocketmq:
|
||||
name-server: 127.0.0.1:9876 # RocketMQ Namesrv
|
||||
|
||||
spring:
|
||||
# RabbitMQ 配置项,对应 RabbitProperties 配置类
|
||||
|
||||
16
nl-server/src/main/resources/application-mq-dev.yaml
Normal file
16
nl-server/src/main/resources/application-mq-dev.yaml
Normal file
@@ -0,0 +1,16 @@
|
||||
--- #################### MQ 消息队列相关配置 ####################
|
||||
# rocketmq 配置项,对应 RocketMQProperties 配置类
|
||||
rocketmq:
|
||||
name-server: 192.168.81.193:9876
|
||||
producer:
|
||||
group: nl_producer_dev_group
|
||||
send-message-timeout: 3000
|
||||
consumer:
|
||||
wms-task-operate:
|
||||
group: wms_task_status_change_dev_group
|
||||
topic: wms_task_status_change_dev_topic
|
||||
lms-task-operate:
|
||||
group: lms_task_status_change_dev_group
|
||||
topic: lms_task_status_change_dev_topic
|
||||
task:
|
||||
topic: task_status_change_dev_topic
|
||||
16
nl-server/src/main/resources/application-mq-test.yaml
Normal file
16
nl-server/src/main/resources/application-mq-test.yaml
Normal file
@@ -0,0 +1,16 @@
|
||||
--- #################### MQ 消息队列相关配置 ####################
|
||||
# rocketmq 配置项,对应 RocketMQProperties 配置类
|
||||
rocketmq:
|
||||
name-server: 192.168.81.193:9876
|
||||
producer:
|
||||
group: nl_producer_dev_group
|
||||
send-message-timeout: 3000
|
||||
consumer:
|
||||
wms-task-operate:
|
||||
group: wms_task_status_change_dev_group
|
||||
topic: wms_task_status_change_dev_topic
|
||||
lms-task-operate:
|
||||
group: lms_task_status_change_dev_group
|
||||
topic: lms_task_status_change_dev_topic
|
||||
task:
|
||||
topic: task_status_change_dev_topic
|
||||
@@ -59,10 +59,10 @@ spring:
|
||||
# Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优
|
||||
data:
|
||||
redis:
|
||||
host: 192.168.81.193 # 地址
|
||||
host: 127.0.0.1 # 地址
|
||||
port: 6379 # 端口
|
||||
database: 1 # 数据库索引
|
||||
password: redis123
|
||||
# password: redis123
|
||||
|
||||
--- #################### 定时任务相关配置 ####################
|
||||
|
||||
|
||||
@@ -5,6 +5,9 @@ spring:
|
||||
|
||||
profiles:
|
||||
active: dev
|
||||
config:
|
||||
import:
|
||||
- optional:classpath:application-mq-${spring.profiles.active}.yaml # 加载 MQ 配置
|
||||
|
||||
main:
|
||||
allow-circular-references: true # 允许循环依赖,因为项目是三层架构,无法避免这个情况。
|
||||
@@ -85,10 +88,10 @@ mybatis-plus:
|
||||
map-underscore-to-camel-case: true # 虽然默认为 true ,但是还是显示去指定下。
|
||||
global-config:
|
||||
db-config:
|
||||
id-type: NONE # “智能”模式,基于 IdTypeEnvironmentPostProcessor + 数据源的类型,自动适配成 AUTO、INPUT 模式。
|
||||
# id-type: NONE # “智能”模式,基于 IdTypeEnvironmentPostProcessor + 数据源的类型,自动适配成 AUTO、INPUT 模式。
|
||||
# id-type: AUTO # 自增 ID,适合 MySQL 等直接自增的数据库
|
||||
# id-type: INPUT # 用户输入 ID,适合 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库
|
||||
# id-type: ASSIGN_ID # 分配 ID,默认使用雪花算法。注意,Oracle、PostgreSQL、Kingbase、DB2、H2 数据库时,需要去除实体类上的 @KeySequence 注解
|
||||
id-type: ASSIGN_ID # 分配 ID,默认使用雪花算法。注意,Oracle、PostgreSQL、Kingbase、DB2、H2 数据库时,需要去除实体类上的 @KeySequence 注解
|
||||
logic-delete-value: 1 # 逻辑已删除值(默认为 1)
|
||||
logic-not-delete-value: 0 # 逻辑未删除值(默认为 0)
|
||||
banner: false # 关闭控制台的 Banner 打印
|
||||
@@ -144,11 +147,6 @@ aj:
|
||||
|
||||
--- #################### 消息队列相关 ####################
|
||||
|
||||
# rocketmq 配置项,对应 RocketMQProperties 配置类
|
||||
rocketmq:
|
||||
# Producer 配置项
|
||||
producer:
|
||||
group: ${spring.application.name}_PRODUCER # 生产者分组
|
||||
|
||||
spring:
|
||||
# Kafka 配置项,对应 KafkaProperties 配置类
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
package cn.code.nl.server.acs;
|
||||
|
||||
import cn.code.nl.framework.common.pojo.AcsCommonResult;
|
||||
import cn.code.nl.framework.common.pojo.CommonResult;
|
||||
import cn.code.nl.framework.common.util.spring.SpringUtils;
|
||||
import cn.code.nl.framework.execute.util.http.AcsUtil;
|
||||
import cn.code.nl.module.infra.api.config.ConfigApi;
|
||||
import cn.code.nl.module.task.job.dto.AcsTaskDTO;
|
||||
import lombok.Data;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static cn.code.nl.module.task.enums.AcsApiConstants.ACS_TASK_API;
|
||||
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||
|
||||
@SpringJUnitConfig
|
||||
@ContextConfiguration(classes = AcsUtilLocalSpringTest.TestConfiguration.class)
|
||||
class AcsUtilLocalSpringTest {
|
||||
|
||||
private static final String SERVER_ADDRESS = "http://127.0.0.1:8011";
|
||||
|
||||
@Test
|
||||
void shouldPostIssueTaskToLocalAcs() {
|
||||
AcsCommonResult<AcsIssueTaskResp> result = AcsUtil.post(SERVER_ADDRESS, ACS_TASK_API,
|
||||
List.of(buildAcsTask()), AcsIssueTaskResp.class);
|
||||
|
||||
assertNotNull(result);
|
||||
}
|
||||
|
||||
private AcsTaskDTO buildAcsTask() {
|
||||
AcsTaskDTO task = new AcsTaskDTO();
|
||||
task.setTaskId(10001L);
|
||||
task.setTaskCode("LOCAL-ACS-TEST-10001");
|
||||
task.setStartDeviceCode("START-TEST-01");
|
||||
task.setNextDeviceCode("END-TEST-01");
|
||||
task.setPriority("1");
|
||||
task.setVehicleCode("BOX-TEST-01");
|
||||
task.setTaskType("TRANSFER");
|
||||
task.setAgvSystemType("ACS");
|
||||
task.setProductArea("TEST");
|
||||
task.setRemark("local acs issue task test");
|
||||
task.setPayload(Map.of("source", "AcsUtilLocalSpringTest"));
|
||||
return task;
|
||||
}
|
||||
|
||||
@Data
|
||||
static class AcsIssueTaskResp {
|
||||
private List<FailedTask> failedTasks;
|
||||
}
|
||||
|
||||
@Data
|
||||
static class FailedTask {
|
||||
private Long taskId;
|
||||
private String errorMessage;
|
||||
}
|
||||
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
static class TestConfiguration {
|
||||
|
||||
@Bean
|
||||
SpringUtils springUtils() {
|
||||
return new SpringUtils();
|
||||
}
|
||||
|
||||
@Bean
|
||||
ConfigApi configApi() {
|
||||
return key -> CommonResult.success("1");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user