Compare commits
No commits in common. "master" and "v0.1.2" have entirely different histories.
@ -56,6 +56,6 @@ jobs:
|
||||
docker rm -f rt-sim-training-service || echo "rt-sim-training-service not exist"
|
||||
docker pull gitea.joylink.club/joylink/rt-sim-training-service:local-test
|
||||
docker run --name rt-sim-training-service --restart=always --network net --ip 192.168.53.3 -d -e APP_ENV=local-test -p 9000:9000 -p 19000:19000 -v /usr/local/joylink/logs/rtss:/usr/local/joylink/logs/rtss gitea.joylink.club/joylink/rt-sim-training-service:local-test
|
||||
# - name: 清理tag为none的镜像
|
||||
# run: |
|
||||
# docker rmi $(docker images --filter "dangling=true" -q --no-trunc) 2>/dev/null || echo "No dangling images to remove"
|
||||
- name: 清理tag为none的镜像
|
||||
run: |
|
||||
docker rmi $(docker images --filter "dangling=true" -q)
|
@ -2,7 +2,7 @@ name: 版本发布docker构建并上传
|
||||
run-name: ${{ gitea.actor }} is testing out Gitea Actions
|
||||
on:
|
||||
release:
|
||||
types: [ published ]
|
||||
types: [published]
|
||||
|
||||
jobs:
|
||||
Docker-Build-Push:
|
||||
@ -45,9 +45,9 @@ jobs:
|
||||
tags: |
|
||||
gitea.joylink.club/joylink/rt-sim-training-service:${{ github.event.release.tag_name }}
|
||||
gitea.joylink.club/joylink/rt-sim-training-service:latest
|
||||
# - name: 清理tag为none的镜像
|
||||
# run: |
|
||||
# docker rmi $(docker images --filter "dangling=true" -q --no-trunc) 2>/dev/null || echo "No dangling images to remove"
|
||||
- name: 清理tag为none的镜像
|
||||
run: |
|
||||
docker rmi $(docker images --filter "dangling=true" -q)
|
||||
# - name: 发布到本地测试环境
|
||||
# uses: https://gitea.joylink.club/appleboy/ssh-action@v1.0.3
|
||||
# with:
|
||||
|
471
pom.xml
471
pom.xml
@ -1,252 +1,231 @@
|
||||
<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>2.3.5.RELEASE</version>
|
||||
<relativePath/> <!-- lookup parent from repository -->
|
||||
</parent>
|
||||
<groupId>club.joylink</groupId>
|
||||
<artifactId>rtss</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<name>rtss</name>
|
||||
<description>Rail transit simulation system</description>
|
||||
|
||||
<properties>
|
||||
<java.version>11</java.version>
|
||||
<pagehelper.version>4.1.1</pagehelper.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-mail</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-validation</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-websocket</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mybatis.spring.boot</groupId>
|
||||
<artifactId>mybatis-spring-boot-starter</artifactId>
|
||||
<version>2.1.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.pagehelper</groupId>
|
||||
<artifactId>pagehelper-spring-boot-starter</artifactId>
|
||||
<version>1.3.0</version>
|
||||
</dependency>
|
||||
|
||||
<!-- javax.validation -->
|
||||
<dependency>
|
||||
<groupId>javax.validation</groupId>
|
||||
<artifactId>validation-api</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!--spring切面aop依赖 -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-aop</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.netty</groupId>
|
||||
<artifactId>netty-all</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.digitalpetri.modbus</groupId>
|
||||
<artifactId>modbus-codec</artifactId>
|
||||
<version>1.1.1</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 硬件检测依赖 -->
|
||||
<dependency>
|
||||
<groupId>com.github.oshi</groupId>
|
||||
<artifactId>oshi-core-java11</artifactId>
|
||||
<version>5.7.5</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.junit.vintage</groupId>
|
||||
<artifactId>junit-vintage-engine</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.wechatpay-apiv3</groupId>
|
||||
<artifactId>wechatpay-apache-httpclient</artifactId>
|
||||
<version>0.2.1</version>
|
||||
</dependency>
|
||||
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>com.huawei.sis</groupId>-->
|
||||
<!-- <artifactId>huaweicloud-java-sdk-sis</artifactId>-->
|
||||
<!-- <version>1.3.2</version>-->
|
||||
<!-- <scope>system</scope>-->
|
||||
<!-- <systemPath>${project.basedir}/libs/huaweicloud-java-sdk-sis-1.3.2.jar</systemPath>-->
|
||||
<!-- </dependency>-->
|
||||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
<version>31.1-jre</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.minio</groupId>
|
||||
<artifactId>minio</artifactId>
|
||||
<version>8.4.4</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.squareup.okhttp3</groupId>
|
||||
<artifactId>okhttp</artifactId>
|
||||
<version>4.9.0</version>
|
||||
</dependency>
|
||||
<!-- <dependency>
|
||||
<groupId>org.springframework.retry</groupId>
|
||||
<artifactId>spring-retry</artifactId>
|
||||
</dependency>-->
|
||||
<dependency>
|
||||
<groupId>joda-time</groupId>
|
||||
<artifactId>joda-time</artifactId>
|
||||
<version>2.10.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.belerweb</groupId>
|
||||
<artifactId>pinyin4j</artifactId>
|
||||
<version>2.5.0</version>
|
||||
</dependency>
|
||||
<!-- iscs -->
|
||||
<dependency>
|
||||
<groupId>com.google.protobuf</groupId>
|
||||
<artifactId>protobuf-java</artifactId>
|
||||
<version>3.23.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.hubspot.jackson</groupId>
|
||||
<artifactId>jackson-datatype-protobuf</artifactId>
|
||||
<version>0.9.12</version>
|
||||
</dependency>
|
||||
<!-- <dependency>
|
||||
<groupId>com.chenlb.mmseg4j</groupId>
|
||||
<artifactId>mmseg4j-core</artifactId>
|
||||
<version>1.10.0</version>
|
||||
</dependency>-->
|
||||
<!-- <dependency>
|
||||
<groupId>org.ansj</groupId>
|
||||
<artifactId>ansj_seg</artifactId>
|
||||
<version>5.1.6</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.reflections</groupId>
|
||||
<artifactId>reflections</artifactId>
|
||||
<version>0.9.11</version>
|
||||
</dependency>-->
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.12.0</version>
|
||||
</dependency>
|
||||
<!-- <dependency>
|
||||
<groupId>info.debatty</groupId>
|
||||
<artifactId>java-string-similarity</artifactId>
|
||||
<version>2.0.0</version>
|
||||
</dependency>-->
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-text</artifactId>
|
||||
<version>1.10.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>2.3.5.RELEASE</version>
|
||||
<relativePath/> <!-- lookup parent from repository -->
|
||||
</parent>
|
||||
<groupId>club.joylink</groupId>
|
||||
<artifactId>rtss</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<name>rtss</name>
|
||||
<description>Rail transit simulation system</description>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<includeSystemScope>true</includeSystemScope>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<properties>
|
||||
<java.version>11</java.version>
|
||||
<pagehelper.version>4.1.1</pagehelper.version>
|
||||
</properties>
|
||||
<plugin>
|
||||
<groupId>com.github.shalousun</groupId>
|
||||
<artifactId>smart-doc-maven-plugin</artifactId>
|
||||
<version>2.1.9</version>
|
||||
<configuration>
|
||||
<!--指定生成文档的使用的配置文件,配置文件放在自己的项目中-->
|
||||
<configFile>./src/main/resources/smart-doc.json</configFile>
|
||||
<!--smart-doc实现自动分析依赖树加载第三方依赖的源码,如果一些框架依赖库加载不到导致报错,这时请使用excludes排除掉-->
|
||||
<!-- <excludes>-->
|
||||
<!-- <!–格式为:groupId:artifactId;参考如下–>-->
|
||||
<!-- <exclude>com.alibaba:fastjson</exclude>-->
|
||||
<!-- </excludes>-->
|
||||
<!-- <!–自1.0.8版本开始,插件提供includes支持,配置了includes后插件会按照用户配置加载而不是自动加载,因此使用时需要注意–>-->
|
||||
<!-- <!–smart-doc能自动分析依赖树加载所有依赖源码,原则上会影响文档构建效率,因此你可以使用includes来让插件加载你配置的组件–>-->
|
||||
<!-- <includes>-->
|
||||
<!-- <!–格式为:groupId:artifactId;参考如下–>-->
|
||||
<!-- <include>com.alibaba:fastjson</include>-->
|
||||
<!-- </includes>-->
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<!--如果不需要在执行编译时启动smart-doc,则将phase注释掉-->
|
||||
<!-- <phase>compile</phase>-->
|
||||
<goals>
|
||||
<!--smart-doc提供了html、openapi、markdown等goal,可按需配置-->
|
||||
<goal>html</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-mail</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-validation</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-websocket</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mybatis.spring.boot</groupId>
|
||||
<artifactId>mybatis-spring-boot-starter</artifactId>
|
||||
<version>2.1.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.pagehelper</groupId>
|
||||
<artifactId>pagehelper-spring-boot-starter</artifactId>
|
||||
<version>1.3.0</version>
|
||||
</dependency>
|
||||
|
||||
<!-- javax.validation -->
|
||||
<dependency>
|
||||
<groupId>javax.validation</groupId>
|
||||
<artifactId>validation-api</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!--spring切面aop依赖 -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-aop</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.netty</groupId>
|
||||
<artifactId>netty-all</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.digitalpetri.modbus</groupId>
|
||||
<artifactId>modbus-codec</artifactId>
|
||||
<version>1.1.1</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 硬件检测依赖 -->
|
||||
<dependency>
|
||||
<groupId>com.github.oshi</groupId>
|
||||
<artifactId>oshi-core-java11</artifactId>
|
||||
<version>5.7.5</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.junit.vintage</groupId>
|
||||
<artifactId>junit-vintage-engine</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.wechatpay-apiv3</groupId>
|
||||
<artifactId>wechatpay-apache-httpclient</artifactId>
|
||||
<version>0.2.1</version>
|
||||
</dependency>
|
||||
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>com.huawei.sis</groupId>-->
|
||||
<!-- <artifactId>huaweicloud-java-sdk-sis</artifactId>-->
|
||||
<!-- <version>1.3.2</version>-->
|
||||
<!-- <scope>system</scope>-->
|
||||
<!-- <systemPath>${project.basedir}/libs/huaweicloud-java-sdk-sis-1.3.2.jar</systemPath>-->
|
||||
<!-- </dependency>-->
|
||||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
<version>31.1-jre</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.minio</groupId>
|
||||
<artifactId>minio</artifactId>
|
||||
<version>8.4.4</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.squareup.okhttp3</groupId>
|
||||
<artifactId>okhttp</artifactId>
|
||||
<version>4.9.0</version>
|
||||
</dependency>
|
||||
<!-- <dependency>
|
||||
<groupId>org.springframework.retry</groupId>
|
||||
<artifactId>spring-retry</artifactId>
|
||||
</dependency>-->
|
||||
<dependency>
|
||||
<groupId>joda-time</groupId>
|
||||
<artifactId>joda-time</artifactId>
|
||||
<version>2.10.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.belerweb</groupId>
|
||||
<artifactId>pinyin4j</artifactId>
|
||||
<version>2.5.0</version>
|
||||
</dependency>
|
||||
<!-- iscs -->
|
||||
<dependency>
|
||||
<groupId>com.google.protobuf</groupId>
|
||||
<artifactId>protobuf-java</artifactId>
|
||||
<version>3.23.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.hubspot.jackson</groupId>
|
||||
<artifactId>jackson-datatype-protobuf</artifactId>
|
||||
<version>0.9.12</version>
|
||||
</dependency>
|
||||
<!-- <dependency>
|
||||
<groupId>com.chenlb.mmseg4j</groupId>
|
||||
<artifactId>mmseg4j-core</artifactId>
|
||||
<version>1.10.0</version>
|
||||
</dependency>-->
|
||||
<!-- <dependency>
|
||||
<groupId>org.ansj</groupId>
|
||||
<artifactId>ansj_seg</artifactId>
|
||||
<version>5.1.6</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.reflections</groupId>
|
||||
<artifactId>reflections</artifactId>
|
||||
<version>0.9.11</version>
|
||||
</dependency>-->
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.12.0</version>
|
||||
</dependency>
|
||||
<!-- <dependency>
|
||||
<groupId>info.debatty</groupId>
|
||||
<artifactId>java-string-similarity</artifactId>
|
||||
<version>2.0.0</version>
|
||||
</dependency>-->
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-text</artifactId>
|
||||
<version>1.10.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<includeSystemScope>true</includeSystemScope>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>com.github.shalousun</groupId>
|
||||
<artifactId>smart-doc-maven-plugin</artifactId>
|
||||
<version>2.1.9</version>
|
||||
<configuration>
|
||||
<!--指定生成文档的使用的配置文件,配置文件放在自己的项目中-->
|
||||
<configFile>./src/main/resources/smart-doc.json</configFile>
|
||||
<!--smart-doc实现自动分析依赖树加载第三方依赖的源码,如果一些框架依赖库加载不到导致报错,这时请使用excludes排除掉-->
|
||||
<!-- <excludes>-->
|
||||
<!-- <!–格式为:groupId:artifactId;参考如下–>-->
|
||||
<!-- <exclude>com.alibaba:fastjson</exclude>-->
|
||||
<!-- </excludes>-->
|
||||
<!-- <!–自1.0.8版本开始,插件提供includes支持,配置了includes后插件会按照用户配置加载而不是自动加载,因此使用时需要注意–>-->
|
||||
<!-- <!–smart-doc能自动分析依赖树加载所有依赖源码,原则上会影响文档构建效率,因此你可以使用includes来让插件加载你配置的组件–>-->
|
||||
<!-- <includes>-->
|
||||
<!-- <!–格式为:groupId:artifactId;参考如下–>-->
|
||||
<!-- <include>com.alibaba:fastjson</include>-->
|
||||
<!-- </includes>-->
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<!--如果不需要在执行编译时启动smart-doc,则将phase注释掉-->
|
||||
<!-- <phase>compile</phase>-->
|
||||
<goals>
|
||||
<!--smart-doc提供了html、openapi、markdown等goal,可按需配置-->
|
||||
<goal>html</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>aliyun-central</id>
|
||||
<url>https://maven.aliyun.com/repository/central</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>aliyun-snapshots</id>
|
||||
<url>https://maven.aliyun.com/repository/snapshots</url>
|
||||
<releases>
|
||||
<enabled>false</enabled>
|
||||
</releases>
|
||||
<snapshots>
|
||||
<enabled>true</enabled>
|
||||
</snapshots>
|
||||
</repository>
|
||||
</repositories>
|
||||
<pluginRepositories>
|
||||
<pluginRepository>
|
||||
<id>aliyun-central</id>
|
||||
<url>https://maven.aliyun.com/repository/central</url>
|
||||
</pluginRepository>
|
||||
</pluginRepositories>
|
||||
</project>
|
||||
|
@ -27,6 +27,6 @@ public class CgyStatsBO {
|
||||
private AtomicLong visitor;
|
||||
//实训人数
|
||||
private final Set<Long> userSet = new HashSet<>();
|
||||
//实训时长/s
|
||||
//实训时长
|
||||
private AtomicLong duration;
|
||||
}
|
||||
|
@ -124,7 +124,8 @@ public class TrainingV2PublishController {
|
||||
*/
|
||||
@PostMapping("/infos")
|
||||
public List<PublishedTraining2InfoRspVo> findTrainingListInfos(
|
||||
@RequestBody PublishedTrainingListRspVo vo,
|
||||
@RequestBody PublishedTrainingListRspVo vo
|
||||
,
|
||||
@RequestAttribute(name = AuthenticateInterceptor.LOGIN_INFO_KEY) LoginUserInfoVO loginUserInfoVO) {
|
||||
//只查询以上架
|
||||
vo.setState(BusinessConsts.STATUS_USE_INT);
|
||||
|
@ -4,25 +4,15 @@ import club.joylink.rtss.services.ISysUserService;
|
||||
import club.joylink.rtss.vo.AccountVO;
|
||||
import club.joylink.rtss.vo.UserQueryVO;
|
||||
import club.joylink.rtss.vo.client.PageVO;
|
||||
import club.joylink.rtss.vo.client.user.MobileInfoVO;
|
||||
import club.joylink.rtss.vo.client.user.RetrievePwdVO;
|
||||
import club.joylink.rtss.vo.client.user.UpdateEmailVO;
|
||||
import club.joylink.rtss.vo.client.user.UpdateMobileVO;
|
||||
import club.joylink.rtss.vo.client.user.UpdatePasswordVO;
|
||||
import club.joylink.rtss.vo.client.user.*;
|
||||
import club.joylink.rtss.vo.user.AccountCreateVO;
|
||||
import club.joylink.rtss.vo.user.AccountRegisterVO;
|
||||
import club.joylink.rtss.vo.user.UserRegisterCheck;
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
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.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 系统账户接口
|
||||
@ -31,186 +21,165 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
@RequestMapping("/api/userinfo")
|
||||
public class SysAccountController {
|
||||
|
||||
@Autowired
|
||||
private ISysUserService iSysUserService;
|
||||
@Autowired
|
||||
private ISysUserService iSysUserService;
|
||||
|
||||
@PostMapping("/register")
|
||||
public void register(
|
||||
@RequestBody @Validated(value = UserRegisterCheck.class) AccountCreateVO accountCreateVO) {
|
||||
this.iSysUserService.register(accountCreateVO);
|
||||
}
|
||||
@PostMapping("/register")
|
||||
public void register(@RequestBody @Validated(value = UserRegisterCheck.class) AccountCreateVO accountCreateVO) {
|
||||
this.iSysUserService.register(accountCreateVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新注册接口
|
||||
*/
|
||||
@PostMapping("/register2")
|
||||
public void register2(@RequestBody @Validated AccountRegisterVO registerVO) {
|
||||
this.iSysUserService.register2(registerVO);
|
||||
}
|
||||
/**
|
||||
* 新注册接口
|
||||
*/
|
||||
@PostMapping("/register2")
|
||||
public void register2(@RequestBody @Validated AccountRegisterVO registerVO) {
|
||||
this.iSysUserService.register2(registerVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据姓名或电话号查询用户
|
||||
*/
|
||||
@GetMapping(path = "/nameOrMobile")
|
||||
public List<AccountVO> queryUserByNameOrMobile(String query) {
|
||||
List<AccountVO> list = this.iSysUserService.queryUserByNameOrMobile(query);
|
||||
return list;
|
||||
}
|
||||
/**
|
||||
*根据姓名或电话号查询用户
|
||||
*/
|
||||
@GetMapping(path="/nameOrMobile")
|
||||
public List<AccountVO> queryUserByNameOrMobile(String query) {
|
||||
List<AccountVO> list = this.iSysUserService.queryUserByNameOrMobile(query);
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 手机号是否已经注册
|
||||
*/
|
||||
@GetMapping("/isExist/mobile")
|
||||
public boolean isMobileExist(String mobile) {
|
||||
return iSysUserService.isSameMobileExist(mobile);
|
||||
}
|
||||
/**
|
||||
* 手机号是否已经注册
|
||||
*/
|
||||
@GetMapping("/isExist/mobile")
|
||||
public boolean isMobileExist(String mobile) {
|
||||
return iSysUserService.isSameMobileExist(mobile);
|
||||
}
|
||||
|
||||
/**
|
||||
* 邮箱是否已经注册
|
||||
*/
|
||||
@GetMapping("/isExist/email")
|
||||
public boolean isEmailExist(String email) {
|
||||
return iSysUserService.isSameEmailExist(email);
|
||||
}
|
||||
/**
|
||||
* 邮箱是否已经注册
|
||||
*/
|
||||
@GetMapping("/isExist/email")
|
||||
public boolean isEmailExist(String email) {
|
||||
return iSysUserService.isSameEmailExist(email);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据用户id获取用户信息
|
||||
*/
|
||||
@GetMapping(path = "/{id}")
|
||||
public AccountVO getUserBaseInfoById(@PathVariable Long id) {
|
||||
return this.iSysUserService.getUserBaseInfoById(id);
|
||||
}
|
||||
/**
|
||||
*根据用户id获取用户信息
|
||||
*/
|
||||
@GetMapping(path = "/{id}")
|
||||
public AccountVO getUserBaseInfoById(@PathVariable Long id) {
|
||||
return this.iSysUserService.getUserBaseInfoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户信息
|
||||
*/
|
||||
@PutMapping(path = "/{id}")
|
||||
public void modify(@PathVariable Long id, @RequestBody AccountVO userInfo, String vdcode) {
|
||||
this.iSysUserService.modify(id, userInfo, vdcode);
|
||||
}
|
||||
/**
|
||||
*修改用户信息
|
||||
*/
|
||||
@PutMapping(path = "/{id}")
|
||||
public void modify(@PathVariable Long id, @RequestBody AccountVO userInfo, String vdcode) {
|
||||
this.iSysUserService.modify(id, userInfo, vdcode);
|
||||
}
|
||||
|
||||
/**
|
||||
* 微信关注事件
|
||||
*/
|
||||
@GetMapping(path = "/wxsubscribe")
|
||||
public void wxSubscribe(@RequestParam String wxId) {
|
||||
iSysUserService.wxSubscribeEventHandle(wxId);
|
||||
}
|
||||
/**
|
||||
*微信关注事件
|
||||
*/
|
||||
@GetMapping(path = "/wxsubscribe")
|
||||
public void wxSubscribe(@RequestParam String wxId) {
|
||||
iSysUserService.wxSubscribeEventHandle(wxId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量修改用户的openId为unionId
|
||||
*/
|
||||
@PutMapping(path = "/batchchange/unionid")
|
||||
public void batchChangeOpenId2UnionId() {
|
||||
this.iSysUserService.batchChangeOpenId2UnionId();
|
||||
}
|
||||
/**
|
||||
*批量修改用户的openId为unionId
|
||||
*/
|
||||
@PutMapping(path = "/batchchange/unionid")
|
||||
public void batchChangeOpenId2UnionId() {
|
||||
this.iSysUserService.batchChangeOpenId2UnionId();
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新用户真实姓名
|
||||
*/
|
||||
@PutMapping(path = "/{id}/name")
|
||||
public void updateName(@PathVariable Long id, String name) {
|
||||
this.iSysUserService.updateUserName(id, name);
|
||||
}
|
||||
/**
|
||||
*更新用户真实姓名
|
||||
*/
|
||||
@PutMapping(path = "/{id}/name")
|
||||
public void updateName(@PathVariable Long id, String name) {
|
||||
this.iSysUserService.updateUserName(id, name);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新用户昵称
|
||||
*/
|
||||
@PutMapping(path = "/{id}/nickname")
|
||||
public void updateNickname(@PathVariable Long id, String nickname) {
|
||||
this.iSysUserService.updateNickname(id, nickname);
|
||||
}
|
||||
/**
|
||||
*更新用户昵称
|
||||
*/
|
||||
@PutMapping(path = "/{id}/nickname")
|
||||
public void updateNickname(@PathVariable Long id, String nickname) {
|
||||
this.iSysUserService.updateNickname(id, nickname);
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户上传头像
|
||||
*/
|
||||
@PostMapping(path = "/{id}/avatar")
|
||||
public void uploadAvatar(@PathVariable Long id, @RequestBody AccountVO accountVO) {
|
||||
this.iSysUserService.updateAvatar(id, accountVO.getAvatarPath());
|
||||
}
|
||||
/**
|
||||
*用户上传头像
|
||||
*/
|
||||
@PostMapping(path = "/{id}/avatar")
|
||||
public void uploadAvatar(@PathVariable Long id, @RequestBody AccountVO accountVO) {
|
||||
this.iSysUserService.updateAvatar(id, accountVO.getAvatarPath());
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送手机验证码
|
||||
*/
|
||||
@PostMapping(path = "/mobile/code")
|
||||
public String sendMobileValidCode(@RequestBody MobileInfoVO mobileInfoVO) {
|
||||
return this.iSysUserService.sendMobileValidCode(mobileInfoVO);
|
||||
}
|
||||
/**
|
||||
*发送手机验证码
|
||||
*/
|
||||
@PostMapping(path = "/mobile/code")
|
||||
public String sendMobileValidCode(@RequestBody MobileInfoVO mobileInfoVO) {
|
||||
return this.iSysUserService.sendMobileValidCode(mobileInfoVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送邮箱验证码
|
||||
*/
|
||||
@PostMapping(path = "/email/code")
|
||||
public String sendEmailValidCode(String email) {
|
||||
return this.iSysUserService.sendEmailValidCode(email);
|
||||
}
|
||||
/**
|
||||
*发送邮箱验证码
|
||||
*/
|
||||
@PostMapping(path = "/email/code")
|
||||
public String sendEmailValidCode(String email) {
|
||||
return this.iSysUserService.sendEmailValidCode(email);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新用户手机号
|
||||
*/
|
||||
@PutMapping(path = "/{id}/mobile")
|
||||
public void updateMobile(@PathVariable Long id,
|
||||
@RequestBody @Validated UpdateMobileVO updateMobileVO) {
|
||||
this.iSysUserService.updateMobile(id, updateMobileVO);
|
||||
}
|
||||
/**
|
||||
*更新用户手机号
|
||||
*/
|
||||
@PutMapping(path = "/{id}/mobile")
|
||||
public void updateMobile(@PathVariable Long id, @RequestBody @Validated UpdateMobileVO updateMobileVO) {
|
||||
this.iSysUserService.updateMobile(id, updateMobileVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新用户邮箱
|
||||
*/
|
||||
@PutMapping(path = "/{id}/email")
|
||||
public void updateEmail(@PathVariable Long id,
|
||||
@RequestBody @Validated UpdateEmailVO updateEmailVO) {
|
||||
this.iSysUserService.updateEmail(id, updateEmailVO);
|
||||
}
|
||||
/**
|
||||
*更新用户邮箱
|
||||
*/
|
||||
@PutMapping(path = "/{id}/email")
|
||||
public void updateEmail(@PathVariable Long id, @RequestBody @Validated UpdateEmailVO updateEmailVO) {
|
||||
this.iSysUserService.updateEmail(id, updateEmailVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新用户登陆密码
|
||||
*/
|
||||
@PutMapping(path = "/{id}/password")
|
||||
public void updatePassword(@PathVariable Long id,
|
||||
@RequestBody @Validated UpdatePasswordVO updatePasswordVO) {
|
||||
this.iSysUserService.updatePassword(id, updatePasswordVO);
|
||||
}
|
||||
/**
|
||||
*更新用户登陆密码
|
||||
*/
|
||||
@PutMapping(path = "/{id}/password")
|
||||
public void updatePassword(@PathVariable Long id, @RequestBody @Validated UpdatePasswordVO updatePasswordVO) {
|
||||
this.iSysUserService.updatePassword(id, updatePasswordVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 按条件分页查询指定来源的账号
|
||||
*/
|
||||
@GetMapping("/page/criteria/{source}")
|
||||
public PageVO<AccountVO> queryPagedAccountOfTheSource(UserQueryVO queryVO,
|
||||
@PathVariable String source) {
|
||||
queryVO.setSource(source);
|
||||
return this.iSysUserService.queryPagedUser(queryVO);
|
||||
}
|
||||
/**
|
||||
* 按条件分页查询指定来源的账号
|
||||
*/
|
||||
@GetMapping("/page/criteria/{source}")
|
||||
public PageVO<AccountVO> queryPagedAccountOfTheSource(UserQueryVO queryVO, @PathVariable String source) {
|
||||
queryVO.setSource(source);
|
||||
return this.iSysUserService.queryPagedUser(queryVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 超管重置用户密码
|
||||
*/
|
||||
@PutMapping("/{id}/reset/pwd")
|
||||
public void resetPwd(@PathVariable long id) {
|
||||
iSysUserService.resetPwd(id);
|
||||
}
|
||||
/**
|
||||
* 超管重置用户密码
|
||||
*/
|
||||
@PutMapping("/{id}/reset/pwd")
|
||||
public void resetPwd(@PathVariable long id) {
|
||||
iSysUserService.resetPwd(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 找回密码
|
||||
*/
|
||||
@PutMapping("/retrieve/pwd")
|
||||
public void retrievePwd(@RequestBody @Validated RetrievePwdVO vo) {
|
||||
iSysUserService.retrievePwd(vo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据用户id列表获取用户信息
|
||||
*/
|
||||
@PostMapping("/list/ids")
|
||||
public List<AccountVO> listByIds(@RequestBody List<Long> ids) {
|
||||
return iSysUserService.listByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询所有用户
|
||||
*/
|
||||
@GetMapping("/list/all")
|
||||
public List<AccountVO> listAll() {
|
||||
return iSysUserService.listAll();
|
||||
}
|
||||
/**
|
||||
* 找回密码
|
||||
*/
|
||||
@PutMapping("/retrieve/pwd")
|
||||
public void retrievePwd(@RequestBody @Validated RetrievePwdVO vo) {
|
||||
iSysUserService.retrievePwd(vo);
|
||||
}
|
||||
}
|
||||
|
@ -363,8 +363,4 @@ public interface ISysUserService {
|
||||
boolean isSameMobileExist(String mobile);
|
||||
|
||||
boolean isSameEmailExist(String email);
|
||||
|
||||
List<AccountVO> listByIds(List<Long> ids);
|
||||
|
||||
List<AccountVO> listAll();
|
||||
}
|
||||
|
@ -1112,20 +1112,6 @@ public class SysUserService implements ISysUserService {
|
||||
return sysAccountDAO.countByExample(example) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AccountVO> listByIds(List<Long> ids) {
|
||||
SysAccountExample example = new SysAccountExample();
|
||||
example.createCriteria().andIdIn(ids);
|
||||
List<SysAccount> sysAccounts = sysAccountDAO.selectByExample(example);
|
||||
return AccountVO.convertFromDB(sysAccounts);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AccountVO> listAll() {
|
||||
List<SysAccount> sysAccounts = sysAccountDAO.selectByExample(null);
|
||||
return AccountVO.convertFromDB(sysAccounts);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询包含组织信息的用户信息
|
||||
*/
|
||||
|
@ -98,7 +98,7 @@ public class CgyStatsService {
|
||||
+ "app_secret=" + statsBO.getAppSecret();
|
||||
body.put("sign", EncryptUtil.md5(sb).toLowerCase());
|
||||
//扩展字段
|
||||
body.put("duration", statsBO.getDuration().get() / 60); //分钟
|
||||
body.put("duration", statsBO.getDuration().get());
|
||||
SimulationInfoQueryVO queryVO = new SimulationInfoQueryVO();
|
||||
queryVO.setFunctionId(statsBO.getFunctionId());
|
||||
List<SimulationInfoVO> sims = simulationService.listAllSimulation(queryVO);
|
||||
@ -108,7 +108,7 @@ public class CgyStatsService {
|
||||
httpHeaders.setContentType(MediaType.APPLICATION_JSON);
|
||||
HttpEntity<Map<String, Object>> httpEntity = new HttpEntity<>(body, httpHeaders);
|
||||
Map<String, String> resBody = restTemplate.postForObject(
|
||||
"http://gdjtapp.cdivtc.edu.cn/api/applicationCenter/openapi/summary", httpEntity,
|
||||
"https://common-dev.educloudxr.com/api/applicationCenter/openapi/summary", httpEntity,
|
||||
Map.class);
|
||||
if (resBody != null && Objects.equals(resBody.get("code"), "100001")) {
|
||||
log.error(String.format("成工院虚仿平台同步数据失败:[%s][%s]", resBody.get("msg"),
|
||||
@ -122,12 +122,10 @@ public class CgyStatsService {
|
||||
public void syncUserSimulationUsing(UserSimulationRecordEvent event) {
|
||||
UserSimulationRecord record = event.getRecord();
|
||||
CgyStatsBO cgyStatsBO = functionStatsMap.get(record.getFunctionId());
|
||||
if (Objects.nonNull(cgyStatsBO)) {
|
||||
cgyStatsBO.getVisitor().incrementAndGet();
|
||||
cgyStatsBO.getUserSet().add(record.getUserId());
|
||||
cgyStatsBO.getDuration().addAndGet(record.getDuration());
|
||||
cgyStatsBO.getChange().set(true);
|
||||
}
|
||||
cgyStatsBO.getVisitor().incrementAndGet();
|
||||
cgyStatsBO.getUserSet().add(record.getUserId());
|
||||
cgyStatsBO.getDuration().addAndGet(record.getDuration());
|
||||
cgyStatsBO.getChange().set(true);
|
||||
}
|
||||
|
||||
/**
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -380,7 +380,9 @@ public class Training2PublishService {
|
||||
if (reqVO.getType() != null) {
|
||||
or.andTypeEqualTo(reqVO.getType().value());
|
||||
}
|
||||
example.setOrderByClause("id desc");
|
||||
// if(reqVO.getOrgId() !=null){
|
||||
// or.andOrgIdNotEqualTo(reqVO.getOrgId());
|
||||
// }
|
||||
List<PublishedTraining2> list = this.publishedDao.selectByExample(example);
|
||||
if (CollectionUtils.isEmpty(list)) {
|
||||
return List.of();
|
||||
|
@ -16,6 +16,8 @@ import club.joylink.rtss.simulation.cbtc.GroupSimulationService;
|
||||
import club.joylink.rtss.simulation.cbtc.Simulation;
|
||||
import club.joylink.rtss.simulation.cbtc.SimulationLifeCycleService;
|
||||
import club.joylink.rtss.simulation.cbtc.SimulationService;
|
||||
import club.joylink.rtss.simulation.cbtc.conversation.ConversationGroup;
|
||||
import club.joylink.rtss.simulation.cbtc.conversation.ConversationMember;
|
||||
import club.joylink.rtss.simulation.cbtc.data.map.Switch;
|
||||
import club.joylink.rtss.simulation.cbtc.data.vo.ConversationMessageVO;
|
||||
import club.joylink.rtss.simulation.cbtc.data.vo.Training2MessageVO;
|
||||
@ -315,12 +317,9 @@ public class Training2Service {
|
||||
Map<Long, Float> scoreMap = new HashMap<>();
|
||||
if (!CollectionUtils.isEmpty(training2.getScoringRules())) {
|
||||
training2.getScoringRules().stream()
|
||||
.flatMap(sr -> sr.getDetails().stream())
|
||||
.forEach(d -> scoreMap.put(d.getStep().getId(), d.getScore()));
|
||||
// training2.getScoringRules().stream()
|
||||
//// .filter(score -> Objects.equals(score.getMember().getId(), member.getId()))
|
||||
// .findFirst().ifPresent(scoringRule2 -> scoringRule2.getDetails()
|
||||
// .forEach(d -> scoreMap.put(d.getStep().getId(), d.getScore())));
|
||||
.filter(score -> Objects.equals(score.getMember().getId(), member.getId()))
|
||||
.findFirst().ifPresent(scoringRule2 -> scoringRule2.getDetails()
|
||||
.forEach(d -> scoreMap.put(d.getStep().getId(), d.getScore())));
|
||||
}
|
||||
// 前端传回的步骤信息
|
||||
Map<Long, PaperTrainAnswerDetail> answerDetailMap = new HashMap<>();
|
||||
@ -328,23 +327,20 @@ public class Training2Service {
|
||||
scoreDetailList.forEach(d -> answerDetailMap.put(d.getStepId(), d));
|
||||
}
|
||||
return training2.getSteps().stream()
|
||||
// .filter(s -> Objects.equals(s.getSimulationMember().getId(), member.getId()))
|
||||
.filter(s -> Objects.equals(s.getSimulationMember().getId(), member.getId()))
|
||||
.map(step -> {
|
||||
PaperTrainAnswerDetail detail = new PaperTrainAnswerDetail();
|
||||
detail.setStepId(step.getId());
|
||||
detail.setHaveRule(scoreMap.containsKey(step.getId()));
|
||||
detail.setRuleScore(scoreMap.get(step.getId()));
|
||||
if (!Objects.equals(step.getSimulationMember().getId(), member.getId())) {
|
||||
detail.setSuccess(true);
|
||||
detail.setScore(detail.getRuleScore());
|
||||
} else {
|
||||
if (answerDetailMap.containsKey(step.getId())) {
|
||||
detail.setSuccess(answerDetailMap.get(step.getId()).isSuccess());
|
||||
detail.setClientOperations(answerDetailMap.get(step.getId()).getClientOperations());
|
||||
detail.setNotExistAppend(true);
|
||||
}
|
||||
if (answerDetailMap.containsKey(step.getId())) {
|
||||
detail.setSuccess(answerDetailMap.get(step.getId()).isSuccess());
|
||||
detail.setScore(
|
||||
detail.isHaveRule() && detail.isSuccess() ? scoreMap.get(step.getId()) : 0F);
|
||||
detail.setClientOperations(answerDetailMap.get(step.getId()).getClientOperations());
|
||||
detail.setNotExistAppend(true);
|
||||
}
|
||||
if (detail.isHaveRule()) {
|
||||
detail.setRuleScore(scoreMap.get(step.getId()));
|
||||
}
|
||||
return detail;
|
||||
}).collect(Collectors.toList());
|
||||
|
@ -2,7 +2,6 @@ package club.joylink.rtss.services.voice;
|
||||
|
||||
import club.joylink.rtss.dao.CompetitionErrorSetDAO;
|
||||
import club.joylink.rtss.entity.CompetitionErrorSet;
|
||||
import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
|
||||
import club.joylink.rtss.simulation.cbtc.conversation.SimulationVoiceHandler;
|
||||
import club.joylink.rtss.util.StrUtils;
|
||||
import club.joylink.rtss.vo.client.PageQueryVO;
|
||||
@ -13,16 +12,8 @@ import club.joylink.rtss.vo.client.voice.VoiceRecognitionVO;
|
||||
import club.joylink.rtss.vo.voice.VoiceVerifyResultVO;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import javax.sound.sampled.AudioFileFormat;
|
||||
import javax.sound.sampled.AudioFormat;
|
||||
import javax.sound.sampled.AudioInputStream;
|
||||
import javax.sound.sampled.AudioSystem;
|
||||
import javax.sound.sampled.UnsupportedAudioFileException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
@ -67,10 +58,9 @@ public class VoiceTrainingService implements IVoiceTrainingService {
|
||||
|
||||
@Override
|
||||
public VoiceVerifyResultVO verifyVoice(String contentType, byte[] fileData, String text) {
|
||||
byte[] monoData = convertToMonoChannel(fileData);
|
||||
VoiceRecognitionResult voiceRecognitionResult = voiceRecognition(
|
||||
new VoiceRecognitionVO(monoData, contentType));
|
||||
boolean match = StrUtils.isMatch(text, voiceRecognitionResult.getResult(), 70);
|
||||
new VoiceRecognitionVO(fileData, contentType));
|
||||
boolean match = StrUtils.isMatch(text, voiceRecognitionResult.getResult(), 20);
|
||||
return new VoiceVerifyResultVO(voiceRecognitionResult.getResult(), match);
|
||||
}
|
||||
|
||||
@ -80,40 +70,4 @@ public class VoiceTrainingService implements IVoiceTrainingService {
|
||||
result.setResult(simulationVoiceHandler.handle(result.getResult()));
|
||||
return result;
|
||||
}
|
||||
|
||||
private byte[] convertToMonoChannel(byte[] audioData) {
|
||||
try {
|
||||
// 假设输入和输出音频都存储在字节数组中
|
||||
byte[] outputAudioBytes;
|
||||
|
||||
// 将输入音频字节数组转换为音频输入流
|
||||
ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(audioData);
|
||||
AudioInputStream audioInputStream = AudioSystem.getAudioInputStream(byteArrayInputStream);
|
||||
AudioFormat format = audioInputStream.getFormat();
|
||||
|
||||
// 确保输入音频是立体声
|
||||
if (format.getChannels() != 2) {
|
||||
System.out.println("Input audio is not stereo.");
|
||||
return audioData;
|
||||
}
|
||||
|
||||
// 创建单声道格式
|
||||
AudioFormat monoFormat = new AudioFormat(format.getEncoding(), format.getSampleRate(),
|
||||
format.getSampleSizeInBits(), 1, format.getFrameSize() / 2, format.getFrameRate(), false);
|
||||
|
||||
// 从立体声转换为单声道
|
||||
AudioInputStream monoInputStream = AudioSystem.getAudioInputStream(monoFormat,
|
||||
audioInputStream);
|
||||
|
||||
// 将单声道音频写入字节数组输出流
|
||||
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
|
||||
AudioSystem.write(monoInputStream, AudioFileFormat.Type.WAVE, byteArrayOutputStream);
|
||||
|
||||
// 获取输出音频的字节数组
|
||||
return byteArrayOutputStream.toByteArray();
|
||||
} catch (UnsupportedAudioFileException | IOException e) {
|
||||
throw BusinessExceptionAssertEnum.SYSTEM_EXCEPTION.exception(
|
||||
String.format("音频转单声道失败:%s", e));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -21,7 +21,6 @@ import club.joylink.rtss.vo.client.WebSocketMessageType;
|
||||
import club.joylink.rtss.vo.client.factory.SocketMessageFactory;
|
||||
import club.joylink.rtss.websocket.StompMessageService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.stereotype.Component;
|
||||
@ -34,14 +33,14 @@ import java.util.stream.Collectors;
|
||||
@Component
|
||||
public class ATSMessageCollectAndDispatcher {
|
||||
|
||||
@Autowired
|
||||
private Joylink3DMessageService joylink3DMessageService;
|
||||
@Autowired
|
||||
private Joylink3DMessageService joylink3DMessageService;
|
||||
|
||||
@Autowired
|
||||
private StompMessageService stompMessageService;
|
||||
@Autowired
|
||||
private StompMessageService stompMessageService;
|
||||
|
||||
@Autowired
|
||||
private ApplicationContext applicationContext;
|
||||
@Autowired
|
||||
private ApplicationContext applicationContext;
|
||||
|
||||
// public void run(Simulation simulation) {
|
||||
//// long start = System.currentTimeMillis();
|
||||
@ -63,223 +62,222 @@ public class ATSMessageCollectAndDispatcher {
|
||||
//// System.out.println(String.format("收集并发送设备状态用时: [%s ms]", (end - start)));
|
||||
// }
|
||||
|
||||
/**
|
||||
* 收集仿真所有设备状态并发送给仿真用户
|
||||
*/
|
||||
public void collectAllAndSend(Simulation simulation) {
|
||||
List<DeviceStatusVO> deviceStatuses = collectAll(simulation);
|
||||
// 构建并发送设备状态消息
|
||||
SocketMessageVO<List<DeviceStatusVO>> deviceStatusMessage =
|
||||
SocketMessageFactory.buildSimulationDeviceStatusesMessage(simulation.getId(), deviceStatuses);
|
||||
Set<String> sessions = simulation.getSimulationUserIds();
|
||||
stompMessageService.sendToUser(sessions, deviceStatusMessage);
|
||||
}
|
||||
/**
|
||||
* 收集仿真所有设备状态并发送给仿真用户
|
||||
*/
|
||||
public void collectAllAndSend(Simulation simulation) {
|
||||
List<DeviceStatusVO> deviceStatuses = collectAll(simulation);
|
||||
// 构建并发送设备状态消息
|
||||
SocketMessageVO<List<DeviceStatusVO>> deviceStatusMessage =
|
||||
SocketMessageFactory.buildSimulationDeviceStatusesMessage(simulation.getId(), deviceStatuses);
|
||||
Set<String> sessions = simulation.getSimulationUserIds();
|
||||
stompMessageService.sendToUser(sessions, deviceStatusMessage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 收集仿真所有设备状态
|
||||
*/
|
||||
public List<DeviceStatusVO> collectAll(Simulation simulation) {
|
||||
List<DeviceStatusVO> totalList = new ArrayList<>();
|
||||
SimulationDataRepository repository = simulation.getRepository();
|
||||
Map<String, ? extends MapElement> deviceMap = repository.getDeviceMap();
|
||||
deviceMap.values().forEach(device -> {
|
||||
DeviceStatus deviceStatus = repository.findStatusByCode(device.getCode());
|
||||
if (Objects.isNull(deviceStatus)) {
|
||||
deviceStatus = buildDeviceStatus(device);
|
||||
if (Objects.nonNull(deviceStatus)) {
|
||||
repository.addDeviceInfo(deviceStatus);
|
||||
totalList.add(deviceStatus.convert2VO(device));
|
||||
}
|
||||
} else {
|
||||
DeviceStatusVO statusVO = buildDeviceStatusVO(device);
|
||||
if (deviceStatus.compareAndChange(device, statusVO)) {
|
||||
totalList.add(statusVO);
|
||||
}
|
||||
}
|
||||
});
|
||||
// 列车状态
|
||||
List<TrainInfo> trainList = repository.getSuperviseTrainList();
|
||||
trainList.forEach(train -> {
|
||||
TrainStatus trainStatus = repository.findStatusByCode(train.getGroupNumber(), TrainStatus.class);
|
||||
if (Objects.isNull(trainStatus)) {
|
||||
/**
|
||||
* 收集仿真所有设备状态
|
||||
*/
|
||||
public List<DeviceStatusVO> collectAll(Simulation simulation) {
|
||||
List<DeviceStatusVO> totalList = new ArrayList<>();
|
||||
SimulationDataRepository repository = simulation.getRepository();
|
||||
Map<String, ? extends MapElement> deviceMap = repository.getDeviceMap();
|
||||
deviceMap.values().forEach(device -> {
|
||||
DeviceStatus deviceStatus = repository.findStatusByCode(device.getCode());
|
||||
if (Objects.isNull(deviceStatus)) {
|
||||
deviceStatus = buildDeviceStatus(device);
|
||||
if (Objects.nonNull(deviceStatus)) {
|
||||
repository.addDeviceInfo(deviceStatus);
|
||||
totalList.add(deviceStatus.convert2VO(device));
|
||||
}
|
||||
} else {
|
||||
DeviceStatusVO statusVO = buildDeviceStatusVO(device);
|
||||
if (deviceStatus.compareAndChange(device, statusVO)) {
|
||||
totalList.add(statusVO);
|
||||
}
|
||||
}
|
||||
});
|
||||
// 列车状态
|
||||
List<TrainInfo> trainList = repository.getSuperviseTrainList();
|
||||
trainList.forEach(train -> {
|
||||
TrainStatus trainStatus = repository.findStatusByCode(train.getGroupNumber(), TrainStatus.class);
|
||||
if (Objects.isNull(trainStatus)) {
|
||||
// if(simulation.getBuildParams().getProdType() == MapPrdTypeEnum.YJDDZH){
|
||||
if (Objects.equals(simulation.getProject(), MapPrdTypeEnum.YJDDZH.name())) {
|
||||
trainStatus = new YJDDZHTrainStatus(train);
|
||||
} else {
|
||||
trainStatus = new TrainStatus(train);
|
||||
}
|
||||
repository.addDeviceInfo(trainStatus);
|
||||
totalList.add(trainStatus.convert2VO(train));
|
||||
} else {
|
||||
DeviceStatusVO statusVO;
|
||||
if(Objects.equals(simulation.getProject(),MapPrdTypeEnum.YJDDZH.name())){
|
||||
trainStatus = new YJDDZHTrainStatus(train);
|
||||
}else{
|
||||
trainStatus = new TrainStatus(train);
|
||||
}
|
||||
repository.addDeviceInfo(trainStatus);
|
||||
totalList.add(trainStatus.convert2VO(train));
|
||||
} else {
|
||||
DeviceStatusVO statusVO;
|
||||
// if(simulation.getBuildParams().getProdType() == MapPrdTypeEnum.YJDDZH){
|
||||
if (Objects.equals(simulation.getProject(), MapPrdTypeEnum.YJDDZH.name())) {
|
||||
statusVO = new YJDDZHTrainStatusVO(train);
|
||||
} else {
|
||||
// statusVO = new TrainStatusVO(train);
|
||||
statusVO = new TrainStatusVO(trainStatus);
|
||||
if(Objects.equals(simulation.getProject(),MapPrdTypeEnum.YJDDZH.name())){
|
||||
statusVO = new YJDDZHTrainStatusVO(train);
|
||||
}else{
|
||||
statusVO = new TrainStatusVO(train);
|
||||
}
|
||||
if (trainStatus.compareAndChange(train, statusVO)) {
|
||||
totalList.add(statusVO);
|
||||
}
|
||||
}
|
||||
});
|
||||
// 回库删除的列车状态
|
||||
List<TrainStatus> inboundTrainList = new ArrayList<>();
|
||||
List<TrainStatus> trainStatusList = repository.getTrainStatusList();
|
||||
if (!CollectionUtils.isEmpty(trainStatusList)) {
|
||||
for (TrainStatus trainStatus : trainStatusList) {
|
||||
TrainInfo trainInfo = repository.findSupervisedTrainByGroup(trainStatus.getGroupNumber());
|
||||
if (Objects.isNull(trainInfo)) {
|
||||
totalList.add(TrainStatusVO.buildDispose(trainStatus.getGroupNumber()));
|
||||
inboundTrainList.add(trainStatus);
|
||||
repository.deleteDeviceStatus(trainStatus.getCode());
|
||||
}
|
||||
}
|
||||
}
|
||||
if (trainStatus.compareAndChange(train, statusVO)) {
|
||||
totalList.add(statusVO);
|
||||
joylink3DMessageService.handleTrainInbound(simulation, inboundTrainList);
|
||||
return totalList;
|
||||
}
|
||||
|
||||
private DeviceStatus buildDeviceStatus(MapElement device) {
|
||||
DeviceStatus status = null;
|
||||
switch (device.getDeviceType()) {
|
||||
case SECTION:
|
||||
status = new SectionStatus((Section) device);
|
||||
break;
|
||||
case SWITCH:
|
||||
status = new SwitchStatus((Switch) device);
|
||||
break;
|
||||
case SIGNAL:
|
||||
status = new SignalStatus((Signal) device);
|
||||
break;
|
||||
case STATION:
|
||||
status = new StationStatus((Station) device);
|
||||
break;
|
||||
case STAND:
|
||||
status = new StandStatus((Stand) device);
|
||||
break;
|
||||
case PSD:
|
||||
status = new PSDStatus((PSD) device);
|
||||
break;
|
||||
case ZC:
|
||||
status = new ZCStatus((ZC) device);
|
||||
break;
|
||||
case ROUTE:
|
||||
status = new RouteStatus((Route) device);
|
||||
break;
|
||||
case OVERLAP: {
|
||||
status = new OverlapStatus((RouteOverlap) device);
|
||||
break;
|
||||
}
|
||||
case CYCLE:
|
||||
status = new CycleStatus((Cycle) device);
|
||||
break;
|
||||
case DIRECTION_ROD:
|
||||
status = new DirectionRodStatus((DirectionRod) device);
|
||||
break;
|
||||
case CATENARY:
|
||||
status = new CatenaryStatus((Catenary) device);
|
||||
break;
|
||||
|
||||
case STATION_DIRECTION:
|
||||
status = new StationDirectionStatus((StationDirection) device);
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
// 回库删除的列车状态
|
||||
List<TrainStatus> inboundTrainList = new ArrayList<>();
|
||||
List<TrainStatus> trainStatusList = repository.getTrainStatusList();
|
||||
if (!CollectionUtils.isEmpty(trainStatusList)) {
|
||||
for (TrainStatus trainStatus : trainStatusList) {
|
||||
TrainInfo trainInfo = repository.findSupervisedTrainByGroup(trainStatus.getGroupNumber());
|
||||
if (Objects.isNull(trainInfo)) {
|
||||
totalList.add(TrainStatusVO.buildDispose(trainStatus.getGroupNumber()));
|
||||
inboundTrainList.add(trainStatus);
|
||||
repository.deleteDeviceStatus(trainStatus.getCode());
|
||||
return status;
|
||||
}
|
||||
|
||||
private DeviceStatusVO buildDeviceStatusVO(MapElement device) {
|
||||
DeviceStatusVO status = null;
|
||||
switch (device.getDeviceType()) {
|
||||
case SECTION:
|
||||
status = new SectionStatusVO((Section) device);
|
||||
break;
|
||||
case SWITCH:
|
||||
status = new SwitchStatusVO((Switch) device);
|
||||
break;
|
||||
case SIGNAL:
|
||||
status = new SignalStatusVO((Signal) device);
|
||||
break;
|
||||
case STATION:
|
||||
status = new StationStatusVO((Station) device);
|
||||
break;
|
||||
case STAND:
|
||||
status = new StandStatusVO((Stand) device);
|
||||
break;
|
||||
case PSD:
|
||||
status = new PSDStatusVO((PSD) device);
|
||||
break;
|
||||
case ZC:
|
||||
status = new ZCStatusVO((ZC) device);
|
||||
break;
|
||||
case ROUTE:
|
||||
status = new RouteStatusVO((Route) device);
|
||||
break;
|
||||
case OVERLAP: {
|
||||
status = new OverlapStatusVO((RouteOverlap) device);
|
||||
break;
|
||||
}
|
||||
case CYCLE:
|
||||
status = new CycleStatusVO((Cycle) device);
|
||||
break;
|
||||
case DIRECTION_ROD:
|
||||
status = new DirectionRodStatusVO((DirectionRod) device);
|
||||
break;
|
||||
case CATENARY:
|
||||
status = new CatenaryStatusVO((Catenary) device);
|
||||
break;
|
||||
|
||||
case STATION_DIRECTION:
|
||||
status = new StationDirectionStatusVO((StationDirection) device);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return status;
|
||||
}
|
||||
joylink3DMessageService.handleTrainInbound(simulation, inboundTrainList);
|
||||
return totalList;
|
||||
}
|
||||
|
||||
private DeviceStatus buildDeviceStatus(MapElement device) {
|
||||
DeviceStatus status = null;
|
||||
switch (device.getDeviceType()) {
|
||||
case SECTION:
|
||||
status = new SectionStatus((Section) device);
|
||||
break;
|
||||
case SWITCH:
|
||||
status = new SwitchStatus((Switch) device);
|
||||
break;
|
||||
case SIGNAL:
|
||||
status = new SignalStatus((Signal) device);
|
||||
break;
|
||||
case STATION:
|
||||
status = new StationStatus((Station) device);
|
||||
break;
|
||||
case STAND:
|
||||
status = new StandStatus((Stand) device);
|
||||
break;
|
||||
case PSD:
|
||||
status = new PSDStatus((PSD) device);
|
||||
break;
|
||||
case ZC:
|
||||
status = new ZCStatus((ZC) device);
|
||||
break;
|
||||
case ROUTE:
|
||||
status = new RouteStatus((Route) device);
|
||||
break;
|
||||
case OVERLAP: {
|
||||
status = new OverlapStatus((RouteOverlap) device);
|
||||
break;
|
||||
}
|
||||
case CYCLE:
|
||||
status = new CycleStatus((Cycle) device);
|
||||
break;
|
||||
case DIRECTION_ROD:
|
||||
status = new DirectionRodStatus((DirectionRod) device);
|
||||
break;
|
||||
case CATENARY:
|
||||
status = new CatenaryStatus((Catenary) device);
|
||||
break;
|
||||
|
||||
case STATION_DIRECTION:
|
||||
status = new StationDirectionStatus((StationDirection) device);
|
||||
break;
|
||||
/**
|
||||
* 列车运行数据
|
||||
*/
|
||||
public void sendTrainRunData(Simulation simulation, RealRun realRun) {
|
||||
stompMessageService.sendToUser(simulation.getSimulationUserIds(),
|
||||
SocketMessageFactory.build(WebSocketMessageType.Simulation_RunFact,
|
||||
simulation.getId(), Arrays.asList(realRun)));
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
||||
private DeviceStatusVO buildDeviceStatusVO(MapElement device) {
|
||||
DeviceStatusVO status = null;
|
||||
switch (device.getDeviceType()) {
|
||||
case SECTION:
|
||||
status = new SectionStatusVO((Section) device);
|
||||
break;
|
||||
case SWITCH:
|
||||
status = new SwitchStatusVO((Switch) device);
|
||||
break;
|
||||
case SIGNAL:
|
||||
status = new SignalStatusVO((Signal) device);
|
||||
break;
|
||||
case STATION:
|
||||
status = new StationStatusVO((Station) device);
|
||||
break;
|
||||
case STAND:
|
||||
status = new StandStatusVO((Stand) device);
|
||||
break;
|
||||
case PSD:
|
||||
status = new PSDStatusVO((PSD) device);
|
||||
break;
|
||||
case ZC:
|
||||
status = new ZCStatusVO((ZC) device);
|
||||
break;
|
||||
case ROUTE:
|
||||
status = new RouteStatusVO((Route) device);
|
||||
break;
|
||||
case OVERLAP: {
|
||||
status = new OverlapStatusVO((RouteOverlap) device);
|
||||
break;
|
||||
}
|
||||
case CYCLE:
|
||||
status = new CycleStatusVO((Cycle) device);
|
||||
break;
|
||||
case DIRECTION_ROD:
|
||||
status = new DirectionRodStatusVO((DirectionRod) device);
|
||||
break;
|
||||
case CATENARY:
|
||||
status = new CatenaryStatusVO((Catenary) device);
|
||||
break;
|
||||
|
||||
case STATION_DIRECTION:
|
||||
status = new StationDirectionStatusVO((StationDirection) device);
|
||||
break;
|
||||
/**
|
||||
* 仿真设备操作消息
|
||||
*/
|
||||
public void handlerOperateMessage(Simulation simulation, OperationMessage operationMessage) {
|
||||
SocketMessageVO<OperationMessage> socketMessageVO =
|
||||
SocketMessageFactory.build(WebSocketMessageType.Simulation_ApplyHandle, simulation.getId(), operationMessage);
|
||||
Set<SimulationMember> humanMembers = operationMessage.getTargetMembers().stream().filter(m -> !m.isRobot()).collect(Collectors.toSet());
|
||||
//当在场景实训设计中,并且无真人成员时,将数据暂存,等待后续角色有人扮演时再发送
|
||||
if (simulation.isInSceneTraining() && CollectionUtils.isEmpty(humanMembers)) {
|
||||
for (SimulationMember targetMember : operationMessage.getTargetMembers()) {
|
||||
targetMember.getUnreceivedMessages().offer(socketMessageVO);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (CollectionUtils.isEmpty(humanMembers)) {
|
||||
//目标都是机器人,选择一个机器人发送事件处理
|
||||
applicationContext.publishEvent(new SimulationOperationMessageEvent(this, simulation, operationMessage));
|
||||
return;
|
||||
}
|
||||
//目标成员有真人,推送对应真人处理
|
||||
stompMessageService.sendToUser(humanMembers.stream().map(SimulationMember::getUserId).collect(Collectors.toSet()), socketMessageVO);
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* 列车运行数据
|
||||
*/
|
||||
public void sendTrainRunData(Simulation simulation, RealRun realRun) {
|
||||
stompMessageService.sendToUser(simulation.getSimulationUserIds(),
|
||||
SocketMessageFactory.build(WebSocketMessageType.Simulation_RunFact,
|
||||
simulation.getId(), Arrays.asList(realRun)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 仿真设备操作消息
|
||||
*/
|
||||
public void handlerOperateMessage(Simulation simulation, OperationMessage operationMessage) {
|
||||
SocketMessageVO<OperationMessage> socketMessageVO =
|
||||
SocketMessageFactory.build(WebSocketMessageType.Simulation_ApplyHandle, simulation.getId(), operationMessage);
|
||||
Set<SimulationMember> humanMembers = operationMessage.getTargetMembers().stream().filter(m -> !m.isRobot()).collect(Collectors.toSet());
|
||||
//当在场景实训设计中,并且无真人成员时,将数据暂存,等待后续角色有人扮演时再发送
|
||||
if (simulation.isInSceneTraining() && CollectionUtils.isEmpty(humanMembers)) {
|
||||
for (SimulationMember targetMember : operationMessage.getTargetMembers()) {
|
||||
targetMember.getUnreceivedMessages().offer(socketMessageVO);
|
||||
}
|
||||
return;
|
||||
/**
|
||||
* 同步仿真系统时间给客户端
|
||||
*/
|
||||
public void syncTime(Simulation simulation) {
|
||||
Set<String> sessions = simulation.getSimulationUserIds();
|
||||
SocketMessageVO<Long> timeSyncMessage = SocketMessageFactory.buildSimulationTimeSyncMessage(simulation);
|
||||
stompMessageService.sendToUser(sessions, timeSyncMessage);
|
||||
}
|
||||
if (CollectionUtils.isEmpty(humanMembers)) {
|
||||
//目标都是机器人,选择一个机器人发送事件处理
|
||||
applicationContext.publishEvent(new SimulationOperationMessageEvent(this, simulation, operationMessage));
|
||||
return;
|
||||
|
||||
public void addJobs(Simulation simulation) {
|
||||
simulation.addJob(SimulationModule.SYNC_TIME.name(), () -> syncTime(simulation), SimulationConstants.SYNC_TIME_RATE);
|
||||
simulation.addFixedRateJob(SimulationModule.MESSAGE.name(), () -> collectAllAndSend(simulation), SimulationConstants.SEND_CLIENT_RATE);
|
||||
}
|
||||
//目标成员有真人,推送对应真人处理
|
||||
stompMessageService.sendToUser(humanMembers.stream().map(SimulationMember::getUserId).collect(Collectors.toSet()), socketMessageVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 同步仿真系统时间给客户端
|
||||
*/
|
||||
public void syncTime(Simulation simulation) {
|
||||
Set<String> sessions = simulation.getSimulationUserIds();
|
||||
SocketMessageVO<Long> timeSyncMessage = SocketMessageFactory.buildSimulationTimeSyncMessage(simulation);
|
||||
stompMessageService.sendToUser(sessions, timeSyncMessage);
|
||||
}
|
||||
|
||||
public void addJobs(Simulation simulation) {
|
||||
simulation.addJob(SimulationModule.SYNC_TIME.name(), () -> syncTime(simulation), SimulationConstants.SYNC_TIME_RATE);
|
||||
simulation.addFixedRateJob(SimulationModule.MESSAGE.name(), () -> collectAllAndSend(simulation), SimulationConstants.SEND_CLIENT_RATE);
|
||||
}
|
||||
}
|
||||
|
@ -413,10 +413,6 @@ public class CiApiServiceImpl2 implements CiApiService {
|
||||
throw BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.exception(
|
||||
"signalCode和routeCode不能都为空");
|
||||
}
|
||||
//开启联锁自动进路的信号机不能办理引导进路,需先解除自动进路(成都三操作文档)
|
||||
if (signal.getRouteList().stream().anyMatch(Route::isFleetMode)) {
|
||||
throw BusinessExceptionAssertEnum.OPERATION_FAIL.exception("需先解除自动进路状态");
|
||||
}
|
||||
|
||||
if (route == null && signal.getRouteList().stream().anyMatch(Route::isAnySwitchMasterLock)) {
|
||||
openGuideAspect4GuideMasterLock(simulation, signal);
|
||||
|
@ -113,7 +113,7 @@ public class CiRouteService {
|
||||
// return new Route.CheckFailMessage(Route.CheckFailReason.SectionFaultOccupied, section);
|
||||
// }
|
||||
}
|
||||
if (!start.isCbtcMode() && !guide) {
|
||||
if (!start.isCbtcMode()) {
|
||||
// 后备办理检查
|
||||
// 区段占用
|
||||
for (Section section : sectionList) {
|
||||
@ -584,13 +584,9 @@ public class CiRouteService {
|
||||
route.setLock(false);
|
||||
}
|
||||
}
|
||||
if (section.isSwitchTrack()) {
|
||||
switchFaultUnlock(simulation, section.getRelSwitch(), route);
|
||||
} else {
|
||||
section.faultUnlock();
|
||||
if (section.isShowLogic()) {
|
||||
section.getLogicList().forEach(Section::faultUnlock);
|
||||
}
|
||||
section.faultUnlock();
|
||||
if (section.isShowLogic()) {
|
||||
section.getLogicList().forEach(Section::faultUnlock);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,43 +0,0 @@
|
||||
package club.joylink.rtss.simulation.cbtc.device.real.modbustcp.cgy;
|
||||
|
||||
import club.joylink.rtss.simulation.cbtc.Simulation;
|
||||
import club.joylink.rtss.simulation.cbtc.data.vr.VirtualRealitySectionAxleCounter;
|
||||
import club.joylink.rtss.simulation.cbtc.device.real.modbustcp.RealDeviceService;
|
||||
import club.joylink.rtss.simulation.cbtc.device.real.modbustcp.common.PlcGateway;
|
||||
import club.joylink.rtss.simulation.cbtc.device.real.modbustcp.common.RealDeviceConfig;
|
||||
import club.joylink.rtss.vo.client.project.cgy.CgySectionConfigVO;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class CgySectionServiceImpl implements RealDeviceService {
|
||||
|
||||
@Override
|
||||
public boolean canHandle(RealDeviceConfig deviceConfig) {
|
||||
return deviceConfig instanceof CgySectionConfig;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(Simulation simulation, RealDeviceConfig deviceConfig) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handle(Simulation simulation, RealDeviceConfig deviceConfig, ByteBuf byteBuf) {
|
||||
PlcGateway plcGateway = simulation.queryPlcGatewayDevice();
|
||||
if (plcGateway == null) {
|
||||
return;
|
||||
}
|
||||
CgySectionConfig config = (CgySectionConfig) deviceConfig;
|
||||
VirtualRealitySectionAxleCounter vrAxleCounter = (VirtualRealitySectionAxleCounter) config.getMapElement();
|
||||
if (vrAxleCounter == null) {
|
||||
return;
|
||||
}
|
||||
CgySectionConfigVO configVO = config.getConfigVO();
|
||||
ByteBuf deviceStatus = RealDeviceConfig.getDeviceCoilStatus(byteBuf, configVO.getAddr(),
|
||||
configVO.getQuantity());
|
||||
|
||||
boolean r_occupied = RealDeviceConfig.getBitOf(deviceStatus, configVO.getR_occupied());
|
||||
vrAxleCounter.setOccupy(r_occupied);
|
||||
}
|
||||
}
|
@ -64,7 +64,7 @@ public class CgySignalServiceImpl implements RealDeviceService {
|
||||
plcGatewayService.writeSingleCoil(baseAddr, configVO.getW_zxj(), true, channel);
|
||||
break;
|
||||
case Y:
|
||||
plcGatewayService.writeSingleCoil(baseAddr, configVO.getW_ddj(), true, channel);
|
||||
plcGatewayService.writeSingleCoil(baseAddr, configVO.getW_ddj(), false, channel);
|
||||
plcGatewayService.writeSingleCoil(baseAddr, configVO.getW_lxj(), true, channel);
|
||||
plcGatewayService.writeSingleCoil(baseAddr, configVO.getW_yxj(), false, channel);
|
||||
plcGatewayService.writeSingleCoil(baseAddr, configVO.getW_zxj(), false, channel);
|
||||
@ -139,8 +139,7 @@ public class CgySignalServiceImpl implements RealDeviceService {
|
||||
break;
|
||||
case G:
|
||||
plcGatewayService.checkEqualAndWriteSingleCoil(baseAddr, configVO.getW_ddj(), w_ddj,
|
||||
false,
|
||||
channel);
|
||||
false, channel);
|
||||
plcGatewayService.checkEqualAndWriteSingleCoil(baseAddr, configVO.getW_lxj(), w_lxj, true,
|
||||
channel);
|
||||
plcGatewayService.checkEqualAndWriteSingleCoil(baseAddr, configVO.getW_yxj(), w_yxj,
|
||||
|
@ -7,18 +7,19 @@ import club.joylink.rtss.vo.client.org.OrgVO;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 账户对象
|
||||
*/
|
||||
@ -27,316 +28,307 @@ import org.springframework.util.StringUtils;
|
||||
@Setter
|
||||
@EqualsAndHashCode
|
||||
public class AccountVO implements Serializable {
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
/**
|
||||
* 登录账户名(线下登录账户名)
|
||||
*/
|
||||
private String account;
|
||||
/**
|
||||
* 父账户
|
||||
*/
|
||||
private String parentAccount;
|
||||
/**
|
||||
* 账户类型
|
||||
*/
|
||||
private String type;
|
||||
public static final String Type_1 = "1"; // 个人账户
|
||||
public static final String Type_2 = "2"; // 第三方企业账户
|
||||
public static final String Type_3 = "3"; // 第三方企业子账户
|
||||
|
||||
/**
|
||||
* 登录账户名(线下登录账户名)
|
||||
*/
|
||||
private String account;
|
||||
/**
|
||||
* 父账户
|
||||
*/
|
||||
private String parentAccount;
|
||||
/**
|
||||
* 账户类型
|
||||
*/
|
||||
private String type;
|
||||
public static final String Type_1 = "1"; // 个人账户
|
||||
public static final String Type_2 = "2"; // 第三方企业账户
|
||||
public static final String Type_3 = "3"; // 第三方企业子账户
|
||||
/**
|
||||
* 账号所属的组织(是账号表里的字段)
|
||||
*/
|
||||
private Long orgId;
|
||||
|
||||
/**
|
||||
* 账号所属的组织(是账号表里的字段)
|
||||
*/
|
||||
private Long orgId;
|
||||
/**
|
||||
* 真实姓名
|
||||
*/
|
||||
@NotBlank(message = "姓名不能为空")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 真实姓名
|
||||
*/
|
||||
@NotBlank(message = "姓名不能为空")
|
||||
private String name;
|
||||
/**
|
||||
* 昵称
|
||||
*/
|
||||
@NotBlank(message = "昵称不能为空")
|
||||
private String nickname;
|
||||
|
||||
/**
|
||||
* 昵称
|
||||
*/
|
||||
@NotBlank(message = "昵称不能为空")
|
||||
private String nickname;
|
||||
/**
|
||||
* 头像资源地址
|
||||
*/
|
||||
private String avatarPath;
|
||||
|
||||
/**
|
||||
* 头像资源地址
|
||||
*/
|
||||
private String avatarPath;
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
@NotBlank(message = "手机号码不能为空")
|
||||
private String mobile;
|
||||
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
@NotBlank(message = "手机号码不能为空")
|
||||
private String mobile;
|
||||
/**
|
||||
* 国家码
|
||||
*/
|
||||
private String nationcode;
|
||||
|
||||
/**
|
||||
* 国家码
|
||||
*/
|
||||
private String nationcode;
|
||||
private String password;
|
||||
|
||||
private String password;
|
||||
/**
|
||||
* 微信openId
|
||||
*/
|
||||
@NotBlank(message = "微信OPENID不能为空")
|
||||
private String wxId;
|
||||
|
||||
/**
|
||||
* 微信openId
|
||||
*/
|
||||
@NotBlank(message = "微信OPENID不能为空")
|
||||
private String wxId;
|
||||
/**
|
||||
* 微信unionId
|
||||
*/
|
||||
private String wxUnionId;
|
||||
|
||||
/**
|
||||
* 微信unionId
|
||||
*/
|
||||
private String wxUnionId;
|
||||
/**
|
||||
* 微信小程序openId
|
||||
*/
|
||||
private String wmOpenId;
|
||||
|
||||
/**
|
||||
* 微信小程序openId
|
||||
*/
|
||||
private String wmOpenId;
|
||||
/**
|
||||
* 数据库的roles字段
|
||||
*/
|
||||
@JsonIgnore
|
||||
private String dbRoles;
|
||||
|
||||
/**
|
||||
* 数据库的roles字段
|
||||
*/
|
||||
@JsonIgnore
|
||||
private String dbRoles;
|
||||
/**
|
||||
* 角色
|
||||
*/
|
||||
private List<String> roles;
|
||||
|
||||
/**
|
||||
* 角色
|
||||
*/
|
||||
private List<String> roles;
|
||||
/**
|
||||
* 账号来源(最初的目的是给cgy做注册人数变化曲线)
|
||||
*/
|
||||
private String source;
|
||||
|
||||
/**
|
||||
* 账号来源(最初的目的是给cgy做注册人数变化曲线)
|
||||
*/
|
||||
private String source;
|
||||
/**
|
||||
* email邮箱
|
||||
*/
|
||||
private String email;
|
||||
|
||||
/**
|
||||
* email邮箱
|
||||
*/
|
||||
private String email;
|
||||
/**
|
||||
* 状态:1-可用
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 状态:1-可用
|
||||
*/
|
||||
private String status;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private LocalDateTime createTime;
|
||||
//单位信息
|
||||
private Long companyId;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
//单位信息
|
||||
private Long companyId;
|
||||
|
||||
private String companyName;
|
||||
private Boolean companyAdmin;
|
||||
/**
|
||||
* 用户所属组织关联的项目
|
||||
*/
|
||||
private List<String> projectCodes;
|
||||
private String companyName;
|
||||
private Boolean companyAdmin;
|
||||
/**
|
||||
* 用户所属组织关联的项目
|
||||
*/
|
||||
private List<String> projectCodes;
|
||||
|
||||
|
||||
public AccountVO() {
|
||||
}
|
||||
|
||||
public AccountVO(SysAccount account) {
|
||||
this.id = account.getId();
|
||||
this.account = account.getAccount();
|
||||
this.parentAccount = account.getParentAccount();
|
||||
this.type = account.getType();
|
||||
this.orgId = account.getOrgId();
|
||||
this.name = account.getName();
|
||||
this.nickname = account.getNickname();
|
||||
this.avatarPath = account.getAvatarPath();
|
||||
this.mobile = account.getMobile();
|
||||
this.nationcode = account.getNationcode();
|
||||
this.password = account.getPassword();
|
||||
this.wxId = account.getWxId();
|
||||
this.wxUnionId = account.getWxUnionId();
|
||||
this.wmOpenId = account.getWmOpenId();
|
||||
this.setRolesByString(account.getRoles());
|
||||
this.source = account.getSource();
|
||||
this.email = account.getEmail();
|
||||
this.status = account.getStatus();
|
||||
this.createTime = account.getCreateTime();
|
||||
this.updateTime = account.getUpdateTime();
|
||||
}
|
||||
|
||||
public static AccountVO system() {
|
||||
AccountVO accountVO = new AccountVO();
|
||||
accountVO.setId(0L);
|
||||
accountVO.setName("系统");
|
||||
return accountVO;
|
||||
}
|
||||
|
||||
public static SysAccount fromVO(AccountVO accountVo) {
|
||||
SysAccount account = new SysAccount();
|
||||
account.setId(accountVo.getId());
|
||||
account.setName(accountVo.getName());
|
||||
account.setNickname(accountVo.getNickname());
|
||||
account.setNationcode(accountVo.getNationcode());
|
||||
account.setMobile(accountVo.getMobile());
|
||||
account.setWxId(accountVo.getWxId());
|
||||
account.setWxUnionId(accountVo.getWxUnionId());
|
||||
account.setRoles(accountVo.getRolesStr());
|
||||
account.setEmail(accountVo.getEmail());
|
||||
account.setStatus(accountVo.getStatus());
|
||||
account.setCreateTime(accountVo.getCreateTime());
|
||||
return account;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public String getIdStr() {
|
||||
return String.valueOf(this.id);
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public String getRolesStr() {
|
||||
if (!CollectionUtils.isEmpty(this.roles)) {
|
||||
return String.join(",", this.roles.toArray(new String[]{}));
|
||||
public AccountVO() {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public void setRolesByString(String roles) {
|
||||
if (StringUtils.hasText(roles)) {
|
||||
String[] splits = roles.split(",");
|
||||
this.roles = new ArrayList<>();
|
||||
Collections.addAll(this.roles, splits);
|
||||
public AccountVO(SysAccount account) {
|
||||
this.id = account.getId();
|
||||
this.account = account.getAccount();
|
||||
this.parentAccount = account.getParentAccount();
|
||||
this.type = account.getType();
|
||||
this.orgId = account.getOrgId();
|
||||
this.name = account.getName();
|
||||
this.nickname = account.getNickname();
|
||||
this.avatarPath = account.getAvatarPath();
|
||||
this.mobile = account.getMobile();
|
||||
this.nationcode = account.getNationcode();
|
||||
this.password = account.getPassword();
|
||||
this.wxId = account.getWxId();
|
||||
this.wxUnionId = account.getWxUnionId();
|
||||
this.wmOpenId = account.getWmOpenId();
|
||||
this.setRolesByString(account.getRoles());
|
||||
this.source = account.getSource();
|
||||
this.email = account.getEmail();
|
||||
this.status = account.getStatus();
|
||||
this.createTime = account.getCreateTime();
|
||||
}
|
||||
}
|
||||
|
||||
public void setRolesByString() {
|
||||
if (StringUtils.hasText(dbRoles)) {
|
||||
String[] splits = dbRoles.split(",");
|
||||
this.roles = new ArrayList<>();
|
||||
Collections.addAll(this.roles, splits);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "UserVO [id=" + id + ", name=" + name + ", nickname=" + nickname + ", mobile=" + mobile
|
||||
+ ", email=" + email + ", nationcode="
|
||||
+ nationcode + ", wxId=" + wxId + "]";
|
||||
}
|
||||
|
||||
public static List<AccountVO> convertFromDB(List<SysAccount> list) {
|
||||
List<AccountVO> voList = new ArrayList<>();
|
||||
if (!CollectionUtils.isEmpty(list)) {
|
||||
list.forEach(account -> voList.add(new AccountVO(account)));
|
||||
}
|
||||
return voList;
|
||||
}
|
||||
|
||||
public static List<AccountVO> convert2BaseInfoVO(List<SysAccount> list) {
|
||||
List<AccountVO> voList = new ArrayList<>();
|
||||
if (!CollectionUtils.isEmpty(list)) {
|
||||
list.forEach(account -> {
|
||||
public static AccountVO system() {
|
||||
AccountVO accountVO = new AccountVO();
|
||||
accountVO.setId(account.getId());
|
||||
accountVO.setName(account.getName());
|
||||
accountVO.setNickname(account.getNickname());
|
||||
accountVO.setMobile(account.getMobile());
|
||||
voList.add(accountVO);
|
||||
});
|
||||
accountVO.setId(0L);
|
||||
accountVO.setName("系统");
|
||||
return accountVO;
|
||||
}
|
||||
return voList;
|
||||
}
|
||||
|
||||
public static List<SysAccount> convert2UnionIdInfoVOs(List<AccountVO> voList) {
|
||||
List<SysAccount> list = new ArrayList<>();
|
||||
if (!CollectionUtils.isEmpty(voList)) {
|
||||
voList.forEach(userVO -> {
|
||||
if (StringUtils.hasText(userVO.getWxUnionId())) {
|
||||
SysAccount account = new SysAccount();
|
||||
account.setId(userVO.getId());
|
||||
account.setWxUnionId(userVO.getWxUnionId());
|
||||
list.add(account);
|
||||
public static SysAccount fromVO(AccountVO accountVo) {
|
||||
SysAccount account = new SysAccount();
|
||||
account.setId(accountVo.getId());
|
||||
account.setName(accountVo.getName());
|
||||
account.setNickname(accountVo.getNickname());
|
||||
account.setNationcode(accountVo.getNationcode());
|
||||
account.setMobile(accountVo.getMobile());
|
||||
account.setWxId(accountVo.getWxId());
|
||||
account.setWxUnionId(accountVo.getWxUnionId());
|
||||
account.setRoles(accountVo.getRolesStr());
|
||||
account.setEmail(accountVo.getEmail());
|
||||
account.setStatus(accountVo.getStatus());
|
||||
account.setCreateTime(accountVo.getCreateTime());
|
||||
return account;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public String getIdStr() {
|
||||
return String.valueOf(this.id);
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public String getRolesStr() {
|
||||
if (!CollectionUtils.isEmpty(this.roles)) {
|
||||
return String.join(",", this.roles.toArray(new String[]{}));
|
||||
}
|
||||
});
|
||||
return null;
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否管理员
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@JsonIgnore
|
||||
public boolean isAdmin() {
|
||||
return !CollectionUtils.isEmpty(this.roles)
|
||||
&& (this.roles.contains(BusinessConsts.ROLE_04) || this.roles.contains(
|
||||
BusinessConsts.ROLE_05));
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否超级管理员
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@JsonIgnore
|
||||
public boolean isSuperAdmin() {
|
||||
return !CollectionUtils.isEmpty(this.roles)
|
||||
&& (this.roles.contains(BusinessConsts.ROLE_05));
|
||||
}
|
||||
|
||||
public void filter4Client() {
|
||||
this.password = null;
|
||||
this.wxUnionId = null;
|
||||
this.wxId = null;
|
||||
this.wmOpenId = null;
|
||||
this.createTime = null;
|
||||
}
|
||||
|
||||
public void forClient() {
|
||||
if (StringUtils.hasText(dbRoles)) {
|
||||
this.roles = List.of(dbRoles.split(","));
|
||||
public void setRolesByString(String roles) {
|
||||
if (StringUtils.hasText(roles)) {
|
||||
String[] splits = roles.split(",");
|
||||
this.roles = new ArrayList<>();
|
||||
Collections.addAll(this.roles, splits);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void setOrgInfo(Org org, Boolean companyAdmin, List<String> projectCodes) {
|
||||
this.companyId = org.getId();
|
||||
this.companyName = org.getName();
|
||||
this.companyAdmin = companyAdmin;
|
||||
this.projectCodes = projectCodes;
|
||||
}
|
||||
|
||||
public void copyOrgInfo(AccountVO accountVO) {
|
||||
if (accountVO != null) {
|
||||
this.companyId = accountVO.getCompanyId();
|
||||
this.companyName = accountVO.getCompanyName();
|
||||
this.companyAdmin = accountVO.getCompanyAdmin();
|
||||
this.projectCodes = accountVO.getProjectCodes();
|
||||
public void setRolesByString() {
|
||||
if (StringUtils.hasText(dbRoles)) {
|
||||
String[] splits = dbRoles.split(",");
|
||||
this.roles = new ArrayList<>();
|
||||
Collections.addAll(this.roles, splits);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public boolean isThirdChildAccount() {
|
||||
return Type_3.equalsIgnoreCase(this.type) && StringUtils.hasText(this.parentAccount);
|
||||
}
|
||||
|
||||
public void setOrgProjectVO(OrgVO orgVO, boolean orgAdmin) {
|
||||
if (orgVO != null) {
|
||||
this.companyId = orgVO.getId();
|
||||
this.companyName = orgVO.getName();
|
||||
this.companyAdmin = orgAdmin;
|
||||
this.projectCodes = orgVO.getProjectCodes();
|
||||
} else {
|
||||
this.companyId = null;
|
||||
this.companyName = null;
|
||||
this.companyAdmin = false;
|
||||
this.projectCodes = List.of();
|
||||
@Override
|
||||
public String toString() {
|
||||
return "UserVO [id=" + id + ", name=" + name + ", nickname=" + nickname + ", mobile=" + mobile + ", email=" + email + ", nationcode="
|
||||
+ nationcode + ", wxId=" + wxId + "]";
|
||||
}
|
||||
|
||||
public static List<AccountVO> convertFromDB(List<SysAccount> list) {
|
||||
List<AccountVO> voList = new ArrayList<>();
|
||||
if (!CollectionUtils.isEmpty(list)) {
|
||||
list.forEach(account -> voList.add(new AccountVO(account)));
|
||||
}
|
||||
return voList;
|
||||
}
|
||||
|
||||
public static List<AccountVO> convert2BaseInfoVO(List<SysAccount> list) {
|
||||
List<AccountVO> voList = new ArrayList<>();
|
||||
if (!CollectionUtils.isEmpty(list)) {
|
||||
list.forEach(account -> {
|
||||
AccountVO accountVO = new AccountVO();
|
||||
accountVO.setId(account.getId());
|
||||
accountVO.setName(account.getName());
|
||||
accountVO.setNickname(account.getNickname());
|
||||
accountVO.setMobile(account.getMobile());
|
||||
voList.add(accountVO);
|
||||
});
|
||||
}
|
||||
return voList;
|
||||
}
|
||||
|
||||
public static List<SysAccount> convert2UnionIdInfoVOs(List<AccountVO> voList) {
|
||||
List<SysAccount> list = new ArrayList<>();
|
||||
if (!CollectionUtils.isEmpty(voList)) {
|
||||
voList.forEach(userVO -> {
|
||||
if (StringUtils.hasText(userVO.getWxUnionId())) {
|
||||
SysAccount account = new SysAccount();
|
||||
account.setId(userVO.getId());
|
||||
account.setWxUnionId(userVO.getWxUnionId());
|
||||
list.add(account);
|
||||
}
|
||||
});
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否管理员
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@JsonIgnore
|
||||
public boolean isAdmin() {
|
||||
return !CollectionUtils.isEmpty(this.roles)
|
||||
&& (this.roles.contains(BusinessConsts.ROLE_04) || this.roles.contains(BusinessConsts.ROLE_05));
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否超级管理员
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@JsonIgnore
|
||||
public boolean isSuperAdmin() {
|
||||
return !CollectionUtils.isEmpty(this.roles)
|
||||
&& (this.roles.contains(BusinessConsts.ROLE_05));
|
||||
}
|
||||
|
||||
public void filter4Client() {
|
||||
this.password = null;
|
||||
this.wxUnionId = null;
|
||||
this.wxId = null;
|
||||
this.wmOpenId = null;
|
||||
this.createTime = null;
|
||||
}
|
||||
|
||||
public void forClient() {
|
||||
if (StringUtils.hasText(dbRoles)) {
|
||||
this.roles = List.of(dbRoles.split(","));
|
||||
}
|
||||
}
|
||||
|
||||
public void setOrgInfo(Org org, Boolean companyAdmin, List<String> projectCodes) {
|
||||
this.companyId = org.getId();
|
||||
this.companyName = org.getName();
|
||||
this.companyAdmin = companyAdmin;
|
||||
this.projectCodes = projectCodes;
|
||||
}
|
||||
|
||||
public void copyOrgInfo(AccountVO accountVO) {
|
||||
if (accountVO != null) {
|
||||
this.companyId = accountVO.getCompanyId();
|
||||
this.companyName = accountVO.getCompanyName();
|
||||
this.companyAdmin = accountVO.getCompanyAdmin();
|
||||
this.projectCodes = accountVO.getProjectCodes();
|
||||
}
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public boolean isThirdChildAccount() {
|
||||
return Type_3.equalsIgnoreCase(this.type) && StringUtils.hasText(this.parentAccount);
|
||||
}
|
||||
|
||||
public void setOrgProjectVO(OrgVO orgVO, boolean orgAdmin) {
|
||||
if (orgVO != null) {
|
||||
this.companyId = orgVO.getId();
|
||||
this.companyName = orgVO.getName();
|
||||
this.companyAdmin = orgAdmin;
|
||||
this.projectCodes = orgVO.getProjectCodes();
|
||||
} else {
|
||||
this.companyId = null;
|
||||
this.companyName = null;
|
||||
this.companyAdmin = false;
|
||||
this.projectCodes = List.of();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,145 +1,140 @@
|
||||
package club.joylink.rtss.vo.map;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public class MapCiGenerateConfig {
|
||||
|
||||
//--------------------联锁数据生成配置start-------------------
|
||||
/**
|
||||
* 是否类似哈尔滨一号线,联锁分为ATP信号、地面信号、引导信号
|
||||
*/
|
||||
private boolean likeHa1;
|
||||
//--------------------联锁数据生成配置start-------------------
|
||||
/**
|
||||
*是否类似哈尔滨一号线,联锁分为ATP信号、地面信号、引导信号
|
||||
*/
|
||||
private boolean likeHa1;
|
||||
|
||||
/**
|
||||
* 是否生成侧防:true-生成侧防,不要联动道岔,false-不生成侧防,用联动道岔
|
||||
*/
|
||||
private boolean generateFls;
|
||||
/**
|
||||
*是否生成侧防:true-生成侧防,不要联动道岔,false-不生成侧防,用联动道岔
|
||||
*/
|
||||
private boolean generateFls;
|
||||
|
||||
/**
|
||||
* 信号机接近区段只取最近的一个
|
||||
*/
|
||||
private boolean signalApproachOnlyOne;
|
||||
/**
|
||||
*信号机接近区段只取最近的一个
|
||||
*/
|
||||
private boolean signalApproachOnlyOne;
|
||||
|
||||
/**
|
||||
* 信号机接近区段仅考虑定位道岔
|
||||
*/
|
||||
private boolean signalApproachOnlyNpSwitch;
|
||||
/**
|
||||
*信号机接近区段仅考虑定位道岔
|
||||
*/
|
||||
private boolean signalApproachOnlyNpSwitch;
|
||||
|
||||
/**
|
||||
* 信号机接近区段不跨过前方同向信号机
|
||||
*/
|
||||
private boolean signalApproachNotPassPreSignal = true;
|
||||
/**
|
||||
*信号机接近区段不跨过前方同向信号机
|
||||
*/
|
||||
private boolean signalApproachNotPassPreSignal = true;
|
||||
|
||||
/**
|
||||
* 进路名称使用终端信号机同区段反向信号机名称命名:true-使用反向(如果存在的话),false-使用终端信号机命名
|
||||
*/
|
||||
private boolean routeNameUseEndOppositeSignalName;
|
||||
/**
|
||||
*进路名称使用终端信号机同区段反向信号机名称命名:true-使用反向(如果存在的话),false-使用终端信号机命名
|
||||
*/
|
||||
private boolean routeNameUseEndOppositeSignalName;
|
||||
|
||||
/**
|
||||
* 是否生成折返进路
|
||||
*/
|
||||
private boolean generateTbRoute;
|
||||
/**
|
||||
*是否生成折返进路
|
||||
*/
|
||||
private boolean generateTbRoute;
|
||||
|
||||
/**
|
||||
* 折返进路名称使用终端信号机反向信号机名称(并且终端按钮亦使用反向信号机-成都三联锁)
|
||||
*/
|
||||
private boolean tbRouteNameUseEndOppositeSignalName;
|
||||
/**
|
||||
*折返进路名称使用终端信号机反向信号机名称
|
||||
*/
|
||||
private boolean tbRouteNameUseEndOppositeSignalName;
|
||||
|
||||
/**
|
||||
* 进路始端防护信号机是否总是绿灯:true-总是开绿灯,false-根据进路中有无反位道岔生成绿灯或黄灯
|
||||
*/
|
||||
private boolean routeSignalAlwaysGreen;
|
||||
/**
|
||||
*进路始端防护信号机是否总是绿灯:true-总是开绿灯,false-根据进路中有无反位道岔生成绿灯或黄灯
|
||||
*/
|
||||
private boolean routeSignalAlwaysGreen;
|
||||
|
||||
/**
|
||||
* 多个延续保护路径生成多条进路:true-生成多条进路,false-生成一条进路
|
||||
*/
|
||||
private boolean routeApartByOverlap;
|
||||
/**
|
||||
*多个延续保护路径生成多条进路:true-生成多条进路,false-生成一条进路
|
||||
*/
|
||||
private boolean routeApartByOverlap;
|
||||
|
||||
/**
|
||||
* 延续保护是否只构建道岔
|
||||
*/
|
||||
private boolean overlapOnlySwitch;
|
||||
/**
|
||||
*延续保护是否只构建道岔
|
||||
*/
|
||||
private boolean overlapOnlySwitch;
|
||||
//
|
||||
// @ApiModelProperty(value = "延续保护构建是否只考虑一个道岔计轴")
|
||||
// private boolean overlapOnlyOneSwitch;
|
||||
/**
|
||||
* 延续保护最小长度
|
||||
*/
|
||||
private float overlapMinLen = 55;
|
||||
/**
|
||||
* 延续保护最小长度
|
||||
*/
|
||||
private float overlapMinLen = 55;
|
||||
|
||||
/**
|
||||
* 延续保护道岔是否只构建定位道岔
|
||||
*/
|
||||
private boolean overlapSwitchNpOnly;
|
||||
/**
|
||||
*延续保护道岔是否只构建定位道岔
|
||||
*/
|
||||
private boolean overlapSwitchNpOnly;
|
||||
|
||||
/**
|
||||
* 延续保护道岔在防护信号机与所属区段方向相反时,只构建定位道岔
|
||||
*/
|
||||
private boolean overlapSignalOppositeSwitchNpOnly;
|
||||
/**
|
||||
*延续保护道岔在防护信号机与所属区段方向相反时,只构建定位道岔
|
||||
*/
|
||||
private boolean overlapSignalOppositeSwitchNpOnly;
|
||||
|
||||
/**
|
||||
* 延续保护的建立方式:true-通过触发建立,false-随进路建立
|
||||
*/
|
||||
private boolean overlapSettingByTrigger;
|
||||
/**
|
||||
*延续保护的建立方式:true-通过触发建立,false-随进路建立
|
||||
*/
|
||||
private boolean overlapSettingByTrigger;
|
||||
|
||||
/**
|
||||
* 默认延续保护解锁时间
|
||||
*/
|
||||
private int overlapReleaseTime = 60;
|
||||
/**
|
||||
*默认延续保护解锁时间
|
||||
*/
|
||||
private int overlapReleaseTime = 60;
|
||||
|
||||
/**
|
||||
* 默认进路解锁时间
|
||||
*/
|
||||
private int routeReleaseTime = 45;
|
||||
/**
|
||||
*默认进路解锁时间
|
||||
*/
|
||||
private int routeReleaseTime = 45;
|
||||
|
||||
/**
|
||||
* 是否生成自动折返
|
||||
*/
|
||||
private boolean generateCycle;
|
||||
/**
|
||||
*是否生成自动折返
|
||||
*/
|
||||
private boolean generateCycle;
|
||||
|
||||
/**
|
||||
* 是否生成进路信号按钮
|
||||
*/
|
||||
private boolean routeButton;
|
||||
/**
|
||||
*是否生成进路信号按钮
|
||||
*/
|
||||
private boolean routeButton;
|
||||
|
||||
/**
|
||||
* 若生成进路信号按钮,进路信号按钮是否取最近的一个信号机
|
||||
*/
|
||||
private boolean getNearlySignal;
|
||||
/**
|
||||
*若生成进路信号按钮,进路信号按钮是否取最近的一个信号机
|
||||
*/
|
||||
private boolean getNearlySignal;
|
||||
|
||||
/**
|
||||
* 是否生成目的地码定义(泰雷兹式)
|
||||
*/
|
||||
private boolean generateDestination;
|
||||
/**
|
||||
*是否生成目的地码定义(泰雷兹式)
|
||||
*/
|
||||
private boolean generateDestination;
|
||||
|
||||
/**
|
||||
* 上下行站台共享紧急关闭效果的车站
|
||||
*/
|
||||
private Set<String> sharingECStations = new HashSet<>();
|
||||
/** 上下行站台共享紧急关闭效果的车站 */
|
||||
private Set<String> sharingECStations = new HashSet<>();
|
||||
|
||||
/**
|
||||
* 进路联锁不包含站台扣车
|
||||
*/
|
||||
private boolean routeInterlockDoNotIncludeStandHoldTrain;
|
||||
/** 进路联锁不包含站台扣车 */
|
||||
private boolean routeInterlockDoNotIncludeStandHoldTrain;
|
||||
|
||||
// @ApiModelProperty(value = "是否分开生成ATP联锁和地面信号联锁")
|
||||
// private boolean apartGroundAndAtp;
|
||||
|
||||
/**
|
||||
* 是否处理停车场/车辆段逻辑
|
||||
*/
|
||||
private boolean handleDepot;
|
||||
/** 是否处理停车场/车辆段逻辑 */
|
||||
private boolean handleDepot;
|
||||
|
||||
/**
|
||||
* 是大铁线路?
|
||||
*/
|
||||
private boolean railway;
|
||||
/**
|
||||
* 是大铁线路?
|
||||
*/
|
||||
private boolean railway;
|
||||
|
||||
//--------------------联锁数据生成配置end-------------------
|
||||
//--------------------联锁数据生成配置end-------------------
|
||||
|
||||
}
|
||||
|
@ -1,46 +1,48 @@
|
||||
package club.joylink.rtss.vo.paper;
|
||||
|
||||
import club.joylink.rtss.vo.client.training2.Operation2VO;
|
||||
import java.util.List;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public class PaperTrainAnswerDetail {
|
||||
|
||||
/**
|
||||
* 实训步骤id
|
||||
*/
|
||||
private Long stepId;
|
||||
/**
|
||||
* 实训步骤id
|
||||
*/
|
||||
private Long stepId;
|
||||
|
||||
/**
|
||||
* 实训是否成功
|
||||
*/
|
||||
private boolean success;
|
||||
/**
|
||||
* 实训是否成功
|
||||
*/
|
||||
private boolean success;
|
||||
|
||||
/**
|
||||
* 获得的分数
|
||||
*/
|
||||
private Float score;
|
||||
/**
|
||||
* 获得的分数
|
||||
*/
|
||||
private Float score;
|
||||
|
||||
/**
|
||||
* 规则设置的分数
|
||||
*/
|
||||
private Float ruleScore;
|
||||
/**
|
||||
* 规则设置的分数
|
||||
*/
|
||||
private Float ruleScore;
|
||||
|
||||
/**
|
||||
* 是否有打分规则
|
||||
*/
|
||||
private boolean haveRule;
|
||||
/**
|
||||
* 是否有打分规则
|
||||
*/
|
||||
private boolean haveRule;
|
||||
|
||||
private boolean notExistAppend;
|
||||
/**
|
||||
* 客户端操作的实训,对应的id必须要传
|
||||
*/
|
||||
private List<TrainOperations> clientOperations;
|
||||
private boolean notExistAppend;
|
||||
/**
|
||||
* 客户端操作的实训,对应的id必须要传
|
||||
*/
|
||||
private List<TrainOperations> clientOperations;
|
||||
|
||||
public static class TrainOperations extends Operation2VO.ClientOperation2VO {
|
||||
|
||||
}
|
||||
public static class TrainOperations extends Operation2VO.ClientOperation2VO{
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user