he2802 il y a 3 ans
Parent
commit
bcb6980a06
100 fichiers modifiés avec 4001 ajouts et 162 suppressions
  1. 1 0
      run-dev.sh
  2. 3 3
      zhongzheng-admin/src/main/java/com/zhongzheng/controller/bank/QuestionController.java
  3. 71 0
      zhongzheng-admin/src/main/java/com/zhongzheng/controller/common/CommonController.java
  4. 13 0
      zhongzheng-admin/src/main/java/com/zhongzheng/controller/goods/GoodsController.java
  5. 112 0
      zhongzheng-admin/src/main/java/com/zhongzheng/controller/goods/GoodsSpecAttributeController.java
  6. 108 0
      zhongzheng-admin/src/main/java/com/zhongzheng/controller/goods/GoodsSpecAttributeRelationController.java
  7. 115 0
      zhongzheng-admin/src/main/java/com/zhongzheng/controller/goods/GoodsSpecController.java
  8. 121 0
      zhongzheng-admin/src/main/java/com/zhongzheng/controller/goods/GoodsSpecTemplateController.java
  9. 10 0
      zhongzheng-admin/src/main/java/com/zhongzheng/controller/grade/ClassGradeController.java
  10. 42 0
      zhongzheng-admin/src/main/java/com/zhongzheng/controller/schedule/ScheduleController.java
  11. 3 0
      zhongzheng-admin/src/main/resources/application-dev.yml
  12. 3 0
      zhongzheng-admin/src/main/resources/application-pre.yml
  13. 3 0
      zhongzheng-admin/src/main/resources/application-prod.yml
  14. 23 31
      zhongzheng-api/src/main/java/com/zhongzheng/controller/cmmon/CommonController.java
  15. 81 0
      zhongzheng-api/src/main/java/com/zhongzheng/controller/exam/ExamActivityController.java
  16. 6 0
      zhongzheng-api/src/main/java/com/zhongzheng/controller/goods/GoodsController.java
  17. 13 0
      zhongzheng-api/src/main/java/com/zhongzheng/controller/user/UserBankRecordController.java
  18. 3 0
      zhongzheng-api/src/main/resources/application-dev.yml
  19. 3 0
      zhongzheng-api/src/main/resources/application-pre.yml
  20. 3 0
      zhongzheng-api/src/main/resources/application-prod.yml
  21. 2 14
      zhongzheng-common/src/main/java/com/zhongzheng/common/core/bo/SysUserEditBo.java
  22. 3 5
      zhongzheng-common/src/main/java/com/zhongzheng/common/utils/SmsUtils.java
  23. 29 0
      zhongzheng-common/src/main/java/com/zhongzheng/common/utils/ToolsUtils.java
  24. 2 0
      zhongzheng-framework/src/main/java/com/zhongzheng/framework/config/SecurityConfig.java
  25. 3 3
      zhongzheng-framework/src/main/java/com/zhongzheng/framework/web/service/UserServiceImpl.java
  26. 40 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/activity/service/impl/ActivityRecommendServiceImpl.java
  27. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/activity/vo/ActivityRecommendGoodsVo.java
  28. 1 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/IQuestionService.java
  29. 53 24
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/impl/QuestionServiceImpl.java
  30. 0 6
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/domain/CourseTopicGoods.java
  31. 6 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseChapterSectionServiceImpl.java
  32. 4 4
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseTopicServiceImpl.java
  33. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/bo/ExamActivityAddBo.java
  34. 13 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/bo/ExamActivityApplyBo.java
  35. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/bo/ExamActivityUpdateBo.java
  36. 14 5
      zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/bo/ExamActivityUserVo.java
  37. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/domain/ExamActivity.java
  38. 9 2
      zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/domain/ExamActivityUser.java
  39. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/service/IExamActivityService.java
  40. 117 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/service/impl/ExamActivityServiceImpl.java
  41. 3 3
      zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/service/impl/ExamApplyServiceImpl.java
  42. 31 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/vo/ExamActivityMajorVo.java
  43. 35 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/vo/ExamActivitySubjectVo.java
  44. 16 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/vo/ExamActivityVo.java
  45. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/bo/GoodsQueryBo.java
  46. 47 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/bo/GoodsSpecAddBo.java
  47. 45 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/bo/GoodsSpecAttributeAddBo.java
  48. 49 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/bo/GoodsSpecAttributeEditBo.java
  49. 54 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/bo/GoodsSpecAttributeQueryBo.java
  50. 39 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/bo/GoodsSpecAttributeRelationAddBo.java
  51. 45 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/bo/GoodsSpecAttributeRelationEditBo.java
  52. 51 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/bo/GoodsSpecAttributeRelationQueryBo.java
  53. 49 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/bo/GoodsSpecEditBo.java
  54. 54 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/bo/GoodsSpecQueryBo.java
  55. 24 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/bo/GoodsSpecTempEditBo.java
  56. 51 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/bo/GoodsSpecTemplateAddBo.java
  57. 50 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/bo/GoodsSpecTemplateEditBo.java
  58. 54 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/bo/GoodsSpecTemplateQueryBo.java
  59. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/domain/Goods.java
  60. 45 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/domain/GoodsSpec.java
  61. 45 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/domain/GoodsSpecAttribute.java
  62. 43 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/domain/GoodsSpecAttributeRelation.java
  63. 45 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/domain/GoodsSpecTemplate.java
  64. 19 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/mapper/GoodsSpecAttributeMapper.java
  65. 15 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/mapper/GoodsSpecAttributeRelationMapper.java
  66. 19 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/mapper/GoodsSpecMapper.java
  67. 14 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/mapper/GoodsSpecTemplateMapper.java
  68. 9 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/IGoodsService.java
  69. 52 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/IGoodsSpecAttributeRelationService.java
  70. 55 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/IGoodsSpecAttributeService.java
  71. 56 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/IGoodsSpecService.java
  72. 57 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/IGoodsSpecTemplateService.java
  73. 180 14
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/impl/GoodsServiceImpl.java
  74. 109 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/impl/GoodsSpecAttributeRelationServiceImpl.java
  75. 108 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/impl/GoodsSpecAttributeServiceImpl.java
  76. 119 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/impl/GoodsSpecServiceImpl.java
  77. 454 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/impl/GoodsSpecTemplateServiceImpl.java
  78. 29 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/vo/GoodsJzsChapterVo.java
  79. 27 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/vo/GoodsJzsSectionVo.java
  80. 35 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/vo/GoodsJzsVo.java
  81. 43 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/vo/GoodsSpecAttrDetailVo.java
  82. 25 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/vo/GoodsSpecAttrListVo.java
  83. 75 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/vo/GoodsSpecAttributeRelationVo.java
  84. 47 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/vo/GoodsSpecAttributeVo.java
  85. 56 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/vo/GoodsSpecTemplateVo.java
  86. 50 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/vo/GoodsSpecVo.java
  87. 5 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/vo/GoodsVo.java
  88. 22 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/bo/RollBackPeriodBo.java
  89. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/bo/UserPeriodEditBo.java
  90. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/bo/UserPeriodStatusAddBo.java
  91. 4 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/bo/UserPeriodStatusEditBo.java
  92. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/domain/UserPeriodStatus.java
  93. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/mapper/ClassGradeUserMapper.java
  94. 5 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/IUserPeriodService.java
  95. 35 31
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/impl/ClassGradeUserServiceImpl.java
  96. 248 10
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/impl/UserPeriodServiceImpl.java
  97. 40 3
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/vo/ClassPeriodChapterVo.java
  98. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/vo/ClassPeriodSectionVo.java
  99. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/vo/ClassPeriodUserVo.java
  100. 50 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/vo/SyncGoodsExport.java

+ 1 - 0
run-dev.sh

@@ -59,6 +59,7 @@ docker run \
 --link mysql:db \
 -e 'spring.profiles.active'=${profile_active} \
 -e TZ="Asia/Shanghai" \
+--add-host=gdxypx.xy.com:192.168.1.210 \
 -v /etc/localtime:/etc/localtime \
 -v /usr/share/fonts:/usr/share/fonts \
 -v /mydata/app/${app_admin_name}/logs:/var/logs \

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

@@ -227,9 +227,9 @@ public class QuestionController extends BaseController {
     @ApiOperation("导入题目Word模板列表")
     @PreAuthorize("@ss.hasPermi('system:question:import')")
     @PostMapping("/importWordQuestionList")
-    public AjaxResult<List<QuestionAddBo>> importWordQuestionList(MultipartFile file, Long eduId, Long projectId, Long businessId, Long subjectId) throws Exception
+    public AjaxResult<Map<String,Object>> importWordQuestionList(MultipartFile file, Long eduId, Long projectId, Long businessId, Long subjectId) throws Exception
     {
-        List<QuestionAddBo> list = iQuestionService.importWordQuestionList(file,  eduId,  projectId,  businessId, subjectId);
-        return AjaxResult.success(list);
+        Map<String,Object> result = iQuestionService.importWordQuestionList(file,  eduId,  projectId,  businessId, subjectId);
+        return AjaxResult.success(result);
     }
 }

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

@@ -5,11 +5,26 @@ import com.zhongzheng.common.config.RuoYiConfig;
 import com.zhongzheng.common.constant.Constants;
 import com.zhongzheng.common.core.domain.AjaxResult;
 import com.zhongzheng.common.core.domain.model.LoginBody;
+import com.zhongzheng.common.utils.ServletUtils;
+import com.zhongzheng.common.utils.ToolsUtils;
 import com.zhongzheng.common.utils.file.FileUploadUtils;
 import com.zhongzheng.common.utils.file.FileUtils;
+import com.zhongzheng.common.utils.poi.ExcelUtil;
 import com.zhongzheng.framework.config.ServerConfig;
+import com.zhongzheng.modules.course.vo.CourseMenuVo;
+import com.zhongzheng.modules.goods.bo.GoodsQueryBo;
+import com.zhongzheng.modules.goods.service.IGoodsService;
+import com.zhongzheng.modules.goods.vo.GoodsJzsVo;
+import com.zhongzheng.modules.grade.bo.RollBackPeriodBo;
+import com.zhongzheng.modules.grade.bo.UserPeriodEditBo;
+import com.zhongzheng.modules.grade.service.IUserPeriodService;
+import com.zhongzheng.modules.grade.vo.ClassPeriodStudentExportAllVo;
+import com.zhongzheng.modules.grade.vo.SyncGoodsExport;
 import com.zhongzheng.modules.order.bo.OrderAddBo;
+import com.zhongzheng.modules.order.service.IOrderService;
+import com.zhongzheng.modules.order.service.impl.OrderServiceImpl;
 import com.zhongzheng.modules.system.service.ISysUserService;
+import com.zhongzheng.modules.user.vo.UserExportVo;
 import io.swagger.annotations.ApiOperation;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -23,6 +38,8 @@ import org.springframework.web.multipart.MultipartFile;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
+import java.util.ArrayList;
+import java.util.List;
 
 /**
  * 通用请求处理
@@ -37,6 +54,12 @@ public class CommonController
     @Autowired
     private ServerConfig serverConfig;
 
+    @Autowired
+    private IGoodsService iGoodsService;
+    @Autowired
+    private IUserPeriodService iUserPeriodService;
+    @Autowired
+    private IOrderService iOrderService;
 
     /**
      * 通用下载请求
@@ -123,4 +146,52 @@ public class CommonController
             log.error("下载文件失败", e);
         }
     }
+
+    @ApiOperation("获取继教二建的商品结构列表")
+    @GetMapping("common/jzs/goodsList")
+    public AjaxResult<GoodsJzsVo> goodsList()
+    {
+        GoodsQueryBo queryBo = new GoodsQueryBo();
+        List<SyncGoodsExport> goodsJzsVoList = iGoodsService.selectRjJzsList(queryBo);
+        ExcelUtil<SyncGoodsExport> util = new ExcelUtil<SyncGoodsExport>(SyncGoodsExport.class);
+  //      ExcelUtil<SyncGoodsExport> util = new ExcelUtil<>(SyncGoodsExport.class);
+        return util.exportEasyExcel(util.exportEasyData(goodsJzsVoList), "继建商品");
+    }
+
+
+
+    @ApiOperation("测试列表")
+    @GetMapping("common/jzs/test")
+    public AjaxResult<Void> testList()
+    {
+        UserPeriodEditBo queryBo = new UserPeriodEditBo();
+        queryBo.setGoodsId(916L);
+        queryBo.setGradeId(794L);
+        queryBo.setUserId(114L);
+        iUserPeriodService.syncStudyLogToOld(queryBo);
+        return AjaxResult.success();
+    }
+
+    @ApiOperation("旧系统打回重审")
+    @PostMapping("common/rollback/period")
+    public AjaxResult<Void> rollbackPeriod(@RequestBody RollBackPeriodBo bo)
+    {
+        String sign = bo.getStamp().toString()+"pubilc2022";
+        if(!bo.getSign().equals(ToolsUtils.EncoderByMd5(sign))){
+            return AjaxResult.error("签名错误");
+        }
+        UserPeriodEditBo queryBo = new UserPeriodEditBo();
+        queryBo.setRollBackPlat(2);
+        queryBo.setOrderGoodsId(bo.getOrderGoodsId());
+        iUserPeriodService.confirmRollbackPeriod(queryBo);
+        return AjaxResult.success();
+    }
+
+   @ApiOperation("测试分班")
+    @GetMapping("common/jzs/grade")
+    public AjaxResult<Void> testGrade()
+    {
+        iOrderService.arrangeGrade("安管继续教育网络班B类",890L,3097L,null,114L,"",174L);
+        return AjaxResult.success();
+    }
 }

+ 13 - 0
zhongzheng-admin/src/main/java/com/zhongzheng/controller/goods/GoodsController.java

@@ -103,6 +103,19 @@ public class GoodsController extends BaseController {
         return getDataTable(list);
     }
 
+    @ApiOperation("获取商品规格模板列表")
+    @GetMapping("/spec/list/{goodsId}")
+    public AjaxResult<List<GoodsSpecTemplateVo>> getSpecTemplateList(@PathVariable("goodsId") Long goodsId) {
+        List<GoodsSpecTemplateVo> list = iGoodsService.getSpecTemplateList(goodsId);
+        return AjaxResult.success(list);
+    }
+
+    @ApiOperation("修改商品默认规格模板")
+    @PostMapping("/update/spec")
+    public AjaxResult<Void> updateSpecTemplate(@RequestBody GoodsSpecTempEditBo bo) {
+        return toAjax(iGoodsService.updateSpecTemplate(bo) ? 1 : 0);
+    }
+
     /**
      * 导出商品列表
      */

+ 112 - 0
zhongzheng-admin/src/main/java/com/zhongzheng/controller/goods/GoodsSpecAttributeController.java

@@ -0,0 +1,112 @@
+package com.zhongzheng.controller.goods;
+
+import java.util.List;
+import java.util.Arrays;
+
+import com.zhongzheng.modules.goods.bo.GoodsSpecAttributeAddBo;
+import com.zhongzheng.modules.goods.bo.GoodsSpecAttributeEditBo;
+import com.zhongzheng.modules.goods.bo.GoodsSpecAttributeQueryBo;
+import com.zhongzheng.modules.goods.service.IGoodsSpecAttributeService;
+import com.zhongzheng.modules.goods.vo.GoodsSpecAttributeVo;
+import lombok.RequiredArgsConstructor;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.zhongzheng.common.annotation.Log;
+import com.zhongzheng.common.core.controller.BaseController;
+import com.zhongzheng.common.core.domain.AjaxResult;
+import com.zhongzheng.common.enums.BusinessType;
+import com.zhongzheng.common.utils.poi.ExcelUtil;
+import com.zhongzheng.common.core.page.TableDataInfo;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+
+/**
+ * 【请填写功能名称】Controller
+ * 
+ * @author ruoyi
+ * @date 2022-09-29
+ */
+@Api(value = "【请填写功能名称】控制器", tags = {"【请填写功能名称】管理"})
+@RequiredArgsConstructor(onConstructor_ = @Autowired)
+@RestController
+@RequestMapping("/system/attribute")
+public class GoodsSpecAttributeController extends BaseController {
+
+    private final IGoodsSpecAttributeService iGoodsSpecAttributeService;
+
+    /**
+     * 查询【请填写功能名称】列表
+     */
+    @ApiOperation("查询【请填写功能名称】列表")
+    @PreAuthorize("@ss.hasPermi('system:attribute:list')")
+    @GetMapping("/list")
+    public TableDataInfo<GoodsSpecAttributeVo> list(GoodsSpecAttributeQueryBo bo) {
+        startPage();
+        List<GoodsSpecAttributeVo> list = iGoodsSpecAttributeService.queryList(bo);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出【请填写功能名称】列表
+     */
+    @ApiOperation("导出【请填写功能名称】列表")
+    @PreAuthorize("@ss.hasPermi('system:attribute:export')")
+    @Log(title = "【请填写功能名称】", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult<GoodsSpecAttributeVo> export(GoodsSpecAttributeQueryBo bo) {
+        List<GoodsSpecAttributeVo> list = iGoodsSpecAttributeService.queryList(bo);
+        ExcelUtil<GoodsSpecAttributeVo> util = new ExcelUtil<GoodsSpecAttributeVo>(GoodsSpecAttributeVo.class);
+        return util.exportExcel(list, "【请填写功能名称】");
+    }
+
+    /**
+     * 获取【请填写功能名称】详细信息
+     */
+    @ApiOperation("获取【请填写功能名称】详细信息")
+    @PreAuthorize("@ss.hasPermi('system:attribute:query')")
+    @GetMapping("/{specAttributeId}")
+    public AjaxResult<GoodsSpecAttributeVo> getInfo(@PathVariable("specAttributeId" ) Long specAttributeId) {
+        return AjaxResult.success(iGoodsSpecAttributeService.queryById(specAttributeId));
+    }
+
+    /**
+     * 新增【请填写功能名称】
+     */
+    @ApiOperation("新增【请填写功能名称】")
+    @PreAuthorize("@ss.hasPermi('system:attribute:add')")
+    @Log(title = "【请填写功能名称】", businessType = BusinessType.INSERT)
+    @PostMapping()
+    public AjaxResult<Void> add(@RequestBody GoodsSpecAttributeAddBo bo) {
+        return toAjax(iGoodsSpecAttributeService.insertByAddBo(bo) ? 1 : 0);
+    }
+
+    /**
+     * 修改【请填写功能名称】
+     */
+    @ApiOperation("修改【请填写功能名称】")
+    @PreAuthorize("@ss.hasPermi('system:attribute:edit')")
+    @Log(title = "【请填写功能名称】", businessType = BusinessType.UPDATE)
+    @PutMapping()
+    public AjaxResult<Void> edit(@RequestBody GoodsSpecAttributeEditBo bo) {
+        return toAjax(iGoodsSpecAttributeService.updateByEditBo(bo) ? 1 : 0);
+    }
+
+    /**
+     * 删除【请填写功能名称】
+     */
+    @ApiOperation("删除【请填写功能名称】")
+    @PreAuthorize("@ss.hasPermi('system:attribute:remove')")
+    @Log(title = "【请填写功能名称】" , businessType = BusinessType.DELETE)
+    @DeleteMapping("/{specAttributeIds}")
+    public AjaxResult<Void> remove(@PathVariable Long[] specAttributeIds) {
+        return toAjax(iGoodsSpecAttributeService.deleteWithValidByIds(Arrays.asList(specAttributeIds), true) ? 1 : 0);
+    }
+}

+ 108 - 0
zhongzheng-admin/src/main/java/com/zhongzheng/controller/goods/GoodsSpecAttributeRelationController.java

@@ -0,0 +1,108 @@
+package com.zhongzheng.controller.goods;
+
+import java.util.List;
+import java.util.Arrays;
+
+import com.zhongzheng.modules.goods.bo.GoodsSpecAttributeRelationAddBo;
+import com.zhongzheng.modules.goods.bo.GoodsSpecAttributeRelationEditBo;
+import com.zhongzheng.modules.goods.bo.GoodsSpecAttributeRelationQueryBo;
+import com.zhongzheng.modules.goods.service.IGoodsSpecAttributeRelationService;
+import com.zhongzheng.modules.goods.vo.GoodsSpecAttributeRelationVo;
+import lombok.RequiredArgsConstructor;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.zhongzheng.common.annotation.Log;
+import com.zhongzheng.common.core.controller.BaseController;
+import com.zhongzheng.common.core.domain.AjaxResult;
+import com.zhongzheng.common.enums.BusinessType;
+import com.zhongzheng.common.utils.poi.ExcelUtil;
+import com.zhongzheng.common.core.page.TableDataInfo;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+
+/**
+ * 【请填写功能名称】Controller
+ * 
+ * @author ruoyi
+ * @date 2022-09-29
+ */
+@Api(value = "规格属性关联控制器", tags = {"规格属性关联管理"})
+@RequiredArgsConstructor(onConstructor_ = @Autowired)
+@RestController
+@RequestMapping("/system/relation")
+public class GoodsSpecAttributeRelationController extends BaseController {
+
+    private final IGoodsSpecAttributeRelationService iGoodsSpecAttributeRelationService;
+
+    /**
+     * 查询【请填写功能名称】列表
+     */
+    @ApiOperation("查询【请填写功能名称】列表")
+    @PreAuthorize("@ss.hasPermi('system:relation:list')")
+    @GetMapping("/list")
+    public TableDataInfo<GoodsSpecAttributeRelationVo> list(GoodsSpecAttributeRelationQueryBo bo) {
+        startPage();
+        List<GoodsSpecAttributeRelationVo> list = iGoodsSpecAttributeRelationService.queryList(bo);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出【请填写功能名称】列表
+     */
+    @ApiOperation("导出【请填写功能名称】列表")
+    @PreAuthorize("@ss.hasPermi('system:relation:export')")
+    @Log(title = "【请填写功能名称】", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult<GoodsSpecAttributeRelationVo> export(GoodsSpecAttributeRelationQueryBo bo) {
+        List<GoodsSpecAttributeRelationVo> list = iGoodsSpecAttributeRelationService.queryList(bo);
+        ExcelUtil<GoodsSpecAttributeRelationVo> util = new ExcelUtil<GoodsSpecAttributeRelationVo>(GoodsSpecAttributeRelationVo.class);
+        return util.exportExcel(list, "【请填写功能名称】");
+    }
+
+    /**
+     * 获取【请填写功能名称】详细信息
+     */
+    @ApiOperation("获取【请填写功能名称】详细信息")
+    @PreAuthorize("@ss.hasPermi('system:relation:query')")
+    @GetMapping("/{id}")
+    public AjaxResult<GoodsSpecAttributeRelationVo> getInfo(@PathVariable("id" ) Long id) {
+        return AjaxResult.success(iGoodsSpecAttributeRelationService.queryById(id));
+    }
+
+    /**
+     * 新增规格属性关联
+     */
+    @ApiOperation("新增规格属性关联")
+    @PostMapping()
+    public AjaxResult<Void> add(@RequestBody GoodsSpecAttributeRelationAddBo bo) {
+        return toAjax(iGoodsSpecAttributeRelationService.insertByAddBo(bo) ? 1 : 0);
+    }
+
+    /**
+     * 修改规格属性关联
+     */
+    @ApiOperation("修改规格属性关联")
+    @PostMapping("/edit")
+    public AjaxResult<Void> edit(@RequestBody GoodsSpecAttributeRelationEditBo bo) {
+        return toAjax(iGoodsSpecAttributeRelationService.updateByEditBo(bo) ? 1 : 0);
+    }
+
+    /**
+     * 删除【请填写功能名称】
+     */
+    @ApiOperation("删除【请填写功能名称】")
+    @PreAuthorize("@ss.hasPermi('system:relation:remove')")
+    @Log(title = "【请填写功能名称】" , businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    public AjaxResult<Void> remove(@PathVariable Long[] ids) {
+        return toAjax(iGoodsSpecAttributeRelationService.deleteWithValidByIds(Arrays.asList(ids), true) ? 1 : 0);
+    }
+}

+ 115 - 0
zhongzheng-admin/src/main/java/com/zhongzheng/controller/goods/GoodsSpecController.java

@@ -0,0 +1,115 @@
+package com.zhongzheng.controller.goods;
+
+import java.util.List;
+import java.util.Arrays;
+
+import com.zhongzheng.modules.goods.bo.GoodsSpecAddBo;
+import com.zhongzheng.modules.goods.bo.GoodsSpecEditBo;
+import com.zhongzheng.modules.goods.bo.GoodsSpecQueryBo;
+import com.zhongzheng.modules.goods.service.IGoodsSpecService;
+import com.zhongzheng.modules.goods.vo.GoodsSpecAttrDetailVo;
+import com.zhongzheng.modules.goods.vo.GoodsSpecVo;
+import lombok.RequiredArgsConstructor;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.zhongzheng.common.annotation.Log;
+import com.zhongzheng.common.core.controller.BaseController;
+import com.zhongzheng.common.core.domain.AjaxResult;
+import com.zhongzheng.common.enums.BusinessType;
+import com.zhongzheng.common.utils.poi.ExcelUtil;
+import com.zhongzheng.common.core.page.TableDataInfo;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+
+/**
+ * 【请填写功能名称】Controller
+ * 
+ * @author ruoyi
+ * @date 2022-09-29
+ */
+@Api(value = "【请填写功能名称】控制器", tags = {"【请填写功能名称】管理"})
+@RequiredArgsConstructor(onConstructor_ = @Autowired)
+@RestController
+@RequestMapping("/system/spec")
+public class GoodsSpecController extends BaseController {
+
+    private final IGoodsSpecService iGoodsSpecService;
+
+    /**
+     * 查询【请填写功能名称】列表
+     */
+    @ApiOperation("查询【请填写功能名称】列表")
+    @PreAuthorize("@ss.hasPermi('system:spec:list')")
+    @GetMapping("/list")
+    public TableDataInfo<GoodsSpecVo> list(GoodsSpecQueryBo bo) {
+        startPage();
+        List<GoodsSpecVo> list = iGoodsSpecService.queryList(bo);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出【请填写功能名称】列表
+     */
+    @ApiOperation("导出【请填写功能名称】列表")
+    @PreAuthorize("@ss.hasPermi('system:spec:export')")
+    @Log(title = "【请填写功能名称】", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult<GoodsSpecVo> export(GoodsSpecQueryBo bo) {
+        List<GoodsSpecVo> list = iGoodsSpecService.queryList(bo);
+        ExcelUtil<GoodsSpecVo> util = new ExcelUtil<GoodsSpecVo>(GoodsSpecVo.class);
+        return util.exportExcel(list, "【请填写功能名称】");
+    }
+
+    /**
+     * 获取【请填写功能名称】详细信息
+     */
+    @ApiOperation("获取【请填写功能名称】详细信息")
+    @PreAuthorize("@ss.hasPermi('system:spec:query')")
+    @GetMapping("/{specId}")
+    public AjaxResult<GoodsSpecVo> getInfo(@PathVariable("specId" ) Long specId) {
+        return AjaxResult.success(iGoodsSpecService.queryById(specId));
+    }
+
+    /**
+     * 新增【请填写功能名称】
+     */
+    @ApiOperation("新增【请填写功能名称】")
+    @PreAuthorize("@ss.hasPermi('system:spec:add')")
+    @Log(title = "【请填写功能名称】", businessType = BusinessType.INSERT)
+    @PostMapping()
+    public AjaxResult<Void> add(@RequestBody GoodsSpecAddBo bo) {
+        return toAjax(iGoodsSpecService.insertByAddBo(bo) ? 1 : 0);
+    }
+
+
+
+    /**
+     * 修改【请填写功能名称】
+     */
+    @ApiOperation("修改【请填写功能名称】")
+    @PreAuthorize("@ss.hasPermi('system:spec:edit')")
+    @Log(title = "【请填写功能名称】", businessType = BusinessType.UPDATE)
+    @PutMapping()
+    public AjaxResult<Void> edit(@RequestBody GoodsSpecEditBo bo) {
+        return toAjax(iGoodsSpecService.updateByEditBo(bo) ? 1 : 0);
+    }
+
+    /**
+     * 删除【请填写功能名称】
+     */
+    @ApiOperation("删除【请填写功能名称】")
+    @PreAuthorize("@ss.hasPermi('system:spec:remove')")
+    @Log(title = "【请填写功能名称】" , businessType = BusinessType.DELETE)
+    @DeleteMapping("/{specIds}")
+    public AjaxResult<Void> remove(@PathVariable Long[] specIds) {
+        return toAjax(iGoodsSpecService.deleteWithValidByIds(Arrays.asList(specIds), true) ? 1 : 0);
+    }
+}

+ 121 - 0
zhongzheng-admin/src/main/java/com/zhongzheng/controller/goods/GoodsSpecTemplateController.java

@@ -0,0 +1,121 @@
+package com.zhongzheng.controller.goods;
+
+import java.util.List;
+import java.util.Arrays;
+
+import com.zhongzheng.modules.goods.bo.GoodsSpecAddBo;
+import com.zhongzheng.modules.goods.bo.GoodsSpecTemplateAddBo;
+import com.zhongzheng.modules.goods.bo.GoodsSpecTemplateEditBo;
+import com.zhongzheng.modules.goods.bo.GoodsSpecTemplateQueryBo;
+import com.zhongzheng.modules.goods.service.IGoodsSpecTemplateService;
+import com.zhongzheng.modules.goods.vo.GoodsSpecAttrDetailVo;
+import com.zhongzheng.modules.goods.vo.GoodsSpecAttrListVo;
+import com.zhongzheng.modules.goods.vo.GoodsSpecAttributeRelationVo;
+import com.zhongzheng.modules.goods.vo.GoodsSpecTemplateVo;
+import lombok.RequiredArgsConstructor;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.zhongzheng.common.annotation.Log;
+import com.zhongzheng.common.core.controller.BaseController;
+import com.zhongzheng.common.core.domain.AjaxResult;
+import com.zhongzheng.common.enums.BusinessType;
+import com.zhongzheng.common.utils.poi.ExcelUtil;
+import com.zhongzheng.common.core.page.TableDataInfo;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+
+/**
+ * 【请填写功能名称】Controller
+ * 
+ * @author ruoyi
+ * @date 2022-09-29
+ */
+@Api(value = "规格模板控制器", tags = {"规格模板管理"})
+@RequiredArgsConstructor(onConstructor_ = @Autowired)
+@RestController
+@RequestMapping("/system/template")
+public class GoodsSpecTemplateController extends BaseController {
+
+    private final IGoodsSpecTemplateService iGoodsSpecTemplateService;
+
+    /**
+     * 查询模板列表
+     */
+    @ApiOperation("查询模板列表")
+    @GetMapping("/list")
+    public TableDataInfo<GoodsSpecTemplateVo> list(GoodsSpecTemplateQueryBo bo) {
+        startPage();
+        List<GoodsSpecTemplateVo> list = iGoodsSpecTemplateService.queryList(bo);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出【请填写功能名称】列表
+     */
+    @ApiOperation("导出【请填写功能名称】列表")
+    @PreAuthorize("@ss.hasPermi('system:template:export')")
+    @Log(title = "【请填写功能名称】", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult<GoodsSpecTemplateVo> export(GoodsSpecTemplateQueryBo bo) {
+        List<GoodsSpecTemplateVo> list = iGoodsSpecTemplateService.queryList(bo);
+        ExcelUtil<GoodsSpecTemplateVo> util = new ExcelUtil<GoodsSpecTemplateVo>(GoodsSpecTemplateVo.class);
+        return util.exportExcel(list, "【请填写功能名称】");
+    }
+
+    /**
+     * 获取规格模板详细信息
+     */
+    @ApiOperation("获取规格模板详细信息")
+    @GetMapping("/detail/{specTemplateId}")
+    public AjaxResult<GoodsSpecTemplateVo> getInfo(@PathVariable("specTemplateId" ) Long specTemplateId) {
+        return AjaxResult.success(iGoodsSpecTemplateService.queryById(specTemplateId));
+    }
+
+    /**
+     * 新增【请填写功能名称】
+     */
+    @ApiOperation("新增【请填写功能名称】")
+    @PreAuthorize("@ss.hasPermi('system:template:add')")
+    @Log(title = "【请填写功能名称】", businessType = BusinessType.INSERT)
+    @PostMapping()
+    public AjaxResult<Void> add(@RequestBody GoodsSpecTemplateAddBo bo) {
+        return toAjax(iGoodsSpecTemplateService.insertByAddBo(bo) ? 1 : 0);
+    }
+
+    /**
+     * 新增规格模板
+     */
+    @ApiOperation("新增规格模板")
+    @PostMapping("/addSpec")
+    public AjaxResult<List<GoodsSpecAttributeRelationVo>> addSpec(@RequestBody GoodsSpecTemplateAddBo bo) {
+        List<GoodsSpecAttributeRelationVo> vo = iGoodsSpecTemplateService.addSpec(bo);
+        return AjaxResult.success(vo);
+    }
+
+    /**
+     * 修改规格模板
+     */
+    @ApiOperation("修改规格模板")
+    @PostMapping("/edit")
+    public AjaxResult<List<GoodsSpecAttributeRelationVo>> edit(@RequestBody GoodsSpecTemplateEditBo bo) {
+        List<GoodsSpecAttributeRelationVo> vo = iGoodsSpecTemplateService.updateByEditBo(bo);
+        return AjaxResult.success(vo);
+    }
+
+    /**
+     * 删除规格模板
+     */
+    @ApiOperation("删除规格模板")
+    @GetMapping("/del/{specTemplateId}")
+    public AjaxResult<Void> remove(@PathVariable Long specTemplateId) {
+        return toAjax(iGoodsSpecTemplateService.deleteWithValidByIds(specTemplateId,false) ? 1 : 0);
+    }
+}

+ 10 - 0
zhongzheng-admin/src/main/java/com/zhongzheng/controller/grade/ClassGradeController.java

@@ -16,6 +16,7 @@ import com.zhongzheng.common.core.domain.entity.SysRole;
 import com.zhongzheng.common.core.redis.RedisCache;
 import com.zhongzheng.common.utils.SecurityUtils;
 import com.zhongzheng.common.utils.ServletUtils;
+import com.zhongzheng.common.utils.ToolsUtils;
 import com.zhongzheng.modules.base.bo.UserProfileQueryBo;
 import com.zhongzheng.modules.base.vo.UserProfileExportGaiVo;
 import com.zhongzheng.modules.grade.bo.*;
@@ -607,4 +608,13 @@ public class ClassGradeController extends BaseController {
     public AjaxResult<Void> OpenQdyAccount() {
         return toAjax(iClassGradeService.sendCode() ? 1 : 0);
     }
+
+    @ApiOperation("二审打回重审")
+    @PostMapping("/confirm/rollbackPeriod")
+    public AjaxResult<Void> confirmRollbackPeriod(@RequestBody UserPeriodEditBo bo)
+    {
+        bo.setRollBackPlat(1);
+        iUserPeriodService.confirmRollbackPeriod(bo);
+        return AjaxResult.success();
+    }
 }

+ 42 - 0
zhongzheng-admin/src/main/java/com/zhongzheng/controller/schedule/ScheduleController.java

@@ -261,6 +261,27 @@ public class ScheduleController extends BaseController {
         return AjaxResult.success();
     }
 
+    @ApiOperation("学生购买15天未学习提醒")
+    @GetMapping("/buyNotReadToStudentFifteen")
+    public AjaxResult buyNotReadToStudentFifteen(UserQueryBo bo){
+        iScheduleService.buyNotReadToStudentFifteen(bo);
+        return AjaxResult.success();
+    }
+
+    @ApiOperation("学生购买30天未学习提醒")
+    @GetMapping("/buyNotReadToStudentThirty")
+    public AjaxResult buyNotReadToStudentThirty(UserQueryBo bo){
+        iScheduleService.buyNotReadToStudentThirty(bo);
+        return AjaxResult.success();
+    }
+
+    @ApiOperation("学生购买55天未学习提醒")
+    @GetMapping("/buyNotReadToStudentFiftyFive")
+    public AjaxResult buyNotReadToStudentFiftyFive(UserQueryBo bo){
+        iScheduleService.buyNotReadToStudentFiftyFive(bo);
+        return AjaxResult.success();
+    }
+
     @ApiOperation("学生购买7天未学习教务提醒")
     @GetMapping("/buyNotReadToTeacher")
     public AjaxResult buyNotReadToTeacher(UserQueryBo bo){
@@ -268,6 +289,27 @@ public class ScheduleController extends BaseController {
         return AjaxResult.success();
     }
 
+    @ApiOperation("学生购买15天未学习教务提醒")
+    @GetMapping("/buyNotReadToTeacherFifteen")
+    public AjaxResult buyNotReadToTeacherFifteen(UserQueryBo bo){
+        iScheduleService.buyNotReadToTeacherFifteen(bo);
+        return AjaxResult.success();
+    }
+
+    @ApiOperation("学生购买30天未学习教务提醒")
+    @GetMapping("/buyNotReadToTeacherThirty")
+    public AjaxResult buyNotReadToTeacherThirty(UserQueryBo bo){
+        iScheduleService.buyNotReadToTeacherThirty(bo);
+        return AjaxResult.success();
+    }
+
+    @ApiOperation("学生购买55天未学习教务提醒")
+    @GetMapping("/buyNotReadToTeacherFiftyFive")
+    public AjaxResult buyNotReadToTeacherFiftyFive(UserQueryBo bo){
+        iScheduleService.buyNotReadToTeacherFiftyFive(bo);
+        return AjaxResult.success();
+    }
+
     @ApiOperation("学生长时间3天未学习提醒")
     @GetMapping("/longNotReadToStudentThree")
     public AjaxResult longNotReadToStudentThree(UserQueryBo bo){

+ 3 - 0
zhongzheng-admin/src/main/resources/application-dev.yml

@@ -132,6 +132,9 @@ liveGotoURL: http://120.79.166.78:19014/
 
 enCodeVersion: develop
 
+oldStudySys:
+    syncPath: http://gdxypx.xy.com/System/BussinessApi/PostUserStudyRecords
+
 officialPush:
     infoPath: http://jypt-dev.gdcic.net/organjxjy/ShangBaoMingdan
     periodPath: http://jypt-dev.gdcic.net/organjxjy/XueshiShenqing

+ 3 - 0
zhongzheng-admin/src/main/resources/application-pre.yml

@@ -132,6 +132,9 @@ liveGotoURL: http://120.79.166.78:19010/
 
 enCodeVersion: trial
 
+oldStudySys:
+    syncPath: http://test.jqbao.net/System/BussinessApi/PostUserStudyRecords
+
 officialPush:
     infoPath: http://jypt-dev.gdcic.net/organjxjy/ShangBaoMingdan
     periodPath: http://jypt-dev.gdcic.net/organjxjy/XueshiShenqing

+ 3 - 0
zhongzheng-admin/src/main/resources/application-prod.yml

@@ -132,6 +132,9 @@ liveGotoURL: https://web.xyyxt.net/
 
 enCodeVersion: release
 
+oldStudySys:
+    syncPath: https://www.xyyxt.net/System/BussinessApi/PostUserStudyRecords
+
 officialPush:
     infoPath: http://jypt-dev.gdcic.net/organjxjy/ShangBaoMingdan
     periodPath: http://jypt-dev.gdcic.net/organjxjy/XueshiShenqing

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

@@ -21,6 +21,8 @@ import com.zhongzheng.modules.exam.bo.ExamActivityApplyBo;
 import com.zhongzheng.modules.exam.bo.ExamActivityApplyVo;
 import com.zhongzheng.modules.exam.service.IExamActivityService;
 import com.zhongzheng.modules.exam.vo.ExamActivityVo;
+import com.zhongzheng.modules.goods.service.IGoodsSpecTemplateService;
+import com.zhongzheng.modules.goods.vo.GoodsSpecTemplateVo;
 import com.zhongzheng.modules.goods.vo.GoodsUserVo;
 import com.zhongzheng.modules.goods.vo.GoodsVo;
 import com.zhongzheng.modules.order.domain.Printer;
@@ -57,10 +59,10 @@ public class CommonController extends BaseController {
     @Autowired
     private RedisCache redisCache;
 
-    private final IExamActivityService iExamActivityService;
-
     private final ICourseTopicService iCourseTopicService;
 
+    private final IGoodsSpecTemplateService iGoodsSpecTemplateService;
+
     /**
      * 获取商品专题页指定商品信息
      */
@@ -70,6 +72,25 @@ public class CommonController extends BaseController {
         return AjaxResult.success(iCourseTopicService.getGoodsInfo(topicId));
     }
 
+    /**
+     * 获取商品规格模板信息
+     */
+    @ApiOperation("获取商品规格模板信息")
+    @GetMapping("/spec/{specTemplateId}")
+    public AjaxResult<GoodsSpecTemplateVo> getSpecTemplate(@PathVariable("specTemplateId")Long specTemplateId) {
+        return AjaxResult.success(iGoodsSpecTemplateService.queryById(specTemplateId));
+    }
+
+    /**
+     * 获取规格属性值对应的商品信息
+     */
+    @ApiOperation("获取规格属性值对应的商品信息")
+    @GetMapping("/attr/goods")
+    public AjaxResult<GoodsVo> getSpecTemplate(@RequestParam("specTemplateId")Long specTemplateId,@RequestParam("specAttrIds")String specAttrIds) {
+        GoodsVo vo = iGoodsSpecTemplateService.getSpecTemplate(specTemplateId,specAttrIds);
+        return AjaxResult.success(vo);
+    }
+
     /**
      * 获取专题页组合班级商品
      */
@@ -111,36 +132,7 @@ public class CommonController extends BaseController {
         return AjaxResult.success(Printer.num);
     }
 
-    /**
-     * 获取活动信息
-     */
-    @ApiOperation("获取活动信息")
-    @GetMapping("/detail/{activityId}")
-    public AjaxResult<ExamActivityVo> getDetail(@PathVariable("activityId" ) Long activityId) {
-        ExamActivityVo vo = iExamActivityService.getDetail(activityId);
-        return AjaxResult.success(vo);
-    }
-
-    /**
-     * 考试活动报名
-     */
-    @ApiOperation("考试活动报名")
-    @PostMapping("/launch")
-    public AjaxResult<ExamActivityApplyVo> applyActivity(@RequestBody ExamActivityApplyBo bo) {
-        ExamActivityApplyVo vo = iExamActivityService.applyActivity(bo);
-        return AjaxResult.success(vo);
-    }
 
-    /**
-     * 获取考试活动商品
-     */
-    @ApiOperation("获取考试活动商品")
-    @GetMapping("/activity/goodsList/{activityId}")
-    public TableDataInfo<GoodsVo> getActivityGoodsList(@PathVariable("activityId") Long activityId) {
-        startPage();
-        List<GoodsVo> voList = iExamActivityService.getActivityGoodsList(activityId);
-        return getDataTable(voList);
-    }
 
     @ApiOperation("小程序配置")
     @GetMapping("/config")

+ 81 - 0
zhongzheng-api/src/main/java/com/zhongzheng/controller/exam/ExamActivityController.java

@@ -0,0 +1,81 @@
+package com.zhongzheng.controller.exam;
+
+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.utils.ServletUtils;
+import com.zhongzheng.framework.web.service.WxTokenService;
+import com.zhongzheng.modules.exam.bo.ExamActivityApplyBo;
+import com.zhongzheng.modules.exam.bo.ExamActivityApplyVo;
+import com.zhongzheng.modules.exam.service.IExamActivityService;
+import com.zhongzheng.modules.exam.vo.ExamActivityVo;
+import com.zhongzheng.modules.goods.vo.GoodsVo;
+import com.zhongzheng.modules.user.entity.ClientLoginUser;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.RequiredArgsConstructor;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 考试安排Controller
+ *
+ * @author ruoyi
+ * @date 2021-12-07
+ */
+@Api(value = "模考活动", tags = {"模考活动"})
+@RequiredArgsConstructor(onConstructor_ = @Autowired)
+@RestController
+@RequestMapping("/apply/activity")
+public class ExamActivityController extends BaseController {
+
+    private final IExamActivityService iExamActivityService;
+
+    private final WxTokenService wxTokenService;
+
+    /**
+     * 获取活动信息
+     */
+    @ApiOperation("获取活动信息")
+    @GetMapping("/detail/{activityId}")
+    public AjaxResult<ExamActivityVo> getDetail(@PathVariable("activityId" ) Long activityId) {
+        ExamActivityVo vo = iExamActivityService.getDetail(activityId);
+        return AjaxResult.success(vo);
+    }
+
+    /**
+     * 考试活动报名
+     */
+    @ApiOperation("考试活动报名")
+    @PostMapping("/launch")
+    public AjaxResult<ExamActivityApplyVo> applyActivity(@RequestBody ExamActivityApplyBo bo) {
+        ClientLoginUser loginUser = wxTokenService.getLoginUser(ServletUtils.getRequest());
+        bo.setUserId(loginUser.getUser().getUserId());
+        ExamActivityApplyVo vo = iExamActivityService.applyActivity(bo);
+        return AjaxResult.success(vo);
+    }
+
+    /**
+     * 获取考试活动商品
+     */
+    @ApiOperation("获取考试活动商品")
+    @GetMapping("/activity/goodsList/{activityId}")
+    public TableDataInfo<GoodsVo> getActivityGoodsList(@PathVariable("activityId") Long activityId) {
+        startPage();
+        List<GoodsVo> voList = iExamActivityService.getActivityGoodsList(activityId);
+        return getDataTable(voList);
+    }
+
+    /**
+     * 校验用户是否已报名
+     */
+    @ApiOperation("校验用户是否已报名")
+    @GetMapping("/check/{activityId}")
+    public AjaxResult<Boolean> checkUserActivityStatus(@PathVariable("activityId") Long activityId) {
+        ClientLoginUser loginUser = wxTokenService.getLoginUser(ServletUtils.getRequest());
+        return AjaxResult.success(iExamActivityService.checkUserActivityStatus(loginUser.getUser().getUserId(),activityId));
+
+    }
+}

+ 6 - 0
zhongzheng-api/src/main/java/com/zhongzheng/controller/goods/GoodsController.java

@@ -24,7 +24,9 @@ import com.zhongzheng.modules.course.vo.CourseSectionVo;
 import com.zhongzheng.modules.goods.bo.*;
 import com.zhongzheng.modules.goods.service.IGoodsAttachedService;
 import com.zhongzheng.modules.goods.service.IGoodsService;
+import com.zhongzheng.modules.goods.service.IGoodsSpecTemplateService;
 import com.zhongzheng.modules.goods.vo.GoodsAttachedVo;
+import com.zhongzheng.modules.goods.vo.GoodsSpecTemplateVo;
 import com.zhongzheng.modules.goods.vo.GoodsVo;
 import com.zhongzheng.modules.grade.bo.UserPeriodQueryBo;
 import com.zhongzheng.modules.grade.service.IUserPeriodService;
@@ -83,6 +85,8 @@ public class GoodsController extends BaseController {
 
     private final IOrderGoodsFreeService iOrderGoodsFreeService;
 
+
+
     /**
      * 获取商品详细信息
      */
@@ -248,4 +252,6 @@ public class GoodsController extends BaseController {
         List<CourseLiveVo> list = iOrderGoodsService.getLiveList(loginUser.getUser().getUserId());
         return getDataTable(list);
     }
+
+
 }

+ 13 - 0
zhongzheng-api/src/main/java/com/zhongzheng/controller/user/UserBankRecordController.java

@@ -64,6 +64,19 @@ public class UserBankRecordController extends BaseController {
         return getDataTable(list);
     }
 
+    /**
+     * 查询用户的做题历史列表
+     */
+    @ApiOperation("视频商品查询用户的做题历史列表")
+    @GetMapping("/bankList")
+    public TableDataInfo<UserBankRecordVo> getUserBankList(UserBankRecordQueryBo bo) {
+        startPage();
+        ClientLoginUser loginUser = wxTokenService.getLoginUser(ServletUtils.getRequest());
+        bo.setUserId(loginUser.getUser().getUserId());
+        List<UserBankRecordVo> list = iUserBankRecordService.getUserBankList(bo);
+        return getDataTable(list);
+    }
+
     /**
      * 修改用户的做题历史
      */

+ 3 - 0
zhongzheng-api/src/main/resources/application-dev.yml

@@ -133,6 +133,9 @@ liveGotoURL: http://120.79.166.78:19014/
 
 enCodeVersion: develop
 
+oldStudySys:
+    syncPath: http://gdxypx.xy.com/System/PostUserStudyRecords
+
 officialPush:
     infoPath: http://jypt-dev.gdcic.net/organjxjy/ShangBaoMingdan
     periodPath: http://jypt-dev.gdcic.net/organjxjy/XueshiShenqing

+ 3 - 0
zhongzheng-api/src/main/resources/application-pre.yml

@@ -132,6 +132,9 @@ liveGotoURL: http://120.79.166.78:19010/
 
 enCodeVersion: trial
 
+oldStudySys:
+    syncPath: http://test.jqbao.net/System/PostUserStudyRecords
+
 officialPush:
     infoPath: http://jypt-dev.gdcic.net/organjxjy/ShangBaoMingdan
     periodPath: http://jypt-dev.gdcic.net/organjxjy/XueshiShenqing

+ 3 - 0
zhongzheng-api/src/main/resources/application-prod.yml

@@ -144,6 +144,9 @@ liveGotoURL: https://web.xyyxt.net/
 
 enCodeVersion: release
 
+oldStudySys:
+    syncPath: https://www.xyyxt.net/System/PostUserStudyRecords
+
 officialPush:
     infoPath: http://jypt-dev.gdcic.net/organjxjy/ShangBaoMingdan
     periodPath: http://jypt-dev.gdcic.net/organjxjy/XueshiShenqing

+ 2 - 14
zhongzheng-common/src/main/java/com/zhongzheng/common/core/bo/SysUserEditBo.java

@@ -1,29 +1,17 @@
 package com.zhongzheng.common.core.bo;
 
-import com.baomidou.mybatisplus.annotation.*;
-import com.fasterxml.jackson.annotation.JsonFormat;
-import com.fasterxml.jackson.annotation.JsonIgnore;
-import com.fasterxml.jackson.annotation.JsonProperty;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
 import com.zhongzheng.common.annotation.Excel;
 import com.zhongzheng.common.annotation.Excel.ColumnType;
 import com.zhongzheng.common.annotation.Excel.Type;
-import com.zhongzheng.common.annotation.Excels;
-import com.zhongzheng.common.core.domain.entity.SysDept;
-import com.zhongzheng.common.core.domain.entity.SysRole;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
-import lombok.NoArgsConstructor;
-import lombok.experimental.Accessors;
 
 import javax.validation.constraints.Email;
 import javax.validation.constraints.NotBlank;
 import javax.validation.constraints.Size;
-import java.io.Serializable;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
 
 /**
  * 用户对象 SysUserEditBo

+ 3 - 5
zhongzheng-common/src/main/java/com/zhongzheng/common/utils/SmsUtils.java

@@ -1,10 +1,8 @@
 package com.zhongzheng.common.utils;
 
-import com.aliyun.tea.*;
-import com.aliyun.dysmsapi20170525.*;
-import com.aliyun.dysmsapi20170525.models.*;
-import com.aliyun.teaopenapi.*;
-import com.aliyun.teaopenapi.models.*;
+import com.aliyun.dysmsapi20170525.models.SendSmsRequest;
+import com.aliyun.dysmsapi20170525.models.SendSmsResponse;
+import com.aliyun.teaopenapi.models.Config;
 
 public class SmsUtils {
     //产品名称:云通信短信API产品,开发者无需替换

+ 29 - 0
zhongzheng-common/src/main/java/com/zhongzheng/common/utils/ToolsUtils.java

@@ -280,5 +280,34 @@ public class ToolsUtils {
         return result;
     }
 
+    public static String EncoderByMd5(String str) {
+        String result = "";
+        MessageDigest md5 = null;
+        try {
+            md5 = MessageDigest.getInstance("MD5");
+            // 这句是关键
+            md5.update(str.getBytes("gb2312"));
+        } catch (NoSuchAlgorithmException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        } catch (UnsupportedEncodingException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+        byte b[] = md5.digest();
+        int i;
+        StringBuffer buf = new StringBuffer("");
+        for (int offset = 0; offset < b.length; offset++) {
+            i = b[offset];
+            if (i < 0)
+                i += 256;
+            if (i < 16)
+                buf.append("0");
+            buf.append(Integer.toHexString(i));
+        }
+        result = buf.toString();
+
+        return result;
+    }
 
 }

+ 2 - 0
zhongzheng-framework/src/main/java/com/zhongzheng/framework/config/SecurityConfig.java

@@ -123,6 +123,8 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
                 .antMatchers("/refreshToken/**").anonymous()
                 .antMatchers("/v1/test/**").anonymous()
                 .antMatchers("/profile/**").anonymous()
+                .antMatchers("/common/jzs/**").anonymous()
+                .antMatchers("/common/rollback/period").anonymous()
                 .antMatchers("/common/download**").anonymous()
                 .antMatchers("/common/download/resource**").anonymous()
                 .antMatchers("/swagger-ui.html").anonymous()

+ 3 - 3
zhongzheng-framework/src/main/java/com/zhongzheng/framework/web/service/UserServiceImpl.java

@@ -732,11 +732,11 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
                 errorList.add(itemImport);
                 continue;
             }
-            if(Validator.isEmpty(itemImport.getIdCard())){
+           /* if(Validator.isEmpty(itemImport.getIdCard())){
                 itemImport.setCause("身份证不能为空");
                 errorList.add(itemImport);
                 continue;
-            }
+            }*/
             if(Validator.isEmpty(itemImport.getRealname())){
                 itemImport.setCause("真实姓名不能为空");
                 errorList.add(itemImport);
@@ -759,7 +759,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
             User user = getOne(new LambdaQueryWrapper<User>()
                     .eq(User::getTelphone,itemImport.getTelphone()).last("limit 1"));
             if(Validator.isNotNull(user)){
-                if(Validator.isNotEmpty(user.getIdCard())&&!itemImport.getIdCard().equals(user.getIdCard())){
+                if(Validator.isNotEmpty(user.getIdCard())&&Validator.isNotEmpty(itemImport.getIdCard())&&!itemImport.getIdCard().equals(user.getIdCard())){
                     throw new CustomException(itemImport.getRealname()+"身份证号码不一致");
                 }
                 if(Validator.isEmpty(user.getIdCard())){

+ 40 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/activity/service/impl/ActivityRecommendServiceImpl.java

@@ -20,7 +20,9 @@ import com.zhongzheng.modules.activity.service.IActivityRecommendService;
 import com.zhongzheng.modules.activity.vo.ActivityRecommendGoodsVo;
 import com.zhongzheng.modules.activity.vo.ActivityRecommendVo;
 import com.zhongzheng.modules.goods.domain.Goods;
+import com.zhongzheng.modules.goods.domain.GoodsSpecAttributeRelation;
 import com.zhongzheng.modules.goods.service.IGoodsService;
+import com.zhongzheng.modules.goods.service.IGoodsSpecAttributeRelationService;
 import com.zhongzheng.modules.goods.vo.GoodsVo;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -43,6 +45,8 @@ public class ActivityRecommendServiceImpl extends ServiceImpl<ActivityRecommendM
     private IActivityRecommendGoodsService iActivityRecommendGoodsService;
     @Autowired
     private IGoodsService iGoodsService;
+    @Autowired
+    private IGoodsSpecAttributeRelationService goodsSpecAttributeRelationService;
 
 
     @Override
@@ -111,7 +115,27 @@ public class ActivityRecommendServiceImpl extends ServiceImpl<ActivityRecommendM
 
     @Override
     public List<ActivityRecommendVo> selectList(ActivityRecommendQueryBo bo) {
-        return baseMapper.selectListByBo(bo);
+        List<ActivityRecommendVo> activityRecommendVos = baseMapper.selectListByBo(bo);
+        if (CollectionUtils.isEmpty(activityRecommendVos)){
+            return new ArrayList<>();
+        }
+        for (ActivityRecommendVo recommendVo : activityRecommendVos) {
+            if (CollectionUtils.isNotEmpty(recommendVo.getGoodsList())){
+                recommendVo.getGoodsList().forEach(item -> {
+                    if (ObjectUtils.isNull(item.getSpecTemplateId())){
+                        List<GoodsSpecAttributeRelation> list = goodsSpecAttributeRelationService.list(new LambdaQueryWrapper<GoodsSpecAttributeRelation>()
+                                .eq(GoodsSpecAttributeRelation::getGoodsId, item.getGoodsId())
+                                .orderByAsc(GoodsSpecAttributeRelation::getCreateTime)
+                                .last("LIMIT 1"));
+                        if (CollectionUtils.isNotEmpty(list)){
+                            GoodsSpecAttributeRelation relation = list.stream().findFirst().get();
+                            item.setSpecTemplateId(relation.getSpecTemplateId());
+                        }
+                    }
+                });
+            }
+        }
+        return activityRecommendVos;
     }
 
     @Override
@@ -175,6 +199,21 @@ public class ActivityRecommendServiceImpl extends ServiceImpl<ActivityRecommendM
         if (CollectionUtils.isEmpty(page.getRecords())){
             return result;
         }
+        page.getRecords().forEach(item -> {
+            Goods goods = iGoodsService.getById(item.getGoodsId());
+            if (ObjectUtils.isNotNull(goods.getSpecTemplateId())){
+                item.setSpecTemplateId(goods.getSpecTemplateId());
+            }else {
+                List<GoodsSpecAttributeRelation> list = goodsSpecAttributeRelationService.list(new LambdaQueryWrapper<GoodsSpecAttributeRelation>()
+                        .eq(GoodsSpecAttributeRelation::getGoodsId, item.getGoodsId())
+                        .orderByAsc(GoodsSpecAttributeRelation::getCreateTime)
+                        .last("LIMIT 1"));
+                if (CollectionUtils.isNotEmpty(list)){
+                    GoodsSpecAttributeRelation relation = list.stream().findFirst().get();
+                    item.setSpecTemplateId(relation.getSpecTemplateId());
+                }
+            }
+        });
         result.setTotal(page.getTotal());
         result.setRows(page.getRecords());
         result.setCode(200);

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/activity/vo/ActivityRecommendGoodsVo.java

@@ -58,4 +58,6 @@ public class ActivityRecommendGoodsVo {
 	@Excel(name = "封面地址")
 	@ApiModelProperty("封面地址")
 	private String coverUrl;
+	@ApiModelProperty("规格模板ID")
+	private Long specTemplateId;
 }

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

@@ -79,5 +79,5 @@ public interface IQuestionService extends IService<Question> {
 
     String importWordQuestion(MultipartFile file, Long eduId, Long projectId, Long businessId, Long subjectId);
 
-	List<QuestionAddBo> importWordQuestionList(MultipartFile file, Long eduId, Long projectId, Long businessId, Long subjectId);
+	Map<String,Object> importWordQuestionList(MultipartFile file, Long eduId, Long projectId, Long businessId, Long subjectId);
 }

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

@@ -1043,6 +1043,12 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
                                 errorLog += "第" + index + "条题目选项错误\n";
                             }
                             if(!hasError){
+                                if (Validator.isEmpty(answerQuestion)) {
+                                    errorLog += "第" + index + "条正确答案错误\n";
+                                }
+                                if(type==5){
+                                    answerQuestion = null;
+                                }
                                 bo.setType(type);
                                 bo.setStatus(1);
                                 bo.setContent(qContent);
@@ -1054,10 +1060,6 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
                                 bo.setPublishStatus(1);
                                 bo.setBusinessList(businessList);
                                 bo.setCreateTime(nowTime);
-                                answerQuestion = content.replace("正确答案:", "");
-                                if (Validator.isEmpty(answerQuestion)) {
-                                    throw new CustomException("正确答案错误");
-                                }
                                 if(type==1){
                                     list1.add(bo);
                                 }
@@ -1234,6 +1236,11 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
                             strContent = "";
                         }
                         nowPart = 7;
+                        if(Validator.isNotEmpty(answerQuestion)){
+                            answerQuestion = answerQuestion +  "<br />" + content ;
+                        }else{
+                            answerQuestion = content.replace("正确答案:", "");
+                        }
                         if (isOption) {
                             //选择题
                             answerQuestion = dealImportAnswer(answerQuestion);
@@ -1250,24 +1257,23 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
                                 answerQuestion = "0";
                                 type = 3;
                             } else {
-                                answerQuestion = null;
+                                analysisContent = answerQuestion; //简答题把正确答案填充到解析文本
                                 type = 5; //简答题
-                                analysisContent = analysisContent +  "<br />" + content; //答案文本
                             }
                         }
 
                     }
                     else if (content.startsWith("解题思路")||(nowPart==8&&!isLineStart(content))) {
                         nowPart = 8;
-                        analysisContent = analysisContent + "<br />"+  content +"<br />";
+                        analysisContent = analysisContent +   content +"<br />";
                     }
                     else if (content.startsWith("考查考点")||(nowPart==9&&!isLineStart(content))) {
                         nowPart = 9;
-                        analysisContent = analysisContent + "<br />"+  content +"<br />";
+                        analysisContent = analysisContent +   content +"<br />";
                     }
                     else if (content.startsWith("老师解答")||(nowPart==10&&!isLineStart(content))) {
                         nowPart = 10;
-                        analysisContent = analysisContent +  "<br />"+  content +"<br />";
+                        analysisContent = analysisContent +    content +"<br />";
                     }
                 }
                 //遍历正文
@@ -1310,7 +1316,8 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
 
 
     @Override
-    public List<QuestionAddBo> importWordQuestionList(MultipartFile file, Long eduId, Long projectId, Long businessId, Long subjectId) {
+    public Map<String,Object> importWordQuestionList(MultipartFile file, Long eduId, Long projectId, Long businessId, Long subjectId) {
+        Map<String,Object> result = new HashMap<>();
         List<QuestionAddBo> list = new ArrayList<>();
         String errorLog = ""; //错误提示
         String buffer = "";
@@ -1335,7 +1342,7 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
                 String qContent = ""; //题目正文
                 String answerQuestion = null; //答案
                 String analysisContent = ""; //解析文本
-                int index = 0; //题目序列号
+                int index = 1; //题目序列号
                 List<QuestionBusinessAddBo> businessList = new ArrayList<>();
                 QuestionBusinessAddBo questionBusinessAddBo = new QuestionBusinessAddBo();
                 questionBusinessAddBo.setEducationTypeId(eduId);
@@ -1353,6 +1360,7 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
                 String strContent = "";
                 String imgUrl = "";
                 boolean hasQuestion = false;
+                boolean hasRightTag = false;
                 boolean hasError = false;
                 for (XWPFParagraph paragraph : paragraphList) {
                     content = paragraph.getText();
@@ -1412,15 +1420,25 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
                             if (Validator.isEmpty(qContent)) {
                                 hasError = true;
                                 errorLog += "第" + index + "条题目内容错误\n";
+                                continue;
 
                             }
                             QuestionAddBo bo = new QuestionAddBo();
                             if (type == -1) {
                                 hasError = true;
                                 errorLog += "第" + index + "条题目选项错误\n";
+                                continue;
 
                             }
                             if(!hasError){
+                                if (Validator.isEmpty(answerQuestion)) {
+                                    errorLog += "第" + index + "正确答案错误\n";
+                                    continue;
+
+                                }
+                                if(type==5){
+                                    answerQuestion = null;
+                                }
                                 bo.setType(type);
                                 bo.setStatus(1);
                                 bo.setContent(qContent);
@@ -1432,9 +1450,6 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
                                 bo.setPublishStatus(1);
                                 bo.setBusinessList(businessList);
                                 bo.setCreateTime(nowTime);
-                                if (Validator.isEmpty(answerQuestion)) {
-                                    throw new CustomException("正确答案错误");
-                                }
                                 if(type==1){
                                     list1.add(bo);
                                 }
@@ -1459,16 +1474,24 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
                             analysisContent = "";
                             optionsList.clear();
                             nowPart = -1;
+                            hasRightTag= false;
+                        }
+                    }
+                    if (content.startsWith("正确答案:")){
+                        if(!hasRightTag){
+                            hasRightTag = true;
+                        }else{
+                            errorLog += "第" + index + "题目序号可能错误\n";
+                            hasRightTag =false;
+                            continue;
                         }
                     }
-
                     if (content.startsWith("#")) { //导入结束
                         break;
                     }
                     if(Validator.isEmpty(content)||content.equals("")){
                         continue;
                     }
-
                     if (isQuestionStart(content)||(nowPart==0&&!isLineStart(content))) {
                         hasQuestion = true;
                         if(nowPart!=0){
@@ -1606,12 +1629,17 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
                     }
                     //答案和题型
                     if (content.startsWith("正确答案:")||(nowPart==7&&!isLineStart(content))) {
-                        hasQuestion = true;
                         if(nowPart!=7){
                             strContent = "";
                         }
-                        answerQuestion = content.replace("正确答案:", "");
+
                         nowPart = 7;
+
+                        if(Validator.isNotEmpty(answerQuestion)){
+                            answerQuestion = answerQuestion +  "<br />" + content ;
+                        }else{
+                            answerQuestion = content.replace("正确答案:", "");
+                        }
                         if (isOption) {
                             //选择题
                             answerQuestion = dealImportAnswer(answerQuestion);
@@ -1628,24 +1656,23 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
                                 answerQuestion = "0";
                                 type = 3;
                             } else {
-                                answerQuestion = null;
+                                analysisContent = answerQuestion; //简答题把正确答案填充到解析文本
                                 type = 5; //简答题
-                                analysisContent = analysisContent +  "<br />" + content; //答案文本
                             }
                         }
 
                     }
                     else if (content.startsWith("解题思路")||(nowPart==8&&!isLineStart(content))) {
                         nowPart = 8;
-                        analysisContent = analysisContent + "<br />"+  content +"<br />";
+                        analysisContent = analysisContent +   content +"<br />";
                     }
                     else if (content.startsWith("考查考点")||(nowPart==9&&!isLineStart(content))) {
                         nowPart = 9;
-                        analysisContent = analysisContent + "<br />"+  content +"<br />";
+                        analysisContent = analysisContent +   content +"<br />";
                     }
                     else if (content.startsWith("老师解答")||(nowPart==10&&!isLineStart(content))) {
                         nowPart = 10;
-                        analysisContent = analysisContent + "<br />"+  content +"<br />";
+                        analysisContent = analysisContent +   content +"<br />";
                     }
                 }
                 //遍历正文
@@ -1684,7 +1711,9 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
             System.out.println("此文件不是word文件!" + e.getMessage() + e.toString() + e.getLocalizedMessage());
         }
         Collections.reverse(list);
-        return list;
+        result.put("list",list);
+        result.put("errorLog",errorLog);
+        return result;
     }
 
 

+ 0 - 6
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/domain/CourseTopicGoods.java

@@ -36,12 +36,6 @@ private static final long serialVersionUID=1L;
     private Long goodsId;
     /** 商品名称 */
     private String goodsName;
-    /** 标准价格 */
-    private BigDecimal standPrice;
-    /** 最低价格 */
-    private BigDecimal lowestPrice;
-    /** 商品划线价 */
-    private BigDecimal linePrice;
     /** 1有效 0无效 */
     private Integer status;
     /** 创建时间 */

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

@@ -140,10 +140,15 @@ public class CourseChapterSectionServiceImpl extends ServiceImpl<CourseChapterSe
     @Override
     public List<CourseUserChapterSectionVo> sectionList(CourseMenuQueryBo bo) {
         List<CourseUserChapterSectionVo> courseUserChapterSectionVos = courseChapterSectionMapper.sectionList(bo);
+        List<CourseUserChapterSectionVo> examList = null;
         if (!CollectionUtils.isEmpty(courseUserChapterSectionVos)) {
             bo.setModuleId(courseUserChapterSectionVos.get(0).getModuleId());
             bo.setChapterId(courseUserChapterSectionVos.get(0).getChapterId());
-            courseUserChapterSectionVos.addAll(courseChapterSectionMapper.examList(bo));
+            examList = courseChapterSectionMapper.examList(bo);
+            courseUserChapterSectionVos.addAll(examList);
+        }else{
+            examList = courseChapterSectionMapper.examList(bo);
+            courseUserChapterSectionVos = examList;
         }
         if (bo.getUserId() != null) {
             for (CourseUserChapterSectionVo courseMenuVo : courseUserChapterSectionVos) {

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

@@ -164,10 +164,6 @@ public class CourseTopicServiceImpl extends ServiceImpl<CourseTopicMapper, Cours
         List<CourseTopicGoods> goodsList = bo.stream().map(item -> {
             CourseTopicGoods tbTopic = new CourseTopicGoods();
             BeanUtil.copyProperties(item, tbTopic);
-            Goods goods = iGoodsService.getById(item.getGoodsId());
-            tbTopic.setStandPrice(goods.getStandPrice());
-            tbTopic.setLowestPrice(goods.getLowestPrice());
-            tbTopic.setLinePrice(goods.getLinePrice());
             tbTopic.setStatus(1);
             tbTopic.setUpdateTime(DateUtils.getNowTime());
             tbTopic.setCreateTime(DateUtils.getNowTime());
@@ -206,6 +202,10 @@ public class CourseTopicServiceImpl extends ServiceImpl<CourseTopicMapper, Cours
         return list.stream().map(item ->{
             CourseTopicGoodsVo vo = new CourseTopicGoodsVo();
             BeanUtil.copyProperties(item, vo);
+            Goods goods = iGoodsService.getById(item.getGoodsId());
+            vo.setLinePrice(goods.getLinePrice());
+            vo.setLowestPrice(goods.getLowestPrice());
+            vo.setStandPrice(goods.getStandPrice());
             return vo;
         }).collect(Collectors.toList());
     }

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/bo/ExamActivityAddBo.java

@@ -24,6 +24,9 @@ public class ExamActivityAddBo implements Serializable {
     @ApiModelProperty("科目(多个用逗号隔开)")
     private String majors;
 
+    @ApiModelProperty("关联模考ID")
+    private Long mockApplyId;
+
     /** 活动开始时间 */
     @ApiModelProperty("活动开始时间")
     private Long startTime;

+ 13 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/bo/ExamActivityApplyBo.java

@@ -20,6 +20,9 @@ public class ExamActivityApplyBo implements Serializable {
     @ApiModelProperty("活动ID")
     private Long activityId;
 
+    @ApiModelProperty("用户ID")
+    private Long userId;
+
     /** 用户名称 */
     @ApiModelProperty("用户名称")
     private String userName;
@@ -40,6 +43,16 @@ public class ExamActivityApplyBo implements Serializable {
     @ApiModelProperty("用户手机号码")
     private String userPhone;
 
+    @ApiModelProperty("专业ID")
+    private Long mockMajorId;
+
+    @ApiModelProperty("科目IDs")
+    private String mockSubjectIds;
+
+    /**模考绑定科目IDs */
+    @ApiModelProperty("模考绑定科目IDs")
+    private String mockMajorSubjectIds;
+
     /** 报考科目(多个用逗号隔开) */
     @ApiModelProperty("报考科目(多个用逗号隔开)")
     private String userMajors;

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/bo/ExamActivityUpdateBo.java

@@ -24,6 +24,9 @@ public class ExamActivityUpdateBo implements Serializable {
     @ApiModelProperty("活动名称")
     private String name;
 
+    @ApiModelProperty("关联模考ID")
+    private Long mockApplyId;
+
     /** 科目(多个用逗号隔开) */
     @ApiModelProperty("科目(多个用逗号隔开)")
     private String majors;

+ 14 - 5
zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/bo/ExamActivityUserVo.java

@@ -37,15 +37,24 @@ public class ExamActivityUserVo implements Serializable {
     private String companyName;
     /** 用户身份证号码 */
     @ApiModelProperty("用户身份证号码")
-    @Excel(name = "用户身份证号码")
+//    @Excel(name = "用户身份证号码")
     private String userIdCard;
     /** 用户手机号码 */
     @ApiModelProperty("用户手机号码")
     @Excel(name = "用户手机号码")
     private String userPhone;
-    /** 报考科目(多个用逗号隔开) */
-    @ApiModelProperty("报考科目(多个用逗号隔开)")
-    @Excel(name = "报考科目(多个用逗号隔开)")
-    private String userMajors;
+
+    @ApiModelProperty("模考ID")
+    private String mockApplyId;
+    @ApiModelProperty("专业ID")
+    private String mockMajorId;
+    @ApiModelProperty("科目IDs")
+    private String mockSubjectIds;
+    @ApiModelProperty("专业名称")
+    @Excel(name = "报考专业")
+    private String mockMajorName;
+    @ApiModelProperty("科目名称(多个按逗号隔开)")
+    @Excel(name = "报考科目")
+    private String mockSubjectNames;
 
 }

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/domain/ExamActivity.java

@@ -37,6 +37,8 @@ private static final long serialVersionUID=1L;
     private Long endTime;
     /** 创建人ID */
     private Long creatorId;
+    /** 关联模考ID */
+    private Long mockApplyId;
     /** 1有效 0无效 */
     private Integer status;
     /** 创建时间 */

+ 9 - 2
zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/domain/ExamActivityUser.java

@@ -4,6 +4,7 @@ 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;
@@ -29,6 +30,8 @@ private static final long serialVersionUID=1L;
     private Long id;
     /** 活动ID */
     private Long activityId;
+    /** 活动ID */
+    private Long UserId;
     /** 用户名称 */
     private String userName;
     /** 用户性别:1男,2女 */
@@ -39,8 +42,12 @@ private static final long serialVersionUID=1L;
     private String userIdCard;
     /** 用户手机号码 */
     private String userPhone;
-    /** 报考科目(多个用逗号隔开) */
-    private String userMajors;
+    /** 模考ID */
+    private Long mockApplyId;
+    /** 模考专业ID */
+    private Long mockMajorId;
+    /** 模考科目IDS */
+    private String mockSubjectIds;
     /** 1有效 0无效 */
     private Integer status;
     /** 创建时间 */

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/service/IExamActivityService.java

@@ -86,4 +86,6 @@ public interface IExamActivityService extends IService<ExamActivity> {
      * @return java.util.List<com.zhongzheng.modules.goods.vo.GoodsVo>
      */
     List<GoodsVo> getActivityGoodsList(Long activityId);
+
+    Boolean checkUserActivityStatus(Long userId,Long activityId);
 }

+ 117 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/service/impl/ExamActivityServiceImpl.java

@@ -2,10 +2,16 @@ package com.zhongzheng.modules.exam.service.impl;
 
 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.extension.service.impl.ServiceImpl;
 import com.zhongzheng.common.core.domain.model.LoginUser;
+import com.zhongzheng.common.exception.CustomException;
 import com.zhongzheng.common.utils.DateUtils;
 import com.zhongzheng.common.utils.SecurityUtils;
+import com.zhongzheng.modules.course.domain.CourseSubject;
+import com.zhongzheng.modules.course.domain.Major;
+import com.zhongzheng.modules.course.service.ICourseSubjectService;
+import com.zhongzheng.modules.course.service.IMajorService;
 import com.zhongzheng.modules.exam.bo.*;
 import com.zhongzheng.modules.exam.domain.ExamActivity;
 import com.zhongzheng.modules.exam.domain.ExamActivityGoods;
@@ -14,17 +20,29 @@ import com.zhongzheng.modules.exam.mapper.ExamActivityMapper;
 import com.zhongzheng.modules.exam.service.IExamActivityGoodsService;
 import com.zhongzheng.modules.exam.service.IExamActivityService;
 import com.zhongzheng.modules.exam.service.IExamActivityUserService;
+import com.zhongzheng.modules.exam.vo.ExamActivityMajorVo;
+import com.zhongzheng.modules.exam.vo.ExamActivitySubjectVo;
 import com.zhongzheng.modules.exam.vo.ExamActivityVo;
 import com.zhongzheng.modules.goods.domain.Goods;
 import com.zhongzheng.modules.goods.service.IGoodsService;
 import com.zhongzheng.modules.goods.vo.GoodsVo;
+import com.zhongzheng.modules.mock.bo.UserMockActivityAddBo;
+import com.zhongzheng.modules.mock.domain.MockMajor;
+import com.zhongzheng.modules.mock.domain.MockMajorSubject;
+import com.zhongzheng.modules.mock.service.IMockMajorService;
+import com.zhongzheng.modules.mock.service.IMockMajorSubjectService;
+import com.zhongzheng.modules.user.domain.User;
+import com.zhongzheng.modules.user.service.IUserMockSubscribeService;
+import com.zhongzheng.modules.user.service.IUserService;
 import com.zhongzheng.modules.wx.service.IWxLoginService;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.List;
 import java.util.stream.Collectors;
 
@@ -45,6 +63,18 @@ public class ExamActivityServiceImpl extends ServiceImpl<ExamActivityMapper, Exa
     private IGoodsService iGoodsService;
     @Autowired
     private IWxLoginService wxLoginService;
+    @Autowired
+    private IMajorService majorService;
+    @Autowired
+    private ICourseSubjectService courseSubjectService;
+    @Autowired
+    private IMockMajorService mockMajorService;
+    @Autowired
+    private IMockMajorSubjectService mockMajorSubjectService;
+    @Autowired
+    private IUserService userService;
+    @Autowired
+    private IUserMockSubscribeService userMockSubscribeService;
 
     @Override
     @Transactional(rollbackFor = Exception.class)
@@ -74,11 +104,37 @@ public class ExamActivityServiceImpl extends ServiceImpl<ExamActivityMapper, Exa
     @Override
     @Transactional(rollbackFor = Exception.class)
     public ExamActivityApplyVo applyActivity(ExamActivityApplyBo bo) {
+        ExamActivity entity = getById(bo.getActivityId());
+        if (ObjectUtils.isNull(entity)){
+            throw new CustomException("活动信息获取失败");
+        }
+
         ExamActivityUser examActivityUser = new ExamActivityUser();
         BeanUtils.copyProperties(bo, examActivityUser);
+        User user = userService.getById(bo.getUserId());
+        examActivityUser.setMockApplyId(entity.getMockApplyId());
+        examActivityUser.setUserIdCard(user.getIdCard());
+        examActivityUser.setUserPhone(user.getTelphone());
         examActivityUser.setCreateTime(DateUtils.getNowTime());
         examActivityUser.setUpdateTime(DateUtils.getNowTime());
+        if (ObjectUtils.isNull(user.getNickname())){
+            user.setNickname(bo.getUserName());
+        }
+        if (ObjectUtils.isNull(user.getSex())){
+            user.setSex(bo.getUserSex());
+        }
+        if (ObjectUtils.isNull(user.getCompanyName())){
+            user.setCompanyName(bo.getCompanyName());
+        }
+        userService.updateById(user);
         iExamActivityUserService.save(examActivityUser);
+        //生成活动模考数据
+        UserMockActivityAddBo addBo = new UserMockActivityAddBo();
+        addBo.setUserId(bo.getUserId());
+        addBo.setMockApplyId(entity.getMockApplyId());
+        addBo.setMockMajorSubjectIds(Arrays.stream(bo.getMockMajorSubjectIds().split(",")).map(x -> Long.valueOf(x)).collect(Collectors.toList()));
+        userMockSubscribeService.addUserActivityMock(addBo);
+
         ExamActivity activity = getById(bo.getActivityId());
         ExamActivityApplyVo vo = new ExamActivityApplyVo();
         BeanUtils.copyProperties(activity,vo);
@@ -90,12 +146,60 @@ public class ExamActivityServiceImpl extends ServiceImpl<ExamActivityMapper, Exa
         ExamActivity activity = getById(activityId);
         ExamActivityVo vo = new ExamActivityVo();
         BeanUtils.copyProperties(activity,vo);
+        //获取活动模考专业和科目信息
+        List<MockMajor> list = mockMajorService
+                .list(new LambdaQueryWrapper<MockMajor>()
+                .eq(MockMajor::getApplyId, activity.getMockApplyId()));
+        if (CollectionUtils.isNotEmpty(list)){
+            List<ExamActivityMajorVo> majorVos = list.stream().map(item -> {
+                ExamActivityMajorVo majorVo = new ExamActivityMajorVo();
+                Major entity = majorService.getById(item.getMajorId());
+                majorVo.setMajorId(item.getMajorId());
+                majorVo.setMockMajorId(item.getMockMajorId());
+                majorVo.setMajorName(entity.getCategoryName());
+                return majorVo;
+            }).collect(Collectors.toList());
+            vo.setMajorList(majorVos);
+            //科目
+            List<Long> majorIds = list.stream().map(MockMajor::getMockMajorId).collect(Collectors.toList());
+            List<MockMajorSubject> majorSubjects = mockMajorSubjectService
+                    .list(new LambdaQueryWrapper<MockMajorSubject>()
+                    .in(MockMajorSubject::getMockMajorId, majorIds));
+            if (CollectionUtils.isNotEmpty(majorSubjects)){
+                List<ExamActivitySubjectVo> subjectVoList = majorSubjects.stream().map(item -> {
+                    ExamActivitySubjectVo subjectVo = new ExamActivitySubjectVo();
+                    CourseSubject subject = courseSubjectService.getById(item.getSubjectId());
+                    subjectVo.setMockMajorSubjectId(item.getMockMajorSubjectId());
+                    subjectVo.setMockMajorId(item.getMockMajorId());
+                    subjectVo.setSubjectId(item.getSubjectId());
+                    subjectVo.setSubjectName(subject.getSubjectName());
+                    return subjectVo;
+                }).collect(Collectors.toList());
+                vo.setSubjectList(subjectVoList);
+            }
+        }
         return vo;
     }
 
     @Override
     public List<ExamActivityUserVo> getActivityUserList(Long activityId) {
-        return baseMapper.getActivityUserList(activityId);
+        List<ExamActivityUserVo> activityUserList = baseMapper.getActivityUserList(activityId);
+        if (CollectionUtils.isEmpty(activityUserList)){
+            return new ArrayList<>();
+        }
+        activityUserList.forEach(item -> {
+            if (ObjectUtils.isNotNull(item.getMockMajorId())){
+                Major major = majorService.getById(item.getMockMajorId());
+                item.setMockMajorName(major.getCategoryName());
+            }
+            if (ObjectUtils.isNotNull(item.getMockSubjectIds())){
+                List<CourseSubject> subjects = courseSubjectService.listByIds(Arrays.stream(item.getMockSubjectIds().split(",")).collect(Collectors.toList()));
+//                String names = subjects.stream().map(CourseSubject::getSubjectName).collect(Collectors.joining());
+                List<String> names = subjects.stream().map(CourseSubject::getSubjectName).collect(Collectors.toList());
+                item.setMockSubjectNames(StringUtils.join(names, ","));
+            }
+        });
+        return activityUserList;
     }
 
     @Override
@@ -121,4 +225,16 @@ public class ExamActivityServiceImpl extends ServiceImpl<ExamActivityMapper, Exa
         }).collect(Collectors.toList());
         return goodsVoList;
     }
+
+    @Override
+    public Boolean checkUserActivityStatus(Long userId,Long activityId) {
+        ExamActivity activity = getById(activityId);
+        if (ObjectUtils.isNull(activity)){
+            throw new CustomException("活动信息获取失败");
+        }
+        int count = iExamActivityUserService.count(new LambdaQueryWrapper<ExamActivityUser>()
+                .eq(ExamActivityUser::getActivityId, activityId)
+                .eq(ExamActivityUser::getUserId, userId));
+        return count > 0;
+    }
 }

+ 3 - 3
zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/service/impl/ExamApplyServiceImpl.java

@@ -350,9 +350,9 @@ public class ExamApplyServiceImpl extends ServiceImpl<ExamApplyMapper, ExamApply
         com.baomidou.mybatisplus.extension.plugins.pagination.Page<GoodsVo> page =
                 iActivityRecommendGoodsService.getGoodsListByPage(new com.baomidou.mybatisplus.extension.plugins.pagination.Page<>(bo.getPageNum(), bo.getPageSize()),activityRecommend.getRecommendId());
 
-        if (CollectionUtils.isEmpty(page.getRecords())){
-            return tableDataInfo;
-        }
+//        if (CollectionUtils.isEmpty(page.getRecords())){
+//            return tableDataInfo;
+//        }
 
         tableDataInfo.setTotal(page.getTotal());
         tableDataInfo.setRows(page.getRecords());

+ 31 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/vo/ExamActivityMajorVo.java

@@ -0,0 +1,31 @@
+package com.zhongzheng.modules.exam.vo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * 考试活动对象 exam_activity
+ *
+ * @author yangdamao
+ * @date 2021-12-07
+ */
+@Data
+@ApiModel("考试活动专业对象")
+public class ExamActivityMajorVo implements Serializable {
+
+    /**模考专业ID */
+    @ApiModelProperty("模考专业ID")
+    private Long mockMajorId;
+
+    /**专业ID */
+    @ApiModelProperty("专业ID")
+    private Long majorId;
+
+    /**专业名称 */
+    @ApiModelProperty("专业名称")
+    private String majorName;
+
+}

+ 35 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/vo/ExamActivitySubjectVo.java

@@ -0,0 +1,35 @@
+package com.zhongzheng.modules.exam.vo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * 考试活动对象 exam_activity
+ *
+ * @author yangdamao
+ * @date 2021-12-07
+ */
+@Data
+@ApiModel("考试活动科目对象")
+public class ExamActivitySubjectVo implements Serializable {
+
+    /**模考专业科目ID */
+    @ApiModelProperty("模考专业科目ID")
+    private Long mockMajorSubjectId;
+
+    /**模考专业ID */
+    @ApiModelProperty("模考专业ID")
+    private Long mockMajorId;
+
+    /**科目ID */
+    @ApiModelProperty("科目ID")
+    private Long subjectId;
+
+    /**科目名称 */
+    @ApiModelProperty("科目名称")
+    private String subjectName;
+
+}

+ 16 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/vo/ExamActivityVo.java

@@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
 import java.io.Serializable;
+import java.util.List;
 
 /**
  * 考试活动对象 exam_activity
@@ -24,6 +25,15 @@ public class ExamActivityVo implements Serializable {
     @ApiModelProperty("活动名称")
     private String name;
 
+    @ApiModelProperty("关联模考ID")
+    private Integer mockApplyId;
+
+    @ApiModelProperty("关联模考名称")
+    private String mockApplyName;
+
+    @ApiModelProperty("关联模考编码")
+    private String mockApplyCode;
+
     /** 科目(多个用逗号隔开) */
     @ApiModelProperty("科目(多个用逗号隔开)")
     private String majors;
@@ -48,4 +58,10 @@ public class ExamActivityVo implements Serializable {
     @ApiModelProperty("1有效 0无效")
     private Integer status;
 
+    @ApiModelProperty("专业集合")
+    private List<ExamActivityMajorVo> majorList;
+
+    @ApiModelProperty("科目集合")
+    private List<ExamActivitySubjectVo> subjectList;
+
 }

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

@@ -75,6 +75,8 @@ GoodsQueryBo extends BaseEntity {
 	/** 商品名称 */
 	@ApiModelProperty("商品名称")
 	private String goodsName;
+	@ApiModelProperty("商品编码")
+	private String code;
 	/** 标准价格 */
 	@ApiModelProperty("标准价格")
 	private BigDecimal standPrice;

+ 47 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/bo/GoodsSpecAddBo.java

@@ -0,0 +1,47 @@
+package com.zhongzheng.modules.goods.bo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import java.util.Date;
+import java.util.List;
+
+
+/**
+ * 【请填写功能名称】添加对象 goods_spec
+ *
+ * @author ruoyi
+ * @date 2022-09-29
+ */
+@Data
+@ApiModel("【请填写功能名称】添加对象")
+public class GoodsSpecAddBo {
+
+    /** 规格ID */
+    @ApiModelProperty("规格ID")
+    private Long specId;
+    /** 规格模板ID */
+    @ApiModelProperty("规格模板ID")
+    private Long specTemplateId;
+    /** 模板名称 */
+    @ApiModelProperty("模板名称")
+    private String name;
+    /** 编码 */
+    @ApiModelProperty("编码")
+    private String code;
+    /** 排序值 */
+    @ApiModelProperty("排序值")
+    private Integer sort;
+    /** 1有效 0无效 */
+    @ApiModelProperty("1有效 0无效")
+    private Integer status;
+    /** 创建时间 */
+    @ApiModelProperty("创建时间")
+    private Long createTime;
+    /** 更新时间 */
+    @ApiModelProperty("更新时间")
+    private Long updateTime;
+    @ApiModelProperty("规格属性集合")
+    private List<GoodsSpecAttributeAddBo> specAttrList;
+}

+ 45 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/bo/GoodsSpecAttributeAddBo.java

@@ -0,0 +1,45 @@
+package com.zhongzheng.modules.goods.bo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import java.util.Date;
+import java.util.List;
+
+
+/**
+ * 【请填写功能名称】添加对象 goods_spec_attribute
+ *
+ * @author ruoyi
+ * @date 2022-09-29
+ */
+@Data
+@ApiModel("【请填写功能名称】添加对象")
+public class GoodsSpecAttributeAddBo {
+
+    /** 规格属性ID */
+    @ApiModelProperty("规格属性ID")
+    private Long specAttributeId;
+    /** 规格ID */
+    @ApiModelProperty("规格ID")
+    private Long specId;
+    /** 模板名称 */
+    @ApiModelProperty("模板名称")
+    private String name;
+    /** 编码 */
+    @ApiModelProperty("编码")
+    private String code;
+    /** 排序值 */
+    @ApiModelProperty("排序值")
+    private Integer sort;
+    /** 1有效 0无效 */
+    @ApiModelProperty("1有效 0无效")
+    private Integer status;
+    /** 创建时间 */
+    @ApiModelProperty("创建时间")
+    private Long createTime;
+    /** 更新时间 */
+    @ApiModelProperty("更新时间")
+    private Long updateTime;
+}

+ 49 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/bo/GoodsSpecAttributeEditBo.java

@@ -0,0 +1,49 @@
+package com.zhongzheng.modules.goods.bo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import java.util.Date;
+
+
+/**
+ * 【请填写功能名称】编辑对象 goods_spec_attribute
+ *
+ * @author ruoyi
+ * @date 2022-09-29
+ */
+@Data
+@ApiModel("【请填写功能名称】编辑对象")
+public class GoodsSpecAttributeEditBo {
+
+    /** 规格属性ID */
+    @ApiModelProperty("规格属性ID")
+    private Long specAttributeId;
+
+    /** 规格ID */
+    @ApiModelProperty("规格ID")
+    private Long specId;
+
+    /** 模板名称 */
+    @ApiModelProperty("模板名称")
+    private String name;
+
+    /** 编码 */
+    @ApiModelProperty("编码")
+    private String code;
+
+    /** 排序值 */
+    @ApiModelProperty("排序值")
+    private Integer sort;
+
+    /** 1有效 0无效 */
+    @ApiModelProperty("1有效 0无效")
+    private Integer status;
+
+    /** 更新时间 */
+    @ApiModelProperty("更新时间")
+    private Long updateTime;
+
+
+}

+ 54 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/bo/GoodsSpecAttributeQueryBo.java

@@ -0,0 +1,54 @@
+package com.zhongzheng.modules.goods.bo;
+
+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 com.zhongzheng.common.core.domain.BaseEntity;
+
+/**
+ * 【请填写功能名称】分页查询对象 goods_spec_attribute
+ *
+ * @author ruoyi
+ * @date 2022-09-29
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ApiModel("【请填写功能名称】分页查询对象")
+public class GoodsSpecAttributeQueryBo extends BaseEntity {
+
+	/** 分页大小 */
+	@ApiModelProperty("分页大小")
+	private Integer pageSize;
+	/** 当前页数 */
+	@ApiModelProperty("当前页数")
+	private Integer pageNum;
+	/** 排序列 */
+	@ApiModelProperty("排序列")
+	private String orderByColumn;
+	/** 排序的方向desc或者asc */
+	@ApiModelProperty(value = "排序的方向", example = "asc,desc")
+	private String isAsc;
+
+
+	/** 规格ID */
+	@ApiModelProperty("规格ID")
+	private Long specId;
+	/** 模板名称 */
+	@ApiModelProperty("模板名称")
+	private String name;
+	/** 编码 */
+	@ApiModelProperty("编码")
+	private String code;
+	/** 排序值 */
+	@ApiModelProperty("排序值")
+	private Integer sort;
+	/** 1有效 0无效 */
+	@ApiModelProperty("1有效 0无效")
+	private Integer status;
+}

+ 39 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/bo/GoodsSpecAttributeRelationAddBo.java

@@ -0,0 +1,39 @@
+package com.zhongzheng.modules.goods.bo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import java.util.Date;
+
+
+
+/**
+ * 【请填写功能名称】添加对象 goods_spec_attribute_relation
+ *
+ * @author ruoyi
+ * @date 2022-09-29
+ */
+@Data
+@ApiModel("【请填写功能名称】添加对象")
+public class GoodsSpecAttributeRelationAddBo {
+
+    /** 规格属性ID集合 */
+    @ApiModelProperty("规格属性ID集合")
+    private String specAttributeIds;
+    /** 商品ID */
+    @ApiModelProperty("商品ID")
+    private Long goodsId;
+    /** 规格模板ID */
+    @ApiModelProperty("规格模板ID")
+    private Long specTemplateId;
+    /** 1有效 0无效 */
+    @ApiModelProperty("1有效 0无效")
+    private Integer status;
+    /** 创建时间 */
+    @ApiModelProperty("创建时间")
+    private Long createTime;
+    /** 更新时间 */
+    @ApiModelProperty("更新时间")
+    private Long updateTime;
+}

+ 45 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/bo/GoodsSpecAttributeRelationEditBo.java

@@ -0,0 +1,45 @@
+package com.zhongzheng.modules.goods.bo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import java.util.Date;
+
+
+/**
+ * 【请填写功能名称】编辑对象 goods_spec_attribute_relation
+ *
+ * @author ruoyi
+ * @date 2022-09-29
+ */
+@Data
+@ApiModel("【请填写功能名称】编辑对象")
+public class GoodsSpecAttributeRelationEditBo {
+
+    /** 主键 */
+    @ApiModelProperty("主键")
+    private Long id;
+
+    /** 规格属性ID集合 */
+    @ApiModelProperty("规格属性ID集合")
+    private String specAttributeIds;
+
+    /** 商品ID */
+    @ApiModelProperty("商品ID")
+    private Long goodsId;
+
+    /** 规格模板ID */
+    @ApiModelProperty("规格模板ID")
+    private Long specTemplateId;
+
+    /** 1有效 0无效 */
+    @ApiModelProperty("1有效 0无效")
+    private Integer status;
+
+    /** 更新时间 */
+    @ApiModelProperty("更新时间")
+    private Long updateTime;
+
+
+}

+ 51 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/bo/GoodsSpecAttributeRelationQueryBo.java

@@ -0,0 +1,51 @@
+package com.zhongzheng.modules.goods.bo;
+
+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 com.zhongzheng.common.core.domain.BaseEntity;
+
+/**
+ * 【请填写功能名称】分页查询对象 goods_spec_attribute_relation
+ *
+ * @author ruoyi
+ * @date 2022-09-29
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ApiModel("【请填写功能名称】分页查询对象")
+public class GoodsSpecAttributeRelationQueryBo extends BaseEntity {
+
+	/** 分页大小 */
+	@ApiModelProperty("分页大小")
+	private Integer pageSize;
+	/** 当前页数 */
+	@ApiModelProperty("当前页数")
+	private Integer pageNum;
+	/** 排序列 */
+	@ApiModelProperty("排序列")
+	private String orderByColumn;
+	/** 排序的方向desc或者asc */
+	@ApiModelProperty(value = "排序的方向", example = "asc,desc")
+	private String isAsc;
+
+
+	/** 规格属性ID集合 */
+	@ApiModelProperty("规格属性ID集合")
+	private String specAttributeIds;
+	/** 商品ID */
+	@ApiModelProperty("商品ID")
+	private Long goodsId;
+	/** 规格模板ID */
+	@ApiModelProperty("规格模板ID")
+	private Long specTemplateId;
+	/** 1有效 0无效 */
+	@ApiModelProperty("1有效 0无效")
+	private Integer status;
+}

+ 49 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/bo/GoodsSpecEditBo.java

@@ -0,0 +1,49 @@
+package com.zhongzheng.modules.goods.bo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import java.util.Date;
+
+
+/**
+ * 【请填写功能名称】编辑对象 goods_spec
+ *
+ * @author ruoyi
+ * @date 2022-09-29
+ */
+@Data
+@ApiModel("【请填写功能名称】编辑对象")
+public class GoodsSpecEditBo {
+
+    /** 规格ID */
+    @ApiModelProperty("规格ID")
+    private Long specId;
+
+    /** 规格模板ID */
+    @ApiModelProperty("规格模板ID")
+    private Long specTemplateId;
+
+    /** 模板名称 */
+    @ApiModelProperty("模板名称")
+    private String name;
+
+    /** 编码 */
+    @ApiModelProperty("编码")
+    private String code;
+
+    /** 排序值 */
+    @ApiModelProperty("排序值")
+    private Integer sort;
+
+    /** 1有效 0无效 */
+    @ApiModelProperty("1有效 0无效")
+    private Integer status;
+
+    /** 更新时间 */
+    @ApiModelProperty("更新时间")
+    private Long updateTime;
+
+
+}

+ 54 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/bo/GoodsSpecQueryBo.java

@@ -0,0 +1,54 @@
+package com.zhongzheng.modules.goods.bo;
+
+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 com.zhongzheng.common.core.domain.BaseEntity;
+
+/**
+ * 【请填写功能名称】分页查询对象 goods_spec
+ *
+ * @author ruoyi
+ * @date 2022-09-29
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ApiModel("【请填写功能名称】分页查询对象")
+public class GoodsSpecQueryBo extends BaseEntity {
+
+	/** 分页大小 */
+	@ApiModelProperty("分页大小")
+	private Integer pageSize;
+	/** 当前页数 */
+	@ApiModelProperty("当前页数")
+	private Integer pageNum;
+	/** 排序列 */
+	@ApiModelProperty("排序列")
+	private String orderByColumn;
+	/** 排序的方向desc或者asc */
+	@ApiModelProperty(value = "排序的方向", example = "asc,desc")
+	private String isAsc;
+
+
+	/** 规格模板ID */
+	@ApiModelProperty("规格模板ID")
+	private Long specTemplateId;
+	/** 模板名称 */
+	@ApiModelProperty("模板名称")
+	private String name;
+	/** 编码 */
+	@ApiModelProperty("编码")
+	private String code;
+	/** 排序值 */
+	@ApiModelProperty("排序值")
+	private Integer sort;
+	/** 1有效 0无效 */
+	@ApiModelProperty("1有效 0无效")
+	private Integer status;
+}

+ 24 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/bo/GoodsSpecTempEditBo.java

@@ -0,0 +1,24 @@
+package com.zhongzheng.modules.goods.bo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+
+/**
+ * 【请填写功能名称】编辑对象 goods_spec
+ *
+ * @author ruoyi
+ * @date 2022-09-29
+ */
+@Data
+@ApiModel("【请填写功能名称】编辑对象")
+public class GoodsSpecTempEditBo {
+    /** 规格模板ID */
+    @ApiModelProperty("规格模板ID")
+    private Long specTemplateId;
+
+    /** 商品ID */
+    @ApiModelProperty("商品ID")
+    private Long goodsId;
+}

+ 51 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/bo/GoodsSpecTemplateAddBo.java

@@ -0,0 +1,51 @@
+package com.zhongzheng.modules.goods.bo;
+
+import com.zhongzheng.modules.goods.domain.GoodsSpecAttributeRelation;
+import com.zhongzheng.modules.goods.vo.GoodsSpecAttributeRelationVo;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import java.util.Date;
+import java.util.List;
+
+
+/**
+ * 【请填写功能名称】添加对象 goods_spec_template
+ *
+ * @author ruoyi
+ * @date 2022-09-29
+ */
+@Data
+@ApiModel("【请填写功能名称】添加对象")
+public class GoodsSpecTemplateAddBo {
+
+    /** 规格模板ID */
+    @ApiModelProperty("规格模板ID")
+    private Long specTemplateId;
+    /** 编码 */
+    @ApiModelProperty("编码")
+    private String code;
+    /** 教育类型id */
+    @ApiModelProperty("教育类型id")
+    private Long educationTypeId;
+    /** 业务层次id */
+    @ApiModelProperty("业务层次id")
+    private Long businessId;
+    /** 模板名称 */
+    @ApiModelProperty("模板名称")
+    private String name;
+    /** 1有效 0无效 */
+    @ApiModelProperty("1有效 0无效")
+    private Integer status;
+    /** 创建时间 */
+    @ApiModelProperty("创建时间")
+    private Long createTime;
+    /** 更新时间 */
+    @ApiModelProperty("更新时间")
+    private Long updateTime;
+    @ApiModelProperty("模板规格集合")
+    private List<GoodsSpecAddBo> specList;
+    @ApiModelProperty("模板商品集合")
+    private List<GoodsSpecAttributeRelationVo> attributeRelationList;
+}

+ 50 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/bo/GoodsSpecTemplateEditBo.java

@@ -0,0 +1,50 @@
+package com.zhongzheng.modules.goods.bo;
+
+import com.zhongzheng.modules.goods.vo.GoodsSpecAttributeRelationVo;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import java.util.Date;
+import java.util.List;
+
+
+/**
+ * 【请填写功能名称】编辑对象 goods_spec_template
+ *
+ * @author ruoyi
+ * @date 2022-09-29
+ */
+@Data
+@ApiModel("【请填写功能名称】编辑对象")
+public class GoodsSpecTemplateEditBo {
+
+    /** 规格模板ID */
+    @ApiModelProperty("规格模板ID")
+    private Long specTemplateId;
+    /** 编码 */
+    @ApiModelProperty("编码")
+    private String code;
+    /** 教育类型id */
+    @ApiModelProperty("教育类型id")
+    private Long educationTypeId;
+    /** 业务层次id */
+    @ApiModelProperty("业务层次id")
+    private Long businessId;
+    /** 模板名称 */
+    @ApiModelProperty("模板名称")
+    private String name;
+    /** 1有效 0无效 */
+    @ApiModelProperty("1有效 0无效")
+    private Integer status;
+    /** 创建时间 */
+    @ApiModelProperty("创建时间")
+    private Long createTime;
+    /** 更新时间 */
+    @ApiModelProperty("更新时间")
+    private Long updateTime;
+    @ApiModelProperty("模板规格集合")
+    private List<GoodsSpecAddBo> specList;
+    @ApiModelProperty("模板商品集合")
+    private List<GoodsSpecAttributeRelationVo> attributeRelationList;
+}

+ 54 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/bo/GoodsSpecTemplateQueryBo.java

@@ -0,0 +1,54 @@
+package com.zhongzheng.modules.goods.bo;
+
+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 com.zhongzheng.common.core.domain.BaseEntity;
+
+/**
+ * 【请填写功能名称】分页查询对象 goods_spec_template
+ *
+ * @author ruoyi
+ * @date 2022-09-29
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ApiModel("【请填写功能名称】分页查询对象")
+public class GoodsSpecTemplateQueryBo extends BaseEntity {
+
+	/** 分页大小 */
+	@ApiModelProperty("分页大小")
+	private Integer pageSize;
+	/** 当前页数 */
+	@ApiModelProperty("当前页数")
+	private Integer pageNum;
+	/** 排序列 */
+	@ApiModelProperty("排序列")
+	private String orderByColumn;
+	/** 排序的方向desc或者asc */
+	@ApiModelProperty(value = "排序的方向", example = "asc,desc")
+	private String isAsc;
+
+
+	/** 编码 */
+	@ApiModelProperty("编码")
+	private String code;
+	/** 教育类型id */
+	@ApiModelProperty("教育类型id")
+	private Long educationTypeId;
+	/** 业务层次id */
+	@ApiModelProperty("业务层次id")
+	private Long businessId;
+	/** 模板名称 */
+	@ApiModelProperty("模板名称")
+	private String name;
+	/** 1有效 0无效 */
+	@ApiModelProperty("1有效 0无效")
+	private Integer status;
+}

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/domain/Goods.java

@@ -139,4 +139,6 @@ private static final long serialVersionUID=1L;
     private Long certificateTpId;
     /** 商品划线价格 */
     private BigDecimal linePrice;
+    /** 默认规格模板ID */
+    private Long specTemplateId;
 }

+ 45 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/domain/GoodsSpec.java

@@ -0,0 +1,45 @@
+package com.zhongzheng.modules.goods.domain;
+
+import com.baomidou.mybatisplus.annotation.*;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import lombok.experimental.Accessors;
+import java.io.Serializable;
+import java.util.Date;
+import java.math.BigDecimal;
+import com.zhongzheng.common.annotation.Excel;
+
+/**
+ * 【请填写功能名称】对象 goods_spec
+ *
+ * @author ruoyi
+ * @date 2022-09-29
+ */
+@Data
+@NoArgsConstructor
+@Accessors(chain = true)
+@TableName("goods_spec")
+public class GoodsSpec implements Serializable {
+
+private static final long serialVersionUID=1L;
+
+    /** 规格ID */
+    @TableId(value = "spec_id")
+    private Long specId;
+    /** 规格模板ID */
+    private Long specTemplateId;
+    /** 模板名称 */
+    private String name;
+    /** 编码 */
+    private String code;
+    /** 排序值 */
+    private Integer sort;
+    /** 1有效 0无效 */
+    private Integer status;
+    /** 创建时间 */
+    @TableField(fill = FieldFill.INSERT)
+    private Long createTime;
+    /** 更新时间 */
+    @TableField(fill = FieldFill.INSERT_UPDATE)
+    private Long updateTime;
+}

+ 45 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/domain/GoodsSpecAttribute.java

@@ -0,0 +1,45 @@
+package com.zhongzheng.modules.goods.domain;
+
+import com.baomidou.mybatisplus.annotation.*;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import lombok.experimental.Accessors;
+import java.io.Serializable;
+import java.util.Date;
+import java.math.BigDecimal;
+import com.zhongzheng.common.annotation.Excel;
+
+/**
+ * 【请填写功能名称】对象 goods_spec_attribute
+ *
+ * @author ruoyi
+ * @date 2022-09-29
+ */
+@Data
+@NoArgsConstructor
+@Accessors(chain = true)
+@TableName("goods_spec_attribute")
+public class GoodsSpecAttribute implements Serializable {
+
+private static final long serialVersionUID=1L;
+
+    /** 规格属性ID */
+    @TableId(value = "spec_attribute_id")
+    private Long specAttributeId;
+    /** 规格ID */
+    private Long specId;
+    /** 模板名称 */
+    private String name;
+    /** 编码 */
+    private String code;
+    /** 排序值 */
+    private Integer sort;
+    /** 1有效 0无效 */
+    private Integer status;
+    /** 创建时间 */
+    @TableField(fill = FieldFill.INSERT)
+    private Long createTime;
+    /** 更新时间 */
+    @TableField(fill = FieldFill.INSERT_UPDATE)
+    private Long updateTime;
+}

+ 43 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/domain/GoodsSpecAttributeRelation.java

@@ -0,0 +1,43 @@
+package com.zhongzheng.modules.goods.domain;
+
+import com.baomidou.mybatisplus.annotation.*;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import lombok.experimental.Accessors;
+import java.io.Serializable;
+import java.util.Date;
+import java.math.BigDecimal;
+import com.zhongzheng.common.annotation.Excel;
+
+/**
+ * 【请填写功能名称】对象 goods_spec_attribute_relation
+ *
+ * @author ruoyi
+ * @date 2022-09-29
+ */
+@Data
+@NoArgsConstructor
+@Accessors(chain = true)
+@TableName("goods_spec_attribute_relation")
+public class GoodsSpecAttributeRelation implements Serializable {
+
+private static final long serialVersionUID=1L;
+
+    /** 主键 */
+    @TableId(value = "id")
+    private Long id;
+    /** 规格属性ID集合 */
+    private String specAttributeIds;
+    /** 商品ID */
+    private Long goodsId;
+    /** 规格模板ID */
+    private Long specTemplateId;
+    /** 1有效 0无效 */
+    private Integer status;
+    /** 创建时间 */
+    @TableField(fill = FieldFill.INSERT)
+    private Long createTime;
+    /** 更新时间 */
+    @TableField(fill = FieldFill.INSERT_UPDATE)
+    private Long updateTime;
+}

+ 45 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/domain/GoodsSpecTemplate.java

@@ -0,0 +1,45 @@
+package com.zhongzheng.modules.goods.domain;
+
+import com.baomidou.mybatisplus.annotation.*;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import lombok.experimental.Accessors;
+import java.io.Serializable;
+import java.util.Date;
+import java.math.BigDecimal;
+import com.zhongzheng.common.annotation.Excel;
+
+/**
+ * 【请填写功能名称】对象 goods_spec_template
+ *
+ * @author ruoyi
+ * @date 2022-09-29
+ */
+@Data
+@NoArgsConstructor
+@Accessors(chain = true)
+@TableName("goods_spec_template")
+public class GoodsSpecTemplate implements Serializable {
+
+private static final long serialVersionUID=1L;
+
+    /** 规格模板ID */
+    @TableId(value = "spec_template_id")
+    private Long specTemplateId;
+    /** 编码 */
+    private String code;
+    /** 教育类型id */
+    private Long educationTypeId;
+    /** 业务层次id */
+    private Long businessId;
+    /** 模板名称 */
+    private String name;
+    /** 1有效 0无效 */
+    private Integer status;
+    /** 创建时间 */
+    @TableField(fill = FieldFill.INSERT)
+    private Long createTime;
+    /** 更新时间 */
+    @TableField(fill = FieldFill.INSERT_UPDATE)
+    private Long updateTime;
+}

+ 19 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/mapper/GoodsSpecAttributeMapper.java

@@ -0,0 +1,19 @@
+package com.zhongzheng.modules.goods.mapper;
+
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.zhongzheng.modules.goods.bo.GoodsSpecAttributeAddBo;
+import com.zhongzheng.modules.goods.domain.GoodsSpecAttribute;
+
+import java.util.List;
+
+/**
+ * 【请填写功能名称】Mapper接口
+ *
+ * @author ruoyi
+ * @date 2022-09-29
+ */
+public interface GoodsSpecAttributeMapper extends BaseMapper<GoodsSpecAttribute> {
+
+    Integer saveBatchEntity(List<GoodsSpecAttributeAddBo> specAttrList);
+}

+ 15 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/mapper/GoodsSpecAttributeRelationMapper.java

@@ -0,0 +1,15 @@
+package com.zhongzheng.modules.goods.mapper;
+
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.zhongzheng.modules.goods.domain.GoodsSpecAttributeRelation;
+
+/**
+ * 【请填写功能名称】Mapper接口
+ *
+ * @author ruoyi
+ * @date 2022-09-29
+ */
+public interface GoodsSpecAttributeRelationMapper extends BaseMapper<GoodsSpecAttributeRelation> {
+
+}

+ 19 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/mapper/GoodsSpecMapper.java

@@ -0,0 +1,19 @@
+package com.zhongzheng.modules.goods.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.zhongzheng.modules.goods.bo.GoodsSpecAddBo;
+import com.zhongzheng.modules.goods.domain.GoodsSpec;
+
+import java.util.List;
+
+/**
+ * 【请填写功能名称】Mapper接口
+ *
+ * @author ruoyi
+ * @date 2022-09-29
+ */
+public interface GoodsSpecMapper extends BaseMapper<GoodsSpec> {
+
+    Integer saveBatchEntity(List<GoodsSpecAddBo> boList);
+
+}

+ 14 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/mapper/GoodsSpecTemplateMapper.java

@@ -0,0 +1,14 @@
+package com.zhongzheng.modules.goods.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.zhongzheng.modules.goods.domain.GoodsSpecTemplate;
+
+/**
+ * 【请填写功能名称】Mapper接口
+ *
+ * @author ruoyi
+ * @date 2022-09-29
+ */
+public interface GoodsSpecTemplateMapper extends BaseMapper<GoodsSpecTemplate> {
+
+}

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

@@ -7,7 +7,10 @@ import com.zhongzheng.modules.exam.bo.ExamNumberGoodsQueryBo;
 import com.zhongzheng.modules.exam.vo.ExamNumberGoodsVo;
 import com.zhongzheng.modules.goods.bo.*;
 import com.zhongzheng.modules.goods.domain.Goods;
+import com.zhongzheng.modules.goods.vo.GoodsSpecTemplateVo;
+import com.zhongzheng.modules.goods.vo.GoodsJzsVo;
 import com.zhongzheng.modules.goods.vo.GoodsVo;
+import com.zhongzheng.modules.grade.vo.SyncGoodsExport;
 
 import java.util.Collection;
 import java.util.List;
@@ -81,4 +84,10 @@ public interface IGoodsService extends IService<Goods> {
 	int queryUpGoods();
 
 	List<CourseModuleFreeExamVo> moduleFreeExamList(Long goodsId);
+
+	List<GoodsSpecTemplateVo> getSpecTemplateList(Long goodsId);
+
+	boolean updateSpecTemplate(GoodsSpecTempEditBo bo);
+
+	List<SyncGoodsExport> selectRjJzsList(GoodsQueryBo bo);
 }

+ 52 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/IGoodsSpecAttributeRelationService.java

@@ -0,0 +1,52 @@
+package com.zhongzheng.modules.goods.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.zhongzheng.modules.goods.bo.GoodsSpecAttributeRelationAddBo;
+import com.zhongzheng.modules.goods.bo.GoodsSpecAttributeRelationEditBo;
+import com.zhongzheng.modules.goods.bo.GoodsSpecAttributeRelationQueryBo;
+import com.zhongzheng.modules.goods.domain.GoodsSpecAttributeRelation;
+import com.zhongzheng.modules.goods.vo.GoodsSpecAttributeRelationVo;
+
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * 【请填写功能名称】Service接口
+ *
+ * @author ruoyi
+ * @date 2022-09-29
+ */
+public interface IGoodsSpecAttributeRelationService extends IService<GoodsSpecAttributeRelation> {
+	/**
+	 * 查询单个
+	 * @return
+	 */
+	GoodsSpecAttributeRelationVo queryById(Long id);
+
+	/**
+	 * 查询列表
+	 */
+	List<GoodsSpecAttributeRelationVo> queryList(GoodsSpecAttributeRelationQueryBo bo);
+
+	/**
+	 * 根据新增业务对象插入【请填写功能名称】
+	 * @param bo 【请填写功能名称】新增业务对象
+	 * @return
+	 */
+	Boolean insertByAddBo(GoodsSpecAttributeRelationAddBo bo);
+
+	/**
+	 * 根据编辑业务对象修改【请填写功能名称】
+	 * @param bo 【请填写功能名称】编辑业务对象
+	 * @return
+	 */
+	Boolean updateByEditBo(GoodsSpecAttributeRelationEditBo bo);
+
+	/**
+	 * 校验并删除数据
+	 * @param ids 主键集合
+	 * @param isValid 是否校验,true-删除前校验,false-不校验
+	 * @return
+	 */
+	Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
+}

+ 55 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/IGoodsSpecAttributeService.java

@@ -0,0 +1,55 @@
+package com.zhongzheng.modules.goods.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.zhongzheng.modules.goods.bo.GoodsSpecAttributeAddBo;
+import com.zhongzheng.modules.goods.bo.GoodsSpecAttributeEditBo;
+import com.zhongzheng.modules.goods.bo.GoodsSpecAttributeQueryBo;
+import com.zhongzheng.modules.goods.domain.GoodsSpecAttribute;
+import com.zhongzheng.modules.goods.vo.GoodsSpecAttributeVo;
+
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * 【请填写功能名称】Service接口
+ *
+ * @author ruoyi
+ * @date 2022-09-29
+ */
+public interface IGoodsSpecAttributeService extends IService<GoodsSpecAttribute> {
+	/**
+	 * 查询单个
+	 * @return
+	 */
+	GoodsSpecAttributeVo queryById(Long specAttributeId);
+
+	/**
+	 * 查询列表
+	 */
+	List<GoodsSpecAttributeVo> queryList(GoodsSpecAttributeQueryBo bo);
+
+	/**
+	 * 根据新增业务对象插入【请填写功能名称】
+	 * @param bo 【请填写功能名称】新增业务对象
+	 * @return
+	 */
+	Boolean insertByAddBo(GoodsSpecAttributeAddBo bo);
+
+	/**
+	 * 根据编辑业务对象修改【请填写功能名称】
+	 * @param bo 【请填写功能名称】编辑业务对象
+	 * @return
+	 */
+	Boolean updateByEditBo(GoodsSpecAttributeEditBo bo);
+
+	/**
+	 * 校验并删除数据
+	 * @param ids 主键集合
+	 * @param isValid 是否校验,true-删除前校验,false-不校验
+	 * @return
+	 */
+	Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
+
+    Integer saveBatchEntity(List<GoodsSpecAttributeAddBo> specAttrList);
+
+}

+ 56 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/IGoodsSpecService.java

@@ -0,0 +1,56 @@
+package com.zhongzheng.modules.goods.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.zhongzheng.modules.goods.bo.GoodsSpecAddBo;
+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.vo.GoodsSpecAttrDetailVo;
+import com.zhongzheng.modules.goods.vo.GoodsSpecVo;
+
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * 【请填写功能名称】Service接口
+ *
+ * @author ruoyi
+ * @date 2022-09-29
+ */
+public interface IGoodsSpecService extends IService<GoodsSpec> {
+	/**
+	 * 查询单个
+	 * @return
+	 */
+	GoodsSpecVo queryById(Long specId);
+
+	/**
+	 * 查询列表
+	 */
+	List<GoodsSpecVo> queryList(GoodsSpecQueryBo bo);
+
+	/**
+	 * 根据新增业务对象插入【请填写功能名称】
+	 * @param bo 【请填写功能名称】新增业务对象
+	 * @return
+	 */
+	Boolean insertByAddBo(GoodsSpecAddBo bo);
+
+	/**
+	 * 根据编辑业务对象修改【请填写功能名称】
+	 * @param bo 【请填写功能名称】编辑业务对象
+	 * @return
+	 */
+	Boolean updateByEditBo(GoodsSpecEditBo bo);
+
+	/**
+	 * 校验并删除数据
+	 * @param ids 主键集合
+	 * @param isValid 是否校验,true-删除前校验,false-不校验
+	 * @return
+	 */
+	Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
+
+    Integer saveBatchEntity(List<GoodsSpecAddBo> bos);
+
+}

+ 57 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/IGoodsSpecTemplateService.java

@@ -0,0 +1,57 @@
+package com.zhongzheng.modules.goods.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.zhongzheng.modules.goods.bo.GoodsSpecAddBo;
+import com.zhongzheng.modules.goods.bo.GoodsSpecTemplateAddBo;
+import com.zhongzheng.modules.goods.bo.GoodsSpecTemplateEditBo;
+import com.zhongzheng.modules.goods.bo.GoodsSpecTemplateQueryBo;
+import com.zhongzheng.modules.goods.domain.GoodsSpecTemplate;
+import com.zhongzheng.modules.goods.vo.*;
+
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * 【请填写功能名称】Service接口
+ *
+ * @author ruoyi
+ * @date 2022-09-29
+ */
+public interface IGoodsSpecTemplateService extends IService<GoodsSpecTemplate> {
+	/**
+	 * 查询单个
+	 * @return
+	 */
+	GoodsSpecTemplateVo queryById(Long specTemplateId);
+
+	/**
+	 * 查询列表
+	 */
+	List<GoodsSpecTemplateVo> queryList(GoodsSpecTemplateQueryBo bo);
+
+	/**
+	 * 根据新增业务对象插入【请填写功能名称】
+	 * @param bo 【请填写功能名称】新增业务对象
+	 * @return
+	 */
+	Boolean insertByAddBo(GoodsSpecTemplateAddBo bo);
+
+	/**
+	 * 根据编辑业务对象修改【请填写功能名称】
+	 * @param bo 【请填写功能名称】编辑业务对象
+	 * @return
+	 */
+	List<GoodsSpecAttributeRelationVo> updateByEditBo(GoodsSpecTemplateEditBo bo);
+
+	/**
+	 * 校验并删除数据
+	 * @param ids 主键集合
+	 * @param isValid 是否校验,true-删除前校验,false-不校验
+	 * @return
+	 */
+	Boolean deleteWithValidByIds(Long id, Boolean isValid);
+
+	List<GoodsSpecAttributeRelationVo> addSpec(GoodsSpecTemplateAddBo bo);
+
+	GoodsVo getSpecTemplate(Long specTemplateId, String specAttrIds);
+}

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

@@ -6,6 +6,8 @@ import cn.hutool.core.util.StrUtil;
 import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
+import com.tencentcloudapi.cme.v20191029.models.VideoEditTemplateMaterial;
 import com.zhongzheng.common.annotation.DataScope;
 import com.zhongzheng.common.exception.CustomException;
 import com.zhongzheng.common.utils.DateUtils;
@@ -14,26 +16,19 @@ import com.zhongzheng.modules.course.bo.CourseMenuAddBo;
 import com.zhongzheng.modules.course.bo.CourseMenuListAddBo;
 import com.zhongzheng.modules.course.bo.CourseMenuQueryBo;
 import com.zhongzheng.modules.course.bo.CourseQueryBo;
-import com.zhongzheng.modules.course.domain.CourseSectionWatchPer;
+import com.zhongzheng.modules.course.domain.*;
 import com.zhongzheng.modules.course.mapper.CourseMapper;
-import com.zhongzheng.modules.course.service.ICourseChapterSectionService;
-import com.zhongzheng.modules.course.service.ICourseMenuService;
-import com.zhongzheng.modules.course.service.ICourseModuleChapterService;
-import com.zhongzheng.modules.course.service.ICourseSectionWatchPerService;
+import com.zhongzheng.modules.course.service.*;
 import com.zhongzheng.modules.course.vo.*;
 import com.zhongzheng.modules.exam.bo.ExamNumberGoodsQueryBo;
 import com.zhongzheng.modules.exam.vo.ExamNumberGoodsVo;
 import com.zhongzheng.modules.goods.bo.*;
-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.domain.*;
 import com.zhongzheng.modules.goods.mapper.GoodsMapper;
-import com.zhongzheng.modules.goods.service.IGoodsAttachedService;
-import com.zhongzheng.modules.goods.service.IGoodsAuditionConfigService;
-import com.zhongzheng.modules.goods.service.IGoodsCourseService;
-import com.zhongzheng.modules.goods.service.IGoodsService;
+import com.zhongzheng.modules.goods.service.*;
 import com.zhongzheng.modules.goods.vo.*;
 import com.zhongzheng.modules.grade.vo.ClassGradeVo;
+import com.zhongzheng.modules.grade.vo.SyncGoodsExport;
 import com.zhongzheng.modules.order.domain.OrderGoods;
 import com.zhongzheng.modules.order.service.IOrderGoodsService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -89,6 +84,25 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
 
     @Autowired
     private ICourseSectionWatchPerService iCourseSectionWatchPerService;
+    @Autowired
+    private IGoodsSpecTemplateService goodsSpecTemplateService;
+    @Autowired
+    private IGoodsSpecAttributeRelationService goodsSpecAttributeRelationService;
+
+    @Autowired
+    private ICourseEducationTypeService iCourseEducationTypeService;
+
+    @Autowired
+    private ICourseProjectTypeService iCourseProjectTypeService;
+
+    @Autowired
+    private ICourseBusinessService iCourseBusinessService;
+
+    @Autowired
+    private  ICourseSubjectService iCourseSubjectService;
+
+    @Autowired
+    private  IGoodsSpecService goodsSpecService;
 
     @Override
     public GoodsVo queryById(Long goodsId){
@@ -178,7 +192,22 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
 
     @Override
     public GoodsVo selectDetail(Long goodsId) {
-        return baseMapper.selectDetail(goodsId);
+        GoodsVo goodsVo = baseMapper.selectDetail(goodsId);
+        if (ObjectUtils.isNotNull(goodsVo) && ObjectUtils.isNull(goodsVo.getSpecTemplateId())){
+            //没有绑定规格模板
+            //查询是否有绑定的模板
+            List<GoodsSpecAttributeRelation> list = goodsSpecAttributeRelationService
+                    .list(new LambdaQueryWrapper<GoodsSpecAttributeRelation>()
+                    .eq(GoodsSpecAttributeRelation::getStatus, 1)
+                    .eq(GoodsSpecAttributeRelation::getGoodsId, goodsId)
+                    .orderByDesc(GoodsSpecAttributeRelation::getCreateTime)
+                    .last("LIMIT 1"));
+            if (CollectionUtils.isNotEmpty(list)){
+                GoodsSpecAttributeRelation relation = list.stream().findFirst().get();
+                goodsVo.setSpecTemplateId(relation.getSpecTemplateId());
+            }
+        }
+        return goodsVo;
     }
 
     @Override
@@ -204,7 +233,7 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
         lqw.like(StrUtil.isNotBlank(bo.getGoodsName()), Goods::getGoodsName, bo.getGoodsName());
         lqw.eq(bo.getStandPrice() != null, Goods::getStandPrice, bo.getStandPrice());
         lqw.eq(bo.getLowestPrice() != null, Goods::getLowestPrice, bo.getLowestPrice());
-        lqw.eq(bo.getStatus() != null, Goods::getStatus, bo.getStatus());
+        lqw.in(bo.getStatus() != null, Goods::getStatus, bo.getStatus());
         lqw.eq(bo.getValidityStartTime() != null, Goods::getValidityStartTime, bo.getValidityStartTime());
         lqw.eq(bo.getValidityEndTime() != null, Goods::getValidityEndTime, bo.getValidityEndTime());
         lqw.eq(bo.getStudyStartTime() != null, Goods::getStudyStartTime, bo.getStudyStartTime());
@@ -599,4 +628,141 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
         return moduleExamList;
     }
 
+    @Override
+    public List<SyncGoodsExport> selectRjJzsList(GoodsQueryBo bo) {
+        CourseEducationType educationType = iCourseEducationTypeService.getOne(new LambdaQueryWrapper<CourseEducationType>().eq(CourseEducationType::getStatus, 1).eq(CourseEducationType::getEducationName,"继续教育").last("limit 1"));
+        CourseProjectType projectType = iCourseProjectTypeService.getOne(new LambdaQueryWrapper<CourseProjectType>().eq(CourseProjectType::getStatus, 1).eq(CourseProjectType::getEducationId,educationType.getId()).eq(CourseProjectType::getProjectName,"建造师").last("limit 1"));
+        CourseBusiness business = iCourseBusinessService.getOne(new LambdaQueryWrapper<CourseBusiness>().eq(CourseBusiness::getStatus, 1).eq(CourseBusiness::getProjectId,projectType.getId()).eq(CourseBusiness::getBusinessName,"二级").last("limit 1"));
+        GoodsQueryBo goodsQueryBo = new GoodsQueryBo();
+        goodsQueryBo.setEducationTypeId(educationType.getId());
+        goodsQueryBo.setBusinessId(business.getId());
+        goodsQueryBo.setGoodsStatus(1);
+        goodsQueryBo.setStatus(new ArrayList<Integer>(Arrays.asList(1)));
+        List<GoodsVo> goodsVoList = queryList(goodsQueryBo);
+        List<GoodsJzsVo> jzsVoList = new ArrayList<>();
+        for(GoodsVo goodsVo : goodsVoList){
+            if(goodsVo.getGoodsId()!=921L){
+                continue;
+            }
+            GoodsJzsVo jzsVo = new GoodsJzsVo();
+            jzsVo.setGoodsId(goodsVo.getGoodsId());
+            jzsVo.setGoodsName(goodsVo.getGoodsName());
+            jzsVo.setClassHours(goodsVo.getClassHours());
+            CourseSubject courseSubject = iCourseSubjectService.getOne(new LambdaQueryWrapper<CourseSubject>().eq(CourseSubject::getId, goodsVo.getSubjectIds()).last("limit 1"));
+            if(Validator.isNotEmpty(courseSubject)){
+                jzsVo.setSubjectName(courseSubject.getSubjectName());
+            }
+            List<GoodsJzsChapterVo> jzsChapterVoList = new ArrayList<>();
+            GoodsCourseQueryBo goodsCourseQueryBo = new GoodsCourseQueryBo();
+            goodsCourseQueryBo.setGoodsId(goodsVo.getGoodsId());
+            List<CourseVo> courseVoList = iGoodsCourseService.selectList(goodsCourseQueryBo);
+            for(CourseVo courseVo : courseVoList){
+                CourseMenuQueryBo menuQueryBo = new CourseMenuQueryBo();
+                menuQueryBo.setCourseId(courseVo.getCourseId());
+                List<CourseMenuVo> courseMenuVoList = iCourseMenuService.selectList(menuQueryBo);
+                courseMenuVoList.forEach(courseMenuVo -> {
+                    if(courseMenuVo.getType()==1){
+                        //获取章信息
+                        List<CourseModuleChapterVo> courseModuleChapterVoList = iCourseModuleChapterService.getListById(courseMenuVo.getMenuId());
+                        courseModuleChapterVoList.forEach(courseModuleChapterVo -> {
+                            //获取节信息
+                            List<CourseChapterSectionVo> courseChapterSectionVoList = iCourseChapterSectionService.getListById(courseModuleChapterVo.getChapterId());
+                            GoodsJzsChapterVo jzsChapterVo = new GoodsJzsChapterVo();
+                            jzsChapterVo.setChapterId(courseModuleChapterVo.getChapterId());
+                            jzsChapterVo.setChapterName(courseModuleChapterVo.getName());
+                            List<GoodsJzsSectionVo> sectionList = new ArrayList<>();
+                            courseChapterSectionVoList.forEach(sectionVo -> {
+                                GoodsJzsSectionVo sectionItem = new GoodsJzsSectionVo();
+                                sectionItem.setSectionId(sectionVo.getSectionId());
+                                sectionItem.setSectionName(sectionVo.getName());
+                                sectionItem.setSectionUrl(sectionVo.getRecordingUrl());
+                                sectionList.add(sectionItem);
+
+                            });
+                            jzsChapterVo.setSectionList(sectionList);
+                            jzsChapterVoList.add(jzsChapterVo);
+                        });
+                    }
+                });
+            }
+            jzsVo.setChapterList(jzsChapterVoList);
+            jzsVoList.add(jzsVo);
+        }
+        List<SyncGoodsExport> exportList = new ArrayList<>();
+        for(GoodsJzsVo jzsVo : jzsVoList){
+            for(GoodsJzsChapterVo chapterVo : jzsVo.getChapterList()){
+                for(GoodsJzsSectionVo sectionVo : chapterVo.getSectionList()){
+                    SyncGoodsExport goodsExport = new SyncGoodsExport();
+                    goodsExport.setGoodsId(jzsVo.getGoodsId());
+                    goodsExport.setGoodsName(jzsVo.getGoodsName());
+                    goodsExport.setSubjectName(jzsVo.getSubjectName());
+                    goodsExport.setClassHours(jzsVo.getClassHours());
+                    goodsExport.setChapterId(chapterVo.getChapterId());
+                    goodsExport.setChapterName(chapterVo.getChapterName());
+                    goodsExport.setSectionId(sectionVo.getSectionId());
+                    goodsExport.setSectionName(sectionVo.getSectionName());
+                    goodsExport.setSectionUrl(sectionVo.getSectionUrl());
+                    exportList.add(goodsExport);
+                }
+            }
+        }
+        return exportList;
+    }
+
+    /**
+     * 获取商品规格模板列表
+     * @author change
+     * @date 2022/10/9 16:38
+     * @param goodsId
+     * @return java.util.List<com.zhongzheng.modules.goods.vo.GoodsSpecTemplateVo>
+     */
+    @Override
+    public List<GoodsSpecTemplateVo> getSpecTemplateList(Long goodsId) {
+        List<GoodsSpecAttributeRelation> relationList = goodsSpecAttributeRelationService
+                .list(new LambdaQueryWrapper<GoodsSpecAttributeRelation>()
+                .eq(GoodsSpecAttributeRelation::getGoodsId, goodsId)
+                .eq(GoodsSpecAttributeRelation::getStatus, 1));
+        if (CollectionUtils.isEmpty(relationList)){
+            return new ArrayList<>();
+        }
+        Set<Long> specTemplateIds = relationList.stream().filter(x -> ObjectUtils.isNotNull(x.getSpecTemplateId()))
+                .map(GoodsSpecAttributeRelation::getSpecTemplateId).collect(Collectors.toSet());
+
+        List<GoodsSpecTemplate> templates = goodsSpecTemplateService
+                .list(new LambdaQueryWrapper<GoodsSpecTemplate>()
+                .in(GoodsSpecTemplate::getSpecTemplateId, specTemplateIds));
+        if (CollectionUtils.isEmpty(templates)){
+            return new ArrayList<>();
+        }
+
+        List<GoodsSpecTemplateVo> collect = templates.stream().map(x -> {
+            GoodsSpecTemplateVo vo = BeanUtil.toBean(x, GoodsSpecTemplateVo.class);
+            CourseEducationType educationType = iCourseEducationTypeService.getById(x.getEducationTypeId());
+            if (ObjectUtils.isNotNull(educationType)) {
+                vo.setEducationName(educationType.getEducationName());
+            }
+            CourseBusiness business = iCourseBusinessService.getById(x.getBusinessId());
+            if (ObjectUtils.isNotNull(business)) {
+                vo.setBusinessName(business.getAliasName());
+            }
+            int count = goodsSpecService.count(new LambdaQueryWrapper<GoodsSpec>()
+                    .eq(GoodsSpec::getSpecTemplateId, x.getSpecTemplateId())
+                    .eq(GoodsSpec::getStatus, 1));
+            vo.setSpecNumber(count);
+            return vo;
+        }).collect(Collectors.toList());
+
+        return collect;
+    }
+
+    @Override
+    public boolean updateSpecTemplate(GoodsSpecTempEditBo bo) {
+        Goods goods = getById(bo.getGoodsId());
+        if (ObjectUtils.isNull(goods)){
+            throw new CustomException("商品信息获取失败");
+        }
+        goods.setSpecTemplateId(bo.getSpecTemplateId());
+        return updateById(goods);
+    }
+
 }

+ 109 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/impl/GoodsSpecAttributeRelationServiceImpl.java

@@ -0,0 +1,109 @@
+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.ObjectUtils;
+import com.zhongzheng.common.exception.CustomException;
+import com.zhongzheng.common.utils.DateUtils;
+import com.zhongzheng.modules.goods.bo.GoodsSpecAttributeRelationAddBo;
+import com.zhongzheng.modules.goods.bo.GoodsSpecAttributeRelationEditBo;
+import com.zhongzheng.modules.goods.bo.GoodsSpecAttributeRelationQueryBo;
+import com.zhongzheng.modules.goods.domain.GoodsSpecAttributeRelation;
+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;
+
+/**
+ * 【请填写功能名称】Service业务层处理
+ *
+ * @author ruoyi
+ * @date 2022-09-29
+ */
+@Service
+public class GoodsSpecAttributeRelationServiceImpl extends ServiceImpl<GoodsSpecAttributeRelationMapper, GoodsSpecAttributeRelation> implements IGoodsSpecAttributeRelationService {
+
+    @Override
+    public GoodsSpecAttributeRelationVo queryById(Long id){
+        GoodsSpecAttributeRelation db = this.baseMapper.selectById(id);
+        return BeanUtil.toBean(db, GoodsSpecAttributeRelationVo.class);
+    }
+
+    @Override
+    public List<GoodsSpecAttributeRelationVo> queryList(GoodsSpecAttributeRelationQueryBo bo) {
+        LambdaQueryWrapper<GoodsSpecAttributeRelation> lqw = Wrappers.lambdaQuery();
+        lqw.eq(StrUtil.isNotBlank(bo.getSpecAttributeIds()), GoodsSpecAttributeRelation::getSpecAttributeIds, bo.getSpecAttributeIds());
+        lqw.eq(bo.getGoodsId() != null, GoodsSpecAttributeRelation::getGoodsId, bo.getGoodsId());
+        lqw.eq(bo.getSpecTemplateId() != null, GoodsSpecAttributeRelation::getSpecTemplateId, bo.getSpecTemplateId());
+        lqw.eq(bo.getStatus() != null, GoodsSpecAttributeRelation::getStatus, bo.getStatus());
+        return entity2Vo(this.list(lqw));
+    }
+
+    /**
+    * 实体类转化成视图对象
+    *
+    * @param collection 实体类集合
+    * @return
+    */
+    private List<GoodsSpecAttributeRelationVo> entity2Vo(Collection<GoodsSpecAttributeRelation> collection) {
+        List<GoodsSpecAttributeRelationVo> voList = collection.stream()
+                .map(any -> BeanUtil.toBean(any, GoodsSpecAttributeRelationVo.class))
+                .collect(Collectors.toList());
+        if (collection instanceof Page) {
+            Page<GoodsSpecAttributeRelation> page = (Page<GoodsSpecAttributeRelation>)collection;
+            Page<GoodsSpecAttributeRelationVo> pageVo = new Page<>();
+            BeanUtil.copyProperties(page,pageVo);
+            pageVo.addAll(voList);
+            voList = pageVo;
+        }
+        return voList;
+    }
+
+    @Override
+    public Boolean insertByAddBo(GoodsSpecAttributeRelationAddBo bo) {
+        GoodsSpecAttributeRelation add = BeanUtil.toBean(bo, GoodsSpecAttributeRelation.class);
+        validEntityBeforeSave(add);
+        add.setCreateTime(DateUtils.getNowTime());
+        add.setUpdateTime(DateUtils.getNowTime());
+        return this.save(add);
+    }
+
+    @Override
+    public Boolean updateByEditBo(GoodsSpecAttributeRelationEditBo bo) {
+        GoodsSpecAttributeRelation relation = getOne(new LambdaQueryWrapper<GoodsSpecAttributeRelation>()
+                .eq(GoodsSpecAttributeRelation::getSpecAttributeIds, bo.getSpecAttributeIds())
+                .eq(GoodsSpecAttributeRelation::getSpecTemplateId, bo.getSpecTemplateId()));
+        if (ObjectUtils.isNull(relation)){
+            throw new CustomException("规格属性关联信息获取失败");
+        }
+        relation.setGoodsId(bo.getGoodsId());
+        relation.setUpdateTime(DateUtils.getNowTime());
+        return this.updateById(relation);
+    }
+
+    /**
+     * 保存前的数据校验
+     *
+     * @param entity 实体类数据
+     */
+    private void validEntityBeforeSave(GoodsSpecAttributeRelation entity){
+        //TODO 做一些数据校验,如唯一约束
+    }
+
+    @Override
+    public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
+        if(isValid){
+            //TODO 做一些业务上的校验,判断是否需要校验
+        }
+        return this.removeByIds(ids);
+    }
+}

+ 108 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/impl/GoodsSpecAttributeServiceImpl.java

@@ -0,0 +1,108 @@
+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.zhongzheng.modules.goods.bo.GoodsSpecAttributeAddBo;
+import com.zhongzheng.modules.goods.bo.GoodsSpecAttributeEditBo;
+import com.zhongzheng.modules.goods.bo.GoodsSpecAttributeQueryBo;
+import com.zhongzheng.modules.goods.domain.GoodsSpecAttribute;
+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;
+
+/**
+ * 【请填写功能名称】Service业务层处理
+ *
+ * @author ruoyi
+ * @date 2022-09-29
+ */
+@Service
+public class GoodsSpecAttributeServiceImpl extends ServiceImpl<GoodsSpecAttributeMapper, GoodsSpecAttribute> implements IGoodsSpecAttributeService {
+
+    @Override
+    public GoodsSpecAttributeVo queryById(Long specAttributeId){
+        GoodsSpecAttribute db = this.baseMapper.selectById(specAttributeId);
+        return BeanUtil.toBean(db, GoodsSpecAttributeVo.class);
+    }
+
+    @Override
+    public List<GoodsSpecAttributeVo> queryList(GoodsSpecAttributeQueryBo bo) {
+        LambdaQueryWrapper<GoodsSpecAttribute> lqw = Wrappers.lambdaQuery();
+        lqw.eq(bo.getSpecId() != null, GoodsSpecAttribute::getSpecId, bo.getSpecId());
+        lqw.like(StrUtil.isNotBlank(bo.getName()), GoodsSpecAttribute::getName, bo.getName());
+        lqw.eq(StrUtil.isNotBlank(bo.getCode()), GoodsSpecAttribute::getCode, bo.getCode());
+        lqw.eq(bo.getSort() != null, GoodsSpecAttribute::getSort, bo.getSort());
+        lqw.eq(bo.getStatus() != null, GoodsSpecAttribute::getStatus, bo.getStatus());
+        return entity2Vo(this.list(lqw));
+    }
+
+    /**
+    * 实体类转化成视图对象
+    *
+    * @param collection 实体类集合
+    * @return
+    */
+    private List<GoodsSpecAttributeVo> entity2Vo(Collection<GoodsSpecAttribute> collection) {
+        List<GoodsSpecAttributeVo> voList = collection.stream()
+                .map(any -> BeanUtil.toBean(any, GoodsSpecAttributeVo.class))
+                .collect(Collectors.toList());
+        if (collection instanceof Page) {
+            Page<GoodsSpecAttribute> page = (Page<GoodsSpecAttribute>)collection;
+            Page<GoodsSpecAttributeVo> pageVo = new Page<>();
+            BeanUtil.copyProperties(page,pageVo);
+            pageVo.addAll(voList);
+            voList = pageVo;
+        }
+        return voList;
+    }
+
+    @Override
+    public Boolean insertByAddBo(GoodsSpecAttributeAddBo bo) {
+        GoodsSpecAttribute add = BeanUtil.toBean(bo, GoodsSpecAttribute.class);
+        validEntityBeforeSave(add);
+        add.setCreateTime(DateUtils.getNowTime());
+        add.setUpdateTime(DateUtils.getNowTime());
+        return this.save(add);
+    }
+
+    @Override
+    public Boolean updateByEditBo(GoodsSpecAttributeEditBo bo) {
+        GoodsSpecAttribute update = BeanUtil.toBean(bo, GoodsSpecAttribute.class);
+        validEntityBeforeSave(update);
+        update.setUpdateTime(DateUtils.getNowTime());
+        return this.updateById(update);
+    }
+
+    /**
+     * 保存前的数据校验
+     *
+     * @param entity 实体类数据
+     */
+    private void validEntityBeforeSave(GoodsSpecAttribute entity){
+        //TODO 做一些数据校验,如唯一约束
+    }
+
+    @Override
+    public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
+        if(isValid){
+            //TODO 做一些业务上的校验,判断是否需要校验
+        }
+        return this.removeByIds(ids);
+    }
+
+    @Override
+    public Integer saveBatchEntity(List<GoodsSpecAttributeAddBo> specAttrList) {
+        return baseMapper.saveBatchEntity(specAttrList);
+    }
+}

+ 119 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/impl/GoodsSpecServiceImpl.java

@@ -0,0 +1,119 @@
+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.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;
+
+/**
+ * 【请填写功能名称】Service业务层处理
+ *
+ * @author ruoyi
+ * @date 2022-09-29
+ */
+@Service
+public class GoodsSpecServiceImpl extends ServiceImpl<GoodsSpecMapper, GoodsSpec> implements IGoodsSpecService {
+
+    @Autowired
+    private GoodsSpecAttributeServiceImpl goodsSpecAttributeServiceImpl;
+
+    @Override
+    public GoodsSpecVo queryById(Long specId){
+        GoodsSpec db = this.baseMapper.selectById(specId);
+        return BeanUtil.toBean(db, GoodsSpecVo.class);
+    }
+
+    @Override
+    public List<GoodsSpecVo> queryList(GoodsSpecQueryBo bo) {
+        LambdaQueryWrapper<GoodsSpec> lqw = Wrappers.lambdaQuery();
+        lqw.eq(bo.getSpecTemplateId() != null, GoodsSpec::getSpecTemplateId, bo.getSpecTemplateId());
+        lqw.like(StrUtil.isNotBlank(bo.getName()), GoodsSpec::getName, bo.getName());
+        lqw.eq(StrUtil.isNotBlank(bo.getCode()), GoodsSpec::getCode, bo.getCode());
+        lqw.eq(bo.getSort() != null, GoodsSpec::getSort, bo.getSort());
+        lqw.eq(bo.getStatus() != null, GoodsSpec::getStatus, bo.getStatus());
+        return entity2Vo(this.list(lqw));
+    }
+
+    /**
+    * 实体类转化成视图对象
+    *
+    * @param collection 实体类集合
+    * @return
+    */
+    private List<GoodsSpecVo> entity2Vo(Collection<GoodsSpec> collection) {
+        List<GoodsSpecVo> voList = collection.stream()
+                .map(any -> BeanUtil.toBean(any, GoodsSpecVo.class))
+                .collect(Collectors.toList());
+        if (collection instanceof Page) {
+            Page<GoodsSpec> page = (Page<GoodsSpec>)collection;
+            Page<GoodsSpecVo> pageVo = new Page<>();
+            BeanUtil.copyProperties(page,pageVo);
+            pageVo.addAll(voList);
+            voList = pageVo;
+        }
+        return voList;
+    }
+
+    @Override
+    public Boolean insertByAddBo(GoodsSpecAddBo bo) {
+        GoodsSpec add = BeanUtil.toBean(bo, GoodsSpec.class);
+        validEntityBeforeSave(add);
+        add.setCreateTime(DateUtils.getNowTime());
+        add.setUpdateTime(DateUtils.getNowTime());
+        return this.save(add);
+    }
+
+    @Override
+    public Boolean updateByEditBo(GoodsSpecEditBo bo) {
+        GoodsSpec update = BeanUtil.toBean(bo, GoodsSpec.class);
+        validEntityBeforeSave(update);
+        update.setUpdateTime(DateUtils.getNowTime());
+        return this.updateById(update);
+    }
+
+    /**
+     * 保存前的数据校验
+     *
+     * @param entity 实体类数据
+     */
+    private void validEntityBeforeSave(GoodsSpec entity){
+        //TODO 做一些数据校验,如唯一约束
+    }
+
+    @Override
+    public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
+        if(isValid){
+            //TODO 做一些业务上的校验,判断是否需要校验
+        }
+        return this.removeByIds(ids);
+    }
+
+    @Override
+    public Integer saveBatchEntity(List<GoodsSpecAddBo> bos) {
+        return baseMapper.saveBatchEntity(bos);
+    }
+
+
+}

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

@@ -0,0 +1,454 @@
+package com.zhongzheng.modules.goods.service.impl;
+
+import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.util.StrUtil;
+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.exception.CustomException;
+import com.zhongzheng.common.utils.DateUtils;
+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.service.ICourseBusinessService;
+import com.zhongzheng.modules.course.service.ICourseEducationTypeService;
+import com.zhongzheng.modules.course.service.ICourseSubjectService;
+import com.zhongzheng.modules.goods.bo.*;
+import com.zhongzheng.modules.goods.domain.*;
+import com.zhongzheng.modules.goods.mapper.GoodsSpecTemplateMapper;
+import com.zhongzheng.modules.goods.service.*;
+import com.zhongzheng.modules.goods.vo.*;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.*;
+import java.util.stream.Collectors;
+
+/**
+ * 【请填写功能名称】Service业务层处理
+ *
+ * @author ruoyi
+ * @date 2022-09-29
+ */
+@Service
+public class GoodsSpecTemplateServiceImpl extends ServiceImpl<GoodsSpecTemplateMapper, GoodsSpecTemplate> implements IGoodsSpecTemplateService {
+
+    @Autowired
+    private IGoodsSpecAttributeService goodsSpecAttributeService;
+    @Autowired
+    public IGoodsSpecService goodsSpecService;
+    @Autowired
+    public IGoodsSpecAttributeRelationService goodsSpecAttributeRelationService;
+    @Autowired
+    public IGoodsService goodsService;
+    @Autowired
+    public ICourseSubjectService courseSubjectService;
+    @Autowired
+    public ICourseEducationTypeService courseEducationTypeService;
+    @Autowired
+    public ICourseBusinessService courseBusinessService;
+
+    @Override
+    public GoodsSpecTemplateVo queryById(Long specTemplateId){
+        GoodsSpecTemplate db = this.baseMapper.selectById(specTemplateId);
+        if (ObjectUtils.isNull(db)){
+            return null;
+        }
+        GoodsSpecTemplateVo vo = BeanUtil.toBean(db, GoodsSpecTemplateVo.class);
+        List<GoodsSpec> specList = goodsSpecService.list(new LambdaQueryWrapper<GoodsSpec>()
+                .eq(GoodsSpec::getSpecTemplateId, specTemplateId)
+                .orderByAsc(GoodsSpec::getSort));
+        if (CollectionUtils.isNotEmpty(specList)){
+            List<GoodsSpecVo> specVos = specList.stream().map(item -> {
+                GoodsSpecVo goodsSpecVo = BeanUtil.toBean(item, GoodsSpecVo.class);
+                List<GoodsSpecAttribute> attrList = goodsSpecAttributeService.list(new LambdaQueryWrapper<GoodsSpecAttribute>()
+                        .eq(GoodsSpecAttribute::getSpecId, item.getSpecId())
+                        .orderByAsc(GoodsSpecAttribute::getSort));
+                if (CollectionUtils.isNotEmpty(attrList)) {
+                    List<GoodsSpecAttributeVo> attrVos = attrList.stream().map(x -> BeanUtil.toBean(x, GoodsSpecAttributeVo.class)).collect(Collectors.toList());
+                    goodsSpecVo.setSpecAttrList(attrVos);
+                }
+                return goodsSpecVo;
+            }).collect(Collectors.toList());
+            vo.setSpecList(specVos);
+        }
+        return vo;
+    }
+
+    @Override
+    public List<GoodsSpecTemplateVo> queryList(GoodsSpecTemplateQueryBo bo) {
+        LambdaQueryWrapper<GoodsSpecTemplate> lqw = Wrappers.lambdaQuery();
+        lqw.eq(StrUtil.isNotBlank(bo.getCode()), GoodsSpecTemplate::getCode, bo.getCode());
+        lqw.eq(bo.getEducationTypeId() != null, GoodsSpecTemplate::getEducationTypeId, bo.getEducationTypeId());
+        lqw.eq(bo.getBusinessId() != null, GoodsSpecTemplate::getBusinessId, bo.getBusinessId());
+        lqw.like(StrUtil.isNotBlank(bo.getName()), GoodsSpecTemplate::getName, bo.getName());
+        lqw.eq(bo.getStatus() != null, GoodsSpecTemplate::getStatus, bo.getStatus());
+        lqw.orderByDesc(GoodsSpecTemplate::getCreateTime);
+        List<GoodsSpecTemplateVo> vos = entity2Vo(this.list(lqw));
+        if (CollectionUtils.isNotEmpty(vos)){
+            vos.forEach(item -> {
+                CourseEducationType type = courseEducationTypeService.getById(item.getEducationTypeId());
+                if (ObjectUtils.isNotNull(type)){
+                    item.setEducationName(type.getEducationName());
+                }
+                CourseBusiness business = courseBusinessService.getById(item.getBusinessId());
+                if (ObjectUtils.isNotNull(business)){
+                    item.setBusinessName(business.getAliasName());
+                }
+                int count = goodsSpecService.count(new LambdaQueryWrapper<GoodsSpec>()
+                        .eq(GoodsSpec::getSpecTemplateId, item.getSpecTemplateId()));
+                item.setSpecNumber(count);
+            });
+        }
+        return vos;
+    }
+
+    /**
+    * 实体类转化成视图对象
+    *
+    * @param collection 实体类集合
+    * @return
+    */
+    private List<GoodsSpecTemplateVo> entity2Vo(Collection<GoodsSpecTemplate> collection) {
+        List<GoodsSpecTemplateVo> voList = collection.stream()
+                .map(any -> BeanUtil.toBean(any, GoodsSpecTemplateVo.class))
+                .collect(Collectors.toList());
+        if (collection instanceof Page) {
+            Page<GoodsSpecTemplate> page = (Page<GoodsSpecTemplate>)collection;
+            Page<GoodsSpecTemplateVo> pageVo = new Page<>();
+            BeanUtil.copyProperties(page,pageVo);
+            pageVo.addAll(voList);
+            voList = pageVo;
+        }
+        return voList;
+    }
+
+    @Override
+    public Boolean insertByAddBo(GoodsSpecTemplateAddBo bo) {
+        GoodsSpecTemplate add = BeanUtil.toBean(bo, GoodsSpecTemplate.class);
+        validEntityBeforeSave(add);
+        add.setCreateTime(DateUtils.getNowTime());
+        add.setUpdateTime(DateUtils.getNowTime());
+        return this.save(add);
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public List<GoodsSpecAttributeRelationVo> updateByEditBo(GoodsSpecTemplateEditBo bo) {
+        GoodsSpecTemplate goodsSpecTemplate = new GoodsSpecTemplate();
+        BeanUtil.copyProperties(bo,goodsSpecTemplate);
+        goodsSpecTemplate.setUpdateTime(DateUtils.getNowTime());
+        updateById(goodsSpecTemplate);
+        List<GoodsSpecAddBo> specList = bo.getSpecList();
+        List<GoodsSpec> list = goodsSpecService.list(new LambdaQueryWrapper<GoodsSpec>()
+                .eq(GoodsSpec::getSpecTemplateId, bo.getSpecTemplateId()));
+        if (CollectionUtils.isEmpty(specList) || specList.stream().anyMatch(x -> ObjectUtils.isNull(x.getSpecId()))){
+            deleteSpecAttr(bo);
+        }else if (CollectionUtils.isNotEmpty(list)){
+            List<Long> collect = list.stream().map(GoodsSpec::getSpecId).collect(Collectors.toList());
+            List<Long> collect1 = specList.stream().filter(x -> ObjectUtils.isNotNull(x.getSpecId())).map(GoodsSpecAddBo::getSpecId).collect(Collectors.toList());
+            if (collect.size() != collect1.size()){
+                //与数据库的规格数量不一样.删除以后重新添加
+                deleteSpecAttr(bo);
+            }else {
+                //只删除或者修改了规格值
+                updateSpecAttr(bo);
+            }
+        }else {
+            deleteSpecAttr(bo);
+        }
+        specAttrRelList = new ArrayList<>();
+        //组装规格属性列表
+        createSpec(specList,specList.get(0).getSpecAttrList(),0,new ArrayList<>(),goodsSpecTemplate.getSpecTemplateId());
+        return specAttrRelList;
+    }
+
+    private void updateSpecAttr(GoodsSpecTemplateEditBo bo){
+        List<GoodsSpecAddBo> specList = bo.getSpecList();
+        List<Long> attrIds = new ArrayList<>();
+        specList.forEach(item -> {
+            if (CollectionUtils.isNotEmpty(item.getSpecAttrList())){
+                List<Long> collect = item.getSpecAttrList().stream().filter(x -> ObjectUtils.isNotNull(x.getSpecAttributeId())).map(GoodsSpecAttributeAddBo::getSpecAttributeId).collect(Collectors.toList());
+                attrIds.addAll(collect);
+            }
+        });
+        List<Long> specIds = specList.stream().map(GoodsSpecAddBo::getSpecId).collect(Collectors.toList());
+        List<GoodsSpecAttribute> list = goodsSpecAttributeService.list(new LambdaQueryWrapper<GoodsSpecAttribute>()
+                .in(GoodsSpecAttribute::getSpecId, specIds)
+                .notIn(GoodsSpecAttribute::getSpecAttributeId, attrIds));
+        if (CollectionUtils.isNotEmpty(list)){
+            list.forEach(item -> {
+                goodsSpecAttributeRelationService.remove(new LambdaQueryWrapper<GoodsSpecAttributeRelation>()
+                .eq(GoodsSpecAttributeRelation::getSpecTemplateId,bo.getSpecTemplateId())
+                .like(GoodsSpecAttributeRelation::getSpecAttributeIds,item.getSpecAttributeId()));
+            });
+            goodsSpecAttributeService.removeByIds(list.stream().map(GoodsSpecAttribute::getSpecAttributeId).collect(Collectors.toList()));
+        }
+        Integer sort = 1;
+        for (GoodsSpecAddBo spec : specList) {
+            GoodsSpec goodsSpec = new GoodsSpec();
+            BeanUtil.copyProperties(spec,goodsSpec);
+            goodsSpec.setStatus(1);
+            goodsSpec.setSpecTemplateId(bo.getSpecTemplateId());
+            goodsSpec.setUpdateTime(DateUtils.getNowTime());
+            goodsSpec.setSort(sort);
+            goodsSpecService.updateById(goodsSpec);
+            spec.setSpecId(goodsSpec.getSpecId());
+            if (CollectionUtils.isNotEmpty(spec.getSpecAttrList())){
+                Integer attrSort = 1;
+                for (GoodsSpecAttributeAddBo item : spec.getSpecAttrList()) {
+                    GoodsSpecAttribute goodsSpecAttribute = new GoodsSpecAttribute();
+                    BeanUtil.copyProperties(item, goodsSpecAttribute);
+                    if (ObjectUtils.isNull(goodsSpecAttribute.getCreateTime())){
+                        goodsSpecAttribute.setCreateTime(DateUtils.getNowTime());
+                    }
+                    goodsSpecAttribute.setStatus(1);
+                    goodsSpecAttribute.setUpdateTime(DateUtils.getNowTime());
+                    goodsSpecAttribute.setSpecId(goodsSpec.getSpecId());
+                    if (ObjectUtils.isNull(item.getSort())){
+                        goodsSpecAttribute.setSort(attrSort);
+                    }
+                    goodsSpecAttributeService.saveOrUpdate(goodsSpecAttribute);
+                    item.setSpecAttributeId(goodsSpecAttribute.getSpecAttributeId());
+                    attrSort ++;
+                }
+            }
+            sort ++;
+        }
+    }
+
+    private void deleteSpecAttr(GoodsSpecTemplateEditBo bo){
+        List<GoodsSpecAddBo> specList = bo.getSpecList();
+        //有新增的规格
+        List<GoodsSpec> list = goodsSpecService.list(new LambdaQueryWrapper<GoodsSpec>()
+                .eq(GoodsSpec::getSpecTemplateId, bo.getSpecTemplateId()));
+        if (CollectionUtils.isNotEmpty(list)){
+            List<Long> collect = list.stream().map(x -> x.getSpecId()).collect(Collectors.toList());
+            //清除规格属性
+            goodsSpecAttributeService.remove(new LambdaQueryWrapper<GoodsSpecAttribute>()
+                    .in(GoodsSpecAttribute::getSpecId,collect));
+            //清除属性绑定的商品信息
+            goodsSpecAttributeRelationService.remove(new LambdaQueryWrapper<GoodsSpecAttributeRelation>()
+                    .eq(GoodsSpecAttributeRelation::getSpecTemplateId,bo.getSpecTemplateId()));
+            //清除规格
+            goodsSpecService.remove(new LambdaQueryWrapper<GoodsSpec>().eq(GoodsSpec::getSpecTemplateId,bo.getSpecTemplateId()));
+        }
+        if (CollectionUtils.isNotEmpty(specList)){
+            //重新添加规格
+            Integer sort = 1;
+            //新增规格和规格值
+            for (GoodsSpecAddBo spec : specList) {
+                spec.setStatus(1);
+                spec.setSpecTemplateId(bo.getSpecTemplateId());
+                spec.setCreateTime(DateUtils.getNowTime());
+                spec.setUpdateTime(DateUtils.getNowTime());
+                spec.setSort(sort);
+                sort ++;
+            }
+            goodsSpecService.saveBatchEntity(specList);
+            for (GoodsSpecAddBo specAddBo : specList) {
+                Integer attrSort = 1;//排序值
+                if (CollectionUtils.isNotEmpty(specAddBo.getSpecAttrList())){
+                    for (GoodsSpecAttributeAddBo item : specAddBo.getSpecAttrList()) {
+                        item.setStatus(1);
+                        item.setCreateTime(DateUtils.getNowTime());
+                        item.setUpdateTime(DateUtils.getNowTime());
+                        item.setSpecId(specAddBo.getSpecId());
+                        if (ObjectUtils.isNull(item.getSort())){
+                            item.setSort(attrSort);
+                        }
+                        attrSort ++;
+                    }
+                    goodsSpecAttributeService.saveBatchEntity(specAddBo.getSpecAttrList());
+                }
+            }
+//            for (GoodsSpecAddBo spec : specList) {
+//                GoodsSpec goodsSpec = new GoodsSpec();
+//                BeanUtil.copyProperties(spec,goodsSpec);
+//                goodsSpec.setSpecTemplateId(bo.getSpecTemplateId());
+//                goodsSpec.setCreateTime(DateUtils.getNowTime());
+//                goodsSpec.setUpdateTime(DateUtils.getNowTime());
+//                goodsSpec.setSort(sort);
+//                goodsSpecService.save(goodsSpec);
+//                spec.setSpecId(goodsSpec.getSpecId());
+//                if (CollectionUtils.isNotEmpty(spec.getSpecAttrList())){
+//                    Integer attrSortId = 1;
+//                    for (GoodsSpecAttributeAddBo item : spec.getSpecAttrList()) {
+//                        GoodsSpecAttribute goodsSpecAttribute = new GoodsSpecAttribute();
+//                        BeanUtil.copyProperties(item, goodsSpecAttribute);
+//                        goodsSpecAttribute.setCreateTime(DateUtils.getNowTime());
+//                        goodsSpecAttribute.setUpdateTime(DateUtils.getNowTime());
+//                        goodsSpecAttribute.setSpecId(goodsSpec.getSpecId());
+//                        if (ObjectUtils.isNull(item.getSort())){
+//                            goodsSpecAttribute.setSort(attrSortId);
+//                        }
+//                        goodsSpecAttributeService.save(goodsSpecAttribute);
+//                        item.setSpecAttributeId(goodsSpecAttribute.getSpecAttributeId());
+//                        attrSortId ++;
+//                    }
+//                }
+//                sort ++;
+//            }
+        }
+    };
+
+    /**
+     * 保存前的数据校验
+     *
+     * @param entity 实体类数据
+     */
+    private void validEntityBeforeSave(GoodsSpecTemplate entity){
+        //TODO 做一些数据校验,如唯一约束
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public Boolean deleteWithValidByIds(Long id, Boolean isValid) {
+        if(isValid){
+            //TODO 做一些业务上的校验,判断是否需要校验
+        }
+        GoodsSpecTemplate template = getById(id);
+        if (Objects.isNull(template)){
+            throw new CustomException("模板信息获取失败");
+        }
+        //删除规格模板关联的信息
+        List<GoodsSpec> list = goodsSpecService.list(new LambdaQueryWrapper<GoodsSpec>()
+                .eq(GoodsSpec::getSpecTemplateId, id));
+        if (CollectionUtils.isNotEmpty(list)){
+            List<Long> specIds = list.stream().map(GoodsSpec::getSpecId).collect(Collectors.toList());
+            goodsSpecAttributeService.remove(new LambdaQueryWrapper<GoodsSpecAttribute>()
+            .in(GoodsSpecAttribute::getSpecId,specIds));
+            goodsSpecService.remove(new LambdaQueryWrapper<GoodsSpec>()
+            .eq(GoodsSpec::getSpecTemplateId,id));
+        }
+        goodsSpecAttributeRelationService.remove(new LambdaQueryWrapper<GoodsSpecAttributeRelation>()
+        .eq(GoodsSpecAttributeRelation::getSpecTemplateId,id));
+        return removeById(template);
+    }
+
+    public List<GoodsSpecAttributeRelationVo> specAttrRelList;
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public List<GoodsSpecAttributeRelationVo> addSpec(GoodsSpecTemplateAddBo addBo) {
+        //新增模板
+        GoodsSpecTemplate goodsSpecTemplate = new GoodsSpecTemplate();
+        BeanUtil.copyProperties(addBo,goodsSpecTemplate);
+        goodsSpecTemplate.setCreateTime(DateUtils.getNowTime());
+        goodsSpecTemplate.setUpdateTime(DateUtils.getNowTime());
+        save(goodsSpecTemplate);
+        addBo.setSpecTemplateId(goodsSpecTemplate.getSpecTemplateId());
+        List<GoodsSpecAddBo> bos = addBo.getSpecList();
+        Integer sort = 1;//排序值
+        //新增规格和规格值
+        for (GoodsSpecAddBo bo : bos) {
+            bo.setStatus(1);
+            bo.setSpecTemplateId(goodsSpecTemplate.getSpecTemplateId());
+            bo.setCreateTime(DateUtils.getNowTime());
+            bo.setUpdateTime(DateUtils.getNowTime());
+            bo.setSort(sort);
+            sort ++;
+        }
+        goodsSpecService.saveBatchEntity(bos);
+        for (GoodsSpecAddBo specAddBo : bos) {
+            Integer attrSort = 1;//排序值
+            if (CollectionUtils.isNotEmpty(specAddBo.getSpecAttrList())){
+                for (GoodsSpecAttributeAddBo item : specAddBo.getSpecAttrList()) {
+                    item.setStatus(1);
+                    item.setCreateTime(DateUtils.getNowTime());
+                    item.setUpdateTime(DateUtils.getNowTime());
+                    item.setSpecId(specAddBo.getSpecId());
+                    if (ObjectUtils.isNull(item.getSort())){
+                        item.setSort(attrSort);
+                    }
+                    attrSort ++;
+                }
+                goodsSpecAttributeService.saveBatchEntity(specAddBo.getSpecAttrList());
+            }
+        }
+        specAttrRelList = new ArrayList<>();
+        //组装规格属性列表
+        createSpec(bos,bos.get(0).getSpecAttrList(),0,new ArrayList<>(),goodsSpecTemplate.getSpecTemplateId());
+        return specAttrRelList;
+    }
+
+    private void createSpec(List<GoodsSpecAddBo> bos, List<GoodsSpecAttributeAddBo> specAttrList, int index, List<GoodsSpecAttrListVo> vos,Long specTemplateId) {
+        for (int k = 0; k < specAttrList.size(); k++) {
+            List<GoodsSpecAttrListVo> attrListVos = copyList(vos);
+            if (index < bos.size() - 1){
+                GoodsSpecAttrListVo vo = new GoodsSpecAttrListVo();
+                vo.setKey(specAttrList.get(k).getSpecAttributeId());
+                vo.setValue(specAttrList.get(k).getName());
+                attrListVos.add(vo);
+                createSpec(bos,bos.get(index + 1).getSpecAttrList(),index + 1,attrListVos,specTemplateId);
+            }else {
+                GoodsSpecAttrListVo vo = new GoodsSpecAttrListVo();
+                vo.setKey(specAttrList.get(k).getSpecAttributeId());
+                vo.setValue(specAttrList.get(k).getName());
+                attrListVos.add(vo);
+                GoodsSpecAttributeRelationVo relationVo = new GoodsSpecAttributeRelationVo();
+                relationVo.setAttrListVos(attrListVos);
+                //模板信息
+                GoodsSpecTemplate specTemplate = getById(specTemplateId);
+                relationVo.setSpecTemplateId(specTemplate.getSpecTemplateId());
+                relationVo.setEducationTypeId(specTemplate.getEducationTypeId());
+                relationVo.setBusinessId(specTemplate.getBusinessId());
+                List<Long> attrIds = attrListVos.stream().map(GoodsSpecAttrListVo::getKey).collect(Collectors.toList());
+                //添加商品信息
+               GoodsSpecAttributeRelation attributeRelations = goodsSpecAttributeRelationService
+                        .getOne(new LambdaQueryWrapper<GoodsSpecAttributeRelation>()
+                        .eq(GoodsSpecAttributeRelation::getSpecTemplateId, specTemplateId)
+                        .eq(GoodsSpecAttributeRelation::getSpecAttributeIds,StringUtils.join(attrIds,",")));
+               if (ObjectUtils.isNotNull(attributeRelations) && ObjectUtils.isNotNull(attributeRelations.getGoodsId())){
+                   Goods goods = goodsService.getById(attributeRelations.getGoodsId());
+                   relationVo.setGoodsName(goods.getGoodsName());
+                   relationVo.setGoodsType(goods.getGoodsType());
+                   relationVo.setGoodsStatus(goods.getGoodsStatus());
+                   relationVo.setCode(goods.getCode());
+                   relationVo.setGoodsId(goods.getGoodsId());
+                   relationVo.setServiceTimeNum(goods.getServiceTimeNum());
+                   relationVo.setServiceTimeType(goods.getServiceTimeType());
+                   relationVo.setStandPrice(goods.getStandPrice());
+                   relationVo.setValidityStartTime(goods.getValidityStartTime());
+                   relationVo.setValidityEndTime(goods.getValidityEndTime());
+                   if (StrUtil.isNotBlank(goods.getSubjectIds())) {
+                       relationVo.setSubjectIds(goods.getSubjectIds());
+                       List<String> ids = Arrays.stream(goods.getSubjectIds().split(",")).collect(Collectors.toList());
+                       //科目名称
+                       List<CourseSubject> subjectList = courseSubjectService.list(new LambdaQueryWrapper<CourseSubject>()
+                               .in(CourseSubject::getId, ids));
+                       List<String> names = subjectList.stream().map(CourseSubject::getSubjectName).collect(Collectors.toList());
+                       relationVo.setSubjectNames(StringUtils.join(names, ","));
+                   }
+               }
+                specAttrRelList.add(relationVo);
+            }
+        }
+    }
+
+    private List<GoodsSpecAttrListVo> copyList(List<GoodsSpecAttrListVo> list){
+        if (CollectionUtils.isEmpty(list)){
+            return new ArrayList<>();
+        }
+        return list.stream().map(x -> BeanUtil.toBean(x,GoodsSpecAttrListVo.class)).collect(Collectors.toList());
+    }
+
+
+    @Override
+    public GoodsVo getSpecTemplate(Long specTemplateId, String specAttrIds) {
+        GoodsSpecAttributeRelation relation = goodsSpecAttributeRelationService.getOne(new LambdaQueryWrapper<GoodsSpecAttributeRelation>()
+                .eq(GoodsSpecAttributeRelation::getSpecTemplateId, specTemplateId)
+                .eq(GoodsSpecAttributeRelation::getSpecAttributeIds, specAttrIds));
+        if (ObjectUtils.isNull(relation) || ObjectUtils.isNull(relation.getGoodsId())){
+            throw new CustomException("该规格属性下没有设置商品!请检查");
+        }
+        Goods goods = goodsService.getById(relation.getGoodsId());
+        return BeanUtil.toBean(goods,GoodsVo.class);
+    }
+
+}

+ 29 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/vo/GoodsJzsChapterVo.java

@@ -0,0 +1,29 @@
+package com.zhongzheng.modules.goods.vo;
+
+import com.zhongzheng.common.annotation.Excel;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+@ApiModel("建造师商品章视图对象")
+public class GoodsJzsChapterVo {
+
+    private static final long serialVersionUID = 1L;
+
+    /** 章ID */
+    @Excel(name = "章ID")
+    @ApiModelProperty("章ID")
+    private Long chapterId;
+
+    /** 章名称 */
+    @Excel(name = "章名称")
+    @ApiModelProperty("章名称")
+    private String chapterName;
+
+
+    @ApiModelProperty("节列表")
+    private List<GoodsJzsSectionVo> sectionList;
+}

+ 27 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/vo/GoodsJzsSectionVo.java

@@ -0,0 +1,27 @@
+package com.zhongzheng.modules.goods.vo;
+
+import com.zhongzheng.common.annotation.Excel;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+@Data
+@ApiModel("建造师商品节视图对象")
+public class GoodsJzsSectionVo {
+
+    private static final long serialVersionUID = 1L;
+
+
+    @Excel(name = "节id")
+    @ApiModelProperty("节id")
+    private Long sectionId;
+
+    /** 节名称 */
+    @Excel(name = "节名称")
+    @ApiModelProperty("节名称")
+    private String sectionName;
+
+    @Excel(name = "节视频地址")
+    @ApiModelProperty("节视频地址")
+    private String sectionUrl;
+}

+ 35 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/vo/GoodsJzsVo.java

@@ -0,0 +1,35 @@
+package com.zhongzheng.modules.goods.vo;
+
+import com.zhongzheng.common.annotation.Excel;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.util.List;
+
+@Data
+@ApiModel("商品视图对象")
+public class GoodsJzsVo {
+
+    private static final long serialVersionUID = 1L;
+
+
+    @ApiModelProperty("商品ID")
+    private Long goodsId;
+
+    /** 商品名称 */
+    @Excel(name = "商品名称")
+    @ApiModelProperty("商品名称")
+    private String goodsName;
+
+    @ApiModelProperty("科目名称")
+    private String subjectName;
+
+    /** 学时 */
+    @ApiModelProperty("学时")
+    private BigDecimal classHours;
+
+    @ApiModelProperty("章列表")
+    private List<GoodsJzsChapterVo> chapterList;
+}

+ 43 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/vo/GoodsSpecAttrDetailVo.java

@@ -0,0 +1,43 @@
+package com.zhongzheng.modules.goods.vo;
+
+import com.zhongzheng.common.annotation.Excel;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.List;
+
+
+/**
+ * 规格属性详情VO
+ *
+ * @author ruoyi
+ * @date 2022-09-29
+ */
+@Data
+@ApiModel("规格属性详情VO")
+public class GoodsSpecAttrDetailVo {
+	private static final long serialVersionUID = 1L;
+
+	/** 规格属性ID */
+	@ApiModelProperty("规格属性ID")
+	private Long specAttributeId;
+
+	/** 规格ID */
+	@ApiModelProperty("规格ID")
+	private Long specId;
+	/** 值名称 */
+	@ApiModelProperty("值名称")
+	private String name;
+	/** 编码 */
+	@ApiModelProperty("编码")
+	private String code;
+	/** 排序值 */
+	@ApiModelProperty("排序值")
+	private Integer sort;
+	/** 1有效 0无效 */
+	@ApiModelProperty("1有效 0无效")
+	private Integer status;
+	@ApiModelProperty("子规格属性值集合")
+	private List<GoodsSpecAttrDetailVo> childrenSpecAttr;
+}

+ 25 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/vo/GoodsSpecAttrListVo.java

@@ -0,0 +1,25 @@
+package com.zhongzheng.modules.goods.vo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+
+/**
+ * 【请填写功能名称】视图对象 mall_package
+ *
+ * @author ruoyi
+ * @date 2022-09-29
+ */
+@Data
+@ApiModel("【请填写功能名称】视图对象")
+public class GoodsSpecAttrListVo {
+	private static final long serialVersionUID = 1L;
+
+	/** 规格属性ID */
+	@ApiModelProperty("规格属性ID")
+	private Long key;
+
+	@ApiModelProperty("规格属性名称")
+	private String value;
+}

+ 75 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/vo/GoodsSpecAttributeRelationVo.java

@@ -0,0 +1,75 @@
+package com.zhongzheng.modules.goods.vo;
+
+import com.zhongzheng.common.annotation.Excel;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.util.Date;
+import java.util.List;
+
+
+/**
+ * 【请填写功能名称】视图对象 mall_package
+ *
+ * @author ruoyi
+ * @date 2022-09-29
+ */
+@Data
+@ApiModel("【请填写功能名称】视图对象")
+public class GoodsSpecAttributeRelationVo {
+	private static final long serialVersionUID = 1L;
+
+	/** 主键 */
+	@ApiModelProperty("主键")
+	private Long id;
+
+	/** 规格属性ID集合 */
+	@Excel(name = "规格属性ID集合")
+	@ApiModelProperty("规格属性ID集合")
+	private String specAttributeIds;
+	/** 商品ID */
+	@Excel(name = "商品ID")
+	@ApiModelProperty("商品ID")
+	private Long goodsId;
+	/** 规格模板ID */
+	@Excel(name = "规格模板ID")
+	@ApiModelProperty("规格模板ID")
+	private Long specTemplateId;
+	@ApiModelProperty("规格模板ID")
+	private Long educationTypeId;
+	@ApiModelProperty("规格模板ID")
+	private Long businessId;
+	/** 1有效 0无效 */
+	@Excel(name = "1有效 0无效")
+	@ApiModelProperty("1有效 0无效")
+	private Integer status;
+
+	@ApiModelProperty("商品名称")
+	private String goodsName;
+	@ApiModelProperty("1上架 0未上架")
+	private Integer goodsStatus;
+	@ApiModelProperty("编码")
+	private String code;
+	@ApiModelProperty("商品类型 1视频2题库 3补考 4前培 ")
+	private Integer goodsType;
+	@ApiModelProperty("科目ID,拼接")
+	private String subjectIds;
+	@ApiModelProperty("科目名称拼接")
+	private String subjectNames;
+	@ApiModelProperty("标准价格")
+	private BigDecimal standPrice;
+	@ApiModelProperty("有效期开始")
+	private Long validityStartTime;
+	@ApiModelProperty("有效期结束")
+	private Long validityEndTime;
+	@ApiModelProperty("服务期类型 1年 2月 3日 4区间")
+	private Integer serviceTimeType;
+	@ApiModelProperty("服务期数值")
+	private Long serviceTimeNum;
+
+	@ApiModelProperty("属性值")
+	private List<GoodsSpecAttrListVo> attrListVos;
+}

+ 47 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/vo/GoodsSpecAttributeVo.java

@@ -0,0 +1,47 @@
+package com.zhongzheng.modules.goods.vo;
+
+import com.zhongzheng.common.annotation.Excel;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import java.util.Date;
+
+
+
+/**
+ * 【请填写功能名称】视图对象 mall_package
+ *
+ * @author ruoyi
+ * @date 2022-09-29
+ */
+@Data
+@ApiModel("【请填写功能名称】视图对象")
+public class GoodsSpecAttributeVo {
+	private static final long serialVersionUID = 1L;
+
+	/** 规格属性ID */
+	@ApiModelProperty("规格属性ID")
+	private Long specAttributeId;
+
+	/** 规格ID */
+	@Excel(name = "规格ID")
+	@ApiModelProperty("规格ID")
+	private Long specId;
+	/** 模板名称 */
+	@Excel(name = "模板名称")
+	@ApiModelProperty("模板名称")
+	private String name;
+	/** 编码 */
+	@Excel(name = "编码")
+	@ApiModelProperty("编码")
+	private String code;
+	/** 排序值 */
+	@Excel(name = "排序值")
+	@ApiModelProperty("排序值")
+	private Integer sort;
+	/** 1有效 0无效 */
+	@Excel(name = "1有效 0无效")
+	@ApiModelProperty("1有效 0无效")
+	private Integer status;
+}

+ 56 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/vo/GoodsSpecTemplateVo.java

@@ -0,0 +1,56 @@
+package com.zhongzheng.modules.goods.vo;
+
+import com.zhongzheng.common.annotation.Excel;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.zhongzheng.modules.goods.bo.GoodsSpecAddBo;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import java.util.Date;
+import java.util.List;
+
+
+/**
+ * 【请填写功能名称】视图对象 mall_package
+ *
+ * @author ruoyi
+ * @date 2022-09-29
+ */
+@Data
+@ApiModel("【请填写功能名称】视图对象")
+public class GoodsSpecTemplateVo {
+	private static final long serialVersionUID = 1L;
+
+	/** 规格模板ID */
+	@ApiModelProperty("规格模板ID")
+	private Long specTemplateId;
+
+	/** 编码 */
+	@Excel(name = "编码")
+	@ApiModelProperty("编码")
+	private String code;
+	/** 教育类型id */
+	@Excel(name = "教育类型id")
+	@ApiModelProperty("教育类型id")
+	private Long educationTypeId;
+	@ApiModelProperty("教育类型名称")
+	private String educationName;
+	@ApiModelProperty("业务层次名称")
+	private String businessName;
+	@ApiModelProperty("商品规格数量")
+	private Integer specNumber;
+	/** 业务层次id */
+	@Excel(name = "业务层次id")
+	@ApiModelProperty("业务层次id")
+	private Long businessId;
+	/** 模板名称 */
+	@Excel(name = "模板名称")
+	@ApiModelProperty("模板名称")
+	private String name;
+	/** 1有效 0无效 */
+	@Excel(name = "1有效 0无效")
+	@ApiModelProperty("1有效 0无效")
+	private Integer status;
+	@ApiModelProperty("模板规格集合")
+	private List<GoodsSpecVo> specList;
+}

+ 50 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/vo/GoodsSpecVo.java

@@ -0,0 +1,50 @@
+package com.zhongzheng.modules.goods.vo;
+
+import com.zhongzheng.common.annotation.Excel;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import java.util.Date;
+import java.util.List;
+
+
+/**
+ * 【请填写功能名称】视图对象 mall_package
+ *
+ * @author ruoyi
+ * @date 2022-09-29
+ */
+@Data
+@ApiModel("【请填写功能名称】视图对象")
+public class GoodsSpecVo {
+	private static final long serialVersionUID = 1L;
+
+	/** 规格ID */
+	@ApiModelProperty("规格ID")
+	private Long specId;
+
+	/** 规格模板ID */
+	@Excel(name = "规格模板ID")
+	@ApiModelProperty("规格模板ID")
+	private Long specTemplateId;
+	/** 模板名称 */
+	@Excel(name = "模板名称")
+	@ApiModelProperty("模板名称")
+	private String name;
+	/** 编码 */
+	@Excel(name = "编码")
+	@ApiModelProperty("编码")
+	private String code;
+	/** 排序值 */
+	@Excel(name = "排序值")
+	@ApiModelProperty("排序值")
+	private Integer sort;
+	/** 1有效 0无效 */
+	@Excel(name = "1有效 0无效")
+	@ApiModelProperty("1有效 0无效")
+	private Integer status;
+
+	@ApiModelProperty("规格属性值集合")
+	private List<GoodsSpecAttributeVo> specAttrList;
+}

+ 5 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/vo/GoodsVo.java

@@ -317,4 +317,9 @@ public class GoodsVo {
 	/** 排序字段 */
 	@ApiModelProperty("排序字段")
 	private Integer sort;
+	@ApiModelProperty("商品规格模板数量")
+	private Integer specTemplateNumber;
+	@ApiModelProperty("默认规格模板ID")
+	private Long specTemplateId;
+
 }

+ 22 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/bo/RollBackPeriodBo.java

@@ -0,0 +1,22 @@
+package com.zhongzheng.modules.grade.bo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+
+@Data
+public class RollBackPeriodBo {
+
+    @ApiModelProperty("订单商品ID")
+    @NotBlank(message = "订单商品ID不能为空")
+    private Long orderGoodsId;
+
+    @ApiModelProperty("当前时间戳")
+    @NotBlank(message = "当前时间戳不能为空")
+    private Long stamp;
+
+    @ApiModelProperty("签名")
+    @NotBlank(message = "签名不能为空")
+    private String sign;
+}

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/bo/UserPeriodEditBo.java

@@ -79,4 +79,7 @@ public class UserPeriodEditBo {
     @ApiModelProperty("订单商品ID")
     private Long orderGoodsId;
 
+    @ApiModelProperty("打回操作平台 1自有系统 2老系统")
+    private Integer rollBackPlat;
+
 }

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/bo/UserPeriodStatusAddBo.java

@@ -49,4 +49,7 @@ public class UserPeriodStatusAddBo {
     /** 审核原因 */
     @ApiModelProperty("审核原因")
     private String auditReason;
+    /** 访问IP */
+    @ApiModelProperty("访问IP")
+    private String ip;
 }

+ 4 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/bo/UserPeriodStatusEditBo.java

@@ -58,4 +58,8 @@ public class UserPeriodStatusEditBo {
     /** 审核原因 */
     @ApiModelProperty("审核原因")
     private String auditReason;
+
+    /** 访问IP */
+    @ApiModelProperty("访问IP")
+    private String ip;
 }

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/domain/UserPeriodStatus.java

@@ -51,4 +51,6 @@ private static final long serialVersionUID=1L;
     private String auditUserName;
     /** 审核原因 */
     private String auditReason;
+    /** 访问IP */
+    private String ip;
 }

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/mapper/ClassGradeUserMapper.java

@@ -46,6 +46,8 @@ public interface ClassGradeUserMapper extends BaseMapper<ClassGradeUser> {
 
     List<ClassPeriodSectionVo> listperiodExam(@Param("chapterId") Long id,@Param("goodsId") Long goodsId,@Param("courseId") Long courseId,@Param("userId") Long userId,@Param("moduleId") Long moduleId);
 
+    List<ClassPeriodChapterVo> listperiodModuleExam(@Param("goodsId") Long goodsId,@Param("courseId") Long courseId,@Param("userId") Long userId,@Param("moduleId") Long moduleId);
+
     List<ClassPeriodSectionVo> listPeriodSectionExam(@Param("chapterId") Long id,@Param("goodsId") Long goodsId,@Param("courseId") Long courseId,@Param("userId") Long userId);
 
     List<Long> selectStart(@Param("userId") Long userId,@Param("goodsId") Long goodsId,@Param("gradeId") Long gradeId);

+ 5 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/IUserPeriodService.java

@@ -1,6 +1,7 @@
 package com.zhongzheng.modules.grade.service;
 
 import com.zhongzheng.modules.grade.domain.UserPeriod;
+import com.zhongzheng.modules.grade.vo.SyncUserCourseStudyRec;
 import com.zhongzheng.modules.grade.vo.UserPeriodVo;
 import com.zhongzheng.modules.grade.bo.UserPeriodQueryBo;
 import com.zhongzheng.modules.grade.bo.UserPeriodAddBo;
@@ -59,7 +60,11 @@ public interface IUserPeriodService extends IService<UserPeriod> {
 
 	Boolean confirmPeriod(UserPeriodEditBo bo);
 
+	Boolean confirmRollbackPeriod(UserPeriodEditBo bo);
+
 	Boolean rollbackPeriod(UserPeriodEditBo bo);
 
 	Long todayStudySectionNum(UserPeriodQueryBo bo);
+
+	SyncUserCourseStudyRec syncStudyLogToOld(UserPeriodEditBo bo);
 }

+ 35 - 31
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/impl/ClassGradeUserServiceImpl.java

@@ -18,6 +18,7 @@ import com.zhongzheng.common.core.redis.RedisLockEntity;
 import com.zhongzheng.common.exception.CustomException;
 import com.zhongzheng.common.utils.AES;
 import com.zhongzheng.common.utils.DateUtils;
+import com.zhongzheng.common.utils.ToolsUtils;
 import com.zhongzheng.common.utils.file.FileUtils;
 import com.zhongzheng.common.utils.http.HttpUtils;
 import com.zhongzheng.common.utils.polyv.PolyvUtils;
@@ -679,41 +680,13 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
     }
 
 
-    public static String EncoderByMd5(String str) {
-        String result = "";
-        MessageDigest md5 = null;
-        try {
-            md5 = MessageDigest.getInstance("MD5");
-            // 这句是关键
-            md5.update(str.getBytes("gb2312"));
-        } catch (NoSuchAlgorithmException e) {
-            // TODO Auto-generated catch block
-            e.printStackTrace();
-        } catch (UnsupportedEncodingException e) {
-            // TODO Auto-generated catch block
-            e.printStackTrace();
-        }
-        byte b[] = md5.digest();
-        int i;
-        StringBuffer buf = new StringBuffer("");
-        for (int offset = 0; offset < b.length; offset++) {
-            i = b[offset];
-            if (i < 0)
-                i += 256;
-            if (i < 16)
-                buf.append("0");
-            buf.append(Integer.toHexString(i));
-        }
-        result = buf.toString();
 
-        return result;
-    }
 
     public String dataSign(String SourceMsg, String PKey) {
         String TempPKey;
-        TempPKey = EncoderByMd5(PKey);
+        TempPKey = ToolsUtils.EncoderByMd5(PKey);
         TempPKey = SourceMsg + TempPKey;
-        TempPKey = EncoderByMd5(TempPKey);
+        TempPKey = ToolsUtils.EncoderByMd5(TempPKey);
         return TempPKey;
     }
 
@@ -1021,7 +994,6 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
             for (SubjectStudyRecordVo subjectStudyRecordVo : subjectStudyRecordVos) {
                 secLong = new BigDecimal(secLong.toString()).add(new BigDecimal(subjectStudyRecordVo.getSectionNum().toString())).longValue();
                 studyLong = new BigDecimal(studyLong.toString()).add(new BigDecimal(subjectStudyRecordVo.getRecordNum().toString())).longValue();
-
             }
             //总节数
             classPeriodStudentVo.setSecAllNum(secLong);
@@ -1570,6 +1542,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
             if (classPeriodVo.getType() == 1) {
                 List<ClassPeriodChapterVo> classPeriodChapterVos = baseMapper.listperiodChapter(classPeriodVo.getId(), bo.getGoodsId(), classPeriodVo.getCourseId(), bo.getUserId(), bo.getGradeId());
                 Collections.sort(classPeriodChapterVos);
+                classPeriodChapterVos.addAll(baseMapper.listperiodModuleExam( bo.getGoodsId(), classPeriodVo.getCourseId(), bo.getUserId(), classPeriodVo.getId()));
                 for (ClassPeriodChapterVo classPeriodChapterVo : classPeriodChapterVos) {
                     if (classPeriodChapterVo.getType() == 2) {
                         List<ClassPeriodSectionVo> classPeriodSectionVos = baseMapper.listPeriodSection(classPeriodChapterVo.getId(), bo.getGoodsId(), classPeriodVo.getCourseId(), bo.getUserId());
@@ -1617,6 +1590,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                                 userPeriodQueryBo.setChapterId(classPeriodChapterVo.getId());
                                 userPeriodQueryBo.setModuleId(classPeriodVo.getId());
                                 userPeriodQueryBo.setGradeId(bo.getGradeId());
+                                userPeriodQueryBo.setType(2);
                                 List<UserPeriodStatusVo> userPeriodStatusVos = userPeriodStatusService.selectPeriodStatus(userPeriodQueryBo);
                                 if (!CollectionUtils.isEmpty(userPeriodStatusVos)) {
                                     int numIndex = userPeriodStatusVos.size() - 1;
@@ -1645,6 +1619,36 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
 
                         classPeriodChapterVo.setClassPeriodSectionList(classPeriodSectionVos);
                     }
+                    else if (classPeriodChapterVo.getType() == 5) {
+                        UserPeriodQueryBo userPeriodQueryBo = new UserPeriodQueryBo();
+                        userPeriodQueryBo.setExamId(classPeriodChapterVo.getId());
+                        userPeriodQueryBo.setCourseId(classPeriodChapterVo.getCourseId());
+                        userPeriodQueryBo.setGoodsId(bo.getGoodsId());
+                        userPeriodQueryBo.setUserId(classPeriodChapterVo.getUserId());
+                        userPeriodQueryBo.setModuleId(classPeriodVo.getId());
+                        userPeriodQueryBo.setGradeId(bo.getGradeId());
+                        userPeriodQueryBo.setType(3);
+                        List<UserPeriodStatusVo> userPeriodStatusVos = userPeriodStatusService.selectPeriodStatus(userPeriodQueryBo);
+                        if (!CollectionUtils.isEmpty(userPeriodStatusVos)) {
+                            int numIndex = userPeriodStatusVos.size() - 1;
+                            UserPeriodStatusVo userPeriodStatusVo = userPeriodStatusVos.get(numIndex);
+                            LambdaQueryWrapper<UserStudyRecordPhoto> lqw = Wrappers.lambdaQuery();
+                            lqw.eq(UserStudyRecordPhoto::getPeriodId, userPeriodStatusVo.getId());
+                            classPeriodChapterVo.setUserStudyRecordPhotoList(entity2PhotoVo(userStudyRecordPhotoService.list(lqw)));
+                            classPeriodChapterVo.setNumIndex(Convert.toLong(userPeriodStatusVos.size()));
+                            classPeriodChapterVo.setStatus(userPeriodStatusVo.getStatus());
+                            classPeriodChapterVo.setNumList(Convert.toLong(userPeriodStatusVos.size()));
+                            classPeriodChapterVo.setStudyEndTime(userPeriodStatusVo.getRecordEndTime());
+                            classPeriodChapterVo.setStudyStartTime(userPeriodStatusVo.getRecordStartTime());
+                            classPeriodChapterVo.setPeriodStatus(userPeriodStatusVo.getPeriodStatus());
+                            classPeriodChapterVo.setPeriodId(userPeriodStatusVo.getPeriodId());
+                            classPeriodChapterVo.setAuditTime(userPeriodStatusVo.getAuditTime());
+                            classPeriodChapterVo.setAuditUserName(userPeriodStatusVo.getAuditUserName());
+                            classPeriodChapterVo.setPeriodStatusId(userPeriodStatusVo.getId());
+                            classPeriodChapterVo.setPerformance(Convert.toBigDecimal(userPeriodStatusVo.getPerformance()));
+                        }
+
+                    }
                 }
                 classPeriodVo.setClassPeriods(classPeriodChapterVos);
             }

+ 248 - 10
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/impl/UserPeriodServiceImpl.java

@@ -1,9 +1,11 @@
 package com.zhongzheng.modules.grade.service.impl;
 
 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.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
@@ -12,26 +14,41 @@ import com.zhongzheng.common.core.redis.RedisCache;
 import com.zhongzheng.common.exception.CustomException;
 import com.zhongzheng.common.utils.DateUtils;
 import com.zhongzheng.common.utils.SecurityUtils;
+import com.zhongzheng.common.utils.ToolsUtils;
+import com.zhongzheng.common.utils.http.HttpUtils;
 import com.zhongzheng.modules.base.service.ICertificateTpService;
+import com.zhongzheng.modules.course.bo.CourseMenuQueryBo;
 import com.zhongzheng.modules.course.domain.CourseBusiness;
-import com.zhongzheng.modules.course.service.ICourseBusinessService;
+import com.zhongzheng.modules.course.domain.CourseEducationType;
+import com.zhongzheng.modules.course.domain.CourseProjectType;
+import com.zhongzheng.modules.course.service.*;
+import com.zhongzheng.modules.course.vo.CourseMenuVo;
+import com.zhongzheng.modules.course.vo.CourseModuleChapterVo;
+import com.zhongzheng.modules.course.vo.CourseVo;
+import com.zhongzheng.modules.goods.bo.GoodsCourseQueryBo;
 import com.zhongzheng.modules.goods.domain.Goods;
+import com.zhongzheng.modules.goods.service.IGoodsCourseService;
 import com.zhongzheng.modules.goods.service.IGoodsService;
 import com.zhongzheng.modules.goods.vo.GoodsVo;
 import com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo;
+import com.zhongzheng.modules.grade.domain.ClassGrade;
 import com.zhongzheng.modules.grade.domain.ClassGradeUser;
 import com.zhongzheng.modules.grade.domain.UserPeriodStatus;
 import com.zhongzheng.modules.grade.mapper.ClassGradeUserMapper;
+import com.zhongzheng.modules.grade.service.IClassGradeService;
 import com.zhongzheng.modules.grade.service.IClassGradeUserService;
 import com.zhongzheng.modules.grade.service.IUserPeriodStatusService;
-import com.zhongzheng.modules.grade.vo.ClassPeriodStudentVo;
-import com.zhongzheng.modules.grade.vo.UserPeriodStatusVo;
+import com.zhongzheng.modules.grade.vo.*;
 import com.zhongzheng.modules.inform.bo.InformUserAddBo;
 import com.zhongzheng.modules.inform.service.IInformRemindService;
 import com.zhongzheng.modules.inform.service.IInformUserService;
 import com.zhongzheng.modules.inform.vo.InformRemindVo;
+import com.zhongzheng.modules.order.domain.OrderGoods;
+import com.zhongzheng.modules.order.service.IOrderGoodsService;
 import com.zhongzheng.modules.user.domain.User;
+import com.zhongzheng.modules.user.domain.UserStudyRecordPhoto;
 import com.zhongzheng.modules.user.service.IUserService;
+import com.zhongzheng.modules.user.service.IUserStudyRecordPhotoService;
 import com.zhongzheng.modules.user.vo.UserVo;
 import com.zhongzheng.modules.wx.service.IWxLoginService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -46,10 +63,10 @@ import com.zhongzheng.modules.grade.bo.UserPeriodQueryBo;
 import com.zhongzheng.modules.grade.bo.UserPeriodEditBo;
 import com.zhongzheng.modules.grade.domain.UserPeriod;
 import com.zhongzheng.modules.grade.mapper.UserPeriodMapper;
-import com.zhongzheng.modules.grade.vo.UserPeriodVo;
 import com.zhongzheng.modules.grade.service.IUserPeriodService;
 import org.springframework.transaction.annotation.Transactional;
 
+import java.io.IOException;
 import java.util.*;
 import java.util.concurrent.TimeUnit;
 import java.util.stream.Collectors;
@@ -111,6 +128,35 @@ public class UserPeriodServiceImpl extends ServiceImpl<UserPeriodMapper, UserPer
     @Autowired
     private ICourseBusinessService iCourseBusinessService;
 
+    @Value("${aliyun.oss.endpoint}")
+    private String ossHost;
+
+    @Autowired
+    private IOrderGoodsService iOrderGoodsService;
+
+    @Autowired
+    private IClassGradeService iClassGradeService;
+
+    @Autowired
+    private IGoodsCourseService iGoodsCourseService;
+
+    @Autowired
+    private ICourseMenuService iCourseMenuService;
+
+    @Autowired
+    private ICourseModuleChapterService iCourseModuleChapterService;
+
+    @Autowired
+    private IUserStudyRecordPhotoService userStudyRecordPhotoService;
+
+    @Autowired
+    private ICourseEducationTypeService iCourseEducationTypeService;
+
+    @Autowired
+    private ICourseProjectTypeService iCourseProjectTypeService;
+
+    @Value("${oldStudySys.syncPath}")
+    private String SYNC_PATH;
 
     @Override
     public UserPeriodVo queryById(Long id) {
@@ -221,14 +267,14 @@ public class UserPeriodServiceImpl extends ServiceImpl<UserPeriodMapper, UserPer
         classGradeUserQueryBo.setGoodsId(userPeriodVo.getGoodsId());
         Integer gradePeriodStatus = iClassGradeUserService.updateUserPeriodStatus(classGradeUserQueryBo);
         //发送审核不通过消息
+        bo.setStatus(gradePeriodStatus);
+        bo.setGoodsId(userPeriodVo.getGoodsId());
+        bo.setUserId(userPeriodVo.getUserId());
+        bo.setGradeId(userPeriodVo.getGradeId());
         if (gradePeriodStatus == 0) {
-            bo.setStatus(gradePeriodStatus);
-            bo.setGoodsId(userPeriodVo.getGoodsId());
-            bo.setUserId(userPeriodVo.getUserId());
-            bo.setGradeId(userPeriodVo.getGradeId());
             sendPeriodSMS(bo);
             sendPeriodSevenSMS(bo);
-        }else {
+        }else if(gradePeriodStatus == 3){
             if (ObjectUtils.isNotNull(business.getPeriodNumber()) && business.getPeriodNumber() == 1){
                 //只需要初审,不用复审
                 this.confirmPeriod(bo);
@@ -257,6 +303,7 @@ public class UserPeriodServiceImpl extends ServiceImpl<UserPeriodMapper, UserPer
     @Override
     @Transactional(rollbackFor = Exception.class)
     public boolean editPeriodAll(UserPeriodEditBo bo) {
+        CourseBusiness business = null;
         for (Long id : bo.getIds()) {
             UserPeriodStatusVo oldData = userPeriodStatusService.queryById(id);
             Long goodsId;
@@ -269,7 +316,7 @@ public class UserPeriodServiceImpl extends ServiceImpl<UserPeriodMapper, UserPer
             }
             //获取业务学时审核数据
             Goods goods = iGoodsService.getById(goodsId);
-            CourseBusiness business = iCourseBusinessService.getById(goods.getBusinessId());
+            business = iCourseBusinessService.getById(goods.getBusinessId());
             if (ObjectUtils.isNull(business.getPeriodType()) || business.getPeriodType() == 1){
                 //人工审核
                 //查询此人学时审核是否有权限
@@ -322,6 +369,11 @@ public class UserPeriodServiceImpl extends ServiceImpl<UserPeriodMapper, UserPer
             bo.setStatus(gradePeriodStatus);
             sendPeriodSMS(bo);
             sendPeriodSevenSMS(bo);
+        }else if(gradePeriodStatus == 3) {
+            if (ObjectUtils.isNotNull(business.getPeriodNumber()) && business.getPeriodNumber() == 1){
+                //只需要初审,不用复审
+                this.confirmPeriod(bo);
+            }
         }
 
         return true;
@@ -386,9 +438,193 @@ public class UserPeriodServiceImpl extends ServiceImpl<UserPeriodMapper, UserPer
         bo.setStatus(1);
         sendPeriodSMS(bo);
         sendPeriodSevenSMS(bo);
+        syncStudyLogToOld(bo);
         return true;
     }
 
+    @Override
+    public Boolean confirmRollbackPeriod(UserPeriodEditBo bo) {
+        if(Validator.isEmpty(bo.getOrderGoodsId())){
+            throw new CustomException("参数错误");
+        }
+        ClassGradeUser classGradeUser = iClassGradeUserService.getOne(new LambdaQueryWrapper<ClassGradeUser>()
+                .eq(ClassGradeUser::getOrderGoodsId, bo.getOrderGoodsId())
+                .last("limit 1"));
+        OrderGoods orderGoods = iOrderGoodsService.getOne(new LambdaQueryWrapper<OrderGoods>().eq(OrderGoods::getOrderGoodsId,bo.getOrderGoodsId()).last("limit 1"));
+        if(Validator.isEmpty(classGradeUser)||Validator.isEmpty(orderGoods)){
+            throw new CustomException("数据错误");
+        }
+        bo.setGoodsId(orderGoods.getGoodsId());
+        CourseEducationType educationType = iCourseEducationTypeService.getOne(new LambdaQueryWrapper<CourseEducationType>().eq(CourseEducationType::getStatus, 1).eq(CourseEducationType::getEducationName,"继续教育").last("limit 1"));
+        CourseProjectType projectType = iCourseProjectTypeService.getOne(new LambdaQueryWrapper<CourseProjectType>().eq(CourseProjectType::getStatus, 1).eq(CourseProjectType::getEducationId,educationType.getId()).eq(CourseProjectType::getProjectName,"建造师").last("limit 1"));
+        CourseBusiness business = iCourseBusinessService.getOne(new LambdaQueryWrapper<CourseBusiness>().eq(CourseBusiness::getStatus, 1).eq(CourseBusiness::getProjectId,projectType.getId()).eq(CourseBusiness::getBusinessName,"二级").last("limit 1"));
+
+        GoodsVo goodsVo = iGoodsService.queryById(bo.getGoodsId());
+        if(goodsVo.getBusinessId().longValue()!=business.getId().longValue()){
+            throw new CustomException("非继续二建无法打回");
+        }
+        //查询此人学时审核是否有权限,老系统不进行权限校验
+        if (bo.getRollBackPlat()!=2) {
+            LoginUser loginUser = SecurityUtils.getLoginUser();
+            if(!loginUser.getUser().isAdmin()){
+                if (baseMapper.selectCountConfirmPeriod(loginUser.getUser().getUserId(), bo.getGoodsId()) < 1) {
+                    throw new CustomException("您没有打回权限");
+                }
+            }
+        }
+        LambdaUpdateWrapper<ClassGradeUser> objectLambdaUpdateWrapper = Wrappers.lambdaUpdate();
+        objectLambdaUpdateWrapper.eq(ClassGradeUser::getId, classGradeUser.getId());
+        objectLambdaUpdateWrapper.set(ClassGradeUser::getPeriodStatus, 3);
+        objectLambdaUpdateWrapper.set(ClassGradeUser::getUpdateTime, DateUtils.getNowTime());
+        //判断结业
+        long nowTime = System.currentTimeMillis() / 1000;
+        ClassGradeUserQueryBo queryBo = new ClassGradeUserQueryBo();
+        queryBo.setGradeId(bo.getGradeId());
+        queryBo.setUserId(bo.getUserId());
+        ClassPeriodStudentVo classPeriodStudentVo = classGradeUserMapper.userPeriodStatus(queryBo);
+        if (Validator.isEmpty(classPeriodStudentVo.getClassStartTime())) {
+            //没设置永久有效
+            objectLambdaUpdateWrapper.set(ClassGradeUser::getFinishStatus, 0);
+        }
+        if (Validator.isNotEmpty(classPeriodStudentVo.getClassEndTime()) && Validator.isNotEmpty(classPeriodStudentVo.getClassStartTime())) {
+            if (nowTime < classPeriodStudentVo.getClassEndTime() && nowTime > classPeriodStudentVo.getClassStartTime()) {
+                objectLambdaUpdateWrapper.set(ClassGradeUser::getFinishStatus, 0);
+            }
+        }
+        iClassGradeUserService.update(null, objectLambdaUpdateWrapper);
+        return true;
+    }
+
+    @Override
+    public SyncUserCourseStudyRec syncStudyLogToOld(UserPeriodEditBo bo) {
+        CourseEducationType educationType = iCourseEducationTypeService.getOne(new LambdaQueryWrapper<CourseEducationType>().eq(CourseEducationType::getStatus, 1).eq(CourseEducationType::getEducationName,"继续教育").last("limit 1"));
+        CourseProjectType projectType = iCourseProjectTypeService.getOne(new LambdaQueryWrapper<CourseProjectType>().eq(CourseProjectType::getStatus, 1).eq(CourseProjectType::getEducationId,educationType.getId()).eq(CourseProjectType::getProjectName,"建造师").last("limit 1"));
+        CourseBusiness business = iCourseBusinessService.getOne(new LambdaQueryWrapper<CourseBusiness>().eq(CourseBusiness::getStatus, 1).eq(CourseBusiness::getProjectId,projectType.getId()).eq(CourseBusiness::getBusinessName,"二级").last("limit 1"));
+
+        GoodsVo goodsVo = iGoodsService.queryById(bo.getGoodsId());
+        if(goodsVo.getBusinessId().longValue()!=business.getId().longValue()){
+            return null;
+        }
+        UserVo userVo = iUserService.queryById(bo.getUserId());
+        ClassGradeUser gradeUser = iClassGradeUserService.getOne(new LambdaQueryWrapper<ClassGradeUser>().eq(ClassGradeUser::getUserId,bo.getUserId()).eq(ClassGradeUser::getGradeId,bo.getGradeId()).last("limit 1"));
+        OrderGoods orderGoods = iOrderGoodsService.getOne(new LambdaQueryWrapper<OrderGoods>().eq(OrderGoods::getOrderGoodsId,gradeUser.getOrderGoodsId()).last("limit 1"));
+        ClassGrade classGrade = iClassGradeService.getOne(new LambdaQueryWrapper<ClassGrade>().eq(ClassGrade::getGradeId,gradeUser.getGradeId()).last("limit 1"));
+        SyncUserCourseStudyRec studyRec = new SyncUserCourseStudyRec();
+        studyRec.setName(userVo.getRealname());
+        studyRec.setIdNum(userVo.getIdCard());
+        studyRec.setMobile(userVo.getTelphone());
+        studyRec.setGender(userVo.getSex()==1?"男":"女");
+        studyRec.setRecentPhotoSrc(Validator.isNotEmpty(userVo.getOneInchPhotos())?ossHost+"/"+userVo.getOneInchPhotos():"");
+        studyRec.setIdcardPhotoSrc(Validator.isNotEmpty(userVo.getIdCardImg1())?ossHost+"/"+userVo.getIdCardImg1():"");
+        studyRec.setIdcardPhotoSrc2(Validator.isNotEmpty(userVo.getIdCardImg2())?ossHost+"/"+userVo.getIdCardImg2():"");
+        studyRec.setCourseId(bo.getGoodsId());
+        studyRec.setCourseBuyTime(DateUtils.timestampToDateFormat(orderGoods.getCreateTime(),DateUtils.YYYY_MM_DD_HH_MM_SS));
+        studyRec.setClassNo(classGrade.getOfficialName());
+        studyRec.setOrderGoodsId(orderGoods.getOrderGoodsId());
+        List<SyncUserChapterList> ChapterList = new ArrayList<>();
+        GoodsCourseQueryBo goodsCourseQueryBo = new GoodsCourseQueryBo();
+        goodsCourseQueryBo.setGoodsId(goodsVo.getGoodsId());
+        List<CourseVo> courseVoList = iGoodsCourseService.selectList(goodsCourseQueryBo);
+        for(CourseVo courseVo : courseVoList){
+            CourseMenuQueryBo menuQueryBo = new CourseMenuQueryBo();
+            menuQueryBo.setCourseId(courseVo.getCourseId());
+            List<CourseMenuVo> courseMenuVoList = iCourseMenuService.selectList(menuQueryBo);
+            courseMenuVoList.forEach(courseMenuVo -> {
+                if(courseMenuVo.getType()==1){
+                    //获取章信息
+                    List<CourseModuleChapterVo> courseModuleChapterVoList = iCourseModuleChapterService.getListById(courseMenuVo.getMenuId());
+                    courseModuleChapterVoList.forEach(courseModuleChapterVo -> {
+                        SyncUserChapterList syncUserChapterItem = new SyncUserChapterList();
+                        syncUserChapterItem.setChapterId(courseModuleChapterVo.getChapterId());
+                        syncUserChapterItem.setChapterName(courseModuleChapterVo.getName());
+
+                        UserPeriodQueryBo userPeriodQueryBo = new UserPeriodQueryBo();
+                        userPeriodQueryBo.setCourseId(courseVo.getCourseId());
+                        userPeriodQueryBo.setGoodsId(bo.getGoodsId());
+                        userPeriodQueryBo.setUserId(bo.getUserId());
+                        userPeriodQueryBo.setChapterId(courseModuleChapterVo.getChapterId());
+                        userPeriodQueryBo.setModuleId(courseMenuVo.getMenuId());
+                        userPeriodQueryBo.setGradeId(bo.getGradeId());
+                        userPeriodQueryBo.setType(2);
+                        List<UserPeriodStatusVo> userPeriodStatusVos = userPeriodStatusService.selectPeriodStatus(userPeriodQueryBo);
+                        if (!CollectionUtils.isEmpty(userPeriodStatusVos)&&userPeriodStatusVos.size()>0) {
+                            int numIndex = userPeriodStatusVos.size() - 1;
+                            UserPeriodStatusVo userPeriodStatusVo = userPeriodStatusVos.get(numIndex);
+                            LambdaQueryWrapper<UserStudyRecordPhoto> lqw = Wrappers.lambdaQuery();
+                            lqw.eq(UserStudyRecordPhoto::getPeriodId, userPeriodStatusVo.getId());
+                            List<UserStudyRecordPhoto> examPhoto = userStudyRecordPhotoService.list(lqw);
+                            if(Validator.isNotEmpty(examPhoto)&&examPhoto.size()>0){
+                                UserStudyRecordPhoto photo = examPhoto.get(0);
+                                syncUserChapterItem.setImageSrc(ossHost+"/"+photo.getPhoto());
+                                syncUserChapterItem.setImageTime(DateUtils.timestampToDateFormat(photo.getCreateTime(),DateUtils.YYYY_MM_DD_HH_MM_SS));
+                                syncUserChapterItem.setMatchData(Validator.isNotEmpty(photo.getSimilarity())?photo.getSimilarity().toString():null);
+                                syncUserChapterItem.setExamTime(DateUtils.timestampToDateFormat(userPeriodStatusVo.getRecordStartTime(),DateUtils.YYYY_MM_DD_HH_MM_SS));
+                                syncUserChapterItem.setExamScore(userPeriodStatusVo.getPerformance().toString());
+                                syncUserChapterItem.setStudyIP(userPeriodStatusVo.getIp());
+                            }
+                        }
+                        List<ClassPeriodSectionVo> classPeriodSectionVos = classGradeUserMapper.listPeriodSection(courseModuleChapterVo.getChapterId(), bo.getGoodsId(), courseVo.getCourseId(), bo.getUserId());
+                        Collections.sort(classPeriodSectionVos);
+                        List<SyncUserStudyRec> RecList = new ArrayList<>();
+                        for (ClassPeriodSectionVo classPeriodSectionVo : classPeriodSectionVos) {
+                            SyncUserStudyRec syncUserStudyRec = new SyncUserStudyRec();
+                            syncUserStudyRec.setVideoId(classPeriodSectionVo.getId());
+                            syncUserStudyRec.setVideoKey(classPeriodSectionVo.getRecordingUrl());
+
+                            UserPeriodQueryBo userPeriodQueryBo2 = new UserPeriodQueryBo();
+                            userPeriodQueryBo2.setSectionId(classPeriodSectionVo.getId());
+                            userPeriodQueryBo2.setCourseId(courseVo.getCourseId());
+                            userPeriodQueryBo2.setGoodsId(bo.getGoodsId());
+                            userPeriodQueryBo2.setUserId(bo.getUserId());
+                            userPeriodQueryBo2.setChapterId(courseModuleChapterVo.getChapterId());
+                            userPeriodQueryBo2.setModuleId(courseMenuVo.getMenuId());
+                            userPeriodQueryBo2.setGradeId(bo.getGradeId());
+                            List<UserPeriodStatusVo> userPeriodStatusVos2 = userPeriodStatusService.selectPeriodStatus(userPeriodQueryBo2);
+                            if (!CollectionUtils.isEmpty(userPeriodStatusVos2)) {
+                                int numIndex2 = userPeriodStatusVos2.size() - 1;
+                                UserPeriodStatusVo userPeriodStatusVo = userPeriodStatusVos2.get(numIndex2);
+                                LambdaQueryWrapper<UserStudyRecordPhoto> lqw = Wrappers.lambdaQuery();
+                                lqw.eq(UserStudyRecordPhoto::getPeriodId, userPeriodStatusVo.getId());
+                                List<UserStudyRecordPhoto> videoPhoto2 = userStudyRecordPhotoService.list(lqw);
+                                syncUserStudyRec.setCreateTime(DateUtils.timestampToDateFormat(userPeriodStatusVo.getRecordStartTime(),DateUtils.YYYY_MM_DD_HH_MM_SS));
+                                syncUserStudyRec.setEndTime(DateUtils.timestampToDateFormat(userPeriodStatusVo.getRecordEndTime(),DateUtils.YYYY_MM_DD_HH_MM_SS));
+                                syncUserStudyRec.setStudyIP(userPeriodStatusVo.getIp());
+                                List<SyncUserImageRc> ImgList = new ArrayList<>();
+                                for (UserStudyRecordPhoto videoPhoto : videoPhoto2) {
+                                    SyncUserImageRc imageRc = new SyncUserImageRc();
+                                    imageRc.setImgSrc(ossHost+"/"+videoPhoto.getPhoto());
+                                    imageRc.setCreateTime(DateUtils.timestampToDateFormat(videoPhoto.getCreateTime(),DateUtils.YYYY_MM_DD_HH_MM_SS));
+                                    imageRc.setMatchData(Validator.isNotEmpty(videoPhoto.getSimilarity())?videoPhoto.getSimilarity().toString():null);
+                                    ImgList.add(imageRc);
+                                }
+                                syncUserStudyRec.setImgList(ImgList);
+                            }
+                            RecList.add(syncUserStudyRec);
+                        }
+                        syncUserChapterItem.setRecList(RecList);
+                        ChapterList.add(syncUserChapterItem);
+                    });
+
+                }
+            });
+        }
+        studyRec.setChapterList(ChapterList);
+        //学习记录推送到旧系统
+        Map<String, String> params = new HashMap<>();
+        Long nowTime = DateUtils.getNowTime();
+        String sign = ToolsUtils.EncoderByMd5(nowTime.toString()+"pubilc2022");
+        params.put("stamp", nowTime.toString());
+        params.put("sign", sign);
+        params.put("jsonstr", JSONObject.toJSONString(studyRec));
+        String respone = "";
+        try {
+            respone = HttpUtils.postFormBody(SYNC_PATH, params);
+        } catch (IOException e) {
+            throw new CustomException("同步请求错误"+e.getMessage());
+        }
+        return studyRec;
+    }
+
     /**
      * 打回操作
      *
@@ -444,6 +680,8 @@ public class UserPeriodServiceImpl extends ServiceImpl<UserPeriodMapper, UserPer
         return baseMapper.todayStudySectionNum(bo);
     }
 
+
+
     //学时通过处理事件
     private void periodPass(ClassGradeUserQueryBo classGradeUserQueryBo) {
         //生成证书

+ 40 - 3
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/vo/ClassPeriodChapterVo.java

@@ -1,6 +1,7 @@
 package com.zhongzheng.modules.grade.vo;
 
 import com.zhongzheng.common.annotation.Excel;
+import com.zhongzheng.modules.user.vo.UserStudyRecordPhotoVo;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
@@ -64,7 +65,7 @@ public class ClassPeriodChapterVo implements Comparable<ClassPeriodChapterVo> {
 	/** 审核状态 */
 	@Excel(name = "审核状态")
 	@ApiModelProperty("审核状态 1通过 0作弊")
-	private String status;
+	private Integer status;
 
 	/** 分数 */
 	@Excel(name = "分数")
@@ -78,8 +79,8 @@ public class ClassPeriodChapterVo implements Comparable<ClassPeriodChapterVo> {
 
 
 	/** 1模块 2章 3节 4卷 */
-	@Excel(name = "1模块 2章 3节 4卷")
-	@ApiModelProperty("1模块 2章 3节 4卷")
+	@Excel(name = "1模块 2章 3节 4卷 5模块卷")
+	@ApiModelProperty("1模块 2章 3节 4卷 5模块卷")
 	private Long type;
 
 	/** 章下面得节 */
@@ -95,6 +96,42 @@ public class ClassPeriodChapterVo implements Comparable<ClassPeriodChapterVo> {
 	@ApiModelProperty("排序")
 	private Integer sort;
 
+	/** 审核时间 */
+	@Excel(name = "审核照片")
+	@ApiModelProperty("审核照片")
+	private List<UserStudyRecordPhotoVo> userStudyRecordPhotoList;
+
+	/** 當前位置 */
+	@Excel(name = "當前位置")
+	@ApiModelProperty("當前位置")
+	private Long numIndex;
+
+	/** 审核时间 */
+	@Excel(name = "共有多少條")
+	@ApiModelProperty("共有多少條")
+	private Long numList;
+
+	/** 当前节状态 1 当前状态 0过往状态 */
+	/** 审核时间 */
+	@Excel(name = "当前节状态 1 当前状态 0过往状态")
+	@ApiModelProperty("当前节状态 1 当前状态 0过往状态")
+	private Integer periodStatus;
+
+
+	/** 当前节状态 1 当前状态 0过往状态 */
+	/** 审核时间 */
+	@Excel(name = "當前審核ID")
+	@ApiModelProperty("當前審核ID")
+	private Long periodId;
+
+	/** 当前节状态 1 当前状态 0过往状态 */
+	/** 审核时间 */
+	@Excel(name = "當前審核状态ID")
+	@ApiModelProperty("當前審核状态ID")
+	private Long periodStatusId;
+
+	@ApiModelProperty("审核人")
+	private String auditUserName;
 
 	@Override
 	public int compareTo(ClassPeriodChapterVo o) {

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/vo/ClassPeriodSectionVo.java

@@ -165,6 +165,8 @@ public class ClassPeriodSectionVo implements Comparable<ClassPeriodSectionVo> {
 	@Excel(name = "节类型 1录播 2直播 3回放")
 	@ApiModelProperty("节类型 1录播 2直播 3回放")
 	private Integer sectionType;
+	@ApiModelProperty("录播地址")
+	private String recordingUrl;
 
 	@Override
 	public int compareTo(ClassPeriodSectionVo o) {

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/vo/ClassPeriodUserVo.java

@@ -132,4 +132,7 @@ public class ClassPeriodUserVo {
 
 	@ApiModelProperty("学时")
 	private Long classHours;
+
+	@ApiModelProperty("订单商品ID")
+	private Long orderGoodsId;
 }

+ 50 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/vo/SyncGoodsExport.java

@@ -0,0 +1,50 @@
+package com.zhongzheng.modules.grade.vo;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.util.List;
+
+@Data
+public class SyncGoodsExport {
+    private static final long serialVersionUID = 1L;
+
+    @Excel(name = "课程ID")
+    @ApiModelProperty("课程ID")
+    private Long goodsId;
+
+    @Excel(name = "课程名称")
+    @ApiModelProperty("课程名称")
+    private String goodsName;
+
+    @Excel(name = "章节ID")
+    @ApiModelProperty("章节ID")
+    private Long chapterId;
+
+    @Excel(name = "章节名称")
+    @ApiModelProperty("章节名称")
+    private String chapterName;
+
+    @Excel(name = "视频ID")
+    @ApiModelProperty("视频ID")
+    private Long sectionId;
+
+    @Excel(name = "视频名称")
+    @ApiModelProperty("视频名称")
+    private String sectionName;
+
+    @Excel(name = "视频key")
+    @ApiModelProperty("视频key")
+    private String sectionUrl;
+
+    @Excel(name = "专业")
+    @ApiModelProperty("专业")
+    private String subjectName;
+
+    /** 学时 */
+    @Excel(name = "学时")
+    @ApiModelProperty("学时")
+    private BigDecimal classHours;
+}

Certains fichiers n'ont pas été affichés car il y a eu trop de fichiers modifiés dans ce diff