Browse Source

数字林业 林长增加级别

hanfucheng 11 months ago
parent
commit
4e27997290

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

@@ -5,6 +5,7 @@ import com.ruoyi.common.core.web.controller.BaseController;
 import com.ruoyi.common.core.web.domain.AjaxResult;
 import com.sooka.sponest.data.digitalfirecontrol.domain.bo.FireControlViewBO;
 import com.sooka.sponest.data.digitalfirecontrol.service.IFireControlViewService;
+import com.sooka.sponest.data.digitalforest.domain.bo.ForestCloudRYBO;
 import com.sooka.sponest.data.digitalforest.domain.bo.ForestCloudRyZxBO;
 import com.sooka.sponest.data.digitalforest.domain.bo.ForestLeaderBO;
 import com.sooka.sponest.data.digitalforest.domain.bo.ForestViewBO;
@@ -99,7 +100,7 @@ public class ForestViewController extends BaseController {
 
     @ApiOperation(value = "林场查询总人数用户Id", notes = "林场查询总人数用户Id")
     @PostMapping("/getRyList")
-    public R<ForestCloudRYList> getRyList(@RequestBody ForestCloudMapVO forestCloudMapVO) {
+    public R<List<ForestCloudRYBO>> getRyList(@RequestBody ForestCloudMapVO forestCloudMapVO) {
         return R.ok(forestViewService.getRyList(forestCloudMapVO));
     }
 
@@ -108,4 +109,10 @@ public class ForestViewController extends BaseController {
     public R<List<ForestLeaderBO>> getForestLeader(@RequestBody ForestLeaderVO vo) {
         return R.ok(forestViewService.getForestLeader(vo));
     }
-}
+
+    @ApiOperation(value = "按级别统计林长人数", notes = "按级别统计林长人数")
+    @GetMapping("/getNumByLevel")
+    public R<List<Map<String,Object>>> getNumByLevel(ForestLeaderVO vo) {
+        return R.ok(forestViewService.getNumByLevel(vo));
+    }
+}

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

@@ -18,4 +18,6 @@ public interface ForestViewMapper {
     public  List<ForestCloudRyZxUerIdBO> selectZXRSUerId(ForestCloudMapVO forestCloudMapVO);
 
     public List<ForestLeaderBO> getForestLeader(ForestLeaderVO vo);
+
+    public List<Map<String,Object>> getNumByLevel(ForestLeaderVO vo);
 }

+ 4 - 1
src/main/java/com/sooka/sponest/data/digitalforest/service/IForestViewService.java

@@ -1,6 +1,7 @@
 package com.sooka.sponest.data.digitalforest.service;
 
 import com.sooka.sponest.data.base.service.IBaseService;
+import com.sooka.sponest.data.digitalforest.domain.bo.ForestCloudRYBO;
 import com.sooka.sponest.data.digitalforest.domain.bo.ForestCloudRyZxBO;
 import com.sooka.sponest.data.digitalforest.domain.bo.ForestLeaderBO;
 import com.sooka.sponest.data.digitalforest.domain.bo.ForestViewBO;
@@ -27,7 +28,9 @@ public interface IForestViewService extends IBaseService {
 
     List<Map<String, Object>> dataFilter(List<Map<String, Object>> pointList);
     public ForestCloudRyZxBO selectZXRS(ForestCloudMapVO forestCloudMapVO);
-    public ForestCloudRYList getRyList(ForestCloudMapVO forestCloudMapVO);
+    public List<ForestCloudRYBO> getRyList(ForestCloudMapVO forestCloudMapVO);
 
     public List<ForestLeaderBO> getForestLeader(ForestLeaderVO vo);
+
+    public List<Map<String,Object>> getNumByLevel(ForestLeaderVO vo);
 }

+ 14 - 7
src/main/java/com/sooka/sponest/data/digitalforest/service/impl/ForestViewServiceImpl.java

@@ -81,14 +81,14 @@ public class ForestViewServiceImpl extends BaseServiceImpl implements IForestVie
 
     @Override
     @DataScopeMutiDept(deptAlias = "d", userAlias = "u")
-    public ForestCloudRYList getRyList(ForestCloudMapVO forestCloudMapVO) {
+    public List<ForestCloudRYBO> getRyList(ForestCloudMapVO forestCloudMapVO) {
         setSookaDataBase(forestCloudMapVO);
-        List<ForestCloudRYBO> visuForestCloudRYBO = forestViewMapper.selectVisualRy(forestCloudMapVO);
-        List<ForestCloudRyZxUerIdBO> userList = forestViewMapper.selectZXRSUerId(forestCloudMapVO);
-        ForestCloudRYList forestCloudRYList = new ForestCloudRYList();
-        forestCloudRYList.setUserList(userList);
-        forestCloudRYList.setVisuForestCloudRYBO(visuForestCloudRYBO);
-        return forestCloudRYList;
+        //在线人数
+//        List<ForestCloudRyZxUerIdBO> userList = forestViewMapper.selectZXRSUerId(forestCloudMapVO);
+//        ForestCloudRYList forestCloudRYList = new ForestCloudRYList();
+//        forestCloudRYList.setUserList(userList);
+//        forestCloudRYList.setVisuForestCloudRYBO(visuForestCloudRYBO);
+        return forestViewMapper.selectVisualRy(forestCloudMapVO);
     }
 
     @Override
@@ -97,4 +97,11 @@ public class ForestViewServiceImpl extends BaseServiceImpl implements IForestVie
         setSookaDataBase(vo);
         return forestViewMapper.getForestLeader(vo);
     }
+
+    @Override
+    @DataScopeMutiDept(deptAlias = "d", userAlias = "u")
+    public List<Map<String,Object>> getNumByLevel(ForestLeaderVO vo) {
+        setSookaDataBase(vo);
+        return forestViewMapper.getNumByLevel(vo);
+    }
 }

+ 45 - 11
src/main/resources/mapper/digitalforest/ForestViewMapper.xml

@@ -47,16 +47,25 @@
     </select>
 
     <select id="selectVisualRy" parameterType="ForestCloudMapVO" resultType="ForestCloudRYBO">
-        SELECT
-        a.dict_label as job ,a.dict_value as jobValue ,count(b.user_id) as number ,'' as jobType,a.dict_sort
-        FROM
-        ( SELECT dict_label, dict_value,dict_sort FROM ${database_system}.sys_dict_data WHERE dict_type = 'forest_lin_job' and
-        status='0'	) a
-        LEFT JOIN ( SELECT DISTINCT a.user_id,a.lin_job FROM  ${database_data}.centerdata_t_forest_linleader  a left join ${database_system}.sys_dept d on a.dept_id=d.dept_id where 1=1 ${params.dataScope}) b ON a.dict_value = b.lin_job
-        GROUP BY
-        a.dict_value
-        ORDER BY
-	    a.dict_sort
+        SELECT a.dict_label     as job,
+               a.dict_value     as jobValue,
+               count(b.user_id) as number,
+               ''               as jobType,
+               a.dict_sort
+        FROM (SELECT dict_label, dict_value, dict_sort
+              FROM ${database_system}.sys_dict_data
+              WHERE dict_type = 'forest_lin_job'
+                and status = '0') a
+                 LEFT JOIN (SELECT DISTINCT a.user_id, a.lin_job
+                            FROM ${database_data}.centerdata_t_forest_linleader a
+                                     left join ${database_system}.sys_dept d on a.dept_id = d.dept_id
+                            <where>
+                            <if test="level != null  and level != ''">and a.lin_level = #{level}</if>
+                            ${params.dataScope}
+                            </where>
+                            ) b ON a.dict_value = b.lin_job
+        GROUP BY a.dict_value
+        ORDER BY a.dict_sort
     </select>
 
     <select id="selectZXRS" parameterType="ForestCloudMapVO" resultType="ForestCloudRyZxBO">
@@ -100,6 +109,9 @@
         <if test="name != null and name != ''">
             and a.lin_name like concat('%', #{name}, '%')
         </if>
+        <if test="level != null  and level != ''">
+            and a.lin_level = #{level}
+        </if>
         <choose>
             <when test="deptId != null  and deptId != ''">
                 and FIND_IN_SET( #{deptId}, CONCAT(d.ancestors,',',d.dept_id) )
@@ -110,4 +122,26 @@
         </choose>
         order by a.num,a.create_time desc
     </select>
-</mapper>
+
+    <select id="getNumByLevel" parameterType="ForestLeaderVO" resultType="map">
+        SELECT
+            a.dict_label name,
+            a.dict_value level,
+            b.num
+        FROM
+            ${database_system}.sys_dict_data a
+            LEFT JOIN (
+                SELECT
+                    a.lin_level,
+                    count( a.id ) num
+                FROM
+                    centerdata_t_forest_linleader a
+                        LEFT JOIN ${database_system}.sys_dept d ON a.dept_id = d.dept_id
+                where 1= 1 ${params.dataScope}
+                GROUP BY
+                    a.lin_level
+            ) b ON a.dict_value = b.lin_level
+        WHERE
+            a.dict_type = 'forest_lin_level'
+    </select>
+</mapper>