Commit 5b13fa8f authored by zhouleilei's avatar zhouleilei

计划数据-计划信息、时段信息 静态数据查询

parent 0a82502a
......@@ -157,7 +157,7 @@ public class StaticInfoServiceImpl implements StaticInfoService {
//16 个相位的最大绿时间(单位秒),中间用空格隔开,不存在的相位置 0。
String[] maxGTime = phase.getMaxGTime().split(" ");
//封装环和环上相位数据
Map<Integer, List<RingPhaseDTO>> ringPhasesMap = getRingPhasesMap(ringCount, cycleJSONObject, redTime, greenTime, yellowTime,minGTime,maxGTime);
Map<Integer, List<RingPhaseDTO>> ringPhasesMap = getRingPhasesMap(ringCount, cycleJSONObject, redTime, greenTime, yellowTime, minGTime, maxGTime);
//16 个相位的放行方向,每个相位由 8 字节整型值存储(最多支持 7 个放行方向),每个字节表示一个放行方向,
String[] channelDim = phase.getChannelDim().split(" ");
//数据处理
......@@ -180,7 +180,7 @@ public class StaticInfoServiceImpl implements StaticInfoService {
* @Param greenTime 绿
* @Param yellowTime 黄
**/
private Map<Integer, List<RingPhaseDTO>> getRingPhasesMap(int ringCount, JSONObject cycleJSONObject, String[] redTime, String[] greenTime, String[] yellowTime,String[] minGTime,String[] maxGTime) {
private Map<Integer, List<RingPhaseDTO>> getRingPhasesMap(int ringCount, JSONObject cycleJSONObject, String[] redTime, String[] greenTime, String[] yellowTime, String[] minGTime, String[] maxGTime) {
Map<Integer, List<RingPhaseDTO>> map = new HashMap<>();
for (int i = 1; i <= ringCount; i++) {
//取出环中的数据,并去掉空格和_,得到相位
......@@ -380,7 +380,7 @@ public class StaticInfoServiceImpl implements StaticInfoService {
for (RingPhaseDTO phaseDTO : ringPhaseList) {
Integer phaseId = phaseDTO.getPhaseId();
long channe = Long.valueOf(channelDim[phaseId-1]);
long channe = Long.valueOf(channelDim[phaseId - 1]);
String binaryString = Long.toBinaryString(channe);
//获取方向转向分组
List<String> binaryList = CommonUtils.groupStringFromRight(binaryString);
......@@ -393,10 +393,13 @@ public class StaticInfoServiceImpl implements StaticInfoService {
//灯组
CrossLightsPO crossLightsPO = new CrossLightsPO();
lightNum.getAndIncrement();
crossLightsPO.setLightsNo(lightNum.get()+"");
crossLightsPO.setName("灯组"+lightNum.get());
crossLightsPO.setLightsNo(lightNum.get() + "");
crossLightsPO.setName("灯组" + lightNum.get());
//默认0
crossLightsPO.setType(0);
if (wjPerson != 0) {
crossLightsPO.setType(3);
}
crossLightsPO.setDir(wjLightsDir);
crossLightsPO.setTurn(wjLightsTurn);
crossLightsPO.setCrossId(crossId);
......@@ -440,8 +443,8 @@ public class StaticInfoServiceImpl implements StaticInfoService {
String turn = dirTurn.substring(3); // 低五位 转向
Integer wjLightsDir = HiseseDirEnum.getWjLightsDir(Integer.parseInt(dir, 2));
Integer wjLightsTurn = HisenseTurnEnum.getWjLightsTurn(Integer.parseInt(turn, 2));
System.out.println("wjLightsDir "+wjLightsDir);
System.out.println("wjLightsTurn "+wjLightsTurn);
System.out.println("wjLightsDir " + wjLightsDir);
System.out.println("wjLightsTurn " + wjLightsTurn);
}
}
......@@ -478,21 +481,23 @@ public class StaticInfoServiceImpl implements StaticInfoService {
List<PlanSectionVO> list = new ArrayList<>();
//根据时段表号分组
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) {
PlanSectionVO planSectionVO = new PlanSectionVO();
List<CrossPlanPO> crossPlanPOList = new ArrayList<>();
List<CrossSectionPO> crossSectionPOList = new ArrayList<>();
//时段数据
List<VNtcipTimeBaseDayplanDTO> dayplanDTOS = collect.get(i);
for (int i1 = 0; i1 < dayplanDTOS.size(); i1++) {
VNtcipTimeBaseDayplanDTO dayplanDTO = dayplanDTOS.get(i1);
CrossPlanPO crossPlan = new CrossPlanPO();
CrossSectionPO crossSectionPO = new CrossSectionPO();
crossPlan.setCrossId(crossId);
//计划号-取的是时段表号
crossPlan.setPlanNo(dayplanDTO.getNDayPlanNumber() + "");
crossPlan.setName("海信信号机-时段表号:" + dayplanDTO.getNDayPlanNumber());
crossSectionPO.setCrossId(crossId);
//时段号 - 取的是时段序号
......@@ -522,7 +527,7 @@ public class StaticInfoServiceImpl implements StaticInfoService {
//创建时间
crossSectionPO.setGmtModified(null);
crossPlanPOList.add(crossPlan);
crossSectionPOList.add(crossSectionPO);
}
......
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