Przeglądaj źródła

修改-数据中台-林业-环保得数据格式

lidongyu 1 rok temu
rodzic
commit
470c7bca9f

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

@@ -1,8 +1,11 @@
 package com.sooka.sponest.data.digitalenvironment.controller;
 
 import com.ruoyi.common.core.domain.R;
+import com.ruoyi.common.core.utils.StringUtils;
 import com.ruoyi.common.core.web.controller.BaseController;
 import com.ruoyi.common.core.web.domain.AjaxResult;
+import com.ruoyi.common.security.utils.SecurityUtils;
+import com.ruoyi.system.api.utils.DeptLevelUtil;
 import com.sooka.sponest.data.app.domain.VisuForestCloudMapVO;
 import com.sooka.sponest.data.digitalenvironment.domain.CenterdataTEnvironmentKeyEnterprise;
 import com.sooka.sponest.data.digitalenvironment.domain.CenterdataTEnvironmentProhibitionArea;
@@ -19,7 +22,10 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 import springfox.documentation.annotations.ApiIgnore;
 
+import javax.annotation.Resource;
 import java.io.IOException;
+import java.util.List;
+import java.util.Map;
 
 @RestController
 @RequestMapping("/environmentBigData")
@@ -28,7 +34,8 @@ public class EnvironmentBigDataController extends BaseController {
 
     @Autowired
     private IEnvironmentBigDataService environmentBigDataService;
-
+    @Resource
+    private DeptLevelUtil deptLevelUtil;
     @ApiImplicitParams(value = {
             @ApiImplicitParam(name = "areaType", value = "区域类型", dataType = "String", required = true, paramType = "body")
     })
@@ -64,7 +71,7 @@ public class EnvironmentBigDataController extends BaseController {
     })
     @ApiOperation(value = "按年月日模糊查询天气综合信息远端调用", notes = "按年月日模糊查询天气综合信息远端调用")
     @PostMapping("/selectBigDataByYearMonthFegin")
-    public R selectBigDataByYearMonthFegin(@ApiIgnore @RequestBody CenterdataTForestWeatherinformationBigDataVO centerdataTForestWeatherinformationBigDataVO) {
+    public R<List<Map<String,Object>>> selectBigDataByYearMonthFegin(@ApiIgnore @RequestBody CenterdataTForestWeatherinformationBigDataVO centerdataTForestWeatherinformationBigDataVO) {
         return R.ok(environmentBigDataService.selectBigDataByYearMonth(centerdataTForestWeatherinformationBigDataVO));
     }
 
@@ -168,7 +175,10 @@ public class EnvironmentBigDataController extends BaseController {
     @ApiOperation(value = "大数据查询秸秆离田" , notes = "大数据查询秸秆离田")
     @GetMapping("/leaveField")
     public R leaveField(EnvironmentBigDataVo environmentBigDataVo) {
-        return R.ok(environmentBigDataService.leaveField(environmentBigDataVo));
+        if (StringUtils.isBlank(environmentBigDataVo.getDeptId())){
+            environmentBigDataVo.setDeptId(SecurityUtils.getLoginUser().getSysUser().getDeptId().toString());
+        }
+        return R.ok(deptLevelUtil.getDeptLevel(environmentBigDataVo.getDeptId(),environmentBigDataService.leaveField(environmentBigDataVo),"num"));
     }
     
     /*

+ 1 - 1
src/main/java/com/sooka/sponest/data/digitalenvironment/mapper/CenterdataTEnvironmentBigDataMapper.java

@@ -31,7 +31,7 @@ public interface CenterdataTEnvironmentBigDataMapper {
 
     List<Map<String,Object>> bigFindAttend();
 
-    List<CenterdataTForestWeatherinformation> selectBigDataByYearMonth(CenterdataTForestWeatherinformationBigDataVO centerdataTForestWeatherinformationBigDataVO);
+    List<Map<String,Object>> selectBigDataByYearMonth(CenterdataTForestWeatherinformationBigDataVO centerdataTForestWeatherinformationBigDataVO);
 
     List<Map<String, Object>> getEnvironmentTotal(VisuForestCloudMapVO visuForestCloudMapVO);
 

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

@@ -33,7 +33,7 @@ public interface IEnvironmentBigDataService {
 
     List<Map<String,Object>> bigFindAttend();
 
-    CenterdataTForestWeatherinformationBigDataBO selectBigDataByYearMonth(CenterdataTForestWeatherinformationBigDataVO centerdataTForestWeatherinformationBigDataVO);
+    List<Map<String,Object>> selectBigDataByYearMonth(CenterdataTForestWeatherinformationBigDataVO centerdataTForestWeatherinformationBigDataVO);
 
     List<Map<String, Object>> getEnvironmentTotal(VisuForestCloudMapVO visuForestCloudMapVO);
 

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

@@ -85,22 +85,10 @@ public class EnvironmentBigDataServiceImpl extends BaseServiceImpl implements IE
 
     @DataScopeMutiDept(deptAlias = "d")
     @Override
-    public CenterdataTForestWeatherinformationBigDataBO selectBigDataByYearMonth(CenterdataTForestWeatherinformationBigDataVO centerdataTForestWeatherinformationBigDataVO) {
-        List<CenterdataTForestWeatherinformation> centerdataTForestWeatherinformationList = centerdataTEnvironmentBigDataMapper.selectBigDataByYearMonth(centerdataTForestWeatherinformationBigDataVO);
-        CenterdataTForestWeatherinformationBigDataBO centerdataTForestWeatherinformationBigDataBO = new CenterdataTForestWeatherinformationBigDataBO();
-        String[] day = new String[centerdataTForestWeatherinformationList.size()];
-        String[] low = new String[centerdataTForestWeatherinformationList.size()];
-        String[] heigh = new String[centerdataTForestWeatherinformationList.size()];
-        for (int i = 0; i < centerdataTForestWeatherinformationList.size(); i++) {
-            CenterdataTForestWeatherinformation centerdataTForestWeatherinformation = centerdataTForestWeatherinformationList.get(i);
-            day[i] = DateUtils.dateTime(centerdataTForestWeatherinformation.getWeatherinformationTime());
-            low[i] = centerdataTForestWeatherinformation.getWeatherinformationLow();
-            heigh[i] = centerdataTForestWeatherinformation.getWeatherinformationHigh();
-        }
-        centerdataTForestWeatherinformationBigDataBO.setDay(day);
-        centerdataTForestWeatherinformationBigDataBO.setHeigh(heigh);
-        centerdataTForestWeatherinformationBigDataBO.setLow(low);
-        return centerdataTForestWeatherinformationBigDataBO;
+    public List<Map<String,Object>> selectBigDataByYearMonth(CenterdataTForestWeatherinformationBigDataVO centerdataTForestWeatherinformationBigDataVO) {
+
+        return centerdataTEnvironmentBigDataMapper.selectBigDataByYearMonth(centerdataTForestWeatherinformationBigDataVO);
+
     }
 
     @DataScopeMutiDept(deptAlias = "d")
@@ -172,11 +160,7 @@ public class EnvironmentBigDataServiceImpl extends BaseServiceImpl implements IE
     @Override
     public List<Map<String,Object>> leaveField(EnvironmentBigDataVo environmentBigDataVo) {
         setSookaDataBase(environmentBigDataVo);
-        List<Map<String,Object>> list = centerdataTEnvironmentBigDataMapper.leaveField(environmentBigDataVo);
-        if (StringUtils.isBlank(environmentBigDataVo.getDeptId())){
-            environmentBigDataVo.setDeptId(SecurityUtils.getLoginUser().getSysUser().getDeptId().toString());
-        }
-        return deptLevelUtil.getDeptLevel(environmentBigDataVo.getDeptId(),list,"num");
+        return centerdataTEnvironmentBigDataMapper.leaveField(environmentBigDataVo);
     }
 
     @DataScopeMutiDept(deptAlias = "d")

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

@@ -1,8 +1,13 @@
 package com.sooka.sponest.data.digitalforest.controller;
 
 import com.ruoyi.common.core.domain.R;
+import com.ruoyi.common.core.utils.StringUtils;
 import com.ruoyi.common.core.web.controller.BaseController;
 import com.ruoyi.common.core.web.domain.AjaxResult;
+import com.ruoyi.common.security.utils.DictUtils;
+import com.ruoyi.common.security.utils.SecurityUtils;
+import com.ruoyi.system.api.domain.SysDictData;
+import com.ruoyi.system.api.utils.DeptLevelUtil;
 import com.sooka.sponest.data.app.domain.VisuForestCloudMapVO;
 import com.sooka.sponest.data.basicdata.domain.CenterdataTForestCar;
 import com.sooka.sponest.data.digitalemergency.domain.CenterdataTEmergencyEnterprises;
@@ -20,9 +25,14 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 import springfox.documentation.annotations.ApiIgnore;
 
+import javax.annotation.Resource;
 import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.List;
 import java.util.Map;
+import static com.ruoyi.common.core.utils.DataConvertUtil.convertToMap;
+import static com.sooka.sponest.data.utils.DataConstants.TREE_STATUS;
 
 /**
  * @Auther: mjq
@@ -37,7 +47,8 @@ public class ForestBigDataController extends BaseController {
 
     @Autowired
     private IForestBigDataService forestBigDataService;
-
+    @Resource
+    private DeptLevelUtil deptLevelUtil;
     /*
      * 数字林业远端调用
      * */
@@ -130,7 +141,7 @@ public class ForestBigDataController extends BaseController {
 
     @ApiOperation(value = "远端调用查询GwRs", notes = "远端调用查询GwRs")
     @GetMapping(value = "/selectGwRs")
-    public R<Map<String, Object>> selectGwRs() {
+    public R<List<Map<String, Object>>> selectGwRs() {
         return R.ok(forestBigDataService.selectGwRs());
     }
 
@@ -154,26 +165,36 @@ public class ForestBigDataController extends BaseController {
 
     @ApiOperation(value = "远端调用查询出勤排名", notes = "远端调用查询出勤排名")
     @GetMapping(value = "/selectCqpm")
-    public R<Map<String, Object>> selectCqpm() {
+    public R<List<Map<String, Object>>> selectCqpm() {
         return R.ok(forestBigDataService.selectCqpm());
     }
 
     @ApiOperation(value = "远端调用查询巡查计划", notes = "远端调用查询巡查计划")
     @PostMapping("selectCenterdataTForestPlanHz")
     public R selectCenterdataTForestPlanHz(@RequestBody CenterdataTAfforestationTask centerdataTAfforestationTask) {
-        return R.ok(forestBigDataService.selectCenterdataTForestPlanHz(centerdataTAfforestationTask));
+        if (StringUtils.isNull(centerdataTAfforestationTask.getDeptId())){
+            centerdataTAfforestationTask.setDeptId(SecurityUtils.getLoginUser().getSysUser().getDeptId());
+        }
+        List<SysDictData> dictCache = DictUtils.getDictCache(TREE_STATUS);
+        return R.ok(deptLevelUtil.getDeptLevel(dictCache,forestBigDataService.selectCenterdataTForestPlanHz(centerdataTAfforestationTask,dictCache),String.valueOf(centerdataTAfforestationTask.getDeptId())));
     }
 
 
     @GetMapping("/linLeaderCount")
     public R linLeaderCount(CenterdataTForestLinleader centerdataTForestLinleader) {
-        return R.ok(forestBigDataService.linLeaderCount(centerdataTForestLinleader));
+        return R.ok(convertToMap(forestBigDataService.linLeaderCount(centerdataTForestLinleader), Arrays.asList("name","value")));
     }
 
 
     @PostMapping("/focusOnFire")
     public R focusOnFire(@RequestBody CenterdataTForestKeyFireproofPlots centerdataTForestKeyFireproofPlots) {
-        return R.ok(forestBigDataService.focusOnFire(centerdataTForestKeyFireproofPlots));
+        if (StringUtils.isNull(centerdataTForestKeyFireproofPlots.getDeptId())){
+            centerdataTForestKeyFireproofPlots.setDeptId(SecurityUtils.getLoginUser().getSysUser().getDeptId());
+        }
+        List<String> addKeys = new ArrayList<>();
+        addKeys.add("area");
+        addKeys.add("species");
+        return R.ok(deptLevelUtil.getDeptLevel(String.valueOf(centerdataTForestKeyFireproofPlots.getDeptId()),forestBigDataService.focusOnFire(centerdataTForestKeyFireproofPlots),addKeys));
     }
 
     /**
@@ -184,7 +205,10 @@ public class ForestBigDataController extends BaseController {
     @ApiOperation(value = "林业资源(市级用用户按区县,区县用户按乡镇统计林区面积)", notes = "林业资源(市级用用户按区县,区县用户按乡镇统计林区面积)")
     @PostMapping("/resourcesAreaCount")
     public R selectResourcesAreaCount(@RequestBody CenterdataTForestResources centerdataTForestResources) throws IOException {
-        return R.ok(forestBigDataService.selectResourcesAreaCount(centerdataTForestResources));
+        if (StringUtils.isNull(centerdataTForestResources.getDeptId())){
+            centerdataTForestResources.setDeptId(SecurityUtils.getLoginUser().getSysUser().getDeptId());
+        }
+        return R.ok(deptLevelUtil.getDeptLevel(String.valueOf(centerdataTForestResources.getDeptId()),forestBigDataService.selectResourcesAreaCount(centerdataTForestResources),"areaTotal"));
     }
 
     /**
@@ -195,12 +219,18 @@ public class ForestBigDataController extends BaseController {
     @ApiOperation(value = "林业网格(市级用用户按区县,区县用户按乡镇统计林业网格数量)", notes = "林业网格(市级用用户按区县,区县用户按乡镇统计林业网格数量)")
     @PostMapping("/forestGridCount")
     public R selectForestGridCount(@RequestBody CenterdataTForestGridLevelVo centerdataTForestGridLevel) throws IOException {
-        return R.ok(forestBigDataService.selectForestGridCount(centerdataTForestGridLevel));
+        if (StringUtils.isNull(centerdataTForestGridLevel.getDeptId())){
+            centerdataTForestGridLevel.setDeptId(SecurityUtils.getLoginUser().getSysUser().getDeptId());
+        }
+        return R.ok(deptLevelUtil.getDeptLevel(String.valueOf(centerdataTForestGridLevel.getDeptId()),forestBigDataService.selectForestGridCount(centerdataTForestGridLevel),"gridTotal"));
     }
 
     @ApiOperation(value = "珍稀古树(市级用用户按区县,区县用户按乡镇统计珍稀古树数量)", notes = "珍稀古树(市级用用户按区县,区县用户按乡镇统计珍稀古树数量)")
     @PostMapping("/selectTreeCount")
     public R selectTreeCount(@RequestBody CenterdataTForestTrees centerdataTForestTrees) {
-        return R.ok(forestBigDataService.selectTreeCount(centerdataTForestTrees));
+        if (StringUtils.isNull(centerdataTForestTrees.getDeptId())){
+            centerdataTForestTrees.setDeptId(SecurityUtils.getLoginUser().getSysUser().getDeptId());
+        }
+        return R.ok(deptLevelUtil.getDeptLevel(String.valueOf(centerdataTForestTrees.getDeptId()),forestBigDataService.selectTreeCount(centerdataTForestTrees),"treeTotal"));
     }
 }

+ 5 - 4
src/main/java/com/sooka/sponest/data/digitalforest/mapper/ForestBigDataMapper.java

@@ -1,5 +1,6 @@
 package com.sooka.sponest.data.digitalforest.mapper;
 
+import com.ruoyi.system.api.domain.SysDictData;
 import com.sooka.sponest.data.app.domain.VisuForestCloudMapVO;
 import com.sooka.sponest.data.basicdata.domain.CenterdataTForestCar;
 import com.sooka.sponest.data.digitalfirecontrol.domain.vo.DataVisuFireCloudMapVO;
@@ -11,7 +12,7 @@ import com.sooka.sponest.data.digitalforest.domain.vo.CenterdataTForestGridLevel
 import com.sooka.sponest.data.generalbusiness.domain.CenterdataTForestImportarea;
 import com.sooka.sponest.data.generalbusiness.domain.CenterdataTForestWeatherinformation;
 import com.sooka.sponest.data.generalbusiness.domain.vo.CenterdataTForestWeatherinformationBigDataVO;
-import io.lettuce.core.dynamic.annotation.Param;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 import java.util.Map;
@@ -41,7 +42,7 @@ public interface ForestBigDataMapper {
 
     List<VisuForestCloudEventTypeBO> selectBigDataWeatherStationDeptCount(CenterdataTForestWeatherstation centerdataTForestWeatherstation);
 
-    List<GridUserGwCount> selectGwRs();
+    List<Map<String, Object>> selectGwRs();
 
     List<Map<String, String>> selectCenterdataTForestResourcesSum(CenterdataTForestResources centerdataTForestResources);
 
@@ -49,9 +50,9 @@ public interface ForestBigDataMapper {
 
     List<Map<String, Object>> selectDeviceCount(CenterdataTForestDevice centerdataTForestDevice);
 
-    List<GridUserGwCount> selectCqpm();
+    List<Map<String, Object>> selectCqpm();
 
-    List<Map<String, Object>> queryTaskArea(CenterdataTAfforestationTask centerdataTAfforestationTask);
+    List<Map<String, Object>> queryTaskArea(@Param("data") CenterdataTAfforestationTask centerdataTAfforestationTask, @Param("dict") List<SysDictData> dictList);
 
 
     List<Map<String, Object>> linLeaderCount(CenterdataTForestLinleader centerdataTForestLinleader);

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

@@ -1,6 +1,7 @@
 package com.sooka.sponest.data.digitalforest.service;
 
 import com.ruoyi.common.core.web.domain.AjaxResult;
+import com.ruoyi.system.api.domain.SysDictData;
 import com.sooka.sponest.data.app.domain.VisuForestCloudMapVO;
 import com.sooka.sponest.data.basicdata.domain.CenterdataTForestCar;
 import com.sooka.sponest.data.digitalemergency.domain.CenterdataTEmergencyEnterprises;
@@ -40,7 +41,7 @@ public interface IForestBigDataService {
 
     List<VisuForestCloudEventTypeBO> selectBigDataWeatherStationDeptCount(CenterdataTForestWeatherstation centerdataTForestWeatherstation);
 
-    Map<String, Object> selectGwRs();
+    List<Map<String, Object>> selectGwRs();
 
     List<Map<String, String>> selectCenterdataTForestResourcesSum(CenterdataTForestResources centerdataTForestResources);
 
@@ -48,9 +49,9 @@ public interface IForestBigDataService {
 
     List<Map<String, Object>> selectDeviceCount(CenterdataTForestDevice centerdataTForestDevice);
 
-    Map<String, Object> selectCqpm();
+    List<Map<String, Object>> selectCqpm();
 
-    List<Map<String,Object>> selectCenterdataTForestPlanHz(CenterdataTAfforestationTask centerdataTAfforestationTask);
+    List<Map<String,Object>> selectCenterdataTForestPlanHz(CenterdataTAfforestationTask centerdataTAfforestationTask,List<SysDictData> dictCache);
 
 
     List<Map<String, Object>> linLeaderCount(CenterdataTForestLinleader centerdataTForestLinleader);

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

@@ -3,7 +3,9 @@ package com.sooka.sponest.data.digitalforest.service.impl;
 import com.ruoyi.common.core.utils.DateUtils;
 import com.ruoyi.common.core.utils.StringUtils;
 import com.ruoyi.common.datascope.annotation.DataScopeMutiDept;
+import com.ruoyi.common.security.utils.DictUtils;
 import com.ruoyi.common.security.utils.SecurityUtils;
+import com.ruoyi.system.api.domain.SysDictData;
 import com.ruoyi.system.api.utils.DeptLevelUtil;
 import com.sooka.sponest.data.app.domain.VisuForestCloudMapVO;
 import com.sooka.sponest.data.base.service.impl.BaseServiceImpl;
@@ -25,6 +27,8 @@ import javax.annotation.Resource;
 import java.io.IOException;
 import java.util.*;
 
+import static com.sooka.sponest.data.utils.DataConstants.TREE_STATUS;
+
 /**
  * @Auther: mjq
  * @Date: 2023/5/15 - 05 - 15 - 20:10
@@ -33,11 +37,11 @@ import java.util.*;
  */
 @Service
 public class ForestBigDataServiceImpl extends BaseServiceImpl implements IForestBigDataService {
+
+
     @Autowired
     private ForestBigDataMapper forestBigDataMapper;
 
-    @Resource
-    private DeptLevelUtil deptLevelUtil;
 
     @DataScopeMutiDept(deptAlias = "d")
     @Override
@@ -109,31 +113,8 @@ public class ForestBigDataServiceImpl extends BaseServiceImpl implements IForest
         return forestBigDataMapper.selectBigDataWeatherStationDeptCount(centerdataTForestWeatherstation);
     }
     @Override
-    public Map<String, Object> selectGwRs() {
-        List<GridUserGwCount> gridUserGwCountList = forestBigDataMapper.selectGwRs();
-        String[] gridArray = new String[gridUserGwCountList.size()];
-        String[] gridZgArray = new String[gridUserGwCountList.size()];
-        String[] gridLgArray = new String[gridUserGwCountList.size()];
-        for (int i = 0; i < gridUserGwCountList.size(); i++) {
-            gridArray[i] = gridUserGwCountList.get(i).getGridName();
-            gridZgArray[i] = gridUserGwCountList.get(i).getZg();
-            gridLgArray[i] = gridUserGwCountList.get(i).getLg();
-        }
-        Map mgZg = new HashMap();
-        mgZg.put("name", "在岗");
-        mgZg.put("type", "bar");
-        mgZg.put("data", gridZgArray);
-        Map mgQg = new HashMap();
-        mgQg.put("name", "缺岗");
-        mgQg.put("type", "bar");
-        mgQg.put("data", gridLgArray);
-        List<Map> mapList = new ArrayList<>();
-        mapList.add(mgZg);
-        mapList.add(mgQg);
-        Map<String, Object> map = new HashMap<>();
-        map.put("grid", gridArray);
-        map.put("data", mapList);
-        return map;
+    public List<Map<String, Object>> selectGwRs() {
+        return forestBigDataMapper.selectGwRs();
     }
     @Override
     public List<Map<String, String>> selectCenterdataTForestResourcesSum(CenterdataTForestResources centerdataTForestResources) {
@@ -153,39 +134,15 @@ public class ForestBigDataServiceImpl extends BaseServiceImpl implements IForest
         return forestBigDataMapper.selectDeviceCount(centerdataTForestDevice);
     }
     @Override
-    public Map<String, Object> selectCqpm() {
-        List<GridUserGwCount> gridUserGwCountList = forestBigDataMapper.selectCqpm();
-        String[] gridArray = new String[gridUserGwCountList.size()];
-        String[] gridPmArray = new String[gridUserGwCountList.size()];
-        for (int i = 0; i < gridUserGwCountList.size(); i++) {
-            gridArray[i] = gridUserGwCountList.get(i).getGridName();
-            gridPmArray[i] = gridUserGwCountList.get(i).getLgbz();
-        }
-        Map mgZg = new HashMap();
-        mgZg.put("name", "排名");
-        mgZg.put("type", "line");
-        mgZg.put("data", gridPmArray);
-        List<Map> mapList = new ArrayList<>();
-        mapList.add(mgZg);
-        Map<String, Object> map = new HashMap<>();
-        map.put("grid", gridArray);
-        map.put("data", mapList);
-        return map;
+    public List<Map<String, Object>> selectCqpm() {
+        return forestBigDataMapper.selectCqpm();
     }
 
     @Override
     @DataScopeMutiDept(deptAlias = "d")
-    public List<Map<String, Object>> selectCenterdataTForestPlanHz(CenterdataTAfforestationTask centerdataTAfforestationTask) {
+    public List<Map<String, Object>> selectCenterdataTForestPlanHz(CenterdataTAfforestationTask centerdataTAfforestationTask,List<SysDictData> dictCache) {
         setSookaDataBase(centerdataTAfforestationTask);
-        List<Map<String,Object>> list = forestBigDataMapper.queryTaskArea(centerdataTAfforestationTask);
-        if (StringUtils.isNull(centerdataTAfforestationTask.getDeptId())){
-            centerdataTAfforestationTask.setDeptId(SecurityUtils.getLoginUser().getSysUser().getDeptId());
-        }
-        List<String> addKeys = new ArrayList<>();
-        addKeys.add("begin");
-        addKeys.add("notbegin");
-        addKeys.add("success");
-        return deptLevelUtil.getDeptLevel(String.valueOf(centerdataTAfforestationTask.getDeptId()),list,addKeys);
+        return forestBigDataMapper.queryTaskArea(centerdataTAfforestationTask,dictCache);
     }
 
     @Override
@@ -199,36 +156,21 @@ public class ForestBigDataServiceImpl extends BaseServiceImpl implements IForest
     @DataScopeMutiDept(deptAlias = "d")
     public List<Map<String, Object>> focusOnFire(CenterdataTForestKeyFireproofPlots centerdataTForestKeyFireproofPlots) {
         setSookaDataBase(centerdataTForestKeyFireproofPlots);
-        List<Map<String,Object>> list = forestBigDataMapper.focusOnFire(centerdataTForestKeyFireproofPlots);
-        if (StringUtils.isNull(centerdataTForestKeyFireproofPlots.getDeptId())){
-            centerdataTForestKeyFireproofPlots.setDeptId(SecurityUtils.getLoginUser().getSysUser().getDeptId());
-        }
-        List<String> addKeys = new ArrayList<>();
-        addKeys.add("area");
-        addKeys.add("species");
-        return deptLevelUtil.getDeptLevel(String.valueOf(centerdataTForestKeyFireproofPlots.getDeptId()),list,addKeys);
+        return forestBigDataMapper.focusOnFire(centerdataTForestKeyFireproofPlots);
     }
 
     @DataScopeMutiDept(deptAlias = "d")
     @Override
     public List<Map<String,Object>> selectResourcesAreaCount(CenterdataTForestResources centerdataTForestResources) throws IOException {
         setSookaDataBase(centerdataTForestResources);
-        List<Map<String,Object>> list = forestBigDataMapper.selectResourcesAreaCount(centerdataTForestResources);
-        if (StringUtils.isNull(centerdataTForestResources.getDeptId())){
-            centerdataTForestResources.setDeptId(SecurityUtils.getLoginUser().getSysUser().getDeptId());
-        }
-        return deptLevelUtil.getDeptLevel(String.valueOf(centerdataTForestResources.getDeptId()),list,"areaTotal");
+        return forestBigDataMapper.selectResourcesAreaCount(centerdataTForestResources);
     }
 
     @DataScopeMutiDept(deptAlias = "d")
     @Override
     public List<Map<String,Object>> selectForestGridCount(CenterdataTForestGridLevelVo centerdataTForestGridLevel) throws IOException {
         setSookaDataBase(centerdataTForestGridLevel);
-        List<Map<String,Object>> list = forestBigDataMapper.selectForestGridCount(centerdataTForestGridLevel);
-        if (StringUtils.isNull(centerdataTForestGridLevel.getDeptId())){
-            centerdataTForestGridLevel.setDeptId(SecurityUtils.getLoginUser().getSysUser().getDeptId());
-        }
-        return deptLevelUtil.getDeptLevel(String.valueOf(centerdataTForestGridLevel.getDeptId()),list,"gridTotal");
+        return forestBigDataMapper.selectForestGridCount(centerdataTForestGridLevel);
     }
 
     @DataScopeMutiDept(deptAlias = "d")
@@ -236,10 +178,7 @@ public class ForestBigDataServiceImpl extends BaseServiceImpl implements IForest
     public List<Map<String,Object>> selectTreeCount(CenterdataTForestTrees centerdataTForestTrees) {
         setSookaDataBase(centerdataTForestTrees);
         List<Map<String,Object>> list = forestBigDataMapper.selectTreeCount(centerdataTForestTrees);
-        if (StringUtils.isNull(centerdataTForestTrees.getDeptId())){
-            centerdataTForestTrees.setDeptId(SecurityUtils.getLoginUser().getSysUser().getDeptId());
-        }
-        return deptLevelUtil.getDeptLevel(String.valueOf(centerdataTForestTrees.getDeptId()),list,"treeTotal");
+        return list;
     }
 
 }

+ 3 - 0
src/main/java/com/sooka/sponest/data/utils/DataConstants.java

@@ -26,4 +26,7 @@ public class DataConstants {
     public static final String TITLE = "title";
 
     public static final String CONTACTS ="contacts";
+
+    //植树造林任务管理对象-任务状态字段tree_status
+    public static final String TREE_STATUS ="tree_status";
 }

+ 2 - 3
src/main/resources/mapper/digitalenvironment/CenterdataTEnvironmentBigDataMapper.xml

@@ -121,9 +121,8 @@
     </select>
 
 
-    <select id="selectBigDataByYearMonth" parameterType="CenterdataTForestWeatherinformationBigDataVO"
-            resultMap="CenterdataTForestWeatherinformationResult">
-        select date_format(weatherinformation_time,'%Y-%m-%d') weatherinformation_time, IFNULL(weatherinformation_low,'') weatherinformation_low, IFNULL(weatherinformation_high,'') weatherinformation_high
+    <select id="selectBigDataByYearMonth" resultType="java.util.LinkedHashMap">
+        select date_format(weatherinformation_time,'%Y-%m-%d') day, IFNULL(weatherinformation_low,'') low, IFNULL(weatherinformation_high,'') heigh
         from centerdata_t_forest_weatherinformation
         where weatherinformation_time like concat('%', #{day}, '%')
         order by weatherinformation_time asc

+ 15 - 10
src/main/resources/mapper/digitalforest/ForestBigDataMapper.xml

@@ -113,8 +113,8 @@
         group by a.dept_id,a.dept_name
     </select>
 
-    <select id="selectGwRs" resultType="com.sooka.sponest.data.digitalforest.domain.bo.GridUserGwCount">
-        select a.gridName,a.count-IFNULL(b.countQj,0)  as zg,IFNULL(b.countQj,0) as lg from ( select  b.name  as gridName , count(a.id) as count ,b.id from centerdata_t_forest_linleader a , centerdata_t_forest_grid_level b  where a.lin_grid_id= b.id
+    <select id="selectGwRs" resultType="java.util.LinkedHashMap">
+        select a.gridName,a.count-IFNULL(b.countQj,0)  as zz,IFNULL(b.countQj,0) as qj from ( select  b.name  as gridName , count(a.id) as count ,b.id from centerdata_t_forest_linleader a , centerdata_t_forest_grid_level b  where a.lin_grid_id= b.id
         group by b.name ) a  left join (SELECT count(a.id) as countQj,a.lin_grid_id  FROM `centerdata_t_forest_linleader` a  ,centerdata_t_leave b where a.user_id =b.leave_user_id and b.leave_end_time>= current_timestamp group by a.user_id ,a.lin_grid_id) b on a.id= b.lin_grid_id
         ORDER BY zg DESC
     </select>
@@ -154,9 +154,14 @@
         group by a.forest_type
     </select>
 
-    <select id="selectCqpm" resultType="com.sooka.sponest.data.digitalforest.domain.bo.GridUserGwCount">
-        select a.gridName,a.count - IFNULL( b.countQj, 0 ) AS lgbz from ( select  b.name  as gridName , count(a.id) as count ,b.id from centerdata_t_forest_linleader a , centerdata_t_forest_grid_level b  where a.lin_grid_id= b.id
-        group by b.name ) a  left join (SELECT count(a.id) as countQj,a.lin_grid_id  FROM `centerdata_t_forest_linleader` a  ,centerdata_t_leave b where a.user_id =b.leave_user_id and b.leave_end_time>= curdate() group by a.user_id ,a.lin_grid_id) b on a.id= b.lin_grid_id
+    <select id="selectCqpm" resultType="java.util.LinkedHashMap">
+        select a.gridName,a.count - IFNULL( b.countQj, 0 ) AS lgbz
+        from
+            ( select  b.name  as gridName , count(a.id) as count ,b.id from centerdata_t_forest_linleader a , centerdata_t_forest_grid_level b  where a.lin_grid_id= b.id
+        group by b.name )
+                a
+                left join (SELECT count(a.id) as countQj,a.lin_grid_id  FROM `centerdata_t_forest_linleader` a  ,centerdata_t_leave b where a.user_id =b.leave_user_id and b.leave_end_time>= curdate() group by a.user_id ,a.lin_grid_id)
+                    b on a.id= b.lin_grid_id
         order by lgbz desc
         limit 5
     </select>
@@ -165,15 +170,15 @@
         SELECT
             d.ancestors,
             a.dept_id AS deptId,
-        SUM(CASE WHEN task_status = 1 THEN area ELSE 0 END) AS begin,
-        SUM(CASE WHEN task_status = 2 THEN area ELSE 0 END) AS notbegin,
-        SUM(CASE WHEN task_status = 3 THEN area ELSE 0 END) AS success
+        <foreach item="item" collection="dict" open="" separator="," close="">
+            SUM(CASE WHEN task_status = #{item.dictValue} THEN area ELSE 0 END) AS #{item.dictValue}
+        </foreach>
         FROM
             centerdata_t_afforestation_task a
         LEFT JOIN
-            ${database_system}.sys_dept d ON d.dept_id = a.dept_id
+            ${data.database_system}.sys_dept d ON d.dept_id = a.dept_id
         <where>
-            ${params.dataScope}
+            ${data.params.dataScope}
         </where>
         GROUP BY
             a.dept_id, d.ancestors;