From ce21de71bad2cf5c167e7ab8a6a744bf2ab92482 Mon Sep 17 00:00:00 2001 From: weizhihong Date: Tue, 31 Jan 2023 10:42:15 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E3=80=90=E9=9D=9E=E6=AD=A3=E5=B8=B8?= =?UTF-8?q?=E6=83=85=E5=86=B5=E6=8E=A5=E5=8F=91=E5=88=97=E8=BD=A6=E5=85=B3?= =?UTF-8?q?=E9=94=AE=E7=8E=AF=E8=8A=82=E6=8E=A7=E5=88=B6=E8=A1=A8=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E4=BF=9D=E5=AD=98=E3=80=81=E6=9B=B4=E6=96=B0=E3=80=81?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E6=93=8D=E4=BD=9C=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cbtc/ATS/operation/Operation.java | 16 ++ .../cbtc/CTC/data/CtcRepository.java | 5 + .../cbtc/CTC/data/KeyLinkControlInfo.java | 232 ++++++++++++++++++ .../CTC/operation/RailOperateHandler.java | 28 +++ .../CTC/service/KeyLinkControlService.java | 35 +++ 5 files changed, 316 insertions(+) create mode 100644 src/main/java/club/joylink/rtss/simulation/cbtc/CTC/data/KeyLinkControlInfo.java create mode 100644 src/main/java/club/joylink/rtss/simulation/cbtc/CTC/service/KeyLinkControlService.java diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/operation/Operation.java b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/operation/Operation.java index edf32d5ed..2379c2773 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/operation/Operation.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/operation/Operation.java @@ -1399,6 +1399,22 @@ public class Operation { REGULAR_TRAIN_LINE_STATION_UPDATE(new Label[]{Label.CLIENT},true), REGULAR_TRAIN_LINE_STATION_UPDATE_LIST(new Label[]{Label.CLIENT},true), REGULAR_TRAIN_LINE_STATION_UPDATE_LOAD(new Label[]{Label.CLIENT},true), + + /** + * 非正常情况接发列车关键环节控制表信息保存 + */ + KEY_LINK_CONTROL_INFO_SAVE(new Label[]{Label.CLIENT}, true), + + /** + * 非正常情况接发列车关键环节控制表信息更新 + */ + KEY_LINK_CONTROL_INFO_UPDATE(new Label[]{Label.CLIENT}, true), + + /** + * 非正常情况接发列车关键环节控制表信息查询 + */ + KEY_LINK_CONTROL_INFO_QUERY(new Label[]{Label.CLIENT}, true), + //----------------------------会话信息------------------------------ /** * 电话:创建电话消息 diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/data/CtcRepository.java b/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/data/CtcRepository.java index 0b07f27b8..a7c57ca59 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/data/CtcRepository.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/data/CtcRepository.java @@ -139,6 +139,11 @@ public class CtcRepository { */ private final CopyOnWriteArrayList tickets = new CopyOnWriteArrayList<>(); + /** + * 非正常情况接发列车关键环节控制表 + */ + private final KeyLinkControlInfo keyLinkControlInfo = new KeyLinkControlInfo(); + public void reset(Simulation simulation) { MapConfig config = simulation.getRepository().getConfig(); // 仿真运行数据直接清空 diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/data/KeyLinkControlInfo.java b/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/data/KeyLinkControlInfo.java new file mode 100644 index 000000000..3fe4d14c9 --- /dev/null +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/data/KeyLinkControlInfo.java @@ -0,0 +1,232 @@ +package club.joylink.rtss.simulation.cbtc.CTC.data; + +import club.joylink.rtss.simulation.cbtc.exception.SimulationException; +import club.joylink.rtss.simulation.cbtc.exception.SimulationExceptionType; +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; +import org.springframework.util.CollectionUtils; +import org.springframework.util.IdGenerator; +import org.springframework.util.StringUtils; + +import java.util.*; +import java.util.concurrent.atomic.AtomicInteger; + +/** + * 非正常情况接发列车关键环节控制表 + */ +@Data +public class KeyLinkControlInfo { + + @JsonIgnore + private final AtomicInteger idGenerator = new AtomicInteger(0); + + /** + * 各个车站的关键环节控制信息 + */ + private Map> stationDetailInfoMap = new HashMap<>(); + + /** + * 保存关键环节控制信息 + * @param detailInfo 详情信息 + */ + public void saveDetailInfo(DetailInfo detailInfo) { + if (StringUtils.isEmpty(detailInfo.getStationCode())) { + throw new SimulationException(SimulationExceptionType.Illegal_Argument, "车站信息为空"); + } + List dataList = null; + if (stationDetailInfoMap.containsKey(detailInfo.getStationCode())) { + dataList = stationDetailInfoMap.get(detailInfo.getStationCode()); + } else { + dataList = new LinkedList<>(); + stationDetailInfoMap.put(detailInfo.getStationCode(), dataList); + } + detailInfo.setId(idGenerator.incrementAndGet()); + dataList.add(detailInfo); + } + + /** + * 更新信息 + * @param detailInfo 详情信息 + */ + public void updateDetailInfo(DetailInfo detailInfo) { + List dataList = stationDetailInfoMap.get(detailInfo.getStationCode()); + if (CollectionUtils.isEmpty(dataList)) { + throw new SimulationException(SimulationExceptionType.Illegal_Argument, "无效数据"); + } + DetailInfo oldDetailInfo = dataList.stream().filter(d -> Objects.equals(d.getId(), detailInfo.getId())) + .findFirst().orElse(null); + if (oldDetailInfo == null) { + throw new SimulationException(SimulationExceptionType.Data_Not_Exist); + } + dataList.set(dataList.indexOf(oldDetailInfo), detailInfo); + } + + /** + * 获取信息列表 + * @param stationCode 车站 + * @return 信息列表 + */ + public List getDetailInfoList(String stationCode) { + return stationDetailInfoMap.getOrDefault(stationCode, new LinkedList<>()); + } + + + /** + * 表详情 + */ + @Data + public static class DetailInfo { + /** + * 主键 + */ + private Integer id; + + /** + * 车站编码 + */ + private String stationCode; + + /** + * 值班员 + */ + private String supervisor; + + /** + * 干部上岗是由 + */ + private String cadresPost; + + /** + * 监控干部 + */ + private String monitorCadres; + + /** + * 天气 + */ + private String weather; + + /** + * 日期 + */ + private String registerDate; + + /** + * 通知干部时间 + */ + private TimeStructure noticeCadresTime; + + /** + * 报告列车调度员时间 + */ + private TimeStructure reportDispatcherTime; + + /** + * 报告指挥中心时间 + */ + private TimeStructure reportCommandCentreTime; + + /** + * 监控干部到岗时间 + */ + private TimeStructure monitorArriveTime; + + /** + * 登记列表 + */ + private List registerInfoList; + + /** + * 故障内容 + */ + private String faultContent; + + /** + * 区间闭塞、封闭情况 + */ + private String sectionContent; + + /** + * 接车进路准备方式 + */ + private String pickRoutePrepareContent; + + /** + * 接车信号 + */ + private String pickSignal; + + /** + * 发车进路准备方式 + */ + private String departRoutePrepareContent; + + /** + * 其他关键环节 + */ + private String otherKeyLinkContent; + + } + + /** + * 登记信息 + */ + @Data + public static class RegisterInfo { + /** + * 登记单位 + */ + private String departmentName; + + /** + * 运统46登记(通知干部上岗) + */ + private String registration; + + /** + * 运统46签认(报告列车调度员) + */ + private boolean reportSign; + + /** + * 报告列车调度员(报告列车调度员) + */ + private boolean reportDispatcher; + + /** + * 调度命令核对、接收(报告指挥中心) + */ + private boolean centerDispatchCommandCheck; + + /** + * 运统46到点、签认(监控干部到岗) + */ + private boolean monitorArrive; + + /** + * 运统46销记、签认(安排工作人员) + */ + private boolean writeOff; + + /** + * 调度命令核对、接收(安排工作人员) + */ + private boolean workerDispatchCommandCheck; + } + + /** + * 时分数据格式 + */ + @Data + public static class TimeStructure { + /** + * 时 + */ + private String hour; + + /** + * 分 + */ + private String minute; + } +} diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/operation/RailOperateHandler.java b/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/operation/RailOperateHandler.java index e122c6604..131c3a3f7 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/operation/RailOperateHandler.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/operation/RailOperateHandler.java @@ -3,7 +3,9 @@ package club.joylink.rtss.simulation.cbtc.CTC.operation; import club.joylink.rtss.simulation.cbtc.ATS.operation.Operation; import club.joylink.rtss.simulation.cbtc.ATS.operation.annotation.OperateHandler; import club.joylink.rtss.simulation.cbtc.ATS.operation.annotation.OperateHandlerMapping; +import club.joylink.rtss.simulation.cbtc.CTC.data.KeyLinkControlInfo; import club.joylink.rtss.simulation.cbtc.CTC.data.Ticket; +import club.joylink.rtss.simulation.cbtc.CTC.service.KeyLinkControlService; import club.joylink.rtss.simulation.cbtc.CTC.service.RailRegisterService; import club.joylink.rtss.simulation.cbtc.CTC.data.Register; import club.joylink.rtss.simulation.cbtc.CTC.service.RailTicketService; @@ -23,6 +25,8 @@ public class RailOperateHandler { private RailRegisterService railRegisterService; @Autowired private RailTicketService railTicketService; + @Autowired + private KeyLinkControlService keyLinkControlService; /** * 填写行车簿册 @@ -63,4 +67,28 @@ public class RailOperateHandler { public void giveTicketTo(Simulation simulation, SimulationMember member, String ticketId, String memberId) { railTicketService.giveTicketTo(simulation, member, ticketId, memberId); } + + /** + * 保存非正常情况接发列车关键环节控制表 + */ + @OperateHandlerMapping(type = Operation.Type.KEY_LINK_CONTROL_INFO_SAVE) + public void saveKeyLinkControlInfo(Simulation simulation, KeyLinkControlInfo.DetailInfo detailInfo) { + keyLinkControlService.save(simulation, detailInfo); + } + + /** + * 更新非正常情况接发列车关键环节控制表 + */ + @OperateHandlerMapping(type = Operation.Type.KEY_LINK_CONTROL_INFO_UPDATE) + public void updateKeyLinkControlInfo(Simulation simulation, KeyLinkControlInfo.DetailInfo detailInfo) { + keyLinkControlService.update(simulation, detailInfo); + } + + /** + * 查询非正常情况接发列车关键环节控制表 + */ + @OperateHandlerMapping(type = Operation.Type.KEY_LINK_CONTROL_INFO_QUERY) + public List queryKeyLinkControlInfo(Simulation simulation, String stationCode) { + return keyLinkControlService.query(simulation, stationCode); + } } diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/service/KeyLinkControlService.java b/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/service/KeyLinkControlService.java new file mode 100644 index 000000000..15011c904 --- /dev/null +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/service/KeyLinkControlService.java @@ -0,0 +1,35 @@ +package club.joylink.rtss.simulation.cbtc.CTC.service; + +import club.joylink.rtss.simulation.cbtc.CTC.data.KeyLinkControlInfo; +import club.joylink.rtss.simulation.cbtc.Simulation; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 非正常情况接发列车关键环节控制表 + */ +@Service +public class KeyLinkControlService { + + /** + * 保存非正常情况接发列车关键环节控制表 + */ + public void save(Simulation simulation, KeyLinkControlInfo.DetailInfo detailInfo) { + simulation.getCtcRepository().getKeyLinkControlInfo().saveDetailInfo(detailInfo); + } + + /** + * 更新非正常情况接发列车关键环节控制表 + */ + public void update(Simulation simulation, KeyLinkControlInfo.DetailInfo detailInfo) { + simulation.getCtcRepository().getKeyLinkControlInfo().updateDetailInfo(detailInfo); + } + + /** + * 查询非正常情况接发列车关键环节控制表 + */ + public List query(Simulation simulation, String stationCode) { + return simulation.getCtcRepository().getKeyLinkControlInfo().getDetailInfoList(stationCode); + } +} From 68bbde3029cc0644fbf23554ebd914fad1b6b1e3 Mon Sep 17 00:00:00 2001 From: tiger_zhou <123456> Date: Tue, 31 Jan 2023 10:57:44 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E8=80=83=E8=AF=95=E8=A7=84=E5=88=99?= =?UTF-8?q?=E6=95=B0=E9=87=8F=EF=BC=8C=E6=A0=87=E7=AD=BE=20=E9=92=88?= =?UTF-8?q?=E5=AF=B9=E5=AE=9E=E8=AE=AD=E7=BA=BF=E8=B7=AF=E8=BF=87=E6=BB=A4?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../rtss/dao/PublishedTraining2DAO.java | 4 +-- .../training2/Training2PublishService.java | 31 ++++++++++--------- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/src/main/java/club/joylink/rtss/dao/PublishedTraining2DAO.java b/src/main/java/club/joylink/rtss/dao/PublishedTraining2DAO.java index 08a2d4d97..24c2101ee 100644 --- a/src/main/java/club/joylink/rtss/dao/PublishedTraining2DAO.java +++ b/src/main/java/club/joylink/rtss/dao/PublishedTraining2DAO.java @@ -16,11 +16,11 @@ import java.util.Map; @Repository public interface PublishedTraining2DAO { - @Select("") - List selectAllLabel(@Param("mapId") Long mapId,@Param("orgId") Long orgId,@Param("type") String type); + List selectAllLabel(@Param("mapId") Long mapId,@Param("orgId") Long orgId,@Param("type") String type);*/ long countByExample(PublishedTraining2Example example); int deleteByExample(PublishedTraining2Example example); diff --git a/src/main/java/club/joylink/rtss/services/training2/Training2PublishService.java b/src/main/java/club/joylink/rtss/services/training2/Training2PublishService.java index 96b365e22..5e28f4bcb 100644 --- a/src/main/java/club/joylink/rtss/services/training2/Training2PublishService.java +++ b/src/main/java/club/joylink/rtss/services/training2/Training2PublishService.java @@ -49,16 +49,9 @@ public class Training2PublishService { */ public Long queryCountForLabel(Long mapId,@Deprecated Long orgId,String type,String label){ - BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertTrue(Objects.nonNull(mapId),"没有关联对应的地图"); - BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertTrue(Objects.nonNull(orgId),"组织信息不能为空"); - BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertTrue(Objects.nonNull(type),"查询类型信息不能为空"); - PublishedTraining2Example example = new PublishedTraining2Example(); PublishedTraining2Example.Criteria c = example.createCriteria(); - //针对实训只过滤对应的线路 - c.andMapIdEqualTo(mapId); -// c.andOrgIdEqualTo(orgId); - c.andTypeEqualTo(type); + this.findAllLableCriteria(c,mapId,orgId,type); if(Objects.nonNull(label)){ c.andLabelJsonLike(String.format("%%%s%%", label)); } @@ -69,20 +62,28 @@ public class Training2PublishService { * 根据 组织,类型(单操作,实操) 获取标签 */ public Collection findAllLabel(Long mapId,Long orgId, String type){ - BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertTrue(Objects.nonNull(mapId),"请关联对应的线路"); - BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertTrue(Objects.nonNull(orgId),"组织信息不能为空"); - BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertTrue(Objects.nonNull(type),"查询类型信息不能为空"); - //针对实训只过滤关联的线路 - List list = this.publishedDao.selectAllLabel(mapId,null,type); - if(CollectionUtils.isEmpty(list)){ + PublishedTraining2Example example = new PublishedTraining2Example(); + PublishedTraining2Example.Criteria c = example.createCriteria(); + this.findAllLableCriteria(c,mapId,orgId,type); + List dataList = this.publishedDao.selectByExample(example); + if(CollectionUtils.isEmpty(dataList)){ return Collections.emptyList(); } - return list.stream().filter(StringUtils::hasText).map(d->{ + return dataList.stream().map(PublishedTraining2::getLabelJson).filter(StringUtils::hasText).map(d->{ List l = JsonUtils.readCollection(d,List.class,String.class); return l; }).flatMap(d->d.stream()).collect(Collectors.toSet()); } + private void findAllLableCriteria(PublishedTraining2Example.Criteria criteria,Long mapId,Long orgId,String type){ + BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertTrue(Objects.nonNull(mapId),"请关联对应的线路"); + BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertTrue(Objects.nonNull(orgId),"组织信息不能为空"); + BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertTrue(Objects.nonNull(type),"查询类型信息不能为空"); + criteria.andMapIdEqualTo(mapId); +// c.andOrgIdEqualTo(orgId); + criteria.andTypeEqualTo(type); + } + /** * 已发布实训分页列表 */ From b4e785284fbbaadf91d0b1082eb3d6fe7b9b6029 Mon Sep 17 00:00:00 2001 From: tiger_zhou <123456> Date: Tue, 31 Jan 2023 14:13:44 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E8=AF=95=E5=8D=B7=E7=94=9F=E6=88=90?= =?UTF-8?q?=E7=90=86=E8=AE=BA=E9=A2=98=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../services/paper/PagerQuestionService.java | 51 +++++++++---- .../paper/PaperUserCreateService.java | 72 ++++++++----------- .../training2/Training2PublishService.java | 17 +++-- 3 files changed, 75 insertions(+), 65 deletions(-) diff --git a/src/main/java/club/joylink/rtss/services/paper/PagerQuestionService.java b/src/main/java/club/joylink/rtss/services/paper/PagerQuestionService.java index 0da8df597..cea3904cf 100644 --- a/src/main/java/club/joylink/rtss/services/paper/PagerQuestionService.java +++ b/src/main/java/club/joylink/rtss/services/paper/PagerQuestionService.java @@ -47,14 +47,10 @@ public class PagerQuestionService { * @param queryLabelIsNull 当查询对象labels属性为空时 是否查询 tags is null * @return */ - private PaperQuestionExample createQueryExample(QuestionQueryVO queryVO, boolean orgIdCanNull,boolean queryLabelIsNull){ + public void createQueryExample(PaperQuestionExample.Criteria criteria,QuestionQueryVO queryVO, boolean orgIdCanNull,boolean queryLabelIsNull){ if(Objects.equals(false,orgIdCanNull)){ BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertTrue(Objects.nonNull(queryVO.getOrgId()),"用户组织信息不能为空"); } - - PaperQuestionExample example = new PaperQuestionExample(); - PaperQuestionExample.Criteria criteria = example.createCriteria(); - if (StringUtils.hasText(queryVO.getTopic())) { criteria.andQuestionLike(String.format("%%%s%%", queryVO.getTopic())); } @@ -65,7 +61,33 @@ public class PagerQuestionService { if(Objects.nonNull(queryVO.getOrgId())){ criteria.andOrgIdEqualTo(queryVO.getOrgId()); } - if(!StringUtils.hasText(queryVO.getLabels())){ + criteria.andIsDelEqualTo(BusinessConsts.DBLogicDelete.NORMAL.ordinal()); + if(Objects.equals(false,queryLabelIsNull) && StringUtils.hasText(queryVO.getLabels())){ + List tmpLableList = Splitter.on(",").omitEmptyStrings().splitToList(queryVO.getLabels()); + if(Objects.equals(false,CollectionUtils.isEmpty(tmpLableList))){ + StringBuilder sqlBuilder = new StringBuilder("("); + for(var i = 0 ; i < tmpLableList.size();i++){ + String data = tmpLableList.get(i); + if(i != 0){ + sqlBuilder.append(" and "); + } + sqlBuilder.append(String.format(" find_in_set('%s',tags) > 0 ",data)); + } + sqlBuilder.append(")"); + Class criteriaCls = criteria.getClass(); + Class generatedCriteriaCls = criteriaCls.getSuperclass(); + try{ + Method addCriterion = generatedCriteriaCls.getDeclaredMethod("addCriterion", String.class); + addCriterion.setAccessible(true); + addCriterion.invoke(criteria, sqlBuilder.toString()); + }catch (Exception e){ + log.error("拼写查询标签错误 msg:" + e.getMessage(),e); + } + } + }else { + criteria.andTagsIsNull(); + } + /* if(!StringUtils.hasText(queryVO.getLabels())){ if(queryLabelIsNull) { criteria.andTagsIsNull(); } @@ -91,9 +113,8 @@ public class PagerQuestionService { log.error("拼写查询标签错误 msg:" + e.getMessage(),e); } } - } - criteria.andIsDelEqualTo(BusinessConsts.DBLogicDelete.NORMAL.ordinal()); - return example; + }*/ + } /** @@ -112,7 +133,9 @@ public class PagerQuestionService { queryVO.setOrgId(orgId); queryVO.setType(type.name()); queryVO.setLabels(labels); - PaperQuestionExample example = this.createQueryExample(queryVO,false,true); + PaperQuestionExample example = new PaperQuestionExample(); + PaperQuestionExample.Criteria criteria = example.createCriteria(); + this.createQueryExample(criteria,queryVO,false,false); return this.questionDAO.countByExample(example); } @@ -124,7 +147,9 @@ public class PagerQuestionService { */ public PageVO pagingQueryQuestions(QuestionQueryVO queryVO,boolean companyIdCanNull) { PageHelper.startPage(queryVO.getPageNum(), queryVO.getPageSize()); - PaperQuestionExample example = this.createQueryExample(queryVO,companyIdCanNull,false); + PaperQuestionExample example = new PaperQuestionExample(); + PaperQuestionExample.Criteria criteria = example.createCriteria(); + this.createQueryExample(criteria,queryVO,companyIdCanNull,false); Page page = (Page)this.questionDAO.selectByExampleWithBLOBs(example); List questionVOS = PaperQuestionVO.convert2VOList(page.getResult()); return PageVO.convert(page, questionVOS); @@ -138,7 +163,9 @@ public class PagerQuestionService { * @return */ public List queryQuestions(QuestionQueryVO queryVO,boolean companyIdCanNull) { - PaperQuestionExample example = this.createQueryExample(queryVO,companyIdCanNull,false); + PaperQuestionExample example = new PaperQuestionExample(); + PaperQuestionExample.Criteria criteria = example.createCriteria(); + this.createQueryExample(criteria,queryVO,companyIdCanNull,false); List list = this.questionDAO.selectByExampleWithBLOBs(example); List questionVOS = PaperQuestionVO.convert2VOList(list); return questionVOS; diff --git a/src/main/java/club/joylink/rtss/services/paper/PaperUserCreateService.java b/src/main/java/club/joylink/rtss/services/paper/PaperUserCreateService.java index 21c7ab7cb..336db67cd 100644 --- a/src/main/java/club/joylink/rtss/services/paper/PaperUserCreateService.java +++ b/src/main/java/club/joylink/rtss/services/paper/PaperUserCreateService.java @@ -8,8 +8,10 @@ import club.joylink.rtss.entity.paper.question.PaperQuestionExample; import club.joylink.rtss.entity.training2.PublishedTraining2; import club.joylink.rtss.entity.training2.PublishedTraining2Example; import club.joylink.rtss.exception.PaperExceptionAssert; +import club.joylink.rtss.services.training2.Training2PublishService; import club.joylink.rtss.util.JsonUtils; import club.joylink.rtss.vo.AccountVO; +import club.joylink.rtss.vo.client.pager.question.QuestionQueryVO; import club.joylink.rtss.vo.paper.*; import club.joylink.rtss.vo.paper.convertor.PaperRuleConvertor; import com.google.common.base.Joiner; @@ -20,6 +22,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; +import org.springframework.util.StringUtils; import java.lang.reflect.Method; import java.time.LocalDateTime; @@ -48,6 +51,10 @@ public class PaperUserCreateService { private PaperQuestionDAO questionDAO; @Autowired private PublishedTraining2DAO trainingDAO; + @Autowired + private Training2PublishService training2PublishService; + @Autowired + private PagerQuestionService pagerQuestionService; private void resetPaperRecord(Long pcId, Long userId){ @@ -120,6 +127,7 @@ public class PaperUserCreateService { /** * 根据试卷蓝图和规则来为用户试卷分配题目 */ + @Deprecated private void dispatcherQuestion(PaperUser pu, PaperComposition pc, List ruleList) { for (PaperRule rule : ruleList) { String tags = rule.getTags();//规则标签,list json @@ -168,8 +176,10 @@ public class PaperUserCreateService { */ private List dispatcherCommonQuestion2(PaperUser pu, PaperComposition pc, PaperCompositionWithRuleVo.PaperRuleVo ruleVO,List notInList) { final int qSum = ruleVO.getAmount();//该类型问题个数 + PaperQuestionExample questionExample = new PaperQuestionExample(); + PaperQuestionExample.Criteria criteria = questionExample.createCriteria(); - PaperQuestionExample questionExample = this.commonQuestionExample2(pu, pc, ruleVO,notInList); + this.commonQuestionExample2(criteria,pu, pc, ruleVO,notInList); //符合条件的题目数目 long count = questionDAO.countByExample(questionExample); PaperExceptionAssert.PqEnough.assertTrue(count >= qSum, "符合条件的理论题数目过少:pcId = " + pc.getId() + " pcName = " + pc.getName() + " orgId = " + pc.getOrgId() + " ruleType = " + ruleVO.getSubtype().name() + " ruleSum = " + qSum); @@ -195,6 +205,7 @@ public class PaperUserCreateService { /** * 随机选择理论题目 */ + @Deprecated private List dispatcherCommonQuestion(PaperUser pu, PaperComposition pc, PaperRule rule) { final int qSum = rule.getAmount();//该类型问题个数 // @@ -259,26 +270,25 @@ public class PaperUserCreateService { String tags = rule.getTags();//规则标签,list json List tagArray = null != tags && tags.length() > 0 ? JsonUtils.readCollection(tags, ArrayList.class, String.class) : null; PaperQType.SubType subType = PaperQType.SubType.getItem(rule.getSubtype()); - // + String subTypeStr = this.paperUserService.getTrainingType(subType); + + PublishedTraining2Example questionExample = new PublishedTraining2Example(); PublishedTraining2Example.Criteria criteria = questionExample.createCriteria(); - //针对实训添加mapId 的过滤 - criteria.andMapIdEqualTo(pc.getMapId()); -// criteria.andOrgIdEqualTo(pc.getOrgId()); - if (null == tagArray) { - criteria.andTypeEqualTo(this.paperUserService.getTrainingType(subType)).andStateEqualTo(1);//1-上架 - } else { + + this.training2PublishService.basicQueryCriteria(criteria,pc.getMapId(),pc.getOrgId(), StringUtils.hasText(subTypeStr) ? subTypeStr.toUpperCase():null); + if(!CollectionUtils.isEmpty(tagArray)){ for (String tag : tagArray) { - questionExample.or().andTypeEqualTo(this.paperUserService.getTrainingType(subType)).andStateEqualTo(1).andLabelJsonLike(String.format("%%%s%%", tag)); + criteria.andLabelJsonLike(String.format("%%%s%%", tag)); } } - return questionExample; } /** * 生成根据tag查询的条件 */ + @Deprecated private PaperQuestionExample commonQuestionExample(PaperUser pu, PaperComposition pc, PaperRule rule) { String tags = rule.getTags();//规则标签,list json List tagArray = null != tags && tags.length() > 0 ? JsonUtils.readCollection(tags, ArrayList.class, String.class) : null; @@ -296,42 +306,16 @@ public class PaperUserCreateService { } return questionExample; } - private PaperQuestionExample commonQuestionExample2(PaperUser pu, PaperComposition pc, PaperCompositionWithRuleVo.PaperRuleVo ruleVO,List notInList) { -// String tags = rule.getTags();//规则标签,list json -// List tagArray = null != tags && tags.length() > 0 ? JsonUtils.readCollection(tags, ArrayList.class, String.class) : null; -// PaperQType.SubType subType = PaperQType.SubType.getItem(rule.getSubtype()); - // - PaperQuestionExample questionExample = new PaperQuestionExample(); - PaperQuestionExample.Criteria criteria = questionExample.createCriteria(); - criteria.andOrgIdEqualTo(pc.getOrgId()).andTypeEqualTo(this.paperUserService.getPaperQuestionType(ruleVO.getSubtype()).name()).andIsDelEqualTo(0); + private void commonQuestionExample2(PaperQuestionExample.Criteria criteria,PaperUser pu, PaperComposition pc, PaperCompositionWithRuleVo.PaperRuleVo ruleVO,List notInList) { + QuestionQueryVO queryVO = new QuestionQueryVO(); + if(!CollectionUtils.isEmpty(ruleVO.getTags())){ + queryVO.setLabels(Joiner.on(",").skipNulls().join(ruleVO.getTags())); + } + queryVO.setType(this.paperUserService.getPaperQuestionType(ruleVO.getSubtype()).name()); + queryVO.setOrgId(pc.getOrgId()); if(!CollectionUtils.isEmpty(notInList)){ criteria.andIdNotIn(notInList); } - List tagArray = ruleVO.getTags(); - if (!CollectionUtils.isEmpty(tagArray)) { - StringBuilder sqlBuilder = new StringBuilder("("); - for (var i = 0 ; i < tagArray.size();i++) { - String data = tagArray.get(i); - if(i != 0){ - sqlBuilder.append(" and "); - } - sqlBuilder.append(String.format(" find_in_set('%s',tags) > 0 ",data)); - } - sqlBuilder.append(")"); - Class criteriaCls = PaperQuestionExample.Criteria.class; - Class generatedCriteriaCls = criteriaCls.getSuperclass(); - try{ - Method addCriterion = generatedCriteriaCls.getDeclaredMethod("addCriterion", String.class); - addCriterion.setAccessible(true); - addCriterion.invoke(criteria, sqlBuilder.toString()); - }catch (Exception e){ - log.error("拼写查询标签错误 msg:" + e.getMessage(),e); - } - }else{ - criteria.andTagsIsNull(); - } - return questionExample; + this.pagerQuestionService.createQueryExample(criteria,queryVO,false,false); } - - } diff --git a/src/main/java/club/joylink/rtss/services/training2/Training2PublishService.java b/src/main/java/club/joylink/rtss/services/training2/Training2PublishService.java index 5e28f4bcb..062caeddc 100644 --- a/src/main/java/club/joylink/rtss/services/training2/Training2PublishService.java +++ b/src/main/java/club/joylink/rtss/services/training2/Training2PublishService.java @@ -1,17 +1,16 @@ package club.joylink.rtss.services.training2; -import club.joylink.rtss.constants.BusinessConsts; import club.joylink.rtss.dao.PublishedTraining2DAO; -import club.joylink.rtss.entity.paper.question.PaperQuestionExample; -import club.joylink.rtss.entity.paper.question.PaperQuestionWithBLOBs; +import club.joylink.rtss.entity.paper.PaperComposition; +import club.joylink.rtss.entity.paper.PaperRule; +import club.joylink.rtss.entity.paper.PaperUser; import club.joylink.rtss.entity.training2.PublishedTraining2; import club.joylink.rtss.entity.training2.PublishedTraining2Example; import club.joylink.rtss.entity.training2.PublishedTraining2WithBLOBs; -import club.joylink.rtss.exception.BusinessException; -import club.joylink.rtss.exception.BusinessExceptionAssert; import club.joylink.rtss.exception.BusinessExceptionAssertEnum; import club.joylink.rtss.util.JsonUtils; import club.joylink.rtss.vo.client.PageVO; +import club.joylink.rtss.vo.paper.PaperQType; import club.joylink.rtss.vo.training2.publish.*; import com.github.pagehelper.Page; import com.github.pagehelper.PageHelper; @@ -22,7 +21,6 @@ import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; import org.springframework.util.StringUtils; -import java.lang.reflect.Method; import java.time.LocalDateTime; import java.util.*; import java.util.stream.Collectors; @@ -51,7 +49,7 @@ public class Training2PublishService { public Long queryCountForLabel(Long mapId,@Deprecated Long orgId,String type,String label){ PublishedTraining2Example example = new PublishedTraining2Example(); PublishedTraining2Example.Criteria c = example.createCriteria(); - this.findAllLableCriteria(c,mapId,orgId,type); + this.basicQueryCriteria(c,mapId,orgId,type); if(Objects.nonNull(label)){ c.andLabelJsonLike(String.format("%%%s%%", label)); } @@ -64,7 +62,7 @@ public class Training2PublishService { public Collection findAllLabel(Long mapId,Long orgId, String type){ PublishedTraining2Example example = new PublishedTraining2Example(); PublishedTraining2Example.Criteria c = example.createCriteria(); - this.findAllLableCriteria(c,mapId,orgId,type); + this.basicQueryCriteria(c,mapId,orgId,type); List dataList = this.publishedDao.selectByExample(example); if(CollectionUtils.isEmpty(dataList)){ return Collections.emptyList(); @@ -75,13 +73,14 @@ public class Training2PublishService { }).flatMap(d->d.stream()).collect(Collectors.toSet()); } - private void findAllLableCriteria(PublishedTraining2Example.Criteria criteria,Long mapId,Long orgId,String type){ + public void basicQueryCriteria(PublishedTraining2Example.Criteria criteria, Long mapId, Long orgId, String type){ BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertTrue(Objects.nonNull(mapId),"请关联对应的线路"); BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertTrue(Objects.nonNull(orgId),"组织信息不能为空"); BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertTrue(Objects.nonNull(type),"查询类型信息不能为空"); criteria.andMapIdEqualTo(mapId); // c.andOrgIdEqualTo(orgId); criteria.andTypeEqualTo(type); + criteria.andStateEqualTo(1);//上架 } /** From 86f8820453cd07d09acf5635682a9aa7d706d09d Mon Sep 17 00:00:00 2001 From: weizhihong Date: Tue, 31 Jan 2023 18:02:36 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E3=80=90=E8=A1=8C=E8=BD=A6=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E6=96=BD=E5=B7=A5=E7=99=BB=E8=AE=B0=E7=B0=BF=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cbtc/CTC/data/CtcRepository.java | 7 ++ .../data/book/EquipmentConstructionInfo.java | 116 ++++++++++++++++++ .../data/{ => book}/KeyLinkControlInfo.java | 2 +- .../CTC/operation/RailOperateHandler.java | 12 +- .../CTC/service/KeyLinkControlService.java | 35 ------ .../cbtc/CTC/service/RailBookService.java | 51 ++++++++ 6 files changed, 181 insertions(+), 42 deletions(-) create mode 100644 src/main/java/club/joylink/rtss/simulation/cbtc/CTC/data/book/EquipmentConstructionInfo.java rename src/main/java/club/joylink/rtss/simulation/cbtc/CTC/data/{ => book}/KeyLinkControlInfo.java (98%) delete mode 100644 src/main/java/club/joylink/rtss/simulation/cbtc/CTC/service/KeyLinkControlService.java create mode 100644 src/main/java/club/joylink/rtss/simulation/cbtc/CTC/service/RailBookService.java diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/data/CtcRepository.java b/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/data/CtcRepository.java index a7c57ca59..e2848685a 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/data/CtcRepository.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/data/CtcRepository.java @@ -1,6 +1,8 @@ package club.joylink.rtss.simulation.cbtc.CTC.data; import club.joylink.rtss.exception.BusinessExceptionAssertEnum; +import club.joylink.rtss.simulation.cbtc.CTC.data.book.EquipmentConstructionInfo; +import club.joylink.rtss.simulation.cbtc.CTC.data.book.KeyLinkControlInfo; import club.joylink.rtss.simulation.cbtc.CTC.data.vo.CtcRunPlanVO; import club.joylink.rtss.simulation.cbtc.CTC.data.vo.CtcStationRunPlanLogVO; import club.joylink.rtss.simulation.cbtc.CTC.data.vo.RouteSequenceVO; @@ -144,6 +146,11 @@ public class CtcRepository { */ private final KeyLinkControlInfo keyLinkControlInfo = new KeyLinkControlInfo(); + /** + * 行车设备施工登记簿 + */ + private final EquipmentConstructionInfo equipmentConstructionInfo = new EquipmentConstructionInfo(); + public void reset(Simulation simulation) { MapConfig config = simulation.getRepository().getConfig(); // 仿真运行数据直接清空 diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/data/book/EquipmentConstructionInfo.java b/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/data/book/EquipmentConstructionInfo.java new file mode 100644 index 000000000..a3f44b866 --- /dev/null +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/data/book/EquipmentConstructionInfo.java @@ -0,0 +1,116 @@ +package club.joylink.rtss.simulation.cbtc.CTC.data.book; + +import club.joylink.rtss.simulation.cbtc.exception.SimulationException; +import club.joylink.rtss.simulation.cbtc.exception.SimulationExceptionType; +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; +import org.springframework.util.CollectionUtils; +import org.springframework.util.StringUtils; + +import java.util.*; +import java.util.concurrent.atomic.AtomicInteger; + +/** + * 行车设备施工登记簿 + */ +@Data +public class EquipmentConstructionInfo { + + @JsonIgnore + private final AtomicInteger idGenerator = new AtomicInteger(0); + + /** + * 各个车站的行车设备施工登记簿 + */ + private Map> stationDetailInfoMap = new HashMap<>(); + + /** + * 保存行车设备施工登记 + */ + public void saveDetailInfo(ConstructionInfo detailInfo) { + if (StringUtils.isEmpty(detailInfo.getStationCode())) { + throw new SimulationException(SimulationExceptionType.Illegal_Argument, "车站信息为空"); + } + List dataList = null; + if (stationDetailInfoMap.containsKey(detailInfo.getStationCode())) { + dataList = stationDetailInfoMap.get(detailInfo.getStationCode()); + } else { + dataList = new LinkedList<>(); + stationDetailInfoMap.put(detailInfo.getStationCode(), dataList); + } + detailInfo.setId(idGenerator.incrementAndGet()); + dataList.add(detailInfo); + } + + /** + * 获取信息列表 + */ + public List getDetailInfoList(String stationCode) { + return stationDetailInfoMap.getOrDefault(stationCode, new LinkedList<>()); + } + + + /** + * 施工登记信息 + */ + @Data + public static class ConstructionInfo { + private Integer id; + + /** + * 车站信息 + */ + private String stationCode; + + /** + * 本月施工编号 + */ + private String no; + + /** + * 施工项目 + */ + private String projectName; + + /** + * 请求施工登记时间 + */ + private String requestDate; + + /** + * 请求施工登记详情信息 + */ + private String requestDetails; + + /** + * 请求施工登记所需时间 + */ + private String planSpendTime; + + /** + * 承认施工详情信息 + */ + private String acceptDetail; + + /** + * 施工后开通检查确认、销记 时间 + */ + private String confirmReviewDate; + + /** + * 施工后开通检查确认、销记 详情 + */ + private String confirmReviewDetail; + + /** + * 施工开通 + */ + private String constructionOpenDetail; + + /** + * 备注 + */ + private String remark; + } + +} diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/data/KeyLinkControlInfo.java b/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/data/book/KeyLinkControlInfo.java similarity index 98% rename from src/main/java/club/joylink/rtss/simulation/cbtc/CTC/data/KeyLinkControlInfo.java rename to src/main/java/club/joylink/rtss/simulation/cbtc/CTC/data/book/KeyLinkControlInfo.java index 3fe4d14c9..48d30d933 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/data/KeyLinkControlInfo.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/data/book/KeyLinkControlInfo.java @@ -1,4 +1,4 @@ -package club.joylink.rtss.simulation.cbtc.CTC.data; +package club.joylink.rtss.simulation.cbtc.CTC.data.book; import club.joylink.rtss.simulation.cbtc.exception.SimulationException; import club.joylink.rtss.simulation.cbtc.exception.SimulationExceptionType; diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/operation/RailOperateHandler.java b/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/operation/RailOperateHandler.java index 131c3a3f7..3102c9cb8 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/operation/RailOperateHandler.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/operation/RailOperateHandler.java @@ -3,9 +3,9 @@ package club.joylink.rtss.simulation.cbtc.CTC.operation; import club.joylink.rtss.simulation.cbtc.ATS.operation.Operation; import club.joylink.rtss.simulation.cbtc.ATS.operation.annotation.OperateHandler; import club.joylink.rtss.simulation.cbtc.ATS.operation.annotation.OperateHandlerMapping; -import club.joylink.rtss.simulation.cbtc.CTC.data.KeyLinkControlInfo; +import club.joylink.rtss.simulation.cbtc.CTC.data.book.KeyLinkControlInfo; import club.joylink.rtss.simulation.cbtc.CTC.data.Ticket; -import club.joylink.rtss.simulation.cbtc.CTC.service.KeyLinkControlService; +import club.joylink.rtss.simulation.cbtc.CTC.service.RailBookService; import club.joylink.rtss.simulation.cbtc.CTC.service.RailRegisterService; import club.joylink.rtss.simulation.cbtc.CTC.data.Register; import club.joylink.rtss.simulation.cbtc.CTC.service.RailTicketService; @@ -26,7 +26,7 @@ public class RailOperateHandler { @Autowired private RailTicketService railTicketService; @Autowired - private KeyLinkControlService keyLinkControlService; + private RailBookService keyLinkControlService; /** * 填写行车簿册 @@ -73,7 +73,7 @@ public class RailOperateHandler { */ @OperateHandlerMapping(type = Operation.Type.KEY_LINK_CONTROL_INFO_SAVE) public void saveKeyLinkControlInfo(Simulation simulation, KeyLinkControlInfo.DetailInfo detailInfo) { - keyLinkControlService.save(simulation, detailInfo); + keyLinkControlService.saveKeyLine(simulation, detailInfo); } /** @@ -81,7 +81,7 @@ public class RailOperateHandler { */ @OperateHandlerMapping(type = Operation.Type.KEY_LINK_CONTROL_INFO_UPDATE) public void updateKeyLinkControlInfo(Simulation simulation, KeyLinkControlInfo.DetailInfo detailInfo) { - keyLinkControlService.update(simulation, detailInfo); + keyLinkControlService.updateKeyLine(simulation, detailInfo); } /** @@ -89,6 +89,6 @@ public class RailOperateHandler { */ @OperateHandlerMapping(type = Operation.Type.KEY_LINK_CONTROL_INFO_QUERY) public List queryKeyLinkControlInfo(Simulation simulation, String stationCode) { - return keyLinkControlService.query(simulation, stationCode); + return keyLinkControlService.queryKeyLine(simulation, stationCode); } } diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/service/KeyLinkControlService.java b/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/service/KeyLinkControlService.java deleted file mode 100644 index 15011c904..000000000 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/service/KeyLinkControlService.java +++ /dev/null @@ -1,35 +0,0 @@ -package club.joylink.rtss.simulation.cbtc.CTC.service; - -import club.joylink.rtss.simulation.cbtc.CTC.data.KeyLinkControlInfo; -import club.joylink.rtss.simulation.cbtc.Simulation; -import org.springframework.stereotype.Service; - -import java.util.List; - -/** - * 非正常情况接发列车关键环节控制表 - */ -@Service -public class KeyLinkControlService { - - /** - * 保存非正常情况接发列车关键环节控制表 - */ - public void save(Simulation simulation, KeyLinkControlInfo.DetailInfo detailInfo) { - simulation.getCtcRepository().getKeyLinkControlInfo().saveDetailInfo(detailInfo); - } - - /** - * 更新非正常情况接发列车关键环节控制表 - */ - public void update(Simulation simulation, KeyLinkControlInfo.DetailInfo detailInfo) { - simulation.getCtcRepository().getKeyLinkControlInfo().updateDetailInfo(detailInfo); - } - - /** - * 查询非正常情况接发列车关键环节控制表 - */ - public List query(Simulation simulation, String stationCode) { - return simulation.getCtcRepository().getKeyLinkControlInfo().getDetailInfoList(stationCode); - } -} diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/service/RailBookService.java b/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/service/RailBookService.java new file mode 100644 index 000000000..3f3235438 --- /dev/null +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/service/RailBookService.java @@ -0,0 +1,51 @@ +package club.joylink.rtss.simulation.cbtc.CTC.service; + +import club.joylink.rtss.simulation.cbtc.CTC.data.book.EquipmentConstructionInfo; +import club.joylink.rtss.simulation.cbtc.CTC.data.book.KeyLinkControlInfo; +import club.joylink.rtss.simulation.cbtc.Simulation; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 非正常情况接发列车关键环节控制表 + */ +@Service +public class RailBookService { + + /** + * 保存非正常情况接发列车关键环节控制表 + */ + public void saveKeyLine(Simulation simulation, KeyLinkControlInfo.DetailInfo detailInfo) { + simulation.getCtcRepository().getKeyLinkControlInfo().saveDetailInfo(detailInfo); + } + + /** + * 更新非正常情况接发列车关键环节控制表 + */ + public void updateKeyLine(Simulation simulation, KeyLinkControlInfo.DetailInfo detailInfo) { + simulation.getCtcRepository().getKeyLinkControlInfo().updateDetailInfo(detailInfo); + } + + /** + * 查询非正常情况接发列车关键环节控制表 + */ + public List queryKeyLine(Simulation simulation, String stationCode) { + return simulation.getCtcRepository().getKeyLinkControlInfo().getDetailInfoList(stationCode); + } + + /** + * 保存行车设备施工登记 + */ + public void saveEquipmentConstructionInfo(Simulation simulation, EquipmentConstructionInfo.ConstructionInfo detailInfo) { + simulation.getCtcRepository().getEquipmentConstructionInfo().saveDetailInfo(detailInfo); + } + + /** + * 获取行车设备施工登记信息列表 + */ + public List queryEquipmentConstructionInfo(Simulation simulation, String stationCode) { + return simulation.getCtcRepository().getEquipmentConstructionInfo().getDetailInfoList(stationCode); + } + +} From 5d08b5bd1e6fffa2a216d913f3fc0266bed42d02 Mon Sep 17 00:00:00 2001 From: weizhihong Date: Wed, 1 Feb 2023 14:46:40 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E3=80=90=E8=A1=8C=E8=BD=A6=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E6=96=BD=E5=B7=A5=E7=99=BB=E8=AE=B0=E7=B0=BF=E3=80=81?= =?UTF-8?q?=E4=BA=A4=E6=8E=A5=E7=8F=AD=E8=AE=B0=E5=BD=95=E7=B0=BF=EF=BC=88?= =?UTF-8?q?=E5=8C=BA=E6=AE=B5=E7=AB=99=E3=80=81=E4=B8=AD=E9=97=B4=E7=AB=99?= =?UTF-8?q?=E3=80=81=E5=A4=96=E5=8B=A4=E5=8A=A9=E7=90=86=E3=80=81=E8=B0=83?= =?UTF-8?q?=E8=BD=A6=E5=8C=BA=E9=95=BF=E3=80=81=E8=B0=83=E5=BA=A6=E5=91=98?= =?UTF-8?q?=E3=80=81=E8=BD=A6=E5=8F=B7=E9=95=BF=EF=BC=89=E5=BD=95=E5=85=A5?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cbtc/ATS/operation/Operation.java | 70 +++ .../cbtc/CTC/data/CtcRepository.java | 6 + .../CTC/data/book/SupervisorHandOverInfo.java | 510 ++++++++++++++++++ .../CTC/operation/RailOperateHandler.java | 122 ++++- .../cbtc/CTC/service/RailBookService.java | 17 +- 5 files changed, 720 insertions(+), 5 deletions(-) create mode 100644 src/main/java/club/joylink/rtss/simulation/cbtc/CTC/data/book/SupervisorHandOverInfo.java diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/operation/Operation.java b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/operation/Operation.java index 2379c2773..75e932efb 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/operation/Operation.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/ATS/operation/Operation.java @@ -1415,6 +1415,76 @@ public class Operation { */ KEY_LINK_CONTROL_INFO_QUERY(new Label[]{Label.CLIENT}, true), + /** + * 保存行车设备施工登记信息 + */ + EQUIPMENT_CONSTRUCTION_INFO_SAVE(new Label[]{Label.CLIENT}, true), + + /** + * 查询行车设备施工登记信息 + */ + EQUIPMENT_CONSTRUCTION_INFO_QUERY(new Label[]{Label.CLIENT}, true), + + /** + * 保存区段站交接班记录 + */ + HAND_OVER_SECTION_STATION_SAVE(new Label[]{Label.CLIENT}, true), + + /** + * 获取区间站交接班记录 + */ + HAND_OVER_SECTION_STATION_QUERY(new Label[]{Label.CLIENT}, true), + + /** + * 保存中间站交接班记录 + */ + HAND_OVER_MIDDLE_STATION_SAVE(new Label[]{Label.CLIENT}, true), + + /** + * 获取中间站交接班记录 + */ + HAND_OVER_MIDDLE_STATION_QUERY(new Label[]{Label.CLIENT}, true), + + /** + * 保存外勤助理值班员交接班记录 + */ + HAND_OVER_FIELD_PERSONNEL_SAVE(new Label[]{Label.CLIENT}, true), + + /** + * 获取外勤助理值班员交接班记录 + */ + HAND_OVER_FIELD_PERSONNEL_QUERY(new Label[]{Label.CLIENT}, true), + + /** + * 保存调车区长交接班记录 + */ + HAND_OVER_SHUT_SAVE(new Label[]{Label.CLIENT}, true), + + /** + * 获取调车区长交接班记录 + */ + HAND_OVER_SHUT_QUERY(new Label[]{Label.CLIENT}, true), + + /** + * 保存车站调度员交接班记录 + */ + HAND_OVER_DISPATCHER_SAVE(new Label[]{Label.CLIENT}, true), + + /** + * 获取车站调度员交接班记录 + */ + HAND_OVER_DISPATCHER_QUERY(new Label[]{Label.CLIENT}, true), + + /** + * 保存车号长交接班记录 + */ + HAND_OVER_STATION_MASTER_SAVE(new Label[]{Label.CLIENT}, true), + + /** + * 获取车号长交接班记录 + */ + HAND_OVER_STATION_MASTER_QUERY(new Label[]{Label.CLIENT}, true), + //----------------------------会话信息------------------------------ /** * 电话:创建电话消息 diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/data/CtcRepository.java b/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/data/CtcRepository.java index e2848685a..eb823b4c5 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/data/CtcRepository.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/data/CtcRepository.java @@ -3,6 +3,7 @@ package club.joylink.rtss.simulation.cbtc.CTC.data; import club.joylink.rtss.exception.BusinessExceptionAssertEnum; import club.joylink.rtss.simulation.cbtc.CTC.data.book.EquipmentConstructionInfo; import club.joylink.rtss.simulation.cbtc.CTC.data.book.KeyLinkControlInfo; +import club.joylink.rtss.simulation.cbtc.CTC.data.book.SupervisorHandOverInfo; import club.joylink.rtss.simulation.cbtc.CTC.data.vo.CtcRunPlanVO; import club.joylink.rtss.simulation.cbtc.CTC.data.vo.CtcStationRunPlanLogVO; import club.joylink.rtss.simulation.cbtc.CTC.data.vo.RouteSequenceVO; @@ -151,6 +152,11 @@ public class CtcRepository { */ private final EquipmentConstructionInfo equipmentConstructionInfo = new EquipmentConstructionInfo(); + /** + * 交接班记录登记薄 + */ + private final SupervisorHandOverInfo supervisorHandOverInfo = new SupervisorHandOverInfo(); + public void reset(Simulation simulation) { MapConfig config = simulation.getRepository().getConfig(); // 仿真运行数据直接清空 diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/data/book/SupervisorHandOverInfo.java b/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/data/book/SupervisorHandOverInfo.java new file mode 100644 index 000000000..2c0d94694 --- /dev/null +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/data/book/SupervisorHandOverInfo.java @@ -0,0 +1,510 @@ +package club.joylink.rtss.simulation.cbtc.CTC.data.book; + +import club.joylink.rtss.simulation.cbtc.exception.SimulationException; +import club.joylink.rtss.simulation.cbtc.exception.SimulationExceptionType; +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; +import org.springframework.util.StringUtils; + +import java.util.*; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.stream.Collectors; + +/** + * 交接班记录簿 + */ +@Data +public class SupervisorHandOverInfo { + + @JsonIgnore + private final AtomicInteger idGenerator = new AtomicInteger(0); + + /** + * 各个车站的交接班信息 + */ + private Map> handOverDetailInfoMap = new HashMap<>(); + + /** + * 保存交接班信息 + * @param detailInfo 详情信息 + */ + public void saveDetailInfo(CommonInfo detailInfo) { + if (StringUtils.isEmpty(detailInfo.getStationCode())) { + throw new SimulationException(SimulationExceptionType.Illegal_Argument, "车站信息为空"); + } + List dataList = null; + if (handOverDetailInfoMap.containsKey(detailInfo.getStationCode())) { + dataList = handOverDetailInfoMap.get(detailInfo.getStationCode()); + } else { + dataList = new LinkedList<>(); + handOverDetailInfoMap.put(detailInfo.getStationCode(), dataList); + } + detailInfo.setId(idGenerator.incrementAndGet()); + dataList.add(detailInfo); + } + + /** + * 筛选出交接班信息 + */ + public List getDetailInfoList(String stationCode, HandOverType clsType) { + if (!handOverDetailInfoMap.containsKey(stationCode)) { + return new LinkedList<>(); + } + return handOverDetailInfoMap.get(stationCode).stream().filter(d -> Objects.equals(clsType, d.getType())).collect(Collectors.toList()); + } + + /** + * 一些公共属性 + */ + @Data + public static abstract class CommonInfo { + /** + * 主键 + */ + private Integer id; + + /** + * 交接班薄类型 + */ + private HandOverType type; + + /** + * 车站编码 + */ + private String stationCode; + + /** + * 日期 + */ + private String dateStr; + + /** + * 时间 + */ + private String timeStr; + + /** + * 交班者名字 + */ + private String shifterName; + + /** + * 接班者名字 + */ + private String takerName; + } + + /** + * 表详情 + */ + @Data + public static abstract class DetailInfo extends CommonInfo { + /** + * 文电指示 + */ + private String messageContent; + + /** + * 行车设备 + */ + private String travelEquipment; + + /** + * 行车备品 + */ + private String travelSparePart; + + /** + * 路票 + */ + private String ticketContent; + + /** + * 班前预想 + */ + private String workExpect; + + /** + * 班后总结 + */ + private String workSummary; + + /** + * 操作计数器 + */ + private List counterItemList; + } + + /** + * (区段站)值班员交班详情 + */ + @Data + public static class SectionStationDetailInfo extends DetailInfo { + /** + * 左侧列车占线情况 + */ + private FieldInfo leftField; + + /** + * 右侧列车占线情况 + */ + private FieldInfo rightField; + + public SectionStationDetailInfo() { + this.setType(HandOverType.SECTION_STATION); + } + } + + /** + * (中间站)值班员交班详情 + */ + @Data + public static class MiddleStationDetailInfo extends DetailInfo { + /** + * 日班计划 + */ + private List dayShiftPlanList; + + /** + * 当前车情况 + */ + private String currentSituation; + + /** + * 齿轮工具 + */ + private List gearToolList; + + public MiddleStationDetailInfo() { + this.setType(HandOverType.MIDDLE_STATION); + } + } + + /** + * 外勤助理值班员交接班记录 + */ + @Data + public static class FieldPersonnelDetailInfo extends CommonInfo { + /** + * 站内车 + */ + private String stationCar; + + /** + * 行车备品 + */ + private String travelSparePart; + + /** + * 路票 + */ + private String ticketContent; + + /** + * 止轮工具 + */ + private String gearToolContent; + + public FieldPersonnelDetailInfo() { + this.setType(HandOverType.FIELD_PERSONNEL); + } + } + + /** + * 调车区长交接班记录簿填写样式 + */ + @Data + public static class ShuntDetailInfo extends CommonInfo { + /** + * 待编列车 + */ + private WaitTrainInfo waitTrainInfo; + + /** + * 待解列车 + */ + private WaitTrainInfo unblockTrainInfo; + + /** + * 待取车 + */ + private WaitTrainInfo fetchTrainInfo; + + /** + * 代送车 + */ + private WaitTrainInfo deliverTrainInfo; + + /** + * 重点挂运车辆 + */ + private WaitTrainInfo priorityTrainInfo; + + /** + * 确报份数 + */ + private String confirmNumber; + + /** + * 调车机整备时间 + */ + private String shutPrepareTime; + + /** + * 设备备品 + */ + private String travelSparePart; + + public ShuntDetailInfo() { + this.setType(HandOverType.SHUNT); + } + } + + /** + * 车站调度员交接班记录簿样式 + */ + @Data + public static class StationDispatcherDetailInfo extends CommonInfo { + /** + * 命令指示 + */ + private String commandInstructs; + + /** + * 重点工作 + */ + private String priorityWork; + + /** + * 调车机停留线路 + */ + private String shutStayLine; + + /** + * 整备时间 + */ + private String shutSetupTime; + + /** + * 车站施工地点 + */ + private String constructionLocation; + + /** + * 车站施工起止时间 + */ + private String constructionStartEndTime; + + /** + * 设备备品 + */ + private String travelSparePart; + + public StationDispatcherDetailInfo() { + this.setType(HandOverType.DISPATCHER); + } + } + + /** + * 车号长(员)交接班记录簿填写样式 + */ + @Data + public static class StationMasterDetailInfo extends CommonInfo { + /** + * 待发列车车次 + */ + private String waitTripNumber; + + /** + * 待发列车时间 + */ + private String waitTime; + + /** + * 上行票据张数 + */ + private String upTicket; + + /** + * 下行票据张数 + */ + private String downTicket; + + /** + * 行车设备 + */ + private String travelEquipment; + + /** + * 行车备品 + */ + private String travelSparePart; + + /** + * 列车编组顺序表-待接车 + */ + private String groupReceiveTrain; + + /** + * 列车编组顺序表-待发车 + */ + private String groupDepartTrain; + + /** + * 列车确报-待接车 + */ + private String confirmReceiveTrain; + + /** + * 列车确报-待发车 + */ + private String confirmDepartTrain; + + /** + * 记事 + */ + private String remark; + + public StationMasterDetailInfo() { + this.setType(HandOverType.STATION_MASTER); + } + } + + /** + * 占线情况详情 + */ + @Data + public static class FieldInfo { + private String name; + + private List fieldItemList; + } + + /** + * 占线情况条目 + */ + @Data + public static class FieldItem { + /** + * 线别 + */ + private String lineCode; + + /** + * 车次 + */ + private String tripNumber; + + /** + * 闭塞状态 + */ + private boolean blocked; + + /** + * 挂头状态 + */ + private boolean hung; + + /** + * 编完状态 + */ + private boolean complete; + } + + /** + * 计数器示例 + */ + @Data + public static class CounterItem { + /** + * 名称 + */ + private String name; + + /** + * 号码 + */ + private String number; + } + + /** + * 日班计划 + */ + @Data + public static class DayShiftPlan { + /** + * 名称 + */ + private String name; + + /** + * 内容 + */ + private String content; + } + + /** + * 齿轮工具 + */ + @Data + public static class GearTool { + /** + * 名称 + */ + private String name; + + /** + * 地点 + */ + private String location; + + /** + * 齿轮工具 + */ + private String amount; + } + + /** + * 等待列车信息 + */ + @Data + public static class WaitTrainInfo { + /** + * 车次 + */ + private String tripNumber; + + /** + * 股道 + */ + private String section; + + /** + * 数量 + */ + private String count; + + /** + * 时间字符串 + */ + private String timeStr; + } + + /** + * 交接班薄类型 + */ + public enum HandOverType { + SECTION_STATION("区段车站的交接班记录"), MIDDLE_STATION("中间车站的交接班记录"), + FIELD_PERSONNEL("外勤助理值班员的交接班记录"), SHUNT("调车区长交接班记录"), + DISPATCHER("车站调度员交接班记录"), STATION_MASTER("车号长(员)交接班记录"); + + /** + * 描述 + */ + private String describe; + + HandOverType(String describe) { + this.describe = describe; + } + } +} diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/operation/RailOperateHandler.java b/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/operation/RailOperateHandler.java index 3102c9cb8..ab59adca2 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/operation/RailOperateHandler.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/operation/RailOperateHandler.java @@ -3,8 +3,10 @@ package club.joylink.rtss.simulation.cbtc.CTC.operation; import club.joylink.rtss.simulation.cbtc.ATS.operation.Operation; import club.joylink.rtss.simulation.cbtc.ATS.operation.annotation.OperateHandler; import club.joylink.rtss.simulation.cbtc.ATS.operation.annotation.OperateHandlerMapping; +import club.joylink.rtss.simulation.cbtc.CTC.data.book.EquipmentConstructionInfo; import club.joylink.rtss.simulation.cbtc.CTC.data.book.KeyLinkControlInfo; import club.joylink.rtss.simulation.cbtc.CTC.data.Ticket; +import club.joylink.rtss.simulation.cbtc.CTC.data.book.SupervisorHandOverInfo; import club.joylink.rtss.simulation.cbtc.CTC.service.RailBookService; import club.joylink.rtss.simulation.cbtc.CTC.service.RailRegisterService; import club.joylink.rtss.simulation.cbtc.CTC.data.Register; @@ -26,7 +28,7 @@ public class RailOperateHandler { @Autowired private RailTicketService railTicketService; @Autowired - private RailBookService keyLinkControlService; + private RailBookService railBookService; /** * 填写行车簿册 @@ -73,7 +75,7 @@ public class RailOperateHandler { */ @OperateHandlerMapping(type = Operation.Type.KEY_LINK_CONTROL_INFO_SAVE) public void saveKeyLinkControlInfo(Simulation simulation, KeyLinkControlInfo.DetailInfo detailInfo) { - keyLinkControlService.saveKeyLine(simulation, detailInfo); + railBookService.saveKeyLine(simulation, detailInfo); } /** @@ -81,7 +83,7 @@ public class RailOperateHandler { */ @OperateHandlerMapping(type = Operation.Type.KEY_LINK_CONTROL_INFO_UPDATE) public void updateKeyLinkControlInfo(Simulation simulation, KeyLinkControlInfo.DetailInfo detailInfo) { - keyLinkControlService.updateKeyLine(simulation, detailInfo); + railBookService.updateKeyLine(simulation, detailInfo); } /** @@ -89,6 +91,118 @@ public class RailOperateHandler { */ @OperateHandlerMapping(type = Operation.Type.KEY_LINK_CONTROL_INFO_QUERY) public List queryKeyLinkControlInfo(Simulation simulation, String stationCode) { - return keyLinkControlService.queryKeyLine(simulation, stationCode); + return railBookService.queryKeyLine(simulation, stationCode); + } + + /** + * 保存行车设备施工登记信息 + */ + @OperateHandlerMapping(type = Operation.Type.EQUIPMENT_CONSTRUCTION_INFO_SAVE) + public void saveConstructionInfo(Simulation simulation, EquipmentConstructionInfo.ConstructionInfo detailInfo) { + railBookService.saveEquipmentConstructionInfo(simulation, detailInfo); + } + + /** + * 查询行车设备施工登记信息 + */ + @OperateHandlerMapping(type = Operation.Type.EQUIPMENT_CONSTRUCTION_INFO_QUERY) + public List queryConstructionInfo(Simulation simulation, String stationCode) { + return railBookService.queryEquipmentConstructionInfo(simulation, stationCode); + } + + /** + * 保存区段站交接班记录 + */ + @OperateHandlerMapping(type = Operation.Type.HAND_OVER_SECTION_STATION_SAVE) + public void saveSectionStationHandOverInfo(Simulation simulation, SupervisorHandOverInfo.SectionStationDetailInfo detailInfo) { + railBookService.saveHandOverInfo(simulation, detailInfo); + } + + /** + * 获取区间站交接班记录 + */ + @OperateHandlerMapping(type = Operation.Type.HAND_OVER_SECTION_STATION_QUERY) + public List querySectionStationHandOverInfo(Simulation simulation, String stationCode) { + return railBookService.queryHandOverInfo(simulation, stationCode, SupervisorHandOverInfo.HandOverType.SECTION_STATION); + } + + /** + * 保存中间站交接班记录 + */ + @OperateHandlerMapping(type = Operation.Type.HAND_OVER_MIDDLE_STATION_SAVE) + public void saveMiddleStationHandOverInfo(Simulation simulation, SupervisorHandOverInfo.MiddleStationDetailInfo detailInfo) { + railBookService.saveHandOverInfo(simulation, detailInfo); + } + + /** + * 获取中间站交接班记录 + */ + @OperateHandlerMapping(type = Operation.Type.HAND_OVER_MIDDLE_STATION_QUERY) + public List queryMiddleStationHandOverInfo(Simulation simulation, String stationCode) { + return railBookService.queryHandOverInfo(simulation, stationCode, SupervisorHandOverInfo.HandOverType.MIDDLE_STATION); + } + + /** + * 保存外勤助理值班员交接班记录 + */ + @OperateHandlerMapping(type = Operation.Type.HAND_OVER_FIELD_PERSONNEL_SAVE) + public void saveFieldPersonnelHandOverInfo(Simulation simulation, SupervisorHandOverInfo.FieldPersonnelDetailInfo detailInfo) { + railBookService.saveHandOverInfo(simulation, detailInfo); + } + + /** + * 获取外勤助理值班员交接班记录 + */ + @OperateHandlerMapping(type = Operation.Type.HAND_OVER_FIELD_PERSONNEL_QUERY) + public List queryFieldPersonnelHandOverInfo(Simulation simulation, String stationCode) { + return railBookService.queryHandOverInfo(simulation, stationCode, SupervisorHandOverInfo.HandOverType.FIELD_PERSONNEL); + } + + /** + * 保存调车区长交接班记录 + */ + @OperateHandlerMapping(type = Operation.Type.HAND_OVER_SHUT_SAVE) + public void saveShutHandOverInfo(Simulation simulation, SupervisorHandOverInfo.ShuntDetailInfo detailInfo) { + railBookService.saveHandOverInfo(simulation, detailInfo); + } + + /** + * 获取调车区长交接班记录 + */ + @OperateHandlerMapping(type = Operation.Type.HAND_OVER_SHUT_QUERY) + public List queryShutHandOverInfo(Simulation simulation, String stationCode) { + return railBookService.queryHandOverInfo(simulation, stationCode, SupervisorHandOverInfo.HandOverType.SHUNT); + } + + /** + * 保存车站调度员交接班记录 + */ + @OperateHandlerMapping(type = Operation.Type.HAND_OVER_DISPATCHER_SAVE) + public void saveDispatcherHandOverInfo(Simulation simulation, SupervisorHandOverInfo.StationDispatcherDetailInfo detailInfo) { + railBookService.saveHandOverInfo(simulation, detailInfo); + } + + /** + * 获取车站调度员交接班记录 + */ + @OperateHandlerMapping(type = Operation.Type.HAND_OVER_DISPATCHER_QUERY) + public List queryDispatcherHandOverInfo(Simulation simulation, String stationCode) { + return railBookService.queryHandOverInfo(simulation, stationCode, SupervisorHandOverInfo.HandOverType.DISPATCHER); + } + + /** + * 保存车号长交接班记录 + */ + @OperateHandlerMapping(type = Operation.Type.HAND_OVER_STATION_MASTER_SAVE) + public void saveStationMasterHandOverInfo(Simulation simulation, SupervisorHandOverInfo.StationMasterDetailInfo detailInfo) { + railBookService.saveHandOverInfo(simulation, detailInfo); + } + + /** + * 获取车号长交接班记录 + */ + @OperateHandlerMapping(type = Operation.Type.HAND_OVER_STATION_MASTER_QUERY) + public List queryStationMasterHandOverInfo(Simulation simulation, String stationCode) { + return railBookService.queryHandOverInfo(simulation, stationCode, SupervisorHandOverInfo.HandOverType.STATION_MASTER); } } diff --git a/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/service/RailBookService.java b/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/service/RailBookService.java index 3f3235438..415abdae9 100644 --- a/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/service/RailBookService.java +++ b/src/main/java/club/joylink/rtss/simulation/cbtc/CTC/service/RailBookService.java @@ -2,6 +2,7 @@ package club.joylink.rtss.simulation.cbtc.CTC.service; import club.joylink.rtss.simulation.cbtc.CTC.data.book.EquipmentConstructionInfo; import club.joylink.rtss.simulation.cbtc.CTC.data.book.KeyLinkControlInfo; +import club.joylink.rtss.simulation.cbtc.CTC.data.book.SupervisorHandOverInfo; import club.joylink.rtss.simulation.cbtc.Simulation; import org.springframework.stereotype.Service; @@ -44,8 +45,22 @@ public class RailBookService { /** * 获取行车设备施工登记信息列表 */ - public List queryEquipmentConstructionInfo(Simulation simulation, String stationCode) { + public List queryEquipmentConstructionInfo(Simulation simulation, String stationCode) { return simulation.getCtcRepository().getEquipmentConstructionInfo().getDetailInfoList(stationCode); } + /** + * 保存交接班记录信息 + */ + public void saveHandOverInfo(Simulation simulation, SupervisorHandOverInfo.CommonInfo handoverInfo) { + simulation.getCtcRepository().getSupervisorHandOverInfo().saveDetailInfo(handoverInfo); + } + + /** + * 获取车站对应类型的交接薄记录信息 + */ + public List queryHandOverInfo(Simulation simulation, String stationCode, SupervisorHandOverInfo.HandOverType type) { + return simulation.getCtcRepository().getSupervisorHandOverInfo().getDetailInfoList(stationCode, type); + } + }