|
@@ -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;
|
|
|
}
|
|
|
|
|
|
}
|