xiatian 5 anni fa
parent
commit
9c416c91d6

+ 16 - 2
examcloud-core-reports-service/src/main/java/cn/com/qmth/examcloud/core/reports/service/impl/ExamOrgReportServiceImpl.java

@@ -341,9 +341,17 @@ public class ExamOrgReportServiceImpl implements ExamOrgReportService {
 
 			@Override
 			public int compare(ExamOrgReportMainBean o1, ExamOrgReportMainBean o2) {
-				if (o1.getPassParticipantRatio() > o2.getPassParticipantRatio()) {
+				Double d1=o1.getPassParticipantRatio();
+				Double d2=o2.getPassParticipantRatio();
+				if(d1==null) {
+					d1=0d;
+				}
+				if(d2==null) {
+					d2=0d;
+				}
+				if (d1 > d2) {
 					return 1-ascOrDesc;
-				} else if (o1.getPassParticipantRatio() < o2.getPassParticipantRatio()) {
+				} else if (d1 < d2) {
 					return -1+ascOrDesc;
 				} else {
 					return 0;
@@ -432,6 +440,12 @@ public class ExamOrgReportServiceImpl implements ExamOrgReportService {
 			public int compare(ExamOrgReportMainBean o1, ExamOrgReportMainBean o2) {
 				Double c1 = o1.getPartitionData().get(index).getParticipantRatio();
 				Double c2 = o2.getPartitionData().get(index).getParticipantRatio();
+				if(c1==null) {
+					c1=0d;
+				}
+				if(c2==null) {
+					c2=0d;
+				}
 				if (c1 > c2) {
 					return 1-ascOrDesc;
 				} else if (c1 < c2) {