he2802 3 năm trước cách đây
mục cha
commit
8719f049d4
32 tập tin đã thay đổi với 309 bổ sung16 xóa
  1. 10 0
      zhongzheng-admin/src/main/java/com/zhongzheng/controller/bank/ExamController.java
  2. 9 0
      zhongzheng-admin/src/main/java/com/zhongzheng/controller/bank/QuestionChapterController.java
  3. 9 0
      zhongzheng-admin/src/main/java/com/zhongzheng/controller/bank/QuestionController.java
  4. 10 0
      zhongzheng-admin/src/main/java/com/zhongzheng/controller/bank/QuestionModuleController.java
  5. 10 0
      zhongzheng-admin/src/main/java/com/zhongzheng/controller/course/CourseChapterController.java
  6. 10 0
      zhongzheng-admin/src/main/java/com/zhongzheng/controller/course/CourseController.java
  7. 10 0
      zhongzheng-admin/src/main/java/com/zhongzheng/controller/course/CourseModuleController.java
  8. 10 0
      zhongzheng-admin/src/main/java/com/zhongzheng/controller/course/CourseSectionController.java
  9. 25 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/bo/QuestionBatchDelBo.java
  10. 3 4
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/IExamService.java
  11. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/IQuestionChapterService.java
  12. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/IQuestionModuleService.java
  13. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/IQuestionService.java
  14. 12 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/impl/ExamServiceImpl.java
  15. 13 4
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/impl/QuestionChapterServiceImpl.java
  16. 13 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/impl/QuestionModuleServiceImpl.java
  17. 13 4
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/impl/QuestionServiceImpl.java
  18. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/ICourseChapterService.java
  19. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/ICourseModuleService.java
  20. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/ICourseSectionService.java
  21. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/ICourseService.java
  22. 13 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseChapterServiceImpl.java
  23. 12 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseModuleServiceImpl.java
  24. 13 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseSectionServiceImpl.java
  25. 12 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseServiceImpl.java
  26. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/bo/GoodsAttachedQueryBo.java
  27. 1 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/bo/GoodsBatchDelBo.java
  28. 4 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/mapper/GoodsAttachedMapper.java
  29. 16 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/impl/GoodsAttachedServiceImpl.java
  30. 2 2
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/impl/GoodsServiceImpl.java
  31. 24 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/vo/GoodsAttachedPaperVo.java
  32. 32 0
      zhongzheng-system/src/main/resources/mapper/modules/goods/GoodsAttachedMapper.xml

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

@@ -60,6 +60,16 @@ public class ExamController extends BaseController {
         return getDataTable(list);
     }
 
+    /**
+     * 试卷批量删除
+     */
+    @ApiOperation("试卷批量删除")
+    @PostMapping("/batch/del")
+    public AjaxResult<Void> batchDelExam(@RequestBody QuestionBatchDelBo bo) {
+        return toAjax(iExamService.batchDelExam(bo) ? 1 : 0);
+    }
+
+
     /**
      * 导出试卷列表
      */

+ 9 - 0
zhongzheng-admin/src/main/java/com/zhongzheng/controller/bank/QuestionChapterController.java

@@ -61,6 +61,15 @@ public class QuestionChapterController extends BaseController {
         return getDataTable(list);
     }
 
+    /**
+     * 章卷批量删除
+     */
+    @ApiOperation("章卷批量删除")
+    @PostMapping("/batch/del")
+    public AjaxResult<Void> batchDelChapterExam(@RequestBody QuestionBatchDelBo bo) {
+        return toAjax(iQuestionChapterService.batchDelChapterExam(bo) ? 1 : 0);
+    }
+
     /**
      * 导出章卷列表
      */

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

@@ -80,6 +80,15 @@ public class QuestionController extends BaseController {
         return getDataTable(list);
     }
 
+    /**
+     * 题目批量删除
+     */
+    @ApiOperation("题目批量删除")
+    @PostMapping("/batch/del")
+    public AjaxResult<Void> batchDelQuestion(@RequestBody QuestionBatchDelBo bo) {
+        return toAjax(iQuestionService.batchDelQuestion(bo) ? 1 : 0);
+    }
+
     /**
      * 导出题库题目列表
      */

+ 10 - 0
zhongzheng-admin/src/main/java/com/zhongzheng/controller/bank/QuestionModuleController.java

@@ -13,6 +13,7 @@ import com.zhongzheng.modules.bank.service.IQuestionModuleService;
 import com.zhongzheng.modules.bank.vo.ExamQuestionVo;
 import com.zhongzheng.modules.bank.vo.QuestionChapterVo;
 import com.zhongzheng.modules.bank.vo.QuestionModuleVo;
+import com.zhongzheng.modules.goods.bo.GoodsBatchDelBo;
 import lombok.RequiredArgsConstructor;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -63,6 +64,15 @@ public class QuestionModuleController extends BaseController {
         return getDataTable(list);
     }
 
+    /**
+     * 模块卷批量删除
+     */
+    @ApiOperation("模块卷批量删除")
+    @PostMapping("/batch/del")
+    public AjaxResult<Void> batchDelModuleExam(@RequestBody QuestionBatchDelBo bo) {
+        return toAjax(iQuestionModuleService.batchDelModuleExam(bo) ? 1 : 0);
+    }
+
     /**
      * 导出题目模块列表
      */

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

@@ -12,6 +12,7 @@ import com.zhongzheng.modules.course.service.ICourseChapterBusinessService;
 import com.zhongzheng.modules.course.service.ICourseChapterService;
 import com.zhongzheng.modules.course.service.ICourseSectionBusinessService;
 import com.zhongzheng.modules.course.vo.CourseChapterVo;
+import com.zhongzheng.modules.goods.bo.GoodsBatchDelBo;
 import lombok.RequiredArgsConstructor;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -60,6 +61,15 @@ public class CourseChapterController extends BaseController {
         return getDataTable(list);
     }
 
+    /**
+     * 章批量删除
+     */
+    @ApiOperation("章批量删除")
+    @PostMapping("/batch/del")
+    public AjaxResult<Void> batchDelChapter(@RequestBody GoodsBatchDelBo bo) {
+        return toAjax(iCourseChapterService.batchDelChapter(bo) ? 1 : 0);
+    }
+
     /**
      * 导出课程大章列表
      */

+ 10 - 0
zhongzheng-admin/src/main/java/com/zhongzheng/controller/course/CourseController.java

@@ -11,6 +11,7 @@ import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import com.zhongzheng.modules.course.bo.*;
 import com.zhongzheng.modules.course.service.ICourseService;
 import com.zhongzheng.modules.course.vo.CourseVo;
+import com.zhongzheng.modules.goods.bo.GoodsBatchDelBo;
 import com.zhongzheng.modules.goods.vo.ExportLiveGoodsVo;
 import com.zhongzheng.modules.order.vo.OrderGoodsLiveExportVo;
 import com.zhongzheng.modules.order.vo.OrderGoodsVo;
@@ -62,6 +63,15 @@ public class CourseController extends BaseController {
         return getDataTable(list);
     }
 
+    /**
+     * 课程批量删除
+     */
+    @ApiOperation("课程批量删除")
+    @PostMapping("/batch/del")
+    public AjaxResult<Void> batchDelCourse(@RequestBody GoodsBatchDelBo bo) {
+        return toAjax(iCourseService.batchDelCourse(bo) ? 1 : 0);
+    }
+
     /**
      * 导出课程列表
      */

+ 10 - 0
zhongzheng-admin/src/main/java/com/zhongzheng/controller/course/CourseModuleController.java

@@ -23,6 +23,7 @@ import com.zhongzheng.modules.course.service.ICourseSectionService;
 import com.zhongzheng.modules.course.vo.CourseChapterSectionImport;
 import com.zhongzheng.modules.course.vo.CourseModuleVo;
 import com.zhongzheng.modules.course.vo.CourseSectionImport;
+import com.zhongzheng.modules.goods.bo.GoodsBatchDelBo;
 import lombok.RequiredArgsConstructor;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -77,6 +78,15 @@ public class CourseModuleController extends BaseController {
         return getDataTable(list);
     }
 
+    /**
+     * 模块批量删除
+     */
+    @ApiOperation("模块批量删除")
+    @PostMapping("/batch/del")
+    public AjaxResult<Void> batchDelModule(@RequestBody GoodsBatchDelBo bo) {
+        return toAjax(iCourseModuleService.batchDelModule(bo) ? 1 : 0);
+    }
+
     /**
      * 导出课程模块列表
      */

+ 10 - 0
zhongzheng-admin/src/main/java/com/zhongzheng/controller/course/CourseSectionController.java

@@ -20,6 +20,7 @@ import com.zhongzheng.modules.course.service.ICourseSectionWatchPerService;
 import com.zhongzheng.modules.course.vo.CourseSectionImport;
 import com.zhongzheng.modules.course.vo.CourseSectionVo;
 import com.zhongzheng.modules.course.vo.CourseSectionWatchPerVo;
+import com.zhongzheng.modules.goods.bo.GoodsBatchDelBo;
 import lombok.RequiredArgsConstructor;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -74,6 +75,15 @@ public class CourseSectionController extends BaseController {
         return getDataTable(list);
     }
 
+    /**
+     * 节批量删除
+     */
+    @ApiOperation("节批量删除")
+    @PostMapping("/batch/del")
+    public AjaxResult<Void> batchDelSection(@RequestBody GoodsBatchDelBo bo) {
+        return toAjax(iCourseSectionService.batchDelSection(bo) ? 1 : 0);
+    }
+
     /**
      * 导出课程小节列表
      */

+ 25 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/bo/QuestionBatchDelBo.java

@@ -0,0 +1,25 @@
+package com.zhongzheng.modules.bank.bo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.List;
+
+
+/**
+ * 批量删除
+ *
+ * @author  hjl
+ * @date 2021-10-28
+ */
+@Data
+@ApiModel("批量删除")
+public class QuestionBatchDelBo {
+
+    @ApiModelProperty("商品id集合")
+    private List<Long> ids;
+
+    @ApiModelProperty("状态 1有效 0无效")
+    private Integer status;
+}

+ 3 - 4
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/IExamService.java

@@ -1,10 +1,7 @@
 package com.zhongzheng.modules.bank.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
-import com.zhongzheng.modules.bank.bo.ExamAddBo;
-import com.zhongzheng.modules.bank.bo.ExamEditBo;
-import com.zhongzheng.modules.bank.bo.ExamQueryBo;
-import com.zhongzheng.modules.bank.bo.QuestionChapterExamQueryBo;
+import com.zhongzheng.modules.bank.bo.*;
 import com.zhongzheng.modules.bank.domain.Exam;
 import com.zhongzheng.modules.bank.vo.ExamVo;
 import com.zhongzheng.modules.exam.bo.ExamPaperQueryBo;
@@ -58,4 +55,6 @@ public interface IExamService extends IService<Exam> {
 	ExamVo getNextExam(QuestionChapterExamQueryBo bo);
 
 	List<ExamVo> getPaperExamList(ExamPaperQueryBo bo);
+
+    boolean batchDelExam(QuestionBatchDelBo bo);
 }

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

@@ -1,6 +1,7 @@
 package com.zhongzheng.modules.bank.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.zhongzheng.modules.bank.bo.QuestionBatchDelBo;
 import com.zhongzheng.modules.bank.bo.QuestionChapterAddBo;
 import com.zhongzheng.modules.bank.bo.QuestionChapterEditBo;
 import com.zhongzheng.modules.bank.bo.QuestionChapterQueryBo;
@@ -56,4 +57,6 @@ public interface IQuestionChapterService extends IService<QuestionChapter> {
 	 * @return
 	 */
 	Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
+
+    boolean batchDelChapterExam(QuestionBatchDelBo bo);
 }

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

@@ -1,6 +1,7 @@
 package com.zhongzheng.modules.bank.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.zhongzheng.modules.bank.bo.QuestionBatchDelBo;
 import com.zhongzheng.modules.bank.bo.QuestionModuleAddBo;
 import com.zhongzheng.modules.bank.bo.QuestionModuleEditBo;
 import com.zhongzheng.modules.bank.bo.QuestionModuleQueryBo;
@@ -51,4 +52,6 @@ public interface IQuestionModuleService extends IService<QuestionModule> {
 	 * @return
 	 */
 	Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
+
+    boolean batchDelModuleExam(QuestionBatchDelBo bo);
 }

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

@@ -4,6 +4,7 @@ package com.zhongzheng.modules.bank.service;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.zhongzheng.common.core.domain.entity.SysUser;
 import com.zhongzheng.modules.bank.bo.QuestionAddBo;
+import com.zhongzheng.modules.bank.bo.QuestionBatchDelBo;
 import com.zhongzheng.modules.bank.bo.QuestionEditBo;
 import com.zhongzheng.modules.bank.bo.QuestionQueryBo;
 import com.zhongzheng.modules.bank.domain.Question;
@@ -80,4 +81,6 @@ public interface IQuestionService extends IService<Question> {
     String importWordQuestion(MultipartFile file, Long eduId, Long projectId, Long businessId, Long subjectId);
 
 	Map<String,Object> importWordQuestionList(MultipartFile file, Long eduId, Long projectId, Long businessId, Long subjectId);
+
+    boolean batchDelQuestion(QuestionBatchDelBo bo);
 }

+ 12 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/impl/ExamServiceImpl.java

@@ -3,6 +3,8 @@ package com.zhongzheng.modules.bank.service.impl;
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.lang.Validator;
 import cn.hutool.core.util.StrUtil;
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.zhongzheng.common.exception.CustomException;
 import com.zhongzheng.common.utils.DateUtils;
 import com.zhongzheng.common.utils.ServletUtils;
@@ -274,4 +276,14 @@ public class ExamServiceImpl extends ServiceImpl<ExamMapper, Exam> implements IE
     public List<ExamVo> getPaperExamList(ExamPaperQueryBo bo) {
         return this.baseMapper.getPaperExamList(bo);
     }
+
+    @Override
+    public boolean batchDelExam(QuestionBatchDelBo bo) {
+        if (CollectionUtils.isEmpty(bo.getIds())){
+            throw new CustomException("试卷ID不能为空");
+        }
+        return update(new LambdaUpdateWrapper<Exam>()
+                .set(Exam::getStatus,bo.getStatus())
+                .in(Exam::getExamId,bo.getIds()));
+    }
 }

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

@@ -2,14 +2,13 @@ package com.zhongzheng.modules.bank.service.impl;
 
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.util.StrUtil;
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.zhongzheng.common.exception.CustomException;
 import com.zhongzheng.common.utils.DateUtils;
 import com.zhongzheng.common.utils.ServletUtils;
 import com.zhongzheng.modules.bank.bo.*;
-import com.zhongzheng.modules.bank.domain.QuestionBusiness;
-import com.zhongzheng.modules.bank.domain.QuestionChapter;
-import com.zhongzheng.modules.bank.domain.QuestionChapterExam;
-import com.zhongzheng.modules.bank.domain.QuestionModuleChapter;
+import com.zhongzheng.modules.bank.domain.*;
 import com.zhongzheng.modules.bank.mapper.QuestionChapterMapper;
 import com.zhongzheng.modules.bank.service.IQuestionBusinessService;
 import com.zhongzheng.modules.bank.service.IQuestionChapterExamService;
@@ -204,4 +203,14 @@ public class QuestionChapterServiceImpl extends ServiceImpl<QuestionChapterMappe
         }
         return this.removeByIds(ids);
     }
+
+    @Override
+    public boolean batchDelChapterExam(QuestionBatchDelBo bo) {
+        if (CollectionUtils.isEmpty(bo.getIds())){
+            throw new CustomException("章卷ID不能为空");
+        }
+        return update(new LambdaUpdateWrapper<QuestionChapter>()
+                .set(QuestionChapter::getStatus,bo.getStatus())
+                .in(QuestionChapter::getChapterExamId,bo.getIds()));
+    }
 }

+ 13 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/impl/QuestionModuleServiceImpl.java

@@ -2,6 +2,8 @@ package com.zhongzheng.modules.bank.service.impl;
 
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.util.StrUtil;
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.zhongzheng.common.exception.CustomException;
 import com.zhongzheng.common.utils.DateUtils;
 import com.zhongzheng.common.utils.ServletUtils;
@@ -14,6 +16,7 @@ import com.zhongzheng.modules.bank.service.IQuestionBusinessService;
 import com.zhongzheng.modules.bank.service.IQuestionModuleChapterService;
 import com.zhongzheng.modules.bank.service.IQuestionModuleService;
 import com.zhongzheng.modules.bank.vo.QuestionModuleVo;
+import com.zhongzheng.modules.course.domain.CourseModule;
 import com.zhongzheng.modules.goods.domain.GoodsAttached;
 import com.zhongzheng.modules.goods.service.IGoodsAttachedService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -181,4 +184,14 @@ public class QuestionModuleServiceImpl extends ServiceImpl<QuestionModuleMapper,
         }
         return this.removeByIds(ids);
     }
+
+    @Override
+    public boolean batchDelModuleExam(QuestionBatchDelBo bo) {
+        if (CollectionUtils.isEmpty(bo.getIds())){
+            throw new CustomException("模块卷ID不能为空");
+        }
+        return update(new LambdaUpdateWrapper<QuestionModule>()
+                .set(QuestionModule::getStatus,bo.getStatus())
+                .in(QuestionModule::getModuleExamId,bo.getIds()));
+    }
 }

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

@@ -5,6 +5,8 @@ import cn.hutool.core.lang.Validator;
 import cn.hutool.core.util.StrUtil;
 import cn.hutool.extra.tokenizer.Word;
 import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.zhongzheng.common.constant.Constants;
 import com.zhongzheng.common.core.domain.entity.SysUser;
 import com.zhongzheng.common.core.redis.RedisCache;
@@ -15,10 +17,7 @@ import com.zhongzheng.common.utils.ServletUtils;
 import com.zhongzheng.common.utils.ToolsUtils;
 import com.zhongzheng.modules.alioss.service.OssService;
 import com.zhongzheng.modules.bank.bo.*;
-import com.zhongzheng.modules.bank.domain.ExamQuestion;
-import com.zhongzheng.modules.bank.domain.Question;
-import com.zhongzheng.modules.bank.domain.QuestionBusiness;
-import com.zhongzheng.modules.bank.domain.QuestionModuleChapter;
+import com.zhongzheng.modules.bank.domain.*;
 import com.zhongzheng.modules.bank.mapper.QuestionMapper;
 import com.zhongzheng.modules.bank.service.IExamQuestionService;
 import com.zhongzheng.modules.bank.service.IQuestionBusinessService;
@@ -1716,6 +1715,16 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
         return result;
     }
 
+    @Override
+    public boolean batchDelQuestion(QuestionBatchDelBo bo) {
+        if (CollectionUtils.isEmpty(bo.getIds())){
+            throw new CustomException("题目ID不能为空");
+        }
+        return update(new LambdaUpdateWrapper<Question>()
+                .set(Question::getStatus,bo.getStatus())
+                .in(Question::getQuestionId,bo.getIds()));
+    }
+
 
     private String removeNo(String txt) {
         int intIndex = txt.indexOf("、");

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

@@ -6,6 +6,7 @@ import com.zhongzheng.modules.course.bo.CourseChapterEditBo;
 import com.zhongzheng.modules.course.bo.CourseChapterQueryBo;
 import com.zhongzheng.modules.course.domain.CourseChapter;
 import com.zhongzheng.modules.course.vo.CourseChapterVo;
+import com.zhongzheng.modules.goods.bo.GoodsBatchDelBo;
 
 import java.util.Collection;
 import java.util.List;
@@ -55,4 +56,6 @@ public interface ICourseChapterService extends IService<CourseChapter> {
 	 * @return
 	 */
 	Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
+
+    boolean batchDelChapter(GoodsBatchDelBo bo);
 }

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/ICourseModuleService.java

@@ -6,6 +6,7 @@ import com.zhongzheng.modules.course.bo.CourseModuleEditBo;
 import com.zhongzheng.modules.course.bo.CourseModuleQueryBo;
 import com.zhongzheng.modules.course.domain.CourseModule;
 import com.zhongzheng.modules.course.vo.CourseModuleVo;
+import com.zhongzheng.modules.goods.bo.GoodsBatchDelBo;
 
 import java.util.Collection;
 import java.util.List;
@@ -51,4 +52,6 @@ public interface ICourseModuleService extends IService<CourseModule> {
 	 * @return
 	 */
 	Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
+
+    boolean batchDelModule(GoodsBatchDelBo bo);
 }

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

@@ -11,6 +11,7 @@ import com.zhongzheng.modules.course.domain.CourseSection;
 import com.zhongzheng.modules.course.vo.CourseChapterSectionImport;
 import com.zhongzheng.modules.course.vo.CourseSectionImport;
 import com.zhongzheng.modules.course.vo.CourseSectionVo;
+import com.zhongzheng.modules.goods.bo.GoodsBatchDelBo;
 import net.polyv.live.v1.entity.chat.LiveGetMessageListResponse;
 import org.apache.ibatis.annotations.Param;
 
@@ -74,4 +75,6 @@ public interface ICourseSectionService extends IService<CourseSection> {
 	List<CourseSectionVo> livingSectionList(Long userId);
 
 	List<LiveGetMessageListResponse.MessageList> GetHistoryChatMsg(CourseSectionQueryBo bo) throws IOException, NoSuchAlgorithmException;
+
+    boolean batchDelSection(GoodsBatchDelBo bo);
 }

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/ICourseService.java

@@ -7,6 +7,7 @@ import com.zhongzheng.modules.course.bo.*;
 import com.zhongzheng.modules.course.domain.Course;
 import com.zhongzheng.modules.course.vo.CourseUserVo;
 import com.zhongzheng.modules.course.vo.CourseVo;
+import com.zhongzheng.modules.goods.bo.GoodsBatchDelBo;
 import com.zhongzheng.modules.goods.vo.GoodsPeriodStatusVo;
 import com.zhongzheng.modules.goods.vo.GoodsPeriodVo;
 import com.zhongzheng.modules.goods.vo.GoodsUserVo;
@@ -76,4 +77,6 @@ public interface ICourseService extends IService<Course> {
 	CourseUserVo getCourseUserVoInfo(Long courseId);
 
 	Long rebuildNext(ClassGradeUserQueryBo bo);
+
+    boolean batchDelCourse(GoodsBatchDelBo bo);
 }

+ 13 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseChapterServiceImpl.java

@@ -3,6 +3,8 @@ package com.zhongzheng.modules.course.service.impl;
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.lang.Validator;
 import cn.hutool.core.util.StrUtil;
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.zhongzheng.common.exception.CustomException;
 import com.zhongzheng.common.utils.DateUtils;
 import com.zhongzheng.common.utils.ServletUtils;
@@ -14,6 +16,7 @@ import com.zhongzheng.modules.course.mapper.CourseChapterMapper;
 import com.zhongzheng.modules.course.mapper.CourseSectionMapper;
 import com.zhongzheng.modules.course.service.*;
 import com.zhongzheng.modules.course.vo.CourseChapterVo;
+import com.zhongzheng.modules.goods.bo.GoodsBatchDelBo;
 import com.zhongzheng.modules.goods.domain.GoodsAttached;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -196,6 +199,16 @@ public class CourseChapterServiceImpl extends ServiceImpl<CourseChapterMapper, C
         return this.removeByIds(ids);
     }
 
+    @Override
+    public boolean batchDelChapter(GoodsBatchDelBo bo) {
+        if (CollectionUtils.isEmpty(bo.getIds())){
+            throw new CustomException("模块ID不能为空");
+        }
+        return update(new LambdaUpdateWrapper<CourseChapter>()
+                .set(CourseChapter::getStatus,bo.getStatus())
+                .in(CourseChapter::getChapterId,bo.getIds()));
+    }
+
     private boolean checkNameUnique(CourseChapter entity) {
         CourseChapter info = getOne(new LambdaQueryWrapper<CourseChapter>()
                 .eq(CourseChapter::getPrefixName,entity.getPrefixName()).eq(CourseChapter::getName,entity.getName()).last("limit 1"));

+ 12 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseModuleServiceImpl.java

@@ -4,6 +4,7 @@ import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.lang.Validator;
 import cn.hutool.core.util.StrUtil;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.zhongzheng.common.exception.CustomException;
 import com.zhongzheng.common.utils.DateUtils;
 import com.zhongzheng.common.utils.ServletUtils;
@@ -12,6 +13,7 @@ import com.zhongzheng.modules.course.domain.*;
 import com.zhongzheng.modules.course.mapper.CourseModuleMapper;
 import com.zhongzheng.modules.course.service.*;
 import com.zhongzheng.modules.course.vo.CourseModuleVo;
+import com.zhongzheng.modules.goods.bo.GoodsBatchDelBo;
 import com.zhongzheng.modules.goods.domain.GoodsAttached;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -185,6 +187,16 @@ public class CourseModuleServiceImpl extends ServiceImpl<CourseModuleMapper, Cou
         return this.removeByIds(ids);
     }
 
+    @Override
+    public boolean batchDelModule(GoodsBatchDelBo bo) {
+        if (CollectionUtils.isEmpty(bo.getIds())){
+            throw new CustomException("模块ID不能为空");
+        }
+        return update(new LambdaUpdateWrapper<CourseModule>()
+                .set(CourseModule::getStatus,bo.getStatus())
+                .in(CourseModule::getModuleId,bo.getIds()));
+    }
+
     private boolean checkNameUnique(CourseModule entity) {
         CourseModule info = getOne(new LambdaQueryWrapper<CourseModule>()
                 .eq(CourseModule::getPrefixName,entity.getPrefixName()).eq(CourseModule::getModuleName,entity.getModuleName()).last("limit 1"));

+ 13 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseSectionServiceImpl.java

@@ -5,6 +5,8 @@ import cn.hutool.core.convert.Convert;
 import cn.hutool.core.lang.Validator;
 import cn.hutool.core.util.StrUtil;
 import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.zhongzheng.common.core.redis.RedisCache;
 import com.zhongzheng.common.exception.CustomException;
 import com.zhongzheng.common.utils.DateUtils;
@@ -19,6 +21,7 @@ import com.zhongzheng.modules.course.domain.*;
 import com.zhongzheng.modules.course.mapper.CourseSectionMapper;
 import com.zhongzheng.modules.course.service.*;
 import com.zhongzheng.modules.course.vo.*;
+import com.zhongzheng.modules.goods.bo.GoodsBatchDelBo;
 import com.zhongzheng.modules.goods.bo.GoodsCourseQueryBo;
 import com.zhongzheng.modules.goods.service.IGoodsCourseService;
 import com.zhongzheng.modules.goods.vo.GoodsCourseVo;
@@ -635,6 +638,16 @@ public class CourseSectionServiceImpl extends ServiceImpl<CourseSectionMapper, C
         return null;
     }
 
+    @Override
+    public boolean batchDelSection(GoodsBatchDelBo bo) {
+        if (CollectionUtils.isEmpty(bo.getIds())){
+            throw new CustomException("节ID不能为空");
+        }
+        return update(new LambdaUpdateWrapper<CourseSection>()
+                .set(CourseSection::getStatus,bo.getStatus())
+                .in(CourseSection::getSectionId,bo.getIds()));
+    }
+
     @Transactional(rollbackFor = Exception.class)
     public String insertByAddBoImport(CourseSectionAddBo bo, String errorLog, Integer no) {
         CourseSection add = BeanUtil.toBean(bo, CourseSection.class);

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

@@ -25,6 +25,8 @@ import com.zhongzheng.modules.course.vo.CourseVo;
 import com.zhongzheng.modules.exam.domain.*;
 import com.zhongzheng.modules.exam.service.*;
 import com.zhongzheng.modules.exam.vo.ExamApplyGoodsVo;
+import com.zhongzheng.modules.goods.bo.GoodsBatchDelBo;
+import com.zhongzheng.modules.goods.domain.Goods;
 import com.zhongzheng.modules.goods.domain.GoodsCourse;
 import com.zhongzheng.modules.goods.service.IGoodsCourseService;
 import com.zhongzheng.modules.goods.vo.GoodsPeriodStatusVo;
@@ -147,6 +149,16 @@ public class CourseServiceImpl extends ServiceImpl<CourseMapper, Course> impleme
         return rebuild;
     }
 
+    @Override
+    public boolean batchDelCourse(GoodsBatchDelBo bo) {
+        if (CollectionUtils.isEmpty(bo.getIds())){
+            throw new CustomException("课程ID不能为空");
+        }
+        return update(new LambdaUpdateWrapper<Course>()
+                .set(Course::getStatus,bo.getStatus())
+                .in(Course::getCourseId,bo.getIds()));
+    }
+
     @Override
     public List<CourseVo> queryList(CourseQueryBo bo) {
         LambdaQueryWrapper<Course> lqw = Wrappers.lambdaQuery();

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/bo/GoodsAttachedQueryBo.java

@@ -54,4 +54,6 @@ public class GoodsAttachedQueryBo extends BaseEntity {
 	private Integer isDo;
 	@ApiModelProperty("订单商品id")
 	private Long orderGoodsId;
+	@ApiModelProperty("试卷类型ID")
+	private Long paperId;
 }

+ 1 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/bo/GoodsBatchDelBo.java

@@ -18,7 +18,7 @@ import java.util.List;
 public class GoodsBatchDelBo {
 
     @ApiModelProperty("商品id集合")
-    private List<Long> goodsIds;
+    private List<Long> ids;
 
     @ApiModelProperty("状态 1有效 0无效")
     private Integer status;

+ 4 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/mapper/GoodsAttachedMapper.java

@@ -4,8 +4,10 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.zhongzheng.modules.goods.bo.GoodsAttachedQueryBo;
 import com.zhongzheng.modules.goods.bo.GoodsQueryBo;
 import com.zhongzheng.modules.goods.domain.GoodsAttached;
+import com.zhongzheng.modules.goods.vo.GoodsAttachedPaperVo;
 import com.zhongzheng.modules.goods.vo.GoodsAttachedVo;
 import com.zhongzheng.modules.goods.vo.GoodsVo;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 
@@ -18,4 +20,6 @@ import java.util.List;
 public interface GoodsAttachedMapper extends BaseMapper<GoodsAttached> {
     List<GoodsAttachedVo> getList(GoodsAttachedQueryBo bo);
     List<GoodsAttachedVo> selectDoList(GoodsAttachedQueryBo bo);
+
+    List<GoodsAttachedPaperVo> getPaperIds(@Param("goodsId") Long goodsId);
 }

+ 16 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/impl/GoodsAttachedServiceImpl.java

@@ -2,6 +2,8 @@ package com.zhongzheng.modules.goods.service.impl;
 
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.util.StrUtil;
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import com.zhongzheng.common.utils.DateUtils;
 import com.zhongzheng.modules.goods.bo.GoodsAttachedAddBo;
 import com.zhongzheng.modules.goods.bo.GoodsAttachedEditBo;
@@ -10,6 +12,7 @@ import com.zhongzheng.modules.goods.domain.GoodsAttached;
 import com.zhongzheng.modules.goods.mapper.GoodsAttachedMapper;
 import com.zhongzheng.modules.goods.mapper.GoodsMapper;
 import com.zhongzheng.modules.goods.service.IGoodsAttachedService;
+import com.zhongzheng.modules.goods.vo.GoodsAttachedPaperVo;
 import com.zhongzheng.modules.goods.vo.GoodsAttachedVo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -60,7 +63,19 @@ public class GoodsAttachedServiceImpl extends ServiceImpl<GoodsAttachedMapper, G
 
     @Override
     public List<GoodsAttachedVo> getList(GoodsAttachedQueryBo bo) {
-        return goodsAttachedMapper.getList(bo);
+        List<GoodsAttachedVo> list = goodsAttachedMapper.getList(bo);
+        if (ObjectUtils.isNotNull(bo.getPaperId())){
+            List<GoodsAttachedPaperVo> paperVos = goodsAttachedMapper.getPaperIds(bo.getGoodsId());
+            if (CollectionUtils.isNotEmpty(paperVos)){
+                //需要过滤的
+                List<Long> goodsAttIds = paperVos.stream().filter(x -> x.getExamPaperId().equals(bo.getPaperId()))
+                        .map(GoodsAttachedPaperVo::getGoodsAttachedId).collect(Collectors.toList());
+                if (CollectionUtils.isNotEmpty(goodsAttIds)){
+                    list = list.stream().filter(item -> goodsAttIds.contains(item.getId())).collect(Collectors.toList());
+                }
+            }
+        }
+        return list;
     }
 
     /**

+ 2 - 2
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/impl/GoodsServiceImpl.java

@@ -742,12 +742,12 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
 
     @Override
     public boolean batchDelGoods(GoodsBatchDelBo bo) {
-        if (CollectionUtils.isEmpty(bo.getGoodsIds())){
+        if (CollectionUtils.isEmpty(bo.getIds())){
             throw new CustomException("商品ID不能为空");
         }
         return update(new LambdaUpdateWrapper<Goods>()
                 .set(Goods::getStatus,bo.getStatus())
-                .in(Goods::getGoodsId,bo.getGoodsIds()));
+                .in(Goods::getGoodsId,bo.getIds()));
     }
 
     /**

+ 24 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/vo/GoodsAttachedPaperVo.java

@@ -0,0 +1,24 @@
+package com.zhongzheng.modules.goods.vo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+
+/**
+ * 题库试卷类型Vo
+ *
+ * @author  hjl
+ * @date 2021-10-28
+ */
+@Data
+@ApiModel("题库试卷类型Vo")
+public class GoodsAttachedPaperVo {
+	private static final long serialVersionUID = 1L;
+
+	@ApiModelProperty("goodsAttachedId")
+	private Long goodsAttachedId;
+
+	@ApiModelProperty("试卷类型ID")
+	private Long examPaperId;
+}

+ 32 - 0
zhongzheng-system/src/main/resources/mapper/modules/goods/GoodsAttachedMapper.xml

@@ -309,4 +309,36 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 					   ga.type = 1
 					   AND ga.major_id IN ( SELECT module_exam_id FROM user_exam_record WHERE user_id = #{userId} AND order_goods_id = #{orderGoodsId} AND module_exam_id > 0 GROUP BY module_exam_id )))
 	</select>
+
+	<select id="getPaperIds" parameterType="java.lang.Long" resultType="com.zhongzheng.modules.goods.vo.GoodsAttachedPaperVo">
+		SELECT
+			ga.id as goodsAttachedId,
+			e.exam_paper_id as examPaperId
+		FROM
+			goods_attached ga
+				LEFT JOIN question_module_chapter qmc ON ga.major_id = qmc.module_exam_id
+				LEFT JOIN question_chapter_exam qce ON qmc.chapter_exam_id = qce.chapter_exam_id
+				LEFT JOIN exam e ON qce.exam_id = e.exam_id
+		WHERE
+			ga.goods_id = #{goodsId} AND ga.type = 1
+		UNION ALL
+		SELECT
+			ga.id as goodsAttachedId,
+			e.exam_paper_id as examPaperId
+		FROM
+			goods_attached ga
+				LEFT JOIN question_chapter_exam qce ON ga.major_id = qce.chapter_exam_id
+				LEFT JOIN exam e ON qce.exam_id = e.exam_id
+		WHERE
+			ga.goods_id = #{goodsId} AND ga.type = 2
+		UNION ALL
+		SELECT
+			ga.id as goodsAttachedId,
+			e.exam_paper_id as examPaperId
+		FROM
+			goods_attached ga
+				LEFT JOIN exam e ON ga.major_id = e.exam_id
+		WHERE
+			ga.goods_id = #{goodsId} AND ga.type = 3
+	</select>
 </mapper>