| | |
| | | @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)); |
| | | } |
| | | |
| | | } |
| | |
| | | @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()); |
| | | } |
| | |
| | | System.out.println(exchange); |
| | | return CommonResult.success(exchange); |
| | | } catch (Exception ex) { |
| | | System.out.println("定位接口错误:" + ex.getMessage()); |
| | | return CommonResult.failed(); |
| | | } |
| | | } |
| | |
| | | */ |
| | | 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); |
| | | } |
| | |
| | | */ |
| | | 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); |
| | | } |
| | |
| | | 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; |
| | |
| | | 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)) { |
| | |
| | | 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 |
| | |
| | | imageResources.setCreateTime(LocalDateTime.now()); |
| | | imageResourcesService.save(imageResources); |
| | | } catch (Exception ex) { |
| | | |
| | | System.out.println("海康推送保存异常:" + ex.getMessage()); |
| | | } |
| | | } |
| | | } |
| | |
| | | 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 = "我的待办") |
| | |
| | | */ |
| | | @ApiModelProperty(value = "图片") |
| | | private String picture; |
| | | |
| | | /** |
| | | * 图片 |
| | | */ |
| | | @ApiModelProperty(value = "图片") |
| | | private List<ImageResources> pictureList; |
| | | } |
| | |
| | | , 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, |
| | |
| | | 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 |
| | |
| | | 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} |
| | |
| | | </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> |