| 
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -12,6 +12,7 @@ import com.zc.business.constant.RedisKeyConstants; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.zc.business.domain.*; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.zc.business.enums.LocationEnum; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.zc.business.enums.StakeMarkRange; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.zc.business.enums.TrafficFlowDoorFrameSection; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.zc.business.enums.UniversalEnum; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.zc.business.service.IDcDeviceService; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.zc.business.service.IDcFacilityService; | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -932,7 +933,7 @@ public class DcTrafficStatisticsServiceImpl implements IDcTrafficStatisticsServi | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        // 初始化计数器和描述映射
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        Map<Integer, Integer> flowCounts = new HashMap<>(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        Map<Integer, String> descriptions = new HashMap<>(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        for (int i = UniversalEnum.ONE.getNumber(); i <= 16; i++) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        for (int i = UniversalEnum.ONE.getNumber(); i <= 13; i++) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            flowCounts.put(i, UniversalEnum.ZERO.getNumber()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            descriptions.put(i, UniversalEnum.EMPTY_STRING.getValue()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -957,12 +958,12 @@ public class DcTrafficStatisticsServiceImpl implements IDcTrafficStatisticsServi | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                            .anyMatch(dcFacility -> dcFacility.getId().equals(dcFacility2.getId())); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    if (exists) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        int extractedNumber = Integer.parseInt(extract(stakeMark)); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        int identification = Arrays.stream(StakeMarkRange.values()) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        int identification = Arrays.stream(TrafficFlowDoorFrameSection.values()) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                                .filter(smRange -> extractedNumber >= smRange.getStakeMark() && extractedNumber <= smRange.getEndMark()) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                                .mapToInt(StakeMarkRange::getIdentification) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                                .mapToInt(TrafficFlowDoorFrameSection::getIdentification) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                                .findFirst() | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                                .orElse(UniversalEnum.ZERO.getNumber()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        String description = getDescriptionByIdentification(identification); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        String description = getTrafficFlowDoorFrameSection(identification); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        descriptions.put(identification, description); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        flowCounts.put(identification, flowCounts.get(identification) + totalFlow); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    } | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -971,9 +972,9 @@ public class DcTrafficStatisticsServiceImpl implements IDcTrafficStatisticsServi | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        // 构建结果列表
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        List<Map<String, Object>> mapList = new ArrayList<>(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        for (int i = UniversalEnum.ONE.getNumber(); i <= 16; i++) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        for (int i = UniversalEnum.ONE.getNumber(); i <= 13; i++) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            Map<String, Object> map = new HashMap<>(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            map.put("name", getDescriptionByIdentification(i)); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            map.put("name", getTrafficFlowDoorFrameSection(i)); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            map.put("totalFlow", flowCounts.get(i)); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            mapList.add(map); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -1039,6 +1040,14 @@ public class DcTrafficStatisticsServiceImpl implements IDcTrafficStatisticsServi | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        return UniversalEnum.EMPTY_STRING.getValue(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    public static String getTrafficFlowDoorFrameSection(int identification) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        for (TrafficFlowDoorFrameSection range : TrafficFlowDoorFrameSection.values()) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if (range.getIdentification() == identification) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                return range.getDescription(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        return UniversalEnum.EMPTY_STRING.getValue(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    public List<Map<String, Object>> queryTheGantryDataByPileNumber(String startDate, String stakeMark) throws HttpException, IOException { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -1474,6 +1483,78 @@ public class DcTrafficStatisticsServiceImpl implements IDcTrafficStatisticsServi | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    @Override | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    public Map<String, Integer> trafficFlowAtTollTypes(String startDate) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        Map<String, Integer> map = new HashMap<>(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        try { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            Response response = getResponseTrafficFlowAtToll(startDate, UniversalEnum.ONE.getValue()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            Response responseTwo = getResponseTrafficFlowAtToll(startDate, UniversalEnum.TWO.getValue()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            ResponseBody body = response.body(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            ResponseBody bodyTwo = responseTwo.body(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            Integer bus; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            Integer truck; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            Integer bus1_flow = UniversalEnum.ZERO.getNumber(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            Integer bus2_flow = UniversalEnum.ZERO.getNumber(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            Integer bus3_flow = UniversalEnum.ZERO.getNumber(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            Integer bus4_flow = UniversalEnum.ZERO.getNumber(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            Integer truck1_flow = UniversalEnum.ZERO.getNumber(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            Integer truck2_flow = UniversalEnum.ZERO.getNumber(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            Integer truck3_flow = UniversalEnum.ZERO.getNumber(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            Integer truck4_flow = UniversalEnum.ZERO.getNumber(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            Integer truck5_flow = UniversalEnum.ZERO.getNumber(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            Integer truck6_flow = UniversalEnum.ZERO.getNumber(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if (body != null) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                String jsonString = body.string(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                if (JSON.isValidArray(jsonString)) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    JSONArray jsonArray = JSON.parseArray(jsonString); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    for (Object item : jsonArray) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        JSONObject jsonObject = (JSONObject) item; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        bus1_flow = bus1_flow + jsonObject.getInteger("bus1_flow"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        bus2_flow = bus2_flow + jsonObject.getInteger("bus2_flow"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        bus3_flow = bus3_flow + jsonObject.getInteger("bus3_flow"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        bus4_flow = bus4_flow + jsonObject.getInteger("bus4_flow"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        truck1_flow = truck1_flow + jsonObject.getInteger("truck1_flow"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        truck2_flow = truck2_flow + jsonObject.getInteger("truck2_flow"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        truck3_flow = truck3_flow + jsonObject.getInteger("truck3_flow"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        truck4_flow = truck4_flow + jsonObject.getInteger("truck4_flow"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        truck5_flow = truck5_flow + jsonObject.getInteger("truck5_flow"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        truck6_flow = truck6_flow + jsonObject.getInteger("truck6_flow"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if (bodyTwo != null) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                String jsonString = bodyTwo.string(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                if (JSON.isValidArray(jsonString)) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    JSONArray jsonArray = JSON.parseArray(jsonString); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    for (Object item : jsonArray) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        JSONObject jsonObject = (JSONObject) item; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        bus1_flow = bus1_flow + jsonObject.getInteger("bus1_flow"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        bus2_flow = bus2_flow + jsonObject.getInteger("bus2_flow"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        bus3_flow = bus3_flow + jsonObject.getInteger("bus3_flow"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        bus4_flow = bus4_flow + jsonObject.getInteger("bus4_flow"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        truck1_flow = truck1_flow + jsonObject.getInteger("truck1_flow"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        truck2_flow = truck2_flow + jsonObject.getInteger("truck2_flow"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        truck3_flow = truck3_flow + jsonObject.getInteger("truck3_flow"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        truck4_flow = truck4_flow + jsonObject.getInteger("truck4_flow"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        truck5_flow = truck5_flow + jsonObject.getInteger("truck5_flow"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        truck6_flow = truck6_flow + jsonObject.getInteger("truck6_flow"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            bus = bus1_flow + bus2_flow + bus3_flow + bus4_flow; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            truck = truck1_flow + truck2_flow + truck3_flow + truck4_flow + truck5_flow + truck6_flow; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            map.put("bus", bus); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            map.put("truck", truck); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            return map; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } catch (IOException e) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            // 处理异常
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            e.printStackTrace(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            return map; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } catch (HttpException e) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            throw new RuntimeException(e); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    private Response getResponseTrafficFlowAtToll(String startDate, String stationType) throws HttpException, IOException { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        // 创建OkHttpClient.Builder实例
 | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
				
				 | 
				
					
  |