he2802 1 năm trước cách đây
mục cha
commit
5e68370365

+ 2 - 0
zhongzheng-admin/src/main/java/com/zhongzheng/controller/bank/QuestionController.java

@@ -298,4 +298,6 @@ public class QuestionController extends BaseController {
         Map<String,Object> result = iQuestionService.importXueJianWordQuestionList(file,  eduId,  projectId,  businessId, subjectId);
         return AjaxResult.success(result);
     }
+
+
 }

+ 9 - 0
zhongzheng-admin/src/main/java/com/zhongzheng/controller/common/CommonController.java

@@ -877,4 +877,13 @@ public class CommonController extends BaseController {
         iCertificateTpService.makeBatchCertificatePhoto(bo);
         return AjaxResult.success();
     }
+
+    @ApiOperation("导入二建精选题目Word模板列表")
+    @PreAuthorize("@ss.hasPermi('system:question:import')")
+    @PostMapping("/common/free/importErJianWordQuestionList")
+    public AjaxResult<Map<String,Object>> importErJianWordQuestionList(MultipartFile file, Long eduId, Long projectId, Long businessId, Long subjectId) throws Exception
+    {
+        Map<String,Object> result = iQuestionService.importErJianWordQuestionList(file,  eduId,  projectId,  businessId, subjectId);
+        return AjaxResult.success(result);
+    }
 }

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/IQuestionService.java

@@ -90,6 +90,9 @@ public interface IQuestionService extends IService<Question> {
 
 	Map<String,Object> importXueJianWordQuestionList(MultipartFile file, Long eduId, Long projectId, Long businessId, Long subjectId);
 
+	Map<String,Object> importErJianWordQuestionList(MultipartFile file, Long eduId, Long projectId, Long businessId, Long subjectId);
+
+
     boolean batchDelQuestion(QuestionBatchDelBo bo);
 
     List<BankGoodsExamVo> getBankGoodsExamList(Long goodsId);

+ 3 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/impl/ExamServiceImpl.java

@@ -136,7 +136,9 @@ public class ExamServiceImpl extends ServiceImpl<ExamMapper, Exam> implements IE
     public ExamVo insertByAddBo(ExamAddBo bo) {
         Exam add = BeanUtil.toBean(bo, Exam.class);
         add.setSimulateConfig(bo.getSimulateConfigJson());
-        add.setCode(ServletUtils.getEncoded("SJ"));
+        if(Validator.isEmpty(bo.getCode())){
+            add.setCode(ServletUtils.getEncoded("SJ"));
+        }
         validEntityBeforeSave(add);
         add.setCreateTime(DateUtils.getNowTime());
         add.setUpdateTime(DateUtils.getNowTime());

+ 617 - 4
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/impl/QuestionServiceImpl.java

@@ -32,8 +32,10 @@ import com.zhongzheng.modules.bank.domain.*;
 import com.zhongzheng.modules.bank.mapper.QuestionMapper;
 import com.zhongzheng.modules.bank.service.*;
 import com.zhongzheng.modules.bank.vo.*;
+import com.zhongzheng.modules.course.bo.CourseBusinessQueryBo;
 import com.zhongzheng.modules.course.domain.*;
 import com.zhongzheng.modules.course.service.*;
+import com.zhongzheng.modules.course.vo.CourseBusinessVo;
 import com.zhongzheng.modules.exam.bo.ExamKnowledgeAddBo;
 import com.zhongzheng.modules.exam.bo.ExamKnowledgeBusinessAddBo;
 import com.zhongzheng.modules.exam.domain.ExamKnowledge;
@@ -73,8 +75,7 @@ import org.w3c.dom.NamedNodeMap;
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
 
-import java.io.IOException;
-import java.io.InputStream;
+import java.io.*;
 import java.math.BigDecimal;
 import java.text.NumberFormat;
 import java.util.*;
@@ -1129,9 +1130,21 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
         if (content.startsWith("二、多项选择题")) {
             return true;
         }
+        if (content.indexOf("多项选择题")>-1) {
+            return true;
+        }
         if (content.startsWith("三、实务操作和案例分析题")) {
             return true;
         }
+        if (content.indexOf("案例分析题")>-1) {
+            return true;
+        }
+        if (content.indexOf("章标题:")>-1) {
+            return true;
+        }
+        if (content.startsWith("参考答案")) {
+            return true;
+        }
         if (Validator.isNotEmpty(content)) {
             if(type==5){
                 if(alKeyList.contains(content)){
@@ -1195,6 +1208,16 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
         return false;
     }
 
+    private boolean isNumStart(String content) {
+        for(int i=1;i<40;i++){
+            String num = i+".";
+            if(content.startsWith(num)){
+                return true;
+            }
+        }
+        return false;
+    }
+
     private boolean isNotOptionStart(String content) {
         if (Validator.isNotEmpty(content)) {
             if(isQuestionStart(content)||content.startsWith("正确答案")||content.startsWith("解题思路")||content.startsWith("考查考点")||content.startsWith("老师解答")
@@ -2436,6 +2459,592 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
         return result;
     }
 
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public Map<String, Object> importErJianWordQuestionList(MultipartFile file, Long eduId, Long projectId, Long businessId, Long subjectId) {
+        Map<String,Object> result = new HashMap<>();
+        List<QuestionAddBo> list = new ArrayList<>();
+        String errorLog = ""; //错误提示
+        String preExamName = "";
+        String examName = "";
+        String importNo = ServletUtils.getEncoded("IMPORT");
+        Long sort = 1L;
+        if(Validator.isEmpty(file)){
+            throw new CustomException("请选择文件");
+        }
+        try {
+            Long nowTime = DateUtils.getNowTime();
+            String path = file.getOriginalFilename();
+            if (path.endsWith(".doc")) {
+                throw new CustomException("不支持doc格式");
+            } else if (path.endsWith("docx")) {
+                CourseBusinessQueryBo queryBo = new CourseBusinessQueryBo();
+                queryBo.setEducationName("考前培训");
+                queryBo.setProjectName("建造师");
+                queryBo.setBusinessName("二级");
+                CourseBusinessVo businessVo = iCourseBusinessService.queryFullId(queryBo);
+                String subjectName = path.substring(1,3);
+                if(subjectName.equals("水利")){
+                    subjectName = "水利水电";
+                }
+                CourseSubject subject = iCourseSubjectService.getOne(new LambdaQueryWrapper<CourseSubject>()
+                        .eq(CourseSubject::getSubjectName,subjectName).eq(CourseSubject::getStatus,1).last("limit 1"));
+                String importCode = ServletUtils.getImportEncoded("TM");
+                String importExamCode = ServletUtils.getEncoded("SJ");
+                InputStream is = file.getInputStream();
+                XWPFDocument doc = new XWPFDocument(is);
+                List<XWPFParagraph> paragraphList = doc.getParagraphs();
+                int type = -1;  //题目类型
+                int aType = -1;  //答案题目类型
+                boolean isOption = false; //是否判断题
+                List<QuestionChildAddBo> optionsList = new ArrayList<>(); //题目选项
+                String content = ""; //每行正文
+                String qContent = ""; //题目正文
+                String answerQuestion = null; //答案
+                String analysisContent = ""; //解析文本
+                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);
+
+                List<QuestionAddBo> list1 = new ArrayList<>(); //单选列表
+                List<QuestionAddBo> list2 = new ArrayList<>(); //多选列表
+                List<QuestionAddBo> list3 = new ArrayList<>(); //简答列表
+                List<QuestionAddBo> list4 = new ArrayList<>(); //判断列表
+                Map<String,QuestionAddBo> allQues = new LinkedHashMap<>();
+                Integer nowPart = -1;//0正文 1选项A 2选项B 3选项C 4选项D 5选项E 6选项F
+                String strContent = "";
+                String imgUrl = "";
+                boolean hasQuestion = false;
+                boolean hasRightTag = false;
+                boolean hasError = false;
+                boolean answerStatus = false;
+                int cIndex = 1;
+                int nIndex = 2;
+                List<String> alKeyList  = new ArrayList<>();
+                alKeyList.add("案例(一)");
+                alKeyList.add("案例(二)");
+                alKeyList.add("案例(三)");
+                alKeyList.add("案例(四)");
+                alKeyList.add("案例(五)");
+                alKeyList.add("案例(六)");
+                alKeyList.add("案例(七)");
+                alKeyList.add("案例(八)");
+                alKeyList.add("案例(九)");
+                alKeyList.add("案例(十)");
+                alKeyList.add("案例(十一)");
+                alKeyList.add("案例(十二)");
+                alKeyList.add("案例(十三)");
+                alKeyList.add("案例(十四)");
+                alKeyList.add("案例(十五)");
+                alKeyList.add("案例(十六)");
+                alKeyList.add("案例(十七)");
+                int anLiNum = 0;
+                String indexKey = null;
+                for (XWPFParagraph paragraph : paragraphList) {
+                    content = paragraph.getText();
+
+                    List<XWPFRun> runs = paragraph.getRuns();
+                    imgUrl = null;
+                    //    System.out.println(content);
+                    for (XWPFRun run : runs) {
+                        Node node = run.getCTR().getDomNode();
+
+                        // drawing 一个绘画的图片
+                        Node drawingNode = getChildNode(node, "w:drawing");
+                        if (drawingNode == null && content == null) {
+                            imgUrl = null;
+                            continue;
+                        }
+
+                        //上传图片
+                        if (Validator.isNotEmpty(drawingNode)) {
+                            // 绘画图片的宽和高
+                            Node extentNode = getChildNode(drawingNode, "wp:extent");
+                            NamedNodeMap extentAttrs = extentNode.getAttributes();
+                            int wPx = ToolsUtils.emuToPx(Double.valueOf(extentAttrs.getNamedItem("cx").getNodeValue()));
+                            //            System.out.println("宽:".concat(extentAttrs.getNamedItem("cx").getNodeValue()).concat("emu"));
+                            //            System.out.println("高:".concat(extentAttrs.getNamedItem("cy").getNodeValue()).concat("emu"));
+                            int HPx = ToolsUtils.emuToPx(Double.valueOf(extentAttrs.getNamedItem("cy").getNodeValue()));
+
+                            // 绘画图片具体引用
+                            Node blipNode = getChildNode(drawingNode, "a:blip");
+                            if(Validator.isNotEmpty(blipNode)){
+                                NamedNodeMap blipAttrs = blipNode.getAttributes();
+                                String rid = blipAttrs.getNamedItem("r:embed").getNodeValue();
+                                //            System.out.println("word中图片ID:".concat(rid));
+
+                                // 获取图片信息
+                                PackagePart part = doc.getPartById(rid);
+
+                                String ossPath = null;
+                                try {
+                                    ossPath = ossService.uploadInputStream(part.getInputStream(), 8);
+                                    System.out.println(part.getSize()+"图片大小");
+                                    System.out.println(ossPath);
+                                } catch (Exception e) {
+                                    e.printStackTrace();
+                                }
+                                imgUrl =  ossPath + "?x-oss-process=image/resize,w_" + wPx + ",h_" + HPx;
+                                if(type==5||nowPart==9){
+                                    //正文图片
+                                    if(!answerStatus){
+                                        qContent = qContent+"<br />" +"<p><img src=\"" + ossHost + "/" + imgUrl + "\"></p>";
+                                    }
+                                }
+                                if(answerStatus){
+                                    analysisContent=analysisContent+"<br />" +"<p><img src=\"" + ossHost + "/" + imgUrl + "\"></p>";
+                                }
+                            }
+                        }
+                    }
+                    content = dealTxt(content);
+                    if(content.equals("")){
+                        continue;
+                    }
+                    if(content.indexOf("关于《建设工程工程量清单计价规范》")>-1){
+                        System.out.println(content);
+                    }
+                    System.out.println(content);
+                    if (content.startsWith("###")||isXueJianQuestionStart(content,type,alKeyList)) {
+
+                        if(hasQuestion&&!answerStatus){
+                            index++;
+                            hasQuestion = false;
+                            //插入上一条
+                            QuestionAddBo addBo = new QuestionAddBo();
+                            qContent = removeXueJianNo(qContent,type);
+                            if (Validator.isEmpty(qContent)) {
+                                hasError = true;
+                                errorLog += "第" + index + "条题目内容错误\n";
+                                continue;
+                            }
+                            QuestionAddBo bo = new QuestionAddBo();
+                            if (type == -1) {
+                                hasError = true;
+                                errorLog += "第" + index + "条题目选项错误\n";
+                                throw new CustomException("第" + index + "条题目选项错误\n");
+
+                            }
+                            if(!hasError){
+                               /* if (Validator.isEmpty(answerQuestion)) {
+                                    errorLog += "第" + index + "正确答案错误\n";
+                                    continue;
+
+                                }*/
+                                if(type==5){
+                                    answerQuestion = null;
+                                }else{
+                                    if(optionsList.size()<4){
+                                        throw new CustomException("选项数量错误");
+                                    }
+                                }
+
+                                bo.setType(type);
+                                bo.setStatus(1);
+                                bo.setContent(qContent);
+                                bo.setAnswerQuestion(answerQuestion);
+                                bo.setAnalysisContent(analysisContent);
+                                bo.setOptionsList(copyList(optionsList));
+                                bo.setCreateBy(SecurityUtils.getUsername());
+                                bo.setImportNo(importNo);
+                                bo.setPublishStatus(1);
+                                bo.setBusinessList(businessList);
+                                bo.setCreateTime(nowTime);
+                                if(type==1){
+                                    list1.add(bo);
+                                }
+                                if(type==2){
+                                    list2.add(bo);
+                                }
+                                if(type==3){
+                                    list4.add(bo);
+                                }
+                                if(type==5){
+                                    list3.add(bo);
+                                }
+                            }
+
+                            sort++;
+                            hasError = false;
+                            //清空数据
+                            isOption = false;
+                            qContent = "";
+                            analysisContent = "";
+                            optionsList.clear();
+                            nowPart = -1;
+                            hasRightTag= false;
+                        }
+                    }
+
+                    if(nowPart==8){
+                        if(isNumStart((content))||content.indexOf("###")>-1||content.indexOf("章标题")>-1||content.indexOf("多项选择题")>-1){
+                            if(Validator.isNotEmpty(qContent)&&!qContent.equals("")){
+                                String[] sList = qContent.split("【解析】");
+                                if (sList.length>1) {
+                                    String jiexi = sList[1];
+                                    String[] daList = sList[0].split("\\.");
+                                    int num = Integer.valueOf(daList[0]);
+                                    String daan = daList[1];
+                                    if(num>list1.size()){
+                                        System.out.println(num);
+                                    }
+                                    QuestionAddBo  addBo = list1.get(num-1);
+                                    addBo.setAnalysisContent(jiexi);
+                                    addBo.setAnswerQuestion(dealImportAnswer(daan));
+                                    qContent = "";
+                                }
+                            }
+                        }
+                        qContent = qContent +   content +"<br />";
+                    }
+                    if(nowPart==9){
+                        if(isNumStart((content))||content.indexOf("###")>-1||content.indexOf("章标题")>-1||content.indexOf("案例分析题")>-1){
+                            if(Validator.isNotEmpty(qContent)&&!qContent.equals("")){
+                                String[] sList = qContent.split("【解析】");
+                                if (sList.length>1) {
+                                    String jiexi = sList[1];
+                                    String[] daList = sList[0].split("\\.");
+                                    int num = Integer.valueOf(daList[0]);
+                                    String daan = daList[1];
+                                    if(num>list1.size()){
+                                        System.out.println(num);
+                                    }
+                                    QuestionAddBo  addBo = list2.get(num-1);
+                                    addBo.setAnalysisContent(jiexi);
+                                    addBo.setAnswerQuestion(dealImportAnswer(daan));
+                                    qContent = "";
+                                }
+                            }
+                        }
+                        qContent = qContent +   content +"<br />";
+                    }
+                    if(nowPart==10){
+                        System.out.println(content);
+                        if(alKeyList.contains(content)||content.indexOf("###")>-1||content.indexOf("章标题")>-1){
+                            if(Validator.isNotEmpty(qContent)&&!qContent.equals("")){
+                                if(anLiNum>=list3.size()){
+                                    System.out.println(anLiNum);
+                                }
+                                QuestionAddBo  addBo = list3.get(anLiNum);
+                                addBo.setAnalysisContent(qContent);
+                                qContent = "";
+                                anLiNum++;
+                            }
+                        }
+                        if(!alKeyList.contains(content)){
+                            qContent = qContent +   content +"<br />";
+                        }
+                    }
+                   /* if (content.indexOf("-Reference")>0){
+                        answerStatus = true;
+                    }*/
+    //                System.out.println(content);
+                    if (content.indexOf("章标题:")>-1||content.startsWith("###")){
+                        preExamName = examName;
+                        if(content.indexOf("章标题:")>-1){
+                            examName = content.substring(4);
+                        }
+                        answerStatus = false;
+                        if(list1.size()>0||list2.size()>0||list3.size()>0){
+                            List<ExamQuestionAddBo> questionList = new ArrayList<>();
+                            list1.addAll(list2);
+                            list1.addAll(list3);
+                            int i= 1;
+
+
+                            List<QuestionBusinessAddBo> businessItemList = new ArrayList<>();
+                            QuestionBusinessAddBo businessAddBo = new QuestionBusinessAddBo();
+                            businessAddBo.setSubjectId(subject.getId());
+                            businessAddBo.setBusinessId(businessVo.getBusinessId().longValue());
+                            businessAddBo.setProjectId(businessVo.getProjectId().longValue());
+                            businessAddBo.setEducationTypeId(businessVo.getEducationId().longValue());
+                            businessItemList.add(businessAddBo);
+
+                            for(QuestionAddBo addBo : list1){
+                                if(addBo.getType()==1||addBo.getType()==2){
+                                    if(Validator.isEmpty(addBo.getAnswerQuestion())){
+                                        throw new CustomException("答案错误");
+                                    }
+                                }
+                                addBo.setCode(importCode);
+
+                                addBo.setBusinessList(businessItemList);
+                                Long qId =  insertByAddBoImportBackId(addBo,0);
+
+                                ExamQuestionAddBo questionAddBo = new ExamQuestionAddBo();
+                                questionAddBo.setQuestionId(qId);
+                                questionAddBo.setSort(i);
+                                questionList.add(questionAddBo);
+                                i++;
+                            }
+                            ExamAddBo examAddBo = new ExamAddBo();
+                            examAddBo.setExamName(preExamName);
+                            examAddBo.setCode(importExamCode);
+                            examAddBo.setBusinessList(businessItemList);
+                            examAddBo.setQuestionList(questionList);
+                            examAddBo.setStatus(1);
+                            iExamService.insertByAddBo(examAddBo);
+                        }
+                        list1.clear();
+                        list2.clear();
+                        list3.clear();
+                        list4.clear();
+                        type = -100;
+
+                        continue;
+                    }
+
+                    if(content.indexOf("单项选择题")>-1&&!answerStatus){
+                        type = 1;
+                        continue;
+                    }
+                    if(content.indexOf("多项选择题")>-1&&!answerStatus){
+                        type = 2;
+                        continue;
+                    }
+                    if(content.indexOf("案例分析题")>-1&&!answerStatus){
+                        type = 5;
+                        continue;
+                    }
+
+                    //第一个选项
+                    if(content.startsWith("А.")||content.startsWith("A.")||(nowPart==1&&!isXueJianLineStart(content,type,alKeyList))) {
+                        hasQuestion = true;
+                        if(nowPart!=1){
+                            strContent = "";
+                        }
+                        isOption = true; //是选择题
+                        nowPart = 1;
+                        if(content.indexOf("B.")>-1){
+                            //带B
+                            int len = content.indexOf("B.");
+                            strContent = content.substring(0,len) ;
+                            System.out.println("A选项"+strContent);
+                        }else{
+                            strContent = strContent +   content ;
+                        }
+                        QuestionChildAddBo bo1;
+                        if(optionsList.size()<1){
+                            bo1 = new QuestionChildAddBo();
+                            bo1.setOptionsId(1L);
+                            bo1.setImgUrl(imgUrl);
+                            bo1.setContent(strContent.replace("A.", "").replace("А.", "").trim());
+                            optionsList.add(bo1);
+                        }else{
+                            bo1 = optionsList.get(0);
+                            bo1.setImgUrl(imgUrl);
+                            bo1.setContent(strContent.replace("A.", "").replace("А.", "").trim());
+                        }
+
+
+                    }
+                    //第二个选项
+                    if (content.indexOf("B.")>0||content.startsWith("B.")||(nowPart==2&&!isXueJianLineStart(content,type,alKeyList))) {
+                        if (optionsList.size()<1) {
+                            errorLog += "第" + index + "条题目选项A错误\n";
+                            throw new CustomException("第" + index + "条题目选项A错误\n");
+                        }
+                        if(nowPart!=2){
+                            strContent = "";
+                        }
+                        nowPart = 2;
+                        if(content.indexOf("B.")>0){
+                            //带B
+                            int len = content.indexOf("B.");
+                            strContent = content.substring(len,content.length()) ;
+                        }else{
+                            strContent = strContent +  content ;
+                        }
+
+                        QuestionChildAddBo bo1;
+                        if(optionsList.size()<2){
+                            bo1 = new QuestionChildAddBo();
+                            bo1.setOptionsId(2L);
+                            bo1.setImgUrl(imgUrl);
+                            bo1.setContent(strContent.replace("B.", "").trim());
+                            optionsList.add(bo1);
+                        }else{
+                            bo1 = optionsList.get(1);
+                            bo1.setImgUrl(imgUrl);
+                            bo1.setContent(strContent.replace("B.", "").trim());
+                        }
+                        continue;
+                    }
+                    //第三个选项
+                    if (content.startsWith("C.")||(nowPart==3&&!isXueJianLineStart(content,type,alKeyList))) {
+                        if(nowPart!=3){
+                            strContent = "";
+                        }
+                        nowPart = 3;
+                        if(content.indexOf("D.")>0){
+                            //带B
+                            int len = content.indexOf("D.");
+                            strContent = content.substring(0,len) ;
+                            System.out.println("C选项"+strContent);
+                        }else{
+                            strContent = strContent +   content ;
+                        }
+                        QuestionChildAddBo bo1;
+                        if(optionsList.size()<3){
+                            bo1 = new QuestionChildAddBo();
+                            bo1.setOptionsId(3L);
+                            bo1.setImgUrl(imgUrl);
+                            bo1.setContent(strContent.replace("C.", "").trim());
+                            optionsList.add(bo1);
+                        }else{
+                            bo1 = optionsList.get(2);
+                            bo1.setImgUrl(imgUrl);
+                            bo1.setContent(strContent.replace("C.", "").trim());
+                        }
+
+                    }
+                    //第四个选项
+                    if (content.indexOf("D.")>-1||content.startsWith("D.")||(nowPart==4&&!isXueJianLineStart(content,type,alKeyList))) {
+                        if(nowPart!=4){
+                            strContent = "";
+                        }
+                        nowPart = 4;
+                        if(content.indexOf("D.")>0){
+                            //带B
+                            int len = content.indexOf("D.");
+                            strContent = content.substring(len,content.length()) ;
+                            System.out.println("D选项"+strContent);
+                        }else{
+                            strContent = strContent +   content ;
+                        }
+                        QuestionChildAddBo bo1;
+                        if(optionsList.size()<4){
+                            bo1 = new QuestionChildAddBo();
+                            bo1.setOptionsId(4L);
+                            bo1.setImgUrl(imgUrl);
+                            bo1.setContent(strContent.replace("D.", "").trim());
+                            optionsList.add(bo1);
+                        }else{
+                            bo1 = optionsList.get(3);
+                            bo1.setImgUrl(imgUrl);
+                            bo1.setContent(strContent.replace("D.", "").trim());
+                        }
+                        continue;
+                    }
+                    //第五个选项
+                    if (content.startsWith("E.")||(nowPart==5&&!isXueJianLineStart(content,type,alKeyList))) {
+                        if(nowPart!=5){
+                            strContent = "";
+                        }
+                        nowPart = 5;
+                        if(content.indexOf("F.")>0){
+                            //带B
+                            int len = content.indexOf("F.");
+                            strContent = content.substring(0,len) ;
+                            System.out.println("E选项"+strContent);
+                        }else{
+                            strContent = strContent +   content ;
+                        }
+                        QuestionChildAddBo bo1;
+                        if(optionsList.size()<5){
+                            bo1 = new QuestionChildAddBo();
+                            bo1.setOptionsId(5L);
+                            bo1.setImgUrl(imgUrl);
+                            bo1.setContent(strContent.replace("E.", "").trim());
+                            optionsList.add(bo1);
+                        }else{
+                            bo1 = optionsList.get(4);
+                            bo1.setImgUrl(imgUrl);
+                            bo1.setContent(strContent.replace("E.", "").trim());
+                        }
+                        continue;
+                    }
+                    //第六个选项
+                    if (content.indexOf("F.")>0||content.startsWith("F.")||(nowPart==6&&!isXueJianLineStart(content,type,alKeyList))) {
+                        if(nowPart!=6){
+                            strContent = "";
+                        }
+                        nowPart = 6;
+                        if(content.indexOf("F.")>0){
+                            //带B
+                            int len = content.indexOf("F.");
+                            strContent = content.substring(len,content.length()) ;
+                            System.out.println("F选项"+strContent);
+                        }else{
+                            strContent = strContent +   content ;
+                        }
+                        QuestionChildAddBo bo1;
+                        if(optionsList.size()<6){
+                            bo1 = new QuestionChildAddBo();
+                            bo1.setOptionsId(6L);
+                            bo1.setImgUrl(imgUrl);
+                            bo1.setContent(strContent.replace("F.", "").trim());
+                            optionsList.add(bo1);
+                        }else{
+                            bo1 = optionsList.get(5);
+                            bo1.setImgUrl(imgUrl);
+                            bo1.setContent(strContent.replace("F.", "").trim());
+                        }
+                        continue;
+                    }
+                    //答案和题型
+                    if (content.indexOf("参考答案")>-1) {
+                        answerStatus = true;
+                        continue;
+                    }
+
+                    if(answerStatus&&content.indexOf("单项选择题")>0){
+                        nowPart = 8;
+                        qContent = "";
+                        continue;
+                    }
+                    if(answerStatus&&content.indexOf("多项选择题")>0){
+                        nowPart = 9;
+                        qContent = "";
+                        continue;
+                    }
+                    if(answerStatus&&content.indexOf("案例分析题")>0){
+                        nowPart = 10;
+                        qContent = "";
+                        anLiNum=0;
+                        continue;
+                    }
+
+                    if (isXueJianQuestionStart(content,type,alKeyList)||(nowPart==0&&!isXueJianLineStart(content,type,alKeyList))) {
+                        if(!answerStatus){
+                            hasQuestion = true;
+                            if(nowPart!=0){
+                                qContent = "";
+                            }
+                            nowPart = 0;
+                            //新题开头
+                            if(!alKeyList.contains(content)){
+                                qContent = qContent +   content +"<br />";
+                            }
+                            continue;
+                        }
+
+                    }
+
+                }
+                //遍历正文
+                if(true){
+                    System.out.println(list1);
+                }
+
+
+            } else {
+                throw new CustomException("请导入word文件!");
+            }
+        } catch (IOException e) {
+            System.out.println("此文件不是word文件!" + e.getMessage() + e.toString() + e.getLocalizedMessage());
+        }
+        result.put("list",list);
+        result.put("errorLog",errorLog);
+        return result;
+    }
+
+
     @Override
     public Map<String, Object> importJJWordQuestionList(MultipartFile file, Long eduId, Long projectId, Long businessId, Long subjectId) {
         Map<String,Object> result = new HashMap<>();
@@ -3079,7 +3688,9 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
     public String insertByAddBoImport(QuestionAddBo bo, Integer no) {
         String errorLog = null;
         Question add = BeanUtil.toBean(bo, Question.class);
-        add.setCode(ServletUtils.getImportEncoded("TM") + no);
+        if(Validator.isEmpty(bo.getCode())){
+            add.setCode(ServletUtils.getImportEncoded("TM") + no);
+        }
         if (bo.getOptionsList() != null && bo.getOptionsList().size() > 0) {
             add.setJsonStr(JSON.toJSONString(bo.getOptionsList()));
         }
@@ -3107,7 +3718,9 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
     @Override
     public Long insertByAddBoImportBackId(QuestionAddBo bo, Integer no) {
         Question add = BeanUtil.toBean(bo, Question.class);
-        add.setCode(ServletUtils.getImportEncoded("TM") + no);
+        if(Validator.isEmpty(bo.getCode())){
+            add.setCode(ServletUtils.getImportEncoded("TM") + no);
+        }
         if (bo.getOptionsList() != null && bo.getOptionsList().size() > 0) {
             add.setJsonStr(JSON.toJSONString(bo.getOptionsList()));
         }

+ 1 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseServiceImpl.java

@@ -740,7 +740,7 @@ public class CourseServiceImpl extends ServiceImpl<CourseMapper, Course> impleme
                     goodsUserVo.setErJianErZao(true);
                 }else if (goodsUserVo.getEducationName().equals("考前培训") && goodsUserVo.getProjectName().equals("施工现场专业人员")){
                     int count = iUserProfileService.count(new LambdaQueryWrapper<UserProfile>()
-                            .ne(UserProfile::getStatus,-1)
+                            .notIn(UserProfile::getStatus, Arrays.asList(3, -1))
                             .eq(UserProfile::getUserId, goodsUserVo.getUserId())
                             .eq(UserProfile::getOrderGoodsId, goodsUserVo.getOrderGoodsId())
                             .eq(UserProfile::getCurrentStatus, 1)

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/vo/GoodsUserVo.java

@@ -445,5 +445,7 @@ public class GoodsUserVo {
 	@ApiModelProperty("旧业务系统订单号")
 	private String oldOrderSn;
 
+	@ApiModelProperty("学员资料 变更状态 2变更 1否")
+	private Integer profileChangeStatus;
 
 }

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/service/impl/OrderGoodsServiceImpl.java

@@ -594,6 +594,9 @@ public class OrderGoodsServiceImpl extends ServiceImpl<OrderGoodsMapper, OrderGo
     public List<OrderGoodsVo> listUserVideoLive(GoodsQueryBo bo) {
         List<OrderGoodsVo> list = this.baseMapper.listUserVideoLive(bo);
         for(OrderGoodsVo goodsVo : list){
+            if(goodsVo.getOrderGoodsId().longValue()==6311L){
+                System.out.println(goodsVo.getOrderGoodsId());
+            }
             String fullName = goodsVo.getEducationName()+goodsVo.getBusinessName()+goodsVo.getProjectName();
             goodsVo.setErJianErZao(false);
             if(Validator.isNotEmpty(fullName)){

+ 7 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/vo/OrderGoodsVo.java

@@ -375,4 +375,11 @@ public class OrderGoodsVo {
 
 	@ApiModelProperty("寄件标签:1是 0否")
 	private Integer mailSign;
+
+	@ApiModelProperty("资料审核状态  1通过 3不通过 2待审")
+	private Long profileStatus;
+
+
+	@ApiModelProperty("学员资料 变更状态 2变更 1否")
+	private Integer profileChangeStatus;
 }

+ 2 - 0
zhongzheng-system/src/main/resources/mapper/modules/course/CourseMapper.xml

@@ -224,6 +224,7 @@
         <result property="endTime" column="end_time"/>
         <result property="openGoodsTime" column="open_goods_time"/>
         <result property="oldOrderSn" column="old_order_sn"/>
+        <result property="profileChangeStatus" column="profile_change_status"/>
     </resultMap>
 
     <resultMap type="com.zhongzheng.modules.grade.vo.ClassGradeVo" id="ClassGradeVoResult">
@@ -558,6 +559,7 @@
         (SELECT ea.apply_name FROM exam_apply_goods eag LEFT JOIN exam_apply ea on eag.apply_id = ea.apply_id where eag.goods_id = g.goods_id and ea.`status` = 1 and unix_timestamp(now()) BETWEEN ea.apply_start_time and ea.apply_end_time limit 1) as apply_name,
         (SELECT eb.before_name FROM exam_before_goods ebg LEFT JOIN exam_before eb on ebg.before_id = eb.before_id where ebg.goods_id = g.goods_id and eb.`status` = 1 and unix_timestamp(now()) BETWEEN eb.before_start_time and eb.before_end_time) as before_name,
         (SELECT `status` from user_profile where user_id = o.user_id and goods_id = g.goods_id and current_status = 1 and type_status = 1 and order_goods_id = og.order_goods_id limit 1 ) as profile_status,
+        (SELECT change_status from user_profile where user_id = o.user_id and goods_id = g.goods_id and current_status = 1 and type_status = 1 and order_goods_id = og.order_goods_id limit 1 ) as profile_change_status,
         (case WHEN(SELECT COUNT(1) from profile_tp where `status`=1 and FIND_IN_SET(g.goods_id,goods_ids) ) >0 then 1 ELSE 0 end) as profile_tp_status,
         <if test="querySign == null or querySign == 0">
         (SELECT GROUP_CONCAT(subject_name)  from course_subject where FIND_IN_SET(id,g.subject_ids)) subject_names,

+ 4 - 0
zhongzheng-system/src/main/resources/mapper/modules/order/OrderGoodsMapper.xml

@@ -120,6 +120,8 @@
         <result property="sevenClassCopy" column="seven_class_copy"/>
         <result property="studyStatus" column="study_status"/>
         <result property="mailSign" column="mail_sign"/>
+        <result property="profileStatus" column="profile_status"/>
+        <result property="profileChangeStatus" column="profile_change_status"/>
     </resultMap>
 
     <select id="selectListBybo" parameterType="com.zhongzheng.modules.order.bo.OrderGoodsQueryBo"
@@ -501,6 +503,8 @@
         us.apply_site_exam_time as sub_apply_site_exam_time,
         (SELECT COUNT(1) FROM goods_course gc where gc.goods_id = g.goods_id) as course_num,
         og.study_count as user_study_count,
+        (SELECT `status` from user_profile where user_id = o.user_id and goods_id = g.goods_id and current_status = 1 and type_status = 1 and order_goods_id = og.order_goods_id limit 1 ) as profile_status,
+        (SELECT change_status from user_profile where user_id = o.user_id and goods_id = g.goods_id and current_status = 1 and type_status = 1 and order_goods_id = og.order_goods_id limit 1 ) as profile_change_status,
         (SELECT count(*) from user_study_record usr where usr.user_id = o.user_id and usr.order_goods_id = og.order_goods_id) as study_status
         FROM
         order_goods og

+ 1 - 1
zhongzheng-system/src/main/resources/mapper/modules/user/UserExamRecordMapper.xml

@@ -686,7 +686,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <foreach collection="questionIds" item="item" index="index">
                 <choose>
                     <when test="index == questionIds.size()-1">
-                        AND up.do_question_ids LIKE concat('%', #{item}, '%')
+                        up.do_question_ids LIKE concat('%', #{item}, '%')
                     </when>
                     <otherwise>
                         AND up.do_question_ids LIKE concat('%', #{item}, '%') OR