This commit is contained in:
parent
a8cd7f8436
commit
4b308ed69f
|
@ -472,11 +472,6 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
|||
ids = customThreadPool.submit(() -> {
|
||||
List<Long> temp = selectDTOPageSpecilTotal.parallelStream().map(Map.class::cast)
|
||||
.sorted(Comparator.comparing(x -> {
|
||||
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());
|
||||
if (pingTOp_ <= 0) {
|
||||
|
@ -484,7 +479,7 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
|||
}
|
||||
long pingTOp = (index.get("pin_top_time") == null) ? 0 : Long.parseLong(index.get("pin_top_time").toString());
|
||||
return pingTOp;
|
||||
}, Comparator.reverseOrder())
|
||||
}).reversed()
|
||||
.thenComparing(x -> {
|
||||
Map index = (Map) x;
|
||||
String string = (index.get("total") == null) ? "0" : index.get("total").toString();
|
||||
|
@ -498,11 +493,6 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
|||
ids = customThreadPool.submit(() -> {
|
||||
List<Long> temp = selectDTOPageSpecilTotal.parallelStream().map(Map.class::cast)
|
||||
.sorted(Comparator.comparing(x -> {
|
||||
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());
|
||||
if (pingTOp_ <= 0) {
|
||||
|
@ -510,7 +500,7 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
|||
}
|
||||
long pingTOp = (index.get("pin_top_time") == null) ? 0 : Long.parseLong(index.get("pin_top_time").toString());
|
||||
return pingTOp;
|
||||
}, Comparator.reverseOrder())
|
||||
}).reversed()
|
||||
.thenComparing(x -> {
|
||||
Map index = (Map) x;
|
||||
String string = (index.get("total") == null) ? "0" : index.get("total").toString();
|
||||
|
@ -524,8 +514,8 @@ 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.getPinTop() == null ? 0 : index.getPinTop();
|
||||
}).reversed()
|
||||
return index.getTotal() == null ? 0L : index.getTotal();
|
||||
}, Comparator.reverseOrder())
|
||||
.thenComparing(x -> {
|
||||
ResourceDTO index = (ResourceDTO) x;
|
||||
int pinTop = index.getPinTop() == null ? 0 : index.getPinTop();
|
||||
|
@ -535,29 +525,22 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
|||
return new Date(0).getTime() + pinTop;
|
||||
}
|
||||
}).reversed()
|
||||
.thenComparing(x -> {
|
||||
ResourceDTO index = (ResourceDTO) x;
|
||||
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.getPinTop() == null ? 0 : index.getPinTop();
|
||||
}).reversed()
|
||||
return index.getTotal() == null ? 0L : index.getTotal();
|
||||
}, Comparator.reverseOrder())
|
||||
.thenComparing(x -> {
|
||||
ResourceDTO index = (ResourceDTO) x;
|
||||
int pinTop = index.getPinTop() == null ? 0 : index.getPinTop();
|
||||
if (pinTop > 0) {
|
||||
return index.getPinTopTime() == null ? new Date(0).getTime() : index.getPinTopTime().getTime();
|
||||
return index.getPinTopTime() == null ? new Date(0).getTime() + pinTop : index.getPinTopTime().getTime() + pinTop;
|
||||
} else {
|
||||
return new Date(0).getTime();
|
||||
return new Date(0).getTime() + pinTop;
|
||||
}
|
||||
}).reversed()
|
||||
.thenComparing(x -> {
|
||||
ResourceDTO index = (ResourceDTO) x;
|
||||
return index.getTotal() == null ? 0L : index.getTotal();
|
||||
})).collect(Collectors.toList()));
|
||||
}, Comparator.reverseOrder())
|
||||
).collect(Collectors.toList()));
|
||||
}
|
||||
customThreadPool.shutdown();
|
||||
} else { // 非总体评价排序时
|
||||
|
|
Loading…
Reference in New Issue