Bläddra i källkod

修改生成报告

bihuisong 2 månader sedan
förälder
incheckning
8186f0663c

+ 12 - 1
src/main/java/com/ruoyi/system/service/impl/SysMenuAppServiceImpl.java

@@ -10,6 +10,7 @@ import com.ruoyi.common.core.utils.DateUtils;
 import com.ruoyi.common.core.utils.StringUtils;
 import com.ruoyi.system.api.domain.SysRole;
 import com.ruoyi.system.api.domain.SysUser;
+import com.ruoyi.system.domain.SysMenu;
 import com.ruoyi.system.domain.vo.TreeSelect;
 import com.ruoyi.system.mapper.SysRoleMapper;
 import com.ruoyi.system.mapper.SysRoleMenuappMapper;
@@ -92,7 +93,17 @@ public class SysMenuAppServiceImpl implements ISysMenuAppService
     @Override
     public List<SysMenuApp> selectMenuList(SysMenuApp menu, Long userId)
     {
-        List<SysMenuApp> menuList = sysMenuAppMapper.selectMenuList(menu);
+        List<SysMenuApp> menuList = null;
+        // 管理员显示所有菜单信息
+        if (SysUser.isAdmin(userId))
+        {
+            menuList = sysMenuAppMapper.selectMenuList(menu);
+        }
+        else
+        {
+            menu.setStatus("0");
+            menuList = sysMenuAppMapper.selectMenuList(menu);
+        }
         return menuList;
     }
 

+ 12 - 36
src/main/java/com/ruoyi/system/service/impl/SysReportServiceImpl.java

@@ -209,8 +209,8 @@ public class SysReportServiceImpl implements ISysReportService {
         renderCenterRunEvent(doc, sysReportData);
         log.info("渲染事件中心数据当年 OK");
         //渲染数据中心数据
-        renderCenterData(doc);
-        log.info("渲染数据中心数据 OK");
+//        renderCenterData(doc);
+//        log.info("渲染数据中心数据 OK");
         //渲染传感器上报数和操作日志数
         renderDeviceCountAndOperateCount(doc);
         log.info("渲染传感器上报数和操作日志数 OK");
@@ -310,45 +310,21 @@ public class SysReportServiceImpl implements ISysReportService {
     private void renderRegisterAccountCount(Document doc) {
         Map registerAccountCount = sysReportMapper.selectRegisterAccountCount();
         doc.replace("${account.register.all}", registerAccountCount.get("all").toString(), false, true);
-        doc.replace("${account.register.sbj}", registerAccountCount.get("sbj").toString(), false, true);
-        doc.replace("${account.register.lyj}", registerAccountCount.get("lyj").toString(), false, true);
-        doc.replace("${account.register.nyncj}", registerAccountCount.get("nyncj").toString(), false, true);
-        doc.replace("${account.register.slj}", registerAccountCount.get("slj").toString(), false, true);
-        doc.replace("${account.register.sthjj}", registerAccountCount.get("sthjj").toString(), false, true);
-        doc.replace("${account.register.yjglj}", registerAccountCount.get("yjglj").toString(), false, true);
-        doc.replace("${account.register.jtysj}", registerAccountCount.get("jtysj").toString(), false, true);
-        doc.replace("${account.register.zrzyj}", registerAccountCount.get("zrzyj").toString(), false, true);
-        doc.replace("${account.register.xfjyzd}", registerAccountCount.get("xfjyzd").toString(), false, true);
-        doc.replace("${account.register.sls}", registerAccountCount.get("sls").toString(), false, true);
-        doc.replace("${account.register.lsx}", registerAccountCount.get("lsx").toString(), false, true);
-        doc.replace("${account.register.ytx}", registerAccountCount.get("ytx").toString(), false, true);
-        doc.replace("${account.register.tdq}", registerAccountCount.get("tdq").toString(), false, true);
-        doc.replace("${account.register.txq}", registerAccountCount.get("txq").toString(), false, true);
-        doc.replace("${account.register.gajjc}", registerAccountCount.get("gajjc").toString(), false, true);
-        doc.replace("${account.register.gaj}", registerAccountCount.get("gaj").toString(), false, true);
-        doc.replace("${account.register.fgw}", registerAccountCount.get("fgw").toString(), false, true);
+        doc.replace("${account.register.etk}", registerAccountCount.get("etk").toString(), false, true);
+        doc.replace("${account.register.zlzqz}", registerAccountCount.get("zlzqz").toString(), false, true);
+        doc.replace("${account.register.ccz}", registerAccountCount.get("ccz").toString(), false, true);
+        doc.replace("${account.register.asz}", registerAccountCount.get("asz").toString(), false, true);
+        doc.replace("${account.register.shmz}", registerAccountCount.get("shmz").toString(), false, true);
     }
 
     private void renderActiveAccountCount(Document doc) {
         Map activeAccountCount = sysReportMapper.selectActiveAccountCount();
         doc.replace("${account.active.all}", activeAccountCount.get("all").toString(), false, true);
-        doc.replace("${account.active.sbj}", activeAccountCount.get("sbj").toString(), false, true);
-        doc.replace("${account.active.lyj}", activeAccountCount.get("lyj").toString(), false, true);
-        doc.replace("${account.active.nyncj}", activeAccountCount.get("nyncj").toString(), false, true);
-        doc.replace("${account.active.slj}", activeAccountCount.get("slj").toString(), false, true);
-        doc.replace("${account.active.sthjj}", activeAccountCount.get("sthjj").toString(), false, true);
-        doc.replace("${account.active.yjglj}", activeAccountCount.get("yjglj").toString(), false, true);
-        doc.replace("${account.active.jtysj}", activeAccountCount.get("jtysj").toString(), false, true);
-        doc.replace("${account.active.zrzyj}", activeAccountCount.get("zrzyj").toString(), false, true);
-        doc.replace("${account.active.xfjyzd}", activeAccountCount.get("xfjyzd").toString(), false, true);
-        doc.replace("${account.active.sls}", activeAccountCount.get("sls").toString(), false, true);
-        doc.replace("${account.active.lsx}", activeAccountCount.get("lsx").toString(), false, true);
-        doc.replace("${account.active.ytx}", activeAccountCount.get("ytx").toString(), false, true);
-        doc.replace("${account.active.tdq}", activeAccountCount.get("tdq").toString(), false, true);
-        doc.replace("${account.active.txq}", activeAccountCount.get("txq").toString(), false, true);
-        doc.replace("${account.active.gajjc}", activeAccountCount.get("gajjc").toString(), false, true);
-        doc.replace("${account.active.gaj}", activeAccountCount.get("gaj").toString(), false, true);
-        doc.replace("${account.active.fgw}", activeAccountCount.get("fgw").toString(), false, true);
+        doc.replace("${account.active.etk}", activeAccountCount.get("etk").toString(), false, true);
+        doc.replace("${account.active.zlzqz}", activeAccountCount.get("zlzqz").toString(), false, true);
+        doc.replace("${account.active.ccz}", activeAccountCount.get("ccz").toString(), false, true);
+        doc.replace("${account.active.asz}", activeAccountCount.get("asz").toString(), false, true);
+        doc.replace("${account.active.shmz}", activeAccountCount.get("shmz").toString(), false, true);
     }
 
     private void renderDeviceCount(Document doc) {

+ 1 - 1
src/main/resources/mapper/system/SysMenuMapper.xml

@@ -70,7 +70,7 @@
 		left join sys_role_menu rm on m.menu_id = rm.menu_id
 		left join sys_user_role ur on rm.role_id = ur.role_id
 		left join sys_role ro on ur.role_id = ro.role_id
-		where ur.user_id = #{params.userId}
+		where m.status = 0 and ur.user_id = #{params.userId}
 		<if test="menuName != null and menuName != ''">
             AND m.menu_name like concat('%', #{menuName}, '%')
 		</if>

+ 1 - 1
src/main/resources/mapper/system/SysMenuVisuMapper.xml

@@ -194,7 +194,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         left join sys_role_menuvisu rm on m.menu_id = rm.menu_id
         left join sys_user_role ur on rm.role_id = ur.role_id
         left join sys_role ro on ur.role_id = ro.role_id
-        where ur.user_id = #{params.userId}
+        where m.status = 0 and ur.user_id = #{params.userId}
         <if test="menuName != null and menuName != ''">
             AND m.menu_name like concat('%', #{menuName}, '%')
         </if>

+ 30 - 59
src/main/resources/mapper/system/SysReportMapper.xml

@@ -167,23 +167,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <select id="selectRegisterAccountCount" resultType="java.util.HashMap">
         SELECT
             count(dept_id) `all`,
-            count(((dept_id = 365) OR NULL)) sbj,
-            count(((dept_id = 367) OR FIND_IN_SET(367,a.ancestors) OR NULL)) lyj,
-            count(((dept_id = 3776) OR FIND_IN_SET(3776,a.ancestors) OR NULL)) nyncj,
-            count(((dept_id = 3778) OR FIND_IN_SET(3778,a.ancestors) OR NULL)) slj,
-            count(((dept_id = 3773) OR FIND_IN_SET(3773,a.ancestors) OR NULL)) sthjj,
-            count(((dept_id = 3774) OR FIND_IN_SET(3774,a.ancestors) OR NULL)) yjglj,
-            count(((dept_id = 3775) OR FIND_IN_SET(3775,a.ancestors) OR NULL)) jtysj,
-            count(((dept_id = 3772) OR FIND_IN_SET(3772,a.ancestors) OR NULL)) zrzyj,
-            count(((dept_id = 3777) OR FIND_IN_SET(3777,a.ancestors) OR NULL)) xfjyzd,
-            count(((dept_id = 369) OR FIND_IN_SET(369,a.ancestors) OR NULL)) sls,
-            count(((dept_id = 371) OR FIND_IN_SET(371,a.ancestors)OR NULL)) lsx,
-            count(((dept_id = 370) OR FIND_IN_SET(370,a.ancestors)OR NULL)) ytx,
-            count(((dept_id = 372) OR FIND_IN_SET(372,a.ancestors)OR NULL)) tdq,
-            count(((dept_id = 373) OR FIND_IN_SET(373,a.ancestors)OR NULL)) txq,
-            count(((dept_id = 14449) OR FIND_IN_SET(14449,a.ancestors)OR NULL)) gajjc,
-            count(((dept_id = 14450) OR FIND_IN_SET(14450,a.ancestors)OR NULL)) gaj,
-            count(((dept_id = 14451) OR FIND_IN_SET(14451,a.ancestors)OR NULL)) fgw
+            count(((dept_id = 365) OR NULL)) etk,
+            count(((dept_id = 314391) OR FIND_IN_SET(314391,a.ancestors) OR NULL)) zlzqz,
+            count(((dept_id = 314392) OR FIND_IN_SET(314392,a.ancestors) OR NULL)) ccz,
+            count(((dept_id = 314393) OR FIND_IN_SET(314393,a.ancestors) OR NULL)) asz,
+            count(((dept_id = 314394) OR FIND_IN_SET(314394,a.ancestors) OR NULL)) shmz
         FROM
             (
                 SELECT
@@ -206,23 +194,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <select id="selectActiveAccountCount" resultType="java.util.HashMap">
         SELECT
             count(1) `all`,
-            count(((dept_id = 365) OR NULL)) sbj,
-            count(((dept_id = 367) OR FIND_IN_SET(367,a.ancestors) OR NULL)) lyj,
-            count(((dept_id = 3776) OR FIND_IN_SET(3776,a.ancestors) OR NULL)) nyncj,
-            count(((dept_id = 3778) OR FIND_IN_SET(3778,a.ancestors) OR NULL)) slj,
-            count(((dept_id = 3773) OR FIND_IN_SET(3773,a.ancestors) OR NULL)) sthjj,
-            count(((dept_id = 3774) OR FIND_IN_SET(3774,a.ancestors) OR NULL)) yjglj,
-            count(((dept_id = 3775) OR FIND_IN_SET(3775,a.ancestors) OR NULL)) jtysj,
-            count(((dept_id = 3772) OR FIND_IN_SET(3772,a.ancestors) OR NULL)) zrzyj,
-            count(((dept_id = 3777) OR FIND_IN_SET(3777,a.ancestors) OR NULL)) xfjyzd,
-            count(((dept_id = 369) OR FIND_IN_SET(369,a.ancestors) OR NULL)) sls,
-            count(((dept_id = 371) OR FIND_IN_SET(371,a.ancestors)OR NULL)) lsx,
-            count(((dept_id = 370) OR FIND_IN_SET(370,a.ancestors)OR NULL)) ytx,
-            count(((dept_id = 372) OR FIND_IN_SET(372,a.ancestors)OR NULL)) tdq,
-            count(((dept_id = 373) OR FIND_IN_SET(373,a.ancestors)OR NULL)) txq,
-            count(((dept_id = 14449) OR FIND_IN_SET(14449,a.ancestors)OR NULL)) gajjc,
-            count(((dept_id = 14450) OR FIND_IN_SET(14450,a.ancestors)OR NULL)) gaj,
-            count(((dept_id = 14451) OR FIND_IN_SET(14451,a.ancestors)OR NULL)) fgw
+            count(((dept_id = 365) OR NULL)) etk,
+            count(((dept_id = 314391) OR FIND_IN_SET(314391,a.ancestors) OR NULL)) zlzqz,
+            count(((dept_id = 314392) OR FIND_IN_SET(314392,a.ancestors) OR NULL)) ccz,
+            count(((dept_id = 314393) OR FIND_IN_SET(314393,a.ancestors) OR NULL)) asz,
+            count(((dept_id = 314394) OR FIND_IN_SET(314394,a.ancestors) OR NULL)) shmz
         FROM
             (
                 SELECT
@@ -277,21 +253,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                     'shuichi'
                 END
             ) device_type,
-            IFNULL(dt.`梨树县`, 0) '梨树县',
-            IFNULL(dt.`伊通县`, 0) '伊通县',
-            IFNULL(dt.`双辽市`, 0) '双辽市',
-            IFNULL(dt.`铁东区`, 0) '铁东区',
-            IFNULL(dt.`铁西区`, 0) '铁西区'
+            IFNULL(dt.`敖勒召其镇`, 0) '敖勒召其镇',
+            IFNULL(dt.`城川镇`, 0) '城川镇',
+            IFNULL(dt.`昂素镇`, 0) '昂素镇',
+            IFNULL(dt.`上海庙镇`, 0) '上海庙镇'
         FROM
             sys_dict_data dd
         LEFT JOIN (
             SELECT
                 device_type,
-                count((qx = '梨树县' OR NULL)) '梨树县',
-                count((qx = '伊通县' OR NULL)) '伊通县',
-                count((qx = '双辽市' OR NULL)) '双辽市',
-                count((qx = '铁东区' OR NULL)) '铁东区',
-                count((qx = '铁西区' OR NULL)) '铁西区'
+                count((qx = '敖勒召其镇' OR NULL)) '敖勒召其镇',
+                count((qx = '城川镇' OR NULL)) '城川镇',
+                count((qx = '昂素镇' OR NULL)) '昂素镇',
+                count((qx = '上海庙镇' OR NULL)) '上海庙镇'
             FROM
                 (
                     SELECT DISTINCT
@@ -299,21 +273,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                         d.device_type,
                         (
                             CASE
-                            WHEN find_in_set(369, sd.ancestors) > 0
-                            OR sd.dept_id = 369 THEN
-                                '双辽市'
-                            WHEN find_in_set(370, sd.ancestors) > 0
-                            OR sd.dept_id = 370 THEN
-                                '伊通县'
-                            WHEN find_in_set(371, sd.ancestors) > 0
-                            OR sd.dept_id = 371 THEN
-                                '梨树县'
-                            WHEN find_in_set(372, sd.ancestors) > 0
-                            OR sd.dept_id = 372 THEN
-                                '铁东区'
-                            WHEN find_in_set(373, sd.ancestors) > 0
-                            OR sd.dept_id = 373 THEN
-                                '铁西区'
+                            WHEN find_in_set(314391, sd.ancestors) > 0
+                            OR sd.dept_id = 314391 THEN
+                                '敖勒召其镇'
+                            WHEN find_in_set(314392, sd.ancestors) > 0
+                            OR sd.dept_id = 314392 THEN
+                                '城川镇'
+                            WHEN find_in_set(314393, sd.ancestors) > 0
+                            OR sd.dept_id = 314393 THEN
+                                '昂素镇'
+                            WHEN find_in_set(314394, sd.ancestors) > 0
+                            OR sd.dept_id = 314394 THEN
+                                '上海庙镇'
                             ELSE
                                 '0'
                             END

BIN
src/main/resources/template/template.docx