1.添加监测综合信息库模块结构
This commit is contained in:
parent
82b9230fd6
commit
9080e2f29e
27
jeecg-module-monitor-info-database/pom.xml
Normal file
27
jeecg-module-monitor-info-database/pom.xml
Normal file
|
|
@ -0,0 +1,27 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<groupId>org.jeecgframework.boot</groupId>
|
||||||
|
<artifactId>jeecg-boot-parent</artifactId>
|
||||||
|
<version>3.8.1</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>jeecg-module-monitor-info-database</artifactId>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<maven.compiler.source>17</maven.compiler.source>
|
||||||
|
<maven.compiler.target>17</maven.compiler.target>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.jeecgframework.boot</groupId>
|
||||||
|
<artifactId>jeecg-boot-base-core</artifactId>
|
||||||
|
<version>${jeecgboot.version}</version>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
</project>
|
||||||
|
|
@ -497,10 +497,14 @@ public class TransportResultDataServiceImpl implements TransportResultDataServic
|
||||||
if(CollUtil.isEmpty(transportTaskChildren)){
|
if(CollUtil.isEmpty(transportTaskChildren)){
|
||||||
throw new RuntimeException("此任务站点信息不存在,请确认任务配置信息");
|
throw new RuntimeException("此任务站点信息不存在,请确认任务配置信息");
|
||||||
}
|
}
|
||||||
|
//获取所有台站数据,优先缓存
|
||||||
|
Map<String, Integer> stationsMap = stationDataService.getAllStations().stream().collect(Collectors.toMap(GardsStations::getStationCode,GardsStations::getStationId));
|
||||||
//本任务模拟的台站数据
|
//本任务模拟的台站数据
|
||||||
List<TaskStationsVO> taskStationsVOList = new ArrayList<>();
|
List<TaskStationsVO> taskStationsVOList = new ArrayList<>();
|
||||||
for (int i = 0; i<transportTaskChildren.size();i++) {
|
for (int i = 0; i<transportTaskChildren.size();i++) {
|
||||||
|
Integer stationId = stationsMap.get(transportTaskChildren.get(i).getStationCode());
|
||||||
TaskStationsVO taskStationsVO = new TaskStationsVO();
|
TaskStationsVO taskStationsVO = new TaskStationsVO();
|
||||||
|
taskStationsVO.setStationId(stationId);
|
||||||
taskStationsVO.setStationNum(i+1);
|
taskStationsVO.setStationNum(i+1);
|
||||||
taskStationsVO.setStationCode(transportTaskChildren.get(i).getStationCode());
|
taskStationsVO.setStationCode(transportTaskChildren.get(i).getStationCode());
|
||||||
taskStationsVOList.add(taskStationsVO);
|
taskStationsVOList.add(taskStationsVO);
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,8 @@ import org.jeecg.modules.base.entity.*;
|
||||||
import org.jeecg.modules.base.mapper.WeatherDataMapper;
|
import org.jeecg.modules.base.mapper.WeatherDataMapper;
|
||||||
import org.jeecg.service.TransportTaskService;
|
import org.jeecg.service.TransportTaskService;
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.math.RoundingMode;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.ZoneId;
|
import java.time.ZoneId;
|
||||||
import java.time.temporal.ChronoUnit;
|
import java.time.temporal.ChronoUnit;
|
||||||
|
|
@ -77,8 +79,10 @@ public class TransportTaskExec extends Thread{
|
||||||
//添加任务耗时
|
//添加任务耗时
|
||||||
stopWatch.stop();
|
stopWatch.stop();
|
||||||
long seconds = stopWatch.getTime(TimeUnit.SECONDS);
|
long seconds = stopWatch.getTime(TimeUnit.SECONDS);
|
||||||
Double min = seconds/60D;
|
double min = seconds/60D;
|
||||||
this.transportTaskService.updateTaskStatusToCompleted(this.transportTask.getId(),min);
|
BigDecimal bgMin = new BigDecimal(min);
|
||||||
|
BigDecimal result = bgMin.setScale(2, RoundingMode.HALF_UP);
|
||||||
|
this.transportTaskService.updateTaskStatusToCompleted(this.transportTask.getId(),result.doubleValue());
|
||||||
String taskCompletedLog = "任务执行完成,耗时:"+min+"分钟";
|
String taskCompletedLog = "任务执行完成,耗时:"+min+"分钟";
|
||||||
ProgressQueue.getInstance().offer(new ProgressEvent(this.transportTask.getId(),taskCompletedLog));
|
ProgressQueue.getInstance().offer(new ProgressEvent(this.transportTask.getId(),taskCompletedLog));
|
||||||
}
|
}
|
||||||
|
|
@ -130,9 +134,11 @@ public class TransportTaskExec extends Thread{
|
||||||
paramContent.append(DateUtil.format(this.transportTask.getEndTime(),"yyyyMMdd")).append("\n");
|
paramContent.append(DateUtil.format(this.transportTask.getEndTime(),"yyyyMMdd")).append("\n");
|
||||||
paramContent.append(DateUtil.format(this.transportTask.getStartTime(),"HHmmss")).append("\n");
|
paramContent.append(DateUtil.format(this.transportTask.getStartTime(),"HHmmss")).append("\n");
|
||||||
paramContent.append(DateUtil.format(this.transportTask.getEndTime(),"HHmmss")).append("\n");
|
paramContent.append(DateUtil.format(this.transportTask.getEndTime(),"HHmmss")).append("\n");
|
||||||
|
paramContent.append(this.transportTask.getParticleCount()).append("\n");
|
||||||
paramContent.append(this.transportTask.getZ1()).append("\n");
|
paramContent.append(this.transportTask.getZ1()).append("\n");
|
||||||
paramContent.append(this.transportTask.getZ2()).append("\n");
|
paramContent.append(this.transportTask.getZ2()).append("\n");
|
||||||
paramContent.append(metDataPath).append("\n");
|
paramContent.append(metDataPath).append("\n");
|
||||||
|
paramContent.append(this.simulationProperties.getOutputPath()+File.separator+this.transportTask.getTaskName()).append("\n");
|
||||||
FileUtil.writeString(paramContent.toString(),paramConfigPath,"UTF-8");
|
FileUtil.writeString(paramContent.toString(),paramConfigPath,"UTF-8");
|
||||||
//处理台站数据文件
|
//处理台站数据文件
|
||||||
List<String> stationConfigInfo = new ArrayList<>();
|
List<String> stationConfigInfo = new ArrayList<>();
|
||||||
|
|
|
||||||
46
jeecg-server-cloud/jeecg-monitor-info-database-start/pom.xml
Normal file
46
jeecg-server-cloud/jeecg-monitor-info-database-start/pom.xml
Normal file
|
|
@ -0,0 +1,46 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<groupId>org.jeecgframework.boot</groupId>
|
||||||
|
<artifactId>jeecg-boot-parent</artifactId>
|
||||||
|
<version>3.8.1</version>
|
||||||
|
<relativePath>../../pom.xml</relativePath>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>jeecg-monitor-info-database-start</artifactId>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<maven.compiler.source>17</maven.compiler.source>
|
||||||
|
<maven.compiler.target>17</maven.compiler.target>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.jeecgframework.boot</groupId>
|
||||||
|
<artifactId>jeecg-boot-starter3-cloud</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.jeecgframework.boot</groupId>
|
||||||
|
<artifactId>jeecg-system-cloud-api</artifactId>
|
||||||
|
<version>${jeecgboot.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.jeecgframework.boot</groupId>
|
||||||
|
<artifactId>jeecg-module-monitor-info-database</artifactId>
|
||||||
|
<version>${jeecgboot.version}</version>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
<build>
|
||||||
|
<finalName>stas-cloud-monitor-info-database</finalName>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
</project>
|
||||||
|
|
@ -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<String, Object> 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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -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
|
||||||
|
|
@ -0,0 +1,44 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<configuration debug="false">
|
||||||
|
<!--定义日志文件的存储地址 -->
|
||||||
|
<property name="LOG_HOME" value="logs" />
|
||||||
|
|
||||||
|
<!--<property name="COLOR_PATTERN" value="%black(%contextName-) %red(%d{yyyy-MM-dd HH:mm:ss}) %green([%thread]) %highlight(%-5level) %boldMagenta( %replace(%caller{1}){'\t|Caller.{1}0|\r\n', ''})- %gray(%msg%xEx%n)" />-->
|
||||||
|
<!-- 控制台输出 -->
|
||||||
|
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
|
||||||
|
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
|
||||||
|
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符
|
||||||
|
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50}:%L - %msg%n</pattern>-->
|
||||||
|
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %highlight(%-5level) %cyan(%logger{50}:%L) - %msg%n</pattern>
|
||||||
|
</encoder>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<!-- 按照每天生成日志文件 -->
|
||||||
|
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||||
|
<!--日志文件输出的文件名 -->
|
||||||
|
<FileNamePattern>${LOG_HOME}/stas-monitor-info-database-%d{yyyy-MM-dd}.%i.log</FileNamePattern>
|
||||||
|
<!--日志文件保留天数 -->
|
||||||
|
<MaxHistory>30</MaxHistory>
|
||||||
|
<maxFileSize>10MB</maxFileSize>
|
||||||
|
</rollingPolicy>
|
||||||
|
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
|
||||||
|
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符 -->
|
||||||
|
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50}:%L - %msg%n</pattern>
|
||||||
|
</encoder>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
|
||||||
|
<!--myibatis log configure -->
|
||||||
|
<logger name="com.apache.ibatis" level="TRACE" />
|
||||||
|
<logger name="java.sql.Connection" level="DEBUG" />
|
||||||
|
<logger name="java.sql.Statement" level="DEBUG" />
|
||||||
|
<logger name="java.sql.PreparedStatement" level="DEBUG" />
|
||||||
|
|
||||||
|
<!-- 日志输出级别 -->
|
||||||
|
<root level="INFO">
|
||||||
|
<appender-ref ref="STDOUT" />
|
||||||
|
<appender-ref ref="FILE" />
|
||||||
|
</root>
|
||||||
|
|
||||||
|
</configuration>
|
||||||
|
|
@ -26,6 +26,7 @@
|
||||||
<module>jeecg-data-analyze-start</module>
|
<module>jeecg-data-analyze-start</module>
|
||||||
<module>jeecg-source-rebuild-start</module>
|
<module>jeecg-source-rebuild-start</module>
|
||||||
<module>jeecg-transport-start</module>
|
<module>jeecg-transport-start</module>
|
||||||
|
<module>jeecg-monitor-info-database-start</module>
|
||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
3
pom.xml
3
pom.xml
|
|
@ -90,7 +90,8 @@
|
||||||
<module>jeecg-module-data-analyze</module>
|
<module>jeecg-module-data-analyze</module>
|
||||||
<module>jeecg-module-source-rebuild</module>
|
<module>jeecg-module-source-rebuild</module>
|
||||||
<module>jeecg-module-transport</module>
|
<module>jeecg-module-transport</module>
|
||||||
</modules>
|
<module>jeecg-module-monitor-info-database</module>
|
||||||
|
</modules>
|
||||||
|
|
||||||
<repositories>
|
<repositories>
|
||||||
<repository>
|
<repository>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user