diff --git a/sql/20220914-zhouyin.sql b/sql/20220914-zhouyin.sql new file mode 100644 index 000000000..0ea04f082 --- /dev/null +++ b/sql/20220914-zhouyin.sql @@ -0,0 +1,2 @@ +-- 武汉8号线添加第三方账号 +INSERT INTO `joylink`.`sys_account` ( `account`, `parent_account`, `type`, `org_id`, `name`, `nickname`, `avatar_path`, `password`, `mobile`, `nationcode`, `email`, `wx_id`, `wx_union_id`, `wm_open_id`, `status`, `roles`, `source`, `create_time`, `update_user_id`, `update_time`) VALUES ('yjddzh_train_place', NULL, '2', NULL, NULL, '武汉8号线_train_place', NULL, 'train_place', 'train_place', NULL, 'yjddzh@tests.com', NULL, NULL, NULL, '1', '01', NULL, '2022-09-14 10:00:14', NULL, NULL); diff --git a/src/main/java/club/joylink/rtss/constants/MapPrdTypeEnum.java b/src/main/java/club/joylink/rtss/constants/MapPrdTypeEnum.java index b5f2b4b42..9b47f383e 100644 --- a/src/main/java/club/joylink/rtss/constants/MapPrdTypeEnum.java +++ b/src/main/java/club/joylink/rtss/constants/MapPrdTypeEnum.java @@ -13,7 +13,7 @@ public enum MapPrdTypeEnum { BIG_SCREEN("07", "大屏工作站", null), RUN_PLAN_MAKE("08", "运行图编制工作站", null), DEPOT_IL("09", "车辆段联锁工作站", null), - BIG_SCREEN_TRAIN_POSITION("10", "大屏车辆真实工作站", null), + YJDDZH("10", "应急调度指挥系统", null), // CTC("10", "CTC工作站") ; diff --git a/src/main/java/club/joylink/rtss/constants/Project.java b/src/main/java/club/joylink/rtss/constants/Project.java index 34319eb25..a26e82c2f 100644 --- a/src/main/java/club/joylink/rtss/constants/Project.java +++ b/src/main/java/club/joylink/rtss/constants/Project.java @@ -61,7 +61,9 @@ public enum Project { /** 哈盈达-铁路 */ HYD_RAILWAY, /** 武汉8号线 */ - WH +// WH, + /** 武汉8号线 应急调度指挥系统*/ + YJDDZH ; public static boolean isDefault(Project project) { diff --git a/src/main/java/club/joylink/rtss/constants/ProjectDeviceType.java b/src/main/java/club/joylink/rtss/constants/ProjectDeviceType.java index f23ac2f96..09d317d9f 100644 --- a/src/main/java/club/joylink/rtss/constants/ProjectDeviceType.java +++ b/src/main/java/club/joylink/rtss/constants/ProjectDeviceType.java @@ -67,6 +67,9 @@ public enum ProjectDeviceType { SANDBOX, /** 派班工作站 */ SCHEDULING, + + PIS_STAND, + PIS_TRAIN, /* -----------client device end---------- */ ; diff --git a/src/main/java/club/joylink/rtss/controller/MapDataHandleController.java b/src/main/java/club/joylink/rtss/controller/MapDataHandleController.java index edf332143..b0be90cdd 100644 --- a/src/main/java/club/joylink/rtss/controller/MapDataHandleController.java +++ b/src/main/java/club/joylink/rtss/controller/MapDataHandleController.java @@ -4,9 +4,9 @@ import club.joylink.rtss.services.draftData.DraftMapDataHandleService; import club.joylink.rtss.services.publishData.PublishMapDataHandler; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; + +import java.util.LinkedHashMap; /** * 地图数据处理 @@ -35,4 +35,12 @@ public class MapDataHandleController { public void signalShowDirection() { this.publishMapDataHandler.signalShowDirection(); } + + /** + * 批量修改线路数据和ISCS的车站名 + */ + @PutMapping("/{mapId}/stationName/mapAndIscs") + public void changeStationName(@PathVariable long mapId, @RequestBody LinkedHashMap nameMap) { + this.publishMapDataHandler.changeStationName(mapId, nameMap); + } } diff --git a/src/main/java/club/joylink/rtss/controller/audio/AudioResourcesController.java b/src/main/java/club/joylink/rtss/controller/audio/AudioResourcesController.java index 6155c0f5d..11439a47f 100644 --- a/src/main/java/club/joylink/rtss/controller/audio/AudioResourcesController.java +++ b/src/main/java/club/joylink/rtss/controller/audio/AudioResourcesController.java @@ -23,10 +23,18 @@ public class AudioResourcesController { * 创建 */ @PostMapping() - public void create(@RequestBody @Validated AudioResourcesVO vo) { + public void create(@RequestBody @Validated(value = AudioResourcesVO.Create.class) AudioResourcesVO vo) { audioResourcesService.create(vo); } + /** + * 生成资源 + */ + @PostMapping("/generate") + public void generate(@RequestBody @Validated(value = AudioResourcesVO.Generate.class) AudioResourcesVO vo) { + audioResourcesService.generate(vo); + } + /** * 查询所有 */ diff --git a/src/main/java/club/joylink/rtss/controller/competition/question/QuestionBankController2.java b/src/main/java/club/joylink/rtss/controller/competition/question/QuestionBankController2.java new file mode 100644 index 000000000..72783c245 --- /dev/null +++ b/src/main/java/club/joylink/rtss/controller/competition/question/QuestionBankController2.java @@ -0,0 +1,120 @@ +package club.joylink.rtss.controller.competition.question; + + +import club.joylink.rtss.constants.Project; +import club.joylink.rtss.services.completition.question.IQuestionBankService; +import club.joylink.rtss.vo.AccountVO; +import club.joylink.rtss.vo.LoginUserInfoVO; +import club.joylink.rtss.vo.client.PageVO; +import club.joylink.rtss.vo.client.competition.TheoryQuestionCountVO; +import club.joylink.rtss.vo.client.question.QuestionOptionVO; +import club.joylink.rtss.vo.client.question.QuestionQueryVO; +import club.joylink.rtss.vo.client.question.QuestionVO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + + +/** + *题库管理接口 + */ +@RestController +@RequestMapping(path = "/api/questionBank2") +public class QuestionBankController2 { + + @Autowired + private IQuestionBankService iQuestionBankService; + + /** + *分页查询题目 + */ + @GetMapping(path = "/questions/paging") + public PageVO pagingQueryQuestions(@RequestAttribute LoginUserInfoVO loginInfo, QuestionQueryVO queryVO) { + queryVO.setProjectCode(loginInfo.getProject().name()); + return iQuestionBankService.pagingQueryQuestions(queryVO); + } + + /** + *查询题目列表 + */ + @GetMapping(path = "/questions") + public List queryQuestions(@RequestAttribute LoginUserInfoVO loginInfo,QuestionQueryVO queryVO) { + queryVO.setProjectCode(loginInfo.getProject().name()); + return iQuestionBankService.queryQuestions(queryVO); + } + + /** + *获取题目信息 + */ + @GetMapping(path = "/questions/{questionId}") + public QuestionVO getQuestion(@PathVariable Long questionId) { + return iQuestionBankService.getQuestion(questionId); + } + + /** + *添加题目 + */ + @PostMapping(path = "/questions") + public void addQuestion(@Validated @RequestBody QuestionVO questionVO,@RequestAttribute LoginUserInfoVO loginInfo, + @RequestAttribute AccountVO user) { + questionVO.setProjectCode(loginInfo.getProject().name()); + iQuestionBankService.addQuestion(questionVO, user); + } + + /** + *导入项目或单位试题库 + */ + @PostMapping(path = "/questions/import") + public void importProjectQuestion(@Validated @RequestBody List questions, @RequestAttribute LoginUserInfoVO loginInfo, + @RequestAttribute AccountVO user, @RequestParam(required = false, name = "id") Long companyId) { + + iQuestionBankService.importProjectQuestion(questions, loginInfo.getProject().name(), companyId,user); + } + + /** + *更新题目 + */ + @PutMapping(path = "/questions/{questionId}") + public void updateQuestion(@PathVariable Long questionId, @RequestAttribute LoginUserInfoVO loginInfo,@RequestBody QuestionVO questionVO) { + questionVO.setProjectCode(loginInfo.getProject().name()); + iQuestionBankService.updateQuestion(questionId, questionVO); + } + + /** + *删除题目 + */ + @DeleteMapping(path = "/questions/{questionId}") + public void deleteQuestion(@PathVariable Long questionId) { + iQuestionBankService.deleteQuestion(questionId); + } + + /** + *根据题目查询选项 + */ + @GetMapping(path = "/questions/{questionId}/options") + public List getOptionsByQuestionId(@PathVariable Long questionId) { + return iQuestionBankService.getOptionsByQuestionId(questionId); + } + + /** + *根据题型获取题目数量 + */ + @GetMapping(path = "/number") + public Integer getNumberUnderKnowledgeAndType(@RequestAttribute LoginUserInfoVO loginInfo, String type, Long companyId) { + + return iQuestionBankService.getNumberWithType(type, loginInfo.getProject().name(), companyId); + } + + /** + *获取题型数量 + */ + @GetMapping(path = "/type/number") + public List getNumberUnderKnowledgeAndType(@RequestAttribute LoginUserInfoVO loginInfo, @RequestParam(required = false) Long companyId) { + + String projectCode = Project.isDefault(loginInfo.getProject()) ? null : loginInfo.getProject().name(); + return iQuestionBankService.countNumByType(projectCode, companyId); + } + +} diff --git a/src/main/java/club/joylink/rtss/controller/iscs/IscsSystemResourcesController.java b/src/main/java/club/joylink/rtss/controller/iscs/IscsSystemResourcesController.java index a8056c895..245acd770 100644 --- a/src/main/java/club/joylink/rtss/controller/iscs/IscsSystemResourcesController.java +++ b/src/main/java/club/joylink/rtss/controller/iscs/IscsSystemResourcesController.java @@ -34,6 +34,11 @@ public class IscsSystemResourcesController { iscsSystemResourcesService.batchCreate(vos); } + @PostMapping("/generate/{mapId}/{type}") + public void generate(@PathVariable long mapId, @PathVariable int type) { + iscsSystemResourcesService.generate(mapId, type); + } + /** * 获取所有 */ diff --git a/src/main/java/club/joylink/rtss/controller/user/UserInfoController.java b/src/main/java/club/joylink/rtss/controller/user/UserInfoController.java index 12661af8b..4beb236b5 100644 --- a/src/main/java/club/joylink/rtss/controller/user/UserInfoController.java +++ b/src/main/java/club/joylink/rtss/controller/user/UserInfoController.java @@ -4,13 +4,8 @@ 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.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.client.user.AccountRegisterQueryVO; -import club.joylink.rtss.vo.client.user.AccountRegisterStatisticsVO; import club.joylink.rtss.vo.user.UserRegisterCheck; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.validation.annotation.Validated; @@ -146,4 +141,20 @@ public class UserInfoController { queryVO.setSource(source); return this.iSysUserService.queryPagedUser(queryVO); } + + /** + * 超管重置用户密码 + */ + @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); + } } diff --git a/src/main/java/club/joylink/rtss/services/ISysUserService.java b/src/main/java/club/joylink/rtss/services/ISysUserService.java index c20c5e2b5..565af85d7 100644 --- a/src/main/java/club/joylink/rtss/services/ISysUserService.java +++ b/src/main/java/club/joylink/rtss/services/ISysUserService.java @@ -10,7 +10,6 @@ import club.joylink.rtss.vo.client.PageVO; import club.joylink.rtss.vo.client.org.CompanyVO; import club.joylink.rtss.vo.client.user.*; import club.joylink.rtss.vo.user.AccountCreateVO; -import club.joylink.rtss.vo.client.user.AccountRegisterStatisticsVO; import club.joylink.rtss.vo.wx.WmUserSession; import lombok.NonNull; @@ -325,4 +324,8 @@ public interface ISysUserService { boolean isThirdParentAccountExist(String parentAccount); List findEntitiesBySource(String source); + + void resetPwd(long id); + + void retrievePwd(RetrievePwdVO vo); } diff --git a/src/main/java/club/joylink/rtss/services/SysUserService.java b/src/main/java/club/joylink/rtss/services/SysUserService.java index 5198c5086..2c3c97218 100644 --- a/src/main/java/club/joylink/rtss/services/SysUserService.java +++ b/src/main/java/club/joylink/rtss/services/SysUserService.java @@ -738,7 +738,7 @@ public class SysUserService implements ISysUserService { @Override public String sendMobileValidCode(MobileInfoVO mobileInfoVO) { - BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertTrue(mobileInfoVO.validate()); + BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertTrue(mobileInfoVO.validate(), "发送验证码请求未通过"); String code = RandomGenerator.getByLen(4); long ts = System.currentTimeMillis(); List params = new ArrayList<>(); @@ -757,18 +757,44 @@ public class SysUserService implements ISysUserService { public void updatePassword(Long id, UpdatePasswordVO updatePasswordVO) { Objects.requireNonNull(id, "用户id不能为空"); SysAccount account = this.sysAccountDAO.selectByPrimaryKey(id); + updatePwdByMobileVdCode(updatePasswordVO, account); + } + + private void updatePwdByMobileVdCode(UpdatePasswordVO updatePasswordVO, SysAccount account) { if (Objects.nonNull(account)) { VdCode vdCode = (VdCode) this.iCacheService.get(account.getNationcode() + account.getMobile()); BusinessExceptionAssertEnum.INCORRECT_VERIFICATION_CODE.assertNotNull(vdCode); // 验证验证码 vdCode.isValidCode(updatePasswordVO.getVfCode()); // 验证码通过,修改密码 - account.setPassword(updatePasswordVO.getPassword()); - account.setUpdateTime(LocalDateTime.now()); - this.sysAccountDAO.updateByPrimaryKey(account); + updatePassword4Entity(account, updatePasswordVO.getPassword()); } } + /** + * 通过邮箱验证码更新密码 + * @param account 要更新密码的账号 + * @param userVfCode 用户填写的验证码 + * @param newPwd 新密码 + */ + private void updatePwdByEmailVdCode(SysAccount account, String userVfCode, String newPwd) { + if (Objects.nonNull(account)) { + VdCode vdCode = (VdCode) this.iCacheService.get(account.getEmail()); + BusinessExceptionAssertEnum.INCORRECT_VERIFICATION_CODE.assertNotNull(vdCode); + // 验证验证码 + vdCode.isValidCode(userVfCode); + // 验证码通过,修改密码 + updatePassword4Entity(account, newPwd); + } + } + + private void updatePassword4Entity(SysAccount account, String newPwd) { + BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertHasText(newPwd, "新密码不能为空"); + account.setPassword(newPwd); + account.setUpdateTime(LocalDateTime.now()); + this.sysAccountDAO.updateByPrimaryKey(account); + } + @Override public void updateUserPassword(Long id, String password) { Objects.requireNonNull(id, "用户id不能为空"); @@ -991,6 +1017,55 @@ public class SysUserService implements ISysUserService { return sysAccountDAO.selectByExample(example); } + @Override + public void resetPwd(long id) { + String pwd = EncryptUtil.md5("123456"); + SysAccount account = getEntity(id); + updatePassword4Entity(account, pwd); + } + + @Override + public void retrievePwd(RetrievePwdVO vo) { + if (StringUtils.hasText(vo.getMobile())) { + SysAccount account = getEntityByMobile(vo.getMobile()); + UpdatePasswordVO updatePasswordVO = new UpdatePasswordVO(vo.getVfCode(), vo.getNewPwd()); + updatePwdByMobileVdCode(updatePasswordVO, account); + } else if (StringUtils.hasText(vo.getEmail())) { + SysAccount account = getEntityByEmail(vo.getEmail()); + updatePwdByEmailVdCode(account, vo.getVfCode(), vo.getNewPwd()); + } else { + throw BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.exception("手机号和邮箱不能都为空"); + } + } + + private SysAccount getEntityByMobile(String mobile) { + BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertHasText(mobile); + SysAccountExample example = new SysAccountExample(); + example.createCriteria().andMobileEqualTo(mobile); + List accounts = sysAccountDAO.selectByExample(example); + BusinessExceptionAssertEnum.DATA_NOT_EXIST.assertCollectionNotEmpty(accounts, + String.format("[手机号:%s]的账号不存在", mobile)); + if (accounts.size() != 1) { + log.error("[手机号:%s]的账号有多个"); + throw BusinessExceptionAssertEnum.DATA_ERROR.exception(); + } + return accounts.get(0); + } + + private SysAccount getEntityByEmail(String email) { + BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertHasText(email); + SysAccountExample example = new SysAccountExample(); + example.createCriteria().andEmailEqualTo(email); + List accounts = sysAccountDAO.selectByExample(example); + BusinessExceptionAssertEnum.DATA_NOT_EXIST.assertCollectionNotEmpty(accounts, + String.format("[邮箱:%s]的账号不存在", email)); + if (accounts.size() != 1) { + log.error(String.format("[邮箱:%s]的账号有多个", email)); + throw BusinessExceptionAssertEnum.DATA_ERROR.exception(); + } + return accounts.get(0); + } + private boolean isSameEmailExist(String email) { SysAccountExample example = new SysAccountExample(); example.createCriteria() diff --git a/src/main/java/club/joylink/rtss/services/VirtualRealityIbpService.java b/src/main/java/club/joylink/rtss/services/VirtualRealityIbpService.java index 9f7b33c36..edc6323dd 100644 --- a/src/main/java/club/joylink/rtss/services/VirtualRealityIbpService.java +++ b/src/main/java/club/joylink/rtss/services/VirtualRealityIbpService.java @@ -126,13 +126,15 @@ public class VirtualRealityIbpService implements IVirtualRealityIbpService { break; } case XXYS: { - List czLights = ibp.query(VirtualRealityIbp.Mean.PSD_CZYX_LIGHT, false); - czLights.forEach(light -> light.orderTo(true)); +// List czLights = ibp.query(VirtualRealityIbp.Mean.PSD_CZYX_LIGHT, false); +// czLights.forEach(light -> light.orderTo(true)); + ibp.query(VirtualRealityIbp.Mean.PSD_CZYX_LIGHT, false).orderTo(true); break; } case SXYS: { - List czLights = ibp.query(VirtualRealityIbp.Mean.PSD_CZYX_LIGHT, true); - czLights.forEach(light -> light.orderTo(true)); +// List czLights = ibp.query(VirtualRealityIbp.Mean.PSD_CZYX_LIGHT, true); +// czLights.forEach(light -> light.orderTo(true)); + ibp.query(VirtualRealityIbp.Mean.PSD_CZYX_LIGHT, true).orderTo(true); break; } // case PSD_HSJC: { diff --git a/src/main/java/club/joylink/rtss/services/audio/AudioResourcesService.java b/src/main/java/club/joylink/rtss/services/audio/AudioResourcesService.java index 8c774da6a..6da3625c2 100644 --- a/src/main/java/club/joylink/rtss/services/audio/AudioResourcesService.java +++ b/src/main/java/club/joylink/rtss/services/audio/AudioResourcesService.java @@ -20,4 +20,6 @@ public interface AudioResourcesService { PageVO pagedQuery(AudioResourcesQueryVO queryVO); AudioResourcesVO getById(long id); + + void generate(AudioResourcesVO vo); } diff --git a/src/main/java/club/joylink/rtss/services/audio/AudioResourcesServiceImpl.java b/src/main/java/club/joylink/rtss/services/audio/AudioResourcesServiceImpl.java index 9fca111c3..2fa5ba0fb 100644 --- a/src/main/java/club/joylink/rtss/services/audio/AudioResourcesServiceImpl.java +++ b/src/main/java/club/joylink/rtss/services/audio/AudioResourcesServiceImpl.java @@ -3,12 +3,14 @@ package club.joylink.rtss.services.audio; import club.joylink.rtss.dao.AudioResourcesDAO; import club.joylink.rtss.entity.AudioResources; import club.joylink.rtss.entity.AudioResourcesExample; +import club.joylink.rtss.services.voice.IVoiceService; import club.joylink.rtss.vo.client.PageVO; import club.joylink.rtss.vo.client.audio.AudioResourcesQueryVO; import club.joylink.rtss.vo.client.audio.AudioResourcesVO; import com.github.pagehelper.Page; import com.github.pagehelper.PageHelper; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; import org.springframework.util.StringUtils; @@ -21,6 +23,9 @@ import java.util.List; public class AudioResourcesServiceImpl implements AudioResourcesService { @Autowired private AudioResourcesDAO audioResourcesDAO; + @Autowired + @Qualifier("baiDuVoiceService") + private IVoiceService iVoiceService; @Override public void create(AudioResourcesVO vo) { @@ -82,6 +87,13 @@ public class AudioResourcesServiceImpl implements AudioResourcesService { return new AudioResourcesVO(getEntity(id)); } + @Override + public void generate(AudioResourcesVO vo) { + String filePath = iVoiceService.synthesis(vo.getDesc()); + vo.setUrl(filePath); + create(vo); + } + private AudioResources getEntity(long id) { return audioResourcesDAO.selectByPrimaryKey(id); } diff --git a/src/main/java/club/joylink/rtss/services/auth/AuthenticateService.java b/src/main/java/club/joylink/rtss/services/auth/AuthenticateService.java index d9c94d2ca..6d1c3ada4 100644 --- a/src/main/java/club/joylink/rtss/services/auth/AuthenticateService.java +++ b/src/main/java/club/joylink/rtss/services/auth/AuthenticateService.java @@ -468,6 +468,8 @@ public class AuthenticateService implements IAuthenticateService { case CCTV: case SANDBOX: case ILW: + case PIS_STAND: + case PIS_TRAIN: case VR_IBP: { RelationLoginConfigVO config = deviceVO.buildRelationLoginConfig(); if (Objects.nonNull(config) && Objects.nonNull(config.getDeviceCode())) { diff --git a/src/main/java/club/joylink/rtss/services/completition/question/QuestionBankService.java b/src/main/java/club/joylink/rtss/services/completition/question/QuestionBankService.java index 8de1b1d51..2e9d3c4fc 100644 --- a/src/main/java/club/joylink/rtss/services/completition/question/QuestionBankService.java +++ b/src/main/java/club/joylink/rtss/services/completition/question/QuestionBankService.java @@ -151,13 +151,13 @@ public class QuestionBankService implements IQuestionBankService { @Transactional public void addQuestion(QuestionVO questionVO, AccountVO accountVO) { BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertTrue( - (Objects.equals(BusinessConsts.TheoryType.select, questionVO.getType()) || - Objects.equals(BusinessConsts.TheoryType.judge, questionVO.getType())) && + (Objects.equals(BusinessConsts.TheoryType.select.name(), questionVO.getType()) || + Objects.equals(BusinessConsts.TheoryType.judge.name(), questionVO.getType())) && questionVO.getOptionList().stream().filter(QuestionOptionVO::getCorrect).count() == 1, "单选或判断题正确答案有且只有一个!"); - BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertTrue( - (Objects.equals(BusinessConsts.TheoryType.fill, questionVO.getType()) || - Objects.equals(BusinessConsts.TheoryType.answer, questionVO.getType())) && + BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertNotTrue( + (Objects.equals(BusinessConsts.TheoryType.fill.name(), questionVO.getType()) || + Objects.equals(BusinessConsts.TheoryType.answer.name(), questionVO.getType())) && questionVO.getOptionList().stream().filter(op -> !op.getCorrect()).count() == 0, "填空或问答题不能有错误选项!"); RaceQuestion question = questionVO.convert2DB(); diff --git a/src/main/java/club/joylink/rtss/services/iscs/IscsSystemResourcesService.java b/src/main/java/club/joylink/rtss/services/iscs/IscsSystemResourcesService.java index 221dcbb7e..3cf196f0f 100644 --- a/src/main/java/club/joylink/rtss/services/iscs/IscsSystemResourcesService.java +++ b/src/main/java/club/joylink/rtss/services/iscs/IscsSystemResourcesService.java @@ -22,4 +22,10 @@ public interface IscsSystemResourcesService { List criteriaQuery(IscsSystemResourcesQueryVO queryVO); void batchCreate(List vos); + + /** + * 生成Iscs资源。 + * @param type 要生成的资源的类型,详见方法体内的注释 + */ + void generate(long mapId, int type); } diff --git a/src/main/java/club/joylink/rtss/services/iscs/IscsSystemResourcesServiceImpl.java b/src/main/java/club/joylink/rtss/services/iscs/IscsSystemResourcesServiceImpl.java index b706a218c..fee70bdef 100644 --- a/src/main/java/club/joylink/rtss/services/iscs/IscsSystemResourcesServiceImpl.java +++ b/src/main/java/club/joylink/rtss/services/iscs/IscsSystemResourcesServiceImpl.java @@ -4,11 +4,14 @@ import club.joylink.rtss.dao.IscsSystemResourcesDAO; import club.joylink.rtss.entity.IscsSystemResources; import club.joylink.rtss.entity.IscsSystemResourcesExample; import club.joylink.rtss.exception.BusinessExceptionAssertEnum; +import club.joylink.rtss.services.IMapService; import club.joylink.rtss.services.audio.AudioResourcesService; import club.joylink.rtss.vo.client.PageVO; import club.joylink.rtss.vo.client.audio.AudioResourcesVO; import club.joylink.rtss.vo.client.iscs.systemRes.IscsSystemResourcesQueryVO; import club.joylink.rtss.vo.client.iscs.systemRes.IscsSystemResourcesVO; +import club.joylink.rtss.vo.map.MapVO; +import club.joylink.rtss.vo.map.graph.MapStationNewVO; import com.github.pagehelper.Page; import com.github.pagehelper.PageHelper; import org.springframework.beans.factory.annotation.Autowired; @@ -22,9 +25,10 @@ import java.util.List; public class IscsSystemResourcesServiceImpl implements IscsSystemResourcesService { @Autowired private IscsSystemResourcesDAO iscsSystemResourcesDAO; - @Autowired private AudioResourcesService audioResourcesService; + @Autowired + private IMapService iMapService; @Override public void create(IscsSystemResourcesVO vo) { @@ -106,6 +110,13 @@ public class IscsSystemResourcesServiceImpl implements IscsSystemResourcesServic } } + @Override + public void generate(long mapId, int type) { + MapVO mapDetail = iMapService.getMapDetail(mapId); + List stationList = mapDetail.getGraphDataNew().getStationList(); + + } + private IscsSystemResources findEntityById(long id) { return iscsSystemResourcesDAO.selectByPrimaryKey(id); } diff --git a/src/main/java/club/joylink/rtss/services/iscs/interactive/IscsInteractiveService.java b/src/main/java/club/joylink/rtss/services/iscs/interactive/IscsInteractiveService.java index f31d19a6e..6b787551c 100644 --- a/src/main/java/club/joylink/rtss/services/iscs/interactive/IscsInteractiveService.java +++ b/src/main/java/club/joylink/rtss/services/iscs/interactive/IscsInteractiveService.java @@ -5,7 +5,7 @@ import club.joylink.rtss.services.audio.AudioResourcesService; import club.joylink.rtss.services.voice.IVoiceService; import club.joylink.rtss.simulation.cbtc.Simulation; import club.joylink.rtss.simulation.cbtc.data.SimulationDataRepository; -import club.joylink.rtss.simulation.cbtc.data.map.Audio; +import club.joylink.rtss.simulation.cbtc.data.iscs.Audio; import club.joylink.rtss.simulation.cbtc.data.map.MapElement; import club.joylink.rtss.simulation.cbtc.data.vr.VirtualRealityAudio; import club.joylink.rtss.simulation.cbtc.member.SimulationMember; @@ -18,6 +18,9 @@ import org.springframework.stereotype.Component; import java.util.List; +/** + * ISCS交互服务 + */ @Component public class IscsInteractiveService { @Autowired @@ -27,7 +30,7 @@ public class IscsInteractiveService { @Qualifier("baiDuVoiceService") private IVoiceService iVoiceService; - public void play(Simulation simulation, PlayParamVO param, SimulationMember member) { + public void paPlay(Simulation simulation, PlayParamVO param, SimulationMember member) { BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED.assertTrue(member != null && (member.isDispatcher() || member.isStationSupervisor()), "仅行调和行值可操作"); BusinessExceptionAssertEnum.SYSTEM_EXCEPTION.assertNotNull(param.getResourceId(), "资源id不能为null"); @@ -47,6 +50,26 @@ public class IscsInteractiveService { } } + /** + * 信号系统自动通过PA系统播放 + */ + public void paPlayBySystem(Simulation simulation, List iscsDeviceCodes, + AudioResourcesVO audioResourcesVO, String state) { + SimulationDataRepository repository = simulation.getRepository(); + for (String code : iscsDeviceCodes) { + MapElement element = repository.getByCode(code); + if (element instanceof Audio) { + Audio audio = (Audio) element; + audio.updateResource(audioResourcesVO); + audio.updateState(state); + audio.updateRemain(Audio.DEFAULT_REMAIN); + VirtualRealityAudio vrAudio = audio.getVrAudio(); + vrAudio.updateUrl(audioResourcesVO.getUrl()); + vrAudio.control(VirtualRealityAudio.Command.PLAY); + } + } + } + public void paStopPlaying(Simulation simulation, List iscsDeviceCodes) { SimulationDataRepository repository = simulation.getRepository(); for (String code : iscsDeviceCodes) { diff --git a/src/main/java/club/joylink/rtss/services/project/DeviceServiceImpl.java b/src/main/java/club/joylink/rtss/services/project/DeviceServiceImpl.java index cd82289ef..90519eef7 100644 --- a/src/main/java/club/joylink/rtss/services/project/DeviceServiceImpl.java +++ b/src/main/java/club/joylink/rtss/services/project/DeviceServiceImpl.java @@ -15,6 +15,7 @@ import club.joylink.rtss.vo.client.project.*; import club.joylink.rtss.vo.client.project.gzb.GzbSignalConfigVO; import club.joylink.rtss.vo.client.project.gzb.GzbSwitchConfigVO; import club.joylink.rtss.vo.client.project.hhcj.HhcjIbpConfigVO; +import club.joylink.rtss.vo.client.project.hhcj.HhcjPsdConfigVO; import club.joylink.rtss.vo.client.project.richor.ZjdIbpConfigVO; import club.joylink.rtss.vo.client.project.richor.ZjdPsdConfigVO; import club.joylink.rtss.vo.client.project.richor.ZjdPslConfigVO; @@ -486,6 +487,16 @@ public class DeviceServiceImpl implements DeviceService { HhcjIbpConfigVO ibpConfigVO = new HhcjIbpConfigVO(); ibp.setConfig(ibpConfigVO.toJson()); list.add(ibp); + // PSD + ProjectDevice psd = new ProjectDevice(); + psd.setProjectCode(Project.RICHOR_HHCJ.name()); + psd.setCode("hhcj-psd"); + psd.setType(ProjectDeviceType.PSD.name()); + psd.setCreator(accountVO.getId()); + psd.setCreateTime(now); + HhcjPsdConfigVO psdConfigVO = new HhcjPsdConfigVO(); + psd.setConfig(psdConfigVO.toJson()); + list.add(psd); return list; } diff --git a/src/main/java/club/joylink/rtss/services/publishData/PublishMapDataHandler.java b/src/main/java/club/joylink/rtss/services/publishData/PublishMapDataHandler.java index 05f04469d..1dd3298b2 100644 --- a/src/main/java/club/joylink/rtss/services/publishData/PublishMapDataHandler.java +++ b/src/main/java/club/joylink/rtss/services/publishData/PublishMapDataHandler.java @@ -1,12 +1,14 @@ package club.joylink.rtss.services.publishData; +import club.joylink.rtss.constants.BusinessConsts; import club.joylink.rtss.constants.MapStatus; +import club.joylink.rtss.dao.IscsDAO; import club.joylink.rtss.dao.MapDataDAO; import club.joylink.rtss.dao.MapInfoDAO; -import club.joylink.rtss.entity.MapDataWithBLOBs; -import club.joylink.rtss.entity.MapInfo; -import club.joylink.rtss.entity.MapInfoExample; +import club.joylink.rtss.entity.*; +import club.joylink.rtss.exception.BusinessExceptionAssertEnum; import club.joylink.rtss.services.IMapService; +import club.joylink.rtss.services.cache.ICacheService; import club.joylink.rtss.simulation.cbtc.constant.SignalAspect; import club.joylink.rtss.simulation.cbtc.constant.SignalModel; import club.joylink.rtss.simulation.cbtc.data.map.Signal; @@ -21,14 +23,12 @@ import club.joylink.rtss.vo.map.logic.MapRouteNewVO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; -import javax.validation.constraints.NotBlank; import java.time.LocalDateTime; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.function.Function; -import java.util.stream.Collectors; @Service public class PublishMapDataHandler { @@ -38,6 +38,10 @@ public class PublishMapDataHandler { private MapInfoDAO mapInfoDAO; @Autowired private MapDataDAO mapDataDAO; + @Autowired + private IscsDAO iscsDAO; + @Autowired + private ICacheService iCacheService; public List queryMapInfos() { MapInfoExample example = new MapInfoExample(); @@ -207,4 +211,54 @@ public class PublishMapDataHandler { mapInfoDAO.updateByPrimaryKeySelective(map); this.iMapService.removeCache(mapId); } + + public void changeStationName(long mapId, Map nameMap) { + // 修改地图数据 + MapDataWithBLOBs mapData = getMapDataEntity(mapId); + String graphData = mapData.getGraphData(); + for (Map.Entry entry : nameMap.entrySet()) { + String k = entry.getKey(); + String v = entry.getValue(); + graphData = graphData.replace(k, v); + } + mapData.setGraphData(graphData); + mapDataDAO.updateByPrimaryKeyWithBLOBs(mapData); + // 修改ISCS数据 + IscsExample iscsExample = new IscsExample(); + iscsExample.createCriteria().andMapIdEqualTo(mapId); + List iscsList = iscsDAO.selectByExampleWithBLOBs(iscsExample); + BusinessExceptionAssertEnum.DATA_NOT_EXIST.assertCollectionNotEmpty(iscsList); + for (Iscs iscs : iscsList) { + String iscsGraphData = iscs.getGraphData(); + for (Map.Entry entry : nameMap.entrySet()) { + String k = entry.getKey(); + String v = entry.getValue(); + iscsGraphData = iscsGraphData.replace(k, v); + } + iscs.setGraphData(iscsGraphData); + iscsDAO.updateByPrimaryKeyWithBLOBs(iscs); + } + // 刷新缓存 + iCacheService.remove(BusinessConsts.CachePrefix.Map + mapId); + iMapService.getMapDetail(mapId); + } + + private MapDataWithBLOBs getMapDataEntity(long mapId) { + MapInfo mapInfo = mapInfoDAO.selectByPrimaryKey(mapId); + BusinessExceptionAssertEnum.DATA_NOT_EXIST.assertNotNull(mapInfo); + return getMapDataEntity(mapId, mapInfo.getVersion()); + } + + private MapDataWithBLOBs findMapDataEntity(long mapId, String version) { + MapDataExample example = new MapDataExample(); + example.createCriteria().andMapIdEqualTo(mapId).andVersionEqualTo(version); + List list = mapDataDAO.selectByExampleWithBLOBs(example); + return CollectionUtils.isEmpty(list) ? null : list.get(0); + } + + private MapDataWithBLOBs getMapDataEntity(long mapId, String version) { + MapDataWithBLOBs entity = findMapDataEntity(mapId, version); + BusinessExceptionAssertEnum.DATA_NOT_EXIST.assertNotNull(entity); + return entity; + } } diff --git a/src/main/java/club/joylink/rtss/services/thridAccount/ThirdAccountDataSyncService.java b/src/main/java/club/joylink/rtss/services/thridAccount/ThirdAccountDataSyncService.java index ff82d852e..34a28838b 100644 --- a/src/main/java/club/joylink/rtss/services/thridAccount/ThirdAccountDataSyncService.java +++ b/src/main/java/club/joylink/rtss/services/thridAccount/ThirdAccountDataSyncService.java @@ -10,6 +10,7 @@ import club.joylink.rtss.util.JsonUtils; import club.joylink.rtss.vo.AccountVO; import club.joylink.rtss.vo.LoginUserInfoVO; import club.joylink.rtss.vo.thirdAccount.ThirdInterfaceConfig; +import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.event.EventListener; import org.springframework.http.HttpEntity; @@ -26,6 +27,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +@Slf4j @Service public class ThirdAccountDataSyncService { @@ -88,6 +90,8 @@ public class ThirdAccountDataSyncService { String body = JsonUtils.writeValueAsString(syncRecordData); HttpEntity httpEntity = new HttpEntity<>(body, headers); ResponseEntity responseEntity = this.restTemplate.postForEntity(url, httpEntity, String.class); + log.info("向第三方发送数据:" + body); + log.info("第三方同步数据接口Response:" + responseEntity); } private Map buildSyncUserSimulationRecordData(AccountVO accountVO, UserSimulationStats record) { diff --git a/src/main/java/club/joylink/rtss/simulation/Simulation.java b/src/main/java/club/joylink/rtss/simulation/Simulation.java index 13bceddac..9c1980b07 100644 --- a/src/main/java/club/joylink/rtss/simulation/Simulation.java +++ b/src/main/java/club/joylink/rtss/simulation/Simulation.java @@ -14,6 +14,7 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.util.StringUtils; import java.time.LocalDateTime; +import java.time.ZoneOffset; import java.util.*; import java.util.concurrent.*; import java.util.concurrent.atomic.AtomicBoolean; @@ -190,6 +191,10 @@ public abstract class Simulation simulationCache = new ConcurrentHashMap<>(); + /** + * 数据过期时间 + */ + private final static long EXPIRE_SECTION_TIME_MIN = 10; + /** + * 区段的缓存 + * key 对应的方向类型 + * EXPIRE_SECTION_TIME_MIN 数据过期时间 + */ + private final static Cache> ROAD_TYPE_CACHE = CacheBuilder.newBuilder().expireAfterWrite(EXPIRE_SECTION_TIME_MIN, TimeUnit.MINUTES).build(); +// private final static Cache> ROAD_TYPE_CACHE = CacheBuilder.newBuilder().expireAfterWrite(EXPIRE_SECTION_TIME_MIN, TimeUnit.MINUTES).build(); + + public static final int Destroy_Time = 180; // RtSimulation无用户时销毁时间,单位s @Scheduled(fixedRate = 5000) public void cleanUselessRtSimulation() { @@ -61,6 +78,15 @@ public class SimulationManager { }); } + + public void putSectionDirCache(String type,List
list){ + ROAD_TYPE_CACHE.put(type,list); + } + + public List
getSectionDir(String type){ + return ROAD_TYPE_CACHE.getIfPresent(type); + + } /** * 保存仿真 * @return 需要销毁的仿真 @@ -113,8 +139,11 @@ public class SimulationManager { } public Simulation destroy(String id) { + Simulation simulation = simulationCache.remove(id); if (simulation != null) { + ROAD_TYPE_CACHE.invalidate(simulation.getId() + "-" + Section.SectionRoadType.LEFT.name()); + ROAD_TYPE_CACHE.invalidate(simulation.getId() + "-" + Section.SectionRoadType.RIGHT.name()); if (simulation instanceof club.joylink.rtss.simulation.cbtc.Simulation) { this.applicationContext.publishEvent(new SimulationDestroyEvent(this, (club.joylink.rtss.simulation.cbtc.Simulation) simulation)); } diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/ATSLogicLoop.java b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/ATSLogicLoop.java index c1c87b019..c27bc4dc6 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/ATSLogicLoop.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/ATSLogicLoop.java @@ -30,7 +30,14 @@ public class ATSLogicLoop { this.atsStationService.updateFieldThatChangeOverTime(simulation); } + public void runForTrainPosition(Simulation simulation){ + this.atsTrainMonitorService.monitorForTrainPosition(simulation); + } public void addJobs(Simulation simulation) { simulation.addJob(SimulationModule.ATS.name(), () -> this.run(simulation), SimulationConstants.ATS_LOOP_RATE); } + + public void addJobsForTrainPosition(Simulation simulation){ + simulation.addJob(SimulationModule.ATS.name(), () -> this.runForTrainPosition(simulation), SimulationConstants.ATS_LOOP_RATE); + } } diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/ATSMessageCollectAndDispatcher.java b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/ATSMessageCollectAndDispatcher.java index 725d14736..be795e831 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/ATSMessageCollectAndDispatcher.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/ATSMessageCollectAndDispatcher.java @@ -281,12 +281,10 @@ public class ATSMessageCollectAndDispatcher { /** * 同步仿真系统时间给客户端 - * - * @param simulation */ public void syncTime(Simulation simulation) { Set sessions = simulation.getSimulationUserIds(); - SocketMessageVO timeSyncMessage = SocketMessageFactory.buildSimulationTimeSyncMessage(simulation); + SocketMessageVO timeSyncMessage = SocketMessageFactory.buildSimulationTimeSyncMessage(simulation); stompMessageService.sendToUser(sessions, timeSyncMessage); } diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/operation/handler/IscsOperateHandler.java b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/operation/handler/IscsOperateHandler.java index 45fb734e8..f946b13fe 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/operation/handler/IscsOperateHandler.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/operation/handler/IscsOperateHandler.java @@ -23,7 +23,7 @@ public class IscsOperateHandler { */ @OperateHandlerMapping(type = Operation.Type.ISCS_PA_Play) public void paPlay(Simulation simulation, PlayParamVO playParamVO, SimulationMember member) { - iscsInteractiveService.play(simulation, playParamVO, member); + iscsInteractiveService.paPlay(simulation, playParamVO, member); } /** @@ -46,7 +46,7 @@ public class IscsOperateHandler { * PIS系统停止播放 */ @OperateHandlerMapping(type = Operation.Type.ISCS_PIS_Stop_Playing) - public void pisPlay(Simulation simulation, List iscsDeviceCodes) { + public void pisStopPlaying(Simulation simulation, List iscsDeviceCodes) { iscsInteractiveService.pisStopPlaying(simulation, iscsDeviceCodes); } } diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/service/AtsTrainMonitorService.java b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/service/AtsTrainMonitorService.java index f6d29d30a..42aa490d9 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/service/AtsTrainMonitorService.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/service/AtsTrainMonitorService.java @@ -51,6 +51,13 @@ public class AtsTrainMonitorService { @Autowired private OnBoardPisService onBoardPisService; + + public void monitorForTrainPosition(Simulation simulation){ + List trainList = simulation.getRepository().getSuperviseTrainList(); + for (TrainInfo trainInfo : trainList) { + this.atsTrainTrackingService.track(simulation, trainInfo); + } + } /** * 列车监控逻辑 * @param simulation diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/service/NewAtsTrainLoadService.java b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/service/NewAtsTrainLoadService.java index 4b58317b2..2fad58b54 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/service/NewAtsTrainLoadService.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/service/NewAtsTrainLoadService.java @@ -1,86 +1,83 @@ package club.joylink.rtss.simulation.cbtc.ATS.service; import club.joylink.rtss.exception.BusinessExceptionAssertEnum; -import club.joylink.rtss.simulation.cbtc.ATP.ground.MaService; -import club.joylink.rtss.simulation.cbtc.ATS.service.ars.AtsRouteSelectService; -import club.joylink.rtss.simulation.cbtc.CI.CiApiService; -import club.joylink.rtss.simulation.cbtc.CI.CiLogic; import club.joylink.rtss.simulation.cbtc.Simulation; -import club.joylink.rtss.simulation.cbtc.SimulationLifeCycleService; import club.joylink.rtss.simulation.cbtc.constant.RunLevel; -import club.joylink.rtss.simulation.cbtc.constant.SimulationConstants; -import club.joylink.rtss.simulation.cbtc.data.CalculateService; import club.joylink.rtss.simulation.cbtc.data.SimulationDataRepository; import club.joylink.rtss.simulation.cbtc.data.map.MapConfig; -import club.joylink.rtss.simulation.cbtc.data.map.Route; import club.joylink.rtss.simulation.cbtc.data.map.Section; -import club.joylink.rtss.simulation.cbtc.data.plan.StationPlan; -import club.joylink.rtss.simulation.cbtc.data.plan.TripPlan; -import club.joylink.rtss.simulation.cbtc.data.support.RoutePath; +import club.joylink.rtss.simulation.cbtc.data.map.Stand; +import club.joylink.rtss.simulation.cbtc.data.map.Station; import club.joylink.rtss.simulation.cbtc.data.support.SectionPosition; -import club.joylink.rtss.simulation.cbtc.data.support.TrainLoadParam2; import club.joylink.rtss.simulation.cbtc.data.vo.TrainInfo; import club.joylink.rtss.simulation.cbtc.data.vr.VirtualRealityTrain; -import club.joylink.rtss.simulation.cbtc.device.virtual.VRDeviceLogicLoop; -import club.joylink.rtss.simulation.cbtc.device.virtual.VRTrainRunningService; -import club.joylink.rtss.simulation.cbtc.event.SimulationRunAsPlanEvent; -import club.joylink.rtss.simulation.cbtc.exception.SimulationException; -import club.joylink.rtss.simulation.cbtc.exception.SimulationExceptionType; -import club.joylink.rtss.simulation.cbtc.onboard.ATP.ATPService; -import club.joylink.rtss.simulation.cbtc.tool.DeviceStatusModifyTool; import club.joylink.rtss.vo.ws.TrainPosition; import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.context.ApplicationContext; import org.springframework.stereotype.Component; -import org.springframework.util.CollectionUtils; -import javax.annotation.Resource; -import java.time.LocalDateTime; -import java.time.LocalTime; -import java.util.*; +import java.util.List; +import java.util.Map; +import java.util.Objects; import java.util.function.Function; import java.util.stream.Collectors; @Slf4j @Component -public class NewAtsTrainLoadService extends AtsTrainLoadService { +public class NewAtsTrainLoadService { - @Resource - private VRTrainRunningService vrTrainRunningService; + private void culStation(VirtualRealityTrain train , Section section, TrainPosition tp){ - - - - - public void loadTripNumberTrain(Simulation simulation, TrainPosition tp,Section section) { - SimulationDataRepository repository = simulation.getRepository(); - String tripNumber = tp.getTrainTripNum(); - TrainInfo trainInfo = repository.getTrainInfoMap().values().stream().filter(train -> tripNumber.equals(train.getTripNumber())).findFirst().orElse(null); - -// List allVrTrain = repository.getAllVrTrain(); - - if(Objects.nonNull(trainInfo)){ - //存在列车需要更新位置 - Optional virtualRealityTrainOptional = repository.getAllVrTrain().stream().filter(d->Objects.equals(d.getTripNumber(),tripNumber)).findFirst(); - VirtualRealityTrain virtualRealityTrain = virtualRealityTrainOptional.get(); - trainOnline(simulation, section, tp, virtualRealityTrain); -// virtualRealityTrain.initManualTrain(headPosition, tp.isRight()); + Station station = section.getStation(); + if(Objects.isNull(station)){ + return; + } + /*List stands = station.getLdStandList(); + if(tp.isRight()){ + stands = station.getRdStandList(); + }*/ + VirtualRealityTrain.Door door = train.getDoor1(); + if(tp.isRight()){ + door = train.getDoor2(); + } + if(tp.isStop()){ + /*for (Stand stand : stands) { + Section ss = stand.getSection(); + System.out.println(ss.getCode()); + stand.setTrainParking(true); + stand.getPsd().getVirtualScreenDoor().setClose(tp.isCloseDoor()); + }*/ + door.setClose(tp.isCloseDoor()); + train.setSpeed(0); }else{ - - Optional virtualRealityTrainOptional = repository.getAllVrTrain().stream() - .filter(vrTrain -> !repository.isVrTrainOnline(vrTrain.getGroupNumber())) - .findFirst(); - VirtualRealityTrain virtualRealityTrain = virtualRealityTrainOptional.get(); - // 设置列车车次 - virtualRealityTrain.setTripNumber(tripNumber); - trainOnline(simulation, section, tp, virtualRealityTrain); -// SectionPosition headPosition = new SectionPosition(section, tp.getLocation() - section.getKmMin()); -// virtualRealityTrain.initManualTrain(headPosition, tp.isRight()); + /*for (Stand stand : stands) { + stand.setTrainParking(false); + }*/ + door.setClose(tp.isCloseDoor()); + train.setSpeed(99F); } } + public void loadTripNumberTrain(Simulation simulation, TrainPosition tp,Section section) { + SimulationDataRepository repository = simulation.getRepository(); + Map trainMap = repository.getAllVrTrain().stream().collect(Collectors.toMap(VirtualRealityTrain::getGroupNumber,Function.identity())); + if(Objects.equals(false,trainMap.containsKey(tp.getGroupNum()))){ + log.error("没有找到对应车组号 param:{}",tp); + return; + } + + VirtualRealityTrain virtualRealityTrain = repository.queryOnlineTrainBy(tp.getGroupNum()); + if(Objects.nonNull(virtualRealityTrain)){ + //存在列车需要更新位置 + culStation(virtualRealityTrain,section,tp); + virtualRealityTrain.setRunLevel(RunLevel.IL); + trainOnline(simulation, section, tp, virtualRealityTrain); + }else{ + virtualRealityTrain = trainMap.get(tp.getGroupNum()); + culStation(virtualRealityTrain,section,tp); + virtualRealityTrain.setRunLevel(RunLevel.IL); + trainOnline(simulation, section, tp, virtualRealityTrain); + } + } /** @@ -99,9 +96,12 @@ public class NewAtsTrainLoadService extends AtsTrainLoadService { //重叠检测 SectionPosition headPosition = new SectionPosition(section, tp.getLocation() - section.getKmMin()); // SectionPosition headPosition = new SectionPosition(section, section.getStopPointByDirection(right)); - SectionPosition tailPosition = CalculateService.calculateNextPositionByStartAndLen(headPosition, !right, train.getLen(), false); - boolean willOverlap = vrTrainRunningService.willOverlap(simulation, headPosition, tailPosition); - BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED.assertNotTrue(willOverlap, "列车重叠"); +// SectionPosition tailPosition = CalculateService.calculateNextPositionByStartAndLen(headPosition, !right, train.getLen(), false); +// boolean willOverlap = vrTrainRunningService.willOverlap(simulation, headPosition, tailPosition); +// if(willOverlap){ +// return; +// } +// BusinessExceptionAssertEnum.OPERATION_NOT_SUPPORTED.assertNotTrue(willOverlap, "列车重叠"); // 列车上线并构建ATS监控列车信息 manualTrainOnlineAndSupervise(simulation, train, headPosition, right); } diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/service/TrainPositionService.java b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/service/TrainPositionService.java index a83cb1c57..e3950898b 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/service/TrainPositionService.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/service/TrainPositionService.java @@ -6,8 +6,13 @@ import club.joylink.rtss.simulation.SimulationManager; import club.joylink.rtss.simulation.cbtc.Simulation; import club.joylink.rtss.simulation.cbtc.build.SimulationBuildParams; import club.joylink.rtss.simulation.cbtc.data.map.Section; +import club.joylink.rtss.simulation.cbtc.data.map.Station; import club.joylink.rtss.util.JsonUtils; +import club.joylink.rtss.vo.client.SocketMessageVO; +import club.joylink.rtss.vo.client.WebSocketMessageType; +import club.joylink.rtss.vo.client.factory.SocketMessageFactory; import club.joylink.rtss.vo.ws.TrainPosition; +import club.joylink.rtss.websocket.StompMessageService; import com.google.common.cache.Cache; import com.google.common.cache.CacheBuilder; import lombok.extern.slf4j.Slf4j; @@ -15,9 +20,7 @@ import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; import javax.annotation.Resource; -import java.util.Comparator; -import java.util.List; -import java.util.Objects; +import java.util.*; import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; @@ -28,41 +31,47 @@ public class TrainPositionService { private NewAtsTrainLoadService newAtsTrainLoadService; @Resource private SimulationManager simulationManager; - /** - * 数据过期时间 - */ - private final static long EXPIRE_SECTION_TIME_MIN = 10; - /** - * 区段的缓存 - * key 对应的方向类型 - * EXPIRE_SECTION_TIME_MIN 数据过期时间 - */ - private final static Cache> ROAD_TYPE_CACHE = CacheBuilder.newBuilder().expireAfterWrite(EXPIRE_SECTION_TIME_MIN, TimeUnit.MINUTES).build(); + @Resource + StompMessageService messageService; + /** * 初始化或更新列车的位置 * @param mapName * @param json */ + public void initTrainOrUpdate(String mapName,String json){ TrainPosition tp = JsonUtils.read(json, TrainPosition.class); + tp.setReceiveTime(System.currentTimeMillis()); +// log.info(tp.toString()); List simulationList = this.findSimulationList(mapName); if(Objects.equals(true, CollectionUtils.isEmpty(simulationList))){ log.error("未找到对应的类型的仿真,无法渲染列车位置 param:{}",json); return; } +// boolean d = true; + SocketMessageVO vo = SocketMessageFactory.buildBasic(WebSocketMessageType.YJDDZH_TRAIN_POSITION,tp); + this.messageService.send(vo); - List
sectionList = findDirectionAllSection(simulationList.get(0),tp.getRoadType()); - Section section = this.findSecion(sectionList,tp); - if(Objects.isNull(section)){ - log.error("未找到对应的区段 param:{}",json); - return; - } for (Simulation sim : simulationList) { + List
sectionList = findDirectionAllSection(sim,tp.getRoadType()); + Section section = this.findSecion(sectionList,tp); +// if(d){ +// tp.setSectionCode(section.getCode()); +// log.info(tp.toString()); +// d = false; +// } + if(Objects.isNull(section)){ + log.error("未找到对应的区段 param:{}",json); + return; + } + log.info(tp.toString()); this.newAtsTrainLoadService.loadTripNumberTrain(sim,tp,section); } } + /** * 根据传入的参数 定位对应的所在的区段 * @param sectionList @@ -70,7 +79,7 @@ public class TrainPositionService { * @return */ private Section findSecion(List
sectionList,TrainPosition tp){ - int i = 0; +// int i = 0; // Section findSection; for (Section section : sectionList) { if(tp.isRight()){ @@ -82,7 +91,7 @@ public class TrainPositionService { return section; } } - i++; +// i++; } return null; } @@ -94,19 +103,21 @@ public class TrainPositionService { * @param roadType * @return */ - private static synchronized List
findDirectionAllSection(Simulation sim,Section.SectionRoadType roadType){ - List
list = ROAD_TYPE_CACHE.getIfPresent(roadType); + private synchronized List
findDirectionAllSection(Simulation sim,Section.SectionRoadType roadType){ + String key = sim.getId() + "-" + roadType.name(); + List
list = simulationManager.getSectionDir(key); if(Objects.equals(true,CollectionUtils.isEmpty(list))){ list = sim.getRepository().getSectionList(); - list = list.stream().filter(d->d.getRoadType() == roadType) + + list = list.stream().filter(d->d.getRoadType() == roadType && Objects.nonNull(d.getKmMin())) .sorted(Comparator.comparing(Section::getKmMin)).collect(Collectors.toList()); - ROAD_TYPE_CACHE.put(roadType,list); + simulationManager.putSectionDirCache(key,list); } return list; } /** - * 获取对应线路的仿真,并且地图类型为 MapPrdTypeEnum.BIG_SCREEN_TRAIN_POSITION + * 获取对应线路的仿真,并且地图类型为 MapPrdTypeEnum.YJDDZH * @param mapName * @return */ @@ -115,8 +126,7 @@ public class TrainPositionService { if(d instanceof Simulation){ Simulation sim = (Simulation) d; SimulationBuildParams params = sim.getBuildParams(); - boolean same = Objects.equals(mapName,params.getMap().getName()) && params.getProdType() == MapPrdTypeEnum.BIG_SCREEN_TRAIN_POSITION; - return same; + return Objects.equals(mapName,params.getMap().getName()) && params.getProdType() == MapPrdTypeEnum.YJDDZH; } return false; }).map(d->(Simulation) d).collect(Collectors.toList()); diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/CI/CiLogic.java b/src/main/java/club/joylink/rtss/simulation/cbtc/CI/CiLogic.java index af8a15609..eef107055 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/CI/CiLogic.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/CI/CiLogic.java @@ -36,6 +36,10 @@ public class CiLogic { @Autowired private StationDirectionService stationDirectionService; + public void runForTrainPosition(Simulation simulation){ +// 采集真实设备状态 + deviceStatusCollector.collect(simulation); + } public void run(Simulation simulation) { // 采集真实设备状态 deviceStatusCollector.collect(simulation); @@ -282,4 +286,9 @@ public class CiLogic { simulation.addJob(SimulationModule.CI.name(), () -> run(simulation), SimulationConstants.CI_LOOP_RATE); simulation.addJob(JobName.SECTION_STOP_COUNTDOWN, () -> sectionStopCountDown(simulation), SimulationConstants.CI_LOOP_RATE); } + + public void addJobsForTrainPosition(Simulation simulation){ + simulation.addJob(SimulationModule.CI.name(), () -> runForTrainPosition(simulation), SimulationConstants.CI_LOOP_RATE); +// simulation.addJob(JobName.SECTION_STOP_COUNTDOWN, () -> sectionStopCountDown(simulation), SimulationConstants.CI_LOOP_RATE); + } } diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/CI/device/CiService.java b/src/main/java/club/joylink/rtss/simulation/cbtc/CI/device/CiService.java index 27e459aa1..e9af22e76 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/CI/device/CiService.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/CI/device/CiService.java @@ -260,6 +260,11 @@ public class CiService { return level; } } + //首区段占用 + if (route.getFirstRouteSection().isOccupied()) { + return level; + } + if (signal.isCbtcMode()) { level = Signal.LEVEL_Atp; // ATP级 } diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/ISCS/IscsLogicLoop.java b/src/main/java/club/joylink/rtss/simulation/cbtc/ISCS/IscsLogicLoop.java index 2ec02c318..ad7cf3089 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/ISCS/IscsLogicLoop.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/ISCS/IscsLogicLoop.java @@ -3,13 +3,17 @@ package club.joylink.rtss.simulation.cbtc.ISCS; import club.joylink.rtss.simulation.cbtc.Simulation; import club.joylink.rtss.simulation.cbtc.constant.SimulationConstants; import club.joylink.rtss.simulation.cbtc.data.SimulationDataRepository; -import club.joylink.rtss.simulation.cbtc.data.map.Audio; +import club.joylink.rtss.simulation.cbtc.data.iscs.Audio; import org.springframework.stereotype.Component; @Component public class IscsLogicLoop { - private void run(Simulation simulation) { + public static final String JOB_NAME = "ISCS_LOGIC_LOOP"; + public static final int RATE = 1000; + + public void run(Simulation simulation) { SimulationDataRepository repository = simulation.getRepository(); + // 广播播放结束逻辑 for (Audio audio : repository.getAudioList()) { if (audio.isInPa() && !audio.isNotUsed()) { int remain = audio.getRemainDuration(); @@ -24,6 +28,6 @@ public class IscsLogicLoop { } public void addJob(Simulation simulation) { - simulation.addJob(Simulation.JobName.iscsLogicLoop, () -> run(simulation), SimulationConstants.ATS_LOOP_RATE); + simulation.addJob(JOB_NAME, () -> run(simulation), RATE); } } diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/ISCS/IscsMessageCollectAndDispatcher.java b/src/main/java/club/joylink/rtss/simulation/cbtc/ISCS/IscsMessageCollectAndDispatcher.java index 857f60d92..b36071f56 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/ISCS/IscsMessageCollectAndDispatcher.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/ISCS/IscsMessageCollectAndDispatcher.java @@ -4,7 +4,7 @@ import club.joylink.rtss.simulation.cbtc.Simulation; import club.joylink.rtss.simulation.cbtc.constant.SimulationConstants; import club.joylink.rtss.simulation.cbtc.data.SimulationDataRepository; import club.joylink.rtss.simulation.cbtc.data.SimulationIscsDataRepository; -import club.joylink.rtss.simulation.cbtc.data.map.Audio; +import club.joylink.rtss.simulation.cbtc.data.iscs.Audio; import club.joylink.rtss.simulation.cbtc.data.vo.iscs.IscsAudioStatusVO; import club.joylink.rtss.simulation.cbtc.data.vo.iscs.IscsStatusVO; import club.joylink.rtss.simulation.rt.iscs.IscsStatusPublisher; diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/ProjectJointSimulationServiceImpl.java b/src/main/java/club/joylink/rtss/simulation/cbtc/ProjectJointSimulationServiceImpl.java index 78f67f22d..c005adfdc 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/ProjectJointSimulationServiceImpl.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/ProjectJointSimulationServiceImpl.java @@ -15,9 +15,10 @@ import club.joylink.rtss.simulation.cbtc.device.real.modbustcp.heb.device.Heb1Ib import club.joylink.rtss.simulation.cbtc.device.real.modbustcp.heb.device.Heb1PscConfig; import club.joylink.rtss.simulation.cbtc.device.real.modbustcp.heb.device.Heb1PslConfig; import club.joylink.rtss.simulation.cbtc.device.real.modbustcp.hhcj.HhcjIbpConfig; -import club.joylink.rtss.simulation.cbtc.device.real.modbustcp.richor.ZjdIbpConfig; -import club.joylink.rtss.simulation.cbtc.device.real.modbustcp.richor.ZjdPslConfig; +import club.joylink.rtss.simulation.cbtc.device.real.modbustcp.hhcj.HhcjPsdConfig; import club.joylink.rtss.simulation.cbtc.device.real.modbustcp.xty.XtyPsdConfig; +import club.joylink.rtss.simulation.cbtc.device.real.modbustcp.zjd.ZjdIbpConfig; +import club.joylink.rtss.simulation.cbtc.device.real.modbustcp.zjd.ZjdPslConfig; import club.joylink.rtss.simulation.cbtc.device.real.udp.UDPRealDeviceThread; import club.joylink.rtss.simulation.cbtc.device.real.udp.sr.config.SrSectionConfig; import club.joylink.rtss.simulation.cbtc.device.real.udp.sr.config.SrSignalConfig; @@ -140,12 +141,14 @@ public class ProjectJointSimulationServiceImpl implements ProjectJointSimulation case PSC: return ((Heb1PscConfig) config).getConfig().getPsdCode(); } + break; } case XTY:{ switch (config.getDeviceType()) { case PSD: return ((XtyPsdConfig) config).getConfig().getPsdCode(); } + break; } case RICHOR_JOINT: { switch (config.getDeviceType()) { @@ -154,6 +157,7 @@ public class ProjectJointSimulationServiceImpl implements ProjectJointSimulation case PSL: return ((ZjdPslConfig) config).getConfigVO().getPslCode(); } + break; } case SR_SANDBOX: { switch (config.getDeviceType()) { @@ -166,12 +170,16 @@ public class ProjectJointSimulationServiceImpl implements ProjectJointSimulation case TRAIN: return ((SrTrainConfig) config).getConfigVO().getVrCode(); } + break; } case RICHOR_HHCJ: { switch (config.getDeviceType()) { case IBP: return ((HhcjIbpConfig) config).getConfigVO().getIbpCode(); + case PSD: + return ((HhcjPsdConfig) config).getConfigVO().getPsdCode(); } + break; } } return null; diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/Simulation.java b/src/main/java/club/joylink/rtss/simulation/cbtc/Simulation.java index 99c887f90..b29b774a5 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/Simulation.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/Simulation.java @@ -39,6 +39,7 @@ import org.springframework.util.CollectionUtils; import java.time.LocalDate; import java.time.LocalDateTime; import java.time.LocalTime; +import java.time.ZoneId; import java.util.*; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentLinkedQueue; @@ -497,6 +498,13 @@ public class Simulation extends club.joylink.rtss.simulation.Simulation voiceCommandBOList = iVoiceCommandService.getAll(); simulation.setVoiceCommandBOList(voiceCommandBOList); + // 添加消息发送器 + addMessagePublisher(simulation); // 添加任务 addJobs(simulation); applicationContext.publishEvent(new SimulationCreateSuccessEvent(this, simulation)); return simulation; } + private void addMessagePublisher(Simulation simulation) { + simulation.addMessagePublisher(new IscsStatusPublisher(simulation)); + simulation.addMessagePublisher(new PisStatusPublisher(simulation)); + } + private void addJobs(Simulation simulation) { + if(simulation.getBuildParams().getProdType() == MapPrdTypeEnum.YJDDZH){ + //非武汉大屏车辆定位 +// atsLogicLoop.addJobs(simulation); + atsLogicLoop.addJobsForTrainPosition(simulation); + atsMessageCollectAndDispatcher.addJobs(simulation); +// vrDeviceLogicLoop.addJobs(simulation); + vrDeviceLogicLoop.addJobsForTrainPosition(simulation); +// ciLogic.addJobs(simulation); + ciLogic.addJobsForTrainPosition(simulation); + return; + } if (simulation.getRepository().getConfig().isRailway()) { ctcLogicLoop.addJobs(simulation); } else { @@ -190,14 +211,11 @@ public class SimulationLifeCycleServiceImpl implements SimulationLifeCycleServic iVirtualRealityPslService.addJobs(simulation); iscsMessageCollectAndDispatcher.addJob(simulation); iscsLogicLoop.addJob(simulation); + pisLogicLoop.addJobs(simulation); } atpLogicLoop.addJobs(simulation); - - if(simulation.getBuildParams().getProdType() != MapPrdTypeEnum.BIG_SCREEN_TRAIN_POSITION){ - //非武汉大屏车辆定位 - atsLogicLoop.addJobs(simulation); - simulationRobotService.addJobs(simulation); - } + atsLogicLoop.addJobs(simulation); + simulationRobotService.addJobs(simulation); vrTrainRunningService.addJobs(simulation); ciLogic.addJobs(simulation); vrDeviceLogicLoop.addJobs(simulation); diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/build/SimulationBuilder.java b/src/main/java/club/joylink/rtss/simulation/cbtc/build/SimulationBuilder.java index 864546fe3..463f7a5f6 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/build/SimulationBuilder.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/build/SimulationBuilder.java @@ -3,11 +3,11 @@ package club.joylink.rtss.simulation.cbtc.build; import club.joylink.rtss.entity.Ibp; import club.joylink.rtss.simulation.cbtc.CI.data.StationDirection; import club.joylink.rtss.simulation.cbtc.CTC.data.*; - import club.joylink.rtss.simulation.cbtc.Simulation; import club.joylink.rtss.simulation.cbtc.data.CalculateService; import club.joylink.rtss.simulation.cbtc.data.SimulationDataRepository; import club.joylink.rtss.simulation.cbtc.data.SimulationIscsDataRepository; +import club.joylink.rtss.simulation.cbtc.data.iscs.Audio; import club.joylink.rtss.simulation.cbtc.data.map.*; import club.joylink.rtss.simulation.cbtc.data.plan.TerminalDeparturePlan; import club.joylink.rtss.simulation.cbtc.data.plan.TripPlan; diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/data/SimulationDataRepository.java b/src/main/java/club/joylink/rtss/simulation/cbtc/data/SimulationDataRepository.java index 2ba9cc73e..64e5943fc 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/data/SimulationDataRepository.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/data/SimulationDataRepository.java @@ -5,6 +5,7 @@ import club.joylink.rtss.exception.BusinessExceptionAssertEnum; import club.joylink.rtss.simulation.cbtc.ATS.data.AtsAlarm; import club.joylink.rtss.simulation.cbtc.Simulation; import club.joylink.rtss.simulation.cbtc.communication.vo.TrainHmiDisplay; +import club.joylink.rtss.simulation.cbtc.data.iscs.Audio; import club.joylink.rtss.simulation.cbtc.data.map.*; import club.joylink.rtss.simulation.cbtc.data.plan.RealRun; import club.joylink.rtss.simulation.cbtc.data.plan.SchedulingTrainPlan; @@ -852,6 +853,7 @@ public class SimulationDataRepository { /** * 此方法只能用于计划车次号唯一的线路(比如西门子风格的运行计划) + * * @param tripNumber * @return */ @@ -1242,6 +1244,18 @@ public class SimulationDataRepository { .collect(Collectors.toList()); } + public Stream