hanfucheng 1 рік тому
батько
коміт
fe745647f8

+ 1 - 1
src/main/java/com/sooka/sponest/data/digitalenvironment/controller/EnvironmentBigDataController.java

@@ -168,7 +168,7 @@ public class EnvironmentBigDataController extends BaseController {
     @ApiOperation(value = "大数据查询秸秆离田" , notes = "大数据查询秸秆离田")
     @GetMapping("/leaveField")
     public R leaveField(EnvironmentBigDataVo environmentBigDataVo) {
-        return environmentBigDataService.leaveField(environmentBigDataVo);
+        return R.ok(environmentBigDataService.leaveField(environmentBigDataVo));
     }
     
     /*

+ 1 - 1
src/main/java/com/sooka/sponest/data/digitalenvironment/service/IEnvironmentBigDataService.java

@@ -93,7 +93,7 @@ public interface IEnvironmentBigDataService {
     * @author 韩福成
     * @date 2023/10/27 11:16
     */
-    R leaveField(EnvironmentBigDataVo environmentBigDataVo);
+    List<Map<String,Object>> leaveField(EnvironmentBigDataVo environmentBigDataVo);
 
     /*
     * 大数据按类型和分类统计排污口

+ 1 - 1
src/main/java/com/sooka/sponest/data/digitalenvironment/service/impl/EnvironmentBigDataServiceImpl.java

@@ -170,7 +170,7 @@ public class EnvironmentBigDataServiceImpl extends BaseServiceImpl implements IE
 
     @DataScopeMutiDept(deptAlias = "d")
     @Override
-    public R leaveField(EnvironmentBigDataVo environmentBigDataVo) {
+    public List<Map<String,Object>> leaveField(EnvironmentBigDataVo environmentBigDataVo) {
         setSookaDataBase(environmentBigDataVo);
         List<Map<String,Object>> list = centerdataTEnvironmentBigDataMapper.leaveField(environmentBigDataVo);
         return deptLevelUtil.getDeptLevel(list);

+ 1 - 1
src/main/java/com/sooka/sponest/data/digitalfirecontrol/controller/FireControlBigDataController.java

@@ -140,6 +140,6 @@ public class FireControlBigDataController extends BaseController {
     @ApiOperation(value = "查询水鹤+取水口+消火栓远端调用", notes = "查询水鹤+取水口+消火栓远端调用")
     @PostMapping("/selectBigDataNumWithDeptCount")
     public R selectBigDataNumWithDeptCount(VisuForestCloudMapVO visuForestCloudMapVO) throws IOException {
-        return iFireControlBigDataService.selectBigDataNumWithDeptCount(visuForestCloudMapVO);
+        return R.ok(iFireControlBigDataService.selectBigDataNumWithDeptCount(visuForestCloudMapVO));
     }
 }

+ 2 - 2
src/main/java/com/sooka/sponest/data/digitalfirecontrol/service/IFireControlBigDataService.java

@@ -46,11 +46,11 @@ public interface IFireControlBigDataService {
     /**
      * 消防力量
      */
-    R selectBigDataFireforceDeptCount(CenterdataTFirecontrolFireForce centerdataTFirecontrolFireForce);
+    List<Map<String,Object>> selectBigDataFireforceDeptCount(CenterdataTFirecontrolFireForce centerdataTFirecontrolFireForce);
 
     /**
      * 水鹤+取水口+消火栓
      */
-    R selectBigDataNumWithDeptCount(VisuForestCloudMapVO visuForestCloudMapVO)throws IOException;
+    List<Map<String,Object>> selectBigDataNumWithDeptCount(VisuForestCloudMapVO visuForestCloudMapVO)throws IOException;
 
 }

+ 2 - 2
src/main/java/com/sooka/sponest/data/digitalfirecontrol/service/impl/FireControlBigDataServiceImpl.java

@@ -125,7 +125,7 @@ public class FireControlBigDataServiceImpl extends BaseServiceImpl implements IF
      */
     @DataScopeMutiDept(deptAlias = "d")
     @Override
-    public R selectBigDataFireforceDeptCount(CenterdataTFirecontrolFireForce centerdataTFirecontrolFireForce) {
+    public List<Map<String,Object>> selectBigDataFireforceDeptCount(CenterdataTFirecontrolFireForce centerdataTFirecontrolFireForce) {
         setSookaDataBase(centerdataTFirecontrolFireForce);
         List<Map<String,Object>> list = fireControlBigDataMapper.selectBigDataFireforceDeptCount(centerdataTFirecontrolFireForce);
         return deptLevelUtil.getDeptLevel(list);
@@ -136,7 +136,7 @@ public class FireControlBigDataServiceImpl extends BaseServiceImpl implements IF
      */
     @DataScopeMutiDept(deptAlias = "d")
     @Override
-    public R selectBigDataNumWithDeptCount(VisuForestCloudMapVO visuForestCloudMapVO) throws IOException {
+    public List<Map<String,Object>> selectBigDataNumWithDeptCount(VisuForestCloudMapVO visuForestCloudMapVO) throws IOException {
         setSookaDataBase(visuForestCloudMapVO);
         List<Map<String,Object>> list = fireControlBigDataMapper.selectBigDataNumWithDeptCount(visuForestCloudMapVO);
         return deptLevelUtil.getDeptLevel(list);

+ 2 - 2
src/main/java/com/sooka/sponest/data/digitalforest/controller/ForestBigDataController.java

@@ -177,7 +177,7 @@ public class ForestBigDataController extends BaseController {
     @ApiOperation(value = "林业资源(市级用用户按区县,区县用户按乡镇统计林区面积)", notes = "林业资源(市级用用户按区县,区县用户按乡镇统计林区面积)")
     @GetMapping("/resourcesAreaCount")
     public R selectResourcesAreaCount(CenterdataTForestResources centerdataTForestResources) throws IOException {
-        return forestBigDataService.selectResourcesAreaCount(centerdataTForestResources);
+        return R.ok(forestBigDataService.selectResourcesAreaCount(centerdataTForestResources));
     }
 
     /**
@@ -187,6 +187,6 @@ public class ForestBigDataController extends BaseController {
     @ApiOperation(value = "林业网格(市级用用户按区县,区县用户按乡镇统计林业网格数量)", notes = "林业网格(市级用用户按区县,区县用户按乡镇统计林业网格数量)")
     @GetMapping("/forestGridCount")
     public R selectForestGridCount(CenterdataTForestGridLevelVo centerdataTForestGridLevel) throws IOException {
-        return forestBigDataService.selectForestGridCount(centerdataTForestGridLevel);
+        return R.ok(forestBigDataService.selectForestGridCount(centerdataTForestGridLevel));
     }
 }

+ 2 - 2
src/main/java/com/sooka/sponest/data/digitalforest/service/IForestBigDataService.java

@@ -57,7 +57,7 @@ public interface IForestBigDataService {
 
     List<Map<String, Object>> focusOnFire();
 
-    R selectResourcesAreaCount(CenterdataTForestResources centerdataTForestResources) throws IOException;
+    List<Map<String,Object>> selectResourcesAreaCount(CenterdataTForestResources centerdataTForestResources) throws IOException;
 
-    R selectForestGridCount(CenterdataTForestGridLevelVo centerdataTForestGridLevel) throws IOException;
+    List<Map<String,Object>> selectForestGridCount(CenterdataTForestGridLevelVo centerdataTForestGridLevel) throws IOException;
 }

+ 2 - 2
src/main/java/com/sooka/sponest/data/digitalforest/service/impl/ForestBigDataServiceImpl.java

@@ -207,7 +207,7 @@ public class ForestBigDataServiceImpl extends BaseServiceImpl implements IForest
 
     @DataScopeMutiDept(deptAlias = "d")
     @Override
-    public R selectResourcesAreaCount(CenterdataTForestResources centerdataTForestResources) throws IOException {
+    public List<Map<String,Object>> selectResourcesAreaCount(CenterdataTForestResources centerdataTForestResources) throws IOException {
         setSookaDataBase(centerdataTForestResources);
         List<Map<String,Object>> list = forestBigDataMapper.selectResourcesAreaCount(centerdataTForestResources);
         return deptLevelUtil.getDeptLevel(list);
@@ -215,7 +215,7 @@ public class ForestBigDataServiceImpl extends BaseServiceImpl implements IForest
 
     @DataScopeMutiDept(deptAlias = "d")
     @Override
-    public R selectForestGridCount(CenterdataTForestGridLevelVo centerdataTForestGridLevel) throws IOException {
+    public List<Map<String,Object>> selectForestGridCount(CenterdataTForestGridLevelVo centerdataTForestGridLevel) throws IOException {
         setSookaDataBase(centerdataTForestGridLevel);
         List<Map<String,Object>> list = forestBigDataMapper.selectForestGridCount(centerdataTForestGridLevel);
         return deptLevelUtil.getDeptLevel(list);

+ 11 - 5
src/main/java/com/sooka/sponest/data/utils/DeptLevelUtil.java

@@ -5,6 +5,9 @@ import com.ruoyi.common.core.utils.StringUtils;
 import com.ruoyi.common.security.utils.SecurityUtils;
 import com.ruoyi.system.api.RemoteDeptService;
 import com.ruoyi.system.api.domain.SysDept;
+import com.sooka.sponest.data.digitalemergency.controller.CenterdataTEmergencyEnterindesmapController;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
@@ -17,17 +20,20 @@ import java.util.Map;
 @Component
 public class DeptLevelUtil {
 
+    private static final Logger log = LoggerFactory.getLogger(DeptLevelUtil.class);
+
     @Autowired
     private RemoteDeptService remoteDeptService;
 
-    public R getDeptLevel(List<Map<String,Object>> list) {
+    public List<Map<String,Object>> getDeptLevel(List<Map<String,Object>> list) {
         String deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId().toString();
         List<SysDept> sysDeptList = remoteDeptService.selectChildrenCountyOrVillagesDeptListByDeptId(deptId).getData();
-        if (StringUtils.isEmpty(list)||list==null){
-            return R.ok(sysDeptList);
+        if (StringUtils.isEmpty(list)){
+            return null;
         }
         if (!list.get(0).containsKey("ancestors")||!list.get(0).containsKey("deptId")){
-            return R.fail("入参没有key:'ancestors'或没有key:'deptId'");
+            log.error("入参没有key:'ancestors'或没有key:'deptId'");
+            return new ArrayList<>();
         }
         List<Map<String,Object>> mapList = new ArrayList<>();
         for (SysDept sysDept : sysDeptList){//部门
@@ -54,6 +60,6 @@ public class DeptLevelUtil {
             map.put("deptName",sysDept.getDeptName());
             mapList.add(map);
         }
-        return R.ok(mapList);
+        return mapList;
     }
 }