|
@@ -3,12 +3,14 @@ package com.zhongzheng.modules.bank.service.impl;
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
import cn.hutool.core.lang.Validator;
|
|
import cn.hutool.core.lang.Validator;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
|
+import cn.hutool.extra.tokenizer.Word;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.zhongzheng.common.constant.Constants;
|
|
import com.zhongzheng.common.constant.Constants;
|
|
|
import com.zhongzheng.common.core.domain.entity.SysUser;
|
|
import com.zhongzheng.common.core.domain.entity.SysUser;
|
|
|
import com.zhongzheng.common.core.redis.RedisCache;
|
|
import com.zhongzheng.common.core.redis.RedisCache;
|
|
|
import com.zhongzheng.common.exception.CustomException;
|
|
import com.zhongzheng.common.exception.CustomException;
|
|
|
import com.zhongzheng.common.utils.DateUtils;
|
|
import com.zhongzheng.common.utils.DateUtils;
|
|
|
|
|
+import com.zhongzheng.common.utils.SecurityUtils;
|
|
|
import com.zhongzheng.common.utils.ServletUtils;
|
|
import com.zhongzheng.common.utils.ServletUtils;
|
|
|
import com.zhongzheng.modules.bank.bo.*;
|
|
import com.zhongzheng.modules.bank.bo.*;
|
|
|
import com.zhongzheng.modules.bank.domain.ExamQuestion;
|
|
import com.zhongzheng.modules.bank.domain.ExamQuestion;
|
|
@@ -33,6 +35,13 @@ import com.zhongzheng.modules.exam.service.IExamKnowledgeService;
|
|
|
import com.zhongzheng.modules.goods.bo.GoodsQueryBo;
|
|
import com.zhongzheng.modules.goods.bo.GoodsQueryBo;
|
|
|
import com.zhongzheng.modules.goods.vo.GoodsUserQuestionVo;
|
|
import com.zhongzheng.modules.goods.vo.GoodsUserQuestionVo;
|
|
|
import io.micrometer.core.lang.NonNull;
|
|
import io.micrometer.core.lang.NonNull;
|
|
|
|
|
+import org.apache.poi.hwpf.extractor.WordExtractor;
|
|
|
|
|
+import org.apache.poi.ooxml.POIXMLDocument;
|
|
|
|
|
+import org.apache.poi.ooxml.extractor.POIXMLTextExtractor;
|
|
|
|
|
+import org.apache.poi.openxml4j.opc.OPCPackage;
|
|
|
|
|
+import org.apache.poi.xwpf.extractor.XWPFWordExtractor;
|
|
|
|
|
+import org.apache.poi.xwpf.usermodel.XWPFDocument;
|
|
|
|
|
+import org.apache.poi.xwpf.usermodel.XWPFParagraph;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
@@ -40,7 +49,10 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.github.pagehelper.Page;
|
|
import com.github.pagehelper.Page;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
+import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
|
|
|
|
+import java.io.IOException;
|
|
|
|
|
+import java.io.InputStream;
|
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
import java.util.concurrent.TimeUnit;
|
|
import java.util.concurrent.TimeUnit;
|
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
@@ -287,6 +299,7 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
|
|
|
bAddBo.setSubjectId(subjectId);
|
|
bAddBo.setSubjectId(subjectId);
|
|
|
bList.add(bAddBo);
|
|
bList.add(bAddBo);
|
|
|
addBo.setExamKnowledgeBusinessAddBoList(bList);
|
|
addBo.setExamKnowledgeBusinessAddBoList(bList);
|
|
|
|
|
+ addBo.setStatus(1);
|
|
|
knowledgeId = iExamKnowledgeService.insertByImportQuestionAddBo(addBo);
|
|
knowledgeId = iExamKnowledgeService.insertByImportQuestionAddBo(addBo);
|
|
|
if(Validator.isEmpty(knowledgeId)||knowledgeId==0){
|
|
if(Validator.isEmpty(knowledgeId)||knowledgeId==0){
|
|
|
// errorLog+=knowledge+"-该知识点不存在\n";
|
|
// errorLog+=knowledge+"-该知识点不存在\n";
|
|
@@ -294,7 +307,9 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
|
|
|
errorList.add(question);
|
|
errorList.add(question);
|
|
|
continue;
|
|
continue;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+ //新增进入redis
|
|
|
|
|
+ String key = "KNO_"+knowledge;
|
|
|
|
|
+ redisCache.setCacheObject(key,knowledgeId,3, TimeUnit.MINUTES);//3分钟
|
|
|
}
|
|
}
|
|
|
kIdList.add(knowledgeId);
|
|
kIdList.add(knowledgeId);
|
|
|
}
|
|
}
|
|
@@ -323,12 +338,709 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
|
|
|
return baseMapper.listGoodsUserQuestionVo(bo);
|
|
return baseMapper.listGoodsUserQuestionVo(bo);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ private String dealTxt(String txt){
|
|
|
|
|
+ txt = txt.trim();
|
|
|
|
|
+ if(txt.startsWith("\\t")){
|
|
|
|
|
+ txt = txt.replace("\\t", "");
|
|
|
|
|
+ }
|
|
|
|
|
+ if(txt.startsWith("\t")){
|
|
|
|
|
+ txt = txt.replace("\t", "");
|
|
|
|
|
+ }
|
|
|
|
|
+ return txt;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public String importWordQuestion(MultipartFile file, Long eduId, Long projectId, Long businessId, Long subjectId) {
|
|
|
|
|
+ String errorLog = ""; //错误提示
|
|
|
|
|
+ String buffer = "";
|
|
|
|
|
+ String importNo = ServletUtils.getEncoded("IMPORT");
|
|
|
|
|
+ try{
|
|
|
|
|
+ String path = file.getOriginalFilename();
|
|
|
|
|
+ if (path.endsWith(".doc")) {
|
|
|
|
|
+ throw new CustomException("不支持doc格式");
|
|
|
|
|
+ /*InputStream is = file.getInputStream();
|
|
|
|
|
+ WordExtractor wordExtractor = new WordExtractor(is);
|
|
|
|
|
+ buffer = wordExtractor.getText();
|
|
|
|
|
+ wordExtractor.close();*/
|
|
|
|
|
+ } else if (path.endsWith("docx")) {
|
|
|
|
|
+ InputStream is = file.getInputStream();
|
|
|
|
|
+ XWPFDocument doc = new XWPFDocument(is);
|
|
|
|
|
+ // XWPFWordExtractor extractor = new XWPFWordExtractor(doc);
|
|
|
|
|
+ List<XWPFParagraph> paragraphList = doc.getParagraphs();
|
|
|
|
|
+ int type = -1; //题目类型
|
|
|
|
|
+ boolean isOption = false; //是否判断题
|
|
|
|
|
+ List<QuestionChildAddBo> optionsList =new ArrayList<>(); //题目选项
|
|
|
|
|
+ String content = ""; //每行正文
|
|
|
|
|
+ String qContent = ""; //题目正文
|
|
|
|
|
+ String answerQuestion = null; //答案
|
|
|
|
|
+ String analysisContent = ""; //解析文本
|
|
|
|
|
+ int i = 0;
|
|
|
|
|
+ int index = 1; //题目序列号
|
|
|
|
|
+ List<QuestionBusinessAddBo> businessList = new ArrayList<>();
|
|
|
|
|
+ QuestionBusinessAddBo questionBusinessAddBo = new QuestionBusinessAddBo();
|
|
|
|
|
+ questionBusinessAddBo.setEducationTypeId(eduId);
|
|
|
|
|
+ questionBusinessAddBo.setProjectId(projectId);
|
|
|
|
|
+ questionBusinessAddBo.setBusinessId(businessId);
|
|
|
|
|
+ questionBusinessAddBo.setSubjectId(subjectId);
|
|
|
|
|
+ businessList.add(questionBusinessAddBo);
|
|
|
|
|
+ //遍历正文
|
|
|
|
|
+ while (i<paragraphList.size())
|
|
|
|
|
+ {
|
|
|
|
|
+ content = paragraphList.get(i).getText();
|
|
|
|
|
+ if(Validator.isNotEmpty(content)){
|
|
|
|
|
+ content =dealTxt(content);
|
|
|
|
|
+ if(content.startsWith("注意事项")){
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ //第一个选项
|
|
|
|
|
+ if(content.startsWith("A.")){
|
|
|
|
|
+ isOption = true;
|
|
|
|
|
+ QuestionChildAddBo bo1 = new QuestionChildAddBo();
|
|
|
|
|
+ int j = i+1;
|
|
|
|
|
+ String q_content = content; //题目正文
|
|
|
|
|
+ while (j<paragraphList.size())
|
|
|
|
|
+ {
|
|
|
|
|
+ String tempTxt = dealTxt(paragraphList.get(j).getText());
|
|
|
|
|
+ if(Validator.isEmpty(tempTxt)||tempTxt.startsWith("B.")){
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ q_content+=tempTxt;
|
|
|
|
|
+ j++;
|
|
|
|
|
+ }
|
|
|
|
|
+ bo1.setOptionsId(1L);
|
|
|
|
|
+ bo1.setContent(q_content.replace("A.", ""));
|
|
|
|
|
+ optionsList.add(bo1);
|
|
|
|
|
+ i = j-1; //底部会再执行加回来
|
|
|
|
|
+ }
|
|
|
|
|
+ //第二个选项
|
|
|
|
|
+ else if(content.startsWith("B.")){
|
|
|
|
|
+ QuestionChildAddBo bo1 = new QuestionChildAddBo();
|
|
|
|
|
+ int j = i+1;
|
|
|
|
|
+ String q_content =content; //题目正文
|
|
|
|
|
+ while (j<paragraphList.size())
|
|
|
|
|
+ {
|
|
|
|
|
+ String tempTxt = dealTxt(paragraphList.get(j).getText());
|
|
|
|
|
+ if(Validator.isEmpty(tempTxt)||tempTxt.startsWith("C.")){
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ q_content+=tempTxt;
|
|
|
|
|
+ j++;
|
|
|
|
|
+ }
|
|
|
|
|
+ bo1.setOptionsId(2L);
|
|
|
|
|
+ bo1.setContent(q_content.replace("B.", ""));
|
|
|
|
|
+ optionsList.add(bo1);
|
|
|
|
|
+ i = j-1; //底部会再执行加回来
|
|
|
|
|
+ }
|
|
|
|
|
+ //第三个选项
|
|
|
|
|
+ else if(content.startsWith("C.")){
|
|
|
|
|
+ QuestionChildAddBo bo1 = new QuestionChildAddBo();
|
|
|
|
|
+ int j = i+1;
|
|
|
|
|
+ String q_content = content; //题目正文
|
|
|
|
|
+ while (j<paragraphList.size())
|
|
|
|
|
+ {
|
|
|
|
|
+ String tempTxt = dealTxt(paragraphList.get(j).getText());
|
|
|
|
|
+ if(Validator.isEmpty(tempTxt)||tempTxt.startsWith("D.")){
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ q_content+=tempTxt;
|
|
|
|
|
+ j++;
|
|
|
|
|
+ }
|
|
|
|
|
+ bo1.setOptionsId(3L);
|
|
|
|
|
+ bo1.setContent(q_content.replace("C.", ""));
|
|
|
|
|
+ optionsList.add(bo1);
|
|
|
|
|
+ i = j-1; //底部会再执行加回来
|
|
|
|
|
+ }
|
|
|
|
|
+ //第四个选项
|
|
|
|
|
+ else if(content.startsWith("D.")){
|
|
|
|
|
+ QuestionChildAddBo bo1 = new QuestionChildAddBo();
|
|
|
|
|
+ int j = i+1;
|
|
|
|
|
+ String q_content = content; //题目正文
|
|
|
|
|
+ while (j<paragraphList.size())
|
|
|
|
|
+ {
|
|
|
|
|
+ String tempTxt = dealTxt(paragraphList.get(j).getText());
|
|
|
|
|
+ if(Validator.isEmpty(tempTxt)||tempTxt.startsWith("E.")||tempTxt.startsWith("正确答案")){
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ q_content+=tempTxt;
|
|
|
|
|
+ j++;
|
|
|
|
|
+ }
|
|
|
|
|
+ bo1.setOptionsId(4L);
|
|
|
|
|
+ bo1.setContent(q_content.replace("D.", ""));
|
|
|
|
|
+ optionsList.add(bo1);
|
|
|
|
|
+ i = j-1; //底部会再执行加回来
|
|
|
|
|
+ }
|
|
|
|
|
+ //第五个选项
|
|
|
|
|
+ else if(content.startsWith("E.")){
|
|
|
|
|
+ QuestionChildAddBo bo1 = new QuestionChildAddBo();
|
|
|
|
|
+ int j = i+1;
|
|
|
|
|
+ String q_content = content; //题目正文
|
|
|
|
|
+ while (j<paragraphList.size())
|
|
|
|
|
+ {
|
|
|
|
|
+ String tempTxt = dealTxt(paragraphList.get(j).getText());
|
|
|
|
|
+ if(Validator.isEmpty(tempTxt)||tempTxt.startsWith("F.")||tempTxt.startsWith("正确答案")){
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ q_content+=tempTxt;
|
|
|
|
|
+ j++;
|
|
|
|
|
+ }
|
|
|
|
|
+ bo1.setOptionsId(5L);
|
|
|
|
|
+ bo1.setContent(q_content.replace("E.", ""));
|
|
|
|
|
+ optionsList.add(bo1);
|
|
|
|
|
+ i = j-1; //底部会再执行加回来
|
|
|
|
|
+ }
|
|
|
|
|
+ //第六个选项
|
|
|
|
|
+ else if(content.startsWith("F.")){
|
|
|
|
|
+ QuestionChildAddBo bo1 = new QuestionChildAddBo();
|
|
|
|
|
+ int j = i+1;
|
|
|
|
|
+ String q_content = content; //题目正文
|
|
|
|
|
+ while (j<paragraphList.size())
|
|
|
|
|
+ {
|
|
|
|
|
+ String tempTxt = dealTxt(paragraphList.get(j).getText());
|
|
|
|
|
+ if(Validator.isEmpty(tempTxt)||tempTxt.startsWith("G.")||tempTxt.startsWith("正确答案")){
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ q_content+=tempTxt;
|
|
|
|
|
+ j++;
|
|
|
|
|
+ }
|
|
|
|
|
+ bo1.setOptionsId(6L);
|
|
|
|
|
+ bo1.setContent(q_content.replace("F.", ""));
|
|
|
|
|
+ optionsList.add(bo1);
|
|
|
|
|
+ i = j-1; //底部会再执行加回来
|
|
|
|
|
+ }
|
|
|
|
|
+ //答案和题型
|
|
|
|
|
+ else if(content.startsWith("正确答案")){
|
|
|
|
|
+ answerQuestion = content.replace("正确答案:", "");
|
|
|
|
|
+ if(Validator.isEmpty(answerQuestion)){
|
|
|
|
|
+ throw new CustomException("正确答案错误");
|
|
|
|
|
+ }
|
|
|
|
|
+ if(isOption){
|
|
|
|
|
+ //选择题
|
|
|
|
|
+ answerQuestion = dealImportAnswer(answerQuestion);
|
|
|
|
|
+ if(answerQuestion.length()>1){
|
|
|
|
|
+ type = 2; //多选
|
|
|
|
|
+ }else{
|
|
|
|
|
+ type = 1; //单选
|
|
|
|
|
+ }
|
|
|
|
|
+ }else{
|
|
|
|
|
+ if("正确".equals(answerQuestion)){
|
|
|
|
|
+ answerQuestion = "1";
|
|
|
|
|
+ type = 3; //判断
|
|
|
|
|
+ }
|
|
|
|
|
+ else if("错误".equals(answerQuestion)){
|
|
|
|
|
+ answerQuestion = "0";
|
|
|
|
|
+ type = 3;
|
|
|
|
|
+ }else{
|
|
|
|
|
+ answerQuestion = null;
|
|
|
|
|
+ type = 5; //简答题
|
|
|
|
|
+ int j = i+1;
|
|
|
|
|
+ String q_content = content; //简答题
|
|
|
|
|
+
|
|
|
|
|
+ while (j<paragraphList.size())
|
|
|
|
|
+ {
|
|
|
|
|
+ String tempTxt = paragraphList.get(j).getText();
|
|
|
|
|
+ if(checkKey(tempTxt)){
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ q_content+=tempTxt;
|
|
|
|
|
+ j++;
|
|
|
|
|
+ }
|
|
|
|
|
+ q_content = q_content.replace("正确答案:", "");
|
|
|
|
|
+ QuestionChildAddBo bo1 = null;
|
|
|
|
|
+ if(optionsList.size()==0){
|
|
|
|
|
+ bo1 = new QuestionChildAddBo();
|
|
|
|
|
+ optionsList.add(bo1);
|
|
|
|
|
+ }
|
|
|
|
|
+ bo1 = optionsList.get(0);
|
|
|
|
|
+ bo1.setOptionsId(1L);
|
|
|
|
|
+ bo1.setAnalysisContent(q_content);
|
|
|
|
|
+ i = j-1; //底部会再执行加回来
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ //解题思路
|
|
|
|
|
+ else if(content.startsWith("解题思路:")){
|
|
|
|
|
+ int j = i+1;
|
|
|
|
|
+ String q_content = content; //解题思路
|
|
|
|
|
+ while (j<paragraphList.size())
|
|
|
|
|
+ {
|
|
|
|
|
+ String tempTxt = dealTxt(paragraphList.get(j).getText());
|
|
|
|
|
+ if(checkKey(tempTxt)){
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ q_content+=tempTxt;
|
|
|
|
|
+ j++;
|
|
|
|
|
+ }
|
|
|
|
|
+ analysisContent+=q_content;
|
|
|
|
|
+ i = j-1; //底部会再执行加回来
|
|
|
|
|
+ }
|
|
|
|
|
+ //考查考点
|
|
|
|
|
+ else if(content.startsWith("考查考点:")){
|
|
|
|
|
+ int j = i+1;
|
|
|
|
|
+ String q_content = content; //考查考点
|
|
|
|
|
+ while (j<paragraphList.size())
|
|
|
|
|
+ {
|
|
|
|
|
+ String tempTxt = dealTxt(paragraphList.get(j).getText());
|
|
|
|
|
+ if(checkKey(tempTxt)){
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ q_content+=tempTxt;
|
|
|
|
|
+ j++;
|
|
|
|
|
+ }
|
|
|
|
|
+ analysisContent = analysisContent + "\r\n" +q_content;
|
|
|
|
|
+ i = j-1; //底部会再执行加回来
|
|
|
|
|
+ }
|
|
|
|
|
+ //老师解答
|
|
|
|
|
+ else if(content.startsWith("老师解答:")){
|
|
|
|
|
+ int j = i+1;
|
|
|
|
|
+ String q_content = content; //考查考点
|
|
|
|
|
+ while (j<paragraphList.size())
|
|
|
|
|
+ {
|
|
|
|
|
+ String tempTxt = dealTxt(paragraphList.get(j).getText());
|
|
|
|
|
+ if(checkKey(tempTxt)){
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ q_content+=tempTxt;
|
|
|
|
|
+ j++;
|
|
|
|
|
+ }
|
|
|
|
|
+ analysisContent = analysisContent + "\r\n" +q_content;
|
|
|
|
|
+ i = j-1; //底部会再执行加回来
|
|
|
|
|
+ }
|
|
|
|
|
+ //问答题问题
|
|
|
|
|
+ else if(content.startsWith("【问题】")){
|
|
|
|
|
+ //多个问题合在一起
|
|
|
|
|
+ int j = i+1;
|
|
|
|
|
+ String q_content = content; //问题
|
|
|
|
|
+ while (j<paragraphList.size())
|
|
|
|
|
+ {
|
|
|
|
|
+ String tempTxt = dealTxt(paragraphList.get(j).getText());
|
|
|
|
|
+ if(checkKey(tempTxt)){
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ q_content+=tempTxt;
|
|
|
|
|
+ j++;
|
|
|
|
|
+ }
|
|
|
|
|
+ q_content = q_content.replace("【问题】", "");
|
|
|
|
|
+ QuestionChildAddBo bo1 = null;
|
|
|
|
|
+ if(optionsList.size()==0){
|
|
|
|
|
+ bo1 = new QuestionChildAddBo();
|
|
|
|
|
+ optionsList.add(bo1);
|
|
|
|
|
+ }
|
|
|
|
|
+ bo1 = optionsList.get(0);
|
|
|
|
|
+ bo1.setOptionsId(1L);
|
|
|
|
|
+ bo1.setContent(q_content);
|
|
|
|
|
+ i = j-1; //底部会再执行加回来
|
|
|
|
|
+ }
|
|
|
|
|
+ //题目正文
|
|
|
|
|
+ else{
|
|
|
|
|
+ qContent += content;
|
|
|
|
|
+ }
|
|
|
|
|
+ }else{
|
|
|
|
|
+ qContent = removeNo(qContent);
|
|
|
|
|
+ if(Validator.isEmpty(qContent)){
|
|
|
|
|
+ errorLog+="第"+index+"条题目内容空白\n";
|
|
|
|
|
+ i++;
|
|
|
|
|
+ continue;
|
|
|
|
|
+ }
|
|
|
|
|
+ QuestionAddBo bo = new QuestionAddBo();
|
|
|
|
|
+ if(type==-1){
|
|
|
|
|
+ errorLog+="第"+index+"条题目选项错误\n";
|
|
|
|
|
+ i++;
|
|
|
|
|
+ continue;
|
|
|
|
|
+ }
|
|
|
|
|
+ bo.setType(type);
|
|
|
|
|
+
|
|
|
|
|
+ bo.setStatus(1);
|
|
|
|
|
+ bo.setContent(qContent);
|
|
|
|
|
+ bo.setAnswerQuestion(answerQuestion);
|
|
|
|
|
+ bo.setAnalysisContent(analysisContent);
|
|
|
|
|
+ bo.setOptionsList(optionsList);
|
|
|
|
|
+ bo.setCreateBy(SecurityUtils.getUsername());
|
|
|
|
|
+ bo.setImportNo(importNo);
|
|
|
|
|
+ bo.setPublishStatus(1);
|
|
|
|
|
+ bo.setBusinessList(businessList);
|
|
|
|
|
+ insertByAddBoImport(bo,i);
|
|
|
|
|
+
|
|
|
|
|
+ //清空数据
|
|
|
|
|
+ isOption = false;
|
|
|
|
|
+ type = -1;
|
|
|
|
|
+ qContent = "";
|
|
|
|
|
+ index++;
|
|
|
|
|
+ answerQuestion = null;
|
|
|
|
|
+ analysisContent = "";
|
|
|
|
|
+ optionsList.clear();
|
|
|
|
|
+ }
|
|
|
|
|
+ i++;
|
|
|
|
|
+ }
|
|
|
|
|
+ // buffer = extractor.getText();
|
|
|
|
|
+ //extractor.close();
|
|
|
|
|
+
|
|
|
|
|
+ } else {
|
|
|
|
|
+ throw new CustomException("请导入word文件!");
|
|
|
|
|
+ }
|
|
|
|
|
+ }catch (IOException e){
|
|
|
|
|
+ System.out.println("此文件不是word文件!A"+e.getMessage()+e.toString()+e.getLocalizedMessage());
|
|
|
|
|
+ }
|
|
|
|
|
+ return errorLog;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public List<QuestionAddBo> importWordQuestionList(MultipartFile file, Long eduId, Long projectId, Long businessId, Long subjectId) {
|
|
|
|
|
+ List<QuestionAddBo> list = new ArrayList<>();
|
|
|
|
|
+ String errorLog = ""; //错误提示
|
|
|
|
|
+ String buffer = "";
|
|
|
|
|
+ String importNo = ServletUtils.getEncoded("IMPORT");
|
|
|
|
|
+ try{
|
|
|
|
|
+ String path = file.getOriginalFilename();
|
|
|
|
|
+ if (path.endsWith(".doc")) {
|
|
|
|
|
+ throw new CustomException("不支持doc格式");
|
|
|
|
|
+ /*InputStream is = file.getInputStream();
|
|
|
|
|
+ WordExtractor wordExtractor = new WordExtractor(is);
|
|
|
|
|
+ buffer = wordExtractor.getText();
|
|
|
|
|
+ wordExtractor.close();*/
|
|
|
|
|
+ } else if (path.endsWith("docx")) {
|
|
|
|
|
+ InputStream is = file.getInputStream();
|
|
|
|
|
+ XWPFDocument doc = new XWPFDocument(is);
|
|
|
|
|
+ // XWPFWordExtractor extractor = new XWPFWordExtractor(doc);
|
|
|
|
|
+ List<XWPFParagraph> paragraphList = doc.getParagraphs();
|
|
|
|
|
+ int type = -1; //题目类型
|
|
|
|
|
+ boolean isOption = false; //是否判断题
|
|
|
|
|
+ List<QuestionChildAddBo> optionsList =new ArrayList<>(); //题目选项
|
|
|
|
|
+ String content = ""; //每行正文
|
|
|
|
|
+ String qContent = ""; //题目正文
|
|
|
|
|
+ String answerQuestion = null; //答案
|
|
|
|
|
+ String analysisContent = ""; //解析文本
|
|
|
|
|
+ int i = 0;
|
|
|
|
|
+ int index = 1; //题目序列号
|
|
|
|
|
+ List<QuestionBusinessAddBo> businessList = new ArrayList<>();
|
|
|
|
|
+ QuestionBusinessAddBo questionBusinessAddBo = new QuestionBusinessAddBo();
|
|
|
|
|
+ questionBusinessAddBo.setEducationTypeId(eduId);
|
|
|
|
|
+ questionBusinessAddBo.setProjectId(projectId);
|
|
|
|
|
+ questionBusinessAddBo.setBusinessId(businessId);
|
|
|
|
|
+ questionBusinessAddBo.setSubjectId(subjectId);
|
|
|
|
|
+ businessList.add(questionBusinessAddBo);
|
|
|
|
|
+ //遍历正文
|
|
|
|
|
+ while (i<paragraphList.size())
|
|
|
|
|
+ {
|
|
|
|
|
+ content = paragraphList.get(i).getText();
|
|
|
|
|
+ if(Validator.isNotEmpty(content)){
|
|
|
|
|
+ content =dealTxt(content);
|
|
|
|
|
+ if(content.startsWith("注意事项")){
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ //第一个选项
|
|
|
|
|
+ if(content.startsWith("A.")){
|
|
|
|
|
+ isOption = true;
|
|
|
|
|
+ QuestionChildAddBo bo1 = new QuestionChildAddBo();
|
|
|
|
|
+ int j = i+1;
|
|
|
|
|
+ String q_content = content; //题目正文
|
|
|
|
|
+ while (j<paragraphList.size())
|
|
|
|
|
+ {
|
|
|
|
|
+ String tempTxt = dealTxt(paragraphList.get(j).getText());
|
|
|
|
|
+ if(Validator.isEmpty(tempTxt)||tempTxt.startsWith("B.")){
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ q_content+=tempTxt;
|
|
|
|
|
+ j++;
|
|
|
|
|
+ }
|
|
|
|
|
+ bo1.setOptionsId(1L);
|
|
|
|
|
+ bo1.setContent(q_content.replace("A.", ""));
|
|
|
|
|
+ optionsList.add(bo1);
|
|
|
|
|
+ i = j-1; //底部会再执行加回来
|
|
|
|
|
+ }
|
|
|
|
|
+ //第二个选项
|
|
|
|
|
+ else if(content.startsWith("B.")){
|
|
|
|
|
+ QuestionChildAddBo bo1 = new QuestionChildAddBo();
|
|
|
|
|
+ int j = i+1;
|
|
|
|
|
+ String q_content =content; //题目正文
|
|
|
|
|
+ while (j<paragraphList.size())
|
|
|
|
|
+ {
|
|
|
|
|
+ String tempTxt = dealTxt(paragraphList.get(j).getText());
|
|
|
|
|
+ if(Validator.isEmpty(tempTxt)||tempTxt.startsWith("C.")){
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ q_content+=tempTxt;
|
|
|
|
|
+ j++;
|
|
|
|
|
+ }
|
|
|
|
|
+ bo1.setOptionsId(2L);
|
|
|
|
|
+ bo1.setContent(q_content.replace("B.", ""));
|
|
|
|
|
+ optionsList.add(bo1);
|
|
|
|
|
+ i = j-1; //底部会再执行加回来
|
|
|
|
|
+ }
|
|
|
|
|
+ //第三个选项
|
|
|
|
|
+ else if(content.startsWith("C.")){
|
|
|
|
|
+ QuestionChildAddBo bo1 = new QuestionChildAddBo();
|
|
|
|
|
+ int j = i+1;
|
|
|
|
|
+ String q_content = content; //题目正文
|
|
|
|
|
+ while (j<paragraphList.size())
|
|
|
|
|
+ {
|
|
|
|
|
+ String tempTxt = dealTxt(paragraphList.get(j).getText());
|
|
|
|
|
+ if(Validator.isEmpty(tempTxt)||tempTxt.startsWith("D.")){
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ q_content+=tempTxt;
|
|
|
|
|
+ j++;
|
|
|
|
|
+ }
|
|
|
|
|
+ bo1.setOptionsId(3L);
|
|
|
|
|
+ bo1.setContent(q_content.replace("C.", ""));
|
|
|
|
|
+ optionsList.add(bo1);
|
|
|
|
|
+ i = j-1; //底部会再执行加回来
|
|
|
|
|
+ }
|
|
|
|
|
+ //第四个选项
|
|
|
|
|
+ else if(content.startsWith("D.")){
|
|
|
|
|
+ QuestionChildAddBo bo1 = new QuestionChildAddBo();
|
|
|
|
|
+ int j = i+1;
|
|
|
|
|
+ String q_content = content; //题目正文
|
|
|
|
|
+ while (j<paragraphList.size())
|
|
|
|
|
+ {
|
|
|
|
|
+ String tempTxt = dealTxt(paragraphList.get(j).getText());
|
|
|
|
|
+ if(Validator.isEmpty(tempTxt)||tempTxt.startsWith("E.")||tempTxt.startsWith("正确答案")){
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ q_content+=tempTxt;
|
|
|
|
|
+ j++;
|
|
|
|
|
+ }
|
|
|
|
|
+ bo1.setOptionsId(4L);
|
|
|
|
|
+ bo1.setContent(q_content.replace("D.", ""));
|
|
|
|
|
+ optionsList.add(bo1);
|
|
|
|
|
+ i = j-1; //底部会再执行加回来
|
|
|
|
|
+ }
|
|
|
|
|
+ //第五个选项
|
|
|
|
|
+ else if(content.startsWith("E.")){
|
|
|
|
|
+ QuestionChildAddBo bo1 = new QuestionChildAddBo();
|
|
|
|
|
+ int j = i+1;
|
|
|
|
|
+ String q_content = content; //题目正文
|
|
|
|
|
+ while (j<paragraphList.size())
|
|
|
|
|
+ {
|
|
|
|
|
+ String tempTxt = dealTxt(paragraphList.get(j).getText());
|
|
|
|
|
+ if(Validator.isEmpty(tempTxt)||tempTxt.startsWith("F.")||tempTxt.startsWith("正确答案")){
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ q_content+=tempTxt;
|
|
|
|
|
+ j++;
|
|
|
|
|
+ }
|
|
|
|
|
+ bo1.setOptionsId(5L);
|
|
|
|
|
+ bo1.setContent(q_content.replace("E.", ""));
|
|
|
|
|
+ optionsList.add(bo1);
|
|
|
|
|
+ i = j-1; //底部会再执行加回来
|
|
|
|
|
+ }
|
|
|
|
|
+ //第六个选项
|
|
|
|
|
+ else if(content.startsWith("F.")){
|
|
|
|
|
+ QuestionChildAddBo bo1 = new QuestionChildAddBo();
|
|
|
|
|
+ int j = i+1;
|
|
|
|
|
+ String q_content = content; //题目正文
|
|
|
|
|
+ while (j<paragraphList.size())
|
|
|
|
|
+ {
|
|
|
|
|
+ String tempTxt = dealTxt(paragraphList.get(j).getText());
|
|
|
|
|
+ if(Validator.isEmpty(tempTxt)||tempTxt.startsWith("G.")||tempTxt.startsWith("正确答案")){
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ q_content+=tempTxt;
|
|
|
|
|
+ j++;
|
|
|
|
|
+ }
|
|
|
|
|
+ bo1.setOptionsId(6L);
|
|
|
|
|
+ bo1.setContent(q_content.replace("F.", ""));
|
|
|
|
|
+ optionsList.add(bo1);
|
|
|
|
|
+ i = j-1; //底部会再执行加回来
|
|
|
|
|
+ }
|
|
|
|
|
+ //答案和题型
|
|
|
|
|
+ else if(content.startsWith("正确答案")){
|
|
|
|
|
+ answerQuestion = content.replace("正确答案:", "");
|
|
|
|
|
+ if(Validator.isEmpty(answerQuestion)){
|
|
|
|
|
+ throw new CustomException("正确答案错误");
|
|
|
|
|
+ }
|
|
|
|
|
+ if(isOption){
|
|
|
|
|
+ //选择题
|
|
|
|
|
+ answerQuestion = dealImportAnswer(answerQuestion);
|
|
|
|
|
+ if(answerQuestion.length()>1){
|
|
|
|
|
+ type = 2; //多选
|
|
|
|
|
+ }else{
|
|
|
|
|
+ type = 1; //单选
|
|
|
|
|
+ }
|
|
|
|
|
+ }else{
|
|
|
|
|
+ if("正确".equals(answerQuestion)){
|
|
|
|
|
+ answerQuestion = "1";
|
|
|
|
|
+ type = 3; //判断
|
|
|
|
|
+ }
|
|
|
|
|
+ else if("错误".equals(answerQuestion)){
|
|
|
|
|
+ answerQuestion = "0";
|
|
|
|
|
+ type = 3;
|
|
|
|
|
+ }else{
|
|
|
|
|
+ answerQuestion = null;
|
|
|
|
|
+ type = 5; //简答题
|
|
|
|
|
+ int j = i+1;
|
|
|
|
|
+ String q_content = content; //简答题
|
|
|
|
|
+
|
|
|
|
|
+ while (j<paragraphList.size())
|
|
|
|
|
+ {
|
|
|
|
|
+ String tempTxt = paragraphList.get(j).getText();
|
|
|
|
|
+ if(checkKey(tempTxt)){
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ q_content+=tempTxt;
|
|
|
|
|
+ j++;
|
|
|
|
|
+ }
|
|
|
|
|
+ q_content = q_content.replace("正确答案:", "");
|
|
|
|
|
+ QuestionChildAddBo bo1 = null;
|
|
|
|
|
+ if(optionsList.size()==0){
|
|
|
|
|
+ bo1 = new QuestionChildAddBo();
|
|
|
|
|
+ optionsList.add(bo1);
|
|
|
|
|
+ }
|
|
|
|
|
+ bo1 = optionsList.get(0);
|
|
|
|
|
+ bo1.setOptionsId(1L);
|
|
|
|
|
+ bo1.setAnalysisContent(q_content);
|
|
|
|
|
+ i = j-1; //底部会再执行加回来
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ //解题思路
|
|
|
|
|
+ else if(content.startsWith("解题思路:")){
|
|
|
|
|
+ int j = i+1;
|
|
|
|
|
+ String q_content = content; //解题思路
|
|
|
|
|
+ while (j<paragraphList.size())
|
|
|
|
|
+ {
|
|
|
|
|
+ String tempTxt = dealTxt(paragraphList.get(j).getText());
|
|
|
|
|
+ if(checkKey(tempTxt)){
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ q_content+=tempTxt;
|
|
|
|
|
+ j++;
|
|
|
|
|
+ }
|
|
|
|
|
+ analysisContent+=q_content;
|
|
|
|
|
+ i = j-1; //底部会再执行加回来
|
|
|
|
|
+ }
|
|
|
|
|
+ //考查考点
|
|
|
|
|
+ else if(content.startsWith("考查考点:")){
|
|
|
|
|
+ int j = i+1;
|
|
|
|
|
+ String q_content = content; //考查考点
|
|
|
|
|
+ while (j<paragraphList.size())
|
|
|
|
|
+ {
|
|
|
|
|
+ String tempTxt = dealTxt(paragraphList.get(j).getText());
|
|
|
|
|
+ if(checkKey(tempTxt)){
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ q_content+=tempTxt;
|
|
|
|
|
+ j++;
|
|
|
|
|
+ }
|
|
|
|
|
+ analysisContent = analysisContent + "\r\n" +q_content;
|
|
|
|
|
+ i = j-1; //底部会再执行加回来
|
|
|
|
|
+ }
|
|
|
|
|
+ //老师解答
|
|
|
|
|
+ else if(content.startsWith("老师解答:")){
|
|
|
|
|
+ int j = i+1;
|
|
|
|
|
+ String q_content = content; //考查考点
|
|
|
|
|
+ while (j<paragraphList.size())
|
|
|
|
|
+ {
|
|
|
|
|
+ String tempTxt = dealTxt(paragraphList.get(j).getText());
|
|
|
|
|
+ if(checkKey(tempTxt)){
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ q_content+=tempTxt;
|
|
|
|
|
+ j++;
|
|
|
|
|
+ }
|
|
|
|
|
+ analysisContent = analysisContent + "\r\n" +q_content;
|
|
|
|
|
+ i = j-1; //底部会再执行加回来
|
|
|
|
|
+ }
|
|
|
|
|
+ //问答题问题
|
|
|
|
|
+ else if(content.startsWith("【问题】")){
|
|
|
|
|
+ //多个问题合在一起
|
|
|
|
|
+ int j = i+1;
|
|
|
|
|
+ String q_content = content; //问题
|
|
|
|
|
+ while (j<paragraphList.size())
|
|
|
|
|
+ {
|
|
|
|
|
+ String tempTxt = dealTxt(paragraphList.get(j).getText());
|
|
|
|
|
+ if(checkKey(tempTxt)){
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ q_content+=tempTxt;
|
|
|
|
|
+ j++;
|
|
|
|
|
+ }
|
|
|
|
|
+ q_content = q_content.replace("【问题】", "");
|
|
|
|
|
+ QuestionChildAddBo bo1 = null;
|
|
|
|
|
+ if(optionsList.size()==0){
|
|
|
|
|
+ bo1 = new QuestionChildAddBo();
|
|
|
|
|
+ optionsList.add(bo1);
|
|
|
|
|
+ }
|
|
|
|
|
+ bo1 = optionsList.get(0);
|
|
|
|
|
+ bo1.setOptionsId(1L);
|
|
|
|
|
+ bo1.setContent(q_content);
|
|
|
|
|
+ i = j-1; //底部会再执行加回来
|
|
|
|
|
+ }
|
|
|
|
|
+ //题目正文
|
|
|
|
|
+ else{
|
|
|
|
|
+ qContent += content;
|
|
|
|
|
+ }
|
|
|
|
|
+ }else{
|
|
|
|
|
+ qContent = removeNo(qContent);
|
|
|
|
|
+ if(Validator.isEmpty(qContent)){
|
|
|
|
|
+ errorLog+="第"+index+"条题目内容空白\n";
|
|
|
|
|
+ i++;
|
|
|
|
|
+ continue;
|
|
|
|
|
+ }
|
|
|
|
|
+ QuestionAddBo bo = new QuestionAddBo();
|
|
|
|
|
+ if(type==-1){
|
|
|
|
|
+ errorLog+="第"+index+"条题目选项错误\n";
|
|
|
|
|
+ i++;
|
|
|
|
|
+ continue;
|
|
|
|
|
+ }
|
|
|
|
|
+ bo.setType(type);
|
|
|
|
|
+
|
|
|
|
|
+ bo.setStatus(1);
|
|
|
|
|
+ bo.setContent(qContent);
|
|
|
|
|
+ bo.setAnswerQuestion(answerQuestion);
|
|
|
|
|
+ bo.setAnalysisContent(analysisContent);
|
|
|
|
|
+ List<QuestionChildAddBo> optionsListBak =new ArrayList<>();
|
|
|
|
|
+ optionsListBak.addAll(optionsList);
|
|
|
|
|
+ bo.setOptionsList(optionsListBak);
|
|
|
|
|
+ bo.setCreateBy(SecurityUtils.getUsername());
|
|
|
|
|
+ bo.setImportNo(importNo);
|
|
|
|
|
+ bo.setPublishStatus(1);
|
|
|
|
|
+ bo.setBusinessList(businessList);
|
|
|
|
|
+ list.add(bo);
|
|
|
|
|
+ //清空数据
|
|
|
|
|
+ isOption = false;
|
|
|
|
|
+ type = -1;
|
|
|
|
|
+ qContent = "";
|
|
|
|
|
+ index++;
|
|
|
|
|
+ answerQuestion = null;
|
|
|
|
|
+ analysisContent = "";
|
|
|
|
|
+ optionsList.clear();
|
|
|
|
|
+ }
|
|
|
|
|
+ i++;
|
|
|
|
|
+ }
|
|
|
|
|
+ // buffer = extractor.getText();
|
|
|
|
|
+ //extractor.close();
|
|
|
|
|
+
|
|
|
|
|
+ } else {
|
|
|
|
|
+ throw new CustomException("请导入word文件!");
|
|
|
|
|
+ }
|
|
|
|
|
+ }catch (IOException e){
|
|
|
|
|
+ System.out.println("此文件不是word文件!A"+e.getMessage()+e.toString()+e.getLocalizedMessage());
|
|
|
|
|
+ }
|
|
|
|
|
+ return list;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ private String removeNo(String txt){
|
|
|
|
|
+ int intIndex = txt.indexOf(".");
|
|
|
|
|
+ if(intIndex != -1){
|
|
|
|
|
+ txt = txt.substring(intIndex+1);
|
|
|
|
|
+ }
|
|
|
|
|
+ return txt;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ private boolean checkKey(String key){
|
|
|
|
|
+ if(Validator.isEmpty(key)||key.startsWith("解题思路:")||key.startsWith("考查考点:")||key.startsWith("老师解答:")||key.startsWith("正确答案:")||key.startsWith("A.")||key.startsWith("【问题】")){
|
|
|
|
|
+ return true;
|
|
|
|
|
+ }
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public String insertByAddBoImport(QuestionAddBo bo,Integer no) {
|
|
public String insertByAddBoImport(QuestionAddBo bo,Integer no) {
|
|
|
String errorLog = null;
|
|
String errorLog = null;
|
|
|
Question add = BeanUtil.toBean(bo, Question.class);
|
|
Question add = BeanUtil.toBean(bo, Question.class);
|
|
|
add.setCode(ServletUtils.getImportEncoded("TM")+no);
|
|
add.setCode(ServletUtils.getImportEncoded("TM")+no);
|
|
|
- if(bo.getOptionsList()!=null){
|
|
|
|
|
|
|
+ if(bo.getOptionsList()!=null&&bo.getOptionsList().size()>0){
|
|
|
add.setJsonStr(JSON.toJSONString(bo.getOptionsList()));
|
|
add.setJsonStr(JSON.toJSONString(bo.getOptionsList()));
|
|
|
}
|
|
}
|
|
|
/*if(checkNameUnique(add)){
|
|
/*if(checkNameUnique(add)){
|
|
@@ -347,7 +1059,7 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
|
|
|
addItem.setType(QuestionBusiness.TYPE_QUESTION);
|
|
addItem.setType(QuestionBusiness.TYPE_QUESTION);
|
|
|
coll.add(addItem);
|
|
coll.add(addItem);
|
|
|
}
|
|
}
|
|
|
- iQuestionBusinessService.saveBatch(coll);
|
|
|
|
|
|
|
+ boolean result1 = iQuestionBusinessService.saveBatch(coll);
|
|
|
}
|
|
}
|
|
|
return errorLog;
|
|
return errorLog;
|
|
|
}
|
|
}
|
|
@@ -552,4 +1264,31 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
|
|
|
}
|
|
}
|
|
|
return sb.toString();
|
|
return sb.toString();
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ private String dealImportAnswer(String Answer){
|
|
|
|
|
+ String[] itemArray = Answer.split("");
|
|
|
|
|
+ List<String> list = new ArrayList<>();
|
|
|
|
|
+ for (String v:itemArray) {
|
|
|
|
|
+ if("A".equals(v)){
|
|
|
|
|
+ list.add("1");
|
|
|
|
|
+ }
|
|
|
|
|
+ else if("B".equals(v)){
|
|
|
|
|
+ list.add("2");
|
|
|
|
|
+ }
|
|
|
|
|
+ else if("C".equals(v)){
|
|
|
|
|
+ list.add("3");
|
|
|
|
|
+ }
|
|
|
|
|
+ else if("D".equals(v)){
|
|
|
|
|
+ list.add("4");
|
|
|
|
|
+ }
|
|
|
|
|
+ else if("E".equals(v)){
|
|
|
|
|
+ list.add("5");
|
|
|
|
|
+ }
|
|
|
|
|
+ else if("F".equals(v)){
|
|
|
|
|
+ list.add("6");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ return String.join(",", list);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|