吉安感知网项目-后端
rain
2026-01-22 72b7d2c5ea19ed2047ee896b7f36da20d04bcea6
事件数量tab接口
5 files modified
1 files added
108 ■■■■■ changed files
drone-service/drone-gd/src/main/java/org/sxkj/gd/workorder/controller/GdClueEventController.java 13 ●●●●● patch | view | raw | blame | history
drone-service/drone-gd/src/main/java/org/sxkj/gd/workorder/mapper/GdClueEventMapper.java 10 ●●●●● patch | view | raw | blame | history
drone-service/drone-gd/src/main/java/org/sxkj/gd/workorder/mapper/GdClueEventMapper.xml 23 ●●●● patch | view | raw | blame | history
drone-service/drone-gd/src/main/java/org/sxkj/gd/workorder/service/IGdClueEventService.java 8 ●●●●● patch | view | raw | blame | history
drone-service/drone-gd/src/main/java/org/sxkj/gd/workorder/service/impl/GdClueEventServiceImpl.java 15 ●●●●● patch | view | raw | blame | history
drone-service/drone-gd/src/main/java/org/sxkj/gd/workorder/vo/GdClueEventCountVO.java 39 ●●●●● patch | view | raw | blame | history
drone-service/drone-gd/src/main/java/org/sxkj/gd/workorder/controller/GdClueEventController.java
@@ -32,6 +32,7 @@
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.GdClueEventCountVO;
import org.sxkj.gd.workorder.vo.GdClueEventListVO;
import org.sxkj.gd.workorder.vo.GdClueEventVO;
import org.sxkj.gd.workorder.excel.GdClueEventExcel;
@@ -82,10 +83,20 @@
    }
    /**
     * 事件表(线索事件) 数量统计
     */
    @GetMapping("/count")
    @ApiOperationSupport(order = 3)
    @ApiOperation(value = "数量统计", notes = "返回全部工单与我的工单数量")
    public R<GdClueEventCountVO> count() {
        return R.data(gdClueEventService.getGdClueEventCount());
    }
    /**
     * 事件表(线索事件) 自定义分页
     */
    @GetMapping("/page")
    @ApiOperationSupport(order = 3)
    @ApiOperationSupport(order = 4)
    @ApiOperation(value = "分页", notes = "传入gdClueEvent")
    public R<IPage<GdClueEventVO>> page(GdClueEventVO gdClueEvent, Query query) {
        IPage<GdClueEventVO> pages = gdClueEventService.selectGdClueEventPage(Condition.getPage(query), gdClueEvent);
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.GdClueEventCountVO;
import org.sxkj.gd.workorder.vo.GdClueEventListVO;
import org.sxkj.gd.workorder.vo.GdClueEventVO;
import org.sxkj.gd.workorder.excel.GdClueEventExcel;
@@ -71,6 +72,15 @@
     */
    GdClueEventVO selectGdClueEventDetailById(@Param("id") Long id, @Param("deptId") Long deptId);
    /**
     * 数量统计
     *
     * @param deptId
     * @param userId
     * @return
     */
    GdClueEventCountVO selectGdClueEventCount(@Param("deptId") Long deptId, @Param("userId") Long userId);
    /**
     * 获取导出数据
drone-service/drone-gd/src/main/java/org/sxkj/gd/workorder/mapper/GdClueEventMapper.xml
@@ -56,6 +56,16 @@
        <result column="create_time" property="createTime"/>
    </resultMap>
    <resultMap id="gdClueEventCountVoResultMap" type="org.sxkj.gd.workorder.vo.GdClueEventCountVO">
        <result column="total_count" property="totalCount"/>
        <result column="my_count" property="myCount"/>
    </resultMap>
    <sql id="gdClueEventDeptWhere">
        where ce.is_deleted = 0
        and ce.dispose_dept = #{deptId}
    </sql>
    <resultMap id="gdClueEventExcelResultMap" type="org.sxkj.gd.workorder.excel.GdClueEventExcel">
        <result column="result_id" property="resultId"/>
        <result column="work_order_id" property="workOrderId"/>
@@ -87,8 +97,7 @@
        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}
        <include refid="gdClueEventDeptWhere"/>
        <if test="onlyMine != null and onlyMine == 1">
            and ce.dispose_user = #{userId}
        </if>
@@ -111,11 +120,17 @@
        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}
        <include refid="gdClueEventDeptWhere"/>
        and ce.id = #{id}
    </select>
    <select id="selectGdClueEventCount" resultMap="gdClueEventCountVoResultMap">
        select count(1) as total_count,
        ifnull(sum(case when ce.dispose_user = #{userId} then 1 else 0 end), 0) as my_count
        from ja_gd_clue_event ce
        <include refid="gdClueEventDeptWhere"/>
    </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.GdClueEventCountVO;
import org.sxkj.gd.workorder.vo.GdClueEventListVO;
import org.sxkj.gd.workorder.vo.GdClueEventVO;
import org.sxkj.gd.workorder.excel.GdClueEventExcel;
@@ -69,6 +70,13 @@
    GdClueEventVO getGdClueEventDetail(Long id);
    /**
     * 数量统计
     *
     * @return
     */
    GdClueEventCountVO getGdClueEventCount();
    /**
     * 分发事件
     *
     * @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.GdClueEventCountVO;
import org.sxkj.gd.workorder.vo.GdClueEventListVO;
import org.sxkj.gd.workorder.vo.GdClueEventVO;
import org.springframework.stereotype.Service;
@@ -82,6 +83,20 @@
    }
    @Override
    public GdClueEventCountVO getGdClueEventCount() {
        Long deptId = Long.valueOf(AuthUtil.getDeptId());
        Long userId = AuthUtil.getUserId();
        GdClueEventCountVO countVO = baseMapper.selectGdClueEventCount(deptId, userId);
        if (countVO == null) {
            GdClueEventCountVO empty = new GdClueEventCountVO();
            empty.setTotalCount(0L);
            empty.setMyCount(0L);
            return empty;
        }
        return countVO;
    }
    @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/GdClueEventCountVO.java
New file
@@ -0,0 +1,39 @@
/*
 *      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;
/**
 * 事件表(线索事件) 统计视图实体类
 *
 * @author lw
 * @since 2026-01-14
 */
@Data
public class GdClueEventCountVO implements Serializable {
    private static final long serialVersionUID = 1L;
    @ApiModelProperty(value = "全部工单数量")
    private Long totalCount;
    @ApiModelProperty(value = "我的工单数量")
    private Long myCount;
}