he2802 %!s(int64=2) %!d(string=hai) anos
pai
achega
8b56b9dd79
Modificáronse 83 ficheiros con 1666 adicións e 985 borrados
  1. 17 1
      zhongzheng-admin-saas/src/main/java/com/zhongzheng/controller/goods/TopGoodsController.java
  2. 72 49
      zhongzheng-admin-saas/src/main/java/com/zhongzheng/controller/top/TopSysDictDataController.java
  3. 63 51
      zhongzheng-admin-saas/src/main/java/com/zhongzheng/controller/top/TopSysDictTypeController.java
  4. 5 0
      zhongzheng-common/src/main/java/com/zhongzheng/common/constant/Constants.java
  5. 8 0
      zhongzheng-common/src/main/java/com/zhongzheng/common/core/domain/entity/TopSysUser.java
  6. 40 0
      zhongzheng-common/src/main/java/com/zhongzheng/common/utils/DictUtils.java
  7. 3 2
      zhongzheng-framework/src/main/java/com/zhongzheng/framework/mybatisplus/CreateAndUpdateMetaObjectHandler.java
  8. 6 7
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/impl/ExamQuestionServiceImpl.java
  9. 10 9
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/impl/ExamServiceImpl.java
  10. 6 7
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/impl/QuestionBusinessServiceImpl.java
  11. 6 9
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/impl/QuestionChapterExamServiceImpl.java
  12. 14 7
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/impl/QuestionChapterServiceImpl.java
  13. 6 8
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/impl/QuestionModuleChapterServiceImpl.java
  14. 6 6
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/impl/QuestionModuleServiceImpl.java
  15. 24 25
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/impl/QuestionServiceImpl.java
  16. 6 5
      zhongzheng-system/src/main/java/com/zhongzheng/modules/base/service/impl/CertificateCommonServiceImpl.java
  17. 6 7
      zhongzheng-system/src/main/java/com/zhongzheng/modules/base/service/impl/CertificateServiceImpl.java
  18. 9 12
      zhongzheng-system/src/main/java/com/zhongzheng/modules/base/service/impl/CertificateTpServiceImpl.java
  19. 6 5
      zhongzheng-system/src/main/java/com/zhongzheng/modules/base/service/impl/ProfileFieldServiceImpl.java
  20. 6 7
      zhongzheng-system/src/main/java/com/zhongzheng/modules/base/service/impl/ProfileTpBusinessServiceImpl.java
  21. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/base/service/impl/ProfileTpServiceImpl.java
  22. 14 17
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseBusinessServiceImpl.java
  23. 6 8
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseChapterBusinessServiceImpl.java
  24. 12 11
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseChapterSectionServiceImpl.java
  25. 10 9
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseChapterServiceImpl.java
  26. 6 6
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseEducationTierServiceImpl.java
  27. 16 14
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseEducationTypeServiceImpl.java
  28. 7 8
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseHandoutsBusinessServiceImpl.java
  29. 15 14
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseHandoutsServiceImpl.java
  30. 6 7
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseMenuExamServiceImpl.java
  31. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseMenuServiceImpl.java
  32. 7 9
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseModuleBusinessServiceImpl.java
  33. 12 10
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseModuleChapterServiceImpl.java
  34. 14 8
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseModuleServiceImpl.java
  35. 7 9
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseProjectTypeServiceImpl.java
  36. 6 8
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseSectionBusinessServiceImpl.java
  37. 6 11
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseSectionServiceImpl.java
  38. 2 7
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseSectionWatchPerServiceImpl.java
  39. 16 16
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseServiceImpl.java
  40. 6 8
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseStreamingBusinessServiceImpl.java
  41. 10 10
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseStreamingServiceImpl.java
  42. 7 8
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseSubjectProjectServiceImpl.java
  43. 10 16
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseSubjectServiceImpl.java
  44. 7 8
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/MajorProjectServiceImpl.java
  45. 12 14
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/MajorServiceImpl.java
  46. 9 10
      zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/service/impl/ExamPaperServiceImpl.java
  47. 1 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/IGoodsService.java
  48. 6 7
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/impl/GoodsAttachedServiceImpl.java
  49. 8 9
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/impl/GoodsCourseServiceImpl.java
  50. 4 7
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/impl/GoodsCourseTeacherServiceImpl.java
  51. 7 4
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/impl/GoodsServiceImpl.java
  52. 6 5
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/impl/GoodsSpecAttributeRelationServiceImpl.java
  53. 6 5
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/impl/GoodsSpecAttributeServiceImpl.java
  54. 6 10
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/impl/GoodsSpecServiceImpl.java
  55. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/impl/GoodsSpecTemplateServiceImpl.java
  56. 8 10
      zhongzheng-system/src/main/java/com/zhongzheng/modules/pay/service/impl/PayServeServiceImpl.java
  57. 8 8
      zhongzheng-system/src/main/java/com/zhongzheng/modules/pay/service/impl/PaySupplyServiceImpl.java
  58. 7 6
      zhongzheng-system/src/main/java/com/zhongzheng/modules/polyv/service/impl/PolyvCataServiceImpl.java
  59. 13 14
      zhongzheng-system/src/main/java/com/zhongzheng/modules/polyv/service/impl/PolyvVideoServiceImpl.java
  60. 0 3
      zhongzheng-system/src/main/java/com/zhongzheng/modules/system/service/impl/SysDictDataServiceImpl.java
  61. 65 62
      zhongzheng-system/src/main/java/com/zhongzheng/modules/top/goods/bo/TopGoodsQueryBo.java
  62. 7 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/top/goods/mapper/TopGoodsMapper.java
  63. 5 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/top/goods/mapper/TopQuestionMapper.java
  64. 3 33
      zhongzheng-system/src/main/java/com/zhongzheng/modules/top/goods/service/ITopGoodsService.java
  65. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/top/goods/service/ITopQuestionService.java
  66. 54 140
      zhongzheng-system/src/main/java/com/zhongzheng/modules/top/goods/service/impl/TopGoodsServiceImpl.java
  67. 6 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/top/goods/service/impl/TopQuestionServiceImpl.java
  68. 69 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/top/goods/vo/TopBankGoodsExamVo.java
  69. 143 32
      zhongzheng-system/src/main/java/com/zhongzheng/modules/top/goods/vo/TopGoodsVo.java
  70. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/top/user/bo/TopSysUserAddBo.java
  71. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/top/user/bo/TopSysUserEditBo.java
  72. 4 3
      zhongzheng-system/src/main/java/com/zhongzheng/modules/top/user/bo/TopSysUserQueryBo.java
  73. 18 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/top/user/domain/TopSysDictData.java
  74. 20 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/top/user/domain/TopSysDictType.java
  75. 2 2
      zhongzheng-system/src/main/java/com/zhongzheng/modules/top/user/domain/TopSysMenu.java
  76. 34 23
      zhongzheng-system/src/main/java/com/zhongzheng/modules/top/user/service/ITopSysDictDataService.java
  77. 48 23
      zhongzheng-system/src/main/java/com/zhongzheng/modules/top/user/service/ITopSysDictTypeService.java
  78. 95 58
      zhongzheng-system/src/main/java/com/zhongzheng/modules/top/user/service/impl/TopSysDictDataServiceImpl.java
  79. 131 52
      zhongzheng-system/src/main/java/com/zhongzheng/modules/top/user/service/impl/TopSysDictTypeServiceImpl.java
  80. 2 3
      zhongzheng-system/src/main/java/com/zhongzheng/modules/top/user/service/impl/TopSysUserServiceImpl.java
  81. 6 3
      zhongzheng-system/src/main/java/com/zhongzheng/modules/top/user/vo/TopSysUserVo.java
  82. 264 0
      zhongzheng-system/src/main/resources/mapper/modules/top/TopGoodsMapper.xml
  83. 54 0
      zhongzheng-system/src/main/resources/mapper/modules/top/TopQuestionMapper.xml

+ 17 - 1
zhongzheng-admin-saas/src/main/java/com/zhongzheng/controller/goods/TopGoodsController.java

@@ -2,6 +2,9 @@ package com.zhongzheng.controller.goods;
 
 import com.zhongzheng.common.core.controller.BaseController;
 import com.zhongzheng.common.core.domain.AjaxResult;
+import com.zhongzheng.common.core.page.TableDataInfo;
+import com.zhongzheng.modules.goods.vo.TopGoodsVo;
+import com.zhongzheng.modules.top.goods.bo.TopGoodsQueryBo;
 import com.zhongzheng.modules.top.goods.service.ITopGoodsService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -11,6 +14,8 @@ import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import java.util.List;
+
 /**
  * 商品Controller
  *
@@ -20,7 +25,7 @@ import org.springframework.web.bind.annotation.RestController;
 @Api(value = "商品控制器", tags = {"商品管理"})
 @RequiredArgsConstructor(onConstructor_ = @Autowired)
 @RestController
-@RequestMapping("/sys/goods")
+@RequestMapping("/goods")
 public class TopGoodsController extends BaseController {
 
     private final ITopGoodsService iTopGoodsService;
@@ -43,4 +48,15 @@ public class TopGoodsController extends BaseController {
         return toAjax(iTopGoodsService.goodsBatchCopyDisposeTenant() ? 1 : 0);
     }
 
+    /**
+     * 查询商品列表
+     */
+    @ApiOperation("查询商品列表")
+    @GetMapping("/list")
+    public TableDataInfo<TopGoodsVo> list(TopGoodsQueryBo bo) {
+        startPage();
+        List<TopGoodsVo> list = iTopGoodsService.selectList(bo);
+        return getDataTable(list);
+    }
+
 }

+ 72 - 49
zhongzheng-admin-saas/src/main/java/com/zhongzheng/controller/top/TopSysDictDataController.java

@@ -1,23 +1,25 @@
 package com.zhongzheng.controller.top;
 
+import cn.hutool.core.lang.Validator;
 import com.zhongzheng.common.annotation.Log;
 import com.zhongzheng.common.core.controller.BaseController;
 import com.zhongzheng.common.core.domain.AjaxResult;
+import com.zhongzheng.common.core.page.TableDataInfo;
 import com.zhongzheng.common.enums.BusinessType;
+import com.zhongzheng.common.utils.SecurityUtils;
 import com.zhongzheng.common.utils.poi.ExcelUtil;
-import com.zhongzheng.modules.top.user.bo.TopSysDictDataAddBo;
-import com.zhongzheng.modules.top.user.bo.TopSysDictDataEditBo;
-import com.zhongzheng.modules.top.user.bo.TopSysDictDataQueryBo;
+import com.zhongzheng.modules.top.user.domain.TopSysDictData;
 import com.zhongzheng.modules.top.user.service.ITopSysDictDataService;
-import com.zhongzheng.modules.top.user.vo.TopSysDictDataVo;
+import com.zhongzheng.modules.top.user.service.ITopSysDictTypeService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.RequiredArgsConstructor;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 
-import java.util.Arrays;
+import java.util.ArrayList;
 import java.util.List;
 
 /**
@@ -32,71 +34,92 @@ import java.util.List;
 @RequestMapping("/system/dict/data")
 public class TopSysDictDataController extends BaseController {
 
-    private final ITopSysDictDataService iTopSysDictDataService;
+    private final ITopSysDictDataService dictDataService;
 
-    /**
-     * 查询【请填写功能名称】列表
-     */
-    @ApiOperation("查询【请填写功能名称】列表")
+    private final ITopSysDictTypeService dictTypeService;
+
+
+    @ApiOperation("获取字典数据列表")
+    //  @PreAuthorize("@ss.hasPermi('system:dict:list')")
     @GetMapping("/list")
-    public AjaxResult<List<TopSysDictDataVo>> list(TopSysDictDataQueryBo bo) {
-        List<TopSysDictDataVo> list = iTopSysDictDataService.queryList(bo);
-        return AjaxResult.success(list);
+    public TableDataInfo list(TopSysDictData dictData)
+    {
+        startPage();
+        List<TopSysDictData> list = dictDataService.selectDictDataList(dictData);
+        return getDataTable(list);
+    }
+
+    @Log(title = "字典数据", businessType = BusinessType.EXPORT)
+    //  @PreAuthorize("@ss.hasPermi('system:dict:export')")
+    @GetMapping("/export")
+    public AjaxResult export(TopSysDictData dictData)
+    {
+        List<TopSysDictData> list = dictDataService.selectDictDataList(dictData);
+        ExcelUtil<TopSysDictData> util = new ExcelUtil<TopSysDictData>(TopSysDictData.class);
+        return util.exportExcel(list, "字典数据");
     }
 
     /**
-     * 导出【请填写功能名称】列表
+     * 查询字典数据详细
      */
-    @ApiOperation("导出【请填写功能名称】列表")
-    @PreAuthorize("@ss.hasPermi('system:data:export')")
-    @Log(title = "【请填写功能名称】", businessType = BusinessType.EXPORT)
-    @GetMapping("/export")
-    public AjaxResult<TopSysDictDataVo> export(TopSysDictDataQueryBo bo) {
-        List<TopSysDictDataVo> list = iTopSysDictDataService.queryList(bo);
-        ExcelUtil<TopSysDictDataVo> util = new ExcelUtil<TopSysDictDataVo>(TopSysDictDataVo.class);
-        return util.exportExcel(list, "【请填写功能名称】");
+    @ApiOperation("查询字典数据详细")
+    // @PreAuthorize("@ss.hasPermi('system:dict:query')")
+    @GetMapping(value = "/{dictCode}")
+    public AjaxResult getInfo(@PathVariable Long dictCode)
+    {
+        return AjaxResult.success(dictDataService.selectDictDataById(dictCode));
     }
 
     /**
-     * 获取【请填写功能名称】详细信息
+     * 根据字典类型查询字典数据信息
      */
-    @ApiOperation("获取【请填写功能名称】详细信息")
-    @PreAuthorize("@ss.hasPermi('system:data:query')")
-    @GetMapping("/{dictCode}")
-    public AjaxResult<TopSysDictDataVo> getInfo(@PathVariable("dictCode" ) Long dictCode) {
-        return AjaxResult.success(iTopSysDictDataService.queryById(dictCode));
+    @ApiOperation("根据字典类型查询字典数据信息")
+    @GetMapping(value = "/type/{dictType}")
+    public AjaxResult dictType(@PathVariable String dictType)
+    {
+        List<TopSysDictData> data = dictTypeService.selectDictDataByType(dictType);
+        if (Validator.isNull(data))
+        {
+            data = new ArrayList<TopSysDictData>();
+        }
+        return AjaxResult.success(data);
     }
 
     /**
-     * 新增【请填写功能名称】
+     * 新增字典类型
      */
-    @ApiOperation("新增【请填写功能名称】")
-    @PreAuthorize("@ss.hasPermi('system:data:add')")
-    @Log(title = "【请填写功能名称】", businessType = BusinessType.INSERT)
-    @PostMapping()
-    public AjaxResult<Void> add(@RequestBody TopSysDictDataAddBo bo) {
-        return toAjax(iTopSysDictDataService.insertByAddBo(bo) ? 1 : 0);
+    @ApiOperation("新增字典数据")
+    @PreAuthorize("@ss.hasPermi('system:dict:add')")
+    @Log(title = "字典数据", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@Validated @RequestBody TopSysDictData dict)
+    {
+        dict.setCreateBy(SecurityUtils.getUsername());
+        return toAjax(dictDataService.insertDictData(dict));
     }
 
     /**
-     * 修改【请填写功能名称】
+     * 修改保存字典类型
      */
-    @ApiOperation("修改【请填写功能名称】")
-    @PreAuthorize("@ss.hasPermi('system:data:edit')")
-    @Log(title = "【请填写功能名称】", businessType = BusinessType.UPDATE)
-    @PutMapping()
-    public AjaxResult<Void> edit(@RequestBody TopSysDictDataEditBo bo) {
-        return toAjax(iTopSysDictDataService.updateByEditBo(bo) ? 1 : 0);
+    @ApiOperation("修改保存字典数据")
+    @PreAuthorize("@ss.hasPermi('system:dict:edit')")
+    @Log(title = "字典数据", businessType = BusinessType.UPDATE)
+    @PostMapping("/edit")
+    public AjaxResult edit(@Validated @RequestBody TopSysDictData dict)
+    {
+        dict.setUpdateBy(SecurityUtils.getUsername());
+        return toAjax(dictDataService.updateDictData(dict));
     }
 
     /**
-     * 删除【请填写功能名称】
+     * 删除字典类型
      */
-    @ApiOperation("删除【请填写功能名称】")
-    @PreAuthorize("@ss.hasPermi('system:data:remove')")
-    @Log(title = "【请填写功能名称】" , businessType = BusinessType.DELETE)
-    @DeleteMapping("/{dictCodes}")
-    public AjaxResult<Void> remove(@PathVariable Long[] dictCodes) {
-        return toAjax(iTopSysDictDataService.deleteWithValidByIds(Arrays.asList(dictCodes), true) ? 1 : 0);
+    @ApiOperation("删除字典数据")
+    @PreAuthorize("@ss.hasPermi('system:dict:remove')")
+    @Log(title = "字典类型", businessType = BusinessType.DELETE)
+    @PostMapping("/delete/{dictCodes}")
+    public AjaxResult remove(@PathVariable Long[] dictCodes)
+    {
+        return toAjax(dictDataService.deleteDictDataByIds(dictCodes));
     }
 }

+ 63 - 51
zhongzheng-admin-saas/src/main/java/com/zhongzheng/controller/top/TopSysDictTypeController.java

@@ -1,24 +1,22 @@
 package com.zhongzheng.controller.top;
 
 import com.zhongzheng.common.annotation.Log;
+import com.zhongzheng.common.constant.UserConstants;
 import com.zhongzheng.common.core.controller.BaseController;
 import com.zhongzheng.common.core.domain.AjaxResult;
 import com.zhongzheng.common.core.page.TableDataInfo;
 import com.zhongzheng.common.enums.BusinessType;
-import com.zhongzheng.common.utils.poi.ExcelUtil;
-import com.zhongzheng.modules.top.user.bo.TopSysDictTypeAddBo;
-import com.zhongzheng.modules.top.user.bo.TopSysDictTypeEditBo;
-import com.zhongzheng.modules.top.user.bo.TopSysDictTypeQueryBo;
+import com.zhongzheng.common.utils.SecurityUtils;
+import com.zhongzheng.modules.top.user.domain.TopSysDictType;
 import com.zhongzheng.modules.top.user.service.ITopSysDictTypeService;
-import com.zhongzheng.modules.top.user.vo.TopSysDictTypeVo;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.RequiredArgsConstructor;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 
-import java.util.Arrays;
 import java.util.List;
 
 /**
@@ -30,76 +28,90 @@ import java.util.List;
 @Api(value = "【请填写功能名称】控制器", tags = {"【请填写功能名称】管理"})
 @RequiredArgsConstructor(onConstructor_ = @Autowired)
 @RestController
-@RequestMapping("/system/type")
+@RequestMapping("/system/dict/type")
 public class TopSysDictTypeController extends BaseController {
 
-    private final ITopSysDictTypeService iTopSysDictTypeService;
+    private final ITopSysDictTypeService dictTypeService;
 
-    /**
-     * 查询【请填写功能名称】列表
-     */
-    @ApiOperation("查询【请填写功能名称】列表")
-    @PreAuthorize("@ss.hasPermi('system:type:list')")
+    @ApiOperation("获取字典类型列表")
+    //   @PreAuthorize("@ss.hasPermi('system:dict:list')")
     @GetMapping("/list")
-    public TableDataInfo<TopSysDictTypeVo> list(TopSysDictTypeQueryBo bo) {
+    public TableDataInfo list(TopSysDictType dictType)
+    {
         startPage();
-        List<TopSysDictTypeVo> list = iTopSysDictTypeService.queryList(bo);
+        List<TopSysDictType> list = dictTypeService.selectDictTypeList(dictType);
         return getDataTable(list);
     }
+    
 
     /**
-     * 导出【请填写功能名称】列表
+     * 查询字典类型详细
      */
-    @ApiOperation("导出【请填写功能名称】列表")
-    @PreAuthorize("@ss.hasPermi('system:type:export')")
-    @Log(title = "【请填写功能名称】", businessType = BusinessType.EXPORT)
-    @GetMapping("/export")
-    public AjaxResult<TopSysDictTypeVo> export(TopSysDictTypeQueryBo bo) {
-        List<TopSysDictTypeVo> list = iTopSysDictTypeService.queryList(bo);
-        ExcelUtil<TopSysDictTypeVo> util = new ExcelUtil<TopSysDictTypeVo>(TopSysDictTypeVo.class);
-        return util.exportExcel(list, "【请填写功能名称】");
+    @ApiOperation("查询字典类型详细")
+    //   @PreAuthorize("@ss.hasPermi('system:dict:query')")
+    @GetMapping(value = "/{dictId}")
+    public AjaxResult getInfo(@PathVariable Long dictId)
+    {
+        return AjaxResult.success(dictTypeService.selectDictTypeById(dictId));
     }
 
     /**
-     * 获取【请填写功能名称】详细信息
+     * 新增字典类型
      */
-    @ApiOperation("获取【请填写功能名称】详细信息")
-    @PreAuthorize("@ss.hasPermi('system:type:query')")
-    @GetMapping("/{dictId}")
-    public AjaxResult<TopSysDictTypeVo> getInfo(@PathVariable("dictId" ) Long dictId) {
-        return AjaxResult.success(iTopSysDictTypeService.queryById(dictId));
+    @ApiOperation("新增字典类型")
+    @PreAuthorize("@ss.hasPermi('system:dict:add')")
+    @Log(title = "字典类型", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@Validated @RequestBody TopSysDictType dict)
+    {
+        if (UserConstants.NOT_UNIQUE.equals(dictTypeService.checkDictTypeUnique(dict)))
+        {
+            return AjaxResult.error("新增字典'" + dict.getDictName() + "'失败,字典类型已存在");
+        }
+        dict.setCreateBy(SecurityUtils.getUsername());
+        return toAjax(dictTypeService.insertDictType(dict));
     }
 
     /**
-     * 新增【请填写功能名称】
+     * 修改字典类型
      */
-    @ApiOperation("新增【请填写功能名称】")
-    @PreAuthorize("@ss.hasPermi('system:type:add')")
-    @Log(title = "【请填写功能名称】", businessType = BusinessType.INSERT)
-    @PostMapping()
-    public AjaxResult<Void> add(@RequestBody TopSysDictTypeAddBo bo) {
-        return toAjax(iTopSysDictTypeService.insertByAddBo(bo) ? 1 : 0);
+    @ApiOperation("修改字典类型")
+    @PreAuthorize("@ss.hasPermi('system:dict:edit')")
+    @Log(title = "字典类型", businessType = BusinessType.UPDATE)
+    @PostMapping("/edit")
+    public AjaxResult edit(@Validated @RequestBody TopSysDictType dict)
+    {
+        if (UserConstants.NOT_UNIQUE.equals(dictTypeService.checkDictTypeUnique(dict)))
+        {
+            return AjaxResult.error("修改字典'" + dict.getDictName() + "'失败,字典类型已存在");
+        }
+        dict.setUpdateBy(SecurityUtils.getUsername());
+        return toAjax(dictTypeService.updateDictType(dict));
     }
 
     /**
-     * 修改【请填写功能名称】
+     * 删除字典类型
      */
-    @ApiOperation("修改【请填写功能名称】")
-    @PreAuthorize("@ss.hasPermi('system:type:edit')")
-    @Log(title = "【请填写功能名称】", businessType = BusinessType.UPDATE)
-    @PutMapping()
-    public AjaxResult<Void> edit(@RequestBody TopSysDictTypeEditBo bo) {
-        return toAjax(iTopSysDictTypeService.updateByEditBo(bo) ? 1 : 0);
+    @ApiOperation("删除字典类型")
+    @PreAuthorize("@ss.hasPermi('system:dict:remove')")
+    @Log(title = "字典类型", businessType = BusinessType.DELETE)
+    @PostMapping("/delete/{dictIds}")
+    public AjaxResult remove(@PathVariable Long[] dictIds)
+    {
+        return toAjax(dictTypeService.deleteDictTypeByIds(dictIds));
     }
 
     /**
-     * 删除【请填写功能名称】
+     * 清空缓存
      */
-    @ApiOperation("删除【请填写功能名称】")
-    @PreAuthorize("@ss.hasPermi('system:type:remove')")
-    @Log(title = "【请填写功能名称】" , businessType = BusinessType.DELETE)
-    @DeleteMapping("/{dictIds}")
-    public AjaxResult<Void> remove(@PathVariable Long[] dictIds) {
-        return toAjax(iTopSysDictTypeService.deleteWithValidByIds(Arrays.asList(dictIds), true) ? 1 : 0);
+
+    @PreAuthorize("@ss.hasPermi('system:dict:remove')")
+    @Log(title = "字典类型", businessType = BusinessType.CLEAN)
+    @DeleteMapping("/clearCache")
+    public AjaxResult clearCache()
+    {
+        dictTypeService.clearCache();
+        return AjaxResult.success();
     }
+
 }

+ 5 - 0
zhongzheng-common/src/main/java/com/zhongzheng/common/constant/Constants.java

@@ -154,6 +154,11 @@ public class Constants
      */
     public static final String SYS_DICT_KEY = "sys_dict:";
 
+    /**
+     * 字典管理 cache key
+     */
+    public static final String SYS_TOP_DICT_KEY = "sys_top_dict:";
+
     /**
      * 资源映射路径 前缀
      */

+ 8 - 0
zhongzheng-common/src/main/java/com/zhongzheng/common/core/domain/entity/TopSysUser.java

@@ -72,6 +72,9 @@ public class TopSysUser implements Serializable
     /** 用户头像 */
     private String avatar;
 
+    /** 用户编码 */
+    private String code;
+
     /** 密码 */
     private String password;
 
@@ -82,6 +85,7 @@ public class TopSysUser implements Serializable
     }
 
     /** 盐加密 */
+    @TableField(exist = false)
     private String salt;
 
     /** 帐号状态(1正常 0停用) */
@@ -146,6 +150,10 @@ public class TopSysUser implements Serializable
     @TableField(exist = false)
     private Long[] roleIds;
 
+    /** 角色名称 */
+    @TableField(exist = false)
+    private String roleName;
+
     /** 岗位组 */
     @TableField(exist = false)
     private Long[] postIds;

+ 40 - 0
zhongzheng-common/src/main/java/com/zhongzheng/common/utils/DictUtils.java

@@ -34,6 +34,17 @@ public class DictUtils
         SpringUtils.getBean(RedisCache.class).setCacheObject(getCacheKey(key), dictDatas);
     }
 
+    /**
+     * 设置字典缓存
+     *
+     * @param key 参数键
+     * @param dictDatas 字典数据列表
+     */
+    public static void setTopDictCache(String key, List<SysDictData> dictDatas)
+    {
+        SpringUtils.getBean(RedisCache.class).setCacheObject(getTopCacheKey(key), dictDatas);
+    }
+
     /**
      * 获取字典缓存
      * 
@@ -51,6 +62,24 @@ public class DictUtils
         return null;
     }
 
+    /**
+     * 获取字典缓存
+     *
+     * @param key 参数键
+     * @return dictDatas 字典数据列表
+     */
+    public static List<SysDictData> getTopDictCache(String key)
+    {
+        Object cacheObj = SpringUtils.getBean(RedisCache.class).getCacheObject(getTopCacheKey(key));
+        if (Validator.isNotNull(cacheObj))
+        {
+            List<SysDictData> dictDatas = (List<SysDictData>)cacheObj;
+            return dictDatas;
+        }
+        return null;
+    }
+
+
     /**
      * 根据字典类型和字典值获取字典标签
      * 
@@ -174,4 +203,15 @@ public class DictUtils
     {
         return Constants.SYS_DICT_KEY + configKey;
     }
+
+    /**
+     * 设置cache key
+     *
+     * @param configKey 参数键
+     * @return 缓存键key
+     */
+    public static String getTopCacheKey(String configKey)
+    {
+        return Constants.SYS_TOP_DICT_KEY + configKey;
+    }
 }

+ 3 - 2
zhongzheng-framework/src/main/java/com/zhongzheng/framework/mybatisplus/CreateAndUpdateMetaObjectHandler.java

@@ -1,6 +1,7 @@
 package com.zhongzheng.framework.mybatisplus;
 
 import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
+import com.zhongzheng.common.utils.DateUtils;
 import com.zhongzheng.common.utils.SecurityUtils;
 import org.apache.ibatis.reflection.MetaObject;
 
@@ -18,7 +19,7 @@ public class CreateAndUpdateMetaObjectHandler implements MetaObjectHandler {
 		//根据属性名字设置要填充的值
 		if (metaObject.hasGetter("createTime")) {
 			if (metaObject.getValue("createTime") == null) {
-				this.setFieldValByName("createTime", new Date(), metaObject);
+				this.setFieldValByName("createTime", DateUtils.getNowTime(), metaObject);
 			}
 		}
 		if (metaObject.hasGetter("createBy")) {
@@ -37,7 +38,7 @@ public class CreateAndUpdateMetaObjectHandler implements MetaObjectHandler {
 		}
 		if (metaObject.hasGetter("updateTime")) {
 			if (metaObject.getValue("updateTime") == null) {
-				this.setFieldValByName("updateTime", new Date(), metaObject);
+				this.setFieldValByName("updateTime", DateUtils.getNowTime(), metaObject);
 			}
 		}
 	}

+ 6 - 7
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/impl/ExamQuestionServiceImpl.java

@@ -1,8 +1,11 @@
 package com.zhongzheng.modules.bank.service.impl;
 
 import cn.hutool.core.bean.BeanUtil;
-import cn.hutool.core.util.StrUtil;
-import com.zhongzheng.common.utils.DateUtils;
+import com.baomidou.dynamic.datasource.annotation.DS;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.github.pagehelper.Page;
 import com.zhongzheng.modules.bank.bo.ExamQuestionAddBo;
 import com.zhongzheng.modules.bank.bo.ExamQuestionEditBo;
 import com.zhongzheng.modules.bank.bo.ExamQuestionQueryBo;
@@ -12,13 +15,8 @@ import com.zhongzheng.modules.bank.service.IExamQuestionService;
 import com.zhongzheng.modules.bank.vo.ExamQuestionVo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import com.github.pagehelper.Page;
 
 import java.util.Collection;
-import java.util.Collections;
 import java.util.List;
 import java.util.stream.Collectors;
 
@@ -29,6 +27,7 @@ import java.util.stream.Collectors;
  * @date 2021-10-22
  */
 @Service
+@DS("slave")
 public class ExamQuestionServiceImpl extends ServiceImpl<ExamQuestionMapper, ExamQuestion> implements IExamQuestionService {
 
     @Autowired

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

@@ -4,15 +4,23 @@ import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.lang.Validator;
 import cn.hutool.core.util.StrUtil;
 import com.alibaba.fastjson.JSON;
+import com.baomidou.dynamic.datasource.annotation.DS;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import com.baomidou.mybatisplus.core.toolkit.StringUtils;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.github.pagehelper.Page;
 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.*;
+import com.zhongzheng.modules.bank.domain.Exam;
+import com.zhongzheng.modules.bank.domain.ExamQuestion;
+import com.zhongzheng.modules.bank.domain.QuestionBusiness;
+import com.zhongzheng.modules.bank.domain.QuestionChapterExam;
 import com.zhongzheng.modules.bank.mapper.ExamMapper;
 import com.zhongzheng.modules.bank.service.IExamQuestionService;
 import com.zhongzheng.modules.bank.service.IExamService;
@@ -20,10 +28,7 @@ import com.zhongzheng.modules.bank.service.IQuestionBusinessService;
 import com.zhongzheng.modules.bank.service.IQuestionChapterExamService;
 import com.zhongzheng.modules.bank.vo.ExamVo;
 import com.zhongzheng.modules.bank.vo.QuestionChapterExamVo;
-import com.zhongzheng.modules.course.bo.CourseChapterSectionListAddBo;
-import com.zhongzheng.modules.course.domain.CourseChapterSection;
 import com.zhongzheng.modules.course.domain.CourseMenuExam;
-import com.zhongzheng.modules.course.service.ICourseChapterBusinessService;
 import com.zhongzheng.modules.course.service.ICourseMenuExamService;
 import com.zhongzheng.modules.exam.bo.ExamPaperQueryBo;
 import com.zhongzheng.modules.goods.bo.GoodsAttachedQueryBo;
@@ -31,14 +36,9 @@ import com.zhongzheng.modules.goods.domain.GoodsAttached;
 import com.zhongzheng.modules.goods.service.IGoodsAttachedService;
 import com.zhongzheng.modules.goods.vo.GoodsAttachedVo;
 import com.zhongzheng.modules.user.bo.CheckUserExamRecordBo;
-import com.zhongzheng.modules.user.domain.User;
 import com.zhongzheng.modules.user.service.IUserExamRecordService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import com.github.pagehelper.Page;
 import org.springframework.transaction.annotation.Transactional;
 
 import java.util.*;
@@ -51,6 +51,7 @@ import java.util.stream.Collectors;
  * @date 2021-10-22
  */
 @Service
+@DS("slave")
 public class ExamServiceImpl extends ServiceImpl<ExamMapper, Exam> implements IExamService {
 
     @Autowired

+ 6 - 7
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/impl/QuestionBusinessServiceImpl.java

@@ -1,8 +1,11 @@
 package com.zhongzheng.modules.bank.service.impl;
 
 import cn.hutool.core.bean.BeanUtil;
-import cn.hutool.core.util.StrUtil;
-import com.zhongzheng.common.utils.DateUtils;
+import com.baomidou.dynamic.datasource.annotation.DS;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.github.pagehelper.Page;
 import com.zhongzheng.modules.bank.bo.QuestionBusinessAddBo;
 import com.zhongzheng.modules.bank.bo.QuestionBusinessEditBo;
 import com.zhongzheng.modules.bank.bo.QuestionBusinessQueryBo;
@@ -12,13 +15,8 @@ import com.zhongzheng.modules.bank.service.IQuestionBusinessService;
 import com.zhongzheng.modules.bank.vo.QuestionBusinessVo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import com.github.pagehelper.Page;
 
 import java.util.Collection;
-import java.util.Collections;
 import java.util.List;
 import java.util.stream.Collectors;
 
@@ -29,6 +27,7 @@ import java.util.stream.Collectors;
  * @date 2021-10-25
  */
 @Service
+@DS("slave")
 public class QuestionBusinessServiceImpl extends ServiceImpl<QuestionBusinessMapper, QuestionBusiness> implements IQuestionBusinessService {
 
     @Autowired

+ 6 - 9
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/impl/QuestionChapterExamServiceImpl.java

@@ -1,27 +1,23 @@
 package com.zhongzheng.modules.bank.service.impl;
 
 import cn.hutool.core.bean.BeanUtil;
-import cn.hutool.core.util.StrUtil;
-import com.zhongzheng.common.utils.DateUtils;
+import com.baomidou.dynamic.datasource.annotation.DS;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.github.pagehelper.Page;
 import com.zhongzheng.modules.bank.bo.QuestionChapterExamAddBo;
 import com.zhongzheng.modules.bank.bo.QuestionChapterExamEditBo;
 import com.zhongzheng.modules.bank.bo.QuestionChapterExamQueryBo;
 import com.zhongzheng.modules.bank.domain.QuestionChapterExam;
 import com.zhongzheng.modules.bank.mapper.QuestionChapterExamMapper;
-import com.zhongzheng.modules.bank.mapper.QuestionModuleChapterMapper;
 import com.zhongzheng.modules.bank.service.IQuestionChapterExamService;
 import com.zhongzheng.modules.bank.vo.ExamVo;
 import com.zhongzheng.modules.bank.vo.QuestionChapterExamVo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import com.github.pagehelper.Page;
-
 
 import java.util.Collection;
-import java.util.Collections;
 import java.util.List;
 import java.util.stream.Collectors;
 
@@ -32,6 +28,7 @@ import java.util.stream.Collectors;
  * @date 2021-10-25
  */
 @Service
+@DS("slave")
 public class QuestionChapterExamServiceImpl extends ServiceImpl<QuestionChapterExamMapper, QuestionChapterExam> implements IQuestionChapterExamService {
 
     @Autowired

+ 14 - 7
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/impl/QuestionChapterServiceImpl.java

@@ -2,33 +2,39 @@ package com.zhongzheng.modules.bank.service.impl;
 
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.util.StrUtil;
+import com.baomidou.dynamic.datasource.annotation.DS;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.github.pagehelper.Page;
 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.*;
+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.mapper.QuestionChapterMapper;
 import com.zhongzheng.modules.bank.service.IQuestionBusinessService;
 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 com.zhongzheng.modules.user.bo.CheckUserExamRecordBo;
 import com.zhongzheng.modules.user.service.IUserExamRecordService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import com.github.pagehelper.Page;
 import org.springframework.transaction.annotation.Transactional;
 
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.List;
 import java.util.stream.Collectors;
 
 /**
@@ -38,6 +44,7 @@ import java.util.stream.Collectors;
  * @date 2021-10-25
  */
 @Service
+@DS("slave")
 public class QuestionChapterServiceImpl extends ServiceImpl<QuestionChapterMapper, QuestionChapter> implements IQuestionChapterService {
 
     @Autowired

+ 6 - 8
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/impl/QuestionModuleChapterServiceImpl.java

@@ -1,26 +1,23 @@
 package com.zhongzheng.modules.bank.service.impl;
 
 import cn.hutool.core.bean.BeanUtil;
-import cn.hutool.core.util.StrUtil;
-import com.zhongzheng.common.utils.DateUtils;
+import com.baomidou.dynamic.datasource.annotation.DS;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.github.pagehelper.Page;
 import com.zhongzheng.modules.bank.bo.QuestionModuleChapterAddBo;
 import com.zhongzheng.modules.bank.bo.QuestionModuleChapterEditBo;
 import com.zhongzheng.modules.bank.bo.QuestionModuleChapterQueryBo;
 import com.zhongzheng.modules.bank.domain.QuestionModuleChapter;
 import com.zhongzheng.modules.bank.mapper.QuestionModuleChapterMapper;
-import com.zhongzheng.modules.bank.service.IQuestionBusinessService;
 import com.zhongzheng.modules.bank.service.IQuestionModuleChapterService;
 import com.zhongzheng.modules.bank.vo.QuestionChapterVo;
 import com.zhongzheng.modules.bank.vo.QuestionModuleChapterVo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import com.github.pagehelper.Page;
 
 import java.util.Collection;
-import java.util.Collections;
 import java.util.List;
 import java.util.stream.Collectors;
 
@@ -31,6 +28,7 @@ import java.util.stream.Collectors;
  * @date 2021-10-26
  */
 @Service
+@DS("slave")
 public class QuestionModuleChapterServiceImpl extends ServiceImpl<QuestionModuleChapterMapper, QuestionModuleChapter> implements IQuestionModuleChapterService {
 
     @Autowired

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

@@ -2,8 +2,13 @@ package com.zhongzheng.modules.bank.service.impl;
 
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.util.StrUtil;
+import com.baomidou.dynamic.datasource.annotation.DS;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.github.pagehelper.Page;
 import com.zhongzheng.common.exception.CustomException;
 import com.zhongzheng.common.utils.DateUtils;
 import com.zhongzheng.common.utils.ServletUtils;
@@ -16,21 +21,15 @@ 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 com.zhongzheng.modules.user.bo.CheckUserExamRecordBo;
 import com.zhongzheng.modules.user.service.IUserExamRecordService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import com.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.stream.Collectors;
@@ -42,6 +41,7 @@ import java.util.stream.Collectors;
  * @date 2021-10-25
  */
 @Service
+@DS("slave")
 public class QuestionModuleServiceImpl extends ServiceImpl<QuestionModuleMapper, QuestionModule> implements IQuestionModuleService {
 
     @Autowired

+ 24 - 25
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/impl/QuestionServiceImpl.java

@@ -3,13 +3,15 @@ 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 cn.hutool.extra.tokenizer.Word;
 import com.alibaba.fastjson.JSON;
+import com.baomidou.dynamic.datasource.annotation.DS;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
-import com.zhongzheng.common.constant.Constants;
-import com.zhongzheng.common.core.domain.entity.SysUser;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.github.pagehelper.Page;
 import com.zhongzheng.common.core.redis.RedisCache;
 import com.zhongzheng.common.exception.CustomException;
 import com.zhongzheng.common.utils.DateUtils;
@@ -18,17 +20,27 @@ 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.*;
+import com.zhongzheng.modules.bank.domain.Exam;
+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.mapper.QuestionMapper;
 import com.zhongzheng.modules.bank.service.IExamQuestionService;
 import com.zhongzheng.modules.bank.service.IExamService;
 import com.zhongzheng.modules.bank.service.IQuestionBusinessService;
 import com.zhongzheng.modules.bank.service.IQuestionService;
-import com.zhongzheng.modules.bank.vo.*;
-import com.zhongzheng.modules.base.domain.ApplyAreas;
-import com.zhongzheng.modules.course.bo.CourseChapterSectionListAddBo;
-import com.zhongzheng.modules.course.domain.*;
-import com.zhongzheng.modules.course.service.*;
+import com.zhongzheng.modules.bank.vo.QuestionImport;
+import com.zhongzheng.modules.bank.vo.QuestionImportContent;
+import com.zhongzheng.modules.bank.vo.QuestionImportV2;
+import com.zhongzheng.modules.bank.vo.QuestionVo;
+import com.zhongzheng.modules.course.domain.CourseBusiness;
+import com.zhongzheng.modules.course.domain.CourseEducationType;
+import com.zhongzheng.modules.course.domain.CourseProjectType;
+import com.zhongzheng.modules.course.domain.CourseSubject;
+import com.zhongzheng.modules.course.service.ICourseBusinessService;
+import com.zhongzheng.modules.course.service.ICourseEducationTypeService;
+import com.zhongzheng.modules.course.service.ICourseProjectTypeService;
+import com.zhongzheng.modules.course.service.ICourseSubjectService;
 import com.zhongzheng.modules.exam.bo.ExamKnowledgeAddBo;
 import com.zhongzheng.modules.exam.bo.ExamKnowledgeBusinessAddBo;
 import com.zhongzheng.modules.exam.domain.ExamKnowledge;
@@ -41,7 +53,6 @@ import com.zhongzheng.modules.goods.service.IGoodsService;
 import com.zhongzheng.modules.goods.vo.BankGoodsExamVo;
 import com.zhongzheng.modules.goods.vo.GoodsExamTimeVo;
 import com.zhongzheng.modules.goods.vo.GoodsUserQuestionVo;
-
 import com.zhongzheng.modules.user.bo.CheckUserExamRecordBo;
 import com.zhongzheng.modules.user.bo.UserSpecialExamRecord;
 import com.zhongzheng.modules.user.domain.User;
@@ -55,35 +66,22 @@ import org.apache.poi.openxml4j.opc.PackagePart;
 import org.apache.poi.xwpf.usermodel.XWPFDocument;
 import org.apache.poi.xwpf.usermodel.XWPFParagraph;
 import org.apache.poi.xwpf.usermodel.XWPFRun;
-import org.apache.poi.xwpf.usermodel.XWPFTable;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import com.github.pagehelper.Page;
 import org.springframework.transaction.annotation.Transactional;
-import org.springframework.util.unit.DataUnit;
 import org.springframework.web.multipart.MultipartFile;
 import org.w3c.dom.NamedNodeMap;
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
 
-import javax.imageio.ImageIO;
-import javax.xml.bind.DatatypeConverter;
-import java.awt.*;
-import java.awt.image.BufferedImage;
-import java.io.*;
-import java.net.URL;
+import java.io.IOException;
+import java.io.InputStream;
 import java.text.NumberFormat;
 import java.util.*;
-import java.util.List;
 import java.util.concurrent.TimeUnit;
 import java.util.stream.Collectors;
 
-import static com.zhongzheng.common.utils.ToolsUtils.getEncoding;
-
 /**
  * 题库题目Service业务层处理
  *
@@ -91,6 +89,7 @@ import static com.zhongzheng.common.utils.ToolsUtils.getEncoding;
  * @date 2021-10-21
  */
 @Service
+@DS("slave")
 public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> implements IQuestionService {
 
     @Autowired

+ 6 - 5
zhongzheng-system/src/main/java/com/zhongzheng/modules/base/service/impl/CertificateCommonServiceImpl.java

@@ -2,6 +2,11 @@ package com.zhongzheng.modules.base.service.impl;
 
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.util.StrUtil;
+import com.baomidou.dynamic.datasource.annotation.DS;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.github.pagehelper.Page;
 import com.zhongzheng.common.utils.DateUtils;
 import com.zhongzheng.common.utils.ServletUtils;
 import com.zhongzheng.modules.base.bo.CertificateCommonAddBo;
@@ -12,13 +17,8 @@ import com.zhongzheng.modules.base.mapper.CertificateCommonMapper;
 import com.zhongzheng.modules.base.service.ICertificateCommonService;
 import com.zhongzheng.modules.base.vo.CertificateCommonVo;
 import org.springframework.stereotype.Service;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import com.github.pagehelper.Page;
 
 import java.util.Collection;
-import java.util.Collections;
 import java.util.List;
 import java.util.stream.Collectors;
 
@@ -29,6 +29,7 @@ import java.util.stream.Collectors;
  * @date 2022-06-07
  */
 @Service
+@DS("slave")
 public class CertificateCommonServiceImpl extends ServiceImpl<CertificateCommonMapper, CertificateCommon> implements ICertificateCommonService {
 
     @Override

+ 6 - 7
zhongzheng-system/src/main/java/com/zhongzheng/modules/base/service/impl/CertificateServiceImpl.java

@@ -3,26 +3,24 @@ package com.zhongzheng.modules.base.service.impl;
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.lang.Validator;
 import cn.hutool.core.util.StrUtil;
+import com.baomidou.dynamic.datasource.annotation.DS;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.github.pagehelper.Page;
 import com.zhongzheng.common.exception.CustomException;
 import com.zhongzheng.common.utils.DateUtils;
 import com.zhongzheng.common.utils.ServletUtils;
 import com.zhongzheng.modules.base.bo.CertificateAddBo;
 import com.zhongzheng.modules.base.bo.CertificateEditBo;
 import com.zhongzheng.modules.base.bo.CertificateQueryBo;
-import com.zhongzheng.modules.base.domain.ApplyAreas;
 import com.zhongzheng.modules.base.domain.Certificate;
 import com.zhongzheng.modules.base.mapper.CertificateMapper;
 import com.zhongzheng.modules.base.service.ICertificateService;
 import com.zhongzheng.modules.base.vo.CertificateVo;
-import com.zhongzheng.modules.course.domain.CourseSection;
 import org.springframework.stereotype.Service;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import com.github.pagehelper.Page;
 
 import java.util.Collection;
-import java.util.Collections;
 import java.util.List;
 import java.util.stream.Collectors;
 
@@ -33,6 +31,7 @@ import java.util.stream.Collectors;
  * @date 2021-10-08
  */
 @Service
+@DS("slave")
 public class CertificateServiceImpl extends ServiceImpl<CertificateMapper, Certificate> implements ICertificateService {
 
     @Override

+ 9 - 12
zhongzheng-system/src/main/java/com/zhongzheng/modules/base/service/impl/CertificateTpServiceImpl.java

@@ -3,7 +3,12 @@ package com.zhongzheng.modules.base.service.impl;
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.lang.Validator;
 import cn.hutool.core.util.StrUtil;
+import com.baomidou.dynamic.datasource.annotation.DS;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.github.pagehelper.Page;
 import com.google.zxing.BarcodeFormat;
 import com.google.zxing.common.BitMatrix;
 import com.google.zxing.qrcode.QRCodeWriter;
@@ -20,11 +25,7 @@ import com.zhongzheng.modules.base.mapper.CertificateTpMapper;
 import com.zhongzheng.modules.base.service.ICertificateTpService;
 import com.zhongzheng.modules.base.vo.CertificatePhotoVo;
 import com.zhongzheng.modules.base.vo.CertificateTpVo;
-import com.zhongzheng.modules.course.domain.CourseBusiness;
 import com.zhongzheng.modules.course.vo.CourseChapterVo;
-import com.zhongzheng.modules.course.vo.CourseUserEducationTypeVo;
-import com.zhongzheng.modules.goods.domain.GoodsAttached;
-import com.zhongzheng.modules.goods.service.IGoodsAttachedService;
 import com.zhongzheng.modules.goods.service.IGoodsService;
 import com.zhongzheng.modules.goods.vo.GoodsVo;
 import com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo;
@@ -37,23 +38,18 @@ import com.zhongzheng.modules.user.service.IUserService;
 import com.zhongzheng.modules.user.service.IUserStudyRecordService;
 import com.zhongzheng.modules.user.vo.UserStudyRecordVo;
 import com.zhongzheng.modules.user.vo.UserVo;
-import org.apache.commons.compress.utils.IOUtils;
 import org.apache.commons.lang3.ArrayUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import com.github.pagehelper.Page;
 
 import javax.imageio.ImageIO;
-import javax.validation.Valid;
-import javax.validation.Validation;
 import java.awt.*;
 import java.awt.image.BufferedImage;
 import java.io.*;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
 import java.util.List;
 import java.util.concurrent.TimeUnit;
 import java.util.stream.Collectors;
@@ -65,6 +61,7 @@ import java.util.stream.Collectors;
  * @date 2022-02-16
  */
 @Service
+@DS("slave")
 public class CertificateTpServiceImpl extends ServiceImpl<CertificateTpMapper, CertificateTp> implements ICertificateTpService {
 
     @Autowired

+ 6 - 5
zhongzheng-system/src/main/java/com/zhongzheng/modules/base/service/impl/ProfileFieldServiceImpl.java

@@ -2,6 +2,11 @@ package com.zhongzheng.modules.base.service.impl;
 
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.util.StrUtil;
+import com.baomidou.dynamic.datasource.annotation.DS;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.github.pagehelper.Page;
 import com.zhongzheng.common.utils.DateUtils;
 import com.zhongzheng.modules.base.bo.ProfileFieldAddBo;
 import com.zhongzheng.modules.base.bo.ProfileFieldEditBo;
@@ -11,13 +16,8 @@ import com.zhongzheng.modules.base.mapper.ProfileFieldMapper;
 import com.zhongzheng.modules.base.service.IProfileFieldService;
 import com.zhongzheng.modules.base.vo.ProfileFieldVo;
 import org.springframework.stereotype.Service;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import com.github.pagehelper.Page;
 
 import java.util.Collection;
-import java.util.Collections;
 import java.util.List;
 import java.util.stream.Collectors;
 
@@ -28,6 +28,7 @@ import java.util.stream.Collectors;
  * @date 2021-11-19
  */
 @Service
+@DS("slave")
 public class ProfileFieldServiceImpl extends ServiceImpl<ProfileFieldMapper, ProfileField> implements IProfileFieldService {
 
     @Override

+ 6 - 7
zhongzheng-system/src/main/java/com/zhongzheng/modules/base/service/impl/ProfileTpBusinessServiceImpl.java

@@ -1,8 +1,11 @@
 package com.zhongzheng.modules.base.service.impl;
 
 import cn.hutool.core.bean.BeanUtil;
-import cn.hutool.core.util.StrUtil;
-import com.zhongzheng.common.utils.DateUtils;
+import com.baomidou.dynamic.datasource.annotation.DS;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.github.pagehelper.Page;
 import com.zhongzheng.modules.base.bo.ProfileTpBusinessAddBo;
 import com.zhongzheng.modules.base.bo.ProfileTpBusinessEditBo;
 import com.zhongzheng.modules.base.bo.ProfileTpBusinessQueryBo;
@@ -11,13 +14,8 @@ import com.zhongzheng.modules.base.mapper.ProfileTpBusinessMapper;
 import com.zhongzheng.modules.base.service.IProfileTpBusinessService;
 import com.zhongzheng.modules.base.vo.ProfileTpBusinessVo;
 import org.springframework.stereotype.Service;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import com.github.pagehelper.Page;
 
 import java.util.Collection;
-import java.util.Collections;
 import java.util.List;
 import java.util.stream.Collectors;
 
@@ -28,6 +26,7 @@ import java.util.stream.Collectors;
  * @date 2021-11-19
  */
 @Service
+@DS("slave")
 public class ProfileTpBusinessServiceImpl extends ServiceImpl<ProfileTpBusinessMapper, ProfileTpBusiness> implements IProfileTpBusinessService {
 
     @Override

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/base/service/impl/ProfileTpServiceImpl.java

@@ -3,6 +3,7 @@ package com.zhongzheng.modules.base.service.impl;
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.lang.Validator;
 import cn.hutool.core.util.StrUtil;
+import com.baomidou.dynamic.datasource.annotation.DS;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -33,6 +34,7 @@ import java.util.stream.Collectors;
  * @date 2021-11-19
  */
 @Service
+@DS("slave")
 public class ProfileTpServiceImpl extends ServiceImpl<ProfileTpMapper, ProfileTp> implements IProfileTpService {
 
     @Autowired

+ 14 - 17
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseBusinessServiceImpl.java

@@ -2,37 +2,33 @@ 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.dynamic.datasource.annotation.DS;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.github.pagehelper.Page;
 import com.zhongzheng.common.exception.CustomException;
 import com.zhongzheng.common.utils.DateUtils;
 import com.zhongzheng.common.utils.ServletUtils;
-import com.zhongzheng.modules.course.bo.CourseProjectTypeQueryBo;
-import com.zhongzheng.modules.course.domain.CourseProjectType;
-import com.zhongzheng.modules.course.domain.CourseTopic;
-import com.zhongzheng.modules.course.service.ICourseChapterBusinessService;
-import com.zhongzheng.modules.course.service.ICourseProjectTypeService;
-import com.zhongzheng.modules.course.service.ICourseTopicService;
-import com.zhongzheng.modules.course.vo.*;
-import org.apache.el.util.Validation;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import com.github.pagehelper.Page;
 import com.zhongzheng.modules.course.bo.CourseBusinessAddBo;
-import com.zhongzheng.modules.course.bo.CourseBusinessQueryBo;
 import com.zhongzheng.modules.course.bo.CourseBusinessEditBo;
+import com.zhongzheng.modules.course.bo.CourseBusinessQueryBo;
 import com.zhongzheng.modules.course.domain.CourseBusiness;
+import com.zhongzheng.modules.course.domain.CourseTopic;
 import com.zhongzheng.modules.course.mapper.CourseBusinessMapper;
 import com.zhongzheng.modules.course.service.ICourseBusinessService;
+import com.zhongzheng.modules.course.service.ICourseProjectTypeService;
+import com.zhongzheng.modules.course.service.ICourseTopicService;
+import com.zhongzheng.modules.course.vo.CourseBusinessVo;
+import com.zhongzheng.modules.course.vo.CourseProjectTypeVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
 import org.springframework.util.CollectionUtils;
 
 import java.util.ArrayList;
 import java.util.Collection;
-import java.util.Collections;
 import java.util.List;
 import java.util.stream.Collectors;
 
@@ -43,6 +39,7 @@ import java.util.stream.Collectors;
  * @date 2021-10-08
  */
 @Service
+@DS("slave")
 public class CourseBusinessServiceImpl extends ServiceImpl<CourseBusinessMapper, CourseBusiness> implements ICourseBusinessService {
 
     @Autowired

+ 6 - 8
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseChapterBusinessServiceImpl.java

@@ -1,25 +1,22 @@
 package com.zhongzheng.modules.course.service.impl;
 
 import cn.hutool.core.bean.BeanUtil;
-import cn.hutool.core.util.StrUtil;
-import com.zhongzheng.common.utils.DateUtils;
+import com.baomidou.dynamic.datasource.annotation.DS;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.github.pagehelper.Page;
 import com.zhongzheng.modules.course.bo.CourseChapterBusinessAddBo;
 import com.zhongzheng.modules.course.bo.CourseChapterBusinessEditBo;
 import com.zhongzheng.modules.course.bo.CourseChapterBusinessQueryBo;
 import com.zhongzheng.modules.course.domain.CourseChapterBusiness;
 import com.zhongzheng.modules.course.mapper.CourseChapterBusinessMapper;
-import com.zhongzheng.modules.course.mapper.CourseSectionBusinessMapper;
 import com.zhongzheng.modules.course.service.ICourseChapterBusinessService;
 import com.zhongzheng.modules.course.vo.CourseChapterBusinessVo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import com.github.pagehelper.Page;
 
 import java.util.Collection;
-import java.util.Collections;
 import java.util.List;
 import java.util.stream.Collectors;
 
@@ -30,6 +27,7 @@ import java.util.stream.Collectors;
  * @date 2021-10-09
  */
 @Service
+@DS("slave")
 public class CourseChapterBusinessServiceImpl extends ServiceImpl<CourseChapterBusinessMapper, CourseChapterBusiness> implements ICourseChapterBusinessService {
 
     @Autowired

+ 12 - 11
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseChapterSectionServiceImpl.java

@@ -2,26 +2,26 @@ 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.dynamic.datasource.annotation.DS;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
-import com.zhongzheng.common.utils.DateUtils;
-import com.zhongzheng.modules.course.bo.*;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.github.pagehelper.Page;
+import com.zhongzheng.modules.course.bo.CourseChapterSectionAddBo;
+import com.zhongzheng.modules.course.bo.CourseChapterSectionEditBo;
+import com.zhongzheng.modules.course.bo.CourseChapterSectionQueryBo;
+import com.zhongzheng.modules.course.bo.CourseMenuQueryBo;
 import com.zhongzheng.modules.course.domain.CourseChapterSection;
-import com.zhongzheng.modules.course.domain.CourseStreamingBusiness;
-import com.zhongzheng.modules.course.mapper.CourseChapterMapper;
 import com.zhongzheng.modules.course.mapper.CourseChapterSectionMapper;
 import com.zhongzheng.modules.course.service.ICourseChapterSectionService;
-import com.zhongzheng.modules.course.vo.*;
+import com.zhongzheng.modules.course.vo.CourseChapterSectionVo;
+import com.zhongzheng.modules.course.vo.CourseUserChapterSectionVo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import com.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.stream.Collectors;
@@ -33,6 +33,7 @@ import java.util.stream.Collectors;
  * @date 2021-10-12
  */
 @Service
+@DS("slave")
 public class CourseChapterSectionServiceImpl extends ServiceImpl<CourseChapterSectionMapper, CourseChapterSection> implements ICourseChapterSectionService {
 
     @Autowired

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

@@ -3,32 +3,32 @@ 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.dynamic.datasource.annotation.DS;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.github.pagehelper.Page;
 import com.zhongzheng.common.exception.CustomException;
 import com.zhongzheng.common.utils.DateUtils;
 import com.zhongzheng.common.utils.ServletUtils;
-import com.zhongzheng.modules.bank.domain.QuestionModuleChapter;
-import com.zhongzheng.modules.bank.service.IQuestionModuleChapterService;
 import com.zhongzheng.modules.course.bo.*;
 import com.zhongzheng.modules.course.domain.*;
 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 com.zhongzheng.modules.grade.bo.UserPeriodQueryBo;
 import com.zhongzheng.modules.grade.service.IUserPeriodService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import com.github.pagehelper.Page;
 import org.springframework.transaction.annotation.Transactional;
 
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.List;
 import java.util.stream.Collectors;
 
 /**
@@ -38,6 +38,7 @@ import java.util.stream.Collectors;
  * @date 2021-10-09
  */
 @Service
+@DS("slave")
 public class CourseChapterServiceImpl extends ServiceImpl<CourseChapterMapper, CourseChapter> implements ICourseChapterService {
 
     @Autowired

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

@@ -2,22 +2,21 @@ package com.zhongzheng.modules.course.service.impl;
 
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.util.StrUtil;
-import com.zhongzheng.common.utils.DateUtils;
-import org.springframework.stereotype.Service;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.baomidou.dynamic.datasource.annotation.DS;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.github.pagehelper.Page;
 import com.zhongzheng.modules.course.bo.CourseEducationTierAddBo;
-import com.zhongzheng.modules.course.bo.CourseEducationTierQueryBo;
 import com.zhongzheng.modules.course.bo.CourseEducationTierEditBo;
+import com.zhongzheng.modules.course.bo.CourseEducationTierQueryBo;
 import com.zhongzheng.modules.course.domain.CourseEducationTier;
 import com.zhongzheng.modules.course.mapper.CourseEducationTierMapper;
-import com.zhongzheng.modules.course.vo.CourseEducationTierVo;
 import com.zhongzheng.modules.course.service.ICourseEducationTierService;
+import com.zhongzheng.modules.course.vo.CourseEducationTierVo;
+import org.springframework.stereotype.Service;
 
 import java.util.Collection;
-import java.util.Collections;
 import java.util.List;
 import java.util.stream.Collectors;
 
@@ -28,6 +27,7 @@ import java.util.stream.Collectors;
  * @date 2021-11-01
  */
 @Service
+@DS("slave")
 public class CourseEducationTierServiceImpl extends ServiceImpl<CourseEducationTierMapper, CourseEducationTier> implements ICourseEducationTierService {
 
     @Override

+ 16 - 14
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseEducationTypeServiceImpl.java

@@ -3,32 +3,33 @@ 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.dynamic.datasource.annotation.DS;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.github.pagehelper.Page;
 import com.zhongzheng.common.utils.DateUtils;
 import com.zhongzheng.common.utils.ServletUtils;
-import com.zhongzheng.modules.base.domain.ApplyAreas;
 import com.zhongzheng.modules.base.vo.BaseFilterVo;
 import com.zhongzheng.modules.course.bo.CourseEducationTierAddBo;
-import com.zhongzheng.modules.course.domain.CourseEducationTier;
-import com.zhongzheng.modules.course.service.ICourseEducationTierService;
-import com.zhongzheng.modules.course.vo.CourseEducationTierVo;
-import com.zhongzheng.modules.pay.domain.PayAisle;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import com.github.pagehelper.Page;
 import com.zhongzheng.modules.course.bo.CourseEducationTypeAddBo;
-import com.zhongzheng.modules.course.bo.CourseEducationTypeQueryBo;
 import com.zhongzheng.modules.course.bo.CourseEducationTypeEditBo;
+import com.zhongzheng.modules.course.bo.CourseEducationTypeQueryBo;
+import com.zhongzheng.modules.course.domain.CourseEducationTier;
 import com.zhongzheng.modules.course.domain.CourseEducationType;
 import com.zhongzheng.modules.course.mapper.CourseEducationTypeMapper;
-import com.zhongzheng.modules.course.vo.CourseEducationTypeVo;
+import com.zhongzheng.modules.course.service.ICourseEducationTierService;
 import com.zhongzheng.modules.course.service.ICourseEducationTypeService;
+import com.zhongzheng.modules.course.vo.CourseEducationTierVo;
+import com.zhongzheng.modules.course.vo.CourseEducationTypeVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
 import org.springframework.util.StringUtils;
 
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
 import java.util.stream.Collectors;
 
 /**
@@ -38,6 +39,7 @@ import java.util.stream.Collectors;
  * @date 2021-10-08
  */
 @Service
+@DS("slave")
 public class CourseEducationTypeServiceImpl extends ServiceImpl<CourseEducationTypeMapper, CourseEducationType> implements ICourseEducationTypeService {
 
     @Autowired

+ 7 - 8
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseHandoutsBusinessServiceImpl.java

@@ -1,24 +1,22 @@
 package com.zhongzheng.modules.course.service.impl;
 
 import cn.hutool.core.bean.BeanUtil;
-import cn.hutool.core.util.StrUtil;
-import com.zhongzheng.common.utils.DateUtils;
-import com.zhongzheng.modules.course.domain.CourseEducationType;
-import org.springframework.stereotype.Service;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.baomidou.dynamic.datasource.annotation.DS;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.github.pagehelper.Page;
+import com.zhongzheng.common.utils.DateUtils;
 import com.zhongzheng.modules.course.bo.CourseHandoutsBusinessAddBo;
-import com.zhongzheng.modules.course.bo.CourseHandoutsBusinessQueryBo;
 import com.zhongzheng.modules.course.bo.CourseHandoutsBusinessEditBo;
+import com.zhongzheng.modules.course.bo.CourseHandoutsBusinessQueryBo;
 import com.zhongzheng.modules.course.domain.CourseHandoutsBusiness;
 import com.zhongzheng.modules.course.mapper.CourseHandoutsBusinessMapper;
-import com.zhongzheng.modules.course.vo.CourseHandoutsBusinessVo;
 import com.zhongzheng.modules.course.service.ICourseHandoutsBusinessService;
+import com.zhongzheng.modules.course.vo.CourseHandoutsBusinessVo;
+import org.springframework.stereotype.Service;
 
 import java.util.Collection;
-import java.util.Collections;
 import java.util.List;
 import java.util.stream.Collectors;
 
@@ -29,6 +27,7 @@ import java.util.stream.Collectors;
  * @date 2021-11-02
  */
 @Service
+@DS("slave")
 public class CourseHandoutsBusinessServiceImpl extends ServiceImpl<CourseHandoutsBusinessMapper, CourseHandoutsBusiness> implements ICourseHandoutsBusinessService {
 
     @Override

+ 15 - 14
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseHandoutsServiceImpl.java

@@ -2,33 +2,33 @@ 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.dynamic.datasource.annotation.DS;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.github.pagehelper.Page;
 import com.zhongzheng.common.exception.CustomException;
 import com.zhongzheng.common.utils.DateUtils;
 import com.zhongzheng.common.utils.ServletUtils;
 import com.zhongzheng.modules.course.bo.*;
-import com.zhongzheng.modules.course.domain.*;
+import com.zhongzheng.modules.course.domain.CourseFile;
+import com.zhongzheng.modules.course.domain.CourseHandouts;
+import com.zhongzheng.modules.course.domain.CourseHandoutsBusiness;
+import com.zhongzheng.modules.course.mapper.CourseHandoutsMapper;
 import com.zhongzheng.modules.course.service.ICourseFileService;
 import com.zhongzheng.modules.course.service.ICourseHandoutsBusinessService;
+import com.zhongzheng.modules.course.service.ICourseHandoutsService;
 import com.zhongzheng.modules.course.vo.CourseHandoutsBusinessVo;
-import com.zhongzheng.modules.course.vo.CourseMenuExamVo;
-import com.zhongzheng.modules.goods.bo.GoodsCourseAddBo;
+import com.zhongzheng.modules.course.vo.CourseHandoutsVo;
 import com.zhongzheng.modules.goods.domain.Goods;
-import com.zhongzheng.modules.goods.domain.GoodsAttached;
-import com.zhongzheng.modules.goods.domain.GoodsCourse;
 import com.zhongzheng.modules.goods.service.IGoodsService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import com.github.pagehelper.Page;
-import com.zhongzheng.modules.course.mapper.CourseHandoutsMapper;
-import com.zhongzheng.modules.course.vo.CourseHandoutsVo;
-import com.zhongzheng.modules.course.service.ICourseHandoutsService;
 import org.springframework.util.CollectionUtils;
 
-import java.util.*;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.List;
 import java.util.stream.Collectors;
 
 /**
@@ -38,6 +38,7 @@ import java.util.stream.Collectors;
  * @date 2021-11-02
  */
 @Service
+@DS("slave")
 public class CourseHandoutsServiceImpl extends ServiceImpl<CourseHandoutsMapper, CourseHandouts> implements ICourseHandoutsService {
 
     @Autowired

+ 6 - 7
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseMenuExamServiceImpl.java

@@ -1,25 +1,23 @@
 package com.zhongzheng.modules.course.service.impl;
 
 import cn.hutool.core.bean.BeanUtil;
-import cn.hutool.core.util.StrUtil;
+import com.baomidou.dynamic.datasource.annotation.DS;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.github.pagehelper.Page;
 import com.zhongzheng.common.utils.DateUtils;
 import com.zhongzheng.modules.course.bo.CourseMenuExamAddBo;
 import com.zhongzheng.modules.course.bo.CourseMenuExamEditBo;
 import com.zhongzheng.modules.course.bo.CourseMenuExamQueryBo;
 import com.zhongzheng.modules.course.domain.CourseMenuExam;
 import com.zhongzheng.modules.course.mapper.CourseMenuExamMapper;
-import com.zhongzheng.modules.course.mapper.CourseMenuMapper;
 import com.zhongzheng.modules.course.service.ICourseMenuExamService;
 import com.zhongzheng.modules.course.vo.CourseMenuExamVo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import com.github.pagehelper.Page;
 
 import java.util.Collection;
-import java.util.Collections;
 import java.util.List;
 import java.util.stream.Collectors;
 
@@ -30,6 +28,7 @@ import java.util.stream.Collectors;
  * @date 2021-11-17
  */
 @Service
+@DS("slave")
 public class CourseMenuExamServiceImpl extends ServiceImpl<CourseMenuExamMapper, CourseMenuExam> implements ICourseMenuExamService {
 
     @Autowired

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

@@ -2,6 +2,7 @@ package com.zhongzheng.modules.course.service.impl;
 
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.lang.Validator;
+import com.baomidou.dynamic.datasource.annotation.DS;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
@@ -41,6 +42,7 @@ import java.util.stream.Collectors;
  * @date 2021-10-12
  */
 @Service
+@DS("slave")
 public class CourseMenuServiceImpl extends ServiceImpl<CourseMenuMapper, CourseMenu> implements ICourseMenuService {
 
     @Autowired

+ 7 - 9
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseModuleBusinessServiceImpl.java

@@ -1,25 +1,22 @@
 package com.zhongzheng.modules.course.service.impl;
 
 import cn.hutool.core.bean.BeanUtil;
-import cn.hutool.core.util.StrUtil;
-import com.zhongzheng.common.utils.DateUtils;
+import com.baomidou.dynamic.datasource.annotation.DS;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.github.pagehelper.Page;
 import com.zhongzheng.modules.course.bo.CourseModuleBusinessAddBo;
 import com.zhongzheng.modules.course.bo.CourseModuleBusinessEditBo;
 import com.zhongzheng.modules.course.bo.CourseModuleBusinessQueryBo;
-import com.zhongzheng.modules.course.domain.CourseModule;
 import com.zhongzheng.modules.course.domain.CourseModuleBusiness;
 import com.zhongzheng.modules.course.mapper.CourseModuleBusinessMapper;
 import com.zhongzheng.modules.course.service.ICourseModuleBusinessService;
 import com.zhongzheng.modules.course.vo.CourseModuleBusinessVo;
-import com.zhongzheng.modules.grade.service.IClassGradeUserService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import com.github.pagehelper.Page;
+
 import java.util.Collection;
-import java.util.Collections;
 import java.util.List;
 import java.util.stream.Collectors;
 
@@ -30,6 +27,7 @@ import java.util.stream.Collectors;
  * @date 2021-10-09
  */
 @Service
+@DS("slave")
 public class CourseModuleBusinessServiceImpl extends ServiceImpl<CourseModuleBusinessMapper, CourseModuleBusiness> implements ICourseModuleBusinessService {
 
     @Autowired

+ 12 - 10
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseModuleChapterServiceImpl.java

@@ -2,25 +2,26 @@ 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.dynamic.datasource.annotation.DS;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
-import com.zhongzheng.common.utils.DateUtils;
-import com.zhongzheng.modules.course.bo.*;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.github.pagehelper.Page;
+import com.zhongzheng.modules.course.bo.CourseMenuQueryBo;
+import com.zhongzheng.modules.course.bo.CourseModuleChapterAddBo;
+import com.zhongzheng.modules.course.bo.CourseModuleChapterEditBo;
+import com.zhongzheng.modules.course.bo.CourseModuleChapterQueryBo;
 import com.zhongzheng.modules.course.domain.CourseModuleChapter;
-import com.zhongzheng.modules.course.mapper.CourseChapterSectionMapper;
 import com.zhongzheng.modules.course.mapper.CourseModuleChapterMapper;
 import com.zhongzheng.modules.course.service.ICourseModuleChapterService;
-import com.zhongzheng.modules.course.vo.*;
+import com.zhongzheng.modules.course.vo.CourseModuleChapterVo;
+import com.zhongzheng.modules.course.vo.CourseUserModuleChapterVo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import com.github.pagehelper.Page;
 
 import java.util.ArrayList;
 import java.util.Collection;
-import java.util.Collections;
 import java.util.List;
 import java.util.stream.Collectors;
 
@@ -31,6 +32,7 @@ import java.util.stream.Collectors;
  * @date 2021-10-11
  */
 @Service
+@DS("slave")
 public class CourseModuleChapterServiceImpl extends ServiceImpl<CourseModuleChapterMapper, CourseModuleChapter> implements ICourseModuleChapterService {
 
     @Autowired

+ 14 - 8
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseModuleServiceImpl.java

@@ -3,30 +3,35 @@ 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.dynamic.datasource.annotation.DS;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.github.pagehelper.Page;
 import com.zhongzheng.common.exception.CustomException;
 import com.zhongzheng.common.utils.DateUtils;
 import com.zhongzheng.common.utils.ServletUtils;
 import com.zhongzheng.modules.course.bo.*;
-import com.zhongzheng.modules.course.domain.*;
+import com.zhongzheng.modules.course.domain.CourseMenu;
+import com.zhongzheng.modules.course.domain.CourseModule;
+import com.zhongzheng.modules.course.domain.CourseModuleBusiness;
+import com.zhongzheng.modules.course.domain.CourseModuleChapter;
 import com.zhongzheng.modules.course.mapper.CourseModuleMapper;
-import com.zhongzheng.modules.course.service.*;
+import com.zhongzheng.modules.course.service.ICourseMenuService;
+import com.zhongzheng.modules.course.service.ICourseModuleBusinessService;
+import com.zhongzheng.modules.course.service.ICourseModuleChapterService;
+import com.zhongzheng.modules.course.service.ICourseModuleService;
 import com.zhongzheng.modules.course.vo.CourseModuleVo;
 import com.zhongzheng.modules.goods.bo.GoodsBatchDelBo;
-import com.zhongzheng.modules.goods.domain.GoodsAttached;
 import com.zhongzheng.modules.grade.bo.UserPeriodQueryBo;
 import com.zhongzheng.modules.grade.service.IUserPeriodService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import com.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.stream.Collectors;
@@ -38,6 +43,7 @@ import java.util.stream.Collectors;
  * @date 2021-10-09
  */
 @Service
+@DS("slave")
 public class CourseModuleServiceImpl extends ServiceImpl<CourseModuleMapper, CourseModule> implements ICourseModuleService {
 
     @Autowired

+ 7 - 9
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseProjectTypeServiceImpl.java

@@ -1,26 +1,23 @@
 package com.zhongzheng.modules.course.service.impl;
 
 import cn.hutool.core.bean.BeanUtil;
-import cn.hutool.core.util.StrUtil;
-import com.zhongzheng.common.utils.DateUtils;
-import com.zhongzheng.common.utils.ServletUtils;
-import org.springframework.stereotype.Service;
+import com.baomidou.dynamic.datasource.annotation.DS;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.github.pagehelper.Page;
+import com.zhongzheng.common.utils.DateUtils;
+import com.zhongzheng.common.utils.ServletUtils;
 import com.zhongzheng.modules.course.bo.CourseProjectTypeAddBo;
-import com.zhongzheng.modules.course.bo.CourseProjectTypeQueryBo;
 import com.zhongzheng.modules.course.bo.CourseProjectTypeEditBo;
+import com.zhongzheng.modules.course.bo.CourseProjectTypeQueryBo;
 import com.zhongzheng.modules.course.domain.CourseProjectType;
 import com.zhongzheng.modules.course.mapper.CourseProjectTypeMapper;
-import com.zhongzheng.modules.course.vo.CourseProjectTypeVo;
 import com.zhongzheng.modules.course.service.ICourseProjectTypeService;
+import com.zhongzheng.modules.course.vo.CourseProjectTypeVo;
+import org.springframework.stereotype.Service;
 import org.springframework.util.CollectionUtils;
 
 import java.util.ArrayList;
 import java.util.Collection;
-import java.util.Collections;
 import java.util.List;
 import java.util.stream.Collectors;
 
@@ -31,6 +28,7 @@ import java.util.stream.Collectors;
  * @date 2021-10-08
  */
 @Service
+@DS("slave")
 public class CourseProjectTypeServiceImpl extends ServiceImpl<CourseProjectTypeMapper, CourseProjectType> implements ICourseProjectTypeService {
 
     @Override

+ 6 - 8
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseSectionBusinessServiceImpl.java

@@ -1,25 +1,22 @@
 package com.zhongzheng.modules.course.service.impl;
 
 import cn.hutool.core.bean.BeanUtil;
-import cn.hutool.core.util.StrUtil;
-import com.zhongzheng.common.utils.DateUtils;
+import com.baomidou.dynamic.datasource.annotation.DS;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.github.pagehelper.Page;
 import com.zhongzheng.modules.course.bo.CourseSectionBusinessAddBo;
 import com.zhongzheng.modules.course.bo.CourseSectionBusinessEditBo;
 import com.zhongzheng.modules.course.bo.CourseSectionBusinessQueryBo;
 import com.zhongzheng.modules.course.domain.CourseSectionBusiness;
 import com.zhongzheng.modules.course.mapper.CourseSectionBusinessMapper;
 import com.zhongzheng.modules.course.service.ICourseSectionBusinessService;
-import com.zhongzheng.modules.course.service.IMajorService;
 import com.zhongzheng.modules.course.vo.CourseSectionBusinessVo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import com.github.pagehelper.Page;
 
 import java.util.Collection;
-import java.util.Collections;
 import java.util.List;
 import java.util.stream.Collectors;
 
@@ -30,6 +27,7 @@ import java.util.stream.Collectors;
  * @date 2021-10-11
  */
 @Service
+@DS("slave")
 public class CourseSectionBusinessServiceImpl extends ServiceImpl<CourseSectionBusinessMapper, CourseSectionBusiness> implements ICourseSectionBusinessService {
 
     @Autowired

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

@@ -4,18 +4,18 @@ import cn.hutool.core.bean.BeanUtil;
 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.dynamic.datasource.annotation.DS;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.github.pagehelper.Page;
 import com.zhongzheng.common.core.redis.RedisCache;
 import com.zhongzheng.common.exception.CustomException;
 import com.zhongzheng.common.utils.DateUtils;
 import com.zhongzheng.common.utils.ServletUtils;
-import com.zhongzheng.modules.bank.bo.QuestionAddBo;
-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.*;
 import com.zhongzheng.modules.course.domain.*;
 import com.zhongzheng.modules.course.mapper.CourseSectionMapper;
@@ -32,20 +32,14 @@ import com.zhongzheng.modules.polyv.bo.PolyvLiveQueryBo;
 import com.zhongzheng.modules.polyv.service.IPolyvLiveService;
 import com.zhongzheng.modules.polyv.service.IPolyvVideoService;
 import com.zhongzheng.modules.polyv.vo.PolyvVideoQuerVo;
-import com.zhongzheng.modules.system.domain.SysRoleMenu;
 import net.polyv.live.v1.entity.chat.LiveGetMessageListResponse;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import com.github.pagehelper.Page;
 import org.springframework.transaction.annotation.Transactional;
 
 import java.io.IOException;
 import java.security.NoSuchAlgorithmException;
 import java.text.ParseException;
-import java.text.SimpleDateFormat;
 import java.util.*;
 import java.util.concurrent.TimeUnit;
 import java.util.stream.Collectors;
@@ -57,6 +51,7 @@ import java.util.stream.Collectors;
  * @date 2021-10-11
  */
 @Service
+@DS("slave")
 public class CourseSectionServiceImpl extends ServiceImpl<CourseSectionMapper, CourseSection> implements ICourseSectionService {
 
     @Autowired

+ 2 - 7
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseSectionWatchPerServiceImpl.java

@@ -2,13 +2,11 @@ package com.zhongzheng.modules.course.service.impl;
 
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.codec.Base64;
-import cn.hutool.core.codec.Base64Decoder;
+import com.baomidou.dynamic.datasource.annotation.DS;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.toolkit.BeanUtils;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.zhongzheng.common.exception.CustomException;
 import com.zhongzheng.common.utils.DateUtils;
 import com.zhongzheng.modules.course.bo.CheckSectionWatchVo;
 import com.zhongzheng.modules.course.bo.SectionWatchPerAddBo;
@@ -23,14 +21,10 @@ import com.zhongzheng.modules.course.vo.CourseSectionWatchPerVo;
 import com.zhongzheng.modules.goods.domain.Goods;
 import com.zhongzheng.modules.goods.service.IGoodsService;
 import com.zhongzheng.modules.wx.service.IWxLoginService;
-import org.apache.commons.codec.digest.DigestUtils;
-import org.bouncycastle.pqc.math.linearalgebra.ByteUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 
-import java.security.MessageDigest;
-import java.util.Date;
 import java.util.List;
 
 /**
@@ -38,6 +32,7 @@ import java.util.List;
  * @date 2022年08月16日 11:05
  */
 @Service
+@DS("slave")
 public class CourseSectionWatchPerServiceImpl extends ServiceImpl<CourseSectionWatchPerMapper, CourseSectionWatchPer> implements ICourseSectionWatchPerService {
 
     @Autowired

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

@@ -3,36 +3,40 @@ 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.dynamic.datasource.annotation.DS;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
-import com.zhongzheng.common.core.page.TableDataInfo;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.github.pagehelper.Page;
 import com.zhongzheng.common.exception.CustomException;
 import com.zhongzheng.common.utils.DateUtils;
 import com.zhongzheng.common.utils.ServletUtils;
-import com.zhongzheng.modules.bank.domain.ExamQuestion;
-import com.zhongzheng.modules.bank.domain.Question;
-import com.zhongzheng.modules.course.bo.*;
+import com.zhongzheng.modules.course.bo.CourseAddBo;
+import com.zhongzheng.modules.course.bo.CourseEditBo;
+import com.zhongzheng.modules.course.bo.CourseQueryBo;
 import com.zhongzheng.modules.course.domain.Course;
-import com.zhongzheng.modules.course.domain.CourseBusiness;
 import com.zhongzheng.modules.course.domain.CoursePhotoLog;
 import com.zhongzheng.modules.course.mapper.CourseMapper;
-import com.zhongzheng.modules.course.mapper.CourseSectionMapper;
 import com.zhongzheng.modules.course.service.ICoursePhotoLogService;
-import com.zhongzheng.modules.course.service.ICourseSectionBusinessService;
 import com.zhongzheng.modules.course.service.ICourseService;
 import com.zhongzheng.modules.course.vo.CourseUserVo;
 import com.zhongzheng.modules.course.vo.CourseVo;
-import com.zhongzheng.modules.exam.domain.*;
-import com.zhongzheng.modules.exam.service.*;
+import com.zhongzheng.modules.exam.domain.ExamApplyUser;
+import com.zhongzheng.modules.exam.domain.ExamBefore;
+import com.zhongzheng.modules.exam.domain.ExamBeforeApply;
+import com.zhongzheng.modules.exam.service.IExamApplyGoodsService;
+import com.zhongzheng.modules.exam.service.IExamApplyUserService;
+import com.zhongzheng.modules.exam.service.IExamBeforeApplyService;
+import com.zhongzheng.modules.exam.service.IExamBeforeService;
 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;
 import com.zhongzheng.modules.goods.vo.GoodsPeriodVo;
 import com.zhongzheng.modules.goods.vo.GoodsUserVo;
-import com.zhongzheng.modules.goods.vo.GoodsVo;
 import com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo;
 import com.zhongzheng.modules.grade.bo.UserPeriodQueryBo;
 import com.zhongzheng.modules.grade.bo.UserPeriodStatusAddBo;
@@ -56,16 +60,11 @@ import com.zhongzheng.modules.user.vo.SubjectStudyRecordVo;
 import com.zhongzheng.modules.user.vo.UserStudyRecordPhotoVo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import com.github.pagehelper.Page;
 import org.springframework.transaction.annotation.Transactional;
 
 import java.math.BigDecimal;
 import java.util.ArrayList;
 import java.util.Collection;
-import java.util.Collections;
 import java.util.List;
 import java.util.stream.Collectors;
 
@@ -76,6 +75,7 @@ import java.util.stream.Collectors;
  * @date 2021-10-09
  */
 @Service
+@DS("slave")
 public class CourseServiceImpl extends ServiceImpl<CourseMapper, Course> implements ICourseService {
 
     @Autowired

+ 6 - 8
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseStreamingBusinessServiceImpl.java

@@ -1,25 +1,22 @@
 package com.zhongzheng.modules.course.service.impl;
 
 import cn.hutool.core.bean.BeanUtil;
-import cn.hutool.core.util.StrUtil;
-import com.zhongzheng.common.utils.DateUtils;
+import com.baomidou.dynamic.datasource.annotation.DS;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.github.pagehelper.Page;
 import com.zhongzheng.modules.course.bo.CourseStreamingBusinessAddBo;
 import com.zhongzheng.modules.course.bo.CourseStreamingBusinessEditBo;
 import com.zhongzheng.modules.course.bo.CourseStreamingBusinessQueryBo;
 import com.zhongzheng.modules.course.domain.CourseStreamingBusiness;
-import com.zhongzheng.modules.course.mapper.CourseSectionBusinessMapper;
 import com.zhongzheng.modules.course.mapper.CourseStreamingBusinessMapper;
 import com.zhongzheng.modules.course.service.ICourseStreamingBusinessService;
 import com.zhongzheng.modules.course.vo.CourseStreamingBusinessVo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import com.github.pagehelper.Page;
 
 import java.util.Collection;
-import java.util.Collections;
 import java.util.List;
 import java.util.stream.Collectors;
 
@@ -30,6 +27,7 @@ import java.util.stream.Collectors;
  * @date 2021-10-11
  */
 @Service
+@DS("slave")
 public class CourseStreamingBusinessServiceImpl extends ServiceImpl<CourseStreamingBusinessMapper, CourseStreamingBusiness> implements ICourseStreamingBusinessService {
 
     @Autowired

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

@@ -3,18 +3,22 @@ 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.dynamic.datasource.annotation.DS;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.StringUtils;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.github.pagehelper.Page;
 import com.zhongzheng.common.exception.CustomException;
 import com.zhongzheng.common.utils.DateUtils;
 import com.zhongzheng.common.utils.ServletUtils;
-import com.zhongzheng.modules.course.bo.*;
-import com.zhongzheng.modules.course.domain.Course;
-import com.zhongzheng.modules.course.domain.CourseSectionBusiness;
+import com.zhongzheng.modules.course.bo.CourseStreamingAddBo;
+import com.zhongzheng.modules.course.bo.CourseStreamingBusinessAddBo;
+import com.zhongzheng.modules.course.bo.CourseStreamingEditBo;
+import com.zhongzheng.modules.course.bo.CourseStreamingQueryBo;
 import com.zhongzheng.modules.course.domain.CourseStreaming;
 import com.zhongzheng.modules.course.domain.CourseStreamingBusiness;
-import com.zhongzheng.modules.course.mapper.CourseSectionMapper;
 import com.zhongzheng.modules.course.mapper.CourseStreamingMapper;
-import com.zhongzheng.modules.course.service.ICourseSectionBusinessService;
 import com.zhongzheng.modules.course.service.ICourseStreamingBusinessService;
 import com.zhongzheng.modules.course.service.ICourseStreamingService;
 import com.zhongzheng.modules.course.vo.CourseStreamingVo;
@@ -22,14 +26,9 @@ import com.zhongzheng.modules.polyv.service.IPolyvVideoService;
 import com.zhongzheng.modules.polyv.vo.PolyvVideoQuerVo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import com.github.pagehelper.Page;
 import org.springframework.transaction.annotation.Transactional;
 
 import java.util.Collection;
-import java.util.Collections;
 import java.util.List;
 import java.util.stream.Collectors;
 
@@ -40,6 +39,7 @@ import java.util.stream.Collectors;
  * @date 2021-10-11
  */
 @Service
+@DS("slave")
 public class CourseStreamingServiceImpl extends ServiceImpl<CourseStreamingMapper, CourseStreaming> implements ICourseStreamingService {
 
     @Autowired

+ 7 - 8
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseSubjectProjectServiceImpl.java

@@ -1,24 +1,22 @@
 package com.zhongzheng.modules.course.service.impl;
 
 import cn.hutool.core.bean.BeanUtil;
-import cn.hutool.core.util.StrUtil;
-import com.zhongzheng.common.utils.DateUtils;
-import com.zhongzheng.modules.course.domain.CourseHandoutsBusiness;
-import org.springframework.stereotype.Service;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.baomidou.dynamic.datasource.annotation.DS;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.github.pagehelper.Page;
+import com.zhongzheng.common.utils.DateUtils;
 import com.zhongzheng.modules.course.bo.CourseSubjectProjectAddBo;
-import com.zhongzheng.modules.course.bo.CourseSubjectProjectQueryBo;
 import com.zhongzheng.modules.course.bo.CourseSubjectProjectEditBo;
+import com.zhongzheng.modules.course.bo.CourseSubjectProjectQueryBo;
 import com.zhongzheng.modules.course.domain.CourseSubjectProject;
 import com.zhongzheng.modules.course.mapper.CourseSubjectProjectMapper;
-import com.zhongzheng.modules.course.vo.CourseSubjectProjectVo;
 import com.zhongzheng.modules.course.service.ICourseSubjectProjectService;
+import com.zhongzheng.modules.course.vo.CourseSubjectProjectVo;
+import org.springframework.stereotype.Service;
 
 import java.util.Collection;
-import java.util.Collections;
 import java.util.List;
 import java.util.stream.Collectors;
 
@@ -29,6 +27,7 @@ import java.util.stream.Collectors;
  * @date 2021-10-09
  */
 @Service
+@DS("slave")
 public class CourseSubjectProjectServiceImpl extends ServiceImpl<CourseSubjectProjectMapper, CourseSubjectProject> implements ICourseSubjectProjectService {
 
     @Override

+ 10 - 16
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseSubjectServiceImpl.java

@@ -1,35 +1,28 @@
 package com.zhongzheng.modules.course.service.impl;
 
 import cn.hutool.core.bean.BeanUtil;
-import cn.hutool.core.util.StrUtil;
+import com.baomidou.dynamic.datasource.annotation.DS;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.github.pagehelper.Page;
 import com.zhongzheng.common.utils.DateUtils;
 import com.zhongzheng.common.utils.ServletUtils;
 import com.zhongzheng.modules.course.bo.*;
-import com.zhongzheng.modules.course.domain.CourseBusiness;
-import com.zhongzheng.modules.course.domain.CourseEducationType;
+import com.zhongzheng.modules.course.domain.CourseSubject;
 import com.zhongzheng.modules.course.domain.CourseSubjectProject;
+import com.zhongzheng.modules.course.mapper.CourseSubjectMapper;
 import com.zhongzheng.modules.course.service.ICourseSubjectProjectService;
+import com.zhongzheng.modules.course.service.ICourseSubjectService;
 import com.zhongzheng.modules.course.vo.CourseProjectTypeVo;
+import com.zhongzheng.modules.course.vo.CourseSubjectVo;
 import com.zhongzheng.modules.grade.bo.ClassGradeListBo;
-import com.zhongzheng.modules.user.bo.SchoolProjectAddBo;
-import com.zhongzheng.modules.user.domain.SchoolProject;
-import com.zhongzheng.modules.user.vo.SchoolVo;
-
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import com.github.pagehelper.Page;
-import com.zhongzheng.modules.course.domain.CourseSubject;
-import com.zhongzheng.modules.course.mapper.CourseSubjectMapper;
-import com.zhongzheng.modules.course.vo.CourseSubjectVo;
-import com.zhongzheng.modules.course.service.ICourseSubjectService;
 
 import java.util.ArrayList;
 import java.util.Collection;
-import java.util.Collections;
 import java.util.List;
 import java.util.stream.Collectors;
 
@@ -40,6 +33,7 @@ import java.util.stream.Collectors;
  * @date 2021-10-09
  */
 @Service
+@DS("slave")
 public class CourseSubjectServiceImpl extends ServiceImpl<CourseSubjectMapper, CourseSubject> implements ICourseSubjectService {
 
     @Autowired

+ 7 - 8
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/MajorProjectServiceImpl.java

@@ -1,24 +1,22 @@
 package com.zhongzheng.modules.course.service.impl;
 
 import cn.hutool.core.bean.BeanUtil;
-import cn.hutool.core.util.StrUtil;
-import com.zhongzheng.common.utils.DateUtils;
-import com.zhongzheng.modules.course.domain.MajorCategory;
-import org.springframework.stereotype.Service;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.baomidou.dynamic.datasource.annotation.DS;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.github.pagehelper.Page;
+import com.zhongzheng.common.utils.DateUtils;
 import com.zhongzheng.modules.course.bo.MajorProjectAddBo;
-import com.zhongzheng.modules.course.bo.MajorProjectQueryBo;
 import com.zhongzheng.modules.course.bo.MajorProjectEditBo;
+import com.zhongzheng.modules.course.bo.MajorProjectQueryBo;
 import com.zhongzheng.modules.course.domain.MajorProject;
 import com.zhongzheng.modules.course.mapper.MajorProjectMapper;
-import com.zhongzheng.modules.course.vo.MajorProjectVo;
 import com.zhongzheng.modules.course.service.IMajorProjectService;
+import com.zhongzheng.modules.course.vo.MajorProjectVo;
+import org.springframework.stereotype.Service;
 
 import java.util.Collection;
-import java.util.Collections;
 import java.util.List;
 import java.util.stream.Collectors;
 
@@ -29,6 +27,7 @@ import java.util.stream.Collectors;
  * @date 2021-10-09
  */
 @Service
+@DS("slave")
 public class MajorProjectServiceImpl extends ServiceImpl<MajorProjectMapper, MajorProject> implements IMajorProjectService {
 
     @Override

+ 12 - 14
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/MajorServiceImpl.java

@@ -1,31 +1,28 @@
 package com.zhongzheng.modules.course.service.impl;
 
 import cn.hutool.core.bean.BeanUtil;
-import cn.hutool.core.util.StrUtil;
-import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
+import com.baomidou.dynamic.datasource.annotation.DS;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.github.pagehelper.Page;
 import com.zhongzheng.common.utils.DateUtils;
 import com.zhongzheng.common.utils.ServletUtils;
 import com.zhongzheng.modules.course.bo.*;
-import com.zhongzheng.modules.course.domain.CourseEducationType;
+import com.zhongzheng.modules.course.domain.Major;
 import com.zhongzheng.modules.course.domain.MajorProject;
+import com.zhongzheng.modules.course.mapper.MajorMapper;
 import com.zhongzheng.modules.course.service.IMajorLabelService;
 import com.zhongzheng.modules.course.service.IMajorProjectService;
-import com.zhongzheng.modules.course.vo.*;
-import com.zhongzheng.modules.user.bo.SchoolProjectAddBo;
-import com.zhongzheng.modules.user.domain.SchoolProject;
+import com.zhongzheng.modules.course.service.IMajorService;
+import com.zhongzheng.modules.course.vo.CourseProjectTypeVo;
+import com.zhongzheng.modules.course.vo.MajorLabelVo;
+import com.zhongzheng.modules.course.vo.MajorVo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import com.github.pagehelper.Page;
-import com.zhongzheng.modules.course.domain.Major;
-import com.zhongzheng.modules.course.mapper.MajorMapper;
-import com.zhongzheng.modules.course.service.IMajorService;
 
 import java.util.ArrayList;
 import java.util.Collection;
-import java.util.Collections;
 import java.util.List;
 import java.util.stream.Collectors;
 
@@ -36,6 +33,7 @@ import java.util.stream.Collectors;
  * @date 2021-10-09
  */
 @Service
+@DS("slave")
 public class MajorServiceImpl extends ServiceImpl<MajorMapper, Major> implements IMajorService {
 
     @Autowired

+ 9 - 10
zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/service/impl/ExamPaperServiceImpl.java

@@ -3,26 +3,24 @@ package com.zhongzheng.modules.exam.service.impl;
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.lang.Validator;
 import cn.hutool.core.util.StrUtil;
-import com.zhongzheng.common.exception.CustomException;
-import com.zhongzheng.common.utils.DateUtils;
-import com.zhongzheng.common.utils.ServletUtils;
-import com.zhongzheng.modules.course.domain.CourseSection;
-import com.zhongzheng.modules.pay.domain.PayAisle;
-import org.springframework.stereotype.Service;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.baomidou.dynamic.datasource.annotation.DS;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.github.pagehelper.Page;
+import com.zhongzheng.common.exception.CustomException;
+import com.zhongzheng.common.utils.DateUtils;
+import com.zhongzheng.common.utils.ServletUtils;
 import com.zhongzheng.modules.exam.bo.ExamPaperAddBo;
-import com.zhongzheng.modules.exam.bo.ExamPaperQueryBo;
 import com.zhongzheng.modules.exam.bo.ExamPaperEditBo;
+import com.zhongzheng.modules.exam.bo.ExamPaperQueryBo;
 import com.zhongzheng.modules.exam.domain.ExamPaper;
 import com.zhongzheng.modules.exam.mapper.ExamPaperMapper;
-import com.zhongzheng.modules.exam.vo.ExamPaperVo;
 import com.zhongzheng.modules.exam.service.IExamPaperService;
+import com.zhongzheng.modules.exam.vo.ExamPaperVo;
+import org.springframework.stereotype.Service;
 
 import java.util.Collection;
-import java.util.Collections;
 import java.util.List;
 import java.util.stream.Collectors;
 
@@ -33,6 +31,7 @@ import java.util.stream.Collectors;
  * @date 2021-10-18
  */
 @Service
+@DS("slave")
 public class ExamPaperServiceImpl extends ServiceImpl<ExamPaperMapper, ExamPaper> implements IExamPaperService {
 
     @Override

+ 1 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/IGoodsService.java

@@ -120,4 +120,5 @@ public interface IGoodsService extends IService<Goods> {
 
     boolean updateGoodsRepair(UpdateGoodsRepairBo bo);
 
+
 }

+ 6 - 7
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/impl/GoodsAttachedServiceImpl.java

@@ -1,28 +1,26 @@
 package com.zhongzheng.modules.goods.service.impl;
 
 import cn.hutool.core.bean.BeanUtil;
-import cn.hutool.core.util.StrUtil;
+import com.baomidou.dynamic.datasource.annotation.DS;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.github.pagehelper.Page;
 import com.zhongzheng.common.utils.DateUtils;
 import com.zhongzheng.modules.goods.bo.GoodsAttachedAddBo;
 import com.zhongzheng.modules.goods.bo.GoodsAttachedEditBo;
 import com.zhongzheng.modules.goods.bo.GoodsAttachedQueryBo;
 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;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import com.github.pagehelper.Page;
 
 import java.util.Collection;
-import java.util.Collections;
 import java.util.List;
 import java.util.stream.Collectors;
 
@@ -33,6 +31,7 @@ import java.util.stream.Collectors;
  * @date 2021-10-28
  */
 @Service
+@DS("slave")
 public class GoodsAttachedServiceImpl extends ServiceImpl<GoodsAttachedMapper, GoodsAttached> implements IGoodsAttachedService {
 
 

+ 8 - 9
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/impl/GoodsCourseServiceImpl.java

@@ -1,27 +1,25 @@
 package com.zhongzheng.modules.goods.service.impl;
 
 import cn.hutool.core.bean.BeanUtil;
-import cn.hutool.core.util.StrUtil;
-import com.zhongzheng.common.utils.DateUtils;
+import com.baomidou.dynamic.datasource.annotation.DS;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.github.pagehelper.Page;
 import com.zhongzheng.modules.course.vo.CourseVo;
 import com.zhongzheng.modules.goods.bo.GoodsCourseAddBo;
 import com.zhongzheng.modules.goods.bo.GoodsCourseEditBo;
 import com.zhongzheng.modules.goods.bo.GoodsCourseQueryBo;
 import com.zhongzheng.modules.goods.domain.GoodsCourse;
 import com.zhongzheng.modules.goods.mapper.GoodsCourseMapper;
-import com.zhongzheng.modules.goods.mapper.GoodsMapper;
 import com.zhongzheng.modules.goods.service.IGoodsCourseService;
 import com.zhongzheng.modules.goods.vo.GoodsCourseMoreVo;
 import com.zhongzheng.modules.goods.vo.GoodsCourseVo;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import com.github.pagehelper.Page;
+import org.springframework.transaction.annotation.Propagation;
+import org.springframework.transaction.annotation.Transactional;
 
 import java.util.Collection;
-import java.util.Collections;
 import java.util.List;
 import java.util.stream.Collectors;
 
@@ -32,6 +30,7 @@ import java.util.stream.Collectors;
  * @date 2021-10-12
  */
 @Service
+@DS("slave")
 public class GoodsCourseServiceImpl extends ServiceImpl<GoodsCourseMapper, GoodsCourse> implements IGoodsCourseService {
 
 

+ 4 - 7
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/impl/GoodsCourseTeacherServiceImpl.java

@@ -2,11 +2,12 @@ package com.zhongzheng.modules.goods.service.impl;
 
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.lang.Validator;
-import cn.hutool.core.util.StrUtil;
+import com.baomidou.dynamic.datasource.annotation.DS;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.github.pagehelper.Page;
 import com.zhongzheng.common.exception.CustomException;
 import com.zhongzheng.common.utils.DateUtils;
-import com.zhongzheng.modules.course.domain.CourseSectionWatchPer;
 import com.zhongzheng.modules.goods.bo.GoodsCourseTeacherAddBo;
 import com.zhongzheng.modules.goods.bo.GoodsCourseTeacherEditBo;
 import com.zhongzheng.modules.goods.bo.GoodsCourseTeacherItemBo;
@@ -20,14 +21,9 @@ import com.zhongzheng.modules.goods.vo.GoodsCourseTeacherVo;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import com.github.pagehelper.Page;
 
 import java.util.ArrayList;
 import java.util.Collection;
-import java.util.Collections;
 import java.util.List;
 import java.util.stream.Collectors;
 
@@ -38,6 +34,7 @@ import java.util.stream.Collectors;
  * @date 2022-09-14
  */
 @Service
+@DS("slave")
 public class GoodsCourseTeacherServiceImpl extends ServiceImpl<GoodsCourseTeacherMapper, GoodsCourseTeacher> implements IGoodsCourseTeacherService {
 
     @Autowired

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

@@ -8,9 +8,14 @@ import cn.hutool.core.util.StrUtil;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
+import com.baomidou.dynamic.datasource.annotation.DS;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.github.pagehelper.Page;
 import com.zhongzheng.common.annotation.DataScope;
 import com.zhongzheng.common.core.redis.RedisCache;
 import com.zhongzheng.common.exception.CustomException;
@@ -79,10 +84,6 @@ import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import com.github.pagehelper.Page;
 import org.springframework.transaction.annotation.Transactional;
 
 import java.io.IOException;
@@ -102,6 +103,7 @@ import static java.math.RoundingMode.HALF_UP;
  * @date 2021-10-12
  */
 @Service
+@DS("slave")
 public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements IGoodsService {
 
 
@@ -4150,6 +4152,7 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
         return true;
     }
 
+
     private Long getNewId(Long oldId, Integer type){
         if (ObjectUtils.isNull(oldId) || oldId <= 0L){
             return null;

+ 6 - 5
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/impl/GoodsSpecAttributeRelationServiceImpl.java

@@ -2,7 +2,12 @@ package com.zhongzheng.modules.goods.service.impl;
 
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.util.StrUtil;
+import com.baomidou.dynamic.datasource.annotation.DS;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.github.pagehelper.Page;
 import com.zhongzheng.common.exception.CustomException;
 import com.zhongzheng.common.utils.DateUtils;
 import com.zhongzheng.modules.goods.bo.GoodsSpecAttributeRelationAddBo;
@@ -13,13 +18,8 @@ import com.zhongzheng.modules.goods.mapper.GoodsSpecAttributeRelationMapper;
 import com.zhongzheng.modules.goods.service.IGoodsSpecAttributeRelationService;
 import com.zhongzheng.modules.goods.vo.GoodsSpecAttributeRelationVo;
 import org.springframework.stereotype.Service;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import com.github.pagehelper.Page;
 
 import java.util.Collection;
-import java.util.Collections;
 import java.util.List;
 import java.util.stream.Collectors;
 
@@ -30,6 +30,7 @@ import java.util.stream.Collectors;
  * @date 2022-09-29
  */
 @Service
+@DS("slave")
 public class GoodsSpecAttributeRelationServiceImpl extends ServiceImpl<GoodsSpecAttributeRelationMapper, GoodsSpecAttributeRelation> implements IGoodsSpecAttributeRelationService {
 
     @Override

+ 6 - 5
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/impl/GoodsSpecAttributeServiceImpl.java

@@ -2,6 +2,11 @@ package com.zhongzheng.modules.goods.service.impl;
 
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.util.StrUtil;
+import com.baomidou.dynamic.datasource.annotation.DS;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.github.pagehelper.Page;
 import com.zhongzheng.common.utils.DateUtils;
 import com.zhongzheng.modules.goods.bo.GoodsSpecAttributeAddBo;
 import com.zhongzheng.modules.goods.bo.GoodsSpecAttributeEditBo;
@@ -11,13 +16,8 @@ import com.zhongzheng.modules.goods.mapper.GoodsSpecAttributeMapper;
 import com.zhongzheng.modules.goods.service.IGoodsSpecAttributeService;
 import com.zhongzheng.modules.goods.vo.GoodsSpecAttributeVo;
 import org.springframework.stereotype.Service;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import com.github.pagehelper.Page;
 
 import java.util.Collection;
-import java.util.Collections;
 import java.util.List;
 import java.util.stream.Collectors;
 
@@ -28,6 +28,7 @@ import java.util.stream.Collectors;
  * @date 2022-09-29
  */
 @Service
+@DS("slave")
 public class GoodsSpecAttributeServiceImpl extends ServiceImpl<GoodsSpecAttributeMapper, GoodsSpecAttribute> implements IGoodsSpecAttributeService {
 
     @Override

+ 6 - 10
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/impl/GoodsSpecServiceImpl.java

@@ -2,28 +2,23 @@ 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.dynamic.datasource.annotation.DS;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.github.pagehelper.Page;
 import com.zhongzheng.common.utils.DateUtils;
 import com.zhongzheng.modules.goods.bo.GoodsSpecAddBo;
-import com.zhongzheng.modules.goods.bo.GoodsSpecAttributeAddBo;
 import com.zhongzheng.modules.goods.bo.GoodsSpecEditBo;
 import com.zhongzheng.modules.goods.bo.GoodsSpecQueryBo;
 import com.zhongzheng.modules.goods.domain.GoodsSpec;
-import com.zhongzheng.modules.goods.domain.GoodsSpecAttribute;
 import com.zhongzheng.modules.goods.mapper.GoodsSpecMapper;
 import com.zhongzheng.modules.goods.service.IGoodsSpecService;
-import com.zhongzheng.modules.goods.vo.GoodsSpecAttrDetailVo;
 import com.zhongzheng.modules.goods.vo.GoodsSpecVo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import com.github.pagehelper.Page;
 
-import java.util.ArrayList;
 import java.util.Collection;
-import java.util.Collections;
 import java.util.List;
 import java.util.stream.Collectors;
 
@@ -34,6 +29,7 @@ import java.util.stream.Collectors;
  * @date 2022-09-29
  */
 @Service
+@DS("slave")
 public class GoodsSpecServiceImpl extends ServiceImpl<GoodsSpecMapper, GoodsSpec> implements IGoodsSpecService {
 
     @Autowired

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

@@ -2,6 +2,7 @@ package com.zhongzheng.modules.goods.service.impl;
 
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.util.StrUtil;
+import com.baomidou.dynamic.datasource.annotation.DS;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
@@ -36,6 +37,7 @@ import java.util.stream.Collectors;
  * @date 2022-09-29
  */
 @Service
+@DS("slave")
 public class GoodsSpecTemplateServiceImpl extends ServiceImpl<GoodsSpecTemplateMapper, GoodsSpecTemplate> implements IGoodsSpecTemplateService {
 
     @Autowired

+ 8 - 10
zhongzheng-system/src/main/java/com/zhongzheng/modules/pay/service/impl/PayServeServiceImpl.java

@@ -2,27 +2,24 @@ package com.zhongzheng.modules.pay.service.impl;
 
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.util.StrUtil;
-import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
-import com.zhongzheng.common.utils.DateUtils;
-import com.zhongzheng.modules.pay.domain.PayAisle;
-import com.zhongzheng.modules.pay.domain.PayNature;
-import com.zhongzheng.modules.pay.domain.PayPayee;
-import org.springframework.stereotype.Service;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.baomidou.dynamic.datasource.annotation.DS;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.github.pagehelper.Page;
+import com.zhongzheng.common.utils.DateUtils;
 import com.zhongzheng.modules.pay.bo.PayServeAddBo;
-import com.zhongzheng.modules.pay.bo.PayServeQueryBo;
 import com.zhongzheng.modules.pay.bo.PayServeEditBo;
+import com.zhongzheng.modules.pay.bo.PayServeQueryBo;
 import com.zhongzheng.modules.pay.domain.PayServe;
 import com.zhongzheng.modules.pay.mapper.PayServeMapper;
-import com.zhongzheng.modules.pay.vo.PayServeVo;
 import com.zhongzheng.modules.pay.service.IPayServeService;
+import com.zhongzheng.modules.pay.vo.PayServeVo;
+import org.springframework.stereotype.Service;
 
 import java.util.ArrayList;
 import java.util.Collection;
-import java.util.Collections;
 import java.util.List;
 import java.util.stream.Collectors;
 
@@ -33,6 +30,7 @@ import java.util.stream.Collectors;
  * @date 2021-10-12
  */
 @Service
+@DS("slave")
 public class PayServeServiceImpl extends ServiceImpl<PayServeMapper, PayServe> implements IPayServeService {
 
     @Override

+ 8 - 8
zhongzheng-system/src/main/java/com/zhongzheng/modules/pay/service/impl/PaySupplyServiceImpl.java

@@ -2,25 +2,24 @@ package com.zhongzheng.modules.pay.service.impl;
 
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.util.StrUtil;
-import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
-import com.zhongzheng.common.utils.DateUtils;
-import com.zhongzheng.modules.pay.domain.PayNature;
-import org.springframework.stereotype.Service;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.baomidou.dynamic.datasource.annotation.DS;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.github.pagehelper.Page;
+import com.zhongzheng.common.utils.DateUtils;
 import com.zhongzheng.modules.pay.bo.PaySupplyAddBo;
-import com.zhongzheng.modules.pay.bo.PaySupplyQueryBo;
 import com.zhongzheng.modules.pay.bo.PaySupplyEditBo;
+import com.zhongzheng.modules.pay.bo.PaySupplyQueryBo;
 import com.zhongzheng.modules.pay.domain.PaySupply;
 import com.zhongzheng.modules.pay.mapper.PaySupplyMapper;
-import com.zhongzheng.modules.pay.vo.PaySupplyVo;
 import com.zhongzheng.modules.pay.service.IPaySupplyService;
+import com.zhongzheng.modules.pay.vo.PaySupplyVo;
+import org.springframework.stereotype.Service;
 
 import java.util.ArrayList;
 import java.util.Collection;
-import java.util.Collections;
 import java.util.List;
 import java.util.stream.Collectors;
 
@@ -31,6 +30,7 @@ import java.util.stream.Collectors;
  * @date 2021-10-12
  */
 @Service
+@DS("slave")
 public class PaySupplyServiceImpl extends ServiceImpl<PaySupplyMapper, PaySupply> implements IPaySupplyService {
 
     @Override

+ 7 - 6
zhongzheng-system/src/main/java/com/zhongzheng/modules/polyv/service/impl/PolyvCataServiceImpl.java

@@ -2,22 +2,22 @@ package com.zhongzheng.modules.polyv.service.impl;
 
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.util.StrUtil;
-import com.zhongzheng.common.utils.DateUtils;
-import org.springframework.stereotype.Service;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.baomidou.dynamic.datasource.annotation.DS;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.github.pagehelper.Page;
+import com.zhongzheng.common.utils.DateUtils;
 import com.zhongzheng.modules.polyv.bo.PolyvCataAddBo;
-import com.zhongzheng.modules.polyv.bo.PolyvCataQueryBo;
 import com.zhongzheng.modules.polyv.bo.PolyvCataEditBo;
+import com.zhongzheng.modules.polyv.bo.PolyvCataQueryBo;
 import com.zhongzheng.modules.polyv.domain.PolyvCata;
 import com.zhongzheng.modules.polyv.mapper.PolyvCataMapper;
-import com.zhongzheng.modules.polyv.vo.PolyvCataVo;
 import com.zhongzheng.modules.polyv.service.IPolyvCataService;
+import com.zhongzheng.modules.polyv.vo.PolyvCataVo;
+import org.springframework.stereotype.Service;
 
 import java.util.Collection;
-import java.util.Collections;
 import java.util.List;
 import java.util.stream.Collectors;
 
@@ -28,6 +28,7 @@ import java.util.stream.Collectors;
  * @date 2022-01-11
  */
 @Service
+@DS("slave")
 public class PolyvCataServiceImpl extends ServiceImpl<PolyvCataMapper, PolyvCata> implements IPolyvCataService {
 
     @Override

+ 13 - 14
zhongzheng-system/src/main/java/com/zhongzheng/modules/polyv/service/impl/PolyvVideoServiceImpl.java

@@ -7,9 +7,13 @@ import cn.hutool.core.util.StrUtil;
 import cn.hutool.http.HttpStatus;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
+import com.baomidou.dynamic.datasource.annotation.DS;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
-import com.baomidou.mybatisplus.core.toolkit.StringUtils;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.fasterxml.jackson.databind.ObjectMapper;
+import com.github.pagehelper.Page;
 import com.zhongzheng.common.core.page.TableDataInfo;
 import com.zhongzheng.common.core.redis.RedisCache;
 import com.zhongzheng.common.utils.DateUtils;
@@ -22,27 +26,21 @@ import com.zhongzheng.modules.course.domain.CourseStreaming;
 import com.zhongzheng.modules.course.service.ICourseStreamingBusinessService;
 import com.zhongzheng.modules.course.service.ICourseStreamingService;
 import com.zhongzheng.modules.course.vo.CourseStreamingVo;
-import com.zhongzheng.modules.inform.bo.InformClassifyEditBo;
-import com.zhongzheng.modules.inform.domain.InformClassify;
 import com.zhongzheng.modules.polyv.bo.PolyvCataQueryBo;
+import com.zhongzheng.modules.polyv.bo.PolyvVideoAddBo;
+import com.zhongzheng.modules.polyv.bo.PolyvVideoEditBo;
+import com.zhongzheng.modules.polyv.bo.PolyvVideoQueryBo;
 import com.zhongzheng.modules.polyv.domain.PolyvCata;
 import com.zhongzheng.modules.polyv.domain.PolyvVideDo;
+import com.zhongzheng.modules.polyv.domain.PolyvVideo;
+import com.zhongzheng.modules.polyv.domain.TokenResponse;
+import com.zhongzheng.modules.polyv.mapper.PolyvVideoMapper;
 import com.zhongzheng.modules.polyv.service.IPolyvCataService;
+import com.zhongzheng.modules.polyv.service.IPolyvVideoService;
 import com.zhongzheng.modules.polyv.vo.*;
-import com.zhongzheng.modules.polyv.domain.TokenResponse;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import com.github.pagehelper.Page;
-import com.zhongzheng.modules.polyv.bo.PolyvVideoAddBo;
-import com.zhongzheng.modules.polyv.bo.PolyvVideoQueryBo;
-import com.zhongzheng.modules.polyv.bo.PolyvVideoEditBo;
-import com.zhongzheng.modules.polyv.domain.PolyvVideo;
-import com.zhongzheng.modules.polyv.mapper.PolyvVideoMapper;
-import com.zhongzheng.modules.polyv.service.IPolyvVideoService;
 import org.springframework.transaction.annotation.Transactional;
 
 import java.io.IOException;
@@ -59,6 +57,7 @@ import static com.squareup.okhttp.internal.Util.md5Hex;
  * @date 2021-06-11
  */
 @Service
+@DS("slave")
 public class PolyvVideoServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVideo> implements IPolyvVideoService {
 
     @Value("${poliv.token.userid}")

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

@@ -5,12 +5,9 @@ import cn.hutool.core.util.StrUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.zhongzheng.common.core.domain.entity.SysDictData;
-import com.zhongzheng.common.core.domain.entity.SysDictType;
-import com.zhongzheng.common.core.domain.entity.TopSysUser;
 import com.zhongzheng.common.exception.CustomException;
 import com.zhongzheng.common.utils.DateUtils;
 import com.zhongzheng.common.utils.DictUtils;
-import com.zhongzheng.modules.course.domain.MajorCategory;
 import com.zhongzheng.modules.system.mapper.SysDictDataMapper;
 import com.zhongzheng.modules.system.service.ISysDictDataService;
 import org.springframework.stereotype.Service;

+ 65 - 62
zhongzheng-system/src/main/java/com/zhongzheng/modules/top/goods/bo/TopGoodsQueryBo.java

@@ -1,16 +1,13 @@
 package com.zhongzheng.modules.top.goods.bo;
 
+import com.zhongzheng.common.core.domain.BaseEntity;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
-import java.util.Date;
-import java.util.Map;
-import java.util.HashMap;
-
 import java.math.BigDecimal;
-import com.zhongzheng.common.core.domain.BaseEntity;
+import java.util.List;
 
 /**
  * 商品分页查询对象 top_goods
@@ -40,18 +37,28 @@ public class TopGoodsQueryBo extends BaseEntity {
 	/** 年份 */
 	@ApiModelProperty("年份")
 	private Long year;
-	/** 供应方id */
-	@ApiModelProperty("供应方id")
+	/** 供应方(服务) */
+	@ApiModelProperty("供应方(服务)")
 	private Long supplyId;
-	/** 商品类型 1视频2题库 3补考 4前培 5虚拟赠送题库 6直播 */
-	@ApiModelProperty("商品类型 1视频2题库 3补考 4前培 5虚拟赠送题库 6直播")
+	/** 商品类型 1视频2题库 3补考 4前培 */
+	@ApiModelProperty("商品类型 1视频2题库 3补考 4前培 ")
 	private Integer goodsType;
+
+	/** 商品类型 1视频2题库 3补考 4前培 */
+	@ApiModelProperty("商品类型集合 1视频2题库 3补考 4前培 ")
+	private List<Integer> goodsTypes;
 	/** 教育类型id */
 	@ApiModelProperty("教育类型id")
 	private Long educationTypeId;
+	@ApiModelProperty("项目类型id")
+	private Long projectId;
 	/** 业务层次id */
 	@ApiModelProperty("业务层次id")
 	private Long businessId;
+	@ApiModelProperty("业务层次id")
+	private List<Long> businessIds;
+	@ApiModelProperty("商品id")
+	private List<Long> goodsIds;
 	/** 所属院校 */
 	@ApiModelProperty("所属院校")
 	private Long schoolId;
@@ -61,6 +68,8 @@ public class TopGoodsQueryBo extends BaseEntity {
 	/** 商品名称 */
 	@ApiModelProperty("商品名称")
 	private String goodsName;
+	@ApiModelProperty("商品编码")
+	private String code;
 	/** 标准价格 */
 	@ApiModelProperty("标准价格")
 	private BigDecimal standPrice;
@@ -69,7 +78,7 @@ public class TopGoodsQueryBo extends BaseEntity {
 	private BigDecimal lowestPrice;
 	/** 状态 1有效 0无效 */
 	@ApiModelProperty("状态 1有效 0无效")
-	private Integer status;
+	private List<Integer> status;
 	/** 有效期开始 */
 	@ApiModelProperty("有效期开始")
 	private Long validityStartTime;
@@ -109,30 +118,17 @@ public class TopGoodsQueryBo extends BaseEntity {
 	/** 学时 */
 	@ApiModelProperty("学时")
 	private BigDecimal classHours;
+
+	/** 商品ID */
+	@ApiModelProperty("商品ID")
+	private Long goodsId;
 	/** 标准价格详情json */
 	@ApiModelProperty("标准价格详情json")
 	private String standPriceJson;
-	/** 编码 */
-	@ApiModelProperty("编码")
-	private String code;
-	/** 项目ID */
-	@ApiModelProperty("项目ID")
-	private Long projectId;
-	/** 试听设置 */
-	@ApiModelProperty("试听设置")
-	private String goodsAuditionConfig;
-	/** 拍照设置 */
-	@ApiModelProperty("拍照设置")
-	private String goodsPhotographConfig;
-	/** 播放设置 */
-	@ApiModelProperty("播放设置")
-	private String goodsPlayConfig;
-	/** 试卷试做设置 */
-	@ApiModelProperty("试卷试做设置")
-	private String goodsExamConfig;
-	/** 讲义id */
-	@ApiModelProperty("讲义id")
-	private Long handoutsId;
+
+	/** 学时 */
+	@ApiModelProperty("学时")
+	private Long period;
 	/** 补考或前培开始时间 */
 	@ApiModelProperty("补考或前培开始时间")
 	private Long makeStartTime;
@@ -142,33 +138,48 @@ public class TopGoodsQueryBo extends BaseEntity {
 	/** 学习次数 */
 	@ApiModelProperty("学习次数")
 	private Long studyCount;
-	/** 试卷拍照设置 */
-	@ApiModelProperty("试卷拍照设置")
-	private String goodsPhotoExamConfig;
-	/** 前培和补考商品关联 */
-	@ApiModelProperty("前培和补考商品关联")
+
+	@ApiModelProperty("科目ID")
+	private Long subjectId;
+
+	@ApiModelProperty("用户ID")
+	private Long userId;
+
+	@ApiModelProperty("被补考的商品")
 	private Long makeGoodsId;
-	/** 服务期类型 1年 2月 3日 4区间 */
-	@ApiModelProperty("服务期类型 1年 2月 3日 4区间")
-	private Integer serviceTimeType;
-	/** 服务期数值 */
-	@ApiModelProperty("服务期数值")
-	private Long serviceTimeNum;
-	/** 每天最大节学习数量 */
-	@ApiModelProperty("每天最大节学习数量")
-	private Long sectionMaxNum;
+
+	@ApiModelProperty("获取节数量 1")
+	private Long sectionNum;
+
+	@ApiModelProperty("搜索kEY")
+	private String searchKey;
+
+	@ApiModelProperty("获取有课程的视频商品 1获取 ")
+	private Long haveCourse;
+
+	@ApiModelProperty("排序模式 1默认 2价格从低到高 3价格从高到低")
+	private Integer sortType;
+
 	/** 考试次数 */
 	@ApiModelProperty("考试次数")
 	private Long examNumber;
 	/** 前培次数 */
 	@ApiModelProperty("前培次数")
 	private Long doNumber;
+	@ApiModelProperty("订单商品ID")
+	private Long orderGoodsId;
 	/** 讲师ID */
 	@ApiModelProperty("讲师ID")
 	private Long teacherId;
+	/** 是否返回订单数量 */
+	@ApiModelProperty("是否返回订单数量 1带 0不带")
+	private Long getOrderNum;
 	/** 科目ID,拼接 */
 	@ApiModelProperty("科目ID,拼接")
 	private String subjectIds;
+	/** 科目ID,拼接 */
+	@ApiModelProperty("科目ID集合")
+	private List<Long> subjectIdList;
 	/** 证书类型ID */
 	@ApiModelProperty("证书类型ID")
 	private Long certificateTypeId;
@@ -178,24 +189,16 @@ public class TopGoodsQueryBo extends BaseEntity {
 	/** 证书模板ID */
 	@ApiModelProperty("证书模板ID")
 	private Long certificateTpId;
-	/** 商品划线价 */
-	@ApiModelProperty("商品划线价")
-	private BigDecimal linePrice;
-	/** 默认规格模板ID */
-	@ApiModelProperty("默认规格模板ID")
-	private Long specTemplateId;
-	/** 是否显示:0否 1是 */
-	@ApiModelProperty("是否显示:0否 1是")
+	@ApiModelProperty("是否返回商品购买用户数量 1带 0不带")
+	private Long getUserNum;
+	@ApiModelProperty("获取章数量 1")
+	private Long chapterNum;
+	/** 商品服务期校验字段 */
+	@ApiModelProperty("商品服务期校验字段:1,未过期 2,已过期")
+	private Integer serviceCheck;
+	/** 商品服务期校验字段 */
+	@ApiModelProperty("显示状态:1,显示 0,不显示")
 	private Integer showStatus;
-	/** 显示排序字段 */
-	@ApiModelProperty("显示排序字段")
-	private Long showSort;
-	/** 外部跳转链接 */
-	@ApiModelProperty("外部跳转链接")
-	private String externalLink;
-	/** 是否外链商品:0否 1是 */
-	@ApiModelProperty("是否外链商品:0否 1是")
-	private Integer externalLinkStatus;
 	/** 是否提交官方审核 0没有 1有 */
 	@ApiModelProperty("是否提交官方审核 0没有 1有")
 	private Integer commitPeriodStatus;

+ 7 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/top/goods/mapper/TopGoodsMapper.java

@@ -1,8 +1,12 @@
 package com.zhongzheng.modules.top.goods.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.zhongzheng.modules.goods.vo.TopGoodsVo;
+import com.zhongzheng.modules.top.goods.bo.TopGoodsQueryBo;
 import com.zhongzheng.modules.top.goods.domain.TopGoods;
 
+import java.util.List;
+
 /**
  * 商品Mapper接口
  *
@@ -11,4 +15,7 @@ import com.zhongzheng.modules.top.goods.domain.TopGoods;
  */
 public interface TopGoodsMapper extends BaseMapper<TopGoods> {
 
+    List<TopGoodsVo> selectAllList(TopGoodsQueryBo bo);
+
+    Long getSectionNum(Long goodsId);
 }

+ 5 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/top/goods/mapper/TopQuestionMapper.java

@@ -2,6 +2,10 @@ package com.zhongzheng.modules.top.goods.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.zhongzheng.modules.top.goods.domain.TopQuestion;
+import com.zhongzheng.modules.top.goods.vo.TopBankGoodsExamVo;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 /**
  * 题库题目Mapper接口
@@ -11,4 +15,5 @@ import com.zhongzheng.modules.top.goods.domain.TopQuestion;
  */
 public interface TopQuestionMapper extends BaseMapper<TopQuestion> {
 
+    List<TopBankGoodsExamVo> getBankGoodsExamList(@Param("goodsId") Long goodsId);
 }

+ 3 - 33
zhongzheng-system/src/main/java/com/zhongzheng/modules/top/goods/service/ITopGoodsService.java

@@ -1,11 +1,11 @@
 package com.zhongzheng.modules.top.goods.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.zhongzheng.modules.goods.vo.TopGoodsVo;
 import com.zhongzheng.modules.top.goods.bo.TopGoodsAddBo;
 import com.zhongzheng.modules.top.goods.bo.TopGoodsEditBo;
 import com.zhongzheng.modules.top.goods.bo.TopGoodsQueryBo;
 import com.zhongzheng.modules.top.goods.domain.TopGoods;
-import com.zhongzheng.modules.top.goods.vo.TopGoodsVo;
 
 import java.util.Collection;
 import java.util.List;
@@ -17,40 +17,10 @@ import java.util.List;
  * @date 2023-03-15
  */
 public interface ITopGoodsService extends IService<TopGoods> {
-	/**
-	 * 查询单个
-	 * @return
-	 */
-	TopGoodsVo queryById(Long goodsId);
-
-	/**
-	 * 查询列表
-	 */
-	List<TopGoodsVo> queryList(TopGoodsQueryBo bo);
-
-	/**
-	 * 根据新增业务对象插入商品
-	 * @param bo 商品新增业务对象
-	 * @return
-	 */
-	Boolean insertByAddBo(TopGoodsAddBo bo);
-
-	/**
-	 * 根据编辑业务对象修改商品
-	 * @param bo 商品编辑业务对象
-	 * @return
-	 */
-	Boolean updateByEditBo(TopGoodsEditBo bo);
-
-	/**
-	 * 校验并删除数据
-	 * @param ids 主键集合
-	 * @param isValid 是否校验,true-删除前校验,false-不校验
-	 * @return
-	 */
-	Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
 
     boolean goodsBatchCopyTenant();
 
     boolean goodsBatchCopyDisposeTenant();
+
+	List<TopGoodsVo> selectList(TopGoodsQueryBo bo);
 }

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/top/goods/service/ITopQuestionService.java

@@ -5,6 +5,7 @@ import com.zhongzheng.modules.top.goods.bo.TopQuestionAddBo;
 import com.zhongzheng.modules.top.goods.bo.TopQuestionEditBo;
 import com.zhongzheng.modules.top.goods.bo.TopQuestionQueryBo;
 import com.zhongzheng.modules.top.goods.domain.TopQuestion;
+import com.zhongzheng.modules.top.goods.vo.TopBankGoodsExamVo;
 import com.zhongzheng.modules.top.goods.vo.TopQuestionVo;
 
 import java.util.Collection;
@@ -49,4 +50,6 @@ public interface ITopQuestionService extends IService<TopQuestion> {
 	 * @return
 	 */
 	Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
+
+    List<TopBankGoodsExamVo> getBankGoodsExamList(Long goodsId);
 }

+ 54 - 140
zhongzheng-system/src/main/java/com/zhongzheng/modules/top/goods/service/impl/TopGoodsServiceImpl.java

@@ -1,14 +1,12 @@
 package com.zhongzheng.modules.top.goods.service.impl;
 
 import cn.hutool.core.bean.BeanUtil;
-import cn.hutool.core.util.StrUtil;
+import cn.hutool.core.lang.Validator;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.github.pagehelper.Page;
 import com.zhongzheng.common.exception.CustomException;
 import com.zhongzheng.common.utils.DateUtils;
 import com.zhongzheng.modules.bank.domain.*;
@@ -21,8 +19,7 @@ import com.zhongzheng.modules.exam.domain.ExamPaper;
 import com.zhongzheng.modules.exam.service.IExamPaperService;
 import com.zhongzheng.modules.goods.domain.*;
 import com.zhongzheng.modules.goods.service.*;
-import com.zhongzheng.modules.grade.service.IClassGradeInterfaceService;
-import com.zhongzheng.modules.order.service.IOrderInputTemplateService;
+import com.zhongzheng.modules.goods.vo.TopGoodsVo;
 import com.zhongzheng.modules.pay.domain.PayServe;
 import com.zhongzheng.modules.pay.domain.PaySupply;
 import com.zhongzheng.modules.pay.service.IPayServeService;
@@ -32,14 +29,11 @@ import com.zhongzheng.modules.polyv.domain.PolyvVideo;
 import com.zhongzheng.modules.polyv.service.IPolyvCataService;
 import com.zhongzheng.modules.polyv.service.IPolyvVideoService;
 import com.zhongzheng.modules.system.bo.GoodsCopyEnum;
-import com.zhongzheng.modules.system.service.ISysGoodsCopyRecordService;
-import com.zhongzheng.modules.top.goods.bo.TopGoodsAddBo;
-import com.zhongzheng.modules.top.goods.bo.TopGoodsEditBo;
 import com.zhongzheng.modules.top.goods.bo.TopGoodsQueryBo;
 import com.zhongzheng.modules.top.goods.domain.*;
 import com.zhongzheng.modules.top.goods.mapper.TopGoodsMapper;
 import com.zhongzheng.modules.top.goods.service.*;
-import com.zhongzheng.modules.top.goods.vo.TopGoodsVo;
+import com.zhongzheng.modules.top.goods.vo.TopBankGoodsExamVo;
 import net.polyv.common.v1.util.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -47,7 +41,7 @@ import org.springframework.transaction.annotation.Transactional;
 
 import java.util.ArrayList;
 import java.util.Arrays;
-import java.util.Collection;
+import java.util.Comparator;
 import java.util.List;
 import java.util.stream.Collectors;
 
@@ -69,10 +63,6 @@ public class TopGoodsServiceImpl extends ServiceImpl<TopGoodsMapper, TopGoods> i
     @Autowired
     private ICourseService iCourseService;
     @Autowired
-    private IOrderInputTemplateService iOrderInputTemplateService;
-    @Autowired
-    private IClassGradeInterfaceService iClassGradeInterfaceService;
-    @Autowired
     private ICourseMenuService iCourseMenuService;
     @Autowired
     private ICourseMenuExamService iCourseMenuExamService;
@@ -139,8 +129,6 @@ public class TopGoodsServiceImpl extends ServiceImpl<TopGoodsMapper, TopGoods> i
     @Autowired
     private ICertificateTpService iCertificateTpService;
     @Autowired
-    private ISysGoodsCopyRecordService iSysGoodsCopyRecordService;
-    @Autowired
     private IGoodsCourseTeacherService goodsCourseTeacherService;
     @Autowired
     private ICourseChapterService iCourseChapterService;
@@ -168,9 +156,9 @@ public class TopGoodsServiceImpl extends ServiceImpl<TopGoodsMapper, TopGoods> i
     private IMajorProjectService iMajorProjectService;
     @Autowired
     private IPayServeService iPayServeService;
+
     @Autowired
     private ITopGoodsCopyService iTopGoodsCopyService;
-
     @Autowired
     private ITopGoodsCourseService iTopGoodsCourseService;
     @Autowired
@@ -272,132 +260,12 @@ public class TopGoodsServiceImpl extends ServiceImpl<TopGoodsMapper, TopGoods> i
     @Autowired
     private ITopPayServeService iTopPayServeService;
 
-    @Override
-    public TopGoodsVo queryById(Long goodsId){
-        TopGoods db = this.baseMapper.selectById(goodsId);
-        return BeanUtil.toBean(db, TopGoodsVo.class);
-    }
 
     @Override
-    public List<TopGoodsVo> queryList(TopGoodsQueryBo bo) {
-        LambdaQueryWrapper<TopGoods> lqw = Wrappers.lambdaQuery();
-        lqw.eq(bo.getYear() != null, TopGoods::getYear, bo.getYear());
-        lqw.eq(bo.getSupplyId() != null, TopGoods::getSupplyId, bo.getSupplyId());
-        lqw.eq(bo.getGoodsType() != null, TopGoods::getGoodsType, bo.getGoodsType());
-        lqw.eq(bo.getEducationTypeId() != null, TopGoods::getEducationTypeId, bo.getEducationTypeId());
-        lqw.eq(bo.getBusinessId() != null, TopGoods::getBusinessId, bo.getBusinessId());
-        lqw.eq(bo.getSchoolId() != null, TopGoods::getSchoolId, bo.getSchoolId());
-        lqw.eq(bo.getMajorId() != null, TopGoods::getMajorId, bo.getMajorId());
-        lqw.like(StrUtil.isNotBlank(bo.getGoodsName()), TopGoods::getGoodsName, bo.getGoodsName());
-        lqw.eq(bo.getStandPrice() != null, TopGoods::getStandPrice, bo.getStandPrice());
-        lqw.eq(bo.getLowestPrice() != null, TopGoods::getLowestPrice, bo.getLowestPrice());
-        lqw.eq(bo.getStatus() != null, TopGoods::getStatus, bo.getStatus());
-        lqw.eq(bo.getValidityStartTime() != null, TopGoods::getValidityStartTime, bo.getValidityStartTime());
-        lqw.eq(bo.getValidityEndTime() != null, TopGoods::getValidityEndTime, bo.getValidityEndTime());
-        lqw.eq(bo.getStudyStartTime() != null, TopGoods::getStudyStartTime, bo.getStudyStartTime());
-        lqw.eq(bo.getStudyEndTime() != null, TopGoods::getStudyEndTime, bo.getStudyEndTime());
-        lqw.eq(StrUtil.isNotBlank(bo.getCertificateIds()), TopGoods::getCertificateIds, bo.getCertificateIds());
-        lqw.eq(StrUtil.isNotBlank(bo.getIntroduce()), TopGoods::getIntroduce, bo.getIntroduce());
-        lqw.eq(StrUtil.isNotBlank(bo.getSuitableObject()), TopGoods::getSuitableObject, bo.getSuitableObject());
-        lqw.eq(StrUtil.isNotBlank(bo.getBuyNote()), TopGoods::getBuyNote, bo.getBuyNote());
-        lqw.eq(StrUtil.isNotBlank(bo.getPcDetailHtml()), TopGoods::getPcDetailHtml, bo.getPcDetailHtml());
-        lqw.eq(StrUtil.isNotBlank(bo.getMobileDetailHtml()), TopGoods::getMobileDetailHtml, bo.getMobileDetailHtml());
-        lqw.eq(bo.getGoodsStatus() != null, TopGoods::getGoodsStatus, bo.getGoodsStatus());
-        lqw.eq(StrUtil.isNotBlank(bo.getCoverUrl()), TopGoods::getCoverUrl, bo.getCoverUrl());
-        lqw.eq(bo.getClassHours() != null, TopGoods::getClassHours, bo.getClassHours());
-        lqw.eq(StrUtil.isNotBlank(bo.getStandPriceJson()), TopGoods::getStandPriceJson, bo.getStandPriceJson());
-        lqw.eq(StrUtil.isNotBlank(bo.getCode()), TopGoods::getCode, bo.getCode());
-        lqw.eq(bo.getProjectId() != null, TopGoods::getProjectId, bo.getProjectId());
-        lqw.eq(StrUtil.isNotBlank(bo.getGoodsAuditionConfig()), TopGoods::getGoodsAuditionConfig, bo.getGoodsAuditionConfig());
-        lqw.eq(StrUtil.isNotBlank(bo.getGoodsPhotographConfig()), TopGoods::getGoodsPhotographConfig, bo.getGoodsPhotographConfig());
-        lqw.eq(StrUtil.isNotBlank(bo.getGoodsPlayConfig()), TopGoods::getGoodsPlayConfig, bo.getGoodsPlayConfig());
-        lqw.eq(StrUtil.isNotBlank(bo.getGoodsExamConfig()), TopGoods::getGoodsExamConfig, bo.getGoodsExamConfig());
-        lqw.eq(bo.getHandoutsId() != null, TopGoods::getHandoutsId, bo.getHandoutsId());
-        lqw.eq(bo.getMakeStartTime() != null, TopGoods::getMakeStartTime, bo.getMakeStartTime());
-        lqw.eq(bo.getMakeEndTime() != null, TopGoods::getMakeEndTime, bo.getMakeEndTime());
-        lqw.eq(bo.getStudyCount() != null, TopGoods::getStudyCount, bo.getStudyCount());
-        lqw.eq(StrUtil.isNotBlank(bo.getGoodsPhotoExamConfig()), TopGoods::getGoodsPhotoExamConfig, bo.getGoodsPhotoExamConfig());
-        lqw.eq(bo.getMakeGoodsId() != null, TopGoods::getMakeGoodsId, bo.getMakeGoodsId());
-        lqw.eq(bo.getServiceTimeType() != null, TopGoods::getServiceTimeType, bo.getServiceTimeType());
-        lqw.eq(bo.getServiceTimeNum() != null, TopGoods::getServiceTimeNum, bo.getServiceTimeNum());
-        lqw.eq(bo.getSectionMaxNum() != null, TopGoods::getSectionMaxNum, bo.getSectionMaxNum());
-        lqw.eq(bo.getExamNumber() != null, TopGoods::getExamNumber, bo.getExamNumber());
-        lqw.eq(bo.getDoNumber() != null, TopGoods::getDoNumber, bo.getDoNumber());
-        lqw.eq(bo.getTeacherId() != null, TopGoods::getTeacherId, bo.getTeacherId());
-        lqw.eq(StrUtil.isNotBlank(bo.getSubjectIds()), TopGoods::getSubjectIds, bo.getSubjectIds());
-        lqw.eq(bo.getCertificateTypeId() != null, TopGoods::getCertificateTypeId, bo.getCertificateTypeId());
-        lqw.eq(bo.getCertificateId() != null, TopGoods::getCertificateId, bo.getCertificateId());
-        lqw.eq(bo.getCertificateTpId() != null, TopGoods::getCertificateTpId, bo.getCertificateTpId());
-        lqw.eq(bo.getLinePrice() != null, TopGoods::getLinePrice, bo.getLinePrice());
-        lqw.eq(bo.getSpecTemplateId() != null, TopGoods::getSpecTemplateId, bo.getSpecTemplateId());
-        lqw.eq(bo.getShowStatus() != null, TopGoods::getShowStatus, bo.getShowStatus());
-        lqw.eq(bo.getShowSort() != null, TopGoods::getShowSort, bo.getShowSort());
-        lqw.eq(StrUtil.isNotBlank(bo.getExternalLink()), TopGoods::getExternalLink, bo.getExternalLink());
-        lqw.eq(bo.getExternalLinkStatus() != null, TopGoods::getExternalLinkStatus, bo.getExternalLinkStatus());
-        lqw.eq(bo.getCommitPeriodStatus() != null, TopGoods::getCommitPeriodStatus, bo.getCommitPeriodStatus());
-        lqw.eq(StrUtil.isNotBlank(bo.getCommitPeriodRemark()), TopGoods::getCommitPeriodRemark, bo.getCommitPeriodRemark());
-        return entity2Vo(this.list(lqw));
-    }
-
-    /**
-    * 实体类转化成视图对象
-    *
-    * @param collection 实体类集合
-    * @return
-    */
-    private List<TopGoodsVo> entity2Vo(Collection<TopGoods> collection) {
-        List<TopGoodsVo> voList = collection.stream()
-                .map(any -> BeanUtil.toBean(any, TopGoodsVo.class))
-                .collect(Collectors.toList());
-        if (collection instanceof Page) {
-            Page<TopGoods> page = (Page<TopGoods>)collection;
-            Page<TopGoodsVo> pageVo = new Page<>();
-            BeanUtil.copyProperties(page,pageVo);
-            pageVo.addAll(voList);
-            voList = pageVo;
-        }
-        return voList;
-    }
-
-    @Override
-    public Boolean insertByAddBo(TopGoodsAddBo bo) {
-        TopGoods add = BeanUtil.toBean(bo, TopGoods.class);
-        validEntityBeforeSave(add);
-        add.setCreateTime(DateUtils.getNowTime());
-        add.setUpdateTime(DateUtils.getNowTime());
-        return this.save(add);
-    }
-
-    @Override
-    public Boolean updateByEditBo(TopGoodsEditBo bo) {
-        TopGoods update = BeanUtil.toBean(bo, TopGoods.class);
-        validEntityBeforeSave(update);
-        update.setUpdateTime(DateUtils.getNowTime());
-        return this.updateById(update);
-    }
-
-    /**
-     * 保存前的数据校验
-     *
-     * @param entity 实体类数据
-     */
-    private void validEntityBeforeSave(TopGoods entity){
-        //TODO 做一些数据校验,如唯一约束
-    }
-
-    @Override
-    public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
-        if(isValid){
-            //TODO 做一些业务上的校验,判断是否需要校验
-        }
-        return this.removeByIds(ids);
-    }
-
-    @Override
-    @Transactional(rollbackFor = Exception.class)
+//    @Transactional(rollbackFor = Exception.class)
     public boolean goodsBatchCopyTenant() {
         List<TopGoodsCopy> copyRecordList = new ArrayList<>();
-        String tenantId = "867735392558919680";
+        Long tenantId = 867735392558919680L;
         //全量同步
         // 1 goods
         List<Goods> goodsList = iGoodsService.list(new LambdaQueryWrapper<Goods>().eq(Goods::getTenantId,tenantId));
@@ -1326,7 +1194,9 @@ public class TopGoodsServiceImpl extends ServiceImpl<TopGoodsMapper, TopGoods> i
             //所属专业
             goods.setMajorId(getNewId(goods.getMajorId(), GoodsCopyEnum.MAJOR.getType()));
             //项目
-            goods.setProjectId(getNewId(goods.getProjectId().longValue(), GoodsCopyEnum.COURSE_PROJECT_TYPE.getType()));
+            if (ObjectUtils.isNotNull(goods.getProjectId())){
+                goods.setProjectId(getNewId(goods.getProjectId().longValue(), GoodsCopyEnum.COURSE_PROJECT_TYPE.getType()));
+            }
             //讲义
             goods.setHandoutsId(getNewId(goods.getHandoutsId(), GoodsCopyEnum.COURSE_HANDOUTS.getType()));
             //科目
@@ -1882,4 +1752,48 @@ public class TopGoodsServiceImpl extends ServiceImpl<TopGoodsMapper, TopGoods> i
         return records.stream().map(x -> x.getNewId().toString()).collect(Collectors.joining(","));
     }
 
+
+    @Override
+    public List<TopGoodsVo> selectList(TopGoodsQueryBo bo) {
+        if (Validator.isNotEmpty(bo.getGoodsName())) {
+            bo.setGoodsName(bo.getGoodsName().trim());
+        }
+        List<TopGoodsVo> list = baseMapper.selectAllList(bo);
+        if (Validator.isNotEmpty(bo.getSectionNum()) && bo.getSectionNum().longValue() == 1) {
+            for (TopGoodsVo vo : list) {
+                Long sectionNum = baseMapper.getSectionNum(vo.getGoodsId());
+                vo.setSectionNum(sectionNum);
+            }
+        }
+        list.forEach(goods -> {
+            //多规格下的价格区间
+            if (ObjectUtils.isNotNull(goods.getSpecTemplateId())) {
+                List<TopGoodsSpecAttributeRelation> specAttributeRelations = topGoodsSpecAttributeRelationService
+                        .list(new LambdaQueryWrapper<TopGoodsSpecAttributeRelation>()
+                                .eq(TopGoodsSpecAttributeRelation::getSpecTemplateId, goods.getSpecTemplateId()));
+                if (CollectionUtils.isNotEmpty(specAttributeRelations)) {
+                    List<Long> goodsIds = specAttributeRelations.stream().filter(x -> ObjectUtils.isNotNull(x.getGoodsId())).map(TopGoodsSpecAttributeRelation::getGoodsId).collect(Collectors.toList());
+                    List<TopGoods> goodsList = listByIds(goodsIds);
+                    //从小到大排序
+                    List<TopGoods> collect = goodsList.stream().filter(x -> ObjectUtils.isNotNull(x.getStandPrice())).sorted(Comparator.comparing(TopGoods::getStandPrice)).collect(Collectors.toList());
+                    goods.setMinPrice(collect.get(0).getStandPrice());
+                    goods.setMaxPrice(collect.get(collect.size() - 1).getStandPrice());
+                }
+            }
+            //是否包含每日一练试卷
+            if (goods.getGoodsType() == 2) {
+                //题库商品
+                List<TopBankGoodsExamVo> examVos = iTopQuestionService.getBankGoodsExamList(goods.getGoodsId());
+                if (examVos.stream().filter(x -> StringUtils.isNotBlank(x.getPaperName())).anyMatch(x -> x.getPaperName().equals("每日一练"))) {
+                    goods.setExamRecord(1);
+                } else {
+                    goods.setExamRecord(0);
+                }
+            } else {
+                goods.setExamRecord(0);
+            }
+        });
+        return list;
+    }
+
 }

+ 6 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/top/goods/service/impl/TopQuestionServiceImpl.java

@@ -13,6 +13,7 @@ import com.zhongzheng.modules.top.goods.bo.TopQuestionQueryBo;
 import com.zhongzheng.modules.top.goods.domain.TopQuestion;
 import com.zhongzheng.modules.top.goods.mapper.TopQuestionMapper;
 import com.zhongzheng.modules.top.goods.service.ITopQuestionService;
+import com.zhongzheng.modules.top.goods.vo.TopBankGoodsExamVo;
 import com.zhongzheng.modules.top.goods.vo.TopQuestionVo;
 import org.springframework.stereotype.Service;
 
@@ -107,4 +108,9 @@ public class TopQuestionServiceImpl extends ServiceImpl<TopQuestionMapper, TopQu
         }
         return this.removeByIds(ids);
     }
+
+    @Override
+    public List<TopBankGoodsExamVo> getBankGoodsExamList(Long goodsId) {
+        return baseMapper.getBankGoodsExamList(goodsId);
+    }
 }

+ 69 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/top/goods/vo/TopBankGoodsExamVo.java

@@ -0,0 +1,69 @@
+package com.zhongzheng.modules.top.goods.vo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @author yangdamao
+ * @date 2022年11月11日 14:25
+ */
+@Data
+@ApiModel("每日一练试卷对象")
+public class TopBankGoodsExamVo implements Serializable {
+
+    @ApiModelProperty("id")
+    private Long id;
+    /**
+     * 商品id
+     */
+    @ApiModelProperty("商品id")
+    private Long goodsId;
+    /**
+     * 模块卷ID
+     */
+    @ApiModelProperty("模块卷ID")
+    private Long moduleExamId;
+    /**
+     * 章卷ID
+     */
+    @ApiModelProperty("章卷ID")
+    private Long chapterExamId;
+    /**
+     * 试卷ID
+     */
+    @ApiModelProperty("试卷ID")
+    private Long examId;
+    /**
+     * 试卷名称
+     */
+    @ApiModelProperty("试卷名称")
+    private String examName;
+    /**
+     * 试卷类型名称
+     */
+    @ApiModelProperty("试卷类型名称")
+    private String paperName;
+    /**
+     * 每日一练时间
+     */
+    @ApiModelProperty("每日一练时间")
+    private Long examTime;
+    /**
+     * 1有效 0无效
+     */
+    @ApiModelProperty("1有效 0无效")
+    private Integer status;
+    /**
+     * 添加时间
+     */
+    @ApiModelProperty("添加时间")
+    private Long createTime;
+    /**
+     * 修改时间
+     */
+    @ApiModelProperty("修改时间")
+    private Long updateTime;
+}

+ 143 - 32
zhongzheng-system/src/main/java/com/zhongzheng/modules/top/goods/vo/TopGoodsVo.java

@@ -1,20 +1,19 @@
-package com.zhongzheng.modules.top.goods.vo;
+package com.zhongzheng.modules.goods.vo;
 
 import com.zhongzheng.common.annotation.Excel;
-import com.fasterxml.jackson.annotation.JsonFormat;
-import java.math.BigDecimal;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
-import java.util.Date;
 
+import java.math.BigDecimal;
+import java.util.List;
 
 
 /**
  * 商品视图对象 mall_package
  *
- * @author ruoyi
- * @date 2023-03-15
+ * @author hjl
+ * @date 2021-10-12
  */
 @Data
 @ApiModel("商品视图对象")
@@ -29,13 +28,13 @@ public class TopGoodsVo {
 	@Excel(name = "年份")
 	@ApiModelProperty("年份")
 	private Long year;
-	/** 供应方id */
-	@Excel(name = "供应方id")
-	@ApiModelProperty("供应方id")
+	/** 供应方(服务) */
+	@Excel(name = "供应方" , readConverterExp = "服=务")
+	@ApiModelProperty("供应方(服务)")
 	private Long supplyId;
-	/** 商品类型 1视频2题库 3补考 4前培 5虚拟赠送题库 6直播 */
-	@Excel(name = "商品类型 1视频2题库 3补考 4前培 5虚拟赠送题库 6直播")
-	@ApiModelProperty("商品类型 1视频2题库 3补考 4前培 5虚拟赠送题库 6直播")
+	/** $column.columnComment */
+	@Excel(name = "供应方" , readConverterExp = "商品类型 1视频2题库 3补考 4前培 ")
+	@ApiModelProperty("商品类型 1视频2题库 3补考 4前培 ")
 	private Integer goodsType;
 	/** 教育类型id */
 	@Excel(name = "教育类型id")
@@ -69,6 +68,11 @@ public class TopGoodsVo {
 	@Excel(name = "状态 1有效 0无效")
 	@ApiModelProperty("状态 1有效 0无效")
 	private Integer status;
+
+	/** 班级*/
+	@Excel(name = "班级")
+	@ApiModelProperty("班级")
+	private Long gradeId;
 	/** 有效期开始 */
 	@Excel(name = "有效期开始")
 	@ApiModelProperty("有效期开始")
@@ -129,10 +133,29 @@ public class TopGoodsVo {
 	@Excel(name = "编码")
 	@ApiModelProperty("编码")
 	private String code;
+	@ApiModelProperty("创建时间")
+	private Long createTime;
+	@ApiModelProperty("更新试卷")
+	private Long updateTime;
+	@ApiModelProperty("供应方名称")
+	private String supplyName;
 	/** 项目ID */
 	@Excel(name = "项目ID")
 	@ApiModelProperty("项目ID")
 	private Long projectId;
+
+
+	@ApiModelProperty("教育名称")
+	private String educationName;
+	@ApiModelProperty("项目名称")
+	private String projectName;
+	@ApiModelProperty("业务名称")
+	private String businessName;
+	@ApiModelProperty("学校名称")
+	private String schoolName;
+	@ApiModelProperty("专业名称")
+	private String categoryName;
+
 	/** 试听设置 */
 	@Excel(name = "试听设置")
 	@ApiModelProperty("试听设置")
@@ -141,18 +164,46 @@ public class TopGoodsVo {
 	@Excel(name = "拍照设置")
 	@ApiModelProperty("拍照设置")
 	private String goodsPhotographConfig;
+
+	/** 试卷拍照设置 */
+	@Excel(name = "试卷拍照设置")
+	@ApiModelProperty("试卷拍照设置")
+	private String goodsPhotoExamConfig;
 	/** 播放设置 */
 	@Excel(name = "播放设置")
 	@ApiModelProperty("播放设置")
 	private String goodsPlayConfig;
+
+	@ApiModelProperty("试听配置列表")
+	private List<GoodsAuditionConfigVo> auditionList;
+
+	@ApiModelProperty("播放设置")
+	private GoodsPlayConfigVo goodsPlayConfigVo;
+
+	@ApiModelProperty("拍照设置")
+	private GoodsPhotographConfigVo goodsPhotographConfigVo;
+
+	@ApiModelProperty("试卷拍照设置")
+	private GoodsPhotoExamConfigVo goodsPhotoExamConfigVo;
+
+	@ApiModelProperty("试卷试做配置列表")
+	private List<GoodsExamConfigVo> examConfigList;
+
 	/** 试卷试做设置 */
-	@Excel(name = "试卷试做设置")
 	@ApiModelProperty("试卷试做设置")
 	private String goodsExamConfig;
-	/** 讲义id */
-	@Excel(name = "讲义id")
+
 	@ApiModelProperty("讲义id")
 	private Long handoutsId;
+
+	/** 模板类型置 */
+	@ApiModelProperty("模板类型置")
+	private String templateType;
+
+	/** 学时 */
+	@Excel(name = "学时")
+	@ApiModelProperty("学时")
+	private Long period;
 	/** 补考或前培开始时间 */
 	@Excel(name = "补考或前培开始时间")
 	@ApiModelProperty("补考或前培开始时间")
@@ -163,16 +214,33 @@ public class TopGoodsVo {
 	private Long makeEndTime;
 	/** 学习次数 */
 	@Excel(name = "学习次数")
-	@ApiModelProperty("学习次数")
+	@ApiModelProperty("学习次数 前培次数,考培次数")
 	private Long studyCount;
-	/** 试卷拍照设置 */
-	@Excel(name = "试卷拍照设置")
-	@ApiModelProperty("试卷拍照设置")
-	private String goodsPhotoExamConfig;
+
 	/** 前培和补考商品关联 */
 	@Excel(name = "前培和补考商品关联")
 	@ApiModelProperty("前培和补考商品关联")
 	private Long makeGoodsId;
+
+	/** 前培和补考商品关联 */
+	@Excel(name = "前培和补考商品关联")
+	@ApiModelProperty("前培和补考商品关联商品名")
+	private String makeGoodsName;
+
+	/** 前培和补考商品关联 */
+	@Excel(name = "前培和补考商品关联")
+	@ApiModelProperty("前培和补考商品关联编码")
+	private String makeGoodsCode;
+
+	@ApiModelProperty("课程数量")
+	private Long courseNum;
+
+	@ApiModelProperty("章数量")
+	private Long chapterNum;
+
+	@ApiModelProperty("节数量")
+	private Long sectionNum;
+
 	/** 服务期类型 1年 2月 3日 4区间 */
 	@Excel(name = "服务期类型 1年 2月 3日 4区间")
 	@ApiModelProperty("服务期类型 1年 2月 3日 4区间")
@@ -181,10 +249,18 @@ public class TopGoodsVo {
 	@Excel(name = "服务期数值")
 	@ApiModelProperty("服务期数值")
 	private Long serviceTimeNum;
+
+	@ApiModelProperty("班级数量")
+	private Long gradeNum;
+
 	/** 每天最大节学习数量 */
 	@Excel(name = "每天最大节学习数量")
 	@ApiModelProperty("每天最大节学习数量")
 	private Long sectionMaxNum;
+
+	@ApiModelProperty("班级名称")
+	private String gradeName;
+
 	/** 考试次数 */
 	@Excel(name = "考试次数")
 	@ApiModelProperty("考试次数")
@@ -193,10 +269,16 @@ public class TopGoodsVo {
 	@Excel(name = "前培次数")
 	@ApiModelProperty("前培次数")
 	private Long doNumber;
+	@ApiModelProperty("总的试卷数量")
+	private Long totalExamNum;
+	@ApiModelProperty("订单")
+	private Long orderNum;
 	/** 讲师ID */
 	@Excel(name = "讲师ID")
 	@ApiModelProperty("讲师ID")
 	private Long teacherId;
+	@ApiModelProperty("直播商品数量")
+	private Integer goodsLiveNum;
 	/** 科目ID,拼接 */
 	@Excel(name = "科目ID,拼接")
 	@ApiModelProperty("科目ID,拼接")
@@ -213,28 +295,56 @@ public class TopGoodsVo {
 	@Excel(name = "证书模板ID")
 	@ApiModelProperty("证书模板ID")
 	private Long certificateTpId;
-	/** 商品划线价 */
-	@Excel(name = "商品划线价")
-	@ApiModelProperty("商品划线价")
+	@ApiModelProperty("科目名称拼接")
+	private String subjectNames;
+	@ApiModelProperty("购买用户数")
+	private Integer buyUserNum;
+	/** 学习进度 */
+	@ApiModelProperty("总节数")
+	private Long secAllNum;
+	/** 考试次数 */
+	@Excel(name = "商品章卷数量")
+	@ApiModelProperty("商品章卷数量")
+	private Long examNum;
+
+	/** 商品划线价格 */
+	@ApiModelProperty("商品划线价格")
 	private BigDecimal linePrice;
-	/** 默认规格模板ID */
-	@Excel(name = "默认规格模板ID")
+	/** 排序字段 */
+	@ApiModelProperty("排序字段")
+	private Integer sort;
+	@ApiModelProperty("商品规格模板数量")
+	private Integer specTemplateNumber;
 	@ApiModelProperty("默认规格模板ID")
 	private Long specTemplateId;
+
+	@ApiModelProperty("业务层次学习顺序:1限制章下做卷顺序 0不限制 2限制整个目录顺序")
+	private Integer goodsLearningOrder;
+
+	@ApiModelProperty("是否包含每日一练试卷:1是 0否")
+	private Integer examRecord;
+
+	@ApiModelProperty("最小价格")
+	private BigDecimal minPrice;
+
+	@ApiModelProperty("最大价格")
+	private BigDecimal maxPrice;
+
 	/** 是否显示:0否 1是 */
-	@Excel(name = "是否显示:0否 1是")
 	@ApiModelProperty("是否显示:0否 1是")
 	private Integer showStatus;
 	/** 显示排序字段 */
-	@Excel(name = "显示排序字段")
 	@ApiModelProperty("显示排序字段")
 	private Long showSort;
-	/** 外部跳转链接 */
-	@Excel(name = "外部跳转链接")
-	@ApiModelProperty("外部跳转链接")
+
+	@ApiModelProperty("是否二建商品:1是 0否")
+	private Integer specialGoods;
+
+	@ApiModelProperty("商品复制时间")
+	private List<String> copyTime;
+
+	@ApiModelProperty("外链")
 	private String externalLink;
-	/** 是否外链商品:0否 1是 */
-	@Excel(name = "是否外链商品:0否 1是")
 	@ApiModelProperty("是否外链商品:0否 1是")
 	private Integer externalLinkStatus;
 	/** 是否提交官方审核 0没有 1有 */
@@ -245,4 +355,5 @@ public class TopGoodsVo {
 	@Excel(name = "提交官方审核备注说明")
 	@ApiModelProperty("提交官方审核备注说明")
 	private String commitPeriodRemark;
+
 }

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/top/user/bo/TopSysUserAddBo.java

@@ -73,4 +73,6 @@ public class TopSysUserAddBo {
     /** 备注 */
     @ApiModelProperty("备注")
     private String remark;
+    /** 用户编码 */
+    private String code;
 }

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/top/user/bo/TopSysUserEditBo.java

@@ -82,4 +82,7 @@ public class TopSysUserEditBo {
     /** 备注 */
     @ApiModelProperty("备注")
     private String remark;
+
+    /** 用户编码 */
+    private String code;
 }

+ 4 - 3
zhongzheng-system/src/main/java/com/zhongzheng/modules/top/user/bo/TopSysUserQueryBo.java

@@ -1,5 +1,7 @@
 package com.zhongzheng.modules.top.user.bo;
 
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.zhongzheng.common.core.domain.BaseEntity;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
@@ -7,9 +9,6 @@ import lombok.EqualsAndHashCode;
 
 import java.util.Date;
 
-import com.fasterxml.jackson.annotation.JsonFormat;
-import com.zhongzheng.common.core.domain.BaseEntity;
-
 /**
  * SAAS用户信息分页查询对象 top_sys_user
  *
@@ -73,4 +72,6 @@ public class TopSysUserQueryBo extends BaseEntity {
 	@ApiModelProperty("最后登录时间")
 	private Date loginDate;
 
+	/** 用户编码 */
+	private String code;
 }

+ 18 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/top/user/domain/TopSysDictData.java

@@ -4,12 +4,16 @@ import com.baomidou.mybatisplus.annotation.FieldFill;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.zhongzheng.common.constant.UserConstants;
 import lombok.Data;
 import lombok.NoArgsConstructor;
 import lombok.experimental.Accessors;
 
 import java.io.Serializable;
 import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
 
 /**
  * 【请填写功能名称】对象 top_sys_dict_data
@@ -60,4 +64,18 @@ private static final long serialVersionUID=1L;
     private String remark;
     /** 字典类型ID */
     private Long dictTypeId;
+
+    @TableField(exist = false)
+    private List<String> statusArray;
+    /**
+     * 请求参数
+     */
+    @TableField(exist = false)
+    private Map<String, Object> params = new HashMap<>();
+
+    public boolean getDefault()
+    {
+        return UserConstants.YES.equals(this.isDefault) ? true : false;
+    }
+
 }

+ 20 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/top/user/domain/TopSysDictType.java

@@ -4,12 +4,16 @@ import com.baomidou.mybatisplus.annotation.FieldFill;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.NoArgsConstructor;
 import lombok.experimental.Accessors;
 
 import java.io.Serializable;
 import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
 
 /**
  * 【请填写功能名称】对象 top_sys_dict_type
@@ -48,4 +52,20 @@ private static final long serialVersionUID=1L;
     private Date updateTime;
     /** 备注 */
     private String remark;
+
+    @TableField(exist = false)
+    private List<String> statusArray;
+    /**
+     * 请求参数
+     */
+    @TableField(exist = false)
+    private Map<String, Object> params = new HashMap<>();
+    /** 分页大小 */
+    @ApiModelProperty("分页大小")
+    @TableField(exist = false)
+    private Integer pageSize;
+    /** 当前页数 */
+    @ApiModelProperty("当前页数")
+    @TableField(exist = false)
+    private Integer pageNum;
 }

+ 2 - 2
zhongzheng-system/src/main/java/com/zhongzheng/modules/top/user/domain/TopSysMenu.java

@@ -39,9 +39,9 @@ private static final long serialVersionUID=1L;
     /** 组件路径 */
     private String component;
     /** 是否为外链(0是 1否) */
-    private Long isFrame;
+    private String isFrame;
     /** 是否缓存(0缓存 1不缓存) */
-    private Long isCache;
+    private String isCache;
     /** 菜单类型(M目录 C菜单 F按钮) */
     private String menuType;
     /** 菜单状态(1显示 0隐藏) */

+ 34 - 23
zhongzheng-system/src/main/java/com/zhongzheng/modules/top/user/service/ITopSysDictDataService.java

@@ -2,13 +2,8 @@ package com.zhongzheng.modules.top.user.service;
 
 
 import com.baomidou.mybatisplus.extension.service.IService;
-import com.zhongzheng.modules.top.user.bo.TopSysDictDataAddBo;
-import com.zhongzheng.modules.top.user.bo.TopSysDictDataEditBo;
-import com.zhongzheng.modules.top.user.bo.TopSysDictDataQueryBo;
 import com.zhongzheng.modules.top.user.domain.TopSysDictData;
-import com.zhongzheng.modules.top.user.vo.TopSysDictDataVo;
 
-import java.util.Collection;
 import java.util.List;
 
 /**
@@ -19,35 +14,51 @@ import java.util.List;
  */
 public interface ITopSysDictDataService extends IService<TopSysDictData> {
 	/**
-	 * 查询单个
-	 * @return
+	 * 根据条件分页查询字典数据
+	 *
+	 * @param dictData 字典数据信息
+	 * @return 字典数据集合信息
 	 */
-	TopSysDictDataVo queryById(Long dictCode);
+	public List<TopSysDictData> selectDictDataList(TopSysDictData dictData);
 
 	/**
-	 * 查询列表
+	 * 根据字典类型和字典键值查询字典数据信息
+	 *
+	 * @param dictType  字典类型
+	 * @param dictValue 字典键值
+	 * @return 字典标签
 	 */
-	List<TopSysDictDataVo> queryList(TopSysDictDataQueryBo bo);
+	public String selectDictLabel(String dictType, String dictValue);
 
 	/**
-	 * 根据新增业务对象插入【请填写功能名称】
-	 * @param bo 【请填写功能名称】新增业务对象
-	 * @return
+	 * 根据字典数据ID查询信息
+	 *
+	 * @param dictCode 字典数据ID
+	 * @return 字典数据
 	 */
-	Boolean insertByAddBo(TopSysDictDataAddBo bo);
+	public TopSysDictData selectDictDataById(Long dictCode);
 
 	/**
-	 * 根据编辑业务对象修改【请填写功能名称】
-	 * @param bo 【请填写功能名称】编辑业务对象
-	 * @return
+	 * 批量删除字典数据信息
+	 *
+	 * @param dictCodes 需要删除的字典数据ID
+	 * @return 结果
 	 */
-	Boolean updateByEditBo(TopSysDictDataEditBo bo);
+	public int deleteDictDataByIds(Long[] dictCodes);
 
 	/**
-	 * 校验并删除数据
-	 * @param ids 主键集合
-	 * @param isValid 是否校验,true-删除前校验,false-不校验
-	 * @return
+	 * 新增保存字典数据信息
+	 *
+	 * @param dictData 字典数据信息
+	 * @return 结果
 	 */
-	Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
+	public int insertDictData(TopSysDictData dictData);
+
+	/**
+	 * 修改保存字典数据信息
+	 *
+	 * @param dictData 字典数据信息
+	 * @return 结果
+	 */
+	public int updateDictData(TopSysDictData dictData);
 }

+ 48 - 23
zhongzheng-system/src/main/java/com/zhongzheng/modules/top/user/service/ITopSysDictTypeService.java

@@ -2,13 +2,9 @@ package com.zhongzheng.modules.top.user.service;
 
 
 import com.baomidou.mybatisplus.extension.service.IService;
-import com.zhongzheng.modules.top.user.bo.TopSysDictTypeAddBo;
-import com.zhongzheng.modules.top.user.bo.TopSysDictTypeEditBo;
-import com.zhongzheng.modules.top.user.bo.TopSysDictTypeQueryBo;
+import com.zhongzheng.modules.top.user.domain.TopSysDictData;
 import com.zhongzheng.modules.top.user.domain.TopSysDictType;
-import com.zhongzheng.modules.top.user.vo.TopSysDictTypeVo;
 
-import java.util.Collection;
 import java.util.List;
 
 /**
@@ -19,35 +15,64 @@ import java.util.List;
  */
 public interface ITopSysDictTypeService extends IService<TopSysDictType> {
 	/**
-	 * 查询单个
-	 * @return
+	 * 根据条件分页查询字典类型
+	 *
+	 * @param dictType 字典类型信息
+	 * @return 字典类型集合信息
 	 */
-	TopSysDictTypeVo queryById(Long dictId);
+	public List<TopSysDictType> selectDictTypeList(TopSysDictType dictType);
+
+
+	/**
+	 * 根据字典类型ID查询信息
+	 *
+	 * @param dictId 字典类型ID
+	 * @return 字典类型
+	 */
+	public TopSysDictType selectDictTypeById(Long dictId);
+
+	/**
+	 * 批量删除字典信息
+	 *
+	 * @param dictIds 需要删除的字典ID
+	 * @return 结果
+	 */
+	public int deleteDictTypeByIds(Long[] dictIds);
+
+	/**
+	 * 清空缓存数据
+	 */
+	public void clearCache();
 
 	/**
-	 * 查询列表
+	 * 新增保存字典类型信息
+	 *
+	 * @param dictType 字典类型信息
+	 * @return 结果
 	 */
-	List<TopSysDictTypeVo> queryList(TopSysDictTypeQueryBo bo);
+	public int insertDictType(TopSysDictType dictType);
 
 	/**
-	 * 根据新增业务对象插入【请填写功能名称】
-	 * @param bo 【请填写功能名称】新增业务对象
-	 * @return
+	 * 根据字典类型查询字典数据
+	 *
+	 * @param dictType 字典类型
+	 * @return 字典数据集合信息
 	 */
-	Boolean insertByAddBo(TopSysDictTypeAddBo bo);
+	public List<TopSysDictData> selectDictDataByType(String dictType);
 
 	/**
-	 * 根据编辑业务对象修改【请填写功能名称】
-	 * @param bo 【请填写功能名称】编辑业务对象
-	 * @return
+	 * 修改保存字典类型信息
+	 *
+	 * @param dictType 字典类型信息
+	 * @return 结果
 	 */
-	Boolean updateByEditBo(TopSysDictTypeEditBo bo);
+	public int updateDictType(TopSysDictType dictType);
 
 	/**
-	 * 校验并删除数据
-	 * @param ids 主键集合
-	 * @param isValid 是否校验,true-删除前校验,false-不校验
-	 * @return
+	 * 校验字典类型称是否唯一
+	 *
+	 * @param dictType 字典类型
+	 * @return 结果
 	 */
-	Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
+	public String checkDictTypeUnique(TopSysDictType dictType);
 }

+ 95 - 58
zhongzheng-system/src/main/java/com/zhongzheng/modules/top/user/service/impl/TopSysDictDataServiceImpl.java

@@ -1,24 +1,19 @@
 package com.zhongzheng.modules.top.user.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.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.github.pagehelper.Page;
-import com.zhongzheng.modules.top.user.bo.TopSysDictDataAddBo;
-import com.zhongzheng.modules.top.user.bo.TopSysDictDataEditBo;
-import com.zhongzheng.modules.top.user.bo.TopSysDictDataQueryBo;
+import com.zhongzheng.common.exception.CustomException;
+import com.zhongzheng.common.utils.DateUtils;
+import com.zhongzheng.common.utils.DictUtils;
 import com.zhongzheng.modules.top.user.domain.TopSysDictData;
 import com.zhongzheng.modules.top.user.mapper.TopSysDictDataMapper;
 import com.zhongzheng.modules.top.user.service.ITopSysDictDataService;
-import com.zhongzheng.modules.top.user.vo.TopSysDictDataVo;
 import org.springframework.stereotype.Service;
 
-import java.util.Collection;
-import java.util.Date;
+import java.util.Arrays;
 import java.util.List;
-import java.util.stream.Collectors;
 
 /**
  * 【请填写功能名称】Service业务层处理
@@ -29,63 +24,99 @@ import java.util.stream.Collectors;
 @Service
 public class TopSysDictDataServiceImpl extends ServiceImpl<TopSysDictDataMapper, TopSysDictData> implements ITopSysDictDataService {
 
+    /**
+     * 根据条件分页查询字典数据
+     *
+     * @param dictData 字典数据信息
+     * @return 字典数据集合信息
+     */
     @Override
-    public TopSysDictDataVo queryById(Long dictCode){
-        TopSysDictData db = this.baseMapper.selectById(dictCode);
-        return BeanUtil.toBean(db, TopSysDictDataVo.class);
+    public List<TopSysDictData> selectDictDataList(TopSysDictData dictData) {
+        return list(new LambdaQueryWrapper<TopSysDictData>().eq(StrUtil.isNotBlank(dictData.getDictType()), TopSysDictData::getDictType, dictData.getDictType())
+                .like(StrUtil.isNotBlank(dictData.getDictLabel()), TopSysDictData::getDictLabel, dictData.getDictLabel())
+                .eq(StrUtil.isNotBlank(dictData.getStatus()), TopSysDictData::getStatus, dictData.getStatus())
+                .in(dictData.getStatusArray()!=null, TopSysDictData::getStatus, dictData.getStatusArray())
+                .eq(dictData.getDictTypeId()!=null, TopSysDictData::getDictTypeId, dictData.getDictTypeId())
+                .orderByAsc(TopSysDictData::getDictSort));
     }
 
+    /**
+     * 根据字典类型和字典键值查询字典数据信息
+     *
+     * @param dictType  字典类型
+     * @param dictValue 字典键值
+     * @return 字典标签
+     */
     @Override
-    public List<TopSysDictDataVo> queryList(TopSysDictDataQueryBo bo) {
-        LambdaQueryWrapper<TopSysDictData> lqw = Wrappers.lambdaQuery();
-        lqw.eq(bo.getDictSort() != null, TopSysDictData::getDictSort, bo.getDictSort());
-        lqw.eq(StrUtil.isNotBlank(bo.getDictLabel()), TopSysDictData::getDictLabel, bo.getDictLabel());
-        lqw.eq(StrUtil.isNotBlank(bo.getDictValue()), TopSysDictData::getDictValue, bo.getDictValue());
-        lqw.eq(StrUtil.isNotBlank(bo.getDictType()), TopSysDictData::getDictType, bo.getDictType());
-        lqw.eq(StrUtil.isNotBlank(bo.getCssClass()), TopSysDictData::getCssClass, bo.getCssClass());
-        lqw.eq(StrUtil.isNotBlank(bo.getListClass()), TopSysDictData::getListClass, bo.getListClass());
-        lqw.eq(StrUtil.isNotBlank(bo.getIsDefault()), TopSysDictData::getIsDefault, bo.getIsDefault());
-        lqw.eq(StrUtil.isNotBlank(bo.getStatus()), TopSysDictData::getStatus, bo.getStatus());
-        lqw.eq(bo.getDictTypeId() != null, TopSysDictData::getDictTypeId, bo.getDictTypeId());
-        lqw.orderByAsc(TopSysDictData::getDictSort);
-        return entity2Vo(this.list(lqw));
+    public String selectDictLabel(String dictType, String dictValue) {
+        return getOne(new LambdaQueryWrapper<TopSysDictData>()
+                .select(TopSysDictData::getDictLabel)
+                .eq(TopSysDictData::getDictType, dictType)
+                .eq(TopSysDictData::getDictValue, dictValue))
+                .getDictLabel();
     }
 
     /**
-    * 实体类转化成视图对象
-    *
-    * @param collection 实体类集合
-    * @return
-    */
-    private List<TopSysDictDataVo> entity2Vo(Collection<TopSysDictData> collection) {
-        List<TopSysDictDataVo> voList = collection.stream()
-                .map(any -> BeanUtil.toBean(any, TopSysDictDataVo.class))
-                .collect(Collectors.toList());
-        if (collection instanceof Page) {
-            Page<TopSysDictData> page = (Page<TopSysDictData>)collection;
-            Page<TopSysDictDataVo> pageVo = new Page<>();
-            BeanUtil.copyProperties(page,pageVo);
-            pageVo.addAll(voList);
-            voList = pageVo;
+     * 根据字典数据ID查询信息
+     *
+     * @param dictCode 字典数据ID
+     * @return 字典数据
+     */
+    @Override
+    public TopSysDictData selectDictDataById(Long dictCode) {
+        return getById(dictCode);
+    }
+
+    /**
+     * 批量删除字典数据信息
+     *
+     * @param dictCodes 需要删除的字典数据ID
+     * @return 结果
+     */
+    @Override
+    public int deleteDictDataByIds(Long[] dictCodes) {
+        int row = baseMapper.deleteBatchIds(Arrays.asList(dictCodes));
+        if (row > 0) {
+            DictUtils.clearDictCache();
         }
-        return voList;
+        return row;
     }
 
+    /**
+     * 新增保存字典数据信息
+     *
+     * @param dictData 字典数据信息
+     * @return 结果
+     */
     @Override
-    public Boolean insertByAddBo(TopSysDictDataAddBo bo) {
-        TopSysDictData add = BeanUtil.toBean(bo, TopSysDictData.class);
-        validEntityBeforeSave(add);
-        add.setCreateTime(new Date());
-        add.setUpdateTime(new Date());
-        return this.save(add);
+    public int insertDictData(TopSysDictData dictData) {
+        validEntityBeforeSave(dictData);
+        int row = baseMapper.insert(dictData);
+        if (row > 0) {
+            DictUtils.clearDictCache();
+        }
+        return row;
     }
 
+    /**
+     * 修改保存字典数据信息
+     *
+     * @param dictData 字典数据信息
+     * @return 结果
+     */
     @Override
-    public Boolean updateByEditBo(TopSysDictDataEditBo bo) {
-        TopSysDictData update = BeanUtil.toBean(bo, TopSysDictData.class);
-        validEntityBeforeSave(update);
-        update.setUpdateTime(new Date());
-        return this.updateById(update);
+    public int updateDictData(TopSysDictData dictData) {
+        if (dictData.getStatus().equals("-1")){
+            dictData.setUpdateTime(DateUtils.getNowDate());
+            int row = baseMapper.updateById(dictData);
+            return row;
+        }
+        validEntityBeforeSave(dictData);
+        int row = baseMapper.updateById(dictData);
+        if (row > 0) {
+            DictUtils.clearDictCache();
+        }
+        return row;
     }
 
     /**
@@ -95,13 +126,19 @@ public class TopSysDictDataServiceImpl extends ServiceImpl<TopSysDictDataMapper,
      */
     private void validEntityBeforeSave(TopSysDictData entity){
         //TODO 做一些数据校验,如唯一约束
+        if(checkDictValueUnique(entity)){
+            throw new CustomException("该键值已存在");
+        }
     }
 
-    @Override
-    public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
-        if(isValid){
-            //TODO 做一些业务上的校验,判断是否需要校验
+    private boolean checkDictValueUnique(TopSysDictData entity) {
+        TopSysDictData info = getOne(new LambdaQueryWrapper<TopSysDictData>()
+                .eq(TopSysDictData::getDictValue,entity.getDictValue())
+                .eq(TopSysDictData::getDictType,entity.getDictType())
+                .last("limit 1"));
+        if (Validator.isNotNull(info)) {
+            return true;
         }
-        return this.removeByIds(ids);
+        return false;
     }
 }

+ 131 - 52
zhongzheng-system/src/main/java/com/zhongzheng/modules/top/user/service/impl/TopSysDictTypeServiceImpl.java

@@ -1,23 +1,28 @@
 package com.zhongzheng.modules.top.user.service.impl;
 
 import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.lang.Validator;
 import cn.hutool.core.util.StrUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.github.pagehelper.Page;
-import com.zhongzheng.modules.top.user.bo.TopSysDictTypeAddBo;
-import com.zhongzheng.modules.top.user.bo.TopSysDictTypeEditBo;
-import com.zhongzheng.modules.top.user.bo.TopSysDictTypeQueryBo;
+import com.zhongzheng.common.constant.UserConstants;
+import com.zhongzheng.common.core.domain.entity.SysDictData;
+import com.zhongzheng.common.exception.CustomException;
+import com.zhongzheng.common.utils.DictUtils;
+import com.zhongzheng.modules.top.user.domain.TopSysDictData;
 import com.zhongzheng.modules.top.user.domain.TopSysDictType;
+import com.zhongzheng.modules.top.user.mapper.TopSysDictDataMapper;
 import com.zhongzheng.modules.top.user.mapper.TopSysDictTypeMapper;
 import com.zhongzheng.modules.top.user.service.ITopSysDictTypeService;
-import com.zhongzheng.modules.top.user.vo.TopSysDictTypeVo;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 
-import java.util.Collection;
-import java.util.Date;
+import java.util.Arrays;
 import java.util.List;
+import java.util.Map;
 import java.util.stream.Collectors;
 
 /**
@@ -29,72 +34,146 @@ import java.util.stream.Collectors;
 @Service
 public class TopSysDictTypeServiceImpl extends ServiceImpl<TopSysDictTypeMapper, TopSysDictType> implements ITopSysDictTypeService {
 
+    @Autowired
+    private TopSysDictDataMapper dictDataMapper;
+
+    /**
+     * 根据条件分页查询字典类型
+     *
+     * @param dictType 字典类型信息
+     * @return 字典类型集合信息
+     */
     @Override
-    public TopSysDictTypeVo queryById(Long dictId){
-        TopSysDictType db = this.baseMapper.selectById(dictId);
-        return BeanUtil.toBean(db, TopSysDictTypeVo.class);
+    public List<TopSysDictType> selectDictTypeList(TopSysDictType dictType) {
+        Map<String, Object> params = dictType.getParams();
+        return list(new LambdaQueryWrapper<TopSysDictType>()
+                .like(StrUtil.isNotBlank(dictType.getDictName()),TopSysDictType::getDictName, dictType.getDictName())
+                .eq(StrUtil.isNotBlank(dictType.getStatus()),TopSysDictType::getStatus, dictType.getStatus())
+                .in(dictType.getStatusArray()!=null,TopSysDictType::getStatus, dictType.getStatusArray())
+                .like(StrUtil.isNotBlank(dictType.getDictType()),TopSysDictType::getDictType, dictType.getDictType())
+                .apply(Validator.isNotEmpty(params.get("beginTime")),
+                        "date_format(create_time,'%y%m%d') >= date_format({0},'%y%m%d')",
+                        params.get("beginTime"))
+                .apply(Validator.isNotEmpty(params.get("endTime")),
+                        "date_format(create_time,'%y%m%d') <= date_format({0},'%y%m%d')",
+                        params.get("endTime")));
     }
 
+
+    /**
+     * 根据字典类型ID查询信息
+     *
+     * @param dictId 字典类型ID
+     * @return 字典类型
+     */
     @Override
-    public List<TopSysDictTypeVo> queryList(TopSysDictTypeQueryBo bo) {
-        LambdaQueryWrapper<TopSysDictType> lqw = Wrappers.lambdaQuery();
-        lqw.like(StrUtil.isNotBlank(bo.getDictName()), TopSysDictType::getDictName, bo.getDictName());
-        lqw.eq(StrUtil.isNotBlank(bo.getDictType()), TopSysDictType::getDictType, bo.getDictType());
-        lqw.eq(StrUtil.isNotBlank(bo.getStatus()), TopSysDictType::getStatus, bo.getStatus());
-        return entity2Vo(this.list(lqw));
+    public TopSysDictType selectDictTypeById(Long dictId) {
+        return getById(dictId);
     }
 
     /**
-    * 实体类转化成视图对象
-    *
-    * @param collection 实体类集合
-    * @return
-    */
-    private List<TopSysDictTypeVo> entity2Vo(Collection<TopSysDictType> collection) {
-        List<TopSysDictTypeVo> voList = collection.stream()
-                .map(any -> BeanUtil.toBean(any, TopSysDictTypeVo.class))
-                .collect(Collectors.toList());
-        if (collection instanceof Page) {
-            Page<TopSysDictType> page = (Page<TopSysDictType>)collection;
-            Page<TopSysDictTypeVo> pageVo = new Page<>();
-            BeanUtil.copyProperties(page,pageVo);
-            pageVo.addAll(voList);
-            voList = pageVo;
+     * 批量删除字典类型信息
+     *
+     * @param dictIds 需要删除的字典ID
+     * @return 结果
+     */
+    @Override
+    public int deleteDictTypeByIds(Long[] dictIds) {
+        for (Long dictId : dictIds) {
+            TopSysDictType dictType = selectDictTypeById(dictId);
+            if (dictDataMapper.selectCount(new LambdaQueryWrapper<TopSysDictData>()
+                    .eq(TopSysDictData::getDictType, dictType.getDictType())) > 0) {
+                throw new CustomException(String.format("%1$s已分配,不能删除", dictType.getDictName()));
+            }
+        }
+        int count = baseMapper.deleteBatchIds(Arrays.asList(dictIds));
+        if (count > 0) {
+            DictUtils.clearDictCache();
         }
-        return voList;
+        return count;
     }
 
+    /**
+     * 清空缓存数据
+     */
     @Override
-    public Boolean insertByAddBo(TopSysDictTypeAddBo bo) {
-        TopSysDictType add = BeanUtil.toBean(bo, TopSysDictType.class);
-        validEntityBeforeSave(add);
-        add.setCreateTime(new Date());
-        add.setUpdateTime(new Date());
-        return this.save(add);
+    public void clearCache() {
+        DictUtils.clearDictCache();
     }
 
+    /**
+     * 新增保存字典类型信息
+     *
+     * @param dictType 字典类型信息
+     * @return 结果
+     */
     @Override
-    public Boolean updateByEditBo(TopSysDictTypeEditBo bo) {
-        TopSysDictType update = BeanUtil.toBean(bo, TopSysDictType.class);
-        validEntityBeforeSave(update);
-        update.setUpdateTime(new Date());
-        return this.updateById(update);
+    public int insertDictType(TopSysDictType dictType) {
+        int row = baseMapper.insert(dictType);
+        if (row > 0) {
+            DictUtils.clearDictCache();
+        }
+        return row;
     }
 
     /**
-     * 保存前的数据校验
+     * 根据字典类型查询字典数据
      *
-     * @param entity 实体类数据
+     * @param dictType 字典类型
+     * @return 字典数据集合信息
      */
-    private void validEntityBeforeSave(TopSysDictType entity){
-        //TODO 做一些数据校验,如唯一约束
+    @Override
+    public List<TopSysDictData> selectDictDataByType(String dictType) {
+        List<SysDictData> dictDatas = DictUtils.getTopDictCache(dictType);
+        if (CollUtil.isNotEmpty(dictDatas)) {
+            return dictDatas.stream().map(item -> BeanUtil.toBean(item,TopSysDictData.class)).collect(Collectors.toList());
+        }
+        List<TopSysDictData> dictDataList = dictDataMapper.selectList(new LambdaQueryWrapper<TopSysDictData>()
+                .eq(TopSysDictData::getStatus, 0)
+                .eq(TopSysDictData::getDictType, dictType)
+                .orderByAsc(TopSysDictData::getDictSort));
+        if (CollUtil.isNotEmpty(dictDataList)) {
+            DictUtils.setTopDictCache(dictType, dictDataList.stream().map(item -> BeanUtil.toBean(item,SysDictData.class)).collect(Collectors.toList()));
+            return dictDataList;
+        }
+        return null;
     }
 
+    /**
+     * 修改保存字典类型信息
+     *
+     * @param dictType 字典类型信息
+     * @return 结果
+     */
+    @Override
+    @Transactional
+    public int updateDictType(TopSysDictType dictType) {
+        TopSysDictType oldDict = getById(dictType.getDictId());
+        dictDataMapper.update(null, new LambdaUpdateWrapper<TopSysDictData>()
+                .set(TopSysDictData::getDictType, dictType.getDictType())
+                .eq(TopSysDictData::getDictType, oldDict.getDictType()));
+        int row = baseMapper.updateById(dictType);
+        if (row > 0) {
+            DictUtils.clearDictCache();
+        }
+        return row;
+    }
+
+    /**
+     * 校验字典类型称是否唯一
+     *
+     * @param dict 字典类型
+     * @return 结果
+     */
     @Override
-    public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
-        if(isValid){
-            //TODO 做一些业务上的校验,判断是否需要校验
+    public String checkDictTypeUnique(TopSysDictType dict) {
+        Long dictId = Validator.isNull(dict.getDictId()) ? -1L : dict.getDictId();
+        TopSysDictType dictType = getOne(new LambdaQueryWrapper<TopSysDictType>()
+                .eq(TopSysDictType::getDictType, dict.getDictType())
+                .last("limit 1"));
+        if (Validator.isNotNull(dictType) && dictType.getDictId().longValue() != dictId.longValue()) {
+            return UserConstants.NOT_UNIQUE;
         }
-        return this.removeByIds(ids);
+        return UserConstants.UNIQUE;
     }
 }

+ 2 - 3
zhongzheng-system/src/main/java/com/zhongzheng/modules/top/user/service/impl/TopSysUserServiceImpl.java

@@ -9,7 +9,6 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.github.pagehelper.Page;
 import com.zhongzheng.common.annotation.DataScope;
 import com.zhongzheng.common.constant.UserConstants;
-import com.zhongzheng.common.core.domain.entity.SysRole;
 import com.zhongzheng.common.core.domain.entity.TopSysUser;
 import com.zhongzheng.common.exception.CustomException;
 import com.zhongzheng.modules.course.bo.CourseBusinessQueryBo;
@@ -164,7 +163,7 @@ public class TopSysUserServiceImpl extends ServiceImpl<TopSysUserMapper, TopSysU
     @DataScope(deptAlias = "d", userAlias = "u")
     public List<TopSysUser> selectUserList(TopSysUser user) {
         List<TopSysUser> sysUsers = baseMapper.selectUserList(user);
-        for (TopSysUser sysUser : sysUsers) {
+    /*    for (TopSysUser sysUser : sysUsers) {
             List<Long> testList = new ArrayList();
             for (SysRole role : sysUser.getRoles()) {
                 testList.add(role.getRoleId());
@@ -178,7 +177,7 @@ public class TopSysUserServiceImpl extends ServiceImpl<TopSysUserMapper, TopSysU
             }
 
             sysUser.setRoleIds(array);
-        }
+        }*/
         return sysUsers;
     }
 

+ 6 - 3
zhongzheng-system/src/main/java/com/zhongzheng/modules/top/user/vo/TopSysUserVo.java

@@ -1,13 +1,13 @@
 package com.zhongzheng.modules.top.user.vo;
 
-import com.zhongzheng.common.annotation.Excel;
 import com.fasterxml.jackson.annotation.JsonFormat;
-import java.util.Date;
-
+import com.zhongzheng.common.annotation.Excel;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
+import java.util.Date;
+
 
 /**
  * SAAS用户信息视图对象 mall_package
@@ -78,4 +78,7 @@ public class TopSysUserVo {
 	@ApiModelProperty("备注")
 	private String remark;
 
+	/** 用户编码 */
+	private String code;
+
 }

+ 264 - 0
zhongzheng-system/src/main/resources/mapper/modules/top/TopGoodsMapper.xml

@@ -0,0 +1,264 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.zhongzheng.modules.top.goods.mapper.TopGoodsMapper">
+
+    <resultMap type="com.zhongzheng.modules.goods.vo.TopGoodsVo" id="TopGoodsResultVo">
+        <result property="goodsId" column="goods_id"/>
+        <result property="year" column="year"/>
+        <result property="supplyId" column="supply_id"/>
+        <result property="goodsType" column="goods_type"/>
+        <result property="gradeId" column="grade_id"/>
+        <result property="educationTypeId" column="education_type_id"/>
+        <result property="businessId" column="business_id"/>
+        <result property="schoolId" column="school_id"/>
+        <result property="majorId" column="major_id"/>
+        <result property="goodsName" column="goods_name"/>
+        <result property="standPrice" column="stand_price"/>
+        <result property="lowestPrice" column="lowest_price"/>
+        <result property="createTime" column="create_time"/>
+        <result property="updateTime" column="update_time"/>
+        <result property="status" column="status"/>
+        <result property="validityStartTime" column="validity_start_time"/>
+        <result property="validityEndTime" column="validity_end_time"/>
+        <result property="studyStartTime" column="study_start_time"/>
+        <result property="studyEndTime" column="study_end_time"/>
+        <result property="certificateIds" column="certificate_ids"/>
+        <result property="introduce" column="introduce"/>
+        <result property="suitableObject" column="suitable_object"/>
+        <result property="buyNote" column="buy_note"/>
+        <result property="pcDetailHtml" column="pc_detail_html"/>
+        <result property="mobileDetailHtml" column="mobile_detail_html"/>
+        <result property="goodsStatus" column="goods_status"/>
+        <result property="coverUrl" column="cover_url"/>
+        <result property="classHours" column="class_hours"/>
+        <result property="standPriceJson" column="stand_price_json"/>
+        <result property="code" column="code"/>
+        <result property="projectId" column="project_id"/>
+        <result property="goodsAuditionConfig" column="goods_audition_config"/>
+        <result property="goodsPhotographConfig" column="goods_photograph_config"/>
+        <result property="goodsPlayConfig" column="goods_play_config"/>
+        <result property="goodsExamConfig" column="goods_exam_config"/>
+        <result property="sectionMaxNum" column="section_max_num"/>
+        <result property="specTemplateId" column="spec_template_id"/>
+        <result property="showStatus" column="show_status"/>
+        <result property="showSort" column="show_sort"/>
+        <result property="specialGoods" column="special_goods"/>
+        <result property="externalLink" column="external_link"/>
+        <result property="externalLinkStatus" column="external_link_status"/>
+
+        <result property="supplyName" column="supply_name"/>
+        <result property="educationName" column="education_name"/>
+        <result property="projectName" column="project_name"/>
+        <result property="businessName" column="business_name"/>
+        <result property="schoolName" column="school_name"/>
+        <result property="categoryName" column="category_name"/>
+        <result property="handoutsId" column="handouts_id"/>
+        <result property="period" column="period"/>
+        <result property="makeStartTime" column="make_start_time"/>
+        <result property="makeEndTime" column="make_end_time"/>
+        <result property="studyCount" column="study_count"/>
+        <result property="makeGoodsName" column="make_goods_name"/>
+        <result property="makeGoodsCode" column="make_goods_code"/>
+        <result property="courseNum" column="course_num"/>
+        <result property="sectionNum" column="section_num"/>
+        <result property="serviceTimeType" column="service_time_type"/>
+        <result property="serviceTimeNum" column="service_time_num"/>
+        <result property="gradeNum" column="grade_num"/>
+        <result property="gradeId" column="grade_id"/>
+        <result property="gradeName" column="grade_name"/>
+        <result property="examNumber" column="exam_number"/>
+        <result property="doNumber" column="do_number"/>
+        <result property="orderNum" column="order_num"/>
+        <result property="teacherId" column="teacher_id"/>
+        <result property="goodsLiveNum" column="goods_live_num"/>
+        <result property="subjectIds" column="subject_ids"/>
+        <result property="certificateTypeId" column="certificate_type_id"/>
+        <result property="certificateId" column="certificate_id"/>
+        <result property="certificateTpId" column="certificate_tp_id"/>
+        <result property="subjectNames" column="subject_names"/>
+        <result property="buyUserNum" column="buy_user_num"/>
+        <result property="chapterNum" column="chapter_num"/>
+        <result property="examNum" column="exam_num"/>
+        <result property="linePrice" column="line_price"/>
+        <result property="specTemplateNumber" column="spec_template_number"/>
+        <result property="goodsLearningOrder" column="goods_learning_order"/>
+        <result property="commitPeriodStatus" column="commit_period_status"/>
+        <result property="commitPeriodRemark" column="commit_period_remark"/>
+    </resultMap>
+
+    <select id="selectAllList" parameterType="com.zhongzheng.modules.goods.bo.GoodsQueryBo" resultMap="TopGoodsResultVo">
+        SELECT
+        g.*,
+        ps.supply_name,
+        cet.education_name,
+        cpt.project_name,
+        cb.business_name,
+        cb.goods_learning_order,
+        s.school_name,
+        m.category_name,
+        (SELECT GROUP_CONCAT(subject_name) from top_course_subject where FIND_IN_SET(id,g.subject_ids)) subject_names,
+        (SELECT COUNT( DISTINCT gar.spec_template_id ) FROM top_goods_spec_attribute_relation gar WHERE gar.goods_id =
+        g.goods_id AND gar.`status` = 1 ) spec_template_number,
+        (SELECT gs.goods_name FROM top_goods gs where 1=1 and g.make_goods_id = gs.goods_id) as make_goods_name,
+        (SELECT gs.code FROM top_goods gs where 1=1 and g.make_goods_id = gs.goods_id) as make_goods_code
+        <if test="chapterNum ==1">
+            ,(SELECT COUNT(m.id)+(SELECT COUNT(p.id) FROM top_course_module_chapter p LEFT JOIN top_course_menu m on m.menu_id =
+            p.module_id LEFT JOIN top_goods_course gc on gc.course_id = m.course_id where gc.goods_id = g.goods_id and
+            m.type in(1))+(SELECT COUNT(cmc.id) FROM top_course_module_chapter cmc LEFT JOIN top_course_menu m on m.menu_id =
+            cmc.module_id LEFT JOIN top_goods_course gc on gc.course_id = m.course_id where gc.goods_id = g.goods_id and
+            m.type in(2)) FROM top_course_menu m LEFT JOIN top_goods_course gc on gc.course_id = m.course_id where gc.goods_id =
+            g.goods_id and m.type in(3)) as chapter_num
+        </if>
+        ,(case WHEN g.goods_type =1 then (SELECT count(*) FROM top_goods_course gc LEFT JOIN top_course c on gc.course_id =
+        c.course_id where gc.goods_id =g.goods_id and c.course_show=1) ELSE 0 end) as course_num
+        <if test="getOrderNum != null and getOrderNum == 1">
+            ,ou.goods_live_num
+        </if>
+        FROM
+        goods g
+        LEFT JOIN top_pay_supply ps ON g.supply_id = ps.supply_id
+        LEFT JOIN top_course_education_type cet ON g.education_type_id = cet.id
+        LEFT JOIN top_course_project_type cpt ON g.project_id = cpt.id
+        LEFT JOIN top_course_business cb ON g.business_id = cb.id
+        LEFT JOIN top_school s ON s.id = g.school_id
+        LEFT JOIN top_major m ON g.major_id = m.id
+        WHERE
+        1 = 1
+        AND g.goods_type != 5
+        <if test="status != null and status.size()!=0 ">
+            AND g.status in
+            <foreach collection="status" item="item" index="index" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+        <if test="goodsIds != null and goodsIds.size()!=0 ">
+            AND g.goods_id in
+            <foreach collection="goodsIds" item="item" index="index" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+        <if test="goodsTypes != null and goodsTypes.size()!=0 ">
+            AND g.goods_type in
+            <foreach collection="goodsTypes" item="item" index="index" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+        <if test="goodsType != null and goodsType != ''">
+            AND g.goods_type = #{goodsType}
+        </if>
+        <if test="showStatus != null and showStatus != ''">
+            AND g.show_status = #{showStatus}
+        </if>
+        <if test="code != null and code != ''">
+            AND g.code = #{code}
+        </if>
+        <if test="makeGoodsId != null and makeGoodsId != ''">
+            AND g.make_goods_id = #{makeGoodsId}
+        </if>
+        <if test="goodsName != null and goodsName != ''">
+            AND g.goods_name like concat('%', #{goodsName}, '%')
+        </if>
+        <if test="educationTypeId != null and educationTypeId != ''">
+            AND g.education_type_id = #{educationTypeId}
+        </if>
+        <if test="projectId != null and projectId != ''">
+            AND g.project_id = #{projectId}
+        </if>
+        <if test="businessIds != null and businessIds.size()!=0 ">
+            AND g.business_id in
+            <foreach collection="businessIds" item="item" index="index" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+        <if test="businessId != null and businessId != ''">
+            AND g.business_id = #{businessId}
+        </if>
+        <if test="projectId != null and projectId != ''">
+            AND g.project_id = #{projectId}
+        </if>
+        <if test="schoolId != null and schoolId != ''">
+            AND g.school_id = #{schoolId}
+        </if>
+        <if test="majorId != null and majorId != ''">
+            AND g.major_id = #{majorId}
+        </if>
+        <if test="standPrice != null ">
+            AND g.stand_price = #{standPrice}
+        </if>
+        <if test="searchKey != null and searchKey != ''">
+            and (g.goods_name like concat('%', #{searchKey}, '%') or g.code like concat('%', #{searchKey}, '%'))
+        </if>
+        <if test="goodsStatus != null ">
+            AND g.goods_status = #{goodsStatus}
+        </if>
+        <if test="commitPeriodStatus != null ">
+            AND g.commit_period_status = #{commitPeriodStatus}
+        </if>
+        <if test="studyStartTime != null and studyStartTime != '' and studyEndTime != null and studyEndTime != ''">
+            and #{studyStartTime} BETWEEN g.validity_start_time and g.validity_end_time or #{studyEndTime} BETWEEN
+            g.validity_start_time and g.validity_end_time
+        </if>
+        <if test="validityStartTime != null or validityEndTime != null ">
+            AND (#{validityStartTime} BETWEEN g.validity_start_time and g.validity_end_time or #{validityEndTime}
+            BETWEEN g.validity_start_time and g.validity_end_time)
+        </if>
+        <if test="subjectId != null and subjectId >0">
+            AND FIND_IN_SET(#{subjectId},g.subject_ids)
+        </if>
+        <if test="subjectIdList != null and subjectIdList.size > 0 ">
+            AND (
+            <foreach collection="subjectIdList" item="item" index="index">
+                <if test=" index == 0 ">
+                    FIND_IN_SET(#{item},g.subject_ids)
+                </if>
+                <if test=" index != 0 ">
+                    OR FIND_IN_SET(#{item},g.subject_ids)
+                </if>
+            </foreach>
+            )
+        </if>
+        <if test="goodsType ==1 and haveCourse != null and haveCourse == 1">
+            AND (SELECT count(*) from top_goods_course gc LEFT JOIN top_course c ON gc.course_id = c.course_id where gc.goods_id
+            = g.goods_id and c.`status` = 1
+            ) >0
+        </if>
+        <!-- 数据范围过滤 -->
+        ${params.dataScope}
+        <if test="sortType != null and sortType == 2">
+            ORDER BY g.show_sort DESC,g.stand_price ASC
+        </if>
+        <if test="sortType != null and sortType == 3">
+            ORDER BY g.show_sort DESC,g.stand_price DESC
+        </if>
+        <if test="sortType != null and sortType == 1">
+            ORDER BY g.show_sort DESC,g.create_time DESC
+        </if>
+        <if test="sortType == null">
+            ORDER BY g.create_time DESC
+        </if>
+    </select>
+
+
+    <select id="getSectionNum" parameterType="Long" resultType="Long">
+        SELECT COUNT(m.id) + (
+            SELECT COUNT(n.id)
+            FROM top_course_chapter_section n
+                     LEFT JOIN top_course_module_chapter p ON n.chapter_id = p.chapter_id
+                     LEFT JOIN top_course_menu m ON m.menu_id = p.module_id
+                     LEFT JOIN top_goods_course gc ON gc.course_id = m.course_id
+            WHERE gc.goods_id = #{goodsId}
+              AND m.type = 1) + (
+                   SELECT COUNT(n.id)
+                   FROM top_course_chapter_section n
+                            LEFT JOIN top_course_menu m ON m.menu_id = n.chapter_id
+                            LEFT JOIN top_goods_course gc ON gc.course_id = m.course_id
+                   WHERE gc.goods_id = #{goodsId}
+                     AND m.type = 2)
+        FROM top_course_menu m
+                 LEFT JOIN top_goods_course gc ON gc.course_id = m.course_id
+        WHERE gc.goods_id = #{goodsId}
+          AND m.type = 3
+    </select>
+</mapper>

+ 54 - 0
zhongzheng-system/src/main/resources/mapper/modules/top/TopQuestionMapper.xml

@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.zhongzheng.modules.top.goods.mapper.TopQuestionMapper">
+
+    <select id="getBankGoodsExamList" parameterType="java.lang.Long" resultType="com.zhongzheng.modules.top.goods.vo.TopBankGoodsExamVo">
+        SELECT
+            ga.goods_id AS goodsId,
+            qmc.module_exam_id AS moduleExamId,
+            qce.chapter_exam_id AS chapterExamId,
+            e.exam_id AS examId,
+            e.exam_name AS examName,
+            ep.paper_name AS paperName
+        FROM
+            top_goods_attached ga
+                LEFT JOIN top_question_module_chapter qmc ON ga.major_id = qmc.module_exam_id
+                LEFT JOIN top_question_chapter_exam qce ON qmc.chapter_exam_id = qce.chapter_exam_id
+                LEFT JOIN top_exam e ON qce.exam_id = e.exam_id
+                LEFT JOIN top_exam_paper ep ON e.exam_paper_id = ep.paper_id
+        WHERE
+            ga.goods_id = #{goodsId} AND ga.type = 1
+        UNION ALL
+        SELECT
+            ga.goods_id AS goodsId,
+            0 AS moduleExamId,
+            qce.chapter_exam_id AS chapterExamId,
+            e.exam_id AS examId,
+            e.exam_name AS examName,
+            ep.paper_name AS paperName
+        FROM
+            top_goods_attached ga
+                LEFT JOIN top_question_chapter_exam qce ON ga.major_id = qce.chapter_exam_id
+                LEFT JOIN top_exam e ON qce.exam_id = e.exam_id
+                LEFT JOIN top_exam_paper ep ON e.exam_paper_id = ep.paper_id
+        WHERE
+            ga.goods_id = #{goodsId} AND ga.type = 2
+        UNION ALL
+        SELECT
+            ga.goods_id AS goodsId,
+            0 AS moduleExamId,
+            0 AS chapterExamId,
+            e.exam_id AS examId,
+            e.exam_name AS examName,
+            ep.paper_name AS paperName
+        FROM
+            top_goods_attached ga
+                LEFT JOIN top_exam e ON ga.major_id = e.exam_id
+                LEFT JOIN top_exam_paper ep ON e.exam_paper_id = ep.paper_id
+        WHERE
+            ga.goods_id = #{goodsId} AND ga.type = 3
+    </select>
+
+</mapper>