Browse Source

信访投诉趋势问题修改

main
parent
commit
4de201c9f8
  1. 1
      src/main/java/com/biutag/supervision/controller/datav/DataGobalController.java
  2. 2
      src/main/java/com/biutag/supervision/controller/datav/DataMailViewController.java
  3. 20
      src/main/java/com/biutag/supervision/controller/datav/SubOneController.java
  4. 4
      src/main/java/com/biutag/supervision/mapper/CountyStreetDeptMapper.java
  5. 6
      src/main/java/com/biutag/supervision/service/CountyStreetDeptService.java
  6. 2
      src/main/resources/application.yml
  7. 46
      src/test/java/com/biutag/supervision/controller/datav/SubOneControllerTest.java

1
src/main/java/com/biutag/supervision/controller/datav/DataGobalController.java

@ -38,7 +38,6 @@ public class DataGobalController {
private final DataGobalService dataGobalService; private final DataGobalService dataGobalService;
//region 左边 //region 左边
// 机构问题排名 // 机构问题排名
@Operation(summary = "机构问题排名") @Operation(summary = "机构问题排名")

2
src/main/java/com/biutag/supervision/controller/datav/DataMailViewController.java

@ -1,6 +1,5 @@
package com.biutag.supervision.controller.datav; package com.biutag.supervision.controller.datav;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.biutag.supervision.constants.enums.DepartGroupEnum; import com.biutag.supervision.constants.enums.DepartGroupEnum;
import com.biutag.supervision.constants.enums.RepeatEnum; import com.biutag.supervision.constants.enums.RepeatEnum;
@ -70,6 +69,7 @@ public class DataMailViewController {
} }
// endregion // endregion
// region 中间 // region 中间
// 信访数据中央总览统计 // 信访数据中央总览统计
@Operation(summary = "信访数据大屏中央数据统计") @Operation(summary = "信访数据大屏中央数据统计")

20
src/main/java/com/biutag/supervision/controller/datav/SubOneController.java

@ -27,28 +27,28 @@ import java.util.*;
public class SubOneController { public class SubOneController {
private final CountyStreetDeptService countyStreetDeptService; private final CountyStreetDeptService countyStreetDeptService;
@GetMapping("/test")
public Result<JSONObject> test(@RequestParam Integer departId) { @GetMapping("/getSubOneStreetMap")
List<CountyStreetDept> depts = countyStreetDeptService.getTest(4062); public Result<JSONObject> getSubOneStreetMap(@RequestParam Integer departPId) {
List<CountyStreetDept> depts = countyStreetDeptService.getSubOneStreetMap(departPId);
Map<String, Object> geoJson = new HashMap<>(); Map<String, Object> geoJson = new HashMap<>();
geoJson.put("type", "FeatureCollection"); geoJson.put("type", "FeatureCollection");
geoJson.put("name", "4062");
List<Map<String, Object>> features = new ArrayList<>(); List<Map<String, Object>> features = new ArrayList<>();
for (CountyStreetDept dept : depts) { for (CountyStreetDept dept : depts) {
Map<String, Object> feature = new HashMap<>(); Map<String, Object> feature = new HashMap<>();
feature.put("type", "Feature"); feature.put("type", "Feature"); // 第一个键值
Map<String, Object> properties = new HashMap<>(); Map<String, Object> properties = new HashMap<>();
properties.put("name", dept.getName()); properties.put("name", dept.getName());
feature.put("properties", properties); properties.put("id", dept.getId());
feature.put("properties", properties); // 第二个键值
Map<String, Object> geometry = new HashMap<>(); feature.put("geometry", new Gson().fromJson(dept.getGeometry(), Object.class)); // 第三个键值
geometry.put("type", "MultiPolygon");
geometry.put("coordinates", new Gson().fromJson(dept.getGeometry(), Object.class));
feature.put("geometry", geometry);
features.add(feature); features.add(feature);
} }
geoJson.put("features", features); geoJson.put("features", features);
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
jsonObject.put("geoJson", geoJson); jsonObject.put("geoJson", geoJson);
return Result.success(jsonObject); return Result.success(jsonObject);

4
src/main/java/com/biutag/supervision/mapper/CountyStreetDeptMapper.java

@ -23,6 +23,10 @@ public interface CountyStreetDeptMapper extends BaseMapper<CountyStreetDept> {
"FROM county_street_dept where id = 3319;") "FROM county_street_dept where id = 3319;")
List<CountyStreetDept> props(Integer id); List<CountyStreetDept> props(Integer id);
@Select("select * from county_street_dept where dept_pid = #{departPId}")
List<CountyStreetDept> getSubOneStreetMap(Integer departPId);
} }

6
src/main/java/com/biutag/supervision/service/CountyStreetDeptService.java

@ -23,6 +23,12 @@ public class CountyStreetDeptService {
List<CountyStreetDept> res = countyStreetDeptMapper.props(id); List<CountyStreetDept> res = countyStreetDeptMapper.props(id);
return res; return res;
} }
public List<CountyStreetDept> getSubOneStreetMap(Integer departPId) {
List<CountyStreetDept> res = countyStreetDeptMapper.getSubOneStreetMap(departPId);
return res;
}
} }

2
src/main/resources/application.yml

@ -3,6 +3,8 @@ server:
spring: spring:
profiles: profiles:
active: @profiles.active@ active: @profiles.active@
# active: dev
datasource: datasource:
dynamic: dynamic:
primary: master primary: master

46
src/test/java/com/biutag/supervision/controller/datav/SubOneControllerTest.java

@ -0,0 +1,46 @@
package com.biutag.supervision.controller.datav;
import com.alibaba.fastjson.JSONObject;
import com.biutag.supervision.pojo.entity.CountyStreetDept;
import com.biutag.supervision.service.CountyStreetDeptService;
import com.google.gson.Gson;
import jakarta.annotation.Resource;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@SpringBootTest
public class SubOneControllerTest {
@Resource
private CountyStreetDeptService countyStreetDeptService;
@Test
public void testSubstr() {
List<CountyStreetDept> depts = countyStreetDeptService.getTest(4062);
Map<String, Object> geoJson = new HashMap<>();
geoJson.put("type", "FeatureCollection");
geoJson.put("name", "4062");
List<Map<String, Object>> features = new ArrayList<>();
for (CountyStreetDept dept : depts) {
Map<String, Object> feature = new HashMap<>();
feature.put("type", "Feature"); // 第一个键值
Map<String, Object> properties = new HashMap<>();
properties.put("name", dept.getName());
properties.put("id", dept.getId());
feature.put("properties", properties); // 第二个键值
feature.put("geometry", new Gson().fromJson(dept.getGeometry(), Object.class)); // 第三个键值
features.add(feature);
}
geoJson.put("features", features);
JSONObject jsonObject = new JSONObject();
jsonObject.put("geoJson", geoJson);
}
}
Loading…
Cancel
Save