|
@@ -10,6 +10,8 @@ import com.miaxis.newgzpt.service.IGzptExamInfoService;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
+import java.math.BigDecimal;
|
|
|
+import java.math.RoundingMode;
|
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
@@ -39,6 +41,7 @@ public class GzptExamInfoServiceImpl extends ServiceImpl<GzptExamInfoMapper, Gzp
|
|
|
}
|
|
|
|
|
|
|
|
|
+ @Override
|
|
|
public double calculatePassRate(GzptExamInfoDTO examInfoDTO) {
|
|
|
// 1. 知识掌握度评估(权重40%)
|
|
|
double knowledgeScore = this.calculateKnowledgeScore(examInfoDTO.getWrongCount(), examInfoDTO.getPracticedCount(), examInfoDTO.getTotalQuestions());
|
|
@@ -52,7 +55,11 @@ public class GzptExamInfoServiceImpl extends ServiceImpl<GzptExamInfoMapper, Gzp
|
|
|
|
|
|
// 综合计算(标准化到0-100%)
|
|
|
double passRate = (knowledgeScore * 0.4) + (mockExamScore * 0.55) + adjustment;
|
|
|
- return Math.max(0, Math.min(100, passRate));
|
|
|
+
|
|
|
+ double passRateMin = Math.max(0, Math.min(100, passRate));
|
|
|
+ BigDecimal bd = new BigDecimal(passRateMin).setScale(2, RoundingMode.DOWN);
|
|
|
+
|
|
|
+ return bd.doubleValue();
|
|
|
}
|
|
|
|
|
|
|