Explorar el Código

数据统计添加数据权限

wyyay hace 1 año
padre
commit
b4ed3dd429

+ 4 - 7
business-service/src/main/java/com/ozs/service/mapper/MsgAlarmMapper.java

@@ -22,19 +22,16 @@ import java.util.Map;
 @Mapper
 @Mapper
 public interface MsgAlarmMapper extends BaseMapper<MsgAlarm> {
 public interface MsgAlarmMapper extends BaseMapper<MsgAlarm> {
     //报警数据详情
     //报警数据详情
-    List<AlarmStatisticVo> list(@Param("railwayCode") String railwayCode, @Param("currentYear") Integer currentYear, @Param("currentMonth") Integer currentMonth, @Param("alarmType") String alarmType, @Param("userId") String userId);
+    List<AlarmStatisticVo> list(AlarmStatisticResVo alarmStatisticResVo);
 
 
     //报警数据详情导出数据集合
     //报警数据详情导出数据集合
-    List<AlarmStatisticDto> listDto(@Param("railwayCode") String railwayCode, @Param("currentYear") Integer currentYear, @Param("currentMonth") Integer currentMonth, @Param("alarmType") String alarmType, @Param("userId") String userId);
-
-    //报警月统计数据
-    List<AlarmStatisticVo> listMonth(@Param("railwayCode") String railwayCode, @Param("currentYear") Integer currentYear, @Param("currentMonth") Integer currentMonth, @Param("alarmType") String alarmType, @Param("userId") String userId);
+    List<AlarmStatisticDto> listDto(AlarmStatisticResVo alarmStatisticResVo);
 
 
     //报警月统计数据导出数据集合
     //报警月统计数据导出数据集合
-    List<AlarmStatisticMonthDto> listDtoMonth(@Param("railwayCode") String railwayCode, @Param("currentYear") Integer currentYear, @Param("currentMonth") Integer currentMonth, @Param("alarmType") String alarmType, @Param("userId") String userId);
+    List<AlarmStatisticMonthDto> listDtoMonth(AlarmStatisticResVo alarmStatisticResVo);
 
 
     //报警月统计数据导出数据集合(天)
     //报警月统计数据导出数据集合(天)
-    List<AlarmStatisticMonthDto> listDtoDay(@Param("railwayCode") String railwayCode, @Param("currentYear") Integer currentYear, @Param("currentMonth") Integer currentMonth, @Param("alarmType") String alarmType, @Param("userId") String userId);
+    List<AlarmStatisticMonthDto> listDtoDay(AlarmStatisticResVo alarmStatisticResVo);
 
 
     Integer selectCameraCode(@Param("cameraCode") String cameraCode);
     Integer selectCameraCode(@Param("cameraCode") String cameraCode);
 
 

+ 4 - 11
business-service/src/main/java/com/ozs/service/service/MsgAlarmService.java

@@ -19,25 +19,18 @@ import java.util.Map;
  */
  */
 public interface MsgAlarmService extends IService<MsgAlarm> {
 public interface MsgAlarmService extends IService<MsgAlarm> {
     //web数据统计 报警数据详情
     //web数据统计 报警数据详情
-    List<AlarmStatisticVo> list(String railwayCode, Integer currentYear, Integer currentMonth, String alarmType, Integer pageNum, Integer pageSize, String userId);
+    List<AlarmStatisticVo> list(AlarmStatisticResVo alarmStatisticResVo);
 
 
     IPage listToPage(List list, int pageNum, int pageSize);
     IPage listToPage(List list, int pageNum, int pageSize);
 
 
     //web数据统计 报警月统计数据
     //web数据统计 报警月统计数据
-    List<AlarmStatisticMonthDto> getCount(String railwayCode, Integer currentYear, Integer currentMonth, String alarmType, String userId);
+    List<AlarmStatisticMonthDto> getCount(AlarmStatisticResVo alarmStatisticResVo);
 
 
     //web数据统计 报警月统计数据(天)
     //web数据统计 报警月统计数据(天)
-    List<AlarmStatisticMonthDto> getDayCount(String railwayCode, Integer currentYear, Integer currentMonth, String alarmType, String userId);
+    List<AlarmStatisticMonthDto> getDayCount(AlarmStatisticResVo alarmStatisticResVo);
 
 
     //报警数据详情导出数据集合
     //报警数据详情导出数据集合
-    List<AlarmStatisticDto> exportExcel(AlarmStatisticResVo alarmStatisticResVo, String userId);
-
-    //报警数据详情导出数据集合(天)
-    List<AlarmStatisticMonthDto> exportDayExcel(AlarmStatisticResVo alarmStatisticResVo, String userId);
-
-    //web数据统计 报警月统计数据导出
-    List<AlarmStatisticMonthDto> exportExcelMonth(AlarmStatisticResVo alarmStatisticResVo, String userId) throws Exception;
-
+    List<AlarmStatisticDto> exportExcel(AlarmStatisticResVo alarmStatisticResVo);
     /**
     /**
      * 通过相机编码查询未解除预警信息
      * 通过相机编码查询未解除预警信息
      *
      *

+ 8 - 23
business-service/src/main/java/com/ozs/service/service/impl/MsgAlarmServiceImpl.java

@@ -50,41 +50,26 @@ public class MsgAlarmServiceImpl extends ServiceImpl<MsgAlarmMapper, MsgAlarm> i
 
 
     //web数据统计 报警数据详情
     //web数据统计 报警数据详情
     @Override
     @Override
-    public List<AlarmStatisticVo> list(String railwayCode, Integer currentYear, Integer currentMonth, String alarmType, Integer pageNum, Integer pageSize, String userId) {
-        List<AlarmStatisticVo> list = msgAlarmMapper.list(railwayCode, currentYear, currentMonth, alarmType, userId);
+    public List<AlarmStatisticVo> list(AlarmStatisticResVo alarmStatisticResVo) {
+        List<AlarmStatisticVo> list = msgAlarmMapper.list(alarmStatisticResVo);
         return list;
         return list;
     }
     }
 
 
     @Override
     @Override
-    public List<AlarmStatisticMonthDto> getCount(String railwayCode, Integer currentYear, Integer currentMonth, String alarmType, String userId) {
-        List<AlarmStatisticMonthDto> list = msgAlarmMapper.listDtoMonth(railwayCode, currentYear, currentMonth, alarmType, userId);
+    public List<AlarmStatisticMonthDto> getCount(AlarmStatisticResVo alarmStatisticResVo) {
+        List<AlarmStatisticMonthDto> list = msgAlarmMapper.listDtoMonth(alarmStatisticResVo);
         return list;
         return list;
     }
     }
 
 
     @Override
     @Override
-    public List<AlarmStatisticMonthDto> getDayCount(String railwayCode, Integer currentYear, Integer currentMonth, String alarmType, String userId) {
-        List<AlarmStatisticMonthDto> list = msgAlarmMapper.listDtoDay(railwayCode, currentYear, currentMonth, alarmType, userId);
+    public List<AlarmStatisticMonthDto> getDayCount(AlarmStatisticResVo alarmStatisticResVo) {
+        List<AlarmStatisticMonthDto> list = msgAlarmMapper.listDtoDay(alarmStatisticResVo);
         return list;
         return list;
     }
     }
 
 
     @Override
     @Override
-    public List<AlarmStatisticDto> exportExcel(AlarmStatisticResVo alarmStatisticResVo, String userId) {
-        List<AlarmStatisticDto> listDto = msgAlarmMapper.listDto(alarmStatisticResVo.getRailwayCode(), alarmStatisticResVo.getCurrentYear(),
-                alarmStatisticResVo.getCurrentMonth(), alarmStatisticResVo.getAlarmType(), userId);
-        return listDto;
-    }
-
-    @Override
-    public List<AlarmStatisticMonthDto> exportDayExcel(AlarmStatisticResVo alarmStatisticResVo, String userId) {
-        List<AlarmStatisticMonthDto> listDto = msgAlarmMapper.listDtoDay(alarmStatisticResVo.getRailwayCode(), alarmStatisticResVo.getCurrentYear(),
-                alarmStatisticResVo.getCurrentMonth(), alarmStatisticResVo.getAlarmType(), userId);
-        return listDto;
-    }
-
-    @Override
-    public List<AlarmStatisticMonthDto> exportExcelMonth(AlarmStatisticResVo alarmStatisticResVo, String userId) throws Exception {
-        List<AlarmStatisticMonthDto> listDto = msgAlarmMapper.listDtoMonth(alarmStatisticResVo.getRailwayCode(), alarmStatisticResVo.getCurrentYear(),
-                alarmStatisticResVo.getCurrentMonth(), alarmStatisticResVo.getAlarmType(), userId);
+    public List<AlarmStatisticDto> exportExcel(AlarmStatisticResVo alarmStatisticResVo) {
+        List<AlarmStatisticDto> listDto = msgAlarmMapper.listDto(alarmStatisticResVo);
         return listDto;
         return listDto;
     }
     }
 
 

+ 72 - 20
business-service/src/main/resources/mapper/service/MsgAlarmMapper.xml

@@ -22,7 +22,7 @@
         <result column="is_lock" property="isLock"/>
         <result column="is_lock" property="isLock"/>
     </resultMap>
     </resultMap>
 
 
-    <select id="list" resultMap="AlarmStatisticVoResult">
+    <select id="list" parameterType="com.ozs.service.entity.vo.AlarmStatisticResVo" resultMap="AlarmStatisticVoResult">
         SELECT
         SELECT
         a.alarm_id ,
         a.alarm_id ,
         a.camera_code ,
         a.camera_code ,
@@ -42,9 +42,8 @@
         a.remark,
         a.remark,
         a.is_lock
         a.is_lock
         FROM
         FROM
-        msg_alarm AS a left join
+        msg_alarm AS a inner join
         base_camera_management AS b on a.camera_code=b.camera_code left join
         base_camera_management AS b on a.camera_code=b.camera_code left join
-        msg_web_push m on a.alarm_id = m.alarm_id left join
         base_railway_management c on b.railway_code=c.railway_code
         base_railway_management c on b.railway_code=c.railway_code
 
 
         <where>
         <where>
@@ -63,8 +62,22 @@
             <if test="alarmType != null and alarmType != ''">
             <if test="alarmType != null and alarmType != ''">
                 and UPPER(a.alarm_type) like UPPER(CONCAT('%',#{alarmType},'%'))
                 and UPPER(a.alarm_type) like UPPER(CONCAT('%',#{alarmType},'%'))
             </if>
             </if>
-            <if test="userId != null and userId != ''">
-                and UPPER(m.receive_by) like UPPER(CONCAT('%',#{userId},'%'))
+            <if test="!dsFlay">
+                and
+                <trim prefix="(" prefixOverrides="or" suffix=")">
+                    <if test="dsUserId != null and dsUserId != ''">
+                        or a.create_by=#{dsUserId}
+                    </if>
+                    <if test="dsDeptId != null and dsDeptId != 0">
+                        or b.dept_id=#{dsDeptId}
+                    </if>
+                    <if test="dsDeptIds != null">
+                        or b.dept_id in
+                        <foreach item="item" collection="dsDeptIds" separator="," open="(" close=")" index="">
+                            #{item}
+                        </foreach>
+                    </if>
+                </trim>
             </if>
             </if>
         </where>
         </where>
         group by a.alarm_id order by a.alarm_time desc
         group by a.alarm_id order by a.alarm_time desc
@@ -90,7 +103,7 @@
         <result column="remark" property="remark"/>
         <result column="remark" property="remark"/>
         <result column="isLock" property="isLock"/>
         <result column="isLock" property="isLock"/>
     </resultMap>
     </resultMap>
-    <select id="listDto" resultMap="AlarmStatisticDtoResult">
+    <select id="listDto" parameterType="com.ozs.service.entity.vo.AlarmStatisticResVo" resultMap="AlarmStatisticDtoResult">
         SELECT
         SELECT
         a.alarm_id AS alarmId,
         a.alarm_id AS alarmId,
         a.camera_code AS cameraCode,
         a.camera_code AS cameraCode,
@@ -110,9 +123,8 @@
         a.remark AS remark,
         a.remark AS remark,
         a.is_lock AS isLock
         a.is_lock AS isLock
         FROM
         FROM
-        msg_alarm AS a left join
+        msg_alarm AS a inner join
         base_camera_management AS b on a.camera_code=b.camera_code left join
         base_camera_management AS b on a.camera_code=b.camera_code left join
-        msg_web_push m on a.alarm_id = m.alarm_id left join
         base_railway_management c on b.railway_code=c.railway_code
         base_railway_management c on b.railway_code=c.railway_code
 
 
         <where>
         <where>
@@ -131,8 +143,22 @@
             <if test="alarmType != null and alarmType != ''">
             <if test="alarmType != null and alarmType != ''">
                 and UPPER(a.alarm_type) like UPPER(CONCAT('%',#{alarmType},'%'))
                 and UPPER(a.alarm_type) like UPPER(CONCAT('%',#{alarmType},'%'))
             </if>
             </if>
-            <if test="userId != null and userId != ''">
-                and UPPER(m.receive_by) like UPPER(CONCAT('%',#{userId},'%'))
+            <if test="!dsFlay">
+                and
+                <trim prefix="(" prefixOverrides="or" suffix=")">
+                    <if test="dsUserId != null and dsUserId != ''">
+                        or a.create_by=#{dsUserId}
+                    </if>
+                    <if test="dsDeptId != null and dsDeptId != 0">
+                        or b.dept_id=#{dsDeptId}
+                    </if>
+                    <if test="dsDeptIds != null">
+                        or b.dept_id in
+                        <foreach item="item" collection="dsDeptIds" separator="," open="(" close=")" index="">
+                            #{item}
+                        </foreach>
+                    </if>
+                </trim>
             </if>
             </if>
         </where>
         </where>
         group by a.alarm_id order by a.alarm_time desc
         group by a.alarm_id order by a.alarm_time desc
@@ -144,7 +170,7 @@
         <result column="frequency" property="frequency"/>
         <result column="frequency" property="frequency"/>
         <result column="alarm_type" property="alarmType"/>
         <result column="alarm_type" property="alarmType"/>
     </resultMap>
     </resultMap>
-    <select id="listDtoMonth" resultMap="AlarmStatisticMonthDtoResult">
+    <select id="listDtoMonth" parameterType="com.ozs.service.entity.vo.AlarmStatisticResVo" resultMap="AlarmStatisticMonthDtoResult">
         SELECT p.monthsta as monthsta,sum(p.fre) as frequency,p.monthstaString as monthstaString
         SELECT p.monthsta as monthsta,sum(p.fre) as frequency,p.monthstaString as monthstaString
         from
         from
         (SELECT
         (SELECT
@@ -152,9 +178,8 @@
         MONTH(a.alarm_time) as monthsta,
         MONTH(a.alarm_time) as monthsta,
         count(DISTINCT a.alarm_id) as fre
         count(DISTINCT a.alarm_id) as fre
         FROM
         FROM
-        msg_alarm AS a left join
+        msg_alarm AS a inner join
         base_camera_management AS b on a.camera_code=b.camera_code left join
         base_camera_management AS b on a.camera_code=b.camera_code left join
-        msg_web_push m on a.alarm_id = m.alarm_id left join
         base_railway_management c on b.railway_code=c.railway_code
         base_railway_management c on b.railway_code=c.railway_code
 
 
         <where>
         <where>
@@ -173,14 +198,28 @@
             <if test="alarmType != null and alarmType != ''">
             <if test="alarmType != null and alarmType != ''">
                 and UPPER(a.alarm_type) like UPPER(CONCAT('%',#{alarmType},'%'))
                 and UPPER(a.alarm_type) like UPPER(CONCAT('%',#{alarmType},'%'))
             </if>
             </if>
-            <if test="userId != null and userId != ''">
-                and UPPER(m.receive_by) like UPPER(CONCAT('%',#{userId},'%'))
+            <if test="!dsFlay">
+                and
+                <trim prefix="(" prefixOverrides="or" suffix=")">
+                    <if test="dsUserId != null and dsUserId != ''">
+                        or a.create_by=#{dsUserId}
+                    </if>
+                    <if test="dsDeptId != null and dsDeptId != 0">
+                        or b.dept_id=#{dsDeptId}
+                    </if>
+                    <if test="dsDeptIds != null">
+                        or b.dept_id in
+                        <foreach item="item" collection="dsDeptIds" separator="," open="(" close=")" index="">
+                            #{item}
+                        </foreach>
+                    </if>
+                </trim>
             </if>
             </if>
         </where>
         </where>
         group by a.alarm_id) AS p group by p.monthsta order by p.monthsta
         group by a.alarm_id) AS p group by p.monthsta order by p.monthsta
     </select>
     </select>
 
 
-    <select id="listDtoDay" resultMap="AlarmStatisticMonthDtoResult">
+    <select id="listDtoDay" parameterType="com.ozs.service.entity.vo.AlarmStatisticResVo" resultMap="AlarmStatisticMonthDtoResult">
         SELECT p.daysta as monthsta,sum(p.fre) as frequency,p.daystaString as monthstaString
         SELECT p.daysta as monthsta,sum(p.fre) as frequency,p.daystaString as monthstaString
         from
         from
         (SELECT
         (SELECT
@@ -188,9 +227,8 @@
         DAY(a.alarm_time) as daysta,
         DAY(a.alarm_time) as daysta,
         count(DISTINCT a.alarm_id) as fre
         count(DISTINCT a.alarm_id) as fre
         FROM
         FROM
-        msg_alarm AS a left join
+        msg_alarm AS a inner join
         base_camera_management AS b on a.camera_code=b.camera_code left join
         base_camera_management AS b on a.camera_code=b.camera_code left join
-        msg_web_push m on a.alarm_id = m.alarm_id left join
         base_railway_management c on b.railway_code=c.railway_code
         base_railway_management c on b.railway_code=c.railway_code
 
 
         <where>
         <where>
@@ -209,8 +247,22 @@
             <if test="alarmType != null and alarmType != ''">
             <if test="alarmType != null and alarmType != ''">
                 and UPPER(a.alarm_type) like UPPER(CONCAT('%',#{alarmType},'%'))
                 and UPPER(a.alarm_type) like UPPER(CONCAT('%',#{alarmType},'%'))
             </if>
             </if>
-            <if test="userId != null and userId != ''">
-                and UPPER(m.receive_by) like UPPER(CONCAT('%',#{userId},'%'))
+            <if test="!dsFlay">
+                and
+                <trim prefix="(" prefixOverrides="or" suffix=")">
+                    <if test="dsUserId != null and dsUserId != ''">
+                        or a.create_by=#{dsUserId}
+                    </if>
+                    <if test="dsDeptId != null and dsDeptId != 0">
+                        or b.dept_id=#{dsDeptId}
+                    </if>
+                    <if test="dsDeptIds != null">
+                        or b.dept_id in
+                        <foreach item="item" collection="dsDeptIds" separator="," open="(" close=")" index="">
+                            #{item}
+                        </foreach>
+                    </if>
+                </trim>
             </if>
             </if>
         </where>
         </where>
         group by a.alarm_id) AS p group by p.daysta order by p.daysta
         group by a.alarm_id) AS p group by p.daysta order by p.daysta

+ 11 - 32
hazard-admin/src/main/java/com/ozs/web/controller/accountmanagment/MsgAlarmController.java

@@ -529,13 +529,9 @@ public class MsgAlarmController extends BaseController {
     public AjaxResult dataStatistic(@RequestBody AlarmStatisticResVo alarmStatisticResVo) {
     public AjaxResult dataStatistic(@RequestBody AlarmStatisticResVo alarmStatisticResVo) {
         Integer pageNum = alarmStatisticResVo.getPageNum().intValue();
         Integer pageNum = alarmStatisticResVo.getPageNum().intValue();
         Integer pageSize = alarmStatisticResVo.getPageSize().intValue();
         Integer pageSize = alarmStatisticResVo.getPageSize().intValue();
-        SysUser user = getLoginUser().getUser();
-        String userId = getUserId();
-        if (user.isAdmin(user.getId())) {
-            userId = "";
-        }
-        List<AlarmStatisticVo> list = msgAlarmService.list(alarmStatisticResVo.getRailwayCode(), alarmStatisticResVo.getCurrentYear(),
-                alarmStatisticResVo.getCurrentMonth(), alarmStatisticResVo.getAlarmType(), pageNum, pageSize, userId);
+
+        alarmStatisticResVo = (AlarmStatisticResVo) dataScoreUtil.setDataScore(getUserId(), alarmStatisticResVo);
+        List<AlarmStatisticVo> list = msgAlarmService.list(alarmStatisticResVo);
         if (!ObjectUtils.isEmpty(list)) {
         if (!ObjectUtils.isEmpty(list)) {
             list.forEach(l -> {
             list.forEach(l -> {
                 if (!ObjectUtils.isEmpty(l.getAlarmMile())) {
                 if (!ObjectUtils.isEmpty(l.getAlarmMile())) {
@@ -586,18 +582,12 @@ public class MsgAlarmController extends BaseController {
             @ApiImplicitParam(paramType = "query", name = "alarmType", value = "灾害类型"),
             @ApiImplicitParam(paramType = "query", name = "alarmType", value = "灾害类型"),
     })
     })
     public AjaxResult alarmMonthStatistic(@RequestBody AlarmStatisticResVo alarmStatisticResVo) {
     public AjaxResult alarmMonthStatistic(@RequestBody AlarmStatisticResVo alarmStatisticResVo) {
-        SysUser user = getLoginUser().getUser();
-        String userId = getUserId();
-        ;
-        if (user.isAdmin(user.getId())) {
-            userId = "";
-        }
+        alarmStatisticResVo = (AlarmStatisticResVo) dataScoreUtil.setDataScore(getUserId(), alarmStatisticResVo);
         List<Integer> numbs = new ArrayList<>();
         List<Integer> numbs = new ArrayList<>();
         Integer listSize;
         Integer listSize;
         List<AlarmStatisticMonthDto> list = null;
         List<AlarmStatisticMonthDto> list = null;
         if (ObjectUtils.isEmpty(alarmStatisticResVo.getCurrentMonth())) {
         if (ObjectUtils.isEmpty(alarmStatisticResVo.getCurrentMonth())) {
-            list = msgAlarmService.getCount(alarmStatisticResVo.getRailwayCode(), alarmStatisticResVo.getCurrentYear(),
-                    alarmStatisticResVo.getCurrentMonth(), alarmStatisticResVo.getAlarmType(), userId);
+            list = msgAlarmService.getCount(alarmStatisticResVo);
             listSize = 12;
             listSize = 12;
         } else {
         } else {
             if (alarmStatisticResVo.getCurrentMonth().equals(2)) {//2
             if (alarmStatisticResVo.getCurrentMonth().equals(2)) {//2
@@ -608,8 +598,7 @@ public class MsgAlarmController extends BaseController {
             } else {//1,3,5,7,8,10,12
             } else {//1,3,5,7,8,10,12
                 listSize = 31;
                 listSize = 31;
             }
             }
-            list = msgAlarmService.getDayCount(alarmStatisticResVo.getRailwayCode(), alarmStatisticResVo.getCurrentYear(),
-                    alarmStatisticResVo.getCurrentMonth(), alarmStatisticResVo.getAlarmType(), userId);
+            list = msgAlarmService.getDayCount(alarmStatisticResVo);
         }
         }
         for (int i = 1; i <= listSize; i++) {
         for (int i = 1; i <= listSize; i++) {
             numbs.add(i);
             numbs.add(i);
@@ -659,13 +648,9 @@ public class MsgAlarmController extends BaseController {
             @ApiImplicitParam(paramType = "query", name = "alarmType", value = "灾害类型"),
             @ApiImplicitParam(paramType = "query", name = "alarmType", value = "灾害类型"),
     })
     })
     public void exportDataStatistic(HttpServletResponse response, @RequestBody AlarmStatisticResVo alarmStatisticResVo) {
     public void exportDataStatistic(HttpServletResponse response, @RequestBody AlarmStatisticResVo alarmStatisticResVo) {
-        SysUser user = getLoginUser().getUser();
-        String userId = getUserId();
-        if (user.isAdmin(user.getId())) {
-            userId = "";
-        }
+        alarmStatisticResVo = (AlarmStatisticResVo) dataScoreUtil.setDataScore(getUserId(), alarmStatisticResVo);
         try {
         try {
-            List<AlarmStatisticDto> list = msgAlarmService.exportExcel(alarmStatisticResVo, userId);
+            List<AlarmStatisticDto> list = msgAlarmService.exportExcel(alarmStatisticResVo);
             if (!CollectionUtils.isEmpty(list) && Objects.nonNull(list.get(0))) {
             if (!CollectionUtils.isEmpty(list) && Objects.nonNull(list.get(0))) {
                 list.forEach(l -> {
                 list.forEach(l -> {
                     if (!ObjectUtils.isEmpty(l.getAlarmMile())) {
                     if (!ObjectUtils.isEmpty(l.getAlarmMile())) {
@@ -725,18 +710,13 @@ public class MsgAlarmController extends BaseController {
             @ApiImplicitParam(paramType = "query", name = "alarmType", value = "灾害类型"),
             @ApiImplicitParam(paramType = "query", name = "alarmType", value = "灾害类型"),
     })
     })
     public void exportDataStatisticMonth(HttpServletResponse response, @RequestBody AlarmStatisticResVo alarmStatisticResVo) {
     public void exportDataStatisticMonth(HttpServletResponse response, @RequestBody AlarmStatisticResVo alarmStatisticResVo) {
-        SysUser user = getLoginUser().getUser();
-        String userId = getUserId();
-        if (user.isAdmin(user.getId())) {
-            userId = "";
-        }
+        alarmStatisticResVo = (AlarmStatisticResVo) dataScoreUtil.setDataScore(getUserId(), alarmStatisticResVo);
         String sheetName = "报警年统计数据";
         String sheetName = "报警年统计数据";
         List<Integer> numbs = new ArrayList<>();
         List<Integer> numbs = new ArrayList<>();
         Integer listSize;
         Integer listSize;
         List<AlarmStatisticMonthDto> list = null;
         List<AlarmStatisticMonthDto> list = null;
         if (ObjectUtils.isEmpty(alarmStatisticResVo.getCurrentMonth())) {
         if (ObjectUtils.isEmpty(alarmStatisticResVo.getCurrentMonth())) {
-            list = msgAlarmService.getCount(alarmStatisticResVo.getRailwayCode(), alarmStatisticResVo.getCurrentYear(),
-                    alarmStatisticResVo.getCurrentMonth(), alarmStatisticResVo.getAlarmType(), userId);
+            list = msgAlarmService.getCount(alarmStatisticResVo);
             listSize = 12;
             listSize = 12;
         } else {
         } else {
             sheetName = "报警月统计数据";
             sheetName = "报警月统计数据";
@@ -748,8 +728,7 @@ public class MsgAlarmController extends BaseController {
             } else {//1,3,5,7,8,10,12
             } else {//1,3,5,7,8,10,12
                 listSize = 31;
                 listSize = 31;
             }
             }
-            list = msgAlarmService.getDayCount(alarmStatisticResVo.getRailwayCode(), alarmStatisticResVo.getCurrentYear(),
-                    alarmStatisticResVo.getCurrentMonth(), alarmStatisticResVo.getAlarmType(), userId);
+            list = msgAlarmService.getDayCount(alarmStatisticResVo);
         }
         }
         if (!CollectionUtils.isEmpty(list) && Objects.nonNull(list.get(0))) {
         if (!CollectionUtils.isEmpty(list) && Objects.nonNull(list.get(0))) {
             for (int i = 1; i <= listSize; i++) {
             for (int i = 1; i <= listSize; i++) {