Commit 76cef2289923aa380feab6da0f5d4f3bc835b821
1 parent
4b65f9ea80
Exists in
master
and in
6 other branches
update
Showing 1 changed file with 8 additions and 8 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyStatisticsManagerFacade.java
View file @
76cef22
... | ... | @@ -864,8 +864,9 @@ |
864 | 864 | List<Integer> babyCount = new ArrayList<>(); |
865 | 865 | |
866 | 866 | List<String> percent = new ArrayList<>(); |
867 | + babyCount.add(total); | |
868 | + percent.add("100%"); | |
867 | 869 | |
868 | - | |
869 | 870 | if (CollectionUtils.isNotEmpty(temp)) |
870 | 871 | { |
871 | 872 | int count = 0; |
872 | 873 | |
... | ... | @@ -923,14 +924,9 @@ |
923 | 924 | } |
924 | 925 | } |
925 | 926 | } |
927 | + babyCount.add(nocheckCount); | |
926 | 928 | |
927 | - if (total != null && total != 0) | |
928 | - { | |
929 | - babyCount.add(total); | |
930 | - percent.add("100%"); | |
931 | - babyCount.add(nocheckCount); | |
932 | - percent.add(percent(nocheckCount,total)); | |
933 | - } | |
929 | + percent.add(percent(nocheckCount,total)); | |
934 | 930 | |
935 | 931 | babyStatisticsManagerSelfConversionListResult.setResult(result); |
936 | 932 | babyStatisticsManagerSelfConversionListResult.setResultOther(resultOther); |
... | ... | @@ -944,6 +940,10 @@ |
944 | 940 | |
945 | 941 | private String percent(Integer count,Integer total) |
946 | 942 | { |
943 | + if (total != null && total == 0) | |
944 | + { | |
945 | + return new BigDecimal(0) + "%"; | |
946 | + } | |
947 | 947 | return new BigDecimal((double) count * 100 / (double) total).setScale(2, BigDecimal.ROUND_HALF_UP) + "%"; |
948 | 948 | } |
949 | 949 |