|
@@ -187,8 +187,8 @@ public class XzczghcgsbServiceImpl implements XzczghcgsbService {
|
|
|
@Override
|
|
|
public List<TreeAnalyse> getStatistics() {
|
|
|
int current = 1;
|
|
|
-// List<LandMyAttend.RecordsDTO> list = getAllLandMyAttendsData(2, current, 200, "1506");
|
|
|
- List<LandMyAttend.RecordsDTO> list = new ArrayList<>();
|
|
|
+ List<LandMyAttend.RecordsDTO> list = getAllLandMyAttendsData(2, current, 200, "1506");
|
|
|
+// List<LandMyAttend.RecordsDTO> list = new ArrayList<>();
|
|
|
// 根据divisionCode的前9位进行divisionCode分组数量
|
|
|
Map<String, List<String>> townCountMap = new HashMap<>();
|
|
|
// 根据divisionCode的前9位进行divisionCode分组节点类别
|
|
@@ -233,10 +233,6 @@ public class XzczghcgsbServiceImpl implements XzczghcgsbService {
|
|
|
//组织乡镇数据
|
|
|
List<TreeAnalyse> townTreeList = new ArrayList<>();
|
|
|
for (TusexzqhDTO tusexzqhDTO : townList) {
|
|
|
- if(tusexzqhDTO.getTownship().contains("魏家")){
|
|
|
- System.out.println("魏家");
|
|
|
- }
|
|
|
-
|
|
|
Integer villageNum = tuseXzqhMapper.getAllVillageNumByPid(tusexzqhDTO.getCode());
|
|
|
// Integer townReportNum = tuseXzqhMapper.getTownReportNum(tusexzqhDTO.getCode());//上报数
|
|
|
Integer townReportAllNum = tuseXzqhMapper.getTownReportAllNum(tusexzqhDTO.getCode());//颖备案数
|
|
@@ -405,22 +401,43 @@ public class XzczghcgsbServiceImpl implements XzczghcgsbService {
|
|
|
return cityTreeList;
|
|
|
}
|
|
|
|
|
|
+// private List<LandMyAttend.RecordsDTO> getAllLandMyAttendsData(int planType, int current, int size, String divisionCode) {
|
|
|
+// // 正式环境
|
|
|
+// JSONObject jsonObject = sbSearchService.getLandMyAttendsData(planType, current, size, divisionCode, "");
|
|
|
+// // 测试数据
|
|
|
+//// JSONObject jsonObject = sbSearchService.landMyAttendsData(planType, current, size, divisionCode);
|
|
|
+// List<LandMyAttend.RecordsDTO> list = new ArrayList<>();
|
|
|
+// if (jsonObject.containsKey("success") && jsonObject.getBoolean("success")) {
|
|
|
+// LandMyAttend landMyAttend = jsonObject.getObject("data", LandMyAttend.class);
|
|
|
+// list.addAll(landMyAttend.getRecords());
|
|
|
+// if (current < landMyAttend.getPages() + 1) {
|
|
|
+// list.addAll(getAllLandMyAttendsData(planType, current + 1, size, divisionCode));
|
|
|
+// }
|
|
|
+// }
|
|
|
+// return list;
|
|
|
+// }
|
|
|
+
|
|
|
+
|
|
|
private List<LandMyAttend.RecordsDTO> getAllLandMyAttendsData(int planType, int current, int size, String divisionCode) {
|
|
|
- // 正式环境
|
|
|
- JSONObject jsonObject = sbSearchService.getLandMyAttendsData(planType, current, size, divisionCode, "");
|
|
|
// 测试数据
|
|
|
-// JSONObject jsonObject = sbSearchService.landMyAttendsData(planType, current, size, divisionCode);
|
|
|
+ WebResult jsonObject = sbSearchService.landMyAttendsData(planType, current, size, divisionCode);
|
|
|
List<LandMyAttend.RecordsDTO> list = new ArrayList<>();
|
|
|
- if (jsonObject.containsKey("success") && jsonObject.getBoolean("success")) {
|
|
|
- LandMyAttend landMyAttend = jsonObject.getObject("data", LandMyAttend.class);
|
|
|
- list.addAll(landMyAttend.getRecords());
|
|
|
- if (current < landMyAttend.getPages() + 1) {
|
|
|
+ if (jsonObject.containsKey("success") && (Boolean) jsonObject.get("success")) {
|
|
|
+ HashMap<String,Object> resMap = (HashMap<String, Object>) jsonObject.get("data");
|
|
|
+
|
|
|
+ List<HashMap<String,Object>> getList= (List<HashMap<String, Object>>) resMap.get("records");
|
|
|
+ for ( Map<String,Object> mapObj: getList) {
|
|
|
+ ObjectMapper objectMapper = new ObjectMapper();
|
|
|
+ LandMyAttend.RecordsDTO recordsDTO = objectMapper.convertValue(mapObj, LandMyAttend.RecordsDTO.class);
|
|
|
+ list.add(recordsDTO);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (current < (Integer)resMap.get("pages") + 1) {
|
|
|
list.addAll(getAllLandMyAttendsData(planType, current + 1, size, divisionCode));
|
|
|
}
|
|
|
}
|
|
|
return list;
|
|
|
}
|
|
|
-
|
|
|
/**
|
|
|
* 新增记录
|
|
|
*
|