吉安感知网项目-后端
linwei
2026-06-09 b486873000ea043f159c8de5c0edb123c0f38a87
refactor(flyer): 修改飞手表单和实体类中的擅长任务类型字段

- 将 GdFlyerAddParam 中的 skilledTaskType 字段从 String 类型改为 List<List<String>> 类型
- 在 GdFlyerEntity 实体类中为 skilledTaskType 字段添加 GenericListTypeHandler 类型处理器
- 更新 GdFlyerMapper.xml 映射文件中 skilled_task_type 的类型处理器配置
- 修改 GdFlyerPageParam 查询参数类中的 skilledTaskType 类型定义
- 在 GdFlyerVO 视图对象中配置相应的类型处理器和字段类型
- 调整 GdTaskResultController 控制器中 list 方法的参数和注解
- 更新 GdTaskResultMapper 数据访问层的查询方法签名和 SQL 映射
- 修改 Attach 相关实体类和接口中的 resultType 字段类型为 List<List<String>>
- 完善资源服务中的附件类型处理逻辑和类型转换
20 files modified
108 ■■■■ changed files
drone-ops-api/drone-resource-api/src/main/java/org/sxkj/resource/entity/Attach.java 4 ●●● patch | view | raw | blame | history
drone-ops-api/drone-resource-api/src/main/java/org/sxkj/resource/feign/IAttachClient.java 2 ●●● patch | view | raw | blame | history
drone-ops-api/drone-resource-api/src/main/java/org/sxkj/resource/feign/IAttachClientFallback.java 2 ●●● patch | view | raw | blame | history
drone-ops/drone-resource/src/main/java/org/sxkj/resource/dto/AttachDto.java 3 ●●●● patch | view | raw | blame | history
drone-ops/drone-resource/src/main/java/org/sxkj/resource/endpoint/OssEndpoint.java 7 ●●●●● patch | view | raw | blame | history
drone-ops/drone-resource/src/main/java/org/sxkj/resource/feign/AttachClient.java 6 ●●●● patch | view | raw | blame | history
drone-ops/drone-resource/src/main/java/org/sxkj/resource/mapper/AttachMapper.xml 3 ●●●● patch | view | raw | blame | history
drone-ops/drone-resource/src/main/java/org/sxkj/resource/param/AttachPageParam.java 2 ●●● patch | view | raw | blame | history
drone-service/drone-gd/src/main/java/org/sxkj/gd/flyer/entity/GdFlyerEntity.java 4 ●●● patch | view | raw | blame | history
drone-service/drone-gd/src/main/java/org/sxkj/gd/flyer/mapper/GdFlyerMapper.xml 4 ●●●● patch | view | raw | blame | history
drone-service/drone-gd/src/main/java/org/sxkj/gd/flyer/param/GdFlyerAddParam.java 2 ●●● patch | view | raw | blame | history
drone-service/drone-gd/src/main/java/org/sxkj/gd/flyer/param/GdFlyerPageParam.java 2 ●●● patch | view | raw | blame | history
drone-service/drone-gd/src/main/java/org/sxkj/gd/flyer/vo/GdFlyerVO.java 7 ●●●● patch | view | raw | blame | history
drone-service/drone-gd/src/main/java/org/sxkj/gd/workorder/controller/GdTaskResultController.java 12 ●●●● patch | view | raw | blame | history
drone-service/drone-gd/src/main/java/org/sxkj/gd/workorder/mapper/GdTaskResultMapper.java 11 ●●●●● patch | view | raw | blame | history
drone-service/drone-gd/src/main/java/org/sxkj/gd/workorder/mapper/GdTaskResultMapper.xml 9 ●●●●● patch | view | raw | blame | history
drone-service/drone-gd/src/main/java/org/sxkj/gd/workorder/service/IGdTaskResultService.java 9 ●●●● patch | view | raw | blame | history
drone-service/drone-gd/src/main/java/org/sxkj/gd/workorder/service/impl/GdPatrolTaskServiceImpl.java 2 ●●● patch | view | raw | blame | history
drone-service/drone-gd/src/main/java/org/sxkj/gd/workorder/service/impl/GdTaskResultServiceImpl.java 13 ●●●● patch | view | raw | blame | history
drone-service/drone-system/src/main/java/org/sxkj/system/service/impl/DeptServiceImpl.java 4 ●●●● patch | view | raw | blame | history
drone-ops-api/drone-resource-api/src/main/java/org/sxkj/resource/entity/Attach.java
@@ -11,6 +11,7 @@
import org.springblade.core.tenant.mp.TenantEntity;
import org.springblade.core.tool.utils.StringUtil;
import org.springframework.util.StringUtils;
import org.sxkj.common.handler.GenericListTypeHandler;
import org.sxkj.common.utils.file.FileNameHarsher;
import java.util.List;
@@ -82,7 +83,8 @@
    private String patrolTaskId;
    @ApiModelProperty(value = "附件类型: 1=巡查类文档,2=巡检类文档,3=安保类文档,4=文旅类文档,5=采集数据类文档")
    private String resultType;
    @TableField(typeHandler = GenericListTypeHandler.class)
    private List<List<String>> resultType;
    @ApiModelProperty(value = "设备SN")
    private String deviceSn;
drone-ops-api/drone-resource-api/src/main/java/org/sxkj/resource/feign/IAttachClient.java
@@ -83,7 +83,7 @@
     * @throws IOException
     */
    @PostMapping(value = SAVE_ATTACH_FILE_2, consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    BladeFile saveAttachFile(@RequestPart MultipartFile file, @RequestParam String fileName, @RequestParam String type) throws IOException;
    BladeFile saveAttachFile(@RequestPart MultipartFile file, @RequestParam String fileName, @RequestParam List<List<String>> type) throws IOException;
    /**
     * 附件上传
drone-ops-api/drone-resource-api/src/main/java/org/sxkj/resource/feign/IAttachClientFallback.java
@@ -36,7 +36,7 @@
    }
    @Override
    public BladeFile saveAttachFile(MultipartFile file, String fileName, String type) throws IOException {
    public BladeFile saveAttachFile(MultipartFile file, String fileName, List<List<String>> type) throws IOException {
        return null;
    }
drone-ops/drone-resource/src/main/java/org/sxkj/resource/dto/AttachDto.java
@@ -4,6 +4,7 @@
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.util.List;
@Data
public class AttachDto {
@@ -35,7 +36,7 @@
    private String originalName;
    @ApiModelProperty(value = "附件类型: 1=巡查类文档,2=巡检类文档,3=安保类文档,4=文旅类文档,5=采集数据类文档")
    private Integer resultType;
    private List<List<String>> resultType;
    @ApiModelProperty(value = "附件大小")
    private Long attachSize;
drone-ops/drone-resource/src/main/java/org/sxkj/resource/endpoint/OssEndpoint.java
@@ -23,6 +23,7 @@
import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
@@ -188,7 +189,7 @@
    @PostMapping("/put-file-attach-by-name")
    @ApiOperation(value = "上传文件并保存至附件表", notes = "上传文件并保存至附件表-存储桶对象名称")
    public R<BladeFile> putFileAttach(@RequestParam String fileName,
                                      @RequestParam String resultType,
                                      @RequestParam List<List<String>> resultType,
                                      @RequestParam MultipartFile file) {
        BladeFile bladeFile = ossBuilder.template().putFile(fileName, file.getInputStream());
        Long attachId = buildAttach(fileName, resultType, file.getSize(), bladeFile);
@@ -224,7 +225,7 @@
    private BladeFile getBladeFile(@RequestParam MultipartFile file) throws IOException {
        String fileName = file.getOriginalFilename();
        BladeFile bladeFile = ossBuilder.template("estack").putFile(fileName, file.getInputStream());
        Long attachId = buildAttach(fileName, "", file.getSize(), bladeFile);
        Long attachId = buildAttach(fileName, null, file.getSize(), bladeFile);
        bladeFile.setAttachId(attachId);
        return bladeFile;
    }
@@ -237,7 +238,7 @@
     * @param bladeFile 对象存储文件
     * @return attachId
     */
    private Long buildAttach(String fileName, String resultType, Long fileSize, BladeFile bladeFile) {
    private Long buildAttach(String fileName, List<List<String>> resultType, Long fileSize, BladeFile bladeFile) {
        String fileExtension = FileUtil.getFileExtension(fileName);
        Attach attach = new Attach();
        attach.setDomainUrl(bladeFile.getDomain());
drone-ops/drone-resource/src/main/java/org/sxkj/resource/feign/AttachClient.java
@@ -128,7 +128,7 @@
    }
    @Override
    public BladeFile saveAttachFile(MultipartFile file, String fileName, String type) throws IOException {
    public BladeFile saveAttachFile(MultipartFile file, String fileName, List<List<String>> type) throws IOException {
        BladeFile bladeFile = ossBuilder.template().putFile(pojo.getBucket(),fileName, file.getInputStream());
        Long attachId = buildAttach(fileName, file.getSize(), bladeFile, type);
        bladeFile.setAttachId(attachId);
@@ -148,7 +148,7 @@
        return bladeFile;
    }
    private Long buildAttach(String fileName, Long fileSize, BladeFile bladeFile, String type) {
    private Long buildAttach(String fileName, Long fileSize, BladeFile bladeFile, List<List<String>> type) {
        String fileExtension = FileUtil.getFileExtension(fileName);
        Attach attach = new Attach();
        attach.setDomainUrl(bladeFile.getDomain());
@@ -235,7 +235,7 @@
            saveAttachFile(new MockMultipartFile( mediaFile.getName(),
                mediaFile.getName(),
                "application/octet-stream",
                new FileInputStream(mediaFile)), name, Attach.RESULT_TYPE_VEDIO_SHOW);
                new FileInputStream(mediaFile)), name, null);
            log.info("第{}个视频保存入库完成...", (i + 1));
        }
drone-ops/drone-resource/src/main/java/org/sxkj/resource/mapper/AttachMapper.xml
@@ -18,10 +18,11 @@
        <result column="original_name" property="originalName"/>
        <result column="extension" property="extension"/>
        <result column="attach_size" property="attachSize"/>
        <result column="result_type" property="resultType" typeHandler="org.sxkj.common.handler.GenericListTypeHandler"/>
    </resultMap>
    <!--自定义分页查询-->
    <select id="selectAttachPage" resultType="org.sxkj.resource.vo.AttachVO">
    <select id="selectAttachPage" resultMap="attachResultMap" >
        select
        ba.*,
        bd.dept_name,
drone-ops/drone-resource/src/main/java/org/sxkj/resource/param/AttachPageParam.java
@@ -12,7 +12,7 @@
    private Long id;
    @ApiModelProperty(value = "附件类型: 1=巡查类文档,2=巡检类文档,3=安保类文档,4=文旅类文档,5=采集数据类文档")
    private Integer resultType;
    private List<List<String>> resultType;
    /**
     * 附件原名
     */
drone-service/drone-gd/src/main/java/org/sxkj/gd/flyer/entity/GdFlyerEntity.java
@@ -24,6 +24,7 @@
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.mp.base.BaseEntity;
import org.sxkj.common.handler.GenericListTypeHandler;
import java.math.BigDecimal;
import java.util.List;
@@ -80,7 +81,8 @@
     * 擅长任务类型(0:巡查类 1:安保类 2:文旅类 3:采集数据类)
     */
    @ApiModelProperty(value = "擅长任务类型(0:巡查类 1:安保类 2:文旅类 3:采集数据类)")
    private String skilledTaskType;
    @TableField(typeHandler = GenericListTypeHandler.class)
    private List<List<String>> skilledTaskType;
    /**
     * 区域编码
     */
drone-service/drone-gd/src/main/java/org/sxkj/gd/flyer/mapper/GdFlyerMapper.xml
@@ -11,7 +11,7 @@
        <result column="project_experience" property="projectExperience"/>
        <result column="technical_strength" property="technicalStrength"/>
        <result column="skilled_uav_type" property="skilledUavType"/>
        <result column="skilled_task_type" property="skilledTaskType"/>
        <result column="skilled_task_type" property="skilledTaskType" typeHandler="org.sxkj.common.handler.GenericListTypeHandler"/>
        <result column="area_code" property="areaCode"/>
        <result column="flyer_address" property="flyerAddress"/>
        <result column="certification" property="certification" typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler"/>
@@ -33,7 +33,7 @@
        <result column="project_experience" property="projectExperience"/>
        <result column="technical_strength" property="technicalStrength"/>
        <result column="skilled_uav_type" property="skilledUavType"/>
        <result column="skilled_task_type" property="skilledTaskType"/>
        <result column="skilled_task_type" property="skilledTaskType" typeHandler="org.sxkj.common.handler.GenericListTypeHandler"/>
        <result column="area_code" property="areaCode"/>
        <result column="flyer_address" property="flyerAddress"/>
        <result column="certification" property="certification" typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler"/>
drone-service/drone-gd/src/main/java/org/sxkj/gd/flyer/param/GdFlyerAddParam.java
@@ -54,7 +54,7 @@
     * 擅长任务类型(0:巡查类 1:安保类 2:文旅类 3:采集数据类)
     */
    @ApiModelProperty(value = "擅长任务类型(0:巡查类 1:安保类 2:文旅类 3:采集数据类)")
    private String skilledTaskType;
    private List<List<String>> skilledTaskType;
    /**
     * 区域编码
     */
drone-service/drone-gd/src/main/java/org/sxkj/gd/flyer/param/GdFlyerPageParam.java
@@ -43,7 +43,7 @@
     * 擅长任务类型(0:巡查类 1:安保类 2:文旅类 3:采集数据类)
     */
    @ApiModelProperty(value = "擅长任务类型(0:巡查类 1:安保类 2:文旅类 3:采集数据类)")
    private String skilledTaskType;
    private List<List<String>> skilledTaskType;
      // 经度
    @ApiModelProperty(value = "经度")
    private String longitude;
drone-service/drone-gd/src/main/java/org/sxkj/gd/flyer/vo/GdFlyerVO.java
@@ -16,6 +16,7 @@
 */
package org.sxkj.gd.flyer.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@@ -24,6 +25,7 @@
import java.io.Serializable;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import org.sxkj.common.handler.GenericListTypeHandler;
/**
 * 飞手表 视图实体类
@@ -75,7 +77,8 @@
     * 擅长任务类型(0:巡查类 1:安保类 2:文旅类 3:采集数据类)
     */
    @ApiModelProperty(value = "擅长任务类型(0:巡查类 1:安保类 2:文旅类 3:采集数据类)")
    private String skilledTaskType;
    @TableField(typeHandler = GenericListTypeHandler.class)
    private List<List<String>> skilledTaskType;
    /**
     * 区域编码
     */
@@ -91,7 +94,7 @@
     */
    @ApiModelProperty(value = "飞手资质证书地址列表")
    private List<String> certification;
    /**
     * 区域匹配标识(0:未匹配 1:匹配)
     */
drone-service/drone-gd/src/main/java/org/sxkj/gd/workorder/controller/GdTaskResultController.java
@@ -79,12 +79,18 @@
    }
    /**
     * 成果表 列表
     *
     * @param patrolTaskId    巡查任务ID
     * @param attachmentTypes 附件类型列表:1媒体文件;2ai文件;3主视频;(可选,不传则查询全部,多个用逗号分隔)
     * @return 成果列表
     */
    @GetMapping("/list")
    @ApiOperationSupport(order = 2)
    @ApiOperation(value = "列表", notes = "传入patrolTaskId")
    public R<List<GdTaskResultVO>> list(@ApiParam(value = "巡查任务ID", required = true) @RequestParam Long patrolTaskId) {
        return R.data(gdTaskResultService.listByPatrolTaskId(patrolTaskId));
    @ApiOperation(value = "列表", notes = "传入patrolTaskId和attachmentTypes")
    public R<List<GdTaskResultVO>> list(
            @ApiParam(value = "巡查任务ID", required = true) @RequestParam Long patrolTaskId,
            @ApiParam(value = "附件类型:1媒体文件;2ai文件;3主视频;多个用逗号分隔") @RequestParam(required = false) List<Integer> attachmentTypes) {
        return R.data(gdTaskResultService.listByPatrolTaskId(patrolTaskId, attachmentTypes));
    }
//    /**
//     * 成果表 分页
drone-service/drone-gd/src/main/java/org/sxkj/gd/workorder/mapper/GdTaskResultMapper.java
@@ -42,7 +42,16 @@
     */
    List<GdTaskResultVO> selectGdTaskResultPage(IPage page, GdTaskResultVO gdTaskResult);
    List<GdTaskResultVO> selectGdTaskResultListByPatrolTaskId(@Param("patrolTaskId") Long patrolTaskId);
    /**
     * 根据巡查任务ID查询成果列表
     *
     * @param patrolTaskId    巡查任务ID
     * @param attachmentTypes 附件类型列表(可选,为null或空时查询全部)
     * @return 成果列表
     */
    List<GdTaskResultVO> selectGdTaskResultListByPatrolTaskId(
            @Param("patrolTaskId") Long patrolTaskId,
            @Param("attachmentTypes") List<Integer> attachmentTypes);
    /**
drone-service/drone-gd/src/main/java/org/sxkj/gd/workorder/mapper/GdTaskResultMapper.xml
@@ -75,6 +75,9 @@
        <if test="gdTaskResult.createUser != null">
            AND tr.create_user = #{gdTaskResult.createUser}
        </if>
        <if test="gdTaskResult.attachmentType != null">
            AND tr.attachment_type = #{gdTaskResult.attachmentType}
        </if>
        ORDER BY tr.create_time DESC
    </select>
@@ -101,6 +104,12 @@
        WHERE
            tr.is_deleted = 0
          AND tr.patrol_task_id = #{patrolTaskId}
          <if test="attachmentTypes != null and attachmentTypes.size() > 0">
          AND tr.attachment_type IN
          <foreach collection="attachmentTypes" item="type" open="(" separator="," close=")">
              #{type}
          </foreach>
          </if>
    </select>
drone-service/drone-gd/src/main/java/org/sxkj/gd/workorder/service/IGdTaskResultService.java
@@ -43,7 +43,14 @@
     */
    IPage<GdTaskResultVO> selectGdTaskResultPage(IPage<GdTaskResultVO> page, GdTaskResultVO gdTaskResult);
    List<GdTaskResultVO> listByPatrolTaskId(Long patrolTaskId);
    /**
     * 根据巡查任务ID查询成果列表
     *
     * @param patrolTaskId    巡查任务ID
     * @param attachmentTypes 附件类型列表(可选,为null或空时查询全部)
     * @return 成果列表
     */
    List<GdTaskResultVO> listByPatrolTaskId(Long patrolTaskId, List<Integer> attachmentTypes);
    /**
drone-service/drone-gd/src/main/java/org/sxkj/gd/workorder/service/impl/GdPatrolTaskServiceImpl.java
@@ -603,7 +603,7 @@
        attach.setOriginalName(bladeFile.getOriginalName());
        attach.setAttachSize(reportFile.length());
        attach.setExtension(FileUtil.getFileExtension(reportFile.getName()));
        attach.setResultType(JSON.toJSONString(resultType));
        attach.setResultType(resultType);
        attach.setPatrolTaskId(String.valueOf(taskEntity != null ? taskEntity.getId() : null));
        Long createUser = taskEntity != null ? taskEntity.getCreateUser() : null;
        Long updateUser = taskEntity != null ? taskEntity.getUpdateUser() : null;
drone-service/drone-gd/src/main/java/org/sxkj/gd/workorder/service/impl/GdTaskResultServiceImpl.java
@@ -85,9 +85,18 @@
        return page.setRecords(baseMapper.selectGdTaskResultPage(page, gdTaskResult));
    }
    /**
     * 根据巡查任务ID查询成果列表
     *
     * @param patrolTaskId    巡查任务ID
     * @param attachmentTypes 附件类型列表(可选,为null或空时查询全部)
     * @return 成果列表
     */
    @Override
    public List<GdTaskResultVO> listByPatrolTaskId(Long patrolTaskId) {
        List<GdTaskResultVO> gdTaskResultVOS = baseMapper.selectGdTaskResultListByPatrolTaskId(patrolTaskId);
    public List<GdTaskResultVO> listByPatrolTaskId(Long patrolTaskId, List<Integer> attachmentTypes) {
        // 步骤1:查询成果列表
        List<GdTaskResultVO> gdTaskResultVOS = baseMapper.selectGdTaskResultListByPatrolTaskId(patrolTaskId, attachmentTypes);
        // 步骤2:处理URL转义字符
        for (GdTaskResultVO gdTaskResultVO : gdTaskResultVOS) {
            gdTaskResultVO.setResultUrl(unescapeUrl(gdTaskResultVO.getResultUrl()));
        }
drone-service/drone-system/src/main/java/org/sxkj/system/service/impl/DeptServiceImpl.java
@@ -185,9 +185,9 @@
            if (existingDept != null) {
                return updateById(dept);
            }
            return save(dept);
        }
        return false;
        return save(dept);
    }
    @Override