Commit e1650e6916e5d55c7dcbf35494ba98baf6419951
1 parent
b940fe608a
Exists in
master
and in
6 other branches
update
Showing 1 changed file with 6 additions and 7 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyCheckFacade.java
View file @
e1650e6
| ... | ... | @@ -5043,17 +5043,16 @@ |
| 5043 | 5043 | ExceptionUtils.catchException(e, "convertToQuanPatient get result Future error."); |
| 5044 | 5044 | } |
| 5045 | 5045 | } |
| 5046 | - if (data.size() >0) | |
| 5047 | - { | |
| 5046 | + if (CollectionUtils.isNotEmpty(data)) { | |
| 5048 | 5047 | Collections.sort(data); |
| 5049 | - data = data.subList(0,10); | |
| 5048 | + if(data.size()>=10){ | |
| 5049 | + data = data.subList(0,10); | |
| 5050 | + } | |
| 5050 | 5051 | int all = 0; |
| 5051 | - for (BabyRiskSortResult result : data) | |
| 5052 | - { | |
| 5052 | + for (BabyRiskSortResult result : data) { | |
| 5053 | 5053 | all+=result.getCount(); |
| 5054 | 5054 | } |
| 5055 | - for (BabyRiskSortResult result : data) | |
| 5056 | - { | |
| 5055 | + for (BabyRiskSortResult result : data) { | |
| 5057 | 5056 | result.setPercent(StringUtils.getPercent(result.getCount(),all)); |
| 5058 | 5057 | } |
| 5059 | 5058 | } |