吉安感知网项目-后端
rain
2026-02-09 66bfbdb9251c22ffa2b5f05595a76a3547a2f5eb
drone-ops/drone-resource/src/main/java/org/sxkj/resource/service/impl/AttachServiceImpl.java
@@ -115,7 +115,12 @@
   @Override
   public IPage<AttachVO> selectAttachPage(IPage<AttachVO> page, AttachPageParam attach) {
       List<AttachVO> attachVOS   = baseMapper.selectAttachPage(page, attach);
      // 创建部门
      if (!AuthUtil.isAdministrator()) {
         List<Long> deptList = SysCache.getDeptChildIds(Long.valueOf(AuthUtil.getDeptId()));
         attach.setDeptList(deptList);
      }
      List<AttachVO> attachVOS = baseMapper.selectAttachPage(page, attach);
      return page.setRecords(attachVOS);
   }
@@ -529,7 +534,6 @@
   @Override
   public Long findResultNumByJobId(String jobId) {
      return baseMapper.selectCount(Wrappers.<Attach>lambdaQuery()
         .eq(Attach::getIsGenerateAiImg, 0)
         .eq(Attach::getIsDeleted, 0)
         .eq(Attach::getPatrolTaskId, jobId).in(Attach::getResultType, AttachResultTypeEnum.getTheAttachmentType()));
   }
@@ -781,24 +785,18 @@
   /**
    * 下载附件
    * @param param 下载参数
    *
    * @param param        下载参数
    * @param outputStream 输出流
    * @return
    * @throws IOException
    */
   @Override
   public Boolean downloadByByte(AttachmentDownloadParam param, OutputStream outputStream) throws IOException {
      // 如果附件id集合并且任务id集合参数都为空,就判断起止时间是否都有为空,如果都为空,则返回错误
      param.setAreaCode(HeaderUtils.formatAreaCode(param.getAreaCode()));
      if (CollectionUtils.isEmpty(param.getAttachIds()) && CollectionUtils.isEmpty(param.getWayLineJobIds())) {
         // 判断起止时间是否为空
         if (StringUtils.isEmpty(param.getStartTime()) || StringUtils.isEmpty(param.getEndTime())) {
            return false;
         }
      }
   public Boolean downloadByByte(String param, OutputStream outputStream) throws IOException {
      AttachmentDownloadParam attachmentDownloadParam = new AttachmentDownloadParam();
      attachmentDownloadParam.setAttachIds(Func.toLongList(param));
      // 获取附件列表
      List<AttachVO> attachList = getAttachList(param);
      List<AttachVO> attachList = getAttachList(attachmentDownloadParam);
      if (CollectionUtils.isEmpty(attachList)) {
         return false;
      }
@@ -883,7 +881,7 @@
      } catch (Exception e) {
         log.error("创建zip文件失败", e);
         return false;
      }finally {
      } finally {
         if (outputStream != null) {
            try {
               outputStream.flush();