修改UAT,项目状态详情列表默认按数量排序

This commit is contained in:
高嵩
2023-06-27 19:52:12 +08:00
parent daf17a71d2
commit f67f41ee3e
@@ -2055,7 +2055,7 @@ public class ProjectLibraryBaseServiceImpl extends ServiceImpl<ProjectLibraryBas
private void projectDetailsStatisticsGroupByTerritoryHearSort(List<Map<String, Object>> dataList,Map<String,Object> params) { private void projectDetailsStatisticsGroupByTerritoryHearSort(List<Map<String, Object>> dataList,Map<String,Object> params) {
String orderByField = (String) params.get("orderByField"); String orderByField = (String) params.get("orderByField");
String orderBy = (String) params.get("orderBy"); String orderBy = (String) params.get("orderBy");
if(CollectionUtils.isNotEmpty(dataList) && StringUtils.isNotEmpty(orderByField) && StringUtils.isNotEmpty(orderBy)){ if(CollectionUtils.isNotEmpty(dataList)){
Collator comparator = Collator.getInstance(Locale.CHINESE); Collator comparator = Collator.getInstance(Locale.CHINESE);
Collections.sort(dataList,(data1,data2)->{ Collections.sort(dataList,(data1,data2)->{
String param1 = ""; String param1 = "";
@@ -2071,10 +2071,10 @@ public class ProjectLibraryBaseServiceImpl extends ServiceImpl<ProjectLibraryBas
} }
} }
// 数量 // 数量
if("amount".equals(orderByField)){ if(StringUtils.isEmpty(orderByField) || "amount".equals(orderByField)){
double p1 = data1.get("amount") != null ? (double) data1.get("amount") : 0; double p1 = data1.get("amount") != null ? (double) data1.get("amount") : 0;
double p2 = data2.get("amount") != null ? (double) data2.get("amount") : 0; double p2 = data2.get("amount") != null ? (double) data2.get("amount") : 0;
if(OrderEnum.POSITIVE.getValue().equals(orderBy)){ if(StringUtils.isEmpty(orderBy) || OrderEnum.POSITIVE.getValue().equals(orderBy)){
return (int)(p1 - p2); return (int)(p1 - p2);
}else if(OrderEnum.REVERSE.getValue().equals(orderBy)){ }else if(OrderEnum.REVERSE.getValue().equals(orderBy)){
return (int)(p2 - p1); return (int)(p2 - p1);