Commit 75126b49 authored by zhouleilei's avatar zhouleilei

解决时段-1问题

parent c2c28b7a
...@@ -114,7 +114,7 @@ public class SchemeConfigServiceImpl implements SchemeConfigService { ...@@ -114,7 +114,7 @@ public class SchemeConfigServiceImpl implements SchemeConfigService {
String crossId = crossIdBO.getCrossId(); String crossId = crossIdBO.getCrossId();
SaveSchemeConfigDTO saveSchemeConfigDTO = new SaveSchemeConfigDTO(); SaveSchemeConfigDTO saveSchemeConfigDTO = new SaveSchemeConfigDTO();
saveSchemeConfigDTO.setCrossId(crossId); saveSchemeConfigDTO.setCrossId(crossId);
// 构造方案列表 // 构造方案列表phaseSchemeList = {ArrayList@21896} size = 24
List<SaveSchemeConfigDTO.PhaseScheme> phaseSchemeList = buildPhaseSchemeList(crossId); List<SaveSchemeConfigDTO.PhaseScheme> phaseSchemeList = buildPhaseSchemeList(crossId);
List<SaveSchemeConfigDTO.PhaseScheme> sort = phaseSchemeList.stream() List<SaveSchemeConfigDTO.PhaseScheme> sort = phaseSchemeList.stream()
.sorted(Comparator.comparing(scheme -> Integer.parseInt(scheme.getSchemeNo()))) .sorted(Comparator.comparing(scheme -> Integer.parseInt(scheme.getSchemeNo())))
......
...@@ -496,7 +496,7 @@ public class StaticInfoServiceImpl implements StaticInfoService { ...@@ -496,7 +496,7 @@ public class StaticInfoServiceImpl implements StaticInfoService {
} }
//key //key
String lightMapKey = dir + turn + crossLightsPO.getType(); String lightMapKey = dir + turn + crossLightsPO.getType();
if (!lightsMap.containsKey(lightMapKey)){ if (!lightsMap.containsKey(lightMapKey)) {
lightNum.getAndIncrement(); lightNum.getAndIncrement();
lightsMap.put(lightMapKey, lightNum.get()); lightsMap.put(lightMapKey, lightNum.get());
crossLightsPO.setLightsNo(String.valueOf(lightsMap.get(lightMapKey))); crossLightsPO.setLightsNo(String.valueOf(lightsMap.get(lightMapKey)));
...@@ -578,7 +578,7 @@ public class StaticInfoServiceImpl implements StaticInfoService { ...@@ -578,7 +578,7 @@ public class StaticInfoServiceImpl implements StaticInfoService {
String crossId = planSectionDTO.getCrossId(); String crossId = planSectionDTO.getCrossId();
//从缓存中拿路口信息 //从缓存中拿路口信息
CrossInfoPO crossInfoPO = CrossInfoCache.getCrossInfoCache().get(crossId); CrossInfoPO crossInfoPO = CrossInfoCache.getCrossInfoCache().get(crossId);
if (Optional.ofNullable(planSectionDTO).isPresent()) { if (Optional.ofNullable(crossInfoPO).isPresent()) {
String code = crossInfoPO.getCode(); String code = crossInfoPO.getCode();
List<VNtcipTimeBaseDayplanDTO> vNtcipTimeBaseDayplanDTOS = vNtcipTimeBaseDayplanMapper.listByCrossIdAndDayPlanId(code, planSectionDTO.getPlanNo()); List<VNtcipTimeBaseDayplanDTO> vNtcipTimeBaseDayplanDTOS = vNtcipTimeBaseDayplanMapper.listByCrossIdAndDayPlanId(code, planSectionDTO.getPlanNo());
if (!CollectionUtils.isEmpty(vNtcipTimeBaseDayplanDTOS)) { if (!CollectionUtils.isEmpty(vNtcipTimeBaseDayplanDTOS)) {
...@@ -586,14 +586,16 @@ public class StaticInfoServiceImpl implements StaticInfoService { ...@@ -586,14 +586,16 @@ public class StaticInfoServiceImpl implements StaticInfoService {
//根据时段表号分组 //根据时段表号分组
Map<Integer, List<VNtcipTimeBaseDayplanDTO>> collect = vNtcipTimeBaseDayplanDTOS.stream().collect(Collectors.groupingBy(VNtcipTimeBaseDayplanDTO::getNDayPlanNumber)); Map<Integer, List<VNtcipTimeBaseDayplanDTO>> collect = vNtcipTimeBaseDayplanDTOS.stream().collect(Collectors.groupingBy(VNtcipTimeBaseDayplanDTO::getNDayPlanNumber));
List<CrossPlanPO> crossPlanPOList = new ArrayList<>(); List<CrossPlanPO> crossPlanPOList = new ArrayList<>();
Set<Integer> keySet = collect.keySet();
for (Integer i : keySet) {
CrossPlanPO crossPlan = new CrossPlanPO(); CrossPlanPO crossPlan = new CrossPlanPO();
crossPlan.setCrossId(crossId); crossPlan.setCrossId(crossId);
//计划号-取的是时段表号 //计划号-取的是时段表号
crossPlan.setPlanNo(String.valueOf(planSectionDTO.getPlanNo())); crossPlan.setPlanNo(String.valueOf(i));
crossPlan.setName("海信信号机-时段表号:" + String.valueOf(planSectionDTO.getPlanNo())); crossPlan.setName("海信信号机-时段表号:" + i);
crossPlanPOList.add(crossPlan); crossPlanPOList.add(crossPlan);
Set<Integer> keySet = collect.keySet();
for (Integer i : keySet) {
PlanSectionVO planSectionVO = new PlanSectionVO(); PlanSectionVO planSectionVO = new PlanSectionVO();
List<CrossSectionPO> crossSectionPOList = new ArrayList<>(); List<CrossSectionPO> crossSectionPOList = new ArrayList<>();
//时段数据 //时段数据
...@@ -601,8 +603,6 @@ public class StaticInfoServiceImpl implements StaticInfoService { ...@@ -601,8 +603,6 @@ public class StaticInfoServiceImpl implements StaticInfoService {
for (int i1 = 0; i1 < dayplanDTOS.size(); i1++) { for (int i1 = 0; i1 < dayplanDTOS.size(); i1++) {
VNtcipTimeBaseDayplanDTO dayplanDTO = dayplanDTOS.get(i1); VNtcipTimeBaseDayplanDTO dayplanDTO = dayplanDTOS.get(i1);
CrossSectionPO crossSectionPO = new CrossSectionPO(); CrossSectionPO crossSectionPO = new CrossSectionPO();
crossSectionPO.setCrossId(crossId); crossSectionPO.setCrossId(crossId);
//时段号 - 取的是时段序号 //时段号 - 取的是时段序号
crossSectionPO.setSectionNo(dayplanDTO.getNDayPlanEventNumber() + ""); crossSectionPO.setSectionNo(dayplanDTO.getNDayPlanEventNumber() + "");
...@@ -630,10 +630,7 @@ public class StaticInfoServiceImpl implements StaticInfoService { ...@@ -630,10 +630,7 @@ public class StaticInfoServiceImpl implements StaticInfoService {
crossSectionPO.setGmtCreate(null); crossSectionPO.setGmtCreate(null);
//创建时间 //创建时间
crossSectionPO.setGmtModified(null); crossSectionPO.setGmtModified(null);
crossSectionPOList.add(crossSectionPO); crossSectionPOList.add(crossSectionPO);
} }
planSectionVO.setCrossPlanPOList(crossPlanPOList); planSectionVO.setCrossPlanPOList(crossPlanPOList);
planSectionVO.setCrossSectionPOList(crossSectionPOList); planSectionVO.setCrossSectionPOList(crossSectionPOList);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment