From 9080e2f29efde3f000cb2219d798ff1b311dff99 Mon Sep 17 00:00:00 2001 From: panbaolin <13071138970@163.com> Date: Mon, 1 Dec 2025 17:00:07 +0800 Subject: [PATCH] =?UTF-8?q?1.=E6=B7=BB=E5=8A=A0=E7=9B=91=E6=B5=8B=E7=BB=BC?= =?UTF-8?q?=E5=90=88=E4=BF=A1=E6=81=AF=E5=BA=93=E6=A8=A1=E5=9D=97=E7=BB=93?= =?UTF-8?q?=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jeecg-module-monitor-info-database/pom.xml | 27 +++++++++ .../impl/TransportResultDataServiceImpl.java | 4 ++ .../org/jeecg/task/TransportTaskExec.java | 10 +++- .../jeecg-monitor-info-database-start/pom.xml | 46 +++++++++++++++ ...cgMonitorInfoDatabaseCloudApplication.java | 56 +++++++++++++++++++ .../src/main/resources/application.yml | 24 ++++++++ .../src/main/resources/logback-spring.xml | 44 +++++++++++++++ jeecg-server-cloud/pom.xml | 1 + pom.xml | 3 +- 9 files changed, 212 insertions(+), 3 deletions(-) create mode 100644 jeecg-module-monitor-info-database/pom.xml create mode 100644 jeecg-server-cloud/jeecg-monitor-info-database-start/pom.xml create mode 100644 jeecg-server-cloud/jeecg-monitor-info-database-start/src/main/java/org/jeecg/JeecgMonitorInfoDatabaseCloudApplication.java create mode 100644 jeecg-server-cloud/jeecg-monitor-info-database-start/src/main/resources/application.yml create mode 100644 jeecg-server-cloud/jeecg-monitor-info-database-start/src/main/resources/logback-spring.xml diff --git a/jeecg-module-monitor-info-database/pom.xml b/jeecg-module-monitor-info-database/pom.xml new file mode 100644 index 0000000..b52058d --- /dev/null +++ b/jeecg-module-monitor-info-database/pom.xml @@ -0,0 +1,27 @@ + + + 4.0.0 + + org.jeecgframework.boot + jeecg-boot-parent + 3.8.1 + + + jeecg-module-monitor-info-database + + + 17 + 17 + UTF-8 + + + + + org.jeecgframework.boot + jeecg-boot-base-core + ${jeecgboot.version} + + + \ No newline at end of file diff --git a/jeecg-module-transport/src/main/java/org/jeecg/service/impl/TransportResultDataServiceImpl.java b/jeecg-module-transport/src/main/java/org/jeecg/service/impl/TransportResultDataServiceImpl.java index 51979ef..5a57cdd 100644 --- a/jeecg-module-transport/src/main/java/org/jeecg/service/impl/TransportResultDataServiceImpl.java +++ b/jeecg-module-transport/src/main/java/org/jeecg/service/impl/TransportResultDataServiceImpl.java @@ -497,10 +497,14 @@ public class TransportResultDataServiceImpl implements TransportResultDataServic if(CollUtil.isEmpty(transportTaskChildren)){ throw new RuntimeException("此任务站点信息不存在,请确认任务配置信息"); } + //获取所有台站数据,优先缓存 + Map stationsMap = stationDataService.getAllStations().stream().collect(Collectors.toMap(GardsStations::getStationCode,GardsStations::getStationId)); //本任务模拟的台站数据 List taskStationsVOList = new ArrayList<>(); for (int i = 0; i stationConfigInfo = new ArrayList<>(); diff --git a/jeecg-server-cloud/jeecg-monitor-info-database-start/pom.xml b/jeecg-server-cloud/jeecg-monitor-info-database-start/pom.xml new file mode 100644 index 0000000..ec4e61a --- /dev/null +++ b/jeecg-server-cloud/jeecg-monitor-info-database-start/pom.xml @@ -0,0 +1,46 @@ + + + 4.0.0 + + org.jeecgframework.boot + jeecg-boot-parent + 3.8.1 + ../../pom.xml + + + jeecg-monitor-info-database-start + + + 17 + 17 + UTF-8 + + + + + org.jeecgframework.boot + jeecg-boot-starter3-cloud + + + org.jeecgframework.boot + jeecg-system-cloud-api + ${jeecgboot.version} + + + org.jeecgframework.boot + jeecg-module-monitor-info-database + ${jeecgboot.version} + + + + stas-cloud-monitor-info-database + + + org.springframework.boot + spring-boot-maven-plugin + + + + \ No newline at end of file diff --git a/jeecg-server-cloud/jeecg-monitor-info-database-start/src/main/java/org/jeecg/JeecgMonitorInfoDatabaseCloudApplication.java b/jeecg-server-cloud/jeecg-monitor-info-database-start/src/main/java/org/jeecg/JeecgMonitorInfoDatabaseCloudApplication.java new file mode 100644 index 0000000..0185764 --- /dev/null +++ b/jeecg-server-cloud/jeecg-monitor-info-database-start/src/main/java/org/jeecg/JeecgMonitorInfoDatabaseCloudApplication.java @@ -0,0 +1,56 @@ +package org.jeecg; + +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.jeecg.common.base.BaseMap; +import org.jeecg.common.constant.GlobalConstants; +import org.jeecg.common.util.oConvertUtils; +import org.springframework.boot.CommandLineRunner; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.builder.SpringApplicationBuilder; +import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; +import org.springframework.cloud.openfeign.EnableFeignClients; +import org.springframework.context.ConfigurableApplicationContext; +import org.springframework.core.env.Environment; +import org.springframework.data.redis.core.RedisTemplate; + +import java.net.InetAddress; +import java.net.UnknownHostException; + +@Slf4j +@SpringBootApplication +@RequiredArgsConstructor +@EnableFeignClients +public class JeecgMonitorInfoDatabaseCloudApplication extends SpringBootServletInitializer implements CommandLineRunner { + + private final RedisTemplate redisTemplate; + + @Override + protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { + return application.sources(JeecgMonitorInfoDatabaseCloudApplication.class); + } + + public static void main(String[] args) throws UnknownHostException { + ConfigurableApplicationContext application = SpringApplication.run(JeecgMonitorInfoDatabaseCloudApplication.class, args); + Environment env = application.getEnvironment(); + String ip = InetAddress.getLocalHost().getHostAddress(); + String port = env.getProperty("server.port"); + String path = oConvertUtils.getString(env.getProperty("server.servlet.context-path")); + log.info("\n----------------------------------------------------------\n\t" + + "Application STAS-monitor-info-database is running! Access URLs:\n\t" + + "Local: \t\thttp://localhost:" + port + path + "/doc.html\n" + + "External: \thttp://" + ip + ":" + port + path + "/doc.html\n" + + "Swagger文档: \thttp://" + ip + ":" + port + path + "/doc.html\n" + + "----------------------------------------------------------"); + + } + + @Override + public void run(String... args) { + BaseMap params = new BaseMap(); + params.put(GlobalConstants.HANDLER_NAME, GlobalConstants.LODER_ROUDER_HANDLER); + //刷新网关 + redisTemplate.convertAndSend(GlobalConstants.REDIS_TOPIC_NAME, params); + } +} \ No newline at end of file diff --git a/jeecg-server-cloud/jeecg-monitor-info-database-start/src/main/resources/application.yml b/jeecg-server-cloud/jeecg-monitor-info-database-start/src/main/resources/application.yml new file mode 100644 index 0000000..117677e --- /dev/null +++ b/jeecg-server-cloud/jeecg-monitor-info-database-start/src/main/resources/application.yml @@ -0,0 +1,24 @@ +server: + port: 8007 + +spring: + application: + name: jeecg-monitor-info-database + cloud: + nacos: + config: + server-addr: @config.server-addr@ + group: @config.group@ + namespace: @config.namespace@ + username: @config.username@ + password: @config.password@ + discovery: + server-addr: ${spring.cloud.nacos.config.server-addr} + group: @config.group@ + namespace: @config.namespace@ + username: @config.username@ + password: @config.password@ + config: + import: + - optional:nacos:jeecg.yaml + - optional:nacos:jeecg-@profile.name@.yaml \ No newline at end of file diff --git a/jeecg-server-cloud/jeecg-monitor-info-database-start/src/main/resources/logback-spring.xml b/jeecg-server-cloud/jeecg-monitor-info-database-start/src/main/resources/logback-spring.xml new file mode 100644 index 0000000..da788cc --- /dev/null +++ b/jeecg-server-cloud/jeecg-monitor-info-database-start/src/main/resources/logback-spring.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %highlight(%-5level) %cyan(%logger{50}:%L) - %msg%n + + + + + + + + ${LOG_HOME}/stas-monitor-info-database-%d{yyyy-MM-dd}.%i.log + + 30 + 10MB + + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50}:%L - %msg%n + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/jeecg-server-cloud/pom.xml b/jeecg-server-cloud/pom.xml index 06673c7..b0e9bf6 100644 --- a/jeecg-server-cloud/pom.xml +++ b/jeecg-server-cloud/pom.xml @@ -26,6 +26,7 @@ jeecg-data-analyze-start jeecg-source-rebuild-start jeecg-transport-start + jeecg-monitor-info-database-start \ No newline at end of file diff --git a/pom.xml b/pom.xml index 6758b80..22c74cb 100644 --- a/pom.xml +++ b/pom.xml @@ -90,7 +90,8 @@ jeecg-module-data-analyze jeecg-module-source-rebuild jeecg-module-transport - + jeecg-module-monitor-info-database +