|
@@ -60,6 +60,8 @@ public class IndexViewServiceImpl extends BaseServiceImpl implements IndexViewSe
|
|
|
case "8":
|
|
|
map = indexViewMapper.getFire();
|
|
|
break;
|
|
|
+ default:
|
|
|
+ break;
|
|
|
}
|
|
|
return map;
|
|
|
}
|
|
@@ -72,23 +74,19 @@ public class IndexViewServiceImpl extends BaseServiceImpl implements IndexViewSe
|
|
|
public List<IndexViewInfo> getBasicDataList(MenuInfo menu) {
|
|
|
setSookaDataBase(menu);
|
|
|
List<IndexViewInfo> basicList = new ArrayList<>();
|
|
|
-
|
|
|
-// 获取菜单信息
|
|
|
+ // 获取菜单信息
|
|
|
List<MenuInfo> basicDataList = indexViewMapper.getBasicDataList(menu);
|
|
|
|
|
|
-// 存储小类计数信息,key值为小类,value为小类数
|
|
|
+ // 存储小类计数信息,key值为小类,value为小类数
|
|
|
Map<String, Long> subclassCount = new TreeMap<>();
|
|
|
Map<String, List<MenuInfo>> resultMap = new HashMap<>();
|
|
|
-
|
|
|
for (MenuInfo item : basicDataList) {
|
|
|
String[] subclassS = item.getSubclassS().split(",");
|
|
|
String[] tableNameAndType = item.getTableNameAndType().split("/");
|
|
|
-
|
|
|
// 小类的统计次数
|
|
|
for (String subclass : subclassS) {
|
|
|
subclassCount.merge(subclass, 1L, Long::sum);
|
|
|
}
|
|
|
-
|
|
|
for (String subclass : subclassS) {
|
|
|
// 检查resultMap中是否已经存在对应subclass的键
|
|
|
if (!resultMap.containsKey(subclass)) {
|
|
@@ -97,14 +95,12 @@ public class IndexViewServiceImpl extends BaseServiceImpl implements IndexViewSe
|
|
|
// 将当前的item添加到对应subclass的列表中
|
|
|
resultMap.get(subclass).add(item);
|
|
|
}
|
|
|
-
|
|
|
// 将tableName和type放入MenuInfo对象中
|
|
|
item.setTableName(tableNameAndType[0]);
|
|
|
if (tableNameAndType.length > 1) {
|
|
|
item.setType(tableNameAndType[1]);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
// 分类名称映射
|
|
|
Map<String, String> categoryMap = new HashMap<>();
|
|
|
categoryMap.put("project", "数字项目基础数据");
|
|
@@ -118,17 +114,14 @@ public class IndexViewServiceImpl extends BaseServiceImpl implements IndexViewSe
|
|
|
categoryMap.put("traffic", "交通基础数据");
|
|
|
categoryMap.put("resources", "自然资源基础数据");
|
|
|
categoryMap.put("water", "水利基础数据");
|
|
|
-
|
|
|
for (Map.Entry<String, List<MenuInfo>> entry : resultMap.entrySet()) {
|
|
|
String subclass = entry.getKey();
|
|
|
IndexViewInfo indexViewInfo = new IndexViewInfo();
|
|
|
indexViewInfo.setCount(0L);
|
|
|
indexViewInfo.setUpdataCount(0L);
|
|
|
-
|
|
|
indexViewInfo.setCategory(categoryMap.get(subclass));
|
|
|
indexViewInfo.setCategoryEnglish(subclass);
|
|
|
indexViewInfo.setSubclass(subclassCount.get(subclass));
|
|
|
-
|
|
|
List<MenuInfo> menuInfos = entry.getValue();
|
|
|
for (MenuInfo menuInfo : menuInfos) {
|
|
|
setSookaDataBase(menuInfo);
|
|
@@ -137,7 +130,7 @@ public class IndexViewServiceImpl extends BaseServiceImpl implements IndexViewSe
|
|
|
MenuInfo menuInfo1 = new MenuInfo();
|
|
|
setSookaDataBase(menuInfo1);
|
|
|
BeanUtils.copyProperties(menuInfo, menuInfo1);
|
|
|
- if (menu.getTimeArr()!=null){
|
|
|
+ if (menu.getTimeArr() != null) {
|
|
|
String[] date = menu.getTimeArr().split(",");
|
|
|
menuInfo1.setStartDate(date[0]);
|
|
|
menuInfo1.setEndDate(date[1]);
|
|
@@ -145,25 +138,21 @@ public class IndexViewServiceImpl extends BaseServiceImpl implements IndexViewSe
|
|
|
menuInfo1.setMark("xiugai");
|
|
|
Long updateCount = indexViewMapper.getBasicDataCount(menuInfo1);
|
|
|
indexViewInfo.setUpdataCount(indexViewInfo.getUpdataCount() + updateCount);
|
|
|
-
|
|
|
}
|
|
|
basicList.add(indexViewInfo);
|
|
|
}
|
|
|
-
|
|
|
-// 统计总的数据数量
|
|
|
+ // 统计总的数据数量
|
|
|
long totalCount = 0;
|
|
|
for (IndexViewInfo info : basicList) {
|
|
|
totalCount += info.getCount();
|
|
|
}
|
|
|
-
|
|
|
IndexViewInfo indexViewInfo = new IndexViewInfo();
|
|
|
indexViewInfo.setCategory("共有基础数据类型");
|
|
|
indexViewInfo.setCategoryEnglish("all");
|
|
|
indexViewInfo.setSubclass((long) basicDataList.size());
|
|
|
indexViewInfo.setCount(totalCount);
|
|
|
basicList.add(indexViewInfo);
|
|
|
-
|
|
|
-// 使用自定义的 Comparator 对 basicList 进行排序
|
|
|
+ // 使用自定义的 Comparator 对 basicList 进行排序
|
|
|
basicList.sort(customComparator);
|
|
|
return basicList;
|
|
|
}
|
|
@@ -171,24 +160,10 @@ public class IndexViewServiceImpl extends BaseServiceImpl implements IndexViewSe
|
|
|
//排序
|
|
|
Comparator<IndexViewInfo> customComparator = (info1, info2) -> {
|
|
|
// 按照顺序进行比较
|
|
|
- List<String> order = Arrays.asList(
|
|
|
- "林业基础数据",
|
|
|
- "农业基础数据",
|
|
|
- "水利基础数据",
|
|
|
- "环保基础数据",
|
|
|
- "应急基础数据",
|
|
|
- "交通基础数据",
|
|
|
- "自然资源基础数据",
|
|
|
- "消防基础数据",
|
|
|
- "数字项目基础数据",
|
|
|
- "数字公安基础数据",
|
|
|
- "数字森侦基础数据",
|
|
|
- "共有基础数据类型"
|
|
|
- );
|
|
|
-
|
|
|
+ List<String> order = Arrays.asList("林业基础数据", "农业基础数据", "水利基础数据", "环保基础数据", "应急基础数据", "交通基础数据",
|
|
|
+ "自然资源基础数据", "消防基础数据", "数字项目基础数据", "数字公安基础数据", "数字森侦基础数据", "共有基础数据类型");
|
|
|
int index1 = order.indexOf(info1.getCategory());
|
|
|
int index2 = order.indexOf(info2.getCategory());
|
|
|
-
|
|
|
if (index1 < index2) {
|
|
|
return -1;
|
|
|
} else if (index1 > index2) {
|
|
@@ -199,7 +174,6 @@ public class IndexViewServiceImpl extends BaseServiceImpl implements IndexViewSe
|
|
|
}
|
|
|
};
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* 获取一网通办数据
|
|
|
*
|
|
@@ -330,24 +304,24 @@ public class IndexViewServiceImpl extends BaseServiceImpl implements IndexViewSe
|
|
|
}
|
|
|
|
|
|
/*
|
|
|
- * 数据中心-数据统计
|
|
|
- *
|
|
|
- * @author 韩福成
|
|
|
- * @date 2023/11/3 11:19
|
|
|
- */
|
|
|
- public Map<String,Object> dataStatistics(MenuInfo menuInfo) {
|
|
|
+ * 数据中心-数据统计
|
|
|
+ *
|
|
|
+ * @author 韩福成
|
|
|
+ * @date 2023/11/3 11:19
|
|
|
+ */
|
|
|
+ public Map<String, Object> dataStatistics(MenuInfo menuInfo) {
|
|
|
setSookaDataBase(menuInfo);
|
|
|
// 获取菜单信息
|
|
|
List<MenuInfo> basicDataList = indexViewMapper.getBasicDataList(menuInfo);
|
|
|
- Map<String,Object> map = new LinkedHashMap<>();
|
|
|
- map.put("铁东区","0,100,365,372");
|
|
|
- map.put("铁西区","0,100,365,373");
|
|
|
- map.put("双辽市","0,100,365,369");
|
|
|
- map.put("伊通县","0,100,365,370");
|
|
|
- map.put("梨树县","0,100,365,371");
|
|
|
+ Map<String, Object> map = new LinkedHashMap<>();
|
|
|
+ map.put("铁东区", "0,100,365,372");
|
|
|
+ map.put("铁西区", "0,100,365,373");
|
|
|
+ map.put("双辽市", "0,100,365,369");
|
|
|
+ map.put("伊通县", "0,100,365,370");
|
|
|
+ map.put("梨树县", "0,100,365,371");
|
|
|
int a = 101;
|
|
|
- Map<String,Object> td = new LinkedHashMap<>();
|
|
|
- for (Map.Entry<String, Object> m : map.entrySet()){
|
|
|
+ Map<String, Object> td = new LinkedHashMap<>();
|
|
|
+ for (Map.Entry<String, Object> m : map.entrySet()) {
|
|
|
Long updateCount = 0L;
|
|
|
Long count = 0L;
|
|
|
for (MenuInfo item : basicDataList) {
|
|
@@ -360,8 +334,8 @@ public class IndexViewServiceImpl extends BaseServiceImpl implements IndexViewSe
|
|
|
//更新数
|
|
|
MenuInfo info1 = new MenuInfo();
|
|
|
setSookaDataBase(info1);
|
|
|
- BeanUtils.copyProperties(item,info1);
|
|
|
- if (menuInfo.getTimeArr()!=null){
|
|
|
+ BeanUtils.copyProperties(item, info1);
|
|
|
+ if (menuInfo.getTimeArr() != null) {
|
|
|
String[] date = menuInfo.getTimeArr().split(",");
|
|
|
info1.setStartDate(date[0]);
|
|
|
info1.setEndDate(date[1]);
|
|
@@ -369,39 +343,39 @@ public class IndexViewServiceImpl extends BaseServiceImpl implements IndexViewSe
|
|
|
info1.setMark("xiugai");
|
|
|
updateCount += indexViewMapper.getBasicDataCount(info1);
|
|
|
}
|
|
|
- td.put("count"+a,count);
|
|
|
- td.put("updateCount"+a,updateCount);
|
|
|
- BigDecimal updateRate = new BigDecimal(0).setScale(2,RoundingMode.HALF_UP);
|
|
|
- if (updateCount!=0) {
|
|
|
+ td.put("count" + a, count);
|
|
|
+ td.put("updateCount" + a, updateCount);
|
|
|
+ BigDecimal updateRate = new BigDecimal(0).setScale(2, RoundingMode.HALF_UP);
|
|
|
+ if (updateCount != 0) {
|
|
|
BigDecimal counts = new BigDecimal(count);
|
|
|
BigDecimal updateCounts = new BigDecimal(updateCount);
|
|
|
- updateRate = updateCounts.divide(counts,4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100)).setScale(2,RoundingMode.HALF_UP);
|
|
|
+ updateRate = updateCounts.divide(counts, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100)).setScale(2, RoundingMode.HALF_UP);
|
|
|
}
|
|
|
- td.put("updateRate"+a,updateRate+"%");
|
|
|
- a+=1;
|
|
|
+ td.put("updateRate" + a, updateRate + "%");
|
|
|
+ a += 1;
|
|
|
}
|
|
|
List<IndexViewInfo> indexViewInfoList = this.getBasicDataList(menuInfo);
|
|
|
int b = 106;
|
|
|
- for (IndexViewInfo indexViewInfo : indexViewInfoList){
|
|
|
- if (!indexViewInfo.getCategory().equals("共有基础数据类型")){
|
|
|
- td.put("count"+b,indexViewInfo.getCount());
|
|
|
- td.put("updateCount"+b,indexViewInfo.getUpdataCount());
|
|
|
- BigDecimal updateRate = new BigDecimal(0).setScale(2,RoundingMode.HALF_UP);
|
|
|
- if (indexViewInfo.getUpdataCount()!=0){
|
|
|
+ for (IndexViewInfo indexViewInfo : indexViewInfoList) {
|
|
|
+ if (!indexViewInfo.getCategory().equals("共有基础数据类型")) {
|
|
|
+ td.put("count" + b, indexViewInfo.getCount());
|
|
|
+ td.put("updateCount" + b, indexViewInfo.getUpdataCount());
|
|
|
+ BigDecimal updateRate = new BigDecimal(0).setScale(2, RoundingMode.HALF_UP);
|
|
|
+ if (indexViewInfo.getUpdataCount() != 0) {
|
|
|
BigDecimal counts = new BigDecimal(indexViewInfo.getCount());
|
|
|
BigDecimal updateCounts = new BigDecimal(indexViewInfo.getUpdataCount());
|
|
|
- updateRate = updateCounts.divide(counts,4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100)).setScale(2,RoundingMode.HALF_UP);
|
|
|
+ updateRate = updateCounts.divide(counts, 4, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100)).setScale(2, RoundingMode.HALF_UP);
|
|
|
}
|
|
|
- td.put("updateRate"+b,updateRate+"%");
|
|
|
+ td.put("updateRate" + b, updateRate + "%");
|
|
|
}
|
|
|
- b+=1;
|
|
|
+ b += 1;
|
|
|
}
|
|
|
- td.put("count201",0);
|
|
|
- td.put("updateCount201",0);
|
|
|
- td.put("updateRate201","0.00%");
|
|
|
- td.put("count202",0);
|
|
|
- td.put("updateCount202",0);
|
|
|
- td.put("updateRate202","0.00%");
|
|
|
+ td.put("count201", 0);
|
|
|
+ td.put("updateCount201", 0);
|
|
|
+ td.put("updateRate201", "0.00%");
|
|
|
+ td.put("count202", 0);
|
|
|
+ td.put("updateCount202", 0);
|
|
|
+ td.put("updateRate202", "0.00%");
|
|
|
return td;
|
|
|
}
|
|
|
}
|