zhanghua
2023-11-29 5b545fd1006fb28dbe3928c666db2d8a0622fcf2
优化
9个文件已修改
129 ■■■■ 已修改文件
ycl-platform/src/main/java/com/ycl/controller/caseHandler/DisposeRecordController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/controller/platformApi/AlarmController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/controller/platformApi/TranspondDHController.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/mapper/caseHandler/DisposeRecordMapper.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/service/caseHandler/IDisposeRecordService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/service/caseHandler/impl/DisposeRecordServiceImpl.java 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/service/caseHandler/impl/ViolationsServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/vo/MyBacklogVO.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/resources/mapper/caseHandler/DisposeRecordMapper.xml 82 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/controller/caseHandler/DisposeRecordController.java
@@ -54,7 +54,7 @@
                                     @RequestParam(required = false) Short time
                                     ) {
        AdminUserDetails user = (AdminUserDetails) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
        return CommonResult.success(iDisposeRecordService.listMyTask(new Page<>(current,pageSize),num, user.getUserId(),type,source,time));
        return CommonResult.success(iDisposeRecordService.listMyTask(num, user.getUserId(),type,source,time,current,pageSize));
    }
}
ycl-platform/src/main/java/com/ycl/controller/platformApi/AlarmController.java
@@ -71,7 +71,7 @@
    @PostMapping("/HK/alarmReport")
    @LogSave(operationType = "报警管理", contain = "海康视频报警推送")
    public CommonResult hkAlarmReport(@RequestBody @Validated HKAlarmParam alarmParam) {
//        System.out.println("保存报警数据:" + JSONObject.toJSONString(alarmParam));
        System.out.println("海康视频报警推送API:" + JSONObject.toJSONString(alarmParam));
        videoAlarmReportService.saveFromHK(alarmParam);
        return new CommonResult(ResultCode.SUCCESS.getCode(), ResultCode.SUCCESS.getMessage());
    }
ycl-platform/src/main/java/com/ycl/controller/platformApi/TranspondDHController.java
@@ -72,6 +72,7 @@
            System.out.println(exchange);
            return CommonResult.success(exchange);
        } catch (Exception ex) {
            System.out.println("定位接口错误:" + ex.getMessage());
            return CommonResult.failed();
        }
    }
ycl-platform/src/main/java/com/ycl/mapper/caseHandler/DisposeRecordMapper.java
@@ -19,5 +19,14 @@
 */
public interface DisposeRecordMapper extends BaseMapper<DisposeRecord> {
    Page<MyBacklogVO> selectMyBackList(Page<MyBacklogVO> page, @Param("id") Long id, @Param("code") String code, LocalDateTime alarmTimeStart, LocalDateTime alarmTimeEnd, Short source, Short type);
    List<MyBacklogVO> selectMyBackList(@Param("id") Long id, @Param("code") String code,
                                       @Param("alarmTimeStart") LocalDateTime alarmTimeStart,
                                       @Param("alarmTimeEnd") LocalDateTime alarmTimeEnd,
                                       @Param("source") Short source, @Param("type") Short type,
                                       @Param("pageIndex") Integer pageIndex, @Param("pageSize") Integer pageSize);
    Long selectMyBackListTotal(@Param("id") Long id, @Param("code") String code,
                               @Param("alarmTimeStart") LocalDateTime alarmTimeStart,
                               @Param("alarmTimeEnd") LocalDateTime alarmTimeEnd,
                               @Param("source") Short source, @Param("type") Short type);
}
ycl-platform/src/main/java/com/ycl/service/caseHandler/IDisposeRecordService.java
@@ -19,7 +19,7 @@
 */
public interface IDisposeRecordService extends IService<DisposeRecord> {
    Page<MyBacklogVO> listMyTask(Page<MyBacklogVO> page, String num, Long userId, Short type, Short source, Short time);
    Page<MyBacklogVO> listMyTask(String num, Long userId, Short type, Short source, Short time, Integer current, Integer pageSize);
    Boolean saveOrUpdateUpload(UploadDisposingResultParam uploadDisposingResultParam);
}
ycl-platform/src/main/java/com/ycl/service/caseHandler/impl/DisposeRecordServiceImpl.java
@@ -1,5 +1,7 @@
package com.ycl.service.caseHandler.impl;
import cn.hutool.core.util.PageUtil;
import com.alibaba.druid.sql.PagerUtils;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
@@ -68,7 +70,7 @@
    public final static Short LAST_THREEMONTH = 2;
    @Override
    public Page<MyBacklogVO> listMyTask(Page<MyBacklogVO> page, String num, Long userId, Short type, Short source, Short time) {
    public Page<MyBacklogVO> listMyTask(String num, Long userId, Short type, Short source, Short time, Integer current, Integer pageSize) {
        LocalDateTime alarmTimeStart = null;
        LocalDateTime alarmTimeEnd = null;
        if (Objects.equals(time, LAST_WEEK)) {
@@ -81,8 +83,19 @@
            alarmTimeStart = LocalDateTime.now().minusMonths(3);
            alarmTimeEnd = LocalDateTime.now();
        }
        //TODO:出现过一次重复数据
        return disposeRecordMapper.selectMyBackList(page, userId, num, alarmTimeStart, alarmTimeEnd, source, type);
        Integer pageIndex = PageUtil.getStart(current - 1, pageSize);
        List<MyBacklogVO> list = disposeRecordMapper.selectMyBackList(userId, num, alarmTimeStart, alarmTimeEnd, source, type, pageIndex, pageSize);
        Long total = disposeRecordMapper.selectMyBackListTotal(userId, num, alarmTimeStart, alarmTimeEnd, source, type);
        list.forEach(o -> {
            if (o.getPictureList() != null && o.getPictureList().size() > 0) {
                o.setPicture(o.getPictureList().get(0).getUrl());
            }
        });
        Page<MyBacklogVO> page = new Page<>();
        page.setRecords(list);
        page.setTotal(total);
        return page;
    }
    @Override
ycl-platform/src/main/java/com/ycl/service/caseHandler/impl/ViolationsServiceImpl.java
@@ -118,7 +118,7 @@
                    imageResources.setCreateTime(LocalDateTime.now());
                    imageResourcesService.save(imageResources);
                } catch (Exception ex) {
                    System.out.println("海康推送保存异常:" + ex.getMessage());
                }
            }
        }
ycl-platform/src/main/java/com/ycl/vo/MyBacklogVO.java
@@ -1,11 +1,13 @@
package com.ycl.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ycl.entity.resources.ImageResources;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.time.LocalDateTime;
import java.util.List;
@Data
@ApiModel(value = "我的待办")
@@ -61,5 +63,9 @@
     */
    @ApiModelProperty(value = "图片")
    private String picture;
    /**
     * 图片
     */
    @ApiModelProperty(value = "图片")
    private List<ImageResources> pictureList;
}
ycl-platform/src/main/resources/mapper/caseHandler/DisposeRecordMapper.xml
@@ -23,8 +23,23 @@
        , base_case_id, step_name, start_time, handler_role_id, end_time, state, handler_id, create_user, create_time
    </sql>
    <select id="selectMyBackList" resultType="com.ycl.vo.MyBacklogVO">
        select distinct * from (
    <resultMap id="blacklogVoMap" type="com.ycl.vo.MyBacklogVO">
        <result column="event_source" property="eventSource"/>
        <result column="source" property="source"/>
        <result column="category" property="category"/>
        <result column="code" property="code"/>
        <result column="step_name" property="stepName"/>
        <result column="caseId" property="caseId"/>
        <result column="create_time" property="createTime"/>
        <result column="limit_time" property="limitTime"/>
        <collection property="pictureList" ofType="com.ycl.entity.resources.ImageResources">
            <result column="url" property="url"/>
        </collection>
    </resultMap>
    <select id="selectMyBackList" resultMap="blacklogVoMap">
        SELECT nt.*, t4.url
        from (select distinct * from (
        SELECT
        t3.event_source,
        t5.region_name source,
@@ -33,13 +48,11 @@
        t3.`id` caseId,
        t3.`code`,
        t2.create_time,
        t2.limit_time,
        t4.url picture
        t2.limit_time
        FROM
        ums_admin_role_relation t1
        left JOIN ums_dispose_record t2 ON t1.role_id = t2.handler_role_id
        left JOIN ums_base_case t3 ON t2.base_case_id=t3.id
        left JOIN ums_image_resources t4 ON t2.base_case_id=t4.belong_to_id
        inner join ums_sccg_region t5 on t5.id = t3.community_id
        <where>
            t1.admin_id = #{id} and t3.`code` is not null
@@ -66,12 +79,10 @@
        t3.`id` caseId,
        t3.`code`,
        t2.create_time,
        t2.limit_time,
        t4.url picture
        t2.limit_time
        FROM
        ums_dispose_record t2
        LEFT JOIN ums_base_case t3 ON t2.base_case_id = t3.id
        left JOIN ums_image_resources t4 ON t2.base_case_id=t4.belong_to_id
        inner join ums_sccg_region t5 on t5.id = t3.community_id
        <where>
            t2.handler_id = #{id}
@@ -90,6 +101,59 @@
            </if>
        </where>
        ) as t
         order by create_time desc
        order by create_time desc
        LIMIT #{pageIndex},#{pageSize}) nt
        left JOIN ums_image_resources t4 ON nt.caseId=t4.belong_to_id
    </select>
    <select id="selectMyBackListTotal" resultType="java.lang.Long">
        select count( distinct id) from (
        SELECT
        t3.id
        FROM
        ums_admin_role_relation t1
        left JOIN ums_dispose_record t2 ON t1.role_id = t2.handler_role_id
        left JOIN ums_base_case t3 ON t2.base_case_id=t3.id
        inner join ums_sccg_region t5 on t5.id = t3.community_id
        <where>
            t1.admin_id = #{id} and t3.`code` is not null
            AND t2.state = 0
            <if test="code!='' and code!=null">
                and t3.`code` LIKE CONCAT('%',#{code},'%')
            </if>
            <if test="alarmTimeStart!=null and alarmTimeEnd!=null">
                and t3.alarm_time <![CDATA[ <= ]]> #{alarmTimeEnd} and t3.alarm_time >= #{alarmTimeStart}
            </if>
            <if test="type !=null">
                and t3.category = #{type}
            </if>
            <if test="source !=null">
                and t5.parent_id = #{source}
            </if>
        </where>
        union all
        SELECT
        t3.id
        FROM
        ums_dispose_record t2
        LEFT JOIN ums_base_case t3 ON t2.base_case_id = t3.id
        inner join ums_sccg_region t5 on t5.id = t3.community_id
        <where>
            t2.handler_id = #{id}
            AND t2.state = 0
            <if test="code!='' and code!=null">
                and t3.`code` LIKE CONCAT('%',#{code},'%')
            </if>
            <if test="alarmTimeStart!=null and alarmTimeEnd!=null">
                and t3.alarm_time <![CDATA[ <= ]]> #{alarmTimeEnd} and t3.alarm_time >= #{alarmTimeStart}
            </if>
            <if test="type !=null">
                and t3.category = #{type}
            </if>
            <if test="source !=null">
                and t5.parent_id = #{source}
            </if>
        </where>
        ) as t
    </select>
</mapper>