he2802 3 vuotta sitten
vanhempi
commit
5981410676
28 muutettua tiedostoa jossa 228 lisäystä ja 63 poistoa
  1. 11 0
      zhongzheng-admin/src/main/java/com/zhongzheng/controller/bank/ExamController.java
  2. 12 1
      zhongzheng-admin/src/main/java/com/zhongzheng/controller/bank/QuestionChapterController.java
  3. 11 0
      zhongzheng-admin/src/main/java/com/zhongzheng/controller/course/CourseChapterController.java
  4. 9 1
      zhongzheng-admin/src/main/java/com/zhongzheng/controller/course/CourseSectionController.java
  5. 1 1
      zhongzheng-api/src/main/java/com/zhongzheng/controller/cmmon/CommonController.java
  6. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/bo/ExamQueryBo.java
  7. 2 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/bo/QuestionChapterQueryBo.java
  8. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/bo/QuestionEditBo.java
  9. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/IExamService.java
  10. 3 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/IQuestionChapterService.java
  11. 10 4
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/impl/ExamServiceImpl.java
  12. 13 6
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/impl/QuestionChapterServiceImpl.java
  13. 80 26
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/impl/QuestionServiceImpl.java
  14. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/vo/QuestionImport.java
  15. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/bo/CourseChapterQueryBo.java
  16. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/bo/CourseSectionQueryBo.java
  17. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/ICourseChapterService.java
  18. 3 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/ICourseSectionService.java
  19. 10 4
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseChapterServiceImpl.java
  20. 12 6
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseSectionServiceImpl.java
  21. 6 6
      zhongzheng-system/src/main/java/com/zhongzheng/modules/order/service/impl/OrderServiceImpl.java
  22. 3 4
      zhongzheng-system/src/main/java/com/zhongzheng/modules/tencentcloud/service/impl/FaceOcrServiceImpl.java
  23. 1 0
      zhongzheng-system/src/main/resources/mapper/modules/activity/ActivityRecommendMapper.xml
  24. 6 0
      zhongzheng-system/src/main/resources/mapper/modules/bank/ExamMapper.xml
  25. 6 0
      zhongzheng-system/src/main/resources/mapper/modules/bank/QuestionChapterMapper.xml
  26. 6 0
      zhongzheng-system/src/main/resources/mapper/modules/course/CourseChapterMapper.xml
  27. 6 0
      zhongzheng-system/src/main/resources/mapper/modules/course/CourseSectionMapper.xml
  28. 1 1
      zhongzheng-system/src/main/resources/mapper/modules/user/UserStudyRecordMapper.xml

+ 11 - 0
zhongzheng-admin/src/main/java/com/zhongzheng/controller/bank/ExamController.java

@@ -94,6 +94,17 @@ public class ExamController extends BaseController {
         return AjaxResult.success(iExamService.insertByAddBo(bo));
     }
 
+    /**
+     * 新增试卷
+     */
+    @ApiOperation("批量新增试卷")
+    @PreAuthorize("@ss.hasPermi('system:exam:add')")
+    @Log(title = "试卷", businessType = BusinessType.INSERT)
+    @PostMapping("/addMore")
+    public AjaxResult<List<Long>> addMore(@RequestBody List<ExamAddBo> list) {
+        return AjaxResult.success(iExamService.insertByAddBoMore(list));
+    }
+
     /**
      * 修改试卷
      */

+ 12 - 1
zhongzheng-admin/src/main/java/com/zhongzheng/controller/bank/QuestionChapterController.java

@@ -92,7 +92,18 @@ public class QuestionChapterController extends BaseController {
     @Log(title = "章卷", businessType = BusinessType.INSERT)
     @PostMapping()
     public AjaxResult<Void> add(@RequestBody QuestionChapterAddBo bo) {
-        return toAjax(iQuestionChapterService.insertByAddBo(bo) ? 1 : 0);
+        return toAjax(iQuestionChapterService.insertByAddBo(bo)>0 ? 1 : 0);
+    }
+
+    /**
+     * 新增章卷
+     */
+    @ApiOperation("批量新增章卷")
+    @PreAuthorize("@ss.hasPermi('system:chapter:add')")
+    @Log(title = "章卷", businessType = BusinessType.INSERT)
+    @PostMapping("/addMore")
+    public AjaxResult<List<Long>> addMore(@RequestBody List<QuestionChapterAddBo> list) {
+        return AjaxResult.success(iQuestionChapterService.insertByAddBoMore(list));
     }
 
     /**

+ 11 - 0
zhongzheng-admin/src/main/java/com/zhongzheng/controller/course/CourseChapterController.java

@@ -94,6 +94,17 @@ public class CourseChapterController extends BaseController {
         return AjaxResult.success(iCourseChapterService.insertByAddBo(bo));
     }
 
+    /**
+     * 新增课程大章
+     */
+    @ApiOperation("批量新增课程大章")
+    @PreAuthorize("@ss.hasPermi('system:chapter:add')")
+    @Log(title = "课程大章", businessType = BusinessType.INSERT)
+    @PostMapping("/addMore")
+    public AjaxResult<List<Long>> addMore(@RequestBody List<CourseChapterAddBo> list) {
+        return AjaxResult.success(iCourseChapterService.insertByAddBoMore(list));
+    }
+
     /**
      * 修改课程大章
      */

+ 9 - 1
zhongzheng-admin/src/main/java/com/zhongzheng/controller/course/CourseSectionController.java

@@ -101,7 +101,15 @@ public class CourseSectionController extends BaseController {
     @Log(title = "课程小节", businessType = BusinessType.INSERT)
     @PostMapping()
     public AjaxResult<Void> add(@RequestBody CourseSectionAddBo bo) {
-        return toAjax(iCourseSectionService.insertByAddBo(bo) ? 1 : 0);
+        return toAjax(iCourseSectionService.insertByAddBo(bo)>0? 1 : 0);
+    }
+
+    @ApiOperation("批量新增课程小节")
+    @PreAuthorize("@ss.hasPermi('system:section:add')")
+    @Log(title = "课程小节", businessType = BusinessType.INSERT)
+    @PostMapping("/addMore")
+    public AjaxResult<List<Long>> addMore(@RequestBody List<CourseSectionAddBo> list) {
+        return AjaxResult.success(iCourseSectionService.insertByAddBoMore(list));
     }
 
     /**

+ 1 - 1
zhongzheng-api/src/main/java/com/zhongzheng/controller/cmmon/CommonController.java

@@ -101,7 +101,7 @@ public class CommonController extends BaseController {
         map.put("hide",false);
         if(Validator.isNotEmpty(bo.getVersion())){
             if(bo.getVersion().equals("5.2.5")){
-                map.put("hide",true);
+                map.put("hide",false);
             }
         }
         return AjaxResult.success(map);

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/bo/ExamQueryBo.java

@@ -85,4 +85,6 @@ public class ExamQueryBo extends BaseEntity {
 	private Long projectId;
 	@ApiModelProperty("关键词")
 	private String searchKey;
+	@ApiModelProperty("试卷IDs")
+	private List<Long> examIds;
 }

+ 2 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/bo/QuestionChapterQueryBo.java

@@ -70,5 +70,6 @@ public class QuestionChapterQueryBo extends BaseEntity {
 	/** 项目ID */
 	@ApiModelProperty("项目ID")
 	private Long projectId;
-
+	@ApiModelProperty("章卷IDs")
+	private List<Long> chapterExamIds;
 }

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/bo/QuestionEditBo.java

@@ -80,4 +80,7 @@ public class QuestionEditBo {
     /** 导入顺序 */
     @ApiModelProperty("导入顺序")
     private Integer importSort;
+
+    @ApiModelProperty("题目ID")
+    private List<Long> questionIds;
 }

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/IExamService.java

@@ -37,6 +37,8 @@ public interface IExamService extends IService<Exam> {
 	 */
 	ExamVo insertByAddBo(ExamAddBo bo);
 
+	List<Long> insertByAddBoMore(List<ExamAddBo> list);
+
 	/**
 	 * 根据编辑业务对象修改试卷
 	 * @param bo 试卷编辑业务对象

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

@@ -34,7 +34,9 @@ public interface IQuestionChapterService extends IService<QuestionChapter> {
 	 * @param bo 章卷新增业务对象
 	 * @return
 	 */
-	Boolean insertByAddBo(QuestionChapterAddBo bo);
+	Long insertByAddBo(QuestionChapterAddBo bo);
+
+	List<Long> insertByAddBoMore(List<QuestionChapterAddBo> list);
 
 	/**
 	 * 根据编辑业务对象修改章卷

+ 10 - 4
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/impl/ExamServiceImpl.java

@@ -33,10 +33,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.github.pagehelper.Page;
 import org.springframework.transaction.annotation.Transactional;
 
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.List;
+import java.util.*;
 import java.util.stream.Collectors;
 
 /**
@@ -152,6 +149,15 @@ public class ExamServiceImpl extends ServiceImpl<ExamMapper, Exam> implements IE
         return examVo;
     }
 
+    @Override
+    public List<Long> insertByAddBoMore(List<ExamAddBo> list) {
+        List<Long> ids = new ArrayList<>();
+        for(ExamAddBo bo : list){
+            ids.add(insertByAddBo(bo).getExamId());
+        }
+        return ids;
+    }
+
     @Override
     @Transactional(rollbackFor = Exception.class)
     public Boolean updateByEditBo(ExamEditBo bo) {

+ 13 - 6
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/impl/QuestionChapterServiceImpl.java

@@ -16,6 +16,7 @@ import com.zhongzheng.modules.bank.service.IQuestionChapterExamService;
 import com.zhongzheng.modules.bank.service.IQuestionChapterService;
 import com.zhongzheng.modules.bank.service.IQuestionModuleChapterService;
 import com.zhongzheng.modules.bank.vo.QuestionChapterVo;
+import com.zhongzheng.modules.course.bo.CourseSectionAddBo;
 import com.zhongzheng.modules.goods.domain.GoodsAttached;
 import com.zhongzheng.modules.goods.service.IGoodsAttachedService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -26,10 +27,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.github.pagehelper.Page;
 import org.springframework.transaction.annotation.Transactional;
 
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.List;
+import java.util.*;
 import java.util.stream.Collectors;
 
 /**
@@ -100,7 +98,7 @@ public class QuestionChapterServiceImpl extends ServiceImpl<QuestionChapterMappe
 
     @Override
     @Transactional(rollbackFor = Exception.class)
-    public Boolean insertByAddBo(QuestionChapterAddBo bo) {
+    public Long insertByAddBo(QuestionChapterAddBo bo) {
         QuestionChapter add = BeanUtil.toBean(bo, QuestionChapter.class);
         add.setCode(ServletUtils.getEncoded("ZJ"));
         validEntityBeforeSave(add);
@@ -128,7 +126,16 @@ public class QuestionChapterServiceImpl extends ServiceImpl<QuestionChapterMappe
             }
             iQuestionChapterExamService.saveBatch(coll);
         }
-        return result;
+        return add.getChapterExamId();
+    }
+
+    @Override
+    public List<Long> insertByAddBoMore(List<QuestionChapterAddBo> list) {
+        List<Long> ids = new ArrayList<>();
+        for(QuestionChapterAddBo bo : list){
+            ids.add(insertByAddBo(bo));
+        }
+        return ids;
     }
 
     @Override

+ 80 - 26
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/impl/QuestionServiceImpl.java

@@ -180,27 +180,45 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
     @Override
     @Transactional(rollbackFor = Exception.class)
     public Boolean updateByEditBo(QuestionEditBo bo) {
-        Question update = BeanUtil.toBean(bo, Question.class);
-        if (bo.getOptionsList() != null) {
-            update.setJsonStr(JSON.toJSONString(bo.getOptionsList()));
-        }
-        validEntityBeforeSave(update);
-        update.setUpdateTime(DateUtils.getNowTime());
-        if (bo.getBusinessList() != null) {
-            iQuestionBusinessService.remove(new LambdaQueryWrapper<QuestionBusiness>()
-                    .eq(QuestionBusiness::getMajorId, bo.getQuestionId())
-                    .eq(QuestionBusiness::getType, QuestionBusiness.TYPE_QUESTION));
-            Collection<QuestionBusiness> coll = new HashSet<>();
-            for (int i = 0; i < bo.getBusinessList().size(); i++) {
-                QuestionBusinessEditBo item = bo.getBusinessList().get(i);
-                QuestionBusiness addItem = BeanUtil.toBean(item, QuestionBusiness.class);
-                addItem.setMajorId(bo.getQuestionId());
-                addItem.setType(QuestionBusiness.TYPE_QUESTION);
-                coll.add(addItem);
+        if(bo.getStatus()==-1){
+            //删除
+            if(Validator.isNotEmpty(bo.getQuestionIds())&&bo.getQuestionIds().size()>0){
+                for(Long id : bo.getQuestionIds()){
+                    Question update = new Question();
+                    update.setQuestionId(id);
+                    update.setStatus(-1);
+                }
             }
-            iQuestionBusinessService.saveBatch(coll);
+            if(Validator.isNotEmpty(bo.getQuestionId())){
+                Question update = new Question();
+                update.setQuestionId(bo.getQuestionId());
+                update.setStatus(-1);
+                return this.updateById(update);
+            }
+        }else{
+            Question update = BeanUtil.toBean(bo, Question.class);
+            if (bo.getOptionsList() != null) {
+                update.setJsonStr(JSON.toJSONString(bo.getOptionsList()));
+            }
+            validEntityBeforeSave(update);
+            update.setUpdateTime(DateUtils.getNowTime());
+            if (bo.getBusinessList() != null) {
+                iQuestionBusinessService.remove(new LambdaQueryWrapper<QuestionBusiness>()
+                        .eq(QuestionBusiness::getMajorId, bo.getQuestionId())
+                        .eq(QuestionBusiness::getType, QuestionBusiness.TYPE_QUESTION));
+                Collection<QuestionBusiness> coll = new HashSet<>();
+                for (int i = 0; i < bo.getBusinessList().size(); i++) {
+                    QuestionBusinessEditBo item = bo.getBusinessList().get(i);
+                    QuestionBusiness addItem = BeanUtil.toBean(item, QuestionBusiness.class);
+                    addItem.setMajorId(bo.getQuestionId());
+                    addItem.setType(QuestionBusiness.TYPE_QUESTION);
+                    coll.add(addItem);
+                }
+                iQuestionBusinessService.saveBatch(coll);
+            }
+            return this.updateById(update);
         }
-        return this.updateById(update);
+        return true;
     }
 
     /**
@@ -228,7 +246,9 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
         return this.removeByIds(ids);
     }
 
+
     @Override
+    @Transactional(rollbackFor = Exception.class)
     public List<QuestionImport> importQuestion(List<QuestionImport> questionList, Boolean isUpdateSupport, String operName) {
         if (Validator.isNull(questionList) || questionList.size() == 0) {
             throw new CustomException("导入数据不能为空!");
@@ -238,6 +258,9 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
         int i = 1;
         Long nowTime = DateUtils.getNowTime();
         List<QuestionImport> errorList = new ArrayList<>();
+        Collections.reverse(questionList);
+        //案例附属题数组
+        List<QuestionAddBo> attList = new ArrayList<>();
         for (QuestionImport question : questionList) {
             QuestionAddBo bo = new QuestionAddBo();
 
@@ -252,6 +275,11 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
                 errorList.add(question);
                 continue;
             }
+            if(Validator.isEmpty(question.getAttached())){
+                question.setCause("是否案例小题错误");
+                errorList.add(question);
+                continue;
+            }
            /* if(!Validator.isNotEmpty(question.getPrefixName())){
                 errorLog+=question.getContent()+"-前缀名称空白\n";
                 continue;
@@ -266,28 +294,28 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
             List<QuestionBusinessAddBo> businessList = new ArrayList<>();
             QuestionBusinessAddBo questionBusinessAddBo = new QuestionBusinessAddBo();
             Long eduId = findEduId(question.getEducationType());
-            if (!Validator.isNotEmpty(eduId)) {
+            if (question.getAttached().equals("否")&&!Validator.isNotEmpty(eduId)) {
                 //         errorLog+=question.getEducationType()+"-该教育类型不存在\n";
                 question.setCause("教育类型不存在");
                 errorList.add(question);
                 continue;
             }
             Long projectId = findProjectId(question.getProject(), eduId);
-            if (!Validator.isNotEmpty(projectId)) {
+            if (question.getAttached().equals("否")&&!Validator.isNotEmpty(projectId)) {
                 //        errorLog+=question.getProject()+"-该项目类型不存在\n";
                 question.setCause("项目类型不存在");
                 errorList.add(question);
                 continue;
             }
             Long businessId = findBusinessId(question.getBusiness(), projectId);
-            if (!Validator.isNotEmpty(businessId)) {
+            if (question.getAttached().equals("否")&&!Validator.isNotEmpty(businessId)) {
                 //        errorLog+=question.getBusiness()+"-该业务层次不存在\n";
                 question.setCause("业务层次不存在");
                 errorList.add(question);
                 continue;
             }
             Long subjectId = findSubjectId(question.getSubject());
-            if (!Validator.isNotEmpty(subjectId)) {
+            if (question.getAttached().equals("否")&&!Validator.isNotEmpty(subjectId)) {
                 //        errorLog+=question.getSubject()+"-该科目不存在\n";
                 question.setCause("科目不存在");
                 errorList.add(question);
@@ -338,9 +366,31 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
             bo.setPublishStatus(1);
             bo.setImportSort(nowTime + i); //导入时间从小到大排
             bo.setCreateTime(nowTime); //从大到小排
-            errorLog = insertByAddBoImport(bo, i);
+            System.out.println(question);
+            if (question.getAttached().equals("是")){
+                System.out.println("123");
+                attList.add(bo);
+            }else{
+                System.out.println(bo);
+                System.out.println("CCVF"+bo.getType());
+                if(bo.getType()==4){//案例题
+                    Collections.reverse(attList);
+                    System.out.println("777");
+                    bo.setJsonStr(JSON.toJSONString(attList));
+                    System.out.println("666");
+                    attList.clear();
+                }else {
+
+                    System.out.println(errorList);
+                    if(attList.size()>0){
+                        throw new CustomException("案例题格式错误");
+                    }
+                }
+                errorLog = insertByAddBoImport(bo, i);
+            }
             i++;
         }
+
         return errorList;
     }
 
@@ -448,6 +498,7 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
                 String strContent = "";
                 for (XWPFParagraph paragraph : paragraphList) {
                     content = paragraph.getText();
+                    content = dealTxt(content);
                     List<XWPFRun> runs = paragraph.getRuns();
                     for (XWPFRun run : runs) {
                         Node node = run.getCTR().getDomNode();
@@ -486,10 +537,13 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
                                 e.printStackTrace();
                             }
                             String imgUrl = ossHost + "/" + ossPath + "?x-oss-process=image/resize,w_" + wPx + ",h_" + HPx;
-                            content = "<p><img src=\"" + imgUrl + "\"></p>";
+                            if(Validator.isNotEmpty(content)&&content!=""){
+                                content =  content +"<br />" +"<p><img src=\"" + imgUrl + "\"></p>";
+                            }else{
+                                content = "<p><img src=\"" + imgUrl + "\"></p>";
+                            }
                         }
                     }
-                    content = dealTxt(content);
                     if (content.startsWith("#")||isQuestionStart(content)) {
                         if(nowPart>0){
                             //插入上一条

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/vo/QuestionImport.java

@@ -38,6 +38,9 @@ public class QuestionImport implements Serializable {
     @Excel(name = "题目类型")
     private String type;
 
+    @Excel(name = "是否案例小题")
+    private String attached;
+
     @Excel(name = "正确答案")
     private String answerQuestion;
 

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/bo/CourseChapterQueryBo.java

@@ -69,4 +69,6 @@ public class CourseChapterQueryBo extends BaseEntity {
 	/** 科目id */
 	@ApiModelProperty("科目id")
 	private Long subjectId;
+
+	private List<Long> chapterIds;
 }

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/bo/CourseSectionQueryBo.java

@@ -83,4 +83,6 @@ public class CourseSectionQueryBo extends BaseEntity {
 	private Long subjectId;
 	@ApiModelProperty("导入编号")
 	private String importNo;
+	@ApiModelProperty("节ID数组")
+	private List<Long> sectionIds;
 }

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/ICourseChapterService.java

@@ -39,6 +39,8 @@ public interface ICourseChapterService extends IService<CourseChapter> {
 	 */
 	Long insertByAddBo(CourseChapterAddBo bo);
 
+	List<Long> insertByAddBoMore(List<CourseChapterAddBo> list);
+
 	/**
 	 * 根据编辑业务对象修改课程大章
 	 * @param bo 课程大章编辑业务对象

+ 3 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/ICourseSectionService.java

@@ -41,7 +41,9 @@ public interface ICourseSectionService extends IService<CourseSection> {
 	 * @param bo 课程小节新增业务对象
 	 * @return
 	 */
-	Boolean insertByAddBo(CourseSectionAddBo bo);
+	Long insertByAddBo(CourseSectionAddBo bo);
+
+	List<Long> insertByAddBoMore(List<CourseSectionAddBo> list);
 
 	/**
 	 * 根据编辑业务对象修改课程小节

+ 10 - 4
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseChapterServiceImpl.java

@@ -23,10 +23,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.github.pagehelper.Page;
 import org.springframework.transaction.annotation.Transactional;
 
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.List;
+import java.util.*;
 import java.util.stream.Collectors;
 
 /**
@@ -131,6 +128,15 @@ public class CourseChapterServiceImpl extends ServiceImpl<CourseChapterMapper, C
         return add.getChapterId();
     }
 
+    @Override
+    public List<Long> insertByAddBoMore(List<CourseChapterAddBo> list) {
+        List<Long> ids = new ArrayList<>();
+        for(CourseChapterAddBo bo : list){
+            ids.add(insertByAddBo(bo));
+        }
+        return ids;
+    }
+
     @Override
     @Transactional(rollbackFor = Exception.class)
     public Boolean updateByEditBo(CourseChapterEditBo bo) {

+ 12 - 6
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseSectionServiceImpl.java

@@ -14,10 +14,7 @@ import com.zhongzheng.modules.bank.bo.QuestionBusinessAddBo;
 import com.zhongzheng.modules.bank.domain.Question;
 import com.zhongzheng.modules.bank.domain.QuestionBusiness;
 import com.zhongzheng.modules.bank.vo.QuestionImport;
-import com.zhongzheng.modules.course.bo.CourseSectionAddBo;
-import com.zhongzheng.modules.course.bo.CourseSectionBusinessAddBo;
-import com.zhongzheng.modules.course.bo.CourseSectionEditBo;
-import com.zhongzheng.modules.course.bo.CourseSectionQueryBo;
+import com.zhongzheng.modules.course.bo.*;
 import com.zhongzheng.modules.course.domain.*;
 import com.zhongzheng.modules.course.mapper.CourseSectionMapper;
 import com.zhongzheng.modules.course.service.*;
@@ -127,7 +124,7 @@ public class CourseSectionServiceImpl extends ServiceImpl<CourseSectionMapper, C
     }
 
     @Override
-    public Boolean insertByAddBo(CourseSectionAddBo bo) {
+    public Long insertByAddBo(CourseSectionAddBo bo) {
         CourseSection add = BeanUtil.toBean(bo, CourseSection.class);
         add.setCode(ServletUtils.getEncoded("J"));
         validEntityBeforeSave(add);
@@ -141,7 +138,16 @@ public class CourseSectionServiceImpl extends ServiceImpl<CourseSectionMapper, C
                 iCourseSectionBusinessService.insertByAddBo(item);
             }
         }
-        return result;
+        return add.getSectionId();
+    }
+
+    @Override
+    public List<Long> insertByAddBoMore(List<CourseSectionAddBo> list) {
+        List<Long> ids = new ArrayList<>();
+        for(CourseSectionAddBo bo : list){
+            ids.add(insertByAddBo(bo));
+        }
+        return ids;
     }
 
     @Override

+ 6 - 6
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/service/impl/OrderServiceImpl.java

@@ -287,7 +287,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
             //订单商品
             Goods goods = iGoodsService.getOne(new LambdaQueryWrapper<Goods>().eq(Goods::getGoodsId, g.getGoodsId()));
             if (goods.getGoodsStatus() != 1) {
-                throw new CustomException("商品尚未上架");
+                throw new CustomException(goods.getGoodsName()+"商品已下架,请重新选择商品下单");
             }
             OrderGoods orderGoods = BeanUtil.toBean(g, OrderGoods.class);
             orderGoods.setOrderSn(out_trade_no);
@@ -422,7 +422,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
             //订单商品
             Goods goods = iGoodsService.getOne(new LambdaQueryWrapper<Goods>().eq(Goods::getGoodsId, g.getGoodsId()));
             if (goods.getGoodsStatus() != 1) {
-                throw new CustomException("商品尚未上架", 510);
+                throw new CustomException(goods.getGoodsName()+"商品已下架,请重新选择商品下单", 510);
             }
             OrderGoods orderGoods = BeanUtil.toBean(g, OrderGoods.class);
             orderGoods.setOrderSn(out_trade_no);
@@ -594,7 +594,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
             //订单商品
             Goods goods = iGoodsService.getOne(new LambdaQueryWrapper<Goods>().eq(Goods::getGoodsId, g.getGoodsId()));
             if (goods.getGoodsStatus() != 1) {
-                throw new CustomException("商品尚未上架");
+                throw new CustomException(goods.getGoodsName()+"商品已下架,请重新选择商品下单");
             }
             body = "中正祥粤云-" + goods.getGoodsName();
             OrderGoods orderGoods = BeanUtil.toBean(g, OrderGoods.class);
@@ -737,7 +737,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
             //订单商品
             Goods goods = iGoodsService.getOne(new LambdaQueryWrapper<Goods>().eq(Goods::getGoodsId, g.getGoodsId()));
             if (goods.getGoodsStatus() != 1) {
-                throw new CustomException("商品尚未上架");
+                throw new CustomException(goods.getGoodsName()+"商品已下架,请重新选择商品下单");
             }
             body = "中正祥粤云-" + goods.getGoodsName();
             OrderGoods orderGoods = BeanUtil.toBean(g, OrderGoods.class);
@@ -877,7 +877,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
             for (OrderGoods g : goodsList) {
                 Goods goods = iGoodsService.getOne(new LambdaQueryWrapper<Goods>().eq(Goods::getGoodsId, g.getGoodsId()));
                 if (goods.getGoodsStatus() != 1) {
-                    throw new CustomException("商品尚未上架");
+                    throw new CustomException(goods.getGoodsName()+"商品已下架,请重新选择商品下单");
                 }
                 body = "中正祥粤云-" + goods.getGoodsName();
                 break;
@@ -993,7 +993,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
             for (OrderGoods g : goodsList) {
                 Goods goods = iGoodsService.getOne(new LambdaQueryWrapper<Goods>().eq(Goods::getGoodsId, g.getGoodsId()));
                 if (goods.getGoodsStatus() != 1) {
-                    throw new CustomException("商品尚未上架");
+                    throw new CustomException(goods.getGoodsName()+"商品已下架,请重新选择商品下单");
                 }
                 body = "中正祥粤云-" + goods.getGoodsName();
                 break;

+ 3 - 4
zhongzheng-system/src/main/java/com/zhongzheng/modules/tencentcloud/service/impl/FaceOcrServiceImpl.java

@@ -209,17 +209,16 @@ public class FaceOcrServiceImpl implements IFaceOcrService {
     @Override
     public Integer idCardCompareFace(FaceQueryBo bo) {
         try{
-            if(Validator.isEmpty(bo.getOrderGoodsId())){
-                throw new CustomException("缺少参数");
+            if(Validator.isEmpty(bo.getUrlA())||Validator.isEmpty(bo.getOneInchPhotos())){
+                throw new CustomException("参数错误");
             }
-
             String oneInchPhotos =bo.getOneInchPhotos();
             Credential cred = new Credential(SecretId, SecretKey);
             ClientProfile clientProfile = new ClientProfile();
             clientProfile.setSignMethod(clientProfile.SIGN_TC3_256);
             IaiClient iaiClient = new IaiClient(cred,"ap-guangzhou");
             CompareFaceRequest faceRequest = new CompareFaceRequest();
-            faceRequest.setUrlA(ossHost+"/"+bo.getImageA()); //身份证照片OSS URL
+            faceRequest.setUrlA(ossHost+"/"+bo.getUrlA()); //身份证照片OSS URL
             faceRequest.setImageB(oneInchPhotos); //一寸近照
             CompareFaceResponse response = iaiClient.CompareFace(faceRequest);
             return response.getScore().intValue();

+ 1 - 0
zhongzheng-system/src/main/resources/mapper/modules/activity/ActivityRecommendMapper.xml

@@ -58,6 +58,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                 LEFT JOIN goods g ON rg.goods_id = g.goods_id
         WHERE
             rg.recommend_id = #{recommend_id}
+        and g.goods_status = 1 and g.`status` = 1
         order by rg.sort asc
     </select>
 

+ 6 - 0
zhongzheng-system/src/main/resources/mapper/modules/bank/ExamMapper.xml

@@ -97,6 +97,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                 #{item}
             </foreach>
         </if>
+        <if test="examIds != null and examIds.size()!=0 ">
+            AND e.exam_id in
+            <foreach collection="examIds" item="item" index="index" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
         <if test="educationTypeId != null and educationTypeId != ''">
             AND cet.id = #{educationTypeId}
         </if>

+ 6 - 0
zhongzheng-system/src/main/resources/mapper/modules/bank/QuestionChapterMapper.xml

@@ -75,6 +75,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         LEFT JOIN course_business cb ON qb.business_id = cb.id AND cb.status =1
         LEFT JOIN course_subject cs ON cs.id = qb.subject_id  AND cs.status =1
         where 1=1
+        <if test="chapterExamIds != null and chapterExamIds.size()!=0 ">
+            AND qc.chapter_exam_id in
+            <foreach collection="chapterExamIds" item="item" index="index" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
         <if test="status != null and status.size()!=0 ">
             AND qc.status in
             <foreach collection="status" item="item" index="index" open="(" close=")" separator=",">

+ 6 - 0
zhongzheng-system/src/main/resources/mapper/modules/course/CourseChapterMapper.xml

@@ -149,6 +149,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <if test="prefixName != null and prefixName != ''">
             AND c.prefix_name like concat('%', #{prefixName}, '%')
         </if>
+        <if test="chapterIds != null and chapterIds.size()!=0 ">
+            AND c.chapter_id in
+            <foreach collection="chapterIds" item="item" index="index" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
         GROUP BY
         c.chapter_id
         ORDER BY c.chapter_id DESC

+ 6 - 0
zhongzheng-system/src/main/resources/mapper/modules/course/CourseSectionMapper.xml

@@ -149,6 +149,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                 #{item}
             </foreach>
         </if>
+        <if test="sectionIds != null and sectionIds.size()!=0 ">
+            AND c.section_id in
+            <foreach collection="sectionIds" item="item" index="index" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
         <if test="importNo != null and importNo != ''">
             AND c.import_no = #{importNo}
         </if>

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

@@ -1167,7 +1167,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="getStudyStatus" parameterType="com.zhongzheng.modules.grade.vo.ClassPeriodVo" resultType="Integer">
         SELECT
-            IFNULL(status,-1)
+            IFNULL(MAX(status),-1)
         FROM
             user_study_record
         WHERE