排序 仅排序数字 不排序文字
This commit is contained in:
+10
-1
@@ -292,6 +292,11 @@ public class SarStandardComplianceAssessResultController {
|
|||||||
iPage.setTotal(datasCount);
|
iPage.setTotal(datasCount);
|
||||||
iPage.setRecords(standards);
|
iPage.setRecords(standards);
|
||||||
while (iPage.getRecords().remove(null)) ;
|
while (iPage.getRecords().remove(null)) ;
|
||||||
|
if(StringUtils.isNotBlank(eo.getOrder())){
|
||||||
|
if(eo.getOrder().equals("desc")){
|
||||||
|
iPage.getRecords().sort((m1,m2)-> m2.getSpecificItem().compareTo(m1.getSpecificItem()));
|
||||||
|
}
|
||||||
|
}
|
||||||
return Result.success(iPage);
|
return Result.success(iPage);
|
||||||
} else {
|
} else {
|
||||||
IPage<SarInterpretationForeignStandard> iPage = new Page<>(eo.getCurrent(), eo.getSize());
|
IPage<SarInterpretationForeignStandard> iPage = new Page<>(eo.getCurrent(), eo.getSize());
|
||||||
@@ -307,7 +312,11 @@ public class SarStandardComplianceAssessResultController {
|
|||||||
if (eo.getStandId() != null) queryWrapper.eq("STAND_ID", eo.getStandId());
|
if (eo.getStandId() != null) queryWrapper.eq("STAND_ID", eo.getStandId());
|
||||||
IPage<SarInterpretationForeignStandard> page = iSarInterpretationForeignStandardService.page(iPage, queryWrapper);
|
IPage<SarInterpretationForeignStandard> page = iSarInterpretationForeignStandardService.page(iPage, queryWrapper);
|
||||||
while (page.getRecords().remove(null)) ;
|
while (page.getRecords().remove(null)) ;
|
||||||
|
if(StringUtils.isNotBlank(eo.getOrder())){
|
||||||
|
if(eo.getOrder().equals("desc")){
|
||||||
|
iPage.getRecords().sort((m1,m2)-> m2.getSpecificItem().compareTo(m1.getSpecificItem()));
|
||||||
|
}
|
||||||
|
}
|
||||||
return Result.success(page);
|
return Result.success(page);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+3
@@ -51,4 +51,7 @@ public class InterpretationEO {
|
|||||||
@ApiModelProperty("页内数量")
|
@ApiModelProperty("页内数量")
|
||||||
private Integer size=20;
|
private Integer size=20;
|
||||||
|
|
||||||
|
@ApiModelProperty("排序")
|
||||||
|
private String order;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user