|
|
@@ -98,12 +98,24 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
|
|
|
lists.sort(new Comparator<StatisticsBo>() {
|
|
|
@Override
|
|
|
public int compare(StatisticsBo o1, StatisticsBo o2) {
|
|
|
- if (o1.getCheck_all_score() > o2.getCheck_all_score()) {
|
|
|
- return 1;
|
|
|
- } else if (o1.getCheck_all_score() < o2.getCheck_all_score()) {
|
|
|
- return -1;
|
|
|
- } else {
|
|
|
- return 0;
|
|
|
+ if(o1.getChecked_num()!=0 && o2.getChecked_num()!=0){
|
|
|
+ double a = o1.getCheck_all_score() / (o1.getChecked_num()+0.00);
|
|
|
+ double b = o2.getCheck_all_score()/(o2.getChecked_num()+0.00);
|
|
|
+ if (a > b ) {
|
|
|
+ return 1;
|
|
|
+ } else if (a < b) {
|
|
|
+ return -1;
|
|
|
+ } else {
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ if(o1.getChecked_num() == 0){
|
|
|
+ return -1 ;
|
|
|
+ }else if(o2.getChecked_num() ==0){
|
|
|
+ return 1;
|
|
|
+ }else{
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
@@ -118,13 +130,14 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
|
|
|
Map<Long, StatisticsBean> mapStationInfos = new HashMap<>();
|
|
|
int i = 0;
|
|
|
for (StatisticsBean sta : lists) {
|
|
|
- if (i++ < 7) {
|
|
|
+ if (i < 7) {
|
|
|
sta.setId(1);
|
|
|
- } else if (i++ < 13) {
|
|
|
+ } else if (i < 13) {
|
|
|
sta.setId(2);
|
|
|
} else {
|
|
|
sta.setId(3);
|
|
|
}
|
|
|
+ i++ ;
|
|
|
mapStationInfos.put(sta.getDept_id(), sta);
|
|
|
}
|
|
|
|
|
|
@@ -160,12 +173,22 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
|
|
|
if (o1.getId() > o2.getId()) {
|
|
|
return 1;
|
|
|
} else if (o1.getId() == o2.getId()) {
|
|
|
- if (o1.getAll_check_score() > o2.getAll_check_score()) {
|
|
|
- return 1;
|
|
|
- } else if (o1.getAll_check_score() < o2.getAll_check_score()) {
|
|
|
- return -1;
|
|
|
- } else {
|
|
|
- return 0;
|
|
|
+ if(o1.getChecked_num()!=0 && o2.getChecked_num()!=0){
|
|
|
+ if (o1.getAll_check_score()/(o1.getChecked_num()+0.0) > o2.getAll_check_score()/(o2.getChecked_num()+0.0) ) {
|
|
|
+ return 1;
|
|
|
+ } else if (o1.getAll_check_score()/(o1.getChecked_num()+0.0) < o2.getAll_check_score()/(o2.getChecked_num()+0.0)) {
|
|
|
+ return -1;
|
|
|
+ } else {
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ if(o1.getChecked_num() == 0){
|
|
|
+ return -1 ;
|
|
|
+ }else if(o2.getChecked_num() ==0){
|
|
|
+ return 1;
|
|
|
+ }else{
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
}
|
|
|
} else {
|
|
|
return -1;
|
|
|
@@ -184,13 +207,14 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
|
|
|
Map<Long, StatisticsBean> mapStationInfos = new HashMap<>();
|
|
|
int i = 0;
|
|
|
for (StatisticsBean sta : lists) {
|
|
|
- if (i++ < 7) {
|
|
|
+ if (i < 7) {
|
|
|
sta.setId(1);
|
|
|
- } else if (i++ < 13) {
|
|
|
+ } else if (i < 13) {
|
|
|
sta.setId(2);
|
|
|
} else {
|
|
|
sta.setId(3);
|
|
|
}
|
|
|
+ i++ ;
|
|
|
mapStationInfos.put(sta.getDept_id(), sta);
|
|
|
}
|
|
|
|
|
|
@@ -214,18 +238,29 @@ public class StatisticsServiceImpl extends BaseService implements StatisticsServ
|
|
|
}
|
|
|
|
|
|
List<StatisticsBean> sortList = new ArrayList<>(mapStationInfos.values());
|
|
|
+
|
|
|
sortList.sort(new Comparator<StatisticsBean>() {
|
|
|
@Override
|
|
|
public int compare(StatisticsBean o1, StatisticsBean o2) {
|
|
|
if (o1.getId() > o2.getId()) {
|
|
|
return 1;
|
|
|
} else if (o1.getId() == o2.getId()) {
|
|
|
- if (o1.getAll_check_score() > o2.getAll_check_score()) {
|
|
|
- return 1;
|
|
|
- } else if (o1.getAll_check_score() < o2.getAll_check_score()) {
|
|
|
- return -1;
|
|
|
- } else {
|
|
|
- return 0;
|
|
|
+ if(o1.getChecked_num()!=0 && o2.getChecked_num()!=0){
|
|
|
+ if (o1.getAll_check_score()/(o1.getChecked_num()+0.0) > o2.getAll_check_score()/(o2.getChecked_num()+0.0) ) {
|
|
|
+ return 1;
|
|
|
+ } else if (o1.getAll_check_score()/(o1.getChecked_num()+0.0) < o2.getAll_check_score()/(o2.getChecked_num()+0.0)) {
|
|
|
+ return -1;
|
|
|
+ } else {
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ if(o1.getChecked_num() == 0){
|
|
|
+ return -1 ;
|
|
|
+ }else if(o2.getChecked_num() ==0){
|
|
|
+ return 1;
|
|
|
+ }else{
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
}
|
|
|
} else {
|
|
|
return -1;
|