表头排序

This commit is contained in:
zhn
2023-08-21 13:53:24 +08:00
parent 287b00f1a5
commit 8af763b9c1
@@ -417,22 +417,22 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
Collections.sort(otaManageApplyEOList,(e1,e2)->{
String e1MasterDomain = StringUtils.isNotBlank(e1.getMasterDomain()) ? e1.getMasterDomain() : "";
String e2MasterDomain = StringUtils.isNotBlank(e2.getMasterDomain()) ? e2.getMasterDomain() : "";
return comparator.compare(e1MasterDomain,e2MasterDomain);
return comparator.compare(e2MasterDomain,e1MasterDomain);
});
}
}
//studio
if("studio".equals(otaManageApplyEO.getOrderByField())){
if("studioText".equals(otaManageApplyEO.getOrderByField())){
if(OrderEnum.POSITIVE.getValue().equals(otaManageApplyEO.getOrderBy())){
Collections.sort(otaManageApplyEOList,(e1, e2)->{
String e1Studio = StringUtils.isNotBlank(e1.getStudio()) ? e1.getStudio() : "";
String e2Studio = StringUtils.isNotBlank(e2.getStudio()) ? e2.getStudio() : "";
String e1Studio = StringUtils.isNotBlank(e1.getStudioText()) ? e1.getStudioText() : "";
String e2Studio = StringUtils.isNotBlank(e2.getStudioText()) ? e2.getStudioText() : "";
return comparator.compare(e1Studio,e2Studio);
});
}else if(OrderEnum.REVERSE.getValue().equals(otaManageApplyEO.getOrderBy())){
Collections.sort(otaManageApplyEOList,(e1,e2)->{
String e1Studio = StringUtils.isNotBlank(e1.getStudio()) ? e1.getStudio() : "";
String e2Studio = StringUtils.isNotBlank(e2.getStudio()) ? e2.getStudio() : "";
String e1Studio = StringUtils.isNotBlank(e1.getStudioText()) ? e1.getStudioText() : "";
String e2Studio = StringUtils.isNotBlank(e2.getStudioText()) ? e2.getStudioText() : "";
return comparator.compare(e2Studio,e1Studio);
});
}
@@ -520,17 +520,17 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
}
}
//匹配状态
if("matchStatus".equals(otaManageApplyEO.getOrderByField())){
if("matchStatusText".equals(otaManageApplyEO.getOrderByField())){
if(OrderEnum.POSITIVE.getValue().equals(otaManageApplyEO.getOrderBy())){
Collections.sort(otaManageApplyEOList,(e1, e2)->{
String e1MatchStatus = StringUtils.isNotBlank(e1.getMatchStatus()) ? e1.getMatchStatus() : "";
String e2MatchStatus = StringUtils.isNotBlank(e2.getMatchStatus()) ? e2.getMatchStatus() : "";
String e1MatchStatus = StringUtils.isNotBlank(e1.getMatchStatusText()) ? e1.getMatchStatusText() : "";
String e2MatchStatus = StringUtils.isNotBlank(e2.getMatchStatusText()) ? e2.getMatchStatusText() : "";
return comparator.compare(e1MatchStatus,e2MatchStatus);
});
}else if(OrderEnum.REVERSE.getValue().equals(otaManageApplyEO.getOrderBy())){
Collections.sort(otaManageApplyEOList,(e1,e2)->{
String e1MatchStatus = StringUtils.isNotBlank(e1.getMatchStatus()) ? e1.getMatchStatus() : "";
String e2MatchStatus = StringUtils.isNotBlank(e2.getMatchStatus()) ? e2.getMatchStatus() : "";
String e1MatchStatus = StringUtils.isNotBlank(e1.getMatchStatusText()) ? e1.getMatchStatusText() : "";
String e2MatchStatus = StringUtils.isNotBlank(e2.getMatchStatusText()) ? e2.getMatchStatusText() : "";
return comparator.compare(e2MatchStatus,e1MatchStatus);
});
}
@@ -668,7 +668,10 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
}
}
}
if(!list.isEmpty()) {
//表头排序
heartSort(otaManageApplyEO, list);
}
Page pages = PageUtil.getPages(pageNo, pageSize, list);
return pages;
}