shenhao 2 лет назад
Родитель
Сommit
df996bb50b

+ 1 - 1
src/main/java/com/ssj/dao/sys/jxy/dao/JxyQueryDao.java

@@ -25,7 +25,7 @@ public interface JxyQueryDao {
 
     Map<String, Object> findWorkbook(String bookId);
 
-    List<Map<String, Object>> findAnswerList(String questionIds);
+    List<Map<String, Object>> findAnswerList(String bookId,String questionIds);
 
     Page<Map<String, Object>> refundList(Map<String, Object> params, Pageable initPage);
 }

+ 8 - 5
src/main/java/com/ssj/dao/sys/jxy/dao/impl/JxyQueryDaoImpl.java

@@ -58,7 +58,7 @@ public class JxyQueryDaoImpl implements JxyQueryDao {
 	public Page<ErrorModel> errorList(Map<String, Object> params, Pageable initPage) {
 		StringBuilder selSQL = new StringBuilder();
 		List<Object> queryParams = new ArrayList<Object>();
-		selSQL.append("SELECT t.homework_picture_id as id,t12.child_name,t13.league_name,t.create_time,t.error_reason_code,t11.file_key,t11.`subject`,t11.create_time as upload_time \n");
+		selSQL.append("SELECT t.homework_picture_id as id,t12.grade,t12.child_name,t13.league_name,t.create_time,t.error_reason_code,t11.file_key,t11.`subject`,t11.create_time as upload_time \n");
 		selSQL.append("from scon_homework_idetify_error t \n");
 		selSQL.append("left join scon_homework_picture t11 on t.homework_picture_id = t11.id\n");
 		selSQL.append("left join tb_lib_vip t12 on t.vip_id = t12.id\n");
@@ -113,16 +113,19 @@ public class JxyQueryDaoImpl implements JxyQueryDao {
 	}
 
 	@Override
-	public List<Map<String, Object>> findAnswerList(String questionIds) {
+	public List<Map<String, Object>> findAnswerList(String bookId,String pageNos) {
 		StringBuilder sb = new StringBuilder();
 		sb.append(" select  t2.id question_id, t2.big_question_index, t2.small_question_name small_question_index,")
 				.append(" t3.answer option_answer, t3.answer_json,t2.book_course_id, t2.num")
 				.append(" from  kmt_exercise_questions t2 ")
-				.append(" LEFT JOIN q_question_info t3 ON t2.id = t3.id   where t2.id in (")
-				.append(questionIds.replace("[","").replace("]","").replace("\"","'"))
-				.append(") ")
+				.append(" LEFT JOIN q_question_info t3 ON t2.id = t3.id ")
+				.append(" left join q_question_workbook t4 on t3.id = t4.question_id ")
+                .append("where t4.page_index in (")
+				.append(pageNos.replace("[","").replace("]",""))
+				.append(") and t4.book_id=?")
 				.append("order by  t2.num");
 		List<Object> params = new ArrayList<>();
+		params.add(bookId);
 		return  dao.findMap(sb.toString(),params.toArray());
 	}
 

+ 1 - 1
src/main/java/com/ssj/service/sys/jxy/service/JxyService.java

@@ -76,7 +76,7 @@ public interface JxyService extends BaseService<Jxy, String> {
 	 * @param questionIds
 	 * @return
 	 */
-	List<Map<String, Object>> findAnswerList(String questionIds);
+	List<Map<String, Object>> findAnswerList(String bookId,String questionIds);
 
 	/**
 	 * 退款审核列表

+ 3 - 3
src/main/java/com/ssj/service/sys/jxy/service/impl/JxyServiceImpl.java

@@ -169,7 +169,7 @@ public class JxyServiceImpl extends BaseServiceImpl<Jxy, String> implements JxyS
 		data.putAll(workbook);
 
 		//查询题目答案
-		List<Map<String, Object>> answerList = jxyQueryDao.findAnswerList(deal.getQuestionIds());
+		List<Map<String, Object>> answerList = jxyQueryDao.findAnswerList(deal.getBookId(),deal.getBookPageNo());
 		data.put("answerList", answerList);
 		return data;
 	}
@@ -180,8 +180,8 @@ public class JxyServiceImpl extends BaseServiceImpl<Jxy, String> implements JxyS
 	}
 
 	@Override
-	public List<Map<String, Object>> findAnswerList(String questionIds) {
-		return jxyQueryDao.findAnswerList(questionIds);
+	public List<Map<String, Object>> findAnswerList(String bookId,String questionIds) {
+		return jxyQueryDao.findAnswerList(bookId,questionIds);
 	}
 
 	@Override

+ 37 - 0
src/main/java/com/ssj/sys/model/JsonDetailModel.java

@@ -0,0 +1,37 @@
+package com.ssj.sys.model;
+
+import java.io.Serializable;
+
+/**
+ * @author sh
+ * @className JsonModel
+ * @description jsonModel
+ * @date 2022/3/22
+ */
+public class JsonDetailModel implements Serializable {
+    /**
+     * [{"index":0,"list":[{"style":{"height":16,"width":16},"type":1,"value":"示例:"}],"selectedType":0},
+     * {"index":0,"list":[{"style":{"height":16,"width":16},"type":1,"value":"The sun rises in the morning."}],"selectedType":0},
+     * {"index":0,"list":[{"style":{"height":16,"width":16},"type":1,"value":"I can see my shadow."}],"selectedType":0},
+     * {"index":0,"list":[{"style":{"height":16,"width":16},"type":1,"value":"Look at my shadow."}],"selectedType":0},
+     * {"index":0,"list":[{"style":{"height":16,"width":16},"type":1,"value":"It's long."}],"selectedType":0}]
+     */
+    private Integer type;
+    private String value;
+
+    public Integer getType() {
+        return type;
+    }
+
+    public void setType(Integer type) {
+        this.type = type;
+    }
+
+    public String getValue() {
+        return value;
+    }
+
+    public void setValue(String value) {
+        this.value = value;
+    }
+}

+ 47 - 0
src/main/java/com/ssj/sys/model/JsonModel.java

@@ -0,0 +1,47 @@
+package com.ssj.sys.model;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * @author sh
+ * @className JsonModel
+ * @description jsonModel
+ * @date 2022/3/22
+ */
+public class JsonModel implements Serializable {
+    /**
+     * [{"index":0,"list":[{"style":{"height":16,"width":16},"type":1,"value":"示例:"}],"selectedType":0},
+     * {"index":0,"list":[{"style":{"height":16,"width":16},"type":1,"value":"The sun rises in the morning."}],"selectedType":0},
+     * {"index":0,"list":[{"style":{"height":16,"width":16},"type":1,"value":"I can see my shadow."}],"selectedType":0},
+     * {"index":0,"list":[{"style":{"height":16,"width":16},"type":1,"value":"Look at my shadow."}],"selectedType":0},
+     * {"index":0,"list":[{"style":{"height":16,"width":16},"type":1,"value":"It's long."}],"selectedType":0}]
+     */
+    private Integer index;
+    private Integer selectedType;
+    private List<JsonDetailModel> list;
+
+    public Integer getIndex() {
+        return index;
+    }
+
+    public void setIndex(Integer index) {
+        this.index = index;
+    }
+
+    public Integer getSelectedType() {
+        return selectedType;
+    }
+
+    public void setSelectedType(Integer selectedType) {
+        this.selectedType = selectedType;
+    }
+
+    public List<JsonDetailModel> getList() {
+        return list;
+    }
+
+    public void setList(List<JsonDetailModel> list) {
+        this.list = list;
+    }
+}