|
@@ -1,17 +1,16 @@
|
|
|
package org.dromara.filemanager.controller;
|
|
|
|
|
|
import java.util.*;
|
|
|
+import java.util.concurrent.atomic.AtomicInteger;
|
|
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
import cn.hutool.json.JSONUtil;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import jakarta.servlet.http.HttpServletResponse;
|
|
|
import jakarta.validation.constraints.*;
|
|
|
-import org.dromara.filemanager.domain.TblArchives;
|
|
|
import org.dromara.filemanager.domain.bo.TblArchivesFileBo;
|
|
|
import org.dromara.filemanager.domain.vo.TblArchivesFileVo;
|
|
|
import org.dromara.filemanager.service.ITblArchivesFileService;
|
|
|
-import org.dromara.system.domain.SysOss;
|
|
|
import org.dromara.system.domain.vo.SysOssVo;
|
|
|
import org.dromara.system.service.ISysOssService;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
@@ -138,11 +137,25 @@ public class TblArchivesController extends BaseController {
|
|
|
|
|
|
Map<String,Object> newfiles = new HashMap<>();
|
|
|
List<String> filelist = new ArrayList<>();
|
|
|
+ //先查寻
|
|
|
+ TblArchivesFileBo bo1 = new TblArchivesFileBo();
|
|
|
+ bo1.setArchiveId(id);
|
|
|
+ AtomicInteger index = new AtomicInteger();
|
|
|
+ List<TblArchivesFileVo> ss = tblArchivesFileService.queryList(bo1);
|
|
|
+ if(ss.size()>0){
|
|
|
+ ss.forEach(t->{
|
|
|
+ if(t.getSortindex()>index.get()){
|
|
|
+ index.set(t.getSortindex());
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
- List<TblArchivesFileBo> fileBoList = Arrays.stream(fileids.split(",")).map(t->{
|
|
|
+ List<TblArchivesFileBo> fileBoList = Arrays.stream(fileids.split(",")).map(t->{
|
|
|
TblArchivesFileBo bo = new TblArchivesFileBo();
|
|
|
bo.setArchiveId(id);
|
|
|
bo.setOssFileId(Long.parseLong(t));
|
|
|
+ bo.setSortindex(index.getAndIncrement());
|
|
|
filelist.add(t);
|
|
|
return bo;
|
|
|
}).toList();
|