Merge branch 'master' into docker_package

This commit is contained in:
wangliwen 2022-08-15 15:30:07 +08:00
commit 7a7c81194e
1 changed files with 8 additions and 26 deletions

View File

@ -471,24 +471,15 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
case "DESC": // total 倒序
ids = customThreadPool.submit(() -> {
List<Long> temp = selectDTOPageSpecilTotal.parallelStream().map(Map.class::cast).sorted(Comparator.comparing(x -> {
// Map index = (Map) x;
// String string = (index.get("total") == null) ? "0" : index.get("total").toString();
// return Long.valueOf(string);
Map index = (Map) x;
int pingTOp = (index.get("pin_top") == null) ? 0 : Integer.parseInt(index.get("pin_top").toString());
return pingTOp;
}, Comparator.reverseOrder())
.thenComparing(x -> {
// Map index = (Map) x;
// int pingTOp = (index.get("pin_top") == null) ? 0 : Integer.parseInt(index.get("pin_top").toString());
// return pingTOp;
Map index = (Map) x;
long pingTOp = (index.get("pin_top_time") == null) ? 0 : Long.parseLong(index.get("pin_top_time").toString());
return pingTOp;
}, Comparator.reverseOrder()).thenComparing(x -> {
// Map index = (Map) x;
// long pingTOp = (index.get("pin_top_time") == null) ? 0 : Long.parseLong(index.get("pin_top_time").toString());
// return pingTOp;
Map index = (Map) x;
String string = (index.get("total") == null) ? "0" : index.get("total").toString();
return Long.valueOf(string);
@ -500,23 +491,14 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
case "ASC": // total 升序
ids = customThreadPool.submit(() -> {
List<Long> temp = selectDTOPageSpecilTotal.parallelStream().map(Map.class::cast).sorted(Comparator.comparing(x -> {
// Map index = (Map) x;
// String string = (index.get("total") == null) ? "0" : index.get("total").toString();
// return Long.valueOf(string);
Map index = (Map) x;
int pingTOp = (index.get("pin_top") == null) ? 0 : Integer.parseInt(index.get("pin_top").toString());
return pingTOp;
}, Comparator.reverseOrder()).thenComparing(x -> {
// Map index = (Map) x;
// int pingTOp = (index.get("pin_top") == null) ? 0 : Integer.parseInt(index.get("pin_top").toString());
// return pingTOp;
Map index = (Map) x;
long pingTOp = (index.get("pin_top_time") == null) ? 0 : Long.parseLong(index.get("pin_top_time").toString());
return pingTOp;
}, Comparator.reverseOrder()).thenComparing(x -> {
// Map index = (Map) x;
// long pingTOp = (index.get("pin_top_time") == null) ? 0 : Long.parseLong(index.get("pin_top_time").toString());
// return pingTOp;
Map index = (Map) x;
String string = (index.get("total") == null) ? "0" : index.get("total").toString();
return Long.valueOf(string);
@ -529,28 +511,28 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
if ("DESC".equals(orderType)) {
resultPage.setRecords(resourceDTOS.stream().sorted(Comparator.comparing(x -> {
ResourceDTO index = (ResourceDTO) x;
return index.getTotal() == null ? 0L : index.getTotal();
return index.getPinTop() == null ? 0 : index.getPinTop();
}, Comparator.reverseOrder())
.thenComparing(x -> {
ResourceDTO index = (ResourceDTO) x;
return index.getPinTop() == null ? 0 : index.getPinTop();
return index.getPinTopTime() == null ? new Date(0) : index.getPinTopTime();
}, Comparator.reverseOrder()).thenComparing(x -> {
ResourceDTO index = (ResourceDTO) x;
return index.getPinTopTime() == null ? new Date(0) : index.getPinTopTime();
return index.getTotal() == null ? 0L : index.getTotal();
}, Comparator.reverseOrder())
).collect(Collectors.toList()));
} else {
resultPage.setRecords(resourceDTOS.stream().sorted(Comparator.comparing(x -> {
ResourceDTO index = (ResourceDTO) x;
return index.getTotal() == null ? 0L : index.getTotal();
}).thenComparing(x -> {
ResourceDTO index = (ResourceDTO) x;
return index.getPinTop() == null ? 0 : index.getPinTop();
}, Comparator.reverseOrder()).thenComparing(x -> {
ResourceDTO index = (ResourceDTO) x;
return index.getPinTopTime() == null ? new Date(0) : index.getPinTopTime();
}, Comparator.reverseOrder())
.thenComparing(x -> {
ResourceDTO index = (ResourceDTO) x;
return index.getPinTopTime() == null ? new Date(0) : index.getPinTopTime();
}, Comparator.reverseOrder())).collect(Collectors.toList()));
return index.getTotal() == null ? 0L : index.getTotal();
})).collect(Collectors.toList()));
}
customThreadPool.shutdown();
} else { // 非总体评价排序时