| | |
| | | |
| | | public List<CaseStatisticsAreaDTO> sortArea(List<CaseStatisticsAreaDTO> caseStatisticsAreaDTOS){ |
| | | caseStatisticsAreaDTOS.sort((o1, o2)->{ |
| | | log.info("xsd:{},{}",o1,o2); |
| | | Integer totalScore1 = Integer.valueOf(o1.getAreaCode()); |
| | | Integer totalScore2 = Integer.valueOf(o2.getAreaCode()); |
| | | if(totalScore1 > totalScore2) { |
| | |
| | | |
| | | /** |
| | | * 根据json文件获取区域信息 |
| | | * */ |
| | | */ |
| | | public CaseAreaDTO getArea() throws IOException { |
| | | Class<?> clazz = CaseAreaDTO.class; |
| | | String path = clazz.getProtectionDomain().getCodeSource().getLocation().getPath(); |
| | | ObjectMapper mapper = new ObjectMapper(); |
| | | File file = new File(path+ "cn"+File.separator+"huge"+File.separator+"module"+File.separator+"cases"+File.separator+"domain"+File.separator+"json"+File.separator+"Area.json"); |
| | | |
| | | File file = new File("area/Area.json"); |
| | | CaseAreaDTO obj = mapper.readValue(file, CaseAreaDTO.class); |
| | | return obj; |
| | | } |
| | |
| | | |
| | | /** |
| | | * 根据不同的等级获取不同区域子集合 |
| | | * |
| | | * @param areaType 1-市级 2-区 |
| | | * */ |
| | | */ |
| | | public List<CaseAreaDTO> listAreaByType(Object areaType,Object areaCode) throws IOException { |
| | | log.info("listAreaByType {},{}",areaType,areaCode); |
| | | CaseAreaDTO area = getArea(); |
| | | log.info("listAreaByType area {}",JSON.toJSONString(area)); |
| | | if(ObjectUtils.isEmpty(areaType) || areaType.equals("") || areaType.equals("1")){ |
| | | return area.getChildren(); |
| | | } |