浏览代码

一点通抓取修改

小么熊🐻 1 年之前
父节点
当前提交
97cb31b0e6

+ 548 - 0
zzjs-admin/src/test/java/com/miaxis/test/KtTest3.java

@@ -0,0 +1,548 @@
+package com.miaxis.test;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.miaxis.ZzjsApplication;
+import com.miaxis.common.utils.StringUtils;
+import com.miaxis.feign.service.IKtService;
+import com.miaxis.question.domain.QuestionColumn;
+import com.miaxis.question.domain.QuestionFree;
+import com.miaxis.question.domain.QuestionInfoKtGet;
+import com.miaxis.question.domain.QuestionInfoKtNew;
+import com.miaxis.question.service.IQuestionColumnService;
+import com.miaxis.question.service.IQuestionFreeService;
+import com.miaxis.question.service.IQuestionInfoKtGetService;
+import com.miaxis.question.service.IQuestionInfoKtNewService;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.junit4.SpringRunner;
+
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+@SpringBootTest(classes = ZzjsApplication.class)
+@RunWith(SpringRunner.class)
+public class KtTest3 {
+
+
+    @Autowired
+    private IKtService ktService;
+
+
+    @Autowired
+    private IQuestionColumnService questionColumnService;
+
+    @Autowired
+    private IQuestionInfoKtNewService questionInfoKtNewService;
+
+
+
+    /**
+     * 获取一点通题库
+     */
+    @Test
+    public void test() {
+        QuestionInfoKtNew questionInfoKtNew = new QuestionInfoKtNew();
+        questionInfoKtNew.setNumber(150511l);
+        int count = questionInfoKtNewService.selectQuestionInfoKtNewCount(questionInfoKtNew);
+        System.out.println(count);
+
+    }
+
+    @Test
+    public void getColumn() {
+
+        List<Map<String, String>> mapList = this.getMap();
+        for (Map<String, String> m : mapList) {
+
+            String time = String.valueOf(System.currentTimeMillis() / 1000);
+            System.out.println(m.get("model") + "," + m.get("subject"));
+            String result = ktService.getInfo(m.get("model"), m.get("subject"), time);
+            JSONObject json = JSONObject.parseObject(result);
+            JSONArray data = json.getJSONArray("data");
+            System.out.println(data);
+            for (int i = 0; i < data.size(); i++) {
+                JSONObject n1 = (JSONObject) data.get(i);
+                Integer countid = n1.getInteger("id");
+                String title = n1.getString("title");
+                String model = n1.getString("model");
+                String subject = n1.getString("subject");
+                Integer sort = n1.getInteger("sort");
+                System.out.println(countid + "," + title + "," + model + "," + subject);
+
+                QuestionColumn questionColumn = new QuestionColumn();
+                questionColumn.setColumnId(countid);
+                questionColumn.setModel(model);
+                questionColumn.setSort(sort);
+                questionColumn.setSubject(subject);
+                questionColumn.setTitle(title);
+
+                questionColumnService.save(questionColumn);
+            }
+        }
+    }
+
+
+    @Test
+    public void getQuestion() {
+
+        List<Map<String, String>> mapList = this.getMap();
+        for (Map<String, String> m : mapList) {
+
+            String time = String.valueOf(System.currentTimeMillis() / 1000);
+            System.out.println(m.get("model") + "," + m.get("subject"));
+            String result = ktService.getInfo(m.get("model"), m.get("subject"), time);
+            JSONObject json = JSONObject.parseObject(result);
+            JSONArray data = json.getJSONArray("data");
+
+            for (int i = 0; i < data.size(); i++) {
+                JSONObject n1 = (JSONObject) data.get(i);
+                String countid = n1.getString("id");
+                String title = n1.getString("title");
+                //String model = n1.getString("model");
+                String model = m.get("model");
+                String subject = n1.getString("subject");
+                System.out.println(countid + "," + title + "," + model);
+                String result2 = ktService.getQuestion(model, countid, title, subject, time);
+                JSONObject json2 = JSONObject.parseObject(result2);
+                JSONArray data2 = json2.getJSONArray("data");
+                List<QuestionInfoKtNew> addList = new ArrayList<QuestionInfoKtNew>();
+                List<QuestionInfoKtNew> upList = new ArrayList<QuestionInfoKtNew>();
+
+                for (int j = 0; j < data2.size(); j++) {
+                    JSONObject n2 = (JSONObject) data2.get(j);
+                    String id2 = n2.getString("id");    //快通ID
+                    String idYdt = n2.getString("idYdt");  //一点通ID
+                    String number = n2.getString("number");  //一点通ID
+                    String type = n2.getString("type"); // 1:判断题 2:选择题 3:多选题
+                    String answer = n2.getString("answer"); //答案
+                    String answerkeyword = n2.getString("answerkeyword");//答案关键词
+                    String explainGif = n2.getString("explainGif"); //技巧讲解图片URL
+                    String explainJq = n2.getString("explainJq");  //技巧讲解说明
+                    String explainJs = n2.getString("explainJs"); //官方解释
+                    String explainMp3 = n2.getString("explainMp3"); //技巧讲解语音URL
+                    String image = n2.getString("image");   //题目图片URL
+                    String imageYdt = n2.getString("imageYdt"); //题目图片URL2
+                    String issue = n2.getString("issue");  //题目
+                    String model2 = n2.getString("model"); //车型
+                    String columnAll = n2.getString("columnAll"); //车型
+                    String opts = n2.getString("opts");    //答案选项
+                    String skillkeyword = n2.getString("skillkeyword");  //答题技巧关键词
+                    String subject2 = n2.getString("subject");   // 科目与分类
+                    String titlekeyword = n2.getString("titlekeyword");  // 题目关键词
+                    String issuemp3 = n2.getString("issuemp3");   //读题语音URL
+                    String answermp3 = n2.getString("answermp3");   //答案语音URL
+                    String explainjsmp3 = n2.getString("explainjsmp3"); //读题+答案语音URL
+
+                    //查询当前是否数据是否存在
+                    QuestionInfoKtNew questionInfoKtNewQuery = new QuestionInfoKtNew();
+                    questionInfoKtNewQuery.setId(Long.parseLong(id2));
+                    int count = questionInfoKtNewService.selectQuestionInfoKtNewCount(questionInfoKtNewQuery);
+                    if (count == 0) {
+                        QuestionInfoKtNew questionInfoKtNew = new QuestionInfoKtNew();
+                        questionInfoKtNew.setId(Long.parseLong(id2));
+                        questionInfoKtNew.setIdYdt(idYdt == null ? null : Long.parseLong(idYdt));
+                        questionInfoKtNew.setNumber(number == null ? null : Long.parseLong(number));
+                        questionInfoKtNew.setQuestionType(type == null ? null : Long.parseLong(type));
+                        questionInfoKtNew.setAnswer(answer);
+                        questionInfoKtNew.setAnswerkeyword(answerkeyword);
+                        questionInfoKtNew.setExplainGif(explainGif);
+                        questionInfoKtNew.setExplainJq(explainJq);
+                        questionInfoKtNew.setExplainJs(explainJs);
+                        questionInfoKtNew.setExplainMp3(explainMp3);
+                        questionInfoKtNew.setImage(image);
+                        questionInfoKtNew.setImageYdt(imageYdt);
+                        questionInfoKtNew.setIssue(issue);
+                        questionInfoKtNew.setOpts(opts);
+                        questionInfoKtNew.setSkillkeyword(skillkeyword);
+                        questionInfoKtNew.setTitlekeyword(titlekeyword);
+                        questionInfoKtNew.setIssuemp3(issuemp3);
+                        questionInfoKtNew.setAnswermp3(answermp3);
+                        questionInfoKtNew.setExplainjsmp3(explainjsmp3);
+
+                        questionInfoKtNew.setModel(model2);
+                        questionInfoKtNew.setSubject(subject2);
+                        questionInfoKtNew.setColumnAll(columnAll);
+
+                        addList.add(questionInfoKtNew);
+                        // questionInfoGetService.save(questionInfoKt);
+                    } else {
+                        QuestionInfoKtNew questionInfoKtNew = new QuestionInfoKtNew();
+                        questionInfoKtNew.setId(Long.parseLong(id2));
+                        questionInfoKtNew.setIdYdt(idYdt == null ? null : Long.parseLong(idYdt));
+                        questionInfoKtNew.setNumber(number == null ? null : Long.parseLong(number));
+                        questionInfoKtNew.setQuestionType(type == null ? null : Long.parseLong(type));
+                        questionInfoKtNew.setAnswer(answer);
+                        questionInfoKtNew.setAnswerkeyword(answerkeyword);
+                        questionInfoKtNew.setExplainGif(explainGif);
+                        questionInfoKtNew.setExplainJq(explainJq);
+                        questionInfoKtNew.setExplainJs(explainJs);
+                        questionInfoKtNew.setExplainMp3(explainMp3);
+                        questionInfoKtNew.setImage(image);
+                        questionInfoKtNew.setImageYdt(imageYdt);
+                        questionInfoKtNew.setIssue(issue);
+                        questionInfoKtNew.setOpts(opts);
+                        questionInfoKtNew.setSkillkeyword(skillkeyword);
+                        questionInfoKtNew.setTitlekeyword(titlekeyword);
+                        questionInfoKtNew.setIssuemp3(issuemp3);
+                        questionInfoKtNew.setAnswermp3(answermp3);
+                        questionInfoKtNew.setExplainjsmp3(explainjsmp3);
+
+                        questionInfoKtNew.setModel(model2);
+                        questionInfoKtNew.setSubject(subject2);
+                        questionInfoKtNew.setColumnAll(columnAll);
+                        upList.add(questionInfoKtNew);
+                    }
+                }
+                questionInfoKtNewService.saveBatch(addList);
+                questionInfoKtNewService.updateBatchById(upList);
+            }
+        }
+
+    }
+
+
+    public List<Map<String, String>> getMap() {
+
+        //小车 科目一
+        Map<String, String> cart_k1 = new LinkedHashMap(); // k1:顺序练习
+        cart_k1.put("model", "cart");
+        cart_k1.put("subject", "k1");
+        Map<String, String> cart_k1_2 = new LinkedHashMap(); //  k1_2:精选必考题
+        cart_k1_2.put("model", "cart");
+        cart_k1_2.put("subject", "k1_2");
+        Map<String, String> cart_k1_3 = new LinkedHashMap(); //  k1_3:分类练习
+        cart_k1_3.put("model", "cart");
+        cart_k1_3.put("subject", "k1_3");
+        Map<String, String> cart_k1_4 = new LinkedHashMap(); //  k1_4:地方题库
+        cart_k1_4.put("model", "cart");
+        cart_k1_4.put("subject", "k1_4");
+
+        //客车 科目一
+        Map<String, String> bus_k1 = new LinkedHashMap(); // k1:顺序练习
+        bus_k1.put("model", "bus");
+        bus_k1.put("subject", "k1");
+        Map<String, String> bus_k1_2 = new LinkedHashMap(); //  k1_2:精选必考题
+        bus_k1_2.put("model", "bus");
+        bus_k1_2.put("subject", "k1_2");
+        Map<String, String> bus_k1_3 = new LinkedHashMap(); //  k1_3:分类练习
+        bus_k1_3.put("model", "bus");
+        bus_k1_3.put("subject", "k1_3");
+        Map<String, String> bus_k1_4 = new LinkedHashMap(); //  k1_4:地方题库
+        bus_k1_4.put("model", "bus");
+        bus_k1_4.put("subject", "k1_4");
+
+
+        //货车 科目一
+        Map<String, String> truck_k1 = new LinkedHashMap(); // k1:顺序练习
+        truck_k1.put("model", "truck");
+        truck_k1.put("subject", "k1");
+        Map<String, String> truck_k1_2 = new LinkedHashMap(); //  k1_2:精选必考题
+        truck_k1_2.put("model", "truck");
+        truck_k1_2.put("subject", "k1_2");
+        Map<String, String> truck_k1_3 = new LinkedHashMap(); //  k1_3:分类练习
+        truck_k1_3.put("model", "truck");
+        truck_k1_3.put("subject", "k1_3");
+        Map<String, String> truck_k1_4 = new LinkedHashMap(); //  k1_4:地方题库
+        truck_k1_4.put("model", "truck");
+        truck_k1_4.put("subject", "k1_4");
+
+        //摩托车 科目一
+        Map<String, String> mtc_k1 = new LinkedHashMap(); // k1:顺序练习
+        mtc_k1.put("model", "mtc");
+        mtc_k1.put("subject", "k1");
+        Map<String, String> mtc_k1_2 = new LinkedHashMap(); //  k1_2:精选必考题
+        mtc_k1_2.put("model", "mtc");
+        mtc_k1_2.put("subject", "k1_2");
+        Map<String, String> mtc_k1_3 = new LinkedHashMap(); //  k1_3:分类练习
+        mtc_k1_3.put("model", "mtc");
+        mtc_k1_3.put("subject", "k1_3");
+        Map<String, String> mtc_k1_4 = new LinkedHashMap(); //  k1_4:地方题库
+        mtc_k1_4.put("model", "mtc");
+        mtc_k1_4.put("subject", "k1_4");
+
+
+        //小车 科目四
+        Map<String, String> cart_k4 = new LinkedHashMap(); // k4:顺序练习
+        cart_k4.put("model", "cart");
+        cart_k4.put("subject", "k4");
+        Map<String, String> cart_k4_2 = new LinkedHashMap(); //  k4_2:精选必考题
+        cart_k4_2.put("model", "cart");
+        cart_k4_2.put("subject", "k4_2");
+        Map<String, String> cart_k4_3 = new LinkedHashMap(); //  k4_3:分类练习
+        cart_k4_3.put("model", "cart");
+        cart_k4_3.put("subject", "k4_3");
+        Map<String, String> cart_k4_4 = new LinkedHashMap(); //  k4_4:地方题库
+        cart_k4_4.put("model", "cart");
+        cart_k4_4.put("subject", "k4_4");
+
+        //客车 科目四
+        Map<String, String> bus_k4 = new LinkedHashMap(); // k4:顺序练习
+        bus_k4.put("model", "bus");
+        bus_k4.put("subject", "k4");
+        Map<String, String> bus_k4_2 = new LinkedHashMap(); //  k4_2:精选必考题
+        bus_k4_2.put("model", "bus");
+        bus_k4_2.put("subject", "k4_2");
+        Map<String, String> bus_k4_3 = new LinkedHashMap(); //  k4_3:分类练习
+        bus_k4_3.put("model", "bus");
+        bus_k4_3.put("subject", "k4_3");
+        Map<String, String> bus_k4_4 = new LinkedHashMap(); //  k4_4:地方题库
+        bus_k4_4.put("model", "bus");
+        bus_k4_4.put("subject", "k4_4");
+
+
+        //货车 科目四
+        Map<String, String> truck_k4 = new LinkedHashMap(); // k4:顺序练习
+        truck_k4.put("model", "truck");
+        truck_k4.put("subject", "k4");
+        Map<String, String> truck_k4_2 = new LinkedHashMap(); //  k4_2:精选必考题
+        truck_k4_2.put("model", "truck");
+        truck_k4_2.put("subject", "k4_2");
+        Map<String, String> truck_k4_3 = new LinkedHashMap(); //  k4_3:分类练习
+        truck_k4_3.put("model", "truck");
+        truck_k4_3.put("subject", "k4_3");
+        Map<String, String> truck_k4_4 = new LinkedHashMap(); //  k4_4:地方题库
+        truck_k4_4.put("model", "truck");
+        truck_k4_4.put("subject", "k4_4");
+
+        //摩托车 科目四
+        Map<String, String> mtc_k4 = new LinkedHashMap(); // k4:顺序练习
+        mtc_k4.put("model", "mtc");
+        mtc_k4.put("subject", "k4");
+        Map<String, String> mtc_k4_2 = new LinkedHashMap(); //  k4_2:精选必考题
+        mtc_k4_2.put("model", "mtc");
+        mtc_k4_2.put("subject", "k4_2");
+        Map<String, String> mtc_k4_3 = new LinkedHashMap(); //  k4_3:分类练习
+        mtc_k4_3.put("model", "mtc");
+        mtc_k4_3.put("subject", "k4_3");
+        Map<String, String> mtc_k4_4 = new LinkedHashMap(); //  k4_4:地方题库
+        mtc_k4_4.put("model", "mtc");
+        mtc_k4_4.put("subject", "k4_4");
+
+
+        List<Map<String, String>> mapList = new ArrayList<Map<String, String>>();
+        //小车 科目一
+        mapList.add(cart_k1);
+        mapList.add(cart_k1_2);
+        mapList.add(cart_k1_3);
+        mapList.add(cart_k1_4);
+        //客车 科目一
+        mapList.add(bus_k1);
+        mapList.add(bus_k1_2);
+        mapList.add(bus_k1_3);
+        mapList.add(bus_k1_4);
+        //货车 科目一
+        mapList.add(truck_k1);
+        mapList.add(truck_k1_2);
+        mapList.add(truck_k1_3);
+        mapList.add(truck_k1_4);
+        //摩托车 科目一
+        mapList.add(mtc_k1);
+        mapList.add(mtc_k1_2);
+        mapList.add(mtc_k1_3);
+        mapList.add(mtc_k1_4);
+
+        //小车 科目四
+        mapList.add(cart_k4);
+        mapList.add(cart_k4_2);
+        mapList.add(cart_k4_3);
+        mapList.add(cart_k4_4);
+        //客车 科目四
+        mapList.add(bus_k4);
+        mapList.add(bus_k4_2);
+        mapList.add(bus_k4_3);
+        mapList.add(bus_k4_4);
+        //货车 科目四
+        mapList.add(truck_k4);
+        mapList.add(truck_k4_2);
+        mapList.add(truck_k4_3);
+        mapList.add(truck_k4_4);
+        //摩托车 科目四
+        mapList.add(mtc_k4);
+        mapList.add(mtc_k4_2);
+        mapList.add(mtc_k4_3);
+        mapList.add(mtc_k4_4);
+
+        return mapList;
+    }
+
+    public List<Map<String, String>> get1Map() {
+
+        //小车 科目一
+        Map<String, String> cart_k1 = new LinkedHashMap(); // k1:顺序练习
+        cart_k1.put("model", "cart");
+        cart_k1.put("subject", "k1");
+        Map<String, String> cart_k1_2 = new LinkedHashMap(); //  k1_2:精选必考题
+        cart_k1_2.put("model", "cart");
+        cart_k1_2.put("subject", "k1_2");
+        Map<String, String> cart_k1_3 = new LinkedHashMap(); //  k1_3:分类练习
+        cart_k1_3.put("model", "cart");
+        cart_k1_3.put("subject", "k1_3");
+        Map<String, String> cart_k1_4 = new LinkedHashMap(); //  k1_4:地方题库
+        cart_k1_4.put("model", "cart");
+        cart_k1_4.put("subject", "k1_4");
+
+        //客车 科目一
+        Map<String, String> bus_k1 = new LinkedHashMap(); // k1:顺序练习
+        bus_k1.put("model", "bus");
+        bus_k1.put("subject", "k1");
+        Map<String, String> bus_k1_2 = new LinkedHashMap(); //  k1_2:精选必考题
+        bus_k1_2.put("model", "bus");
+        bus_k1_2.put("subject", "k1_2");
+        Map<String, String> bus_k1_3 = new LinkedHashMap(); //  k1_3:分类练习
+        bus_k1_3.put("model", "bus");
+        bus_k1_3.put("subject", "k1_3");
+        Map<String, String> bus_k1_4 = new LinkedHashMap(); //  k1_4:地方题库
+        bus_k1_4.put("model", "bus");
+        bus_k1_4.put("subject", "k1_4");
+
+
+        //货车 科目一
+        Map<String, String> truck_k1 = new LinkedHashMap(); // k1:顺序练习
+        truck_k1.put("model", "truck");
+        truck_k1.put("subject", "k1");
+        Map<String, String> truck_k1_2 = new LinkedHashMap(); //  k1_2:精选必考题
+        truck_k1_2.put("model", "truck");
+        truck_k1_2.put("subject", "k1_2");
+        Map<String, String> truck_k1_3 = new LinkedHashMap(); //  k1_3:分类练习
+        truck_k1_3.put("model", "truck");
+        truck_k1_3.put("subject", "k1_3");
+        Map<String, String> truck_k1_4 = new LinkedHashMap(); //  k1_4:地方题库
+        truck_k1_4.put("model", "truck");
+        truck_k1_4.put("subject", "k1_4");
+
+        //摩托车 科目一
+        Map<String, String> mtc_k1 = new LinkedHashMap(); // k1:顺序练习
+        mtc_k1.put("model", "mtc");
+        mtc_k1.put("subject", "k1");
+        Map<String, String> mtc_k1_2 = new LinkedHashMap(); //  k1_2:精选必考题
+        mtc_k1_2.put("model", "mtc");
+        mtc_k1_2.put("subject", "k1_2");
+        Map<String, String> mtc_k1_3 = new LinkedHashMap(); //  k1_3:分类练习
+        mtc_k1_3.put("model", "mtc");
+        mtc_k1_3.put("subject", "k1_3");
+        Map<String, String> mtc_k1_4 = new LinkedHashMap(); //  k1_4:地方题库
+        mtc_k1_4.put("model", "mtc");
+        mtc_k1_4.put("subject", "k1_4");
+
+
+        List<Map<String, String>> mapList = new ArrayList<Map<String, String>>();
+        //小车 科目一
+        mapList.add(cart_k1);
+        mapList.add(cart_k1_2);
+        mapList.add(cart_k1_3);
+        mapList.add(cart_k1_4);
+        //客车 科目一
+        mapList.add(bus_k1);
+        mapList.add(bus_k1_2);
+        mapList.add(bus_k1_3);
+        mapList.add(bus_k1_4);
+        //货车 科目一
+        mapList.add(truck_k1);
+        mapList.add(truck_k1_2);
+        mapList.add(truck_k1_3);
+        mapList.add(truck_k1_4);
+        //摩托车 科目一
+        mapList.add(mtc_k1);
+        mapList.add(mtc_k1_2);
+        mapList.add(mtc_k1_3);
+        mapList.add(mtc_k1_4);
+
+        return mapList;
+    }
+
+
+    public List<Map<String, String>> get4Map() {
+
+        //小车 科目四
+        Map<String, String> cart_k4 = new LinkedHashMap(); // k4:顺序练习
+        cart_k4.put("model", "cart");
+        cart_k4.put("subject", "k4");
+        Map<String, String> cart_k4_2 = new LinkedHashMap(); //  k4_2:精选必考题
+        cart_k4_2.put("model", "cart");
+        cart_k4_2.put("subject", "k4_2");
+        Map<String, String> cart_k4_3 = new LinkedHashMap(); //  k4_3:分类练习
+        cart_k4_3.put("model", "cart");
+        cart_k4_3.put("subject", "k4_3");
+        Map<String, String> cart_k4_4 = new LinkedHashMap(); //  k4_4:地方题库
+        cart_k4_4.put("model", "cart");
+        cart_k4_4.put("subject", "k4_4");
+
+        //客车 科目四
+        Map<String, String> bus_k4 = new LinkedHashMap(); // k4:顺序练习
+        bus_k4.put("model", "bus");
+        bus_k4.put("subject", "k4");
+        Map<String, String> bus_k4_2 = new LinkedHashMap(); //  k4_2:精选必考题
+        bus_k4_2.put("model", "bus");
+        bus_k4_2.put("subject", "k4_2");
+        Map<String, String> bus_k4_3 = new LinkedHashMap(); //  k4_3:分类练习
+        bus_k4_3.put("model", "bus");
+        bus_k4_3.put("subject", "k4_3");
+        Map<String, String> bus_k4_4 = new LinkedHashMap(); //  k4_4:地方题库
+        bus_k4_4.put("model", "bus");
+        bus_k4_4.put("subject", "k4_4");
+
+
+        //货车 科目四
+        Map<String, String> truck_k4 = new LinkedHashMap(); // k4:顺序练习
+        truck_k4.put("model", "truck");
+        truck_k4.put("subject", "k4");
+        Map<String, String> truck_k4_2 = new LinkedHashMap(); //  k4_2:精选必考题
+        truck_k4_2.put("model", "truck");
+        truck_k4_2.put("subject", "k4_2");
+        Map<String, String> truck_k4_3 = new LinkedHashMap(); //  k4_3:分类练习
+        truck_k4_3.put("model", "truck");
+        truck_k4_3.put("subject", "k4_3");
+        Map<String, String> truck_k4_4 = new LinkedHashMap(); //  k4_4:地方题库
+        truck_k4_4.put("model", "truck");
+        truck_k4_4.put("subject", "k4_4");
+
+        //摩托车 科目四
+        Map<String, String> mtc_k4 = new LinkedHashMap(); // k4:顺序练习
+        mtc_k4.put("model", "mtc");
+        mtc_k4.put("subject", "k4");
+        Map<String, String> mtc_k4_2 = new LinkedHashMap(); //  k4_2:精选必考题
+        mtc_k4_2.put("model", "mtc");
+        mtc_k4_2.put("subject", "k4_2");
+        Map<String, String> mtc_k4_3 = new LinkedHashMap(); //  k4_3:分类练习
+        mtc_k4_3.put("model", "mtc");
+        mtc_k4_3.put("subject", "k4_3");
+        Map<String, String> mtc_k4_4 = new LinkedHashMap(); //  k4_4:地方题库
+        mtc_k4_4.put("model", "mtc");
+        mtc_k4_4.put("subject", "k4_4");
+
+
+        List<Map<String, String>> mapList = new ArrayList<Map<String, String>>();
+        //小车 科目四
+        mapList.add(cart_k4);
+        mapList.add(cart_k4_2);
+        mapList.add(cart_k4_3);
+        mapList.add(cart_k4_4);
+        //客车 科目四
+        mapList.add(bus_k4);
+        mapList.add(bus_k4_2);
+        mapList.add(bus_k4_3);
+        mapList.add(bus_k4_4);
+        //货车 科目四
+        mapList.add(truck_k4);
+        mapList.add(truck_k4_2);
+        mapList.add(truck_k4_3);
+        mapList.add(truck_k4_4);
+        //摩托车 科目四
+        mapList.add(mtc_k4);
+        mapList.add(mtc_k4_2);
+        mapList.add(mtc_k4_3);
+        mapList.add(mtc_k4_4);
+
+        return mapList;
+    }
+
+
+}
+
+
+

+ 75 - 0
zzjs-service/src/main/java/com/miaxis/question/domain/QuestionColumn.java

@@ -0,0 +1,75 @@
+package com.miaxis.question.domain;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.miaxis.common.annotation.Excel;
+import com.miaxis.common.core.domain.BaseEntity;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.miaxis.common.core.domain.BaseBusinessEntity;
+import lombok.Data;
+/**
+ * 题库分类对象 question_column
+ *
+ * @author miaxis
+ * @date 2023-11-03
+ */
+@Data
+@TableName("question_column")
+@ApiModel(value = "QuestionColumn", description = "题库分类对象 question_column")
+public class QuestionColumn extends BaseBusinessEntity{
+    private static final long serialVersionUID = 1L;
+
+    /**  ID */
+    @TableId(value = "id")
+    @ApiModelProperty(value = " ID")
+    private Long id;
+
+    /** 列ID */
+    @Excel(name = "列ID")
+    @TableField("column_id")
+    @ApiModelProperty(value = "列ID")
+    private Integer columnId;
+
+    /** 排序 */
+    @Excel(name = "排序")
+    @TableField("sort")
+    @ApiModelProperty(value = "排序")
+    private Integer sort;
+
+    /** 车型 */
+    @Excel(name = "车型")
+    @TableField("model")
+    @ApiModelProperty(value = "车型")
+    private String model;
+
+    /** 科目类型 */
+    @Excel(name = "科目类型")
+    @TableField("subject")
+    @ApiModelProperty(value = "科目类型")
+    private String subject;
+
+    /** 分类标题 */
+    @Excel(name = "分类标题")
+    @TableField("title")
+    @ApiModelProperty(value = "分类标题")
+    private String title;
+
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("sort", getSort())
+            .append("model", getModel())
+            .append("subject", getSubject())
+            .append("title", getTitle())
+            .append("createTime", getCreateTime())
+            .append("updateTime", getUpdateTime())
+            .toString();
+    }
+}

+ 28 - 4
zzjs-service/src/main/java/com/miaxis/question/domain/QuestionInfoKtNew.java

@@ -17,8 +17,8 @@ import lombok.Data;
  * @date 2022-04-08
  */
 @Data
-@TableName("question_info_kt_get")
-@ApiModel(value = "QuestionInfoKtGet", description = "获取快通题库对象 question_info_kt_get")
+@TableName("question_info_kt_new")
+@ApiModel(value = "QuestionInfoKtNew", description = "获取快通题库对象 question_info_kt_new")
 public class QuestionInfoKtNew extends BaseBusinessEntity{
     private static final long serialVersionUID = 1L;
 
@@ -154,8 +154,32 @@ public class QuestionInfoKtNew extends BaseBusinessEntity{
     @Excel(name = "科目")
     @TableField("subject")
     @ApiModelProperty(value = "科目")
-    private Long subject;
-
+    private String subject;
+
+
+    /** 章节ID */
+    @Excel(name = "章节ID")
+    @TableField("chapter_id")
+    @ApiModelProperty(value = "章节ID")
+    private Long chapterId;
+
+    /** 是否新规定 0否 1是 */
+    @Excel(name = "是否新规定 0否 1是")
+    @TableField("is_new")
+    @ApiModelProperty(value = "是否新规定 0否 1是")
+    private Long isNew;
+
+    /** 难度 */
+    @Excel(name = "难度")
+    @TableField("diff_degree")
+    @ApiModelProperty(value = "难度")
+    private Long diffDegree;
+
+    /** 错误率 */
+    @Excel(name = "错误率")
+    @TableField("error_rate")
+    @ApiModelProperty(value = "错误率")
+    private Long errorRate;
 
 
 }

+ 22 - 0
zzjs-service/src/main/java/com/miaxis/question/mapper/QuestionColumnMapper.java

@@ -0,0 +1,22 @@
+package com.miaxis.question.mapper;
+
+import java.util.List;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.miaxis.question.domain.QuestionColumn;
+
+/**
+ * 题库分类Mapper接口
+ *
+ * @author miaxis
+ * @date 2023-11-03
+ */
+public interface QuestionColumnMapper extends BaseMapper<QuestionColumn> {
+    /**
+     * 查询题库分类列表
+     *
+     * @param questionColumn 题库分类
+     * @return 题库分类集合
+     */
+    public List<QuestionColumn> selectQuestionColumnList(QuestionColumn questionColumn);
+
+}

+ 23 - 0
zzjs-service/src/main/java/com/miaxis/question/mapper/QuestionInfoKtNewMapper.java

@@ -0,0 +1,23 @@
+package com.miaxis.question.mapper;
+
+import java.util.List;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.miaxis.question.domain.QuestionInfoKtNew;
+
+/**
+ * 获取快通题库Mapper接口
+ *
+ * @author miaxis
+ * @date 2023-11-03
+ */
+public interface QuestionInfoKtNewMapper extends BaseMapper<QuestionInfoKtNew> {
+    /**
+     * 查询获取快通题库列表
+     *
+     * @param questionInfoKtNew 获取快通题库
+     * @return 获取快通题库集合
+     */
+    public List<QuestionInfoKtNew> selectQuestionInfoKtNewList(QuestionInfoKtNew questionInfoKtNew);
+
+    int selectQuestionInfoKtNewCount(QuestionInfoKtNew questionInfoKtNew);
+}

+ 21 - 0
zzjs-service/src/main/java/com/miaxis/question/service/IQuestionColumnService.java

@@ -0,0 +1,21 @@
+package com.miaxis.question.service;
+
+import java.util.List;
+import com.miaxis.question.domain.QuestionColumn;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * 题库分类Service接口
+ *
+ * @author miaxis
+ * @date 2023-11-03
+ */
+public interface IQuestionColumnService extends IService<QuestionColumn>{
+    /**
+     * 查询题库分类列表
+     *
+     * @param questionColumn 题库分类
+     * @return 题库分类集合
+     */
+    public List<QuestionColumn> selectQuestionColumnList(QuestionColumn questionColumn);
+}

+ 36 - 0
zzjs-service/src/main/java/com/miaxis/question/service/impl/QuestionColumnServiceImpl.java

@@ -0,0 +1,36 @@
+package com.miaxis.question.service.impl;
+
+import java.util.List;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.miaxis.common.utils.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.apache.commons.lang3.StringUtils;
+import com.miaxis.question.mapper.QuestionColumnMapper;
+import com.miaxis.question.domain.QuestionColumn;
+import com.miaxis.question.service.IQuestionColumnService;
+
+/**
+ * 题库分类Service业务层处理
+ *
+ * @author miaxis
+ * @date 2023-11-03
+ */
+@Service
+public class QuestionColumnServiceImpl extends ServiceImpl<QuestionColumnMapper, QuestionColumn> implements IQuestionColumnService {
+    @Autowired
+    private QuestionColumnMapper questionColumnMapper;
+
+    /**
+     * 查询题库分类列表
+     *
+     * @param questionColumn 题库分类
+     * @return 题库分类
+     */
+    @Override
+    public List<QuestionColumn> selectQuestionColumnList(QuestionColumn questionColumn){
+        return questionColumnMapper.selectQuestionColumnList(questionColumn);
+    }
+}

+ 33 - 0
zzjs-service/src/main/resources/mapper/question/QuestionColumnMapper.xml

@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.miaxis.question.mapper.QuestionColumnMapper">
+
+    <resultMap type="QuestionColumn" id="QuestionColumnResult">
+        <result property="id"    column="id"    />
+        <result property="columnId"    column="column_id"    />
+        <result property="sort"    column="sort"    />
+        <result property="model"    column="model"    />
+        <result property="subject"    column="subject"    />
+        <result property="title"    column="title"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateTime"    column="update_time"    />
+    </resultMap>
+
+    <sql id="selectQuestionColumnVo">
+        select * from question_column
+    </sql>
+
+    <select id="selectQuestionColumnList" parameterType="QuestionColumn" resultMap="QuestionColumnResult">
+        <include refid="selectQuestionColumnVo"/>
+        <where>
+            <if test="sort != null "> and sort = #{sort}</if>
+            <if test="columnId != null "> and column_id = #{columnId}</if>
+            <if test="model != null  and model != ''"> and model = #{model}</if>
+            <if test="subject != null  and subject != ''"> and subject = #{subject}</if>
+            <if test="title != null  and title != ''"> and title = #{title}</if>
+        </where>
+    </select>
+
+</mapper>

+ 107 - 0
zzjs-service/src/main/resources/mapper/question/QuestionInfoKtNewMapper.xml

@@ -0,0 +1,107 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.miaxis.question.mapper.QuestionInfoKtNewMapper">
+
+    <resultMap type="QuestionInfoKtNew" id="QuestionInfoKtNewResult">
+        <result property="id"    column="id"    />
+        <result property="idYdt"    column="id_ydt"    />
+        <result property="number"    column="number"    />
+        <result property="answer"    column="answer"    />
+        <result property="answerkeyword"    column="answerkeyword"    />
+        <result property="explainGif"    column="explain_gif"    />
+        <result property="explainJq"    column="explain_jq"    />
+        <result property="explainJs"    column="explain_js"    />
+        <result property="explainMp3"    column="explain_mp3"    />
+        <result property="image"    column="image"    />
+        <result property="imageYdt"    column="image_ydt"    />
+        <result property="issue"    column="issue"    />
+        <result property="opts"    column="opts"    />
+        <result property="skillkeyword"    column="skillkeyword"    />
+        <result property="titlekeyword"    column="titlekeyword"    />
+        <result property="issuemp3"    column="issuemp3"    />
+        <result property="answermp3"    column="answermp3"    />
+        <result property="explainjsmp3"    column="explainjsmp3"    />
+        <result property="model"    column="model"    />
+        <result property="columnAll"    column="column_all"    />
+        <result property="questionType"    column="question_type"    />
+        <result property="subject"    column="subject"    />
+        <result property="chapterId"    column="chapter_id"    />
+        <result property="isNew"    column="is_new"    />
+        <result property="diffDegree"    column="diff_degree"    />
+        <result property="errorRate"    column="error_rate"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateTime"    column="update_time"    />
+    </resultMap>
+
+    <sql id="selectQuestionInfoKtNewVo">
+        select * from question_info_kt_new
+    </sql>
+
+    <select id="selectQuestionInfoKtNewList" parameterType="QuestionInfoKtNew" resultMap="QuestionInfoKtNewResult">
+        <include refid="selectQuestionInfoKtNewVo"/>
+        <where>
+            <if test="idYdt != null "> and id_ydt = #{idYdt}</if>
+            <if test="number != null "> and number = #{number}</if>
+            <if test="answer != null  and answer != ''"> and answer = #{answer}</if>
+            <if test="answerkeyword != null  and answerkeyword != ''"> and answerkeyword = #{answerkeyword}</if>
+            <if test="explainGif != null  and explainGif != ''"> and explain_gif = #{explainGif}</if>
+            <if test="explainJq != null  and explainJq != ''"> and explain_jq = #{explainJq}</if>
+            <if test="explainJs != null  and explainJs != ''"> and explain_js = #{explainJs}</if>
+            <if test="explainMp3 != null  and explainMp3 != ''"> and explain_mp3 = #{explainMp3}</if>
+            <if test="image != null  and image != ''"> and image = #{image}</if>
+            <if test="imageYdt != null  and imageYdt != ''"> and image_ydt = #{imageYdt}</if>
+            <if test="issue != null  and issue != ''"> and issue = #{issue}</if>
+            <if test="opts != null  and opts != ''"> and opts = #{opts}</if>
+            <if test="skillkeyword != null  and skillkeyword != ''"> and skillkeyword = #{skillkeyword}</if>
+            <if test="titlekeyword != null  and titlekeyword != ''"> and titlekeyword = #{titlekeyword}</if>
+            <if test="issuemp3 != null  and issuemp3 != ''"> and issuemp3 = #{issuemp3}</if>
+            <if test="answermp3 != null  and answermp3 != ''"> and answermp3 = #{answermp3}</if>
+            <if test="explainjsmp3 != null  and explainjsmp3 != ''"> and explainjsmp3 = #{explainjsmp3}</if>
+            <if test="model != null  and model != ''"> and model = #{model}</if>
+            <if test="columnAll != null  and columnAll != ''"> and column_all = #{columnAll}</if>
+            <if test="questionType != null "> and question_type = #{questionType}</if>
+            <if test="subject != null  and subject != ''"> and subject = #{subject}</if>
+            <if test="chapterId != null "> and chapter_id = #{chapterId}</if>
+            <if test="isNew != null "> and is_new = #{isNew}</if>
+            <if test="diffDegree != null "> and diff_degree = #{diffDegree}</if>
+            <if test="errorRate != null "> and error_rate = #{errorRate}</if>
+        </where>
+    </select>
+
+
+    <select id="selectQuestionInfoKtNewCount" parameterType="QuestionInfoKtNew" resultType="int">
+        select count(1) from question_info_kt_new
+        <where>
+            <if test="id != null "> and id = #{id}</if>
+            <if test="idYdt != null "> and id_ydt = #{idYdt}</if>
+            <if test="number != null "> and number = #{number}</if>
+            <if test="answer != null  and answer != ''"> and answer = #{answer}</if>
+            <if test="answerkeyword != null  and answerkeyword != ''"> and answerkeyword = #{answerkeyword}</if>
+            <if test="explainGif != null  and explainGif != ''"> and explain_gif = #{explainGif}</if>
+            <if test="explainJq != null  and explainJq != ''"> and explain_jq = #{explainJq}</if>
+            <if test="explainJs != null  and explainJs != ''"> and explain_js = #{explainJs}</if>
+            <if test="explainMp3 != null  and explainMp3 != ''"> and explain_mp3 = #{explainMp3}</if>
+            <if test="image != null  and image != ''"> and image = #{image}</if>
+            <if test="imageYdt != null  and imageYdt != ''"> and image_ydt = #{imageYdt}</if>
+            <if test="issue != null  and issue != ''"> and issue = #{issue}</if>
+            <if test="opts != null  and opts != ''"> and opts = #{opts}</if>
+            <if test="skillkeyword != null  and skillkeyword != ''"> and skillkeyword = #{skillkeyword}</if>
+            <if test="titlekeyword != null  and titlekeyword != ''"> and titlekeyword = #{titlekeyword}</if>
+            <if test="issuemp3 != null  and issuemp3 != ''"> and issuemp3 = #{issuemp3}</if>
+            <if test="answermp3 != null  and answermp3 != ''"> and answermp3 = #{answermp3}</if>
+            <if test="explainjsmp3 != null  and explainjsmp3 != ''"> and explainjsmp3 = #{explainjsmp3}</if>
+            <if test="model != null  and model != ''"> and model = #{model}</if>
+            <if test="columnAll != null  and columnAll != ''"> and column_all = #{columnAll}</if>
+            <if test="questionType != null "> and question_type = #{questionType}</if>
+            <if test="subject != null  and subject != ''"> and subject = #{subject}</if>
+            <if test="chapterId != null "> and chapter_id = #{chapterId}</if>
+            <if test="isNew != null "> and is_new = #{isNew}</if>
+            <if test="diffDegree != null "> and diff_degree = #{diffDegree}</if>
+            <if test="errorRate != null "> and error_rate = #{errorRate}</if>
+        </where>
+    </select>
+
+
+</mapper>