Compare commits

..

19 Commits

Author SHA1 Message Date
f14e377565 [新增]以终端反向信号机命名的信号机同样也用此信号机作为办理进路的按钮
All checks were successful
CI / Docker-Build (push) Successful in 2m13s
2024-09-29 09:31:21 +08:00
b302bb360b [新增]开启自动进路的信号机不能开放引导信号 2024-09-26 15:20:55 +08:00
1e2ed4d305 [新增]获取用户信息的接口中增加更新时间
All checks were successful
CI / Docker-Build (push) Successful in 2m12s
2024-09-25 13:27:39 +08:00
436a07bcf4 [新增]获取所有用户信息的接口
All checks were successful
CI / Docker-Build (push) Successful in 2m9s
2024-09-25 10:51:31 +08:00
235f4dce5b [新增]按id数组查询用户信息的接口
All checks were successful
CI / Docker-Build (push) Successful in 2m14s
2024-09-24 16:43:07 +08:00
ac87b0dbe9 [bug]实训中,有多个评分规则时,仅有一个评分规则被使用
All checks were successful
CI / Docker-Build (push) Successful in 2m12s
2024-09-18 10:37:33 +08:00
3536ff75ad [修改]后备模式下,办理引导进路不再检查区段占用
All checks were successful
CI / Docker-Build (push) Successful in 2m11s
2024-09-11 19:07:55 +08:00
f57952b755 [修改]实训结束后的评分删除多余的memberId字段;查询实训按id逆序排列
All checks were successful
CI / Docker-Build (push) Successful in 2m13s
2024-09-11 14:02:16 +08:00
9c9e7c60e3 [修改]场景实训结束后的评分展示中增加非用户角色的步骤(并增加每个步骤对应的角色id,非用户角色步骤没有分数)
All checks were successful
CI / Docker-Build (push) Successful in 6m56s
2024-09-10 17:55:50 +08:00
98abf0691a Merge remote-tracking branch 'origin/develop' into develop 2024-09-10 17:01:45 +08:00
16e8dc191f [bug]对道岔区段的区故解仅解锁指定的区段,而非整个道岔计轴区段 2024-09-10 17:01:24 +08:00
tiger_zhou
4f151fae4a 修改 仿真销毁的时候发送cgy时间,有个可能是空的
All checks were successful
CI / Docker-Build (push) Successful in 2m33s
2024-08-19 09:42:14 +08:00
tiger_zhou
e93171e958 调整列车区段没有值得问题
All checks were successful
CI / Docker-Build (push) Successful in 5m14s
2024-08-16 18:59:18 +08:00
4cd80bbec5 [bug]成都工业实体信号机黄灯、绿灯控制逻辑不对 2024-07-29 13:43:06 +08:00
8125e32d7e [bug]成都工业实体信号机黄灯、绿灯控制逻辑不对 2024-07-18 16:45:00 +08:00
e23864fa72 [修改]探索如何设置maven镜像源
All checks were successful
CI / Docker-Build (push) Successful in 5m3s
2024-06-11 20:40:34 +08:00
212773e679 [修改]gitea自动构建/发布脚本文件
Some checks failed
CI / Docker-Build (push) Failing after 19m33s
2024-06-11 20:15:21 +08:00
495681db5d [修改]语音识别校验接口要求匹配率提高到70%
Some checks failed
CI / Docker-Build (push) Failing after 1m49s
2024-06-07 18:10:20 +08:00
dbe197eba6 [bug]成都工业区段联动服务没写 2024-05-24 11:40:13 +08:00
19 changed files with 3389 additions and 3101 deletions

471
pom.xml
View File

@ -1,231 +1,252 @@
<?xml version="1.0" encoding="UTF-8"?> <?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" <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"> 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> <modelVersion>4.0.0</modelVersion>
<parent> <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> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId> <artifactId>spring-boot-starter-parent</artifactId>
<configuration> <version>2.3.5.RELEASE</version>
<includeSystemScope>true</includeSystemScope> <relativePath/> <!-- lookup parent from repository -->
</configuration> </parent>
</plugin> <groupId>club.joylink</groupId>
<artifactId>rtss</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>rtss</name>
<description>Rail transit simulation system</description>
<plugin> <properties>
<groupId>com.github.shalousun</groupId> <java.version>11</java.version>
<artifactId>smart-doc-maven-plugin</artifactId> <pagehelper.version>4.1.1</pagehelper.version>
<version>2.1.9</version> </properties>
<configuration>
<!--指定生成文档的使用的配置文件,配置文件放在自己的项目中-->
<configFile>./src/main/resources/smart-doc.json</configFile>
<!--smart-doc实现自动分析依赖树加载第三方依赖的源码如果一些框架依赖库加载不到导致报错这时请使用excludes排除掉-->
<!-- <excludes>-->
<!-- &lt;!&ndash;格式为groupId:artifactId;参考如下&ndash;&gt;-->
<!-- <exclude>com.alibaba:fastjson</exclude>-->
<!-- </excludes>-->
<!-- &lt;!&ndash;自1.0.8版本开始插件提供includes支持,配置了includes后插件会按照用户配置加载而不是自动加载因此使用时需要注意&ndash;&gt;-->
<!-- &lt;!&ndash;smart-doc能自动分析依赖树加载所有依赖源码原则上会影响文档构建效率因此你可以使用includes来让插件加载你配置的组件&ndash;&gt;-->
<!-- <includes>-->
<!-- &lt;!&ndash;格式为groupId:artifactId;参考如下&ndash;&gt;-->
<!-- <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>-->
<!-- &lt;!&ndash;格式为groupId:artifactId;参考如下&ndash;&gt;-->
<!-- <exclude>com.alibaba:fastjson</exclude>-->
<!-- </excludes>-->
<!-- &lt;!&ndash;自1.0.8版本开始插件提供includes支持,配置了includes后插件会按照用户配置加载而不是自动加载因此使用时需要注意&ndash;&gt;-->
<!-- &lt;!&ndash;smart-doc能自动分析依赖树加载所有依赖源码原则上会影响文档构建效率因此你可以使用includes来让插件加载你配置的组件&ndash;&gt;-->
<!-- <includes>-->
<!-- &lt;!&ndash;格式为groupId:artifactId;参考如下&ndash;&gt;-->
<!-- <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> </project>

View File

@ -27,6 +27,6 @@ public class CgyStatsBO {
private AtomicLong visitor; private AtomicLong visitor;
//实训人数 //实训人数
private final Set<Long> userSet = new HashSet<>(); private final Set<Long> userSet = new HashSet<>();
//实训时长 //实训时长/s
private AtomicLong duration; private AtomicLong duration;
} }

View File

@ -124,8 +124,7 @@ public class TrainingV2PublishController {
*/ */
@PostMapping("/infos") @PostMapping("/infos")
public List<PublishedTraining2InfoRspVo> findTrainingListInfos( public List<PublishedTraining2InfoRspVo> findTrainingListInfos(
@RequestBody PublishedTrainingListRspVo vo @RequestBody PublishedTrainingListRspVo vo,
,
@RequestAttribute(name = AuthenticateInterceptor.LOGIN_INFO_KEY) LoginUserInfoVO loginUserInfoVO) { @RequestAttribute(name = AuthenticateInterceptor.LOGIN_INFO_KEY) LoginUserInfoVO loginUserInfoVO) {
//只查询以上架 //只查询以上架
vo.setState(BusinessConsts.STATUS_USE_INT); vo.setState(BusinessConsts.STATUS_USE_INT);

View File

@ -4,15 +4,25 @@ import club.joylink.rtss.services.ISysUserService;
import club.joylink.rtss.vo.AccountVO; import club.joylink.rtss.vo.AccountVO;
import club.joylink.rtss.vo.UserQueryVO; import club.joylink.rtss.vo.UserQueryVO;
import club.joylink.rtss.vo.client.PageVO; import club.joylink.rtss.vo.client.PageVO;
import club.joylink.rtss.vo.client.user.*; 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.user.AccountCreateVO; import club.joylink.rtss.vo.user.AccountCreateVO;
import club.joylink.rtss.vo.user.AccountRegisterVO; import club.joylink.rtss.vo.user.AccountRegisterVO;
import club.joylink.rtss.vo.user.UserRegisterCheck; import club.joylink.rtss.vo.user.UserRegisterCheck;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import java.util.List; 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;
/** /**
* 系统账户接口 * 系统账户接口
@ -21,165 +31,186 @@ import java.util.List;
@RequestMapping("/api/userinfo") @RequestMapping("/api/userinfo")
public class SysAccountController { public class SysAccountController {
@Autowired @Autowired
private ISysUserService iSysUserService; private ISysUserService iSysUserService;
@PostMapping("/register") @PostMapping("/register")
public void register(@RequestBody @Validated(value = UserRegisterCheck.class) AccountCreateVO accountCreateVO) { public void register(
this.iSysUserService.register(accountCreateVO); @RequestBody @Validated(value = UserRegisterCheck.class) AccountCreateVO accountCreateVO) {
} this.iSysUserService.register(accountCreateVO);
}
/** /**
* 新注册接口 * 新注册接口
*/ */
@PostMapping("/register2") @PostMapping("/register2")
public void register2(@RequestBody @Validated AccountRegisterVO registerVO) { public void register2(@RequestBody @Validated AccountRegisterVO registerVO) {
this.iSysUserService.register2(registerVO); this.iSysUserService.register2(registerVO);
} }
/** /**
*根据姓名或电话号查询用户 * 根据姓名或电话号查询用户
*/ */
@GetMapping(path="/nameOrMobile") @GetMapping(path = "/nameOrMobile")
public List<AccountVO> queryUserByNameOrMobile(String query) { public List<AccountVO> queryUserByNameOrMobile(String query) {
List<AccountVO> list = this.iSysUserService.queryUserByNameOrMobile(query); List<AccountVO> list = this.iSysUserService.queryUserByNameOrMobile(query);
return list; return list;
} }
/** /**
* 手机号是否已经注册 * 手机号是否已经注册
*/ */
@GetMapping("/isExist/mobile") @GetMapping("/isExist/mobile")
public boolean isMobileExist(String mobile) { public boolean isMobileExist(String mobile) {
return iSysUserService.isSameMobileExist(mobile); return iSysUserService.isSameMobileExist(mobile);
} }
/** /**
* 邮箱是否已经注册 * 邮箱是否已经注册
*/ */
@GetMapping("/isExist/email") @GetMapping("/isExist/email")
public boolean isEmailExist(String email) { public boolean isEmailExist(String email) {
return iSysUserService.isSameEmailExist(email); return iSysUserService.isSameEmailExist(email);
} }
/** /**
*根据用户id获取用户信息 * 根据用户id获取用户信息
*/ */
@GetMapping(path = "/{id}") @GetMapping(path = "/{id}")
public AccountVO getUserBaseInfoById(@PathVariable Long id) { public AccountVO getUserBaseInfoById(@PathVariable Long id) {
return this.iSysUserService.getUserBaseInfoById(id); return this.iSysUserService.getUserBaseInfoById(id);
} }
/** /**
*修改用户信息 * 修改用户信息
*/ */
@PutMapping(path = "/{id}") @PutMapping(path = "/{id}")
public void modify(@PathVariable Long id, @RequestBody AccountVO userInfo, String vdcode) { public void modify(@PathVariable Long id, @RequestBody AccountVO userInfo, String vdcode) {
this.iSysUserService.modify(id, userInfo, vdcode); this.iSysUserService.modify(id, userInfo, vdcode);
} }
/** /**
*微信关注事件 * 微信关注事件
*/ */
@GetMapping(path = "/wxsubscribe") @GetMapping(path = "/wxsubscribe")
public void wxSubscribe(@RequestParam String wxId) { public void wxSubscribe(@RequestParam String wxId) {
iSysUserService.wxSubscribeEventHandle(wxId); iSysUserService.wxSubscribeEventHandle(wxId);
} }
/** /**
*批量修改用户的openId为unionId * 批量修改用户的openId为unionId
*/ */
@PutMapping(path = "/batchchange/unionid") @PutMapping(path = "/batchchange/unionid")
public void batchChangeOpenId2UnionId() { public void batchChangeOpenId2UnionId() {
this.iSysUserService.batchChangeOpenId2UnionId(); this.iSysUserService.batchChangeOpenId2UnionId();
} }
/** /**
*更新用户真实姓名 * 更新用户真实姓名
*/ */
@PutMapping(path = "/{id}/name") @PutMapping(path = "/{id}/name")
public void updateName(@PathVariable Long id, String name) { public void updateName(@PathVariable Long id, String name) {
this.iSysUserService.updateUserName(id, name); this.iSysUserService.updateUserName(id, name);
} }
/** /**
*更新用户昵称 * 更新用户昵称
*/ */
@PutMapping(path = "/{id}/nickname") @PutMapping(path = "/{id}/nickname")
public void updateNickname(@PathVariable Long id, String nickname) { public void updateNickname(@PathVariable Long id, String nickname) {
this.iSysUserService.updateNickname(id, nickname); this.iSysUserService.updateNickname(id, nickname);
} }
/** /**
*用户上传头像 * 用户上传头像
*/ */
@PostMapping(path = "/{id}/avatar") @PostMapping(path = "/{id}/avatar")
public void uploadAvatar(@PathVariable Long id, @RequestBody AccountVO accountVO) { public void uploadAvatar(@PathVariable Long id, @RequestBody AccountVO accountVO) {
this.iSysUserService.updateAvatar(id, accountVO.getAvatarPath()); this.iSysUserService.updateAvatar(id, accountVO.getAvatarPath());
} }
/** /**
*发送手机验证码 * 发送手机验证码
*/ */
@PostMapping(path = "/mobile/code") @PostMapping(path = "/mobile/code")
public String sendMobileValidCode(@RequestBody MobileInfoVO mobileInfoVO) { public String sendMobileValidCode(@RequestBody MobileInfoVO mobileInfoVO) {
return this.iSysUserService.sendMobileValidCode(mobileInfoVO); return this.iSysUserService.sendMobileValidCode(mobileInfoVO);
} }
/** /**
*发送邮箱验证码 * 发送邮箱验证码
*/ */
@PostMapping(path = "/email/code") @PostMapping(path = "/email/code")
public String sendEmailValidCode(String email) { public String sendEmailValidCode(String email) {
return this.iSysUserService.sendEmailValidCode(email); return this.iSysUserService.sendEmailValidCode(email);
} }
/** /**
*更新用户手机号 * 更新用户手机号
*/ */
@PutMapping(path = "/{id}/mobile") @PutMapping(path = "/{id}/mobile")
public void updateMobile(@PathVariable Long id, @RequestBody @Validated UpdateMobileVO updateMobileVO) { public void updateMobile(@PathVariable Long id,
this.iSysUserService.updateMobile(id, updateMobileVO); @RequestBody @Validated UpdateMobileVO updateMobileVO) {
} this.iSysUserService.updateMobile(id, updateMobileVO);
}
/** /**
*更新用户邮箱 * 更新用户邮箱
*/ */
@PutMapping(path = "/{id}/email") @PutMapping(path = "/{id}/email")
public void updateEmail(@PathVariable Long id, @RequestBody @Validated UpdateEmailVO updateEmailVO) { public void updateEmail(@PathVariable Long id,
this.iSysUserService.updateEmail(id, updateEmailVO); @RequestBody @Validated UpdateEmailVO updateEmailVO) {
} this.iSysUserService.updateEmail(id, updateEmailVO);
}
/** /**
*更新用户登陆密码 * 更新用户登陆密码
*/ */
@PutMapping(path = "/{id}/password") @PutMapping(path = "/{id}/password")
public void updatePassword(@PathVariable Long id, @RequestBody @Validated UpdatePasswordVO updatePasswordVO) { public void updatePassword(@PathVariable Long id,
this.iSysUserService.updatePassword(id, updatePasswordVO); @RequestBody @Validated UpdatePasswordVO updatePasswordVO) {
} this.iSysUserService.updatePassword(id, updatePasswordVO);
}
/** /**
* 按条件分页查询指定来源的账号 * 按条件分页查询指定来源的账号
*/ */
@GetMapping("/page/criteria/{source}") @GetMapping("/page/criteria/{source}")
public PageVO<AccountVO> queryPagedAccountOfTheSource(UserQueryVO queryVO, @PathVariable String source) { public PageVO<AccountVO> queryPagedAccountOfTheSource(UserQueryVO queryVO,
queryVO.setSource(source); @PathVariable String source) {
return this.iSysUserService.queryPagedUser(queryVO); queryVO.setSource(source);
} return this.iSysUserService.queryPagedUser(queryVO);
}
/** /**
* 超管重置用户密码 * 超管重置用户密码
*/ */
@PutMapping("/{id}/reset/pwd") @PutMapping("/{id}/reset/pwd")
public void resetPwd(@PathVariable long id) { public void resetPwd(@PathVariable long id) {
iSysUserService.resetPwd(id); iSysUserService.resetPwd(id);
} }
/** /**
* 找回密码 * 找回密码
*/ */
@PutMapping("/retrieve/pwd") @PutMapping("/retrieve/pwd")
public void retrievePwd(@RequestBody @Validated RetrievePwdVO vo) { public void retrievePwd(@RequestBody @Validated RetrievePwdVO vo) {
iSysUserService.retrievePwd(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();
}
} }

View File

@ -363,4 +363,8 @@ public interface ISysUserService {
boolean isSameMobileExist(String mobile); boolean isSameMobileExist(String mobile);
boolean isSameEmailExist(String email); boolean isSameEmailExist(String email);
List<AccountVO> listByIds(List<Long> ids);
List<AccountVO> listAll();
} }

View File

@ -1112,6 +1112,20 @@ public class SysUserService implements ISysUserService {
return sysAccountDAO.countByExample(example) > 0; 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);
}
/** /**
* 查询包含组织信息的用户信息 * 查询包含组织信息的用户信息
*/ */

View File

@ -98,7 +98,7 @@ public class CgyStatsService {
+ "app_secret=" + statsBO.getAppSecret(); + "app_secret=" + statsBO.getAppSecret();
body.put("sign", EncryptUtil.md5(sb).toLowerCase()); body.put("sign", EncryptUtil.md5(sb).toLowerCase());
//扩展字段 //扩展字段
body.put("duration", statsBO.getDuration().get()); body.put("duration", statsBO.getDuration().get() / 60); //分钟
SimulationInfoQueryVO queryVO = new SimulationInfoQueryVO(); SimulationInfoQueryVO queryVO = new SimulationInfoQueryVO();
queryVO.setFunctionId(statsBO.getFunctionId()); queryVO.setFunctionId(statsBO.getFunctionId());
List<SimulationInfoVO> sims = simulationService.listAllSimulation(queryVO); List<SimulationInfoVO> sims = simulationService.listAllSimulation(queryVO);
@ -108,7 +108,7 @@ public class CgyStatsService {
httpHeaders.setContentType(MediaType.APPLICATION_JSON); httpHeaders.setContentType(MediaType.APPLICATION_JSON);
HttpEntity<Map<String, Object>> httpEntity = new HttpEntity<>(body, httpHeaders); HttpEntity<Map<String, Object>> httpEntity = new HttpEntity<>(body, httpHeaders);
Map<String, String> resBody = restTemplate.postForObject( Map<String, String> resBody = restTemplate.postForObject(
"https://common-dev.educloudxr.com/api/applicationCenter/openapi/summary", httpEntity, "http://gdjtapp.cdivtc.edu.cn/api/applicationCenter/openapi/summary", httpEntity,
Map.class); Map.class);
if (resBody != null && Objects.equals(resBody.get("code"), "100001")) { if (resBody != null && Objects.equals(resBody.get("code"), "100001")) {
log.error(String.format("成工院虚仿平台同步数据失败:[%s][%s]", resBody.get("msg"), log.error(String.format("成工院虚仿平台同步数据失败:[%s][%s]", resBody.get("msg"),
@ -122,10 +122,12 @@ public class CgyStatsService {
public void syncUserSimulationUsing(UserSimulationRecordEvent event) { public void syncUserSimulationUsing(UserSimulationRecordEvent event) {
UserSimulationRecord record = event.getRecord(); UserSimulationRecord record = event.getRecord();
CgyStatsBO cgyStatsBO = functionStatsMap.get(record.getFunctionId()); CgyStatsBO cgyStatsBO = functionStatsMap.get(record.getFunctionId());
cgyStatsBO.getVisitor().incrementAndGet(); if (Objects.nonNull(cgyStatsBO)) {
cgyStatsBO.getUserSet().add(record.getUserId()); cgyStatsBO.getVisitor().incrementAndGet();
cgyStatsBO.getDuration().addAndGet(record.getDuration()); cgyStatsBO.getUserSet().add(record.getUserId());
cgyStatsBO.getChange().set(true); cgyStatsBO.getDuration().addAndGet(record.getDuration());
cgyStatsBO.getChange().set(true);
}
} }
/** /**

View File

@ -380,9 +380,7 @@ public class Training2PublishService {
if (reqVO.getType() != null) { if (reqVO.getType() != null) {
or.andTypeEqualTo(reqVO.getType().value()); or.andTypeEqualTo(reqVO.getType().value());
} }
// if(reqVO.getOrgId() !=null){ example.setOrderByClause("id desc");
// or.andOrgIdNotEqualTo(reqVO.getOrgId());
// }
List<PublishedTraining2> list = this.publishedDao.selectByExample(example); List<PublishedTraining2> list = this.publishedDao.selectByExample(example);
if (CollectionUtils.isEmpty(list)) { if (CollectionUtils.isEmpty(list)) {
return List.of(); return List.of();

View File

@ -16,8 +16,6 @@ import club.joylink.rtss.simulation.cbtc.GroupSimulationService;
import club.joylink.rtss.simulation.cbtc.Simulation; import club.joylink.rtss.simulation.cbtc.Simulation;
import club.joylink.rtss.simulation.cbtc.SimulationLifeCycleService; import club.joylink.rtss.simulation.cbtc.SimulationLifeCycleService;
import club.joylink.rtss.simulation.cbtc.SimulationService; 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.map.Switch;
import club.joylink.rtss.simulation.cbtc.data.vo.ConversationMessageVO; import club.joylink.rtss.simulation.cbtc.data.vo.ConversationMessageVO;
import club.joylink.rtss.simulation.cbtc.data.vo.Training2MessageVO; import club.joylink.rtss.simulation.cbtc.data.vo.Training2MessageVO;
@ -317,9 +315,12 @@ public class Training2Service {
Map<Long, Float> scoreMap = new HashMap<>(); Map<Long, Float> scoreMap = new HashMap<>();
if (!CollectionUtils.isEmpty(training2.getScoringRules())) { if (!CollectionUtils.isEmpty(training2.getScoringRules())) {
training2.getScoringRules().stream() training2.getScoringRules().stream()
.filter(score -> Objects.equals(score.getMember().getId(), member.getId())) .flatMap(sr -> sr.getDetails().stream())
.findFirst().ifPresent(scoringRule2 -> scoringRule2.getDetails() .forEach(d -> scoreMap.put(d.getStep().getId(), d.getScore()));
.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())));
} }
// 前端传回的步骤信息 // 前端传回的步骤信息
Map<Long, PaperTrainAnswerDetail> answerDetailMap = new HashMap<>(); Map<Long, PaperTrainAnswerDetail> answerDetailMap = new HashMap<>();
@ -327,20 +328,23 @@ public class Training2Service {
scoreDetailList.forEach(d -> answerDetailMap.put(d.getStepId(), d)); scoreDetailList.forEach(d -> answerDetailMap.put(d.getStepId(), d));
} }
return training2.getSteps().stream() return training2.getSteps().stream()
.filter(s -> Objects.equals(s.getSimulationMember().getId(), member.getId())) // .filter(s -> Objects.equals(s.getSimulationMember().getId(), member.getId()))
.map(step -> { .map(step -> {
PaperTrainAnswerDetail detail = new PaperTrainAnswerDetail(); PaperTrainAnswerDetail detail = new PaperTrainAnswerDetail();
detail.setStepId(step.getId()); detail.setStepId(step.getId());
detail.setHaveRule(scoreMap.containsKey(step.getId())); detail.setHaveRule(scoreMap.containsKey(step.getId()));
if (answerDetailMap.containsKey(step.getId())) { detail.setRuleScore(scoreMap.get(step.getId()));
detail.setSuccess(answerDetailMap.get(step.getId()).isSuccess()); 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);
}
detail.setScore( detail.setScore(
detail.isHaveRule() && detail.isSuccess() ? scoreMap.get(step.getId()) : 0F); 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; return detail;
}).collect(Collectors.toList()); }).collect(Collectors.toList());

View File

@ -70,7 +70,7 @@ public class VoiceTrainingService implements IVoiceTrainingService {
byte[] monoData = convertToMonoChannel(fileData); byte[] monoData = convertToMonoChannel(fileData);
VoiceRecognitionResult voiceRecognitionResult = voiceRecognition( VoiceRecognitionResult voiceRecognitionResult = voiceRecognition(
new VoiceRecognitionVO(monoData, contentType)); new VoiceRecognitionVO(monoData, contentType));
boolean match = StrUtils.isMatch(text, voiceRecognitionResult.getResult(), 20); boolean match = StrUtils.isMatch(text, voiceRecognitionResult.getResult(), 70);
return new VoiceVerifyResultVO(voiceRecognitionResult.getResult(), match); return new VoiceVerifyResultVO(voiceRecognitionResult.getResult(), match);
} }

View File

@ -21,6 +21,7 @@ import club.joylink.rtss.vo.client.WebSocketMessageType;
import club.joylink.rtss.vo.client.factory.SocketMessageFactory; import club.joylink.rtss.vo.client.factory.SocketMessageFactory;
import club.joylink.rtss.websocket.StompMessageService; import club.joylink.rtss.websocket.StompMessageService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
@ -33,14 +34,14 @@ import java.util.stream.Collectors;
@Component @Component
public class ATSMessageCollectAndDispatcher { public class ATSMessageCollectAndDispatcher {
@Autowired @Autowired
private Joylink3DMessageService joylink3DMessageService; private Joylink3DMessageService joylink3DMessageService;
@Autowired @Autowired
private StompMessageService stompMessageService; private StompMessageService stompMessageService;
@Autowired @Autowired
private ApplicationContext applicationContext; private ApplicationContext applicationContext;
// public void run(Simulation simulation) { // public void run(Simulation simulation) {
//// long start = System.currentTimeMillis(); //// long start = System.currentTimeMillis();
@ -62,222 +63,223 @@ public class ATSMessageCollectAndDispatcher {
//// System.out.println(String.format("收集并发送设备状态用时: [%s ms]", (end - start))); //// System.out.println(String.format("收集并发送设备状态用时: [%s ms]", (end - start)));
// } // }
/** /**
* 收集仿真所有设备状态并发送给仿真用户 * 收集仿真所有设备状态并发送给仿真用户
*/ */
public void collectAllAndSend(Simulation simulation) { public void collectAllAndSend(Simulation simulation) {
List<DeviceStatusVO> deviceStatuses = collectAll(simulation); List<DeviceStatusVO> deviceStatuses = collectAll(simulation);
// 构建并发送设备状态消息 // 构建并发送设备状态消息
SocketMessageVO<List<DeviceStatusVO>> deviceStatusMessage = SocketMessageVO<List<DeviceStatusVO>> deviceStatusMessage =
SocketMessageFactory.buildSimulationDeviceStatusesMessage(simulation.getId(), deviceStatuses); SocketMessageFactory.buildSimulationDeviceStatusesMessage(simulation.getId(), deviceStatuses);
Set<String> sessions = simulation.getSimulationUserIds(); Set<String> sessions = simulation.getSimulationUserIds();
stompMessageService.sendToUser(sessions, deviceStatusMessage); stompMessageService.sendToUser(sessions, deviceStatusMessage);
} }
/** /**
* 收集仿真所有设备状态 * 收集仿真所有设备状态
*/ */
public List<DeviceStatusVO> collectAll(Simulation simulation) { public List<DeviceStatusVO> collectAll(Simulation simulation) {
List<DeviceStatusVO> totalList = new ArrayList<>(); List<DeviceStatusVO> totalList = new ArrayList<>();
SimulationDataRepository repository = simulation.getRepository(); SimulationDataRepository repository = simulation.getRepository();
Map<String, ? extends MapElement> deviceMap = repository.getDeviceMap(); Map<String, ? extends MapElement> deviceMap = repository.getDeviceMap();
deviceMap.values().forEach(device -> { deviceMap.values().forEach(device -> {
DeviceStatus deviceStatus = repository.findStatusByCode(device.getCode()); DeviceStatus deviceStatus = repository.findStatusByCode(device.getCode());
if (Objects.isNull(deviceStatus)) { if (Objects.isNull(deviceStatus)) {
deviceStatus = buildDeviceStatus(device); deviceStatus = buildDeviceStatus(device);
if (Objects.nonNull(deviceStatus)) { if (Objects.nonNull(deviceStatus)) {
repository.addDeviceInfo(deviceStatus); repository.addDeviceInfo(deviceStatus);
totalList.add(deviceStatus.convert2VO(device)); totalList.add(deviceStatus.convert2VO(device));
} }
} else { } else {
DeviceStatusVO statusVO = buildDeviceStatusVO(device); DeviceStatusVO statusVO = buildDeviceStatusVO(device);
if (deviceStatus.compareAndChange(device, statusVO)) { if (deviceStatus.compareAndChange(device, statusVO)) {
totalList.add(statusVO); totalList.add(statusVO);
} }
} }
}); });
// 列车状态 // 列车状态
List<TrainInfo> trainList = repository.getSuperviseTrainList(); List<TrainInfo> trainList = repository.getSuperviseTrainList();
trainList.forEach(train -> { trainList.forEach(train -> {
TrainStatus trainStatus = repository.findStatusByCode(train.getGroupNumber(), TrainStatus.class); TrainStatus trainStatus = repository.findStatusByCode(train.getGroupNumber(), TrainStatus.class);
if (Objects.isNull(trainStatus)) { if (Objects.isNull(trainStatus)) {
// if(simulation.getBuildParams().getProdType() == MapPrdTypeEnum.YJDDZH){ // if(simulation.getBuildParams().getProdType() == MapPrdTypeEnum.YJDDZH){
if(Objects.equals(simulation.getProject(),MapPrdTypeEnum.YJDDZH.name())){ if (Objects.equals(simulation.getProject(), MapPrdTypeEnum.YJDDZH.name())) {
trainStatus = new YJDDZHTrainStatus(train); trainStatus = new YJDDZHTrainStatus(train);
}else{ } else {
trainStatus = new TrainStatus(train); trainStatus = new TrainStatus(train);
} }
repository.addDeviceInfo(trainStatus); repository.addDeviceInfo(trainStatus);
totalList.add(trainStatus.convert2VO(train)); totalList.add(trainStatus.convert2VO(train));
} else { } else {
DeviceStatusVO statusVO; DeviceStatusVO statusVO;
// if(simulation.getBuildParams().getProdType() == MapPrdTypeEnum.YJDDZH){ // if(simulation.getBuildParams().getProdType() == MapPrdTypeEnum.YJDDZH){
if(Objects.equals(simulation.getProject(),MapPrdTypeEnum.YJDDZH.name())){ if (Objects.equals(simulation.getProject(), MapPrdTypeEnum.YJDDZH.name())) {
statusVO = new YJDDZHTrainStatusVO(train); statusVO = new YJDDZHTrainStatusVO(train);
}else{ } else {
statusVO = new TrainStatusVO(train); // statusVO = new TrainStatusVO(train);
} statusVO = new TrainStatusVO(trainStatus);
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());
}
}
} }
joylink3DMessageService.handleTrainInbound(simulation, inboundTrainList); if (trainStatus.compareAndChange(train, statusVO)) {
return totalList; totalList.add(statusVO);
}
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;
} }
return status; }
} });
// 回库删除的列车状态
private DeviceStatusVO buildDeviceStatusVO(MapElement device) { List<TrainStatus> inboundTrainList = new ArrayList<>();
DeviceStatusVO status = null; List<TrainStatus> trainStatusList = repository.getTrainStatusList();
switch (device.getDeviceType()) { if (!CollectionUtils.isEmpty(trainStatusList)) {
case SECTION: for (TrainStatus trainStatus : trainStatusList) {
status = new SectionStatusVO((Section) device); TrainInfo trainInfo = repository.findSupervisedTrainByGroup(trainStatus.getGroupNumber());
break; if (Objects.isNull(trainInfo)) {
case SWITCH: totalList.add(TrainStatusVO.buildDispose(trainStatus.getGroupNumber()));
status = new SwitchStatusVO((Switch) device); inboundTrainList.add(trainStatus);
break; repository.deleteDeviceStatus(trainStatus.getCode());
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()) {
public void sendTrainRunData(Simulation simulation, RealRun realRun) { case SECTION:
stompMessageService.sendToUser(simulation.getSimulationUserIds(), status = new SectionStatus((Section) device);
SocketMessageFactory.build(WebSocketMessageType.Simulation_RunFact, break;
simulation.getId(), Arrays.asList(realRun))); 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 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;
}
/** private DeviceStatusVO buildDeviceStatusVO(MapElement device) {
* 同步仿真系统时间给客户端 DeviceStatusVO status = null;
*/ switch (device.getDeviceType()) {
public void syncTime(Simulation simulation) { case SECTION:
Set<String> sessions = simulation.getSimulationUserIds(); status = new SectionStatusVO((Section) device);
SocketMessageVO<Long> timeSyncMessage = SocketMessageFactory.buildSimulationTimeSyncMessage(simulation); break;
stompMessageService.sendToUser(sessions, timeSyncMessage); 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;
public void addJobs(Simulation simulation) { case STATION_DIRECTION:
simulation.addJob(SimulationModule.SYNC_TIME.name(), () -> syncTime(simulation), SimulationConstants.SYNC_TIME_RATE); status = new StationDirectionStatusVO((StationDirection) device);
simulation.addFixedRateJob(SimulationModule.MESSAGE.name(), () -> collectAllAndSend(simulation), SimulationConstants.SEND_CLIENT_RATE); break;
} }
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;
}
if (CollectionUtils.isEmpty(humanMembers)) {
//目标都是机器人选择一个机器人发送事件处理
applicationContext.publishEvent(new SimulationOperationMessageEvent(this, simulation, operationMessage));
return;
}
//目标成员有真人推送对应真人处理
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);
}
} }

View File

@ -413,6 +413,10 @@ public class CiApiServiceImpl2 implements CiApiService {
throw BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.exception( throw BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.exception(
"signalCode和routeCode不能都为空"); "signalCode和routeCode不能都为空");
} }
//开启联锁自动进路的信号机不能办理引导进路需先解除自动进路成都三操作文档
if (signal.getRouteList().stream().anyMatch(Route::isFleetMode)) {
throw BusinessExceptionAssertEnum.OPERATION_FAIL.exception("需先解除自动进路状态");
}
if (route == null && signal.getRouteList().stream().anyMatch(Route::isAnySwitchMasterLock)) { if (route == null && signal.getRouteList().stream().anyMatch(Route::isAnySwitchMasterLock)) {
openGuideAspect4GuideMasterLock(simulation, signal); openGuideAspect4GuideMasterLock(simulation, signal);

View File

@ -113,7 +113,7 @@ public class CiRouteService {
// return new Route.CheckFailMessage(Route.CheckFailReason.SectionFaultOccupied, section); // return new Route.CheckFailMessage(Route.CheckFailReason.SectionFaultOccupied, section);
// } // }
} }
if (!start.isCbtcMode()) { if (!start.isCbtcMode() && !guide) {
// 后备办理检查 // 后备办理检查
// 区段占用 // 区段占用
for (Section section : sectionList) { for (Section section : sectionList) {
@ -584,9 +584,13 @@ public class CiRouteService {
route.setLock(false); route.setLock(false);
} }
} }
section.faultUnlock(); if (section.isSwitchTrack()) {
if (section.isShowLogic()) { switchFaultUnlock(simulation, section.getRelSwitch(), route);
section.getLogicList().forEach(Section::faultUnlock); } else {
section.faultUnlock();
if (section.isShowLogic()) {
section.getLogicList().forEach(Section::faultUnlock);
}
} }
} }

View File

@ -0,0 +1,43 @@
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);
}
}

View File

@ -64,7 +64,7 @@ public class CgySignalServiceImpl implements RealDeviceService {
plcGatewayService.writeSingleCoil(baseAddr, configVO.getW_zxj(), true, channel); plcGatewayService.writeSingleCoil(baseAddr, configVO.getW_zxj(), true, channel);
break; break;
case Y: case Y:
plcGatewayService.writeSingleCoil(baseAddr, configVO.getW_ddj(), false, channel); plcGatewayService.writeSingleCoil(baseAddr, configVO.getW_ddj(), true, channel);
plcGatewayService.writeSingleCoil(baseAddr, configVO.getW_lxj(), true, channel); plcGatewayService.writeSingleCoil(baseAddr, configVO.getW_lxj(), true, channel);
plcGatewayService.writeSingleCoil(baseAddr, configVO.getW_yxj(), false, channel); plcGatewayService.writeSingleCoil(baseAddr, configVO.getW_yxj(), false, channel);
plcGatewayService.writeSingleCoil(baseAddr, configVO.getW_zxj(), false, channel); plcGatewayService.writeSingleCoil(baseAddr, configVO.getW_zxj(), false, channel);
@ -139,7 +139,8 @@ public class CgySignalServiceImpl implements RealDeviceService {
break; break;
case G: case G:
plcGatewayService.checkEqualAndWriteSingleCoil(baseAddr, configVO.getW_ddj(), w_ddj, plcGatewayService.checkEqualAndWriteSingleCoil(baseAddr, configVO.getW_ddj(), w_ddj,
false, channel); false,
channel);
plcGatewayService.checkEqualAndWriteSingleCoil(baseAddr, configVO.getW_lxj(), w_lxj, true, plcGatewayService.checkEqualAndWriteSingleCoil(baseAddr, configVO.getW_lxj(), w_lxj, true,
channel); channel);
plcGatewayService.checkEqualAndWriteSingleCoil(baseAddr, configVO.getW_yxj(), w_yxj, plcGatewayService.checkEqualAndWriteSingleCoil(baseAddr, configVO.getW_yxj(), w_yxj,

View File

@ -7,18 +7,17 @@ import club.joylink.rtss.vo.client.org.OrgVO;
import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
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.io.Serializable;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.List; 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;
/** /**
* 账户对象 * 账户对象
@ -28,307 +27,316 @@ import java.util.List;
@Setter @Setter
@EqualsAndHashCode @EqualsAndHashCode
public class AccountVO implements Serializable { 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 Long orgId; 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"; // 第三方企业子账户
/** /**
* 真实姓名 * 账号所属的组织是账号表里的字段
*/ */
@NotBlank(message = "姓名不能为空") private Long orgId;
private String name;
/** /**
* 昵称 * 真实姓名
*/ */
@NotBlank(message = "昵称不能为空") @NotBlank(message = "姓名不能为空")
private String nickname; private String name;
/** /**
* 头像资源地址 * 昵称
*/ */
private String avatarPath; @NotBlank(message = "昵称不能为空")
private String nickname;
/** /**
* 手机号 * 头像资源地址
*/ */
@NotBlank(message = "手机号码不能为空") private String avatarPath;
private String mobile;
/** /**
* 国家码 * 手机号
*/ */
private String nationcode; @NotBlank(message = "手机号码不能为空")
private String mobile;
private String password; /**
* 国家码
*/
private String nationcode;
/** private String password;
* 微信openId
*/
@NotBlank(message = "微信OPENID不能为空")
private String wxId;
/** /**
* 微信unionId * 微信openId
*/ */
private String wxUnionId; @NotBlank(message = "微信OPENID不能为空")
private String wxId;
/** /**
* 微信小程序openId * 微信unionId
*/ */
private String wmOpenId; private String wxUnionId;
/** /**
* 数据库的roles字段 * 微信小程序openId
*/ */
@JsonIgnore private String wmOpenId;
private String dbRoles;
/** /**
* 角色 * 数据库的roles字段
*/ */
private List<String> roles; @JsonIgnore
private String dbRoles;
/** /**
* 账号来源最初的目的是给cgy做注册人数变化曲线 * 角色
*/ */
private String source; private List<String> roles;
/** /**
* email邮箱 * 账号来源最初的目的是给cgy做注册人数变化曲线
*/ */
private String email; private String source;
/** /**
* 状态1-可用 * email邮箱
*/ */
private String status; private String email;
/** /**
* 创建时间 * 状态1-可用
*/ */
private LocalDateTime createTime; private String status;
//单位信息 /**
private Long companyId; * 创建时间
*/
private LocalDateTime createTime;
private String companyName; /**
private Boolean companyAdmin; * 更新时间
/** */
* 用户所属组织关联的项目 private LocalDateTime updateTime;
*/
private List<String> projectCodes; //单位信息
private Long companyId;
private String companyName;
private Boolean companyAdmin;
/**
* 用户所属组织关联的项目
*/
private List<String> projectCodes;
public AccountVO() { 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[]{}));
} }
return null;
}
public AccountVO(SysAccount account) { public void setRolesByString(String roles) {
this.id = account.getId(); if (StringUtils.hasText(roles)) {
this.account = account.getAccount(); String[] splits = roles.split(",");
this.parentAccount = account.getParentAccount(); this.roles = new ArrayList<>();
this.type = account.getType(); Collections.addAll(this.roles, splits);
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 static AccountVO system() { 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 -> {
AccountVO accountVO = new AccountVO(); AccountVO accountVO = new AccountVO();
accountVO.setId(0L); accountVO.setId(account.getId());
accountVO.setName("系统"); accountVO.setName(account.getName());
return accountVO; accountVO.setNickname(account.getNickname());
accountVO.setMobile(account.getMobile());
voList.add(accountVO);
});
} }
return voList;
}
public static SysAccount fromVO(AccountVO accountVo) { public static List<SysAccount> convert2UnionIdInfoVOs(List<AccountVO> voList) {
SysAccount account = new SysAccount(); List<SysAccount> list = new ArrayList<>();
account.setId(accountVo.getId()); if (!CollectionUtils.isEmpty(voList)) {
account.setName(accountVo.getName()); voList.forEach(userVO -> {
account.setNickname(accountVo.getNickname()); if (StringUtils.hasText(userVO.getWxUnionId())) {
account.setNationcode(accountVo.getNationcode()); SysAccount account = new SysAccount();
account.setMobile(accountVo.getMobile()); account.setId(userVO.getId());
account.setWxId(accountVo.getWxId()); account.setWxUnionId(userVO.getWxUnionId());
account.setWxUnionId(accountVo.getWxUnionId()); list.add(account);
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;
}
public void setRolesByString(String roles) { /**
if (StringUtils.hasText(roles)) { * 是否管理员
String[] splits = roles.split(","); *
this.roles = new ArrayList<>(); * @return
Collections.addAll(this.roles, splits); */
} @JsonIgnore
} public boolean isAdmin() {
return !CollectionUtils.isEmpty(this.roles)
&& (this.roles.contains(BusinessConsts.ROLE_04) || this.roles.contains(
BusinessConsts.ROLE_05));
}
public void setRolesByString() { /**
if (StringUtils.hasText(dbRoles)) { * 是否超级管理员
String[] splits = dbRoles.split(","); *
this.roles = new ArrayList<>(); * @return
Collections.addAll(this.roles, splits); */
} @JsonIgnore
} public boolean isSuperAdmin() {
return !CollectionUtils.isEmpty(this.roles)
&& (this.roles.contains(BusinessConsts.ROLE_05));
}
@Override public void filter4Client() {
public String toString() { this.password = null;
return "UserVO [id=" + id + ", name=" + name + ", nickname=" + nickname + ", mobile=" + mobile + ", email=" + email + ", nationcode=" this.wxUnionId = null;
+ nationcode + ", wxId=" + wxId + "]"; this.wxId = null;
} this.wmOpenId = null;
this.createTime = null;
}
public static List<AccountVO> convertFromDB(List<SysAccount> list) { public void forClient() {
List<AccountVO> voList = new ArrayList<>(); if (StringUtils.hasText(dbRoles)) {
if (!CollectionUtils.isEmpty(list)) { this.roles = List.of(dbRoles.split(","));
list.forEach(account -> voList.add(new AccountVO(account)));
}
return voList;
} }
}
public static List<AccountVO> convert2BaseInfoVO(List<SysAccount> list) { public void setOrgInfo(Org org, Boolean companyAdmin, List<String> projectCodes) {
List<AccountVO> voList = new ArrayList<>(); this.companyId = org.getId();
if (!CollectionUtils.isEmpty(list)) { this.companyName = org.getName();
list.forEach(account -> { this.companyAdmin = companyAdmin;
AccountVO accountVO = new AccountVO(); this.projectCodes = projectCodes;
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) { public void copyOrgInfo(AccountVO accountVO) {
List<SysAccount> list = new ArrayList<>(); if (accountVO != null) {
if (!CollectionUtils.isEmpty(voList)) { this.companyId = accountVO.getCompanyId();
voList.forEach(userVO -> { this.companyName = accountVO.getCompanyName();
if (StringUtils.hasText(userVO.getWxUnionId())) { this.companyAdmin = accountVO.getCompanyAdmin();
SysAccount account = new SysAccount(); this.projectCodes = accountVO.getProjectCodes();
account.setId(userVO.getId());
account.setWxUnionId(userVO.getWxUnionId());
list.add(account);
}
});
}
return list;
} }
}
/** @JsonIgnore
* 是否管理员 public boolean isThirdChildAccount() {
* return Type_3.equalsIgnoreCase(this.type) && StringUtils.hasText(this.parentAccount);
* @return }
*/
@JsonIgnore
public boolean isAdmin() {
return !CollectionUtils.isEmpty(this.roles)
&& (this.roles.contains(BusinessConsts.ROLE_04) || this.roles.contains(BusinessConsts.ROLE_05));
}
/** public void setOrgProjectVO(OrgVO orgVO, boolean orgAdmin) {
* 是否超级管理员 if (orgVO != null) {
* this.companyId = orgVO.getId();
* @return this.companyName = orgVO.getName();
*/ this.companyAdmin = orgAdmin;
@JsonIgnore this.projectCodes = orgVO.getProjectCodes();
public boolean isSuperAdmin() { } else {
return !CollectionUtils.isEmpty(this.roles) this.companyId = null;
&& (this.roles.contains(BusinessConsts.ROLE_05)); this.companyName = null;
} this.companyAdmin = false;
this.projectCodes = List.of();
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();
}
} }
}
} }

View File

@ -1,140 +1,145 @@
package club.joylink.rtss.vo.map; package club.joylink.rtss.vo.map;
import lombok.Getter;
import lombok.Setter;
import java.util.HashSet; import java.util.HashSet;
import java.util.Set; import java.util.Set;
import lombok.Getter;
import lombok.Setter;
@Getter @Getter
@Setter @Setter
public class MapCiGenerateConfig { public class MapCiGenerateConfig {
//--------------------联锁数据生成配置start------------------- //--------------------联锁数据生成配置start-------------------
/** /**
*是否类似哈尔滨一号线联锁分为ATP信号地面信号引导信号 * 是否类似哈尔滨一号线联锁分为ATP信号地面信号引导信号
*/ */
private boolean likeHa1; private boolean likeHa1;
/** /**
*是否生成侧防true-生成侧防不要联动道岔false-不生成侧防用联动道岔 * 是否生成侧防true-生成侧防不要联动道岔false-不生成侧防用联动道岔
*/ */
private boolean generateFls; 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-使用终端信号机命名 * 进路名称使用终端信号机同区段反向信号机名称命名true-使用反向如果存在的话false-使用终端信号机命名
*/ */
private boolean routeNameUseEndOppositeSignalName; private boolean routeNameUseEndOppositeSignalName;
/** /**
*是否生成折返进路 * 是否生成折返进路
*/ */
private boolean generateTbRoute; private boolean generateTbRoute;
/** /**
*折返进路名称使用终端信号机反向信号机名称 * 折返进路名称使用终端信号机反向信号机名称并且终端按钮亦使用反向信号机-成都三联锁
*/ */
private boolean tbRouteNameUseEndOppositeSignalName; private boolean tbRouteNameUseEndOppositeSignalName;
/** /**
*进路始端防护信号机是否总是绿灯true-总是开绿灯false-根据进路中有无反位道岔生成绿灯或黄灯 * 进路始端防护信号机是否总是绿灯true-总是开绿灯false-根据进路中有无反位道岔生成绿灯或黄灯
*/ */
private boolean routeSignalAlwaysGreen; private boolean routeSignalAlwaysGreen;
/** /**
*多个延续保护路径生成多条进路:true-生成多条进路false-生成一条进路 * 多个延续保护路径生成多条进路:true-生成多条进路false-生成一条进路
*/ */
private boolean routeApartByOverlap; private boolean routeApartByOverlap;
/** /**
*延续保护是否只构建道岔 * 延续保护是否只构建道岔
*/ */
private boolean overlapOnlySwitch; private boolean overlapOnlySwitch;
// //
// @ApiModelProperty(value = "延续保护构建是否只考虑一个道岔计轴") // @ApiModelProperty(value = "延续保护构建是否只考虑一个道岔计轴")
// private boolean overlapOnlyOneSwitch; // 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-随进路建立 * 延续保护的建立方式true-通过触发建立false-随进路建立
*/ */
private boolean overlapSettingByTrigger; 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联锁和地面信号联锁") // @ApiModelProperty(value = "是否分开生成ATP联锁和地面信号联锁")
// private boolean apartGroundAndAtp; // private boolean apartGroundAndAtp;
/** 是否处理停车场/车辆段逻辑 */ /**
private boolean handleDepot; * 是否处理停车场/车辆段逻辑
*/
private boolean handleDepot;
/** /**
* 是大铁线路 * 是大铁线路
*/ */
private boolean railway; private boolean railway;
//--------------------联锁数据生成配置end------------------- //--------------------联锁数据生成配置end-------------------
} }

View File

@ -1,48 +1,46 @@
package club.joylink.rtss.vo.paper; package club.joylink.rtss.vo.paper;
import club.joylink.rtss.vo.client.training2.Operation2VO; import club.joylink.rtss.vo.client.training2.Operation2VO;
import java.util.List;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import java.util.List;
@Data @Data
@NoArgsConstructor @NoArgsConstructor
public class PaperTrainAnswerDetail { public class PaperTrainAnswerDetail {
/** /**
* 实训步骤id * 实训步骤id
*/ */
private Long stepId; 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; private boolean notExistAppend;
/** /**
* 客户端操作的实训,对应的id必须要传 * 客户端操作的实训,对应的id必须要传
*/ */
private List<TrainOperations> clientOperations; private List<TrainOperations> clientOperations;
public static class TrainOperations extends Operation2VO.ClientOperation2VO {
public static class TrainOperations extends Operation2VO.ClientOperation2VO{ }
}
} }