|
@@ -1,9 +1,7 @@
|
|
|
package com.fs.his.service.impl;
|
|
package com.fs.his.service.impl;
|
|
|
|
|
|
|
|
-import java.util.ArrayList;
|
|
|
|
|
-import java.util.Collections;
|
|
|
|
|
-import java.util.List;
|
|
|
|
|
-import java.util.Objects;
|
|
|
|
|
|
|
+import java.util.*;
|
|
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
import com.fs.common.core.domain.R;
|
|
import com.fs.common.core.domain.R;
|
|
|
import com.fs.common.utils.DateUtils;
|
|
import com.fs.common.utils.DateUtils;
|
|
@@ -55,9 +53,19 @@ public class FsAttachmentServiceImpl extends ServiceImpl<FsAttachmentMapper, FsA
|
|
|
@Override
|
|
@Override
|
|
|
public List<FsAttachment> selectFsAttachmentList(FsAttachmentPageParam fsAttachment) {
|
|
public List<FsAttachment> selectFsAttachmentList(FsAttachmentPageParam fsAttachment) {
|
|
|
List<FsAttachment> list = baseMapper.selectFsAttachmentListPage(fsAttachment);
|
|
List<FsAttachment> list = baseMapper.selectFsAttachmentListPage(fsAttachment);
|
|
|
|
|
+ List<Long> filedIds = list.stream().filter(item -> item.getType() == 0).map(FsAttachment::getAttachmentId).collect(Collectors.toList());
|
|
|
|
|
+ // 如果当前目录有文件夹 查询当前文件夹里面有多少文件
|
|
|
|
|
+ HashMap<Long, HashMap<String, Long>> map = new HashMap<>();
|
|
|
|
|
+ if (!filedIds.isEmpty()) {
|
|
|
|
|
+ map = baseMapper.selectPicCount(filedIds);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
//查询文件夹大小
|
|
//查询文件夹大小
|
|
|
for (FsAttachment attachment : list) {
|
|
for (FsAttachment attachment : list) {
|
|
|
long size = 0;
|
|
long size = 0;
|
|
|
|
|
+ if (attachment.getType() == 0 && map.containsKey(attachment.getAttachmentId())) {
|
|
|
|
|
+ attachment.setPicCount(map.get(attachment.getAttachmentId()).get("pic_count"));
|
|
|
|
|
+ }
|
|
|
if (attachment.getType() == 0){
|
|
if (attachment.getType() == 0){
|
|
|
FsAttachment queryParam = new FsAttachment();
|
|
FsAttachment queryParam = new FsAttachment();
|
|
|
queryParam.setParentId(attachment.getAttachmentId());
|
|
queryParam.setParentId(attachment.getAttachmentId());
|