feat: There is no way the, 所有标准详情 所有文件显示顺序 最新时间排至最上

This commit is contained in:
super_liu
2022-03-31 11:15:43 +08:00
parent 863f355d6f
commit 4cc5393108
5 changed files with 39 additions and 3 deletions
@@ -1056,7 +1056,7 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
if (entry.getValue() != null && InitStandAttrUtil.fileFieldListBuss != null && InitStandAttrUtil.fileFieldListBuss.size() > 0 && InitStandAttrUtil.fileFieldListBuss.contains(name)) {
value = entry.getValue().toString();
if (StringUtils.isNotBlank(value)) {
List<AttFileEO> fileObj = attFileEOService.getMultiFileInfos(value);
List<AttFileEO> fileObj = attFileEOService.getMultiFileInfosOrderByDateDesc(value);
entry.setValue(fileObj);
}
}else if (entry.getValue() != null && InitStandAttrUtil.selectionFieldListBuss != null && InitStandAttrUtil.selectionFieldListBuss.size() > 0 && InitStandAttrUtil.selectionFieldListBuss.contains(name)) {
@@ -398,7 +398,7 @@ public class SarLawsStandInfoServiceImpl extends ServiceImpl<SarLawsStandInfoDao
if (entry.getValue() != null && InitStandAttrUtil.fileFieldListLaws != null && InitStandAttrUtil.fileFieldListLaws.size() > 0 && InitStandAttrUtil.fileFieldListLaws.contains(name)) {
value = entry.getValue().toString();
if (StringUtils.isNotBlank(value)) {
List<AttFileEO> fileObj = attFileEOService.getMultiFileInfos(value);
List<AttFileEO> fileObj = attFileEOService.getMultiFileInfosOrderByDateDesc(value);
entry.setValue(fileObj);
}
}else if (entry.getValue() != null && InitStandAttrUtil.selectionFieldListLaws != null && InitStandAttrUtil.selectionFieldListLaws.size() > 0 && InitStandAttrUtil.selectionFieldListLaws.contains(name)) {
@@ -627,7 +627,7 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
if (entry.getValue() != null && InitStandAttrUtil.fileFieldList != null && InitStandAttrUtil.fileFieldList.size() > 0 && InitStandAttrUtil.fileFieldList.contains(name)) {
value = entry.getValue().toString();
if (StringUtils.isNotBlank(value)) {
List<AttFileEO> fileObj = attFileEOService.getMultiFileInfos(value);
List<AttFileEO> fileObj = attFileEOService.getMultiFileInfosOrderByDateDesc(value);
entry.setValue(fileObj);
}
}else if (entry.getValue() != null && InitStandAttrUtil.selectionFieldList != null && InitStandAttrUtil.selectionFieldList.size() > 0 && InitStandAttrUtil.selectionFieldList.contains(name)) {
@@ -22,6 +22,8 @@ public interface IAttFileEOService extends IService<AttFileEO> {
public List<AttFileEO> getMultiFileInfos(String fileIds);
public List<AttFileEO> getMultiFileInfosOrderByDateDesc(String fileIds);
public String saveFileAttId(File file);
public AttFileVo insertFileInfo(File file,String fileName);
@@ -22,6 +22,7 @@ import org.springframework.web.multipart.MultipartFile;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.Date;
import java.util.List;
@@ -332,6 +333,39 @@ public class AttFileEOServiceImpl extends ServiceImpl<AttFileEODao, AttFileEO> i
return attFileEO;
}
/**
* @Author super_liu
* @Description 多文件查询
* Date 2018/10/24 11:08
* @Param [fileIds]
* @return java.util.List<com.adc.da.att.entity.AttFileEO>
**/
public List<AttFileEO> getMultiFileInfosOrderByDateDesc(String fileIds) {
List<AttFileEO> fileObj = new ArrayList<>();
if(StringUtils.isNotEmpty(fileIds)){
String idList[] = fileIds.split(",");
for(int i=0;i<idList.length;i++){
AttFileEO attFileEO = new AttFileEO();
try {
if(StringUtils.isNotEmpty(idList[i])){
attFileEO.setId(idList[i]);
AttFileEO getFile = this.baseMapper.selectFileInfoById(attFileEO);
if(attFileEO != null && getFile != null){
fileObj.add(getFile);
}
}
} catch (Exception e) {
log.error(e.getMessage(),e);
}
}
}
if(!fileObj.isEmpty()){
fileObj.sort(Comparator.comparing(AttFileEO::getCreationTime,Comparator.nullsLast(Date::compareTo)).reversed());
}
return fileObj;
}
/**
* @Author super_liu