Browse Source

增加权限校验

zhaowenrui 1 year ago
parent
commit
9b66b670d8

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

@@ -160,14 +160,14 @@ public class ForestBigDataController extends BaseController {
 
 
     @GetMapping ("/linLeaderCount")
-    public R linLeaderCount() {
-        return R.ok(forestBigDataService.linLeaderCount());
+    public R linLeaderCount(CenterdataTForestLinleader centerdataTForestLinleader) {
+        return R.ok(forestBigDataService.linLeaderCount(centerdataTForestLinleader));
     }
 
 
     @GetMapping ("/focusOnFire")
-    public R focusOnFire() {
-        return R.ok(forestBigDataService.focusOnFire());
+    public R focusOnFire(CenterdataTForestKeyFireproofPlots centerdataTForestKeyFireproofPlots) {
+        return R.ok(forestBigDataService.focusOnFire(centerdataTForestKeyFireproofPlots));
     }
 
     /**

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

@@ -55,9 +55,9 @@ public interface ForestBigDataMapper {
     List<String> queryTaskArea(@Param("status") String status);
 
 
-    List<Map<String, Object>> linLeaderCount();
+    List<Map<String, Object>> linLeaderCount(CenterdataTForestLinleader centerdataTForestLinleader);
 
-    List<Map<String, Object>> focusOnFire();
+    List<Map<String, Object>> focusOnFire(CenterdataTForestKeyFireproofPlots centerdataTForestKeyFireproofPlots);
     List<Map<String,Object>> selectResourcesAreaCount(CenterdataTForestResources centerdataTForestResources);
 
     List<Map<String,Object>> selectForestGridCount(CenterdataTForestGridLevelVo centerdataTForestGridLevel);

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

@@ -52,9 +52,9 @@ public interface IForestBigDataService {
     AjaxResult selectCenterdataTForestPlanHz();
 
 
-    List<Map<String, Object>> linLeaderCount();
+    List<Map<String, Object>> linLeaderCount(CenterdataTForestLinleader centerdataTForestLinleader);
 
-    List<Map<String, Object>> focusOnFire();
+    List<Map<String, Object>> focusOnFire(CenterdataTForestKeyFireproofPlots centerdataTForestKeyFireproofPlots);
 
     List<Map<String,Object>> selectResourcesAreaCount(CenterdataTForestResources centerdataTForestResources) throws IOException;
 

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

@@ -194,13 +194,17 @@ public class ForestBigDataServiceImpl extends BaseServiceImpl implements IForest
 
 
     @Override
-    public List<Map<String, Object>> linLeaderCount() {
-        return forestBigDataMapper.linLeaderCount();
+    @DataScopeMutiDept(deptAlias = "d")
+    public List<Map<String, Object>> linLeaderCount(CenterdataTForestLinleader centerdataTForestLinleader) {
+        setSookaDataBase(centerdataTForestLinleader);
+        return forestBigDataMapper.linLeaderCount(centerdataTForestLinleader);
     }
 
     @Override
-    public List<Map<String, Object>> focusOnFire() {
-        return forestBigDataMapper.focusOnFire();
+    @DataScopeMutiDept(deptAlias = "d")
+    public List<Map<String, Object>> focusOnFire(CenterdataTForestKeyFireproofPlots centerdataTForestKeyFireproofPlots) {
+        setSookaDataBase(centerdataTForestKeyFireproofPlots);
+        return forestBigDataMapper.focusOnFire(centerdataTForestKeyFireproofPlots);
     }
 
     @DataScopeMutiDept(deptAlias = "d")

+ 21 - 6
src/main/resources/mapper/digitalforest/ForestBigDataMapper.xml

@@ -203,20 +203,35 @@
     </select>
 
     <select id="linLeaderCount" resultType="map">
-        SELECT COUNT(lin_job) as value ,  '三员[治安员,卫生员,技术员]' name FROM `centerdata_t_forest_linleader` WHERE lin_job in ( "forest_lin_jy", "forest_lin_wsy", "forest_lin_jsy")
+        SELECT COUNT(*) as value ,  '三员[治安员,卫生员,技术员]' name FROM `centerdata_t_forest_linleader` a
+            left join ${database_system}.sys_dept d on d.dept_id = a.dept_id
+        where 1=1 AND a.lin_job in ("forest_lin_jy","forest_lin_wsy","forest_lin_jsy") ${params.dataScope}
         UNION all
-        SELECT COUNT(lin_job) as value ,  '村级林长' name FROM `centerdata_t_forest_linleader` WHERE lin_job in ("forest_lin_linzhang","forest_lin_fulinzhang","forest_lin_zonglinzhang","forest_lin_fuzonglinzhang","forest_lin_wgz") and lin_level = "forest_lin_sq"
+        SELECT COUNT(*) as value ,  '村级林长' name FROM `centerdata_t_forest_linleader` a
+            left join ${database_system}.sys_dept d on d.dept_id = a.dept_id
+        where 1=1 AND a.lin_job in ("forest_lin_linzhang","forest_lin_fulinzhang","forest_lin_zonglinzhang","forest_lin_fuzonglinzhang","forest_lin_wgz") and lin_level = "forest_lin_sq" ${params.dataScope}
         UNION all
-        SELECT COUNT(lin_job) as value ,  '乡镇街林长' name FROM `centerdata_t_forest_linleader` WHERE lin_job in ("forest_lin_linzhang","forest_lin_fulinzhang","forest_lin_zonglinzhang","forest_lin_fuzonglinzhang","forest_lin_wgz") and lin_level = "forest_lin_xz"
+        SELECT COUNT(*) as value ,  '乡镇街林长' name FROM `centerdata_t_forest_linleader` a
+            left join ${database_system}.sys_dept d on d.dept_id = a.dept_id
+        where 1=1 AND a.lin_job in ("forest_lin_linzhang","forest_lin_fulinzhang","forest_lin_zonglinzhang","forest_lin_fuzonglinzhang","forest_lin_wgz") and lin_level = "forest_lin_xz" ${params.dataScope}
         UNION all
-        SELECT COUNT(lin_job) as value ,  '县区林长' name FROM `centerdata_t_forest_linleader` WHERE lin_job in ("forest_lin_linzhang","forest_lin_fulinzhang","forest_lin_zonglinzhang","forest_lin_fuzonglinzhang","forest_lin_wgz") and lin_level = "forest_lin_xq"
+        SELECT COUNT(*) as value ,  '县区林长' name FROM `centerdata_t_forest_linleader` a
+            left join ${database_system}.sys_dept d on d.dept_id = a.dept_id
+        where 1=1 AND a.lin_job in ("forest_lin_linzhang","forest_lin_fulinzhang","forest_lin_zonglinzhang","forest_lin_fuzonglinzhang","forest_lin_wgz") and lin_level = "forest_lin_xq" ${params.dataScope}
         UNION all
-        SELECT COUNT(lin_job) as value ,  '护林员' name FROM `centerdata_t_forest_linleader` WHERE   lin_job = "forest_lin_hly"
+        SELECT COUNT(*) as value ,  '护林员' name FROM `centerdata_t_forest_linleader` a
+            left join ${database_system}.sys_dept d on d.dept_id = a.dept_id
+        where 1=1 AND a.lin_job = "forest_lin_hly" ${params.dataScope}
     </select>
 
 
     <select id="focusOnFire" resultType="map">
-        SELECT SUM(plots_area) as area ,COUNT(DISTINCT forest_species)as species,dept_name as deptName FROM `centerdata_t_forest_keyfireproofplots` GROUP BY dept_name
+        SELECT SUM(a.plots_area) as area ,COUNT(DISTINCT a.forest_species)as species,a.dept_name as deptName FROM `centerdata_t_forest_keyfireproofplots` a
+            left join ${database_system}.sys_dept d on a.dept_id = d.dept_id
+        <where>
+            ${params.dataScope}
+        </where>
+        GROUP BY deptName
     </select>
 
     <select id="selectResourcesAreaCount" resultType="java.util.Map">