Commit 75126b49 authored by zhouleilei's avatar zhouleilei

解决时段-1问题

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