吉安感知网项目-后端
rain
2026-01-22 a381426bb74009f45db150beadb9f67ea72a7df5
事件线索app相关接口
6 files modified
1 files added
259 ■■■■■ changed files
drone-service/drone-gd/src/main/java/org/sxkj/gd/workorder/controller/GdClueEventController.java 24 ●●●● patch | view | raw | blame | history
drone-service/drone-gd/src/main/java/org/sxkj/gd/workorder/mapper/GdClueEventMapper.java 20 ●●●●● patch | view | raw | blame | history
drone-service/drone-gd/src/main/java/org/sxkj/gd/workorder/mapper/GdClueEventMapper.xml 48 ●●●●● patch | view | raw | blame | history
drone-service/drone-gd/src/main/java/org/sxkj/gd/workorder/service/IGdClueEventService.java 17 ●●●●● patch | view | raw | blame | history
drone-service/drone-gd/src/main/java/org/sxkj/gd/workorder/service/impl/GdClueEventServiceImpl.java 22 ●●●●● patch | view | raw | blame | history
drone-service/drone-gd/src/main/java/org/sxkj/gd/workorder/vo/GdClueEventListVO.java 43 ●●●●● patch | view | raw | blame | history
drone-service/drone-gd/src/main/java/org/sxkj/gd/workorder/vo/GdClueEventVO.java 85 ●●●●● patch | view | raw | blame | history
drone-service/drone-gd/src/main/java/org/sxkj/gd/workorder/controller/GdClueEventController.java
@@ -29,13 +29,12 @@
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.sxkj.gd.workorder.entity.GdClueEventEntity;
import org.sxkj.gd.workorder.param.GdClueEventRejectParam;
import org.sxkj.gd.workorder.vo.GdClueEventListVO;
import org.sxkj.gd.workorder.vo.GdClueEventVO;
import org.sxkj.gd.workorder.excel.GdClueEventExcel;
import org.sxkj.gd.workorder.wrapper.GdClueEventWrapper;
import org.sxkj.gd.workorder.service.IGdClueEventService;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.tool.utils.DateUtil;
@@ -65,22 +64,21 @@
     */
    @GetMapping("/detail")
    @ApiOperationSupport(order = 1)
    @ApiOperation(value = "详情", notes = "传入gdClueEvent")
    public R<GdClueEventVO> detail(GdClueEventEntity gdClueEvent) {
        GdClueEventEntity detail = gdClueEventService.getOne(Condition.getQueryWrapper(gdClueEvent));
        return R.data(GdClueEventWrapper.build().entityVO(detail));
    @ApiOperation(value = "详情", notes = "传入事件ID")
    public R<GdClueEventVO> detail(@ApiParam(value = "事件ID", required = true) @RequestParam Long id) {
        return R.data(gdClueEventService.getGdClueEventDetail(id));
    }
    /**
     * 事件表(线索事件) 分页
     * 事件表(线索事件) 列表
     */
    @GetMapping("/list")
    @ApiOperationSupport(order = 2)
    @ApiOperation(value = "分页", notes = "传入gdClueEvent")
    public R<IPage<GdClueEventVO>> list(@ApiIgnore @RequestParam Map<String, Object> gdClueEvent, Query query) {
        QueryWrapper<GdClueEventEntity> queryWrapper = Condition.getQueryWrapper(gdClueEvent, GdClueEventEntity.class);
        queryWrapper.lambda().eq(GdClueEventEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED);
        IPage<GdClueEventVO> pages = gdClueEventService.selectGdClueEventList(Condition.getPage(query), queryWrapper);
        return R.data(pages);
    @ApiOperation(value = "列表", notes = "固定过滤本部门,onlyMine=1时仅我的数据")
    public R<List<GdClueEventListVO>> list(@ApiParam(value = "是否仅我的数据,1为是,0为否")
            @RequestParam(value = "onlyMine", required = false, defaultValue = "0") Integer onlyMine) {
        List<GdClueEventListVO> list = gdClueEventService.listGdClueEventByDept(onlyMine);
        return R.data(list);
    }
    /**
drone-service/drone-gd/src/main/java/org/sxkj/gd/workorder/mapper/GdClueEventMapper.java
@@ -17,6 +17,7 @@
package org.sxkj.gd.workorder.mapper;
import org.sxkj.gd.workorder.entity.GdClueEventEntity;
import org.sxkj.gd.workorder.vo.GdClueEventListVO;
import org.sxkj.gd.workorder.vo.GdClueEventVO;
import org.sxkj.gd.workorder.excel.GdClueEventExcel;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
@@ -51,6 +52,25 @@
     */
    List<GdClueEventVO> selectGdClueEventList(IPage page, @Param("ew") Wrapper<GdClueEventEntity> queryWrapper);
    /**
     * 列表查询(不分页)
     *
     * @param deptId
     * @param userId
     * @param onlyMine
     * @return
     */
    List<GdClueEventListVO> selectGdClueEventSimpleList(@Param("deptId") Long deptId, @Param("userId") Long userId, @Param("onlyMine") Integer onlyMine);
    /**
     * 详情查询
     *
     * @param id
     * @param deptId
     * @return
     */
    GdClueEventVO selectGdClueEventDetailById(@Param("id") Long id, @Param("deptId") Long deptId);
    /**
     * 获取导出数据
drone-service/drone-gd/src/main/java/org/sxkj/gd/workorder/mapper/GdClueEventMapper.xml
@@ -34,6 +34,13 @@
        <result column="latitude" property="latitude"/>
        <result column="event_status" property="eventStatus"/>
        <result column="area_code" property="areaCode"/>
        <result column="event_code" property="eventCode"/>
        <result column="event_location" property="eventLocation"/>
        <result column="shoot_time" property="shootTime"/>
        <result column="event_image_url" property="eventImageUrl"/>
        <result column="distribute_user_name" property="distributeUserName"/>
        <result column="distribute_dept_name" property="distributeDeptName"/>
        <result column="distribute_time" property="distributeTime"/>
        <result column="create_user" property="createUser"/>
        <result column="create_dept" property="createDept"/>
        <result column="create_time" property="createTime"/>
@@ -41,6 +48,12 @@
        <result column="update_time" property="updateTime"/>
        <result column="status" property="status"/>
        <result column="is_deleted" property="isDeleted"/>
    </resultMap>
    <resultMap id="gdClueEventListVoResultMap" type="org.sxkj.gd.workorder.vo.GdClueEventListVO">
        <result column="id" property="id"/>
        <result column="event_image_url" property="eventImageUrl"/>
        <result column="create_time" property="createTime"/>
    </resultMap>
    <resultMap id="gdClueEventExcelResultMap" type="org.sxkj.gd.workorder.excel.GdClueEventExcel">
@@ -68,6 +81,41 @@
        left join blade_dept bd on bd.id = ce.dispose_dept and bd.is_deleted = 0
    </select>
    <select id="selectGdClueEventSimpleList" resultMap="gdClueEventListVoResultMap">
        select ce.id as id,
        tr.result_url as event_image_url,
        ce.create_time as create_time
        from ja_gd_clue_event ce
        left join ja_gd_task_result tr on tr.id = ce.result_id and tr.is_deleted = 0
        where ce.is_deleted = 0
        and ce.dispose_dept = #{deptId}
        <if test="onlyMine != null and onlyMine == 1">
            and ce.dispose_user = #{userId}
        </if>
    </select>
    <select id="selectGdClueEventDetailById" resultMap="gdClueEventVoResultMap">
        select ce.*,
        ifnull(bu.real_name, bu.name) as dispose_user_name,
        bd.dept_name as dispose_dept_name,
        ifnull(cu.real_name, cu.name) as distribute_user_name,
        cd.dept_name as distribute_dept_name,
        ce.create_time as distribute_time,
        concat(ce.longitude, ',', ce.latitude) as event_location,
        tr.result_code as event_code,
        tr.shoot_time as shoot_time,
        tr.result_url as event_image_url
        from ja_gd_clue_event ce
        left join blade_user bu on bu.id = ce.dispose_user and bu.is_deleted = 0
        left join blade_dept bd on bd.id = ce.dispose_dept and bd.is_deleted = 0
        left join blade_user cu on cu.id = ce.create_user and cu.is_deleted = 0
        left join blade_dept cd on cd.id = ce.create_dept and cd.is_deleted = 0
        left join ja_gd_task_result tr on tr.id = ce.result_id and tr.is_deleted = 0
        where ce.is_deleted = 0
        and ce.dispose_dept = #{deptId}
        and ce.id = #{id}
    </select>
    <select id="exportGdClueEvent" resultMap="gdClueEventExcelResultMap">
        SELECT * FROM ja_gd_clue_event ${ew.customSqlSegment}
drone-service/drone-gd/src/main/java/org/sxkj/gd/workorder/service/IGdClueEventService.java
@@ -20,6 +20,7 @@
import org.sxkj.gd.workorder.entity.GdClueEventEntity;
import org.sxkj.gd.workorder.param.GdClueEventDistributeParam;
import org.sxkj.gd.workorder.param.GdClueEventRejectParam;
import org.sxkj.gd.workorder.vo.GdClueEventListVO;
import org.sxkj.gd.workorder.vo.GdClueEventVO;
import org.sxkj.gd.workorder.excel.GdClueEventExcel;
import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -52,6 +53,22 @@
    IPage<GdClueEventVO> selectGdClueEventList(IPage<GdClueEventVO> page, Wrapper<GdClueEventEntity> queryWrapper);
    /**
     * 列表查询(不分页)
     *
     * @param onlyMine
     * @return
     */
    List<GdClueEventListVO> listGdClueEventByDept(Integer onlyMine);
    /**
     * 详情查询
     *
     * @param id
     * @return
     */
    GdClueEventVO getGdClueEventDetail(Long id);
    /**
     * 分发事件
     *
     * @param distributeParam
drone-service/drone-gd/src/main/java/org/sxkj/gd/workorder/service/impl/GdClueEventServiceImpl.java
@@ -29,6 +29,7 @@
import org.sxkj.gd.workorder.param.GdClueEventRejectParam;
import org.sxkj.gd.workorder.service.IGdClueEventService;
import org.sxkj.gd.workorder.service.IGdTaskResultService;
import org.sxkj.gd.workorder.vo.GdClueEventListVO;
import org.sxkj.gd.workorder.vo.GdClueEventVO;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -60,6 +61,27 @@
    }
    @Override
    public List<GdClueEventListVO> listGdClueEventByDept(Integer onlyMine) {
        Long deptId = Long.valueOf(AuthUtil.getDeptId());
        Long userId = AuthUtil.getUserId();
        Integer mine = onlyMine == null ? 0 : onlyMine;
        return baseMapper.selectGdClueEventSimpleList(deptId, userId, mine);
    }
    @Override
    public GdClueEventVO getGdClueEventDetail(Long id) {
        if (id == null) {
            throw new RuntimeException("事件ID不能为空");
        }
        Long deptId = Long.valueOf(AuthUtil.getDeptId());
        GdClueEventVO detail = baseMapper.selectGdClueEventDetailById(id, deptId);
        if (detail == null) {
            throw new RuntimeException("事件不存在");
        }
        return detail;
    }
    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean distributeClueEvent(GdClueEventDistributeParam distributeParam) {
        GdTaskResultEntity taskResult = gdTaskResultService.getById(distributeParam.getResultId());
drone-service/drone-gd/src/main/java/org/sxkj/gd/workorder/vo/GdClueEventListVO.java
New file
@@ -0,0 +1,43 @@
/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.sxkj.gd.workorder.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
 * 事件表(线索事件) 列表视图实体类
 *
 * @author lw
 * @since 2026-01-14
 */
@Data
public class GdClueEventListVO implements Serializable {
    private static final long serialVersionUID = 1L;
    @ApiModelProperty("事件ID")
    private Long id;
    @ApiModelProperty(value = "事件图片url")
    private String eventImageUrl;
    @ApiModelProperty(value = "事件生成时间")
    private Date createTime;
}
drone-service/drone-gd/src/main/java/org/sxkj/gd/workorder/vo/GdClueEventVO.java
@@ -19,6 +19,7 @@
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
 * 事件表(线索事件) 视图实体类
@@ -74,10 +75,94 @@
    @ApiModelProperty(value = "区域编码")
    private String areaCode;
    /**
     * 事件编号
     */
    @ApiModelProperty(value = "事件编号")
    private String eventCode;
    /**
     * 事件位置
     */
    @ApiModelProperty(value = "事件位置")
    private String eventLocation;
    /**
     * 拍摄时间
     */
    @ApiModelProperty(value = "拍摄时间")
    private Date shootTime;
    /**
     * 事件图片url
     */
    @ApiModelProperty(value = "事件图片url")
    private String eventImageUrl;
    @ApiModelProperty(value = "处置人姓名")
    private String disposeUserName;
    @ApiModelProperty(value = "处置部门名称")
    private String disposeDeptName;
    /**
     * 分发人员名称
     */
    @ApiModelProperty(value = "分发人员名称")
    private String distributeUserName;
    /**
     * 分发部门名称
     */
    @ApiModelProperty(value = "分发部门名称")
    private String distributeDeptName;
    /**
     * 分发时间
     */
    @ApiModelProperty(value = "分发时间")
    private Date distributeTime;
    /**
     * 创建人
     */
    @ApiModelProperty(value = "创建人")
    private Long createUser;
    /**
     * 创建部门
     */
    @ApiModelProperty(value = "创建部门")
    private Long createDept;
    /**
     * 创建时间
     */
    @ApiModelProperty(value = "创建时间")
    private Date createTime;
    /**
     * 更新人
     */
    @ApiModelProperty(value = "更新人")
    private Long updateUser;
    /**
     * 更新时间
     */
    @ApiModelProperty(value = "更新时间")
    private Date updateTime;
    /**
     * 状态(0正常 1停用)
     */
    @ApiModelProperty(value = "状态(0正常 1停用)")
    private Integer status;
    /**
     * 删除标志(0存在 1删除)
     */
    @ApiModelProperty(value = "删除标志(0存在 1删除)")
    private Integer isDeleted;
}