|
@@ -121,13 +121,14 @@ public class MakrerApi {
|
|
|
List<Long> questionIds = examQuestionList.stream()
|
|
|
.map(m -> m.getId())
|
|
|
.collect(Collectors.toList());
|
|
|
- StringBuilder startSql = new StringBuilder("SELECT t.result,COUNT(*) as sumCount FROM mark_task t WHERE t.`question_id` in ( ");
|
|
|
- String endSql = " ) and t.stage = 1 GROUP BY t.`result`,t.question_id ORDER BY t.result ";
|
|
|
+ StringBuilder startSql = new StringBuilder("select t.`result`,sum(if(t.questionId <> t.currentQuesId, 0, t.sumCount)) as sumCount from(SELECT t.result,COUNT(*) as sumCount,t.question_id as questionId,? as currentQuesId FROM mark_task t WHERE t.`question_id` in ( ");
|
|
|
+ String endSql = " ) and t.stage = 1 GROUP BY t.`result`,t.question_id ORDER BY t.result) t group by t.`result` ";
|
|
|
questionIds.forEach(o -> startSql.append(o).append(","));
|
|
|
//当前老师当前试卷的评档次数
|
|
|
StringBuilder sql = new StringBuilder(startSql.toString().substring(0, startSql.toString().length() - 1));
|
|
|
sql.append(endSql);
|
|
|
- List list = sqlUtil.execSqlForMap(sql.toString());
|
|
|
+ String finalSql = sqlUtil.sqlPrint(sql.toString(), questionId);
|
|
|
+ List list = sqlUtil.execSqlForMap(finalSql);
|
|
|
for (int i = 0; i < list.size(); i++) {
|
|
|
Map map = (Map) list.get(i);
|
|
|
List finalList = (List) map.values().stream()
|
|
@@ -175,11 +176,11 @@ public class MakrerApi {
|
|
|
|
|
|
levelStatDTOs.forEach(o -> {
|
|
|
if (o.getId() != null) {
|
|
|
- double p = (double) o.getCount() / kdtotal;
|
|
|
+ double p = (double) o.getCount() / total;
|
|
|
BigDecimal bd = new BigDecimal(p).setScale(3, RoundingMode.HALF_EVEN);
|
|
|
o.setPercent(bd.doubleValue());
|
|
|
|
|
|
- double gp = (double) o.getGcount() / total;
|
|
|
+ double gp = (double) o.getGcount() / kdtotal;
|
|
|
BigDecimal gbd = new BigDecimal(gp).setScale(3, RoundingMode.HALF_EVEN);
|
|
|
o.setGpercent(gbd.doubleValue());
|
|
|
}
|