吉安感知网项目-后端
xiebin
2026-04-01 939e76b90691c8f4e66e437791bce9e11bc4bfad
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);
   }
@@ -780,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())) {
         // 判断起止时间是否为空
         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;
      }
@@ -882,7 +881,7 @@
      } catch (Exception e) {
         log.error("创建zip文件失败", e);
         return false;
      }finally {
      } finally {
         if (outputStream != null) {
            try {
               outputStream.flush();