|
|
|
@ -27,6 +27,8 @@ import org.springframework.web.servlet.ModelAndView; |
|
|
|
|
import java.text.Collator; |
|
|
|
|
import java.util.*; |
|
|
|
|
|
|
|
|
|
import static cn.hutool.core.date.DateUtil.compare; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* BianmuCommonController |
|
|
|
|
* |
|
|
|
@ -117,11 +119,12 @@ public class MetadataCommonController { |
|
|
|
|
* 根据目录ID查询数据资源列表 |
|
|
|
|
* |
|
|
|
|
* @param directoryId |
|
|
|
|
* @param type 新增标识,用于管控系统-目录审核查询,按照时间排序 |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
@GetMapping("/list/directory") |
|
|
|
|
@Transactional(readOnly = true) |
|
|
|
|
public Result<Page<DirectoryResource>> listByDirectory(Page<DirectoryResource> page, String directoryId, String resourceName, boolean allChild,String reviewStatus) { |
|
|
|
|
public Result<Page<DirectoryResource>> listByDirectory(Page<DirectoryResource> page, String directoryId, String resourceName, boolean allChild,String reviewStatus,String type) { |
|
|
|
|
if (StringUtils.isBlank(directoryId)) { |
|
|
|
|
return Result.of(null, false, "参数不能为空"); |
|
|
|
|
} |
|
|
|
@ -135,10 +138,13 @@ public class MetadataCommonController { |
|
|
|
|
} |
|
|
|
|
item.setHasMark(labelEntityService.getById(item.getId()) != null); |
|
|
|
|
}).toList(); |
|
|
|
|
|
|
|
|
|
//定义中文排序器
|
|
|
|
|
Comparator<Object> chinese = Collator.getInstance(Locale.CHINA); |
|
|
|
|
result.getRecords().sort((a, b) -> chinese.compare(a.getDirectoryPath(), b.getDirectoryPath())); |
|
|
|
|
if(!"control".equals(type)) { |
|
|
|
|
result.getRecords().sort((a, b) -> chinese.compare(a.getDirectoryPath(), b.getDirectoryPath())); |
|
|
|
|
}else{ |
|
|
|
|
result.getRecords().sort((a, b) -> compare(b.getTaskTime(), a.getTaskTime())); |
|
|
|
|
} |
|
|
|
|
return Result.of(result); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|