소스 검색

submit:统一登录

yangdamao 2 년 전
부모
커밋
16813cd318
100개의 변경된 파일2424개의 추가작업 그리고 453개의 파일을 삭제
  1. 69 1
      run-prod.sh
  2. 2 0
      zhongzheng-admin-saas/src/main/resources/application-dev.yml
  3. 2 0
      zhongzheng-admin-saas/src/main/resources/application-prod.yml
  4. 25 0
      zhongzheng-admin/src/main/java/com/zhongzheng/controller/common/CommonController.java
  5. 55 0
      zhongzheng-admin/src/main/java/com/zhongzheng/controller/common/EnterpriseController.java
  6. 25 19
      zhongzheng-admin/src/main/java/com/zhongzheng/controller/course/CourseEducationTypeController.java
  7. 3 1
      zhongzheng-admin/src/main/java/com/zhongzheng/controller/course/CourseSubjectController.java
  8. 22 31
      zhongzheng-admin/src/main/java/com/zhongzheng/controller/goods/GoodsController.java
  9. 7 0
      zhongzheng-admin/src/main/java/com/zhongzheng/controller/schedule/ScheduleController.java
  10. 2 0
      zhongzheng-admin/src/main/resources/application-dev.yml
  11. 2 0
      zhongzheng-admin/src/main/resources/application-prod.yml
  12. 1 1
      zhongzheng-admin/src/main/resources/application.yml
  13. 44 0
      zhongzheng-api/src/main/java/com/zhongzheng/controller/cmmon/CommonController.java
  14. 7 0
      zhongzheng-api/src/main/java/com/zhongzheng/controller/user/LoginController.java
  15. 4 2
      zhongzheng-api/src/main/resources/application-dev.yml
  16. 2 0
      zhongzheng-api/src/main/resources/application-prod.yml
  17. 110 6
      zhongzheng-common/src/main/java/com/zhongzheng/common/utils/DateUtils.java
  18. 1 0
      zhongzheng-framework/src/main/java/com/zhongzheng/framework/config/SecurityConfig.java
  19. 1 1
      zhongzheng-framework/src/main/java/com/zhongzheng/framework/web/service/TokenService.java
  20. 356 2
      zhongzheng-framework/src/main/java/com/zhongzheng/framework/web/service/UserServiceImpl.java
  21. 2 2
      zhongzheng-system/src/main/java/com/zhongzheng/modules/alisms/service/IAliSmsService.java
  22. 32 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/alisms/service/impl/AliSmsServiceImpl.java
  23. 1 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/bo/CourseBusinessQueryBo.java
  24. 5 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/mapper/CourseBusinessMapper.java
  25. 6 3
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/mapper/CourseMapper.java
  26. 4 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/mapper/CourseMenuExamMapper.java
  27. 4 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/mapper/CourseMenuMapper.java
  28. 1 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/mapper/CourseModuleChapterMapper.java
  29. 6 2
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/mapper/CourseSectionMapper.java
  30. 4 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/ICourseBusinessService.java
  31. 4 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/ICourseEducationTypeService.java
  32. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/ICourseMenuExamService.java
  33. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/ICourseMenuService.java
  34. 5 2
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/ICourseSectionService.java
  35. 7 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/ICourseService.java
  36. 5 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseBusinessServiceImpl.java
  37. 31 4
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseEducationTypeServiceImpl.java
  38. 5 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseMenuExamServiceImpl.java
  39. 5 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseMenuServiceImpl.java
  40. 3 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseModuleChapterServiceImpl.java
  41. 10 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseSectionServiceImpl.java
  42. 22 32
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseSectionWatchPerServiceImpl.java
  43. 56 4
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseServiceImpl.java
  44. 5 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/vo/CourseEducationTypeVo.java
  45. 23 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/bo/ExamApplyDetailBo.java
  46. 45 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/bo/ExamApplyResultBo.java
  47. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/domain/ExamSite.java
  48. 11 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/mapper/ExamApplyMapper.java
  49. 4 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/service/IExamApplyService.java
  50. 66 8
      zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/service/impl/ExamApplyServiceImpl.java
  51. 30 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/vo/ExamApplyDetailVo.java
  52. 4 2
      zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/vo/ExamApplyGoodsVo.java
  53. 20 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/vo/ExamApplyUserDetailVo.java
  54. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/bo/GoodsAddBo.java
  55. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/bo/GoodsEditBo.java
  56. 33 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/bo/GoodsNodeCopyTenantBo.java
  57. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/bo/GoodsQueryBo.java
  58. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/domain/Goods.java
  59. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/mapper/GoodsMapper.java
  60. 4 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/IGoodsService.java
  61. 194 4
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/impl/GoodsServiceImpl.java
  62. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/vo/GoodsVo.java
  63. 4 23
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/impl/ClassGradeUserServiceImpl.java
  64. 11 10
      zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/service/impl/InformServiceImpl.java
  65. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/order/bo/OrderBusinessConfigAddBo.java
  66. 4 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/order/bo/OrderBusinessConfigEditBo.java
  67. 6 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/order/bo/OrderBusinessConfigQueryBo.java
  68. 1 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/order/domain/Order.java
  69. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/order/domain/OrderBusinessConfig.java
  70. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/order/domain/OrderGoods.java
  71. 2 6
      zhongzheng-system/src/main/java/com/zhongzheng/modules/order/service/impl/OrderGoodsRefundServiceImpl.java
  72. 23 20
      zhongzheng-system/src/main/java/com/zhongzheng/modules/order/service/impl/OrderServiceImpl.java
  73. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/order/vo/OrderBusinessConfigVo.java
  74. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/schedule/service/IScheduleService.java
  75. 454 237
      zhongzheng-system/src/main/java/com/zhongzheng/modules/schedule/service/impl/ScheduleServiceImpl.java
  76. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/top/goods/bo/TopOldOrderGoodsAddBo.java
  77. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/top/goods/domain/TopOldOrderGoods.java
  78. 42 3
      zhongzheng-system/src/main/java/com/zhongzheng/modules/top/goods/service/impl/TopOldOrderServiceImpl.java
  79. 7 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/top/goods/vo/TopOldOrderGoodsListVo.java
  80. 3 3
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/bo/UserAppTelphoneLoginBo.java
  81. 45 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/bo/UserLiveAccountLoginBo.java
  82. 10 2
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/mapper/UserMapper.java
  83. 8 4
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/IUserService.java
  84. 4 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/impl/UserStudyRecordServiceImpl.java
  85. 70 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/impl/UserSubscribeServiceImpl.java
  86. 29 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/vo/UserLiveAccountLoginVo.java
  87. 34 0
      zhongzheng-system/src/main/resources/mapper/modules/course/CourseBusinessMapper.xml
  88. 8 0
      zhongzheng-system/src/main/resources/mapper/modules/course/CourseMapper.xml
  89. 4 0
      zhongzheng-system/src/main/resources/mapper/modules/course/CourseMenuExamMapper.xml
  90. 4 0
      zhongzheng-system/src/main/resources/mapper/modules/course/CourseMenuMapper.xml
  91. 1 1
      zhongzheng-system/src/main/resources/mapper/modules/course/CourseModuleChapterMapper.xml
  92. 10 1
      zhongzheng-system/src/main/resources/mapper/modules/course/CourseSectionMapper.xml
  93. 68 0
      zhongzheng-system/src/main/resources/mapper/modules/exam/ExamApplyMapper.xml
  94. 9 0
      zhongzheng-system/src/main/resources/mapper/modules/goods/GoodsMapper.xml
  95. 5 2
      zhongzheng-system/src/main/resources/mapper/modules/grade/ClassGradeUserMapper.xml
  96. 8 0
      zhongzheng-system/src/main/resources/mapper/modules/order/OrderBusinessConfigMapper.xml
  97. 2 0
      zhongzheng-system/src/main/resources/mapper/modules/order/OrderGoodsMapper.xml
  98. 2 0
      zhongzheng-system/src/main/resources/mapper/modules/top/TopOldOrderGoodsMapper.xml
  99. 42 0
      zhongzheng-system/src/main/resources/mapper/modules/user/UserMapper.xml
  100. 65 9
      zhongzheng-system/src/main/resources/mapper/modules/user/UserStudyRecordMapper.xml

+ 69 - 1
run-prod.sh

@@ -1,5 +1,36 @@
 #!/usr/bin/env bash
-
+# 定义应用组名
+group_name='zhongzheng'
+# 定义应用名称
+app_name='zhongzheng-saas-api'
+# 定义应用版本
+app_version='1.0-SNAPSHOT'
+# 定义应用环境
+profile_active='prod'
+echo '----copy jar----'
+docker stop ${app_name}
+echo '----stop container----'
+docker rm ${app_name}
+echo '----rm container----'
+docker rmi ${group_name}/${app_name}:${app_version}
+echo '----rm image----'
+# 打包编译docker镜像
+docker build -f /mydata/maven/build/Dockerfile -t ${group_name}/${app_name}:${app_version} .
+echo '----build image----'
+docker run -p 5055:5055 --name ${app_name} \
+--restart=always \
+-e 'spring.profiles.active'=${profile_active} \
+-e TZ="Asia/Shanghai" \
+-m 10240m \
+--cpus=3 \
+--log-opt max-size=50m \
+--log-opt max-file=3 \
+-v /etc/localtime:/etc/localtime \
+-v /usr/share/fonts:/usr/share/fonts \
+-v /data/logs/prod_api:/logs \
+-v /mydata/app/${app_name}/logs:/var/logs \
+-d ${group_name}/${app_name}:${app_version}
+echo '----start container----'
 
 echo "开始等待20秒..."
 # 1-10秒内随机
@@ -46,3 +77,40 @@ echo "开始等待20秒..."
 sleep 5
 echo "等待后继续"
 
+#!/usr/bin/env bash
+# 定义应用组名
+group_admin_name='zhongzheng'
+# 定义应用名称
+app_admin_name='zhongzheng-saas-admin-top'
+# 定义应用版本
+app_admin_version='1.0-SNAPSHOT'
+# 定义应用环境
+profile_active='prod'
+echo '----copy jar admin top----'
+docker stop ${app_admin_name}
+echo '----stop container admin top----'
+docker rm ${app_admin_name}
+echo '----rm container admin top----'
+docker rmi ${group_admin_name}/${app_admin_name}:${app_admin_version}
+echo '----rm image admin top----'
+# 打包编译docker镜像
+docker build -f /mydata/maven/build/Dockerfile-saas -t ${group_admin_name}/${app_admin_name}:${app_admin_version} .
+echo '----build image admin top----'
+docker run \
+-p 7077:7077 \
+--name ${app_admin_name} \
+--restart=always \
+--log-opt max-size=50m \
+--log-opt max-file=3 \
+-e 'spring.profiles.active'=${profile_active} \
+-e TZ="Asia/Shanghai" \
+-v /etc/localtime:/etc/localtime \
+-v /usr/share/fonts:/usr/share/fonts \
+-v /data/logs/prod_admin_top:/logs \
+-v /mydata/app/${app_admin_name}/logs:/var/logs \
+-v /data/nginx/conf.d:/data/nginx/conf.d \
+-d ${group_admin_name}/${app_admin_name}:${app_admin_version}
+echo '----start container admin top----'
+
+
+

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

@@ -170,3 +170,5 @@ oldSys:
 
 invoice:
     host: http://192.168.1.222:7077/sys/common/openMplatform/log
+
+liveHost: http://192.168.1.222:6009

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

@@ -170,3 +170,5 @@ oldSys:
 
 invoice:
     host: https://ptapi.gdzzkj.net/sys/common/openMplatform/log
+
+liveHost: https://sso.xyyxt.net

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

@@ -31,6 +31,10 @@ import com.zhongzheng.modules.distribution.service.IDistributionActivityGoodsSer
 import com.zhongzheng.modules.distribution.service.IDistributionCashWithdrawalService;
 import com.zhongzheng.modules.distribution.service.IDistributionSellerService;
 import com.zhongzheng.modules.distribution.vo.DistributionSellerVo;
+import com.zhongzheng.modules.exam.bo.ExamApplyDetailBo;
+import com.zhongzheng.modules.exam.bo.ExamApplyResultBo;
+import com.zhongzheng.modules.exam.service.IExamApplyService;
+import com.zhongzheng.modules.exam.vo.ExamApplyDetailVo;
 import com.zhongzheng.modules.goods.bo.AlikeGoodsBo;
 import com.zhongzheng.modules.goods.bo.GoodsQueryBo;
 import com.zhongzheng.modules.goods.bo.GoodsStudyUrlBo;
@@ -133,6 +137,8 @@ public class CommonController extends BaseController {
     @Autowired
     private IOrderGoodsRefundService iOrderGoodsRefundService;
     @Autowired
+    private IExamApplyService iExamApplyService;
+    @Autowired
     private IClassGradeUserService iClassGradeUserService;
 
     /**
@@ -253,6 +259,25 @@ public class CommonController extends BaseController {
         return AjaxResult.success(voList);
     }
 
+    @ApiOperation("七大员新考结果")
+    @PostMapping("common/apply/result")
+    public AjaxResult examApplyResult(@RequestBody ExamApplyResultBo bo) {
+        if (!ToolsUtils.checkSignFromOldSys(bo.getStamp().toString(), bo.getSign())) {
+            return AjaxResult.error("签名错误");
+        }
+        iExamApplyService.examApplyResult(bo);
+        return AjaxResult.success();
+    }
+
+
+    @ApiOperation("获取某场考试信息")
+    @PostMapping("common/apply/detail")
+    public AjaxResult examApplyDetail(@RequestBody ExamApplyDetailBo bo) {
+        List<ExamApplyDetailVo> voList = iExamApplyService.examApplyDetail(bo);
+        return AjaxResult.success(voList);
+    }
+
+
     @ApiOperation("旧系统获取商品学习中心路径")
     @PostMapping("common/get/goods/studyUrl")
     public AjaxResult getGoodsStudyUrl(@RequestBody GoodsStudyUrlBo bo) {

+ 55 - 0
zhongzheng-admin/src/main/java/com/zhongzheng/controller/common/EnterpriseController.java

@@ -0,0 +1,55 @@
+package com.zhongzheng.controller.common;
+
+import com.zhongzheng.common.core.domain.AjaxResult;
+import com.zhongzheng.modules.course.bo.CourseBusinessQueryBo;
+import com.zhongzheng.modules.course.bo.CourseEducationTypeQueryBo;
+import com.zhongzheng.modules.course.service.ICourseBusinessService;
+import com.zhongzheng.modules.course.service.ICourseEducationTypeService;
+import com.zhongzheng.modules.course.vo.CourseBusinessVo;
+import com.zhongzheng.modules.course.vo.CourseEducationTypeVo;
+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.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * @author yangdamao
+ * @date 2023年06月28日 11:39
+ */
+@Api(value = "B端接口控制器", tags = {"B端接口控制器"})
+@RequiredArgsConstructor(onConstructor_ = @Autowired)
+@RestController
+@RequestMapping("/enterprise/api")
+public class EnterpriseController {
+
+    private final ICourseEducationTypeService iCourseEducationTypeService;
+
+    private final ICourseBusinessService iCourseBusinessService;
+
+    /**
+     * 查询教育类型列表
+     */
+    @ApiOperation("查询教育类型列表")
+    @GetMapping("/education/list")
+    public AjaxResult<List<CourseEducationTypeVo>> getEducationList(CourseEducationTypeQueryBo bo) {
+        bo.setStatus(Arrays.asList(0,1));
+        return AjaxResult.success(iCourseEducationTypeService.queryList(bo));
+    }
+
+    /**
+     * 查询教育类型列表
+     */
+    @ApiOperation("查询教育类型列表")
+    @GetMapping("/business/list")
+    public AjaxResult<List<CourseBusinessVo>> getBusinessList(CourseBusinessQueryBo bo) {
+        bo.setStatus(Arrays.asList(0,1));
+        return AjaxResult.success(iCourseBusinessService.queryList(bo));
+    }
+
+}

+ 25 - 19
zhongzheng-admin/src/main/java/com/zhongzheng/controller/course/CourseEducationTypeController.java

@@ -1,36 +1,29 @@
 package com.zhongzheng.controller.course;
 
-import java.util.List;
-import java.util.Arrays;
-
-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.core.page.TableDataInfo;
 import com.zhongzheng.common.enums.BusinessType;
-import com.zhongzheng.modules.course.vo.CourseEducationTypeVo;
-import com.zhongzheng.modules.course.bo.CourseEducationTypeQueryBo;
 import com.zhongzheng.modules.course.bo.CourseEducationTypeAddBo;
 import com.zhongzheng.modules.course.bo.CourseEducationTypeEditBo;
+import com.zhongzheng.modules.course.bo.CourseEducationTypeQueryBo;
 import com.zhongzheng.modules.course.service.ICourseEducationTypeService;
-import com.zhongzheng.common.utils.poi.ExcelUtil;
-import com.zhongzheng.common.core.page.TableDataInfo;
+import com.zhongzheng.modules.course.vo.CourseEducationTypeVo;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+import lombok.RequiredArgsConstructor;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
 
 /**
  * 教育类型Controller
- * 
+ *
  * @author ruoyi
  * @date 2021-10-08
  */
@@ -50,10 +43,23 @@ public class CourseEducationTypeController extends BaseController {
     @GetMapping("/list")
     public TableDataInfo<CourseEducationTypeVo> list(CourseEducationTypeQueryBo bo) {
         startPage();
+        bo.setStatus(new ArrayList<Integer>(Arrays.asList(1)));
         List<CourseEducationTypeVo> list = iCourseEducationTypeService.queryList(bo);
         return getDataTable(list);
     }
 
+
+    /**
+     * 查询教育类型列表
+     */
+    @ApiOperation("查询所有业务层次列表")
+    @GetMapping("/allList")
+    public TableDataInfo<CourseEducationTypeVo> allList(CourseEducationTypeQueryBo bo) {
+        startPage();
+        bo.setStatus(new ArrayList<Integer>(Arrays.asList(1)));
+        List<CourseEducationTypeVo> list = iCourseEducationTypeService.queryAllList(bo);
+        return getDataTable(list);
+    }
     /**
      * 导出教育类型列表
      */

+ 3 - 1
zhongzheng-admin/src/main/java/com/zhongzheng/controller/course/CourseSubjectController.java

@@ -1,5 +1,6 @@
 package com.zhongzheng.controller.course;
 
+import java.util.ArrayList;
 import java.util.List;
 import java.util.Arrays;
 
@@ -30,7 +31,7 @@ import io.swagger.annotations.ApiOperation;
 
 /**
  * 科目Controller
- * 
+ *
  * @author ruoyi
  * @date 2021-10-09
  */
@@ -50,6 +51,7 @@ public class CourseSubjectController extends BaseController {
     @GetMapping("/list")
     public TableDataInfo<CourseSubjectVo> list(CourseSubjectQueryBo bo) {
         startPage();
+        bo.setStatus(new ArrayList<Integer>(Arrays.asList(1)));
         List<CourseSubjectVo> list = iCourseSubjectService.queryList(bo);
         return getDataTable(list);
     }

+ 22 - 31
zhongzheng-admin/src/main/java/com/zhongzheng/controller/goods/GoodsController.java

@@ -1,47 +1,29 @@
 package com.zhongzheng.controller.goods;
 
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Arrays;
-
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.lang.Validator;
-import com.zhongzheng.common.utils.ServletUtils;
-import com.zhongzheng.modules.bank.bo.ExamQuestionQueryBo;
+import com.zhongzheng.common.annotation.Log;
+import com.zhongzheng.common.core.controller.BaseController;
+import com.zhongzheng.common.core.domain.AjaxResult;
+import com.zhongzheng.common.core.page.TableDataInfo;
+import com.zhongzheng.common.enums.BusinessType;
+import com.zhongzheng.common.utils.poi.ExcelUtil;
 import com.zhongzheng.modules.bank.service.IQuestionService;
-import com.zhongzheng.modules.bank.vo.ExamQuestionVo;
-import com.zhongzheng.modules.bank.vo.ExamVo;
 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.service.IGoodsAttachedService;
-import com.zhongzheng.modules.goods.service.IGoodsAuditionConfigService;
 import com.zhongzheng.modules.goods.service.IGoodsService;
 import com.zhongzheng.modules.goods.vo.*;
-import com.zhongzheng.modules.grade.vo.StudyAccountStatusExportVo;
-import com.zhongzheng.modules.order.vo.OrderVo;
-import com.zhongzheng.modules.user.bo.UserExamRecordQueryBo;
-import com.zhongzheng.modules.user.entity.ClientLoginUser;
-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;
+import lombok.RequiredArgsConstructor;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.ArrayList;
+import java.util.List;
 
 /**
  * 商品Controller
@@ -339,6 +321,15 @@ public class GoodsController extends BaseController {
         return toAjax(iGoodsService.goodsBatchCopyIncrementTenant(bo) ? 1 : 0);
     }
 
+    /**
+     * 商品节点复制
+     */
+    @ApiOperation("商品节点复制")
+    @PostMapping("/node/copy/add")
+    public AjaxResult<Void> goodsNodeCopyAddTenant(@RequestBody GoodsNodeCopyTenantBo bo) {
+        return toAjax(iGoodsService.goodsNodeCopyAddTenant(bo) ? 1 : 0);
+    }
+
     /**
      * 商品关系ID处理(全量复制后的处理方法)
      */

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

@@ -430,4 +430,11 @@ public class ScheduleController extends BaseController {
         iScheduleService.distributionRebate();
         return AjaxResult.success();
     }
+
+    @ApiOperation("七大员考场创建")
+    @GetMapping("/examApply")
+    public AjaxResult createExamApply(){
+        iScheduleService.createExamApply();
+        return AjaxResult.success();
+    }
 }

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

@@ -172,3 +172,5 @@ oldSys:
 
 invoice:
     host: http://192.168.1.222:7077/sys/common/openMplatform/log
+
+liveHost: http://192.168.1.222:6009

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

@@ -170,3 +170,5 @@ oldSys:
 
 invoice:
     host: https://ptapi.gdzzkj.net/sys/common/openMplatform/log
+
+liveHost: https://sso.xyyxt.net

+ 1 - 1
zhongzheng-admin/src/main/resources/application.yml

@@ -117,7 +117,7 @@ token:
     # 令牌密钥
     secret: abcdefghijklmnopqrstuvwxyz
     # 令牌有效期(默认30分钟)
-    expireTime: 360
+    expireTime: 720
 
 # MyBatis配置
 # https://baomidou.com/config/

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

@@ -13,6 +13,8 @@ import com.zhongzheng.common.utils.ServletUtils;
 import com.zhongzheng.common.utils.ToolsUtils;
 import com.zhongzheng.framework.web.service.WxLoginService;
 import com.zhongzheng.modules.activity.vo.ActivityGoodsPriceVo;
+import com.zhongzheng.modules.alisms.bo.SmsAddBo;
+import com.zhongzheng.modules.alisms.service.IAliSmsService;
 import com.zhongzheng.modules.base.bo.ConfigQueryBo;
 import com.zhongzheng.modules.course.bo.CourseQueryBo;
 import com.zhongzheng.modules.course.bo.CourseTopicGoodsQueryBo;
@@ -36,6 +38,9 @@ import com.zhongzheng.modules.order.domain.Printer;
 import com.zhongzheng.modules.system.bo.SysTenantQueryBo;
 import com.zhongzheng.modules.system.service.ISysConfigService;
 import com.zhongzheng.modules.system.service.ISysTenantService;
+import com.zhongzheng.modules.user.bo.UserLiveAccountLoginBo;
+import com.zhongzheng.modules.user.service.IUserService;
+import com.zhongzheng.modules.user.vo.UserLiveAccountLoginVo;
 import com.zhongzheng.modules.wx.bo.WxInfoBo;
 import com.zhongzheng.modules.wx.bo.WxInfoQuery;
 import com.zhongzheng.modules.wx.bo.WxServerBody;
@@ -90,6 +95,10 @@ public class CommonController extends BaseController {
 
     private final IDistributionActivityGoodsService iDistributionActivityGoodsService;
 
+    private final IUserService iUserService;
+
+    private final IAliSmsService iSmsService;
+
     @PostMapping("/returnStream")
     public AjaxResult returnStream(MultipartFile file, HttpServletResponse response) throws IOException {
         ServletOutputStream out = null;
@@ -374,4 +383,39 @@ public class CommonController extends BaseController {
     public void loginAuthFailOffLine() {
         throw new CustomException("用户验证错误",409);
     }
+
+    @ApiOperation("直播短信统一登录")
+    @PostMapping("/live/sms_login")
+    public AjaxResult<UserLiveAccountLoginVo> sms_login(@RequestBody UserLiveAccountLoginBo bo) {
+        UserLiveAccountLoginVo vo = iUserService.smsLiveUnifyLogin(bo);
+        return AjaxResult.success(vo);
+    }
+
+    @ApiOperation("直播账号统一登录")
+    @PostMapping("/live/account_login")
+    public AjaxResult<UserLiveAccountLoginVo> account_login(@RequestBody UserLiveAccountLoginBo bo) {
+        UserLiveAccountLoginVo vo = iUserService.liveUnifyLogin(bo);
+        return AjaxResult.success(vo);
+    }
+
+    @ApiOperation("直播账号统一登录刷新")
+    @PostMapping("/live/account_login/refresh")
+    public AjaxResult<UserLiveAccountLoginVo> account_loginRefresh(@RequestBody UserLiveAccountLoginBo bo) {
+        UserLiveAccountLoginVo vo = iUserService.liveUnifyLoginRefresh(bo);
+        return AjaxResult.success(vo);
+    }
+
+    @ApiOperation("获取登录短信")
+    @PostMapping("/live/sms")
+    public AjaxResult liveSms(@RequestBody SmsAddBo bo) {
+        iSmsService.sendLiveSms(bo.getTel());
+        return AjaxResult.success();
+    }
+
+    @ApiOperation("获取7个工作日后的时间")
+    @GetMapping("/live/time")
+    public AjaxResult getLiveTime() {
+        Long time = iCourseService.getLiveTime();
+        return AjaxResult.success(time);
+    }
 }

+ 7 - 0
zhongzheng-api/src/main/java/com/zhongzheng/controller/user/LoginController.java

@@ -64,4 +64,11 @@ public class LoginController extends BaseController {
         Map<String,Object> map = iUserService.telphone_login(bo);
         return AjaxResult.success(map);
     }
+
+    @ApiOperation("用户账号自动登入")
+    @PostMapping("/automatic/account_login")
+    public AjaxResult automaticAccountLogin(@RequestBody UserAppTelphoneLoginBo bo) {
+        Map<String,Object> map = iUserService.automaticAccountLogin(bo);
+        return AjaxResult.success(map);
+    }
 }

+ 4 - 2
zhongzheng-api/src/main/resources/application-dev.yml

@@ -121,7 +121,7 @@ certificate:
 
 
 
-liveGotoURL: http://120.79.166.78:19014/
+liveGotoURL: http://
 
 
 enCodeVersion: trial
@@ -172,4 +172,6 @@ oldSys:
     host: http://gdxypx.xy.com
 
 invoice:
-    host: http://192.168.1.222:7077/sys/common/openMplatform/log
+    host: http://192.168.1.222:7077/sys/common/openMplatform/log
+
+liveHost: http://192.168.1.222:6009

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

@@ -182,3 +182,5 @@ oldSys:
 
 invoice:
     host: https://ptapi.gdzzkj.net/sys/common/openMplatform/log
+
+liveHost: https://sso.xyyxt.net

+ 110 - 6
zhongzheng-common/src/main/java/com/zhongzheng/common/utils/DateUtils.java

@@ -7,12 +7,9 @@ import org.apache.commons.lang3.time.DateFormatUtils;
 import java.lang.management.ManagementFactory;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
-import java.time.LocalDateTime;
+import java.time.*;
 import java.time.format.DateTimeFormatter;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Map;
+import java.util.*;
 
 /**
  * 时间工具类
@@ -123,6 +120,12 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
         return DateFormatUtils.format(date, "yyyy/MM/dd");
     }
 
+    public static Date timeToDate(Long times){
+        long t = times.longValue();
+        t = t * 1000;
+        return new Date(t);
+    }
+
     public static String timestampToDateFormatMonth(Long times){
         if(Validator.isEmpty(times)){
             return "";
@@ -153,6 +156,7 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
         return DateFormatUtils.format(date, patternStr);
     }
 
+
     /**
      * 将秒转为时分秒格式【01:01:01】
      * @param second 需要转化的秒数
@@ -405,8 +409,9 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
                 timeStr = "00:"+unitFormat(minute) + ":" + unitFormat(second);
             } else {
                 hour = minute / 60;
-                if (hour > 99)
+                if (hour > 99){
                     return "99:59:59";
+                }
                 minute = minute % 60;
                 second = time - hour * 3600 - minute * 60;
                 timeStr = unitFormat(hour) + ":" + unitFormat(minute) + ":" + unitFormat(second);
@@ -472,4 +477,103 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
                 return 7;
         }
     }
+
+
+    public static LocalDate[] getDateArray() {
+        // 创建一个长度为30的数组
+        LocalDate[] dates = new LocalDate[30];
+        // 获取今天的日期
+        LocalDate today = LocalDate.now();
+        // 用循环给数组赋值
+        for (int i = 0; i < dates.length; i++) {
+            // 用today.plusDays(i)得到第i天的日期
+            dates[i] = today.plusDays(i);
+        }
+        // 返回数组
+        return dates;
+    }
+
+    static List<String> holiday =new ArrayList<>();
+    static List<String> extraWorkDay =new ArrayList<>();
+    public static Boolean isWorkingDay(long time) {
+        LocalDateTime dateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(time), ZoneOffset.of("+8"));
+        String formatTime = dateTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
+        initHoliday();
+        initExtraWorkDay();
+        //是否加班日
+        if(extraWorkDay.contains(formatTime)){
+            return true;
+        }
+        //是否节假日
+        if(holiday.contains(formatTime)){
+            return false;
+        }
+        //如果是1-5表示周一到周五  是工作日
+        DayOfWeek week = dateTime.getDayOfWeek();
+        if(week==DayOfWeek.SATURDAY||week==DayOfWeek.SUNDAY){
+            return false;
+        }
+        return true;
+
+    }
+
+    /**
+     *  初始化节假日
+     */
+    public static void initHoliday(){
+        holiday.add("2023-06-22");
+        holiday.add("2023-06-23");
+        holiday.add("2023-09-29");
+        holiday.add("2023-09-30");
+        holiday.add("2023-10-01");
+        holiday.add("2023-10-02");
+        holiday.add("2023-10-03");
+        holiday.add("2023-10-04");
+        holiday.add("2023-10-05");
+        holiday.add("2023-10-06");
+    }
+    /**
+     *  初始化额外加班日
+     */
+    public static void initExtraWorkDay(){
+        extraWorkDay.add("2023-06-25");
+        extraWorkDay.add("2023-10-07");
+        extraWorkDay.add("2023-10-08");
+    }
+
+
+    /**
+     * 指定时间往前或往后推n天
+     *
+     * @param dateTime 指定时间
+     * @param x 指定天数
+     * @return
+     */
+    public static Long getDayBefore(Long dateTime, int x) {
+        Calendar c = Calendar.getInstance();
+        Date date = new Date(dateTime*1000);
+        c.setTime(date);
+        int day = c.get(Calendar.DATE);
+        c.set(Calendar.DATE, day - x);    //往前推几天
+        //c.set(Calendar.DATE, day + x);  往后推几天
+        return c.getTime().getTime()/1000;
+    }
+
+    /**
+     * 指定时间往前或往后推n天
+     *
+     * @param dateTime 指定时间
+     * @param x 指定天数
+     * @return
+     */
+    public static Long getDayAfter(Long dateTime, int x) {
+        Calendar c = Calendar.getInstance();
+        Date date = new Date(dateTime*1000);
+        c.setTime(date);
+        int day = c.get(Calendar.DATE);
+//        c.set(Calendar.DATE, day - x);    //往前推几天
+        c.set(Calendar.DATE, day + x);  //往后推几天
+        return c.getTime().getTime()/1000;
+    }
+
 }

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

@@ -139,6 +139,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
                 .antMatchers("/common/merge/file").anonymous()
                 .antMatchers("/common/get/goods").anonymous()
                 .antMatchers("/common/get/goods/studyUrl").anonymous()
+                .antMatchers("/common/apply/detail").anonymous()
                 .antMatchers("/common/platform/pay").anonymous()
                 .antMatchers("/common/platform/pay/handle").anonymous()
                 .antMatchers("/common/alike/goods").anonymous()

+ 1 - 1
zhongzheng-framework/src/main/java/com/zhongzheng/framework/web/service/TokenService.java

@@ -114,7 +114,7 @@ public class TokenService
             }
         }
         LoginUser loginUser = (LoginUser) authentication.getPrincipal();
-        loginUser.setExpireTime(System.currentTimeMillis()+200);
+        loginUser.setExpireTime(System.currentTimeMillis());
         return loginUser;
     }
 

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

@@ -1,6 +1,7 @@
 package com.zhongzheng.framework.web.service;
 
 import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.codec.Base64;
 import cn.hutool.core.convert.Convert;
 import cn.hutool.core.lang.Validator;
 import cn.hutool.core.util.ObjectUtil;
@@ -14,6 +15,7 @@ import com.baomidou.mybatisplus.core.toolkit.StringUtils;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.github.pagehelper.Page;
+import com.google.common.base.Splitter;
 import com.zhongzheng.common.constant.Constants;
 import com.zhongzheng.common.core.domain.model.LoginUser;
 import com.zhongzheng.common.core.redis.RedisCache;
@@ -30,20 +32,30 @@ import com.zhongzheng.modules.collect.domain.CollectNote;
 import com.zhongzheng.modules.collect.mapper.CollectBankMapper;
 import com.zhongzheng.modules.collect.mapper.CollectCourseMapper;
 import com.zhongzheng.modules.collect.mapper.CollectNoteMapper;
+import com.zhongzheng.modules.course.domain.Course;
+import com.zhongzheng.modules.course.domain.CourseSection;
 import com.zhongzheng.modules.course.domain.CourseSubject;
+import com.zhongzheng.modules.course.service.ICourseSectionService;
+import com.zhongzheng.modules.course.service.ICourseService;
 import com.zhongzheng.modules.course.service.ICourseSubjectService;
+import com.zhongzheng.modules.goods.domain.Goods;
+import com.zhongzheng.modules.goods.service.IGoodsService;
 import com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo;
 import com.zhongzheng.modules.grade.service.IClassGradeUserService;
 import com.zhongzheng.modules.grade.vo.ClassGradeUserGoodsVo;
-import com.zhongzheng.modules.inform.domain.InformRemind;
+import com.zhongzheng.modules.system.domain.SysTenant;
 import com.zhongzheng.modules.system.service.ISysConfigService;
+import com.zhongzheng.modules.system.service.ISysTenantService;
 import com.zhongzheng.modules.user.bo.*;
-import com.zhongzheng.modules.user.domain.*;
+import com.zhongzheng.modules.user.domain.User;
+import com.zhongzheng.modules.user.domain.UserStudyLog;
+import com.zhongzheng.modules.user.domain.UserVisitLog;
 import com.zhongzheng.modules.user.entity.ClientLoginUser;
 import com.zhongzheng.modules.user.mapper.UserMapper;
 import com.zhongzheng.modules.user.service.*;
 import com.zhongzheng.modules.user.vo.*;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.CollectionUtils;
@@ -115,6 +127,17 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
     private IUserLoginErrorService iUserLoginErrorService;
     @Autowired
     private  ISysConfigService configService;
+    @Autowired
+    private IGoodsService iGoodsService;
+    @Autowired
+    private ISysTenantService iSysTenantService;
+
+    @Autowired
+    private ICourseService iCourseService;
+    @Autowired
+    private ICourseSectionService iCourseSectionService;
+    @Value("${liveGotoURL}")
+    private String liveGotoURL;
 
 
     @Override
@@ -1089,6 +1112,8 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
         });
     }
 
+
+
     private Long findSubjectId(String subject){
         if(subject!=null){
             String key = "SUB_"+subject;
@@ -1212,6 +1237,335 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
         return this.updateById(update);
     }
 
+    @Override
+    public UserLiveAccountLoginVo liveUnifyLogin(UserLiveAccountLoginBo bo) {
+        if (bo.getType() != 1){
+            throw new CustomException("登录错误");
+        }
+        if(Validator.isEmpty(bo.getAccount())){
+            throw new CustomException("账号不能为空");
+        }
+
+        List<User> userList = baseMapper.getUserByTel(bo.getAccount());
+        if (CollectionUtils.isEmpty(userList)){
+            throw new CustomException("账号不存在!请检查");
+        }
+        //参数解析
+        String param = new String(Base64.decode(bo.getParam()));
+        if (StringUtils.isBlank(param)){
+            throw new CustomException("参数为空");
+        }
+
+        Map<String, String> split = Splitter.on("&").withKeyValueSeparator("=").split(param);
+        //商品ID
+        Long goodsId = Long.valueOf(split.get("gid"));
+        //观看权限
+        String per = split.get("watchPer");
+        //课程ID
+        String cid = split.get("cid");
+        //节ID
+        String sid = split.get("sid");
+
+        //获取对应商品
+        Goods goods = iGoodsService.getGoodsByIdNotTenant(goodsId);
+        User user = new User();
+        if (StringUtils.isNotBlank(per) && Integer.valueOf(per) == 2){
+            //所有人都可以看
+            user = userList.stream().filter(item -> {
+                Long tenantId = item.getTenantId();
+                Course course = iCourseService.getCourseByNotTenant(Long.valueOf(cid));
+                Long courseId = iCourseService.getCourseByTenantTwo(course.getCourseName(),course.getCode(),tenantId);
+                CourseSection section = iCourseSectionService.getSectionByNotTenant(Long.valueOf(sid));
+                CourseSection courseSection = iCourseSectionService.getSectionByTenantTwo(section.getName(),section.getCode(),tenantId);
+                Goods goodsTwo = iGoodsService.getGoodsByTenantTwo(goods.getGoodsName(),goods.getCode(),tenantId);
+                return ObjectUtils.isNotNull(courseId) && ObjectUtils.isNotNull(courseSection) && ObjectUtils.isNotNull(goodsTwo);
+            }).findFirst().orElse(null);
+
+        }else {
+            user = userList.stream().filter(item -> {
+                //判断用户是否购买商品
+                Long count = baseMapper.getUserOrderCount(item.getUserId(), item.getTenantId(), goods.getCode(), goods.getGoodsName());
+                return count > 0;
+            }).findFirst().orElse(null);
+        }
+
+        if(Validator.isEmpty(user)){
+            throw new CustomException("请联系管理员!");
+        }
+        else if (UserStatus.DISABLE.getCode().equals(user.getStatus()))
+        {
+            throw new BaseException("对不起,您的账号:已停用");
+        }
+        String password = null;
+        if(bo.getPwd().length()>20){
+            String rsaPrivate = null;
+            try {
+                InputStream certStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("config/pri.key");
+                rsaPrivate = AES.getStringByInputStream_1(certStream);
+                certStream.close();
+                password = AES.decrypt(bo.getPwd(),rsaPrivate);
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }else{
+            password = bo.getPwd();
+        }
+        if (!SecurityUtils.matchesPassword(password,user.getPassword()))
+        {
+            iUserLoginErrorService.saveErrorLog(bo.getAccount());
+            throw new BaseException("登录信息错误");
+        }
+        Long tenantId = user.getTenantId();
+        //组装跳转路径
+        SysTenant tenant = iSysTenantService.getById(tenantId);
+        String post = "";
+        String path = "";
+        switch (bo.getUrlType()){
+            case 1://H5
+                post = tenant.getHostH5();
+                path = "pages/webview/index";
+                break;
+            case 2://PC
+                post = tenant.getHostPc();
+                path = "living-room";
+                break;
+        }
+
+        Course course = iCourseService.getCourseByNotTenant(Long.valueOf(cid));
+        Long courseId = iCourseService.getCourseByTenantTwo(course.getCourseName(),course.getCode(),tenantId);
+        CourseSection section = iCourseSectionService.getSectionByNotTenant(Long.valueOf(sid));
+        CourseSection courseSection = iCourseSectionService.getSectionByTenantTwo(section.getName(),section.getCode(),tenantId);
+        Goods goodsTwo = iGoodsService.getGoodsByTenantTwo(goods.getGoodsName(),goods.getCode(),tenantId);
+
+        String url = "";
+        switch (bo.getUrlType()){
+            case 1://H5
+                String format1 = String.format("cid=%s&gid=%s&sid=%s&a=1", courseId, goodsTwo.getGoodsId(), courseSection.getSectionId());
+                String s1 = Base64.encode(format1);
+                url = String.format("%s/%s/%s?scene=%s",liveGotoURL, post,path, s1);
+                break;
+            case 2://Pc
+                String format = String.format("cid=%s&gid=%s&sid=%s", courseId, goodsTwo.getGoodsId(), courseSection.getSectionId());
+                String s = Base64.encode(format);
+                url = String.format("%s/%s/%s/%s?a=1&%s",liveGotoURL, post,path,courseSection.getLiveUrl(), s);
+                break;
+            default:
+                break;
+        }
+
+        UserLiveAccountLoginVo vo = new UserLiveAccountLoginVo();
+        vo.setTel(user.getTelphone());
+        vo.setUser_account(user.getUserAccount());
+        vo.setUrl(url);
+        vo.setTenantId(tenantId);
+        return vo;
+    }
+
+    @Override
+    public Map<String, Object> automaticAccountLogin(UserAppTelphoneLoginBo bo) {
+        User user = baseMapper.getUserByAccount(bo.getUserAccount());
+
+        if(Validator.isEmpty(user)){
+            throw new CustomException("该账号不存在");
+        }
+        ClientLoginUser loginUser = new ClientLoginUser();
+        loginUser.setUser(user);
+        Map<String,Object> map = new HashMap<>();
+        map.put(Constants.TOKEN,wxTokenService.createToken(loginUser));
+        map.put("user_account",user.getUserAccount());
+        map.put("full_info",Validator.isEmpty(user.getIdCard())?false:true); //是否完善身份信息
+        return map;
+    }
+
+    @Override
+    public UserLiveAccountLoginVo smsLiveUnifyLogin(UserLiveAccountLoginBo bo) {
+        if(bo.getTel()==null){
+            throw new CustomException("手机号不能为空");
+        }
+        String key = Constants.LOGIN_SMS + bo.getTel();
+        String code =  redisCache.getCacheObjectNoTenant(key);
+        if(code==null){
+            throw new CustomException("验证码错误");
+        }
+        if(!code.equals(bo.getCode())){
+            throw new CustomException("验证码错误");
+        }
+        redisCache.deleteObject(key);
+
+        if (bo.getType() != 1){
+            throw new CustomException("登录错误");
+        }
+
+        List<User> userList = baseMapper.getUserByTel(bo.getTel());
+        if (CollectionUtils.isEmpty(userList)){
+            throw new CustomException("请联系管理员!");
+        }
+        //参数解析
+        String param = new String(Base64.decode(bo.getParam()));
+        if (StringUtils.isBlank(param)){
+            throw new CustomException("参数为空");
+        }
+
+        Map<String, String> split = Splitter.on("&").withKeyValueSeparator("=").split(param);
+        //商品ID
+        Long goodsId = Long.valueOf(split.get("gid"));
+        //观看权限
+        String per = split.get("watchPer");
+        //课程ID
+        String cid = split.get("cid");
+        //节ID
+        String sid = split.get("sid");
+        //获取对应商品
+        Goods goods = iGoodsService.getGoodsByIdNotTenant(goodsId);
+        User user = new User();
+        if (StringUtils.isNotBlank(per) && Integer.valueOf(per) == 2){
+            //所有人都可以看
+            user = userList.stream().filter(item -> {
+                Long tenantId = item.getTenantId();
+                Course course = iCourseService.getCourseByNotTenant(Long.valueOf(cid));
+                Long courseId = iCourseService.getCourseByTenantTwo(course.getCourseName(),course.getCode(),tenantId);
+                CourseSection section = iCourseSectionService.getSectionByNotTenant(Long.valueOf(sid));
+                CourseSection courseSection = iCourseSectionService.getSectionByTenantTwo(section.getName(),section.getCode(),tenantId);
+                Goods goodsTwo = iGoodsService.getGoodsByTenantTwo(goods.getGoodsName(),goods.getCode(),tenantId);
+                return ObjectUtils.isNotNull(courseId) && ObjectUtils.isNotNull(courseSection) && ObjectUtils.isNotNull(goodsTwo);
+            }).findFirst().orElse(null);
+
+        }else {
+            user = userList.stream().filter(item -> {
+                //判断用户是否购买商品
+                Long count = baseMapper.getUserOrderCount(item.getUserId(), item.getTenantId(), goods.getCode(), goods.getGoodsName());
+                return count > 0;
+            }).findFirst().orElse(null);
+        }
+
+        if(Validator.isEmpty(user)){
+            throw new CustomException("账号未注册,请联系管理员!");
+        }
+        else if (UserStatus.DISABLE.getCode().equals(user.getStatus()))
+        {
+            throw new BaseException("对不起,您的账号:已停用");
+        }
+
+        Long tenantId = user.getTenantId();
+        //组装跳转路径
+        SysTenant tenant = iSysTenantService.getById(tenantId);
+        String post = "";
+        String path = "";
+        switch (bo.getUrlType()){
+            case 1://H5
+                post = tenant.getHostH5();
+                path = "pages/webview/index";
+                break;
+            case 2://PC
+                post = tenant.getHostPc();
+                path = "living-room";
+                break;
+        }
+        Course course = iCourseService.getCourseByNotTenant(Long.valueOf(cid));
+        Long courseId = iCourseService.getCourseByTenantTwo(course.getCourseName(),course.getCode(),tenantId);
+        CourseSection section = iCourseSectionService.getSectionByNotTenant(Long.valueOf(sid));
+        CourseSection courseSection = iCourseSectionService.getSectionByTenantTwo(section.getName(),section.getCode(),tenantId);
+        Goods goodsTwo = iGoodsService.getGoodsByTenantTwo(goods.getGoodsName(),goods.getCode(),tenantId);
+
+        String url = "";
+        switch (bo.getUrlType()){
+            case 1://H5
+                String format1 = String.format("cid=%s&gid=%s&sid=%s&a=1", courseId, goodsTwo.getGoodsId(), courseSection.getSectionId());
+                String s1 = Base64.encode(format1);
+                url = String.format("%s/%s/%s?scene=%s",liveGotoURL, post,path, s1);
+                break;
+            case 2://Pc
+                String format = String.format("cid=%s&gid=%s&sid=%s", courseId, goodsTwo.getGoodsId(), courseSection.getSectionId());
+                String s = Base64.encode(format);
+                url = String.format("%s/%s/%s/%s?a=1&%s",liveGotoURL, post,path,courseSection.getLiveUrl(), s);
+                break;
+            default:
+                break;
+        }
+
+        UserLiveAccountLoginVo vo = new UserLiveAccountLoginVo();
+        vo.setTel(user.getTelphone());
+        vo.setUser_account(user.getUserAccount());
+        vo.setUrl(url);
+        vo.setTenantId(tenantId);
+        return vo;
+    }
+
+    @Override
+    public UserLiveAccountLoginVo liveUnifyLoginRefresh(UserLiveAccountLoginBo bo) {
+        if(Validator.isEmpty(bo.getUser_account())){
+            throw new CustomException("账号不能为空");
+        }
+
+        User user = baseMapper.getUserByAccount(bo.getUser_account());
+        if(Validator.isEmpty(user)){
+            throw new CustomException("登录信息错误");
+        }
+        else if (UserStatus.DISABLE.getCode().equals(user.getStatus()))
+        {
+            throw new BaseException("对不起,您的账号:已停用");
+        }
+        //参数解析
+        String param = new String(Base64.decode(bo.getParam()));
+        if (StringUtils.isBlank(param)){
+            throw new CustomException("参数为空");
+        }
+
+        Map<String, String> split = Splitter.on("&").withKeyValueSeparator("=").split(param);
+        Long goodsId = Long.valueOf(split.get("gid"));
+
+        //获取对应商品
+        Goods goods = iGoodsService.getGoodsByIdNotTenant(goodsId);
+
+        Long tenantId = user.getTenantId();
+        //组装跳转路径
+        SysTenant tenant = iSysTenantService.getById(tenantId);
+        String post = "";
+        String path = "";
+        switch (bo.getUrlType()){
+            case 1://H5
+                post = tenant.getHostH5();
+                path = "pages/webview/index";
+                break;
+            case 2://PC
+                post = tenant.getHostPc();
+                path = "living-room";
+                break;
+        }
+
+        String cid = split.get("cid");
+        String sid = split.get("sid");
+        Course course = iCourseService.getCourseByNotTenant(Long.valueOf(cid));
+        Long courseId = iCourseService.getCourseByTenantTwo(course.getCourseName(),course.getCode(),tenantId);
+        CourseSection section = iCourseSectionService.getSectionByNotTenant(Long.valueOf(sid));
+        CourseSection courseSection = iCourseSectionService.getSectionByTenantTwo(section.getName(),section.getCode(),tenantId);
+        Goods goodsTwo = iGoodsService.getGoodsByTenantTwo(goods.getGoodsName(),goods.getCode(),tenantId);
+
+        String url = "";
+        switch (bo.getUrlType()){
+            case 1://H5
+                String format1 = String.format("cid=%s&gid=%s&sid=%s&a=1", courseId, goodsTwo.getGoodsId(), courseSection.getSectionId());
+                String s1 = Base64.encode(format1);
+                url = String.format("%s/%s/%s?scene=%s",liveGotoURL, post,path, s1);
+                break;
+            case 2://Pc
+                String format = String.format("cid=%s&gid=%s&sid=%s", courseId, goodsTwo.getGoodsId(), courseSection.getSectionId());
+                String s = Base64.encode(format);
+                url = String.format("%s/%s/%s/%s?a=1&%s",liveGotoURL, post,path,courseSection.getLiveUrl(), s);
+                break;
+            default:
+                break;
+        }
+
+        UserLiveAccountLoginVo vo = new UserLiveAccountLoginVo();
+        vo.setTel(user.getTelphone());
+        vo.setUser_account(user.getUserAccount());
+        vo.setUrl(url);
+        vo.setTenantId(tenantId);
+        return vo;
+    }
+
+
     @Override
     public Map<String, Object> accountLogin(UserAppAccountLoginBo bo) {
         if(Validator.isEmpty(bo.getAccount())){

+ 2 - 2
zhongzheng-system/src/main/java/com/zhongzheng/modules/alisms/service/IAliSmsService.java

@@ -3,8 +3,6 @@ package com.zhongzheng.modules.alisms.service;
 
 import com.zhongzheng.modules.alisms.vo.ResultBean;
 
-import javax.servlet.http.HttpServletRequest;
-
 public interface IAliSmsService {
     ResultBean sendSms(String tel,String param);
 
@@ -26,4 +24,6 @@ public interface IAliSmsService {
     Boolean sendSellerForgetSms(String tel);
 
     Boolean sendSellerLoginSms(String tel);
+
+    Boolean sendLiveSms(String tel);
 }

+ 32 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/alisms/service/impl/AliSmsServiceImpl.java

@@ -349,4 +349,36 @@ public class AliSmsServiceImpl implements IAliSmsService {
         }
         return false;
     }
+
+    @Override
+    public Boolean sendLiveSms(String tel) {
+        if(tel==null){
+            throw new CustomException("手机号码不能为空");
+        }
+        User user = iUserService.getUserByTelNotTenant(tel).stream().findFirst().orElse(null);
+        if(Validator.isEmpty(user)){
+            throw new CustomException("该手机号未注册");
+        }
+        ServletUtils.getResponse().setHeader("TenantId",user.getTenantId().toString());
+        String code = ToolsUtils.getSmsCode();
+        String key = Constants.LOGIN_SMS + tel;
+        redisCache.setCacheObjectTenant(key,code,5, TimeUnit.MINUTES);//5分钟
+        try{
+            Map<String,Object> param = new HashMap<>();
+            param.put("code",code);
+            SendSmsResponse response = SmsUtils.sendSms(tel,SIGNNAME,LOGINTEMPLATECODE, JSON.toJSONString(param),ACCESSKEYID,ACCESSKEYSECRET);
+            if(response.getBody().getMessage().equals("OK")){
+                SmsAddBo smsAddBo = new SmsAddBo();
+                smsAddBo.setCode(code);
+                smsAddBo.setTel(tel);
+                smsAddBo.setType(3L);
+                smsAddBo.setIp(IpUtils.getIpAddr(ServletUtils.getRequest()));
+                iSmsService.insertByAddBo(smsAddBo);
+                return true;
+            }
+        }catch (Exception e){
+            throw new CustomException(e.getMessage());
+        }
+        return false;
+    }
 }

+ 1 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/bo/CourseBusinessQueryBo.java

@@ -60,7 +60,7 @@ public class CourseBusinessQueryBo extends BaseEntity {
 
 	/** 教育类型id */
 	@ApiModelProperty("教育类型id")
-	private Integer educationId;
+	private Long educationId;
 
 	@Excel(name = "模板选用")
 	@ApiModelProperty("模板选用")

+ 5 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/mapper/CourseBusinessMapper.java

@@ -5,9 +5,12 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.zhongzheng.modules.course.bo.CourseBusinessQueryBo;
 import com.zhongzheng.modules.course.domain.CourseBusiness;
 import com.zhongzheng.modules.course.vo.CourseBusinessVo;
+import com.zhongzheng.modules.top.goods.bo.TopCourseBusinessQueryBo;
+import com.zhongzheng.modules.top.goods.vo.TopCourseBusinessVo;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.Collection;
+import java.util.List;
 
 /**
  * 业务层次Mapper接口
@@ -28,4 +31,6 @@ public interface CourseBusinessMapper extends BaseMapper<CourseBusiness> {
     CourseBusiness getBusinessByIdTenant(@Param("businessId") Long businessId,@Param("tenantId") Long tenantId);
 
     CourseBusinessVo queryFullId(CourseBusinessQueryBo bo);
+
+    List<CourseBusinessVo> queryAllList(CourseBusinessQueryBo bo);
 }

+ 6 - 3
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/mapper/CourseMapper.java

@@ -3,8 +3,6 @@ package com.zhongzheng.modules.course.mapper;
 
 import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.zhongzheng.common.core.domain.entity.SysRole;
-import com.zhongzheng.modules.course.bo.CourseMenuQueryBo;
 import com.zhongzheng.modules.course.bo.CourseQueryBo;
 import com.zhongzheng.modules.course.domain.Course;
 import com.zhongzheng.modules.course.vo.CourseUserVo;
@@ -18,7 +16,6 @@ import com.zhongzheng.modules.user.bo.UserPlanQueryBo;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
-import java.util.Map;
 
 /**
  * 课程Mapper接口
@@ -59,4 +56,10 @@ public interface CourseMapper extends BaseMapper<Course> {
 
     @InterceptorIgnore(tenantLine = "true")
     Course getCourseByTenant(@Param("code") String code,@Param("newTenantId") Long newTenantId);
+
+    @InterceptorIgnore(tenantLine = "true")
+    Course getCourseByNotTenant(@Param("cid") Long cid);
+
+    @InterceptorIgnore(tenantLine = "true")
+    Long getCourseByTenantTwo(@Param("courseName") String courseName,@Param("code") String code,@Param("tenantId") Long tenantId);
 }

+ 4 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/mapper/CourseMenuExamMapper.java

@@ -22,4 +22,8 @@ public interface CourseMenuExamMapper extends BaseMapper<CourseMenuExam> {
 
     @InterceptorIgnore(tenantLine = "true")
     void deleteByIdTenant(@Param("newCourseId") Long newCourseId,@Param("newTenantId") Long newTenantId);
+
+    @InterceptorIgnore(tenantLine = "true")
+    void deleteModuleByIdTenant(@Param("newCourseId")Long newCourseId,@Param("newModuleId") Long newModuleId,@Param("newTenantId") Long newTenantId);
+
 }

+ 4 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/mapper/CourseMenuMapper.java

@@ -39,4 +39,8 @@ public interface CourseMenuMapper extends BaseMapper<CourseMenu> {
 
     @InterceptorIgnore(tenantLine = "true")
     void deleteByIdTenant(@Param("newCourseId") Long newCourseId,@Param("newTenantId") Long newTenantId);
+
+    @InterceptorIgnore(tenantLine = "true")
+    List<CourseMenu> selectByNotTenant(@Param("newCourseId") Long newCourseId,@Param("type") Integer type,@Param("newModuleId") Long newModuleId,@Param("newTenantId") Long newTenantId);
+
 }

+ 1 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/mapper/CourseModuleChapterMapper.java

@@ -19,7 +19,7 @@ import java.util.List;
  * @date 2021-10-11
  */
 public interface CourseModuleChapterMapper extends BaseMapper<CourseModuleChapter> {
-    List<CourseModuleChapterVo> getListById(Long id);
+    List<CourseModuleChapterVo> getListById(@Param("id") Long id,@Param("tenantId") Long tenantId);
 
     List<CourseUserModuleChapterVo> chapterList(CourseMenuQueryBo bo);
 

+ 6 - 2
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/mapper/CourseSectionMapper.java

@@ -4,9 +4,7 @@ import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.zhongzheng.modules.course.bo.CourseSectionQueryBo;
 import com.zhongzheng.modules.course.domain.CourseSection;
-import com.zhongzheng.modules.course.domain.CourseStreamingBusiness;
 import com.zhongzheng.modules.course.vo.CourseSectionVo;
-import com.zhongzheng.modules.grade.vo.ClassGradeVo;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
@@ -30,4 +28,10 @@ public interface CourseSectionMapper extends BaseMapper<CourseSection> {
 
     @InterceptorIgnore(tenantLine = "true")
     CourseSection getSectionByTenant(@Param("code") String code,@Param("newTenantId") Long newTenantId);
+
+    @InterceptorIgnore(tenantLine = "true")
+    CourseSection getSectionByNotTenant(@Param("sid") Long sid);
+
+    @InterceptorIgnore(tenantLine = "true")
+    CourseSection getSectionByTenantTwo(@Param("name") String name,@Param("code") String code,@Param("tenantId") Long tenantId);
 }

+ 4 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/ICourseBusinessService.java

@@ -6,7 +6,9 @@ import com.zhongzheng.modules.course.bo.CourseBusinessEditBo;
 import com.zhongzheng.modules.course.bo.CourseBusinessQueryBo;
 import com.zhongzheng.modules.course.domain.CourseBusiness;
 import com.zhongzheng.modules.course.vo.CourseBusinessVo;
+import com.zhongzheng.modules.top.goods.bo.TopCourseBusinessQueryBo;
 import com.zhongzheng.modules.top.goods.domain.TopCourseBusiness;
+import com.zhongzheng.modules.top.goods.vo.TopCourseBusinessVo;
 
 import java.util.Collection;
 import java.util.List;
@@ -68,4 +70,6 @@ public interface ICourseBusinessService extends IService<CourseBusiness> {
 	CourseBusiness getBusinessByIdTenant(Long businessId, Long tenantId);
 
 	CourseBusinessVo queryFullId(CourseBusinessQueryBo bo);
+
+	List<CourseBusinessVo> queryAllList(CourseBusinessQueryBo bo);
 }

+ 4 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/ICourseEducationTypeService.java

@@ -7,6 +7,8 @@ import com.zhongzheng.modules.course.bo.CourseEducationTypeQueryBo;
 import com.zhongzheng.modules.course.bo.CourseEducationTypeAddBo;
 import com.zhongzheng.modules.course.bo.CourseEducationTypeEditBo;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.zhongzheng.modules.top.goods.bo.TopCourseEducationTypeQueryBo;
+import com.zhongzheng.modules.top.goods.vo.TopCourseEducationTypeVo;
 
 import java.util.Collection;
 import java.util.List;
@@ -33,6 +35,8 @@ public interface ICourseEducationTypeService extends IService<CourseEducationTyp
 	 */
 	List<CourseEducationTypeVo> queryList(CourseEducationTypeQueryBo bo);
 
+	List<CourseEducationTypeVo> queryAllList(CourseEducationTypeQueryBo bo);
+
 	/**
 	 * 根据新增业务对象插入教育类型
 	 * @param bo 教育类型新增业务对象

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

@@ -53,4 +53,6 @@ public interface ICourseMenuExamService extends IService<CourseMenuExam> {
 	Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
 
     void deleteByIdTenant(Long newCourseId, Long newTenantId);
+
+    void deleteModuleByIdTenant(Long newCourseId, Long newModuleId, Long newTenantId);
 }

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

@@ -66,4 +66,6 @@ public interface ICourseMenuService extends IService<CourseMenu> {
 	List<CourseUserMenuVo> getGoodsRebuildMenuList(CourseMenuQueryBo bo);
 
     void deleteByIdTenant(Long newCourseId, Long newTenantId);
+
+    List<CourseMenu> selectByNotTenant(Long newCourseId, Integer type, Long newModuleId,Long newTenantId);
 }

+ 5 - 2
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/ICourseSectionService.java

@@ -2,7 +2,6 @@ package com.zhongzheng.modules.course.service;
 
 
 import com.baomidou.mybatisplus.extension.service.IService;
-import com.zhongzheng.modules.bank.vo.QuestionImport;
 import com.zhongzheng.modules.course.bo.CourseSectionAddBo;
 import com.zhongzheng.modules.course.bo.CourseSectionBusinessAddBo;
 import com.zhongzheng.modules.course.bo.CourseSectionEditBo;
@@ -13,7 +12,6 @@ import com.zhongzheng.modules.course.vo.CourseSectionImport;
 import com.zhongzheng.modules.course.vo.CourseSectionVo;
 import com.zhongzheng.modules.goods.bo.GoodsBatchDelBo;
 import net.polyv.live.v1.entity.chat.LiveGetMessageListResponse;
-import org.apache.ibatis.annotations.Param;
 
 import java.io.IOException;
 import java.security.NoSuchAlgorithmException;
@@ -79,4 +77,9 @@ public interface ICourseSectionService extends IService<CourseSection> {
     boolean batchDelSection(GoodsBatchDelBo bo);
 
     CourseSection getSectionByTenant(String code, Long newTenantId);
+
+    CourseSection getSectionByNotTenant(Long sid);
+
+	CourseSection getSectionByTenantTwo(String name, String code, Long tenantId);
+
 }

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

@@ -89,4 +89,11 @@ public interface ICourseService extends IService<Course> {
     Course getCourseByTenant(String code, Long newTenantId);
 
 	Boolean checkTime();
+
+    Course getCourseByNotTenant(Long cid);
+
+	Long getCourseByTenantTwo(String courseName, String code, Long tenantId);
+
+	Long getLiveTime();
+
 }

+ 5 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseBusinessServiceImpl.java

@@ -252,4 +252,9 @@ public class CourseBusinessServiceImpl extends ServiceImpl<CourseBusinessMapper,
         return baseMapper.queryFullId(bo);
     }
 
+    @Override
+    public List<CourseBusinessVo> queryAllList(CourseBusinessQueryBo bo) {
+        return baseMapper.queryAllList(bo);
+    }
+
 }

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

@@ -12,17 +12,20 @@ import com.github.pagehelper.Page;
 import com.zhongzheng.common.utils.DateUtils;
 import com.zhongzheng.common.utils.ServletUtils;
 import com.zhongzheng.modules.base.vo.BaseFilterVo;
-import com.zhongzheng.modules.course.bo.CourseEducationTierAddBo;
-import com.zhongzheng.modules.course.bo.CourseEducationTypeAddBo;
-import com.zhongzheng.modules.course.bo.CourseEducationTypeEditBo;
-import com.zhongzheng.modules.course.bo.CourseEducationTypeQueryBo;
+import com.zhongzheng.modules.course.bo.*;
 import com.zhongzheng.modules.course.domain.CourseEducationTier;
 import com.zhongzheng.modules.course.domain.CourseEducationType;
 import com.zhongzheng.modules.course.mapper.CourseEducationTypeMapper;
+import com.zhongzheng.modules.course.service.ICourseBusinessService;
 import com.zhongzheng.modules.course.service.ICourseEducationTierService;
 import com.zhongzheng.modules.course.service.ICourseEducationTypeService;
+import com.zhongzheng.modules.course.vo.CourseBusinessVo;
 import com.zhongzheng.modules.course.vo.CourseEducationTierVo;
 import com.zhongzheng.modules.course.vo.CourseEducationTypeVo;
+import com.zhongzheng.modules.top.goods.bo.TopCourseBusinessQueryBo;
+import com.zhongzheng.modules.top.goods.domain.TopCourseEducationType;
+import com.zhongzheng.modules.top.goods.vo.TopCourseBusinessVo;
+import com.zhongzheng.modules.top.goods.vo.TopCourseEducationTypeVo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.util.StringUtils;
@@ -44,6 +47,9 @@ public class CourseEducationTypeServiceImpl extends ServiceImpl<CourseEducationT
     @Autowired
     private ICourseEducationTierService courseEducationTierService;
 
+    @Autowired
+    private ICourseBusinessService iCourseBusinessService;
+
     @Override
     public CourseEducationTypeVo queryById(Long id){
         CourseEducationType db = this.baseMapper.selectById(id);
@@ -77,6 +83,27 @@ public class CourseEducationTypeServiceImpl extends ServiceImpl<CourseEducationT
         return entity2Vo(this.list(lqw));
     }
 
+    @Override
+    public List<CourseEducationTypeVo> queryAllList(CourseEducationTypeQueryBo bo) {
+        LambdaQueryWrapper<CourseEducationType> lqw = Wrappers.lambdaQuery();
+        lqw.like(StrUtil.isNotBlank(bo.getEducationName()), CourseEducationType::getEducationName, bo.getEducationName());
+        lqw.eq(StrUtil.isNotBlank(bo.getEncoder()), CourseEducationType::getEncoder, bo.getEncoder());
+        lqw.eq(bo.getStatus() != null, CourseEducationType::getStatus, bo.getStatus());
+        lqw.in(CourseEducationType::getStatus, 1);
+        lqw.eq(bo.getSort() != null, CourseEducationType::getSort, bo.getSort());
+        List<CourseEducationTypeVo> courseEducationTypeVos = entity2Vo(this.list(lqw));
+        if (CollectionUtils.isEmpty(courseEducationTypeVos)){
+            return new ArrayList<>();
+        }
+        courseEducationTypeVos.forEach(item -> {
+            CourseBusinessQueryBo queryBo = new CourseBusinessQueryBo();
+            queryBo.setEducationId(item.getId());
+            List<CourseBusinessVo> businessVoList = iCourseBusinessService.queryAllList(queryBo);
+            item.setBusinessList(businessVoList);
+        });
+        return courseEducationTypeVos;
+    }
+
     /**
     * 实体类转化成视图对象
     *

+ 5 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseMenuExamServiceImpl.java

@@ -114,4 +114,9 @@ public class CourseMenuExamServiceImpl extends ServiceImpl<CourseMenuExamMapper,
     public void deleteByIdTenant(Long newCourseId, Long newTenantId) {
         baseMapper.deleteByIdTenant(newCourseId, newTenantId);
     }
+
+    @Override
+    public void deleteModuleByIdTenant(Long newCourseId, Long newModuleId, Long newTenantId) {
+        baseMapper.deleteModuleByIdTenant(newCourseId,newModuleId, newTenantId);
+    }
 }

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

@@ -332,4 +332,9 @@ public class CourseMenuServiceImpl extends ServiceImpl<CourseMenuMapper, CourseM
     public void deleteByIdTenant(Long newCourseId, Long newTenantId) {
         baseMapper.deleteByIdTenant(newCourseId, newTenantId);
     }
+
+    @Override
+    public List<CourseMenu> selectByNotTenant(Long newCourseId, Integer type, Long newModuleId,Long newTenantId) {
+        return baseMapper.selectByNotTenant(newCourseId, type, newModuleId,newTenantId);
+    }
 }

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

@@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.github.pagehelper.Page;
+import com.zhongzheng.common.utils.ServletUtils;
 import com.zhongzheng.modules.course.bo.CourseMenuQueryBo;
 import com.zhongzheng.modules.course.bo.CourseModuleChapterAddBo;
 import com.zhongzheng.modules.course.bo.CourseModuleChapterEditBo;
@@ -45,7 +46,8 @@ public class CourseModuleChapterServiceImpl extends ServiceImpl<CourseModuleChap
 
     @Override
     public List<CourseModuleChapterVo> getListById(Long id) {
-        return courseModuleChapterMapper.getListById(id);
+        String tenantId = ServletUtils.getRequest().getHeader("TenantId");
+        return courseModuleChapterMapper.getListById(id, Long.valueOf(tenantId));
     }
 
 

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

@@ -659,6 +659,16 @@ public class CourseSectionServiceImpl extends ServiceImpl<CourseSectionMapper, C
         return baseMapper.getSectionByTenant(code, newTenantId);
     }
 
+    @Override
+    public CourseSection getSectionByNotTenant(Long sid) {
+        return baseMapper.getSectionByNotTenant(sid);
+    }
+
+    @Override
+    public CourseSection getSectionByTenantTwo(String name, String code, Long tenantId) {
+        return baseMapper.getSectionByTenantTwo(name, code, tenantId);
+    }
+
     @Transactional(rollbackFor = Exception.class)
     public String insertByAddBoImport(CourseSectionAddBo bo, String errorLog, Integer no) {
         CourseSection add = BeanUtil.toBean(bo, CourseSection.class);

+ 22 - 32
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseSectionWatchPerServiceImpl.java

@@ -2,13 +2,11 @@ package com.zhongzheng.modules.course.service.impl;
 
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.codec.Base64;
-
 import 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.utils.DateUtils;
-import com.zhongzheng.common.utils.ServletUtils;
 import com.zhongzheng.modules.course.bo.CheckSectionWatchVo;
 import com.zhongzheng.modules.course.bo.SectionWatchPerAddBo;
 import com.zhongzheng.modules.course.bo.SectionWatchPerBo;
@@ -51,40 +49,23 @@ public class CourseSectionWatchPerServiceImpl extends ServiceImpl<CourseSectionW
     @Value("${liveGotoURL}")
     private String liveGotoURL;
 
+    @Value("${liveHost}")
+    private String liveHost;
+
     @Override
     public CourseSectionWatchPerVo getSectionWatchPer(SectionWatchPerBo bo) {
         CourseSectionWatchPerVo vo = new CourseSectionWatchPerVo();
-        String tenantId = ServletUtils.getRequest().getHeader("TenantId");
-        //获取课程节信息
-        CourseSection section = courseSectionService.getById(bo.getSectionId());
-//        String url = "";
-        String live = "living-room/";
-        vo.setEnCode(wxLoginService.getLiveEnCode(bo));
-        String format = String.format("cid=%s&gid=%s&sid=%s", bo.getCourseId(), bo.getGoodsId(), bo.getSectionId());
-
-        String s = Base64.encode(format);
+//        String tenantId = ServletUtils.getRequest().getHeader("TenantId");
+//        //获取课程节信息
+//        CourseSection section = courseSectionService.getById(bo.getSectionId());
+//        String live = "living-room/";
+//        vo.setEnCode(wxLoginService.getLiveEnCode(bo));
+//        String format = String.format("cid=%s&gid=%s&sid=%s", bo.getCourseId(), bo.getGoodsId(), bo.getSectionId());
+//        String s = Base64.encode(format);
+//        String domainPc =  iSysTenantService.getById(tenantId).getHostPc();
+//        String url = String.format("%s%s/%s%s?a=1&%s",liveGotoURL, domainPc,live,section.getLiveUrl(), s);
+//        vo.setEnCodePC(url);
 
-//        String s = DigestUtils.md5Hex(format);
-//        String url = String.format("%s%s%s?a=1&cid=%s&gid=%s&sid=%s", liveGotoURL,live,section.getLiveUrl(), bo.getCourseId(), bo.getGoodsId(), bo.getSectionId());
-        // https://web.xyyxt.net/
-        String domainPc =  iSysTenantService.getById(tenantId).getHostPc();
-        String url = String.format("%s%s/%s%s?a=1&%s",liveGotoURL, domainPc,live,section.getLiveUrl(), s);
-//        //生成微信小程序码
-//        switch (bo.getSectionType()){
-//            case 2://直播 living-room/
-//                String live = "living-room/";
-//                vo.setEnCode(wxLoginService.getLiveEnCode(bo));
-//                url = String.format("%s%s%s?a=1&cid=%s&gid=%s&sid=%s", liveGotoURL,live,section.getLiveUrl(), bo.getCourseId(), bo.getGoodsId(), bo.getSectionId());
-//                break;
-//            case 3://回放 my-live-detail/
-//                String detail = "my-live-detail/";
-//                vo.setEnCode(wxLoginService.getBackEnCode(bo));
-//                url = String.format("%s%s%s?a=1&cid=%s&gid=%s&sid=%s", liveGotoURL,detail,bo.getGoodsId(), bo.getCourseId(), bo.getGoodsId(), bo.getSectionId());
-//                break;
-//            default:
-//                throw new CustomException("课程节类型不正确,请检查");
-//        }
-        vo.setEnCodePC(url);
         CourseSectionWatchPer watchPer = getOne(new LambdaQueryWrapper<CourseSectionWatchPer>()
                 .eq(ObjectUtils.isNotNull(bo.getCourseId()), CourseSectionWatchPer::getCourseId, bo.getCourseId())
                 .eq(ObjectUtils.isNotNull(bo.getChapterId()), CourseSectionWatchPer::getChapterId, bo.getChapterId())
@@ -93,6 +74,15 @@ public class CourseSectionWatchPerServiceImpl extends ServiceImpl<CourseSectionW
                 .eq(ObjectUtils.isNotNull(bo.getGoodsId()), CourseSectionWatchPer::getGoodsId, bo.getGoodsId())
                 .eq(CourseSectionWatchPer::getStatus, 1)
                 .last("LIMIT 1"));
+
+        String format = String.format("cid=%s&gid=%s&sid=%s", bo.getCourseId(), bo.getGoodsId(), bo.getSectionId());
+        if (ObjectUtils.isNotNull(watchPer)){
+            format = format + "&watchPer="+watchPer.getWatchPer();
+        }
+        String s = Base64.encode(format);
+        String url = String.format("%s?param=%s",liveHost,s);
+        vo.setEnCodePC(url);
+        vo.setEnCode(url);
         if (ObjectUtils.isNull(watchPer)){
             return vo;
         }

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

@@ -3,9 +3,11 @@ package com.zhongzheng.modules.course.service.impl;
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.lang.Validator;
 import cn.hutool.core.util.StrUtil;
+import com.alibaba.fastjson.JSONArray;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.github.pagehelper.Page;
@@ -22,10 +24,8 @@ import com.zhongzheng.modules.course.service.ICoursePhotoLogService;
 import com.zhongzheng.modules.course.service.ICourseService;
 import com.zhongzheng.modules.course.vo.CourseUserVo;
 import com.zhongzheng.modules.course.vo.CourseVo;
-import com.zhongzheng.modules.exam.domain.ExamApply;
-import com.zhongzheng.modules.exam.domain.ExamApplyUser;
-import com.zhongzheng.modules.exam.domain.ExamBefore;
-import com.zhongzheng.modules.exam.domain.ExamBeforeApply;
+import com.zhongzheng.modules.exam.bo.ExamApplySiteTimeTwoAddBo;
+import com.zhongzheng.modules.exam.domain.*;
 import com.zhongzheng.modules.exam.service.*;
 import com.zhongzheng.modules.exam.vo.ExamApplyGoodsVo;
 import com.zhongzheng.modules.goods.bo.GoodsBatchDelBo;
@@ -63,6 +63,7 @@ import java.math.BigDecimal;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
+import java.util.Calendar;
 import java.util.Collection;
 import java.util.List;
 import java.util.stream.Collectors;
@@ -112,6 +113,9 @@ public class CourseServiceImpl extends ServiceImpl<CourseMapper, Course> impleme
     @Autowired
     private IExamApplyUserService iExamApplyUserService;
 
+    @Autowired
+    private IExamApplySiteTimeService iExamApplySiteTimeService;
+
     @Autowired
     private IExamBeforeApplyService iExamBeforeApplyService;
 
@@ -496,6 +500,19 @@ public class CourseServiceImpl extends ServiceImpl<CourseMapper, Course> impleme
                 List<ExamApplyGoodsVo> examApplyGoodsVos2 = new ArrayList<>();
                 examApplyGoodsVoList.forEach(examApplyGoodsVo -> {
                     ExamApply examApply = iExamApplyService.getById(examApplyGoodsVo.getApplyId());
+                    List<ExamApplySiteTime> siteTimes = iExamApplySiteTimeService.list(new LambdaQueryWrapper<ExamApplySiteTime>()
+                            .eq(ExamApplySiteTime::getApplyId, examApplyGoodsVo.getApplyId()));
+                    if (CollectionUtils.isNotEmpty(siteTimes)){
+                        ExamApplySiteTime timeTime = siteTimes.get(0);
+                        List<ExamApplySiteTimeTwoAddBo> siteTimeTwoAddBos = JSONArray.parseArray(timeTime.getSiteTime(), ExamApplySiteTimeTwoAddBo.class);
+                        ExamApplySiteTimeTwoAddBo twoAddBo = siteTimeTwoAddBos.get(0);
+                        if (ObjectUtils.isNotNull(twoAddBo)){
+                           Long time = timeTime.getExamTime()+28800L;
+                           String format = String.format("%s-%s", twoAddBo.getStartTime(), twoAddBo.getEndTime());
+                            examApplyGoodsVo.setApplyTime(time);
+                            examApplyGoodsVo.setApplyMoment(format);
+                        }
+                    }
                     switch (examApply.getApplyNature()){
                         case 1: //普通场
                             LambdaQueryWrapper<ExamApplyUser> lqw = Wrappers.lambdaQuery();
@@ -622,6 +639,41 @@ public class CourseServiceImpl extends ServiceImpl<CourseMapper, Course> impleme
         return true;
     }
 
+    @Override
+    public Course getCourseByNotTenant(Long cid) {
+        return baseMapper.getCourseByNotTenant(cid);
+    }
+
+    @Override
+    public Long getCourseByTenantTwo(String courseName, String code, Long tenantId) {
+        return baseMapper.getCourseByTenantTwo(courseName, code, tenantId);
+    }
+
+    @Override
+    public Long getLiveTime() {
+        Long nowTime = DateUtils.getNowTime();
+        Long aLong = liveTime(nowTime, 7);
+        return aLong;
+    }
+
+    private Long liveTime(Long nowTime, Integer day) {
+        Long dayAfter = DateUtils.getDayAfter(nowTime, day);
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(DateUtils.timeToDate(dayAfter));
+        int index = calendar.get(Calendar.DAY_OF_WEEK) - 1;
+        String[] weeks = new String[]{"星期天", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"};
+        if (weeks[index].equals("星期六") || weeks[index].equals("星期天")) {
+            //周末
+            liveTime(nowTime,day + 1);
+        }
+
+        //判断当前是否为工作日
+        if (!DateUtils.isWorkingDay(dayAfter)) {
+            liveTime(nowTime,day + 1);
+        }
+        return dayAfter;
+    }
+
     private List<UserStudyRecordPhotoVo> entity2PhotoVo(Collection<UserStudyRecordPhoto> collection) {
         List<UserStudyRecordPhotoVo> voList = collection.stream()
                 .map(any -> BeanUtil.toBean(any, UserStudyRecordPhotoVo.class))

+ 5 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/vo/CourseEducationTypeVo.java

@@ -2,11 +2,12 @@ package com.zhongzheng.modules.course.vo;
 
 import com.zhongzheng.common.annotation.Excel;
 import com.fasterxml.jackson.annotation.JsonFormat;
+import com.zhongzheng.modules.top.goods.vo.TopCourseBusinessVo;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import java.util.Date;
-
+import java.util.List;
 
 
 /**
@@ -48,4 +49,7 @@ public class CourseEducationTypeVo {
 	@Excel(name = "排序")
 	@ApiModelProperty("排序")
 	private Integer sort;
+
+	@ApiModelProperty("业务层级列表")
+	private List<CourseBusinessVo> businessList;
 }

+ 23 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/bo/ExamApplyDetailBo.java

@@ -0,0 +1,23 @@
+package com.zhongzheng.modules.exam.bo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @author yangdamao
+ * @date 2023年06月26日 15:13
+ */
+@Data
+public class ExamApplyDetailBo implements Serializable {
+
+    @ApiModelProperty("考试开始日期")
+    private Long examStartTime;
+    @ApiModelProperty("考试结束日期")
+    private Long examEndTime;
+    @ApiModelProperty("考点开始时间")
+    private String startTime;
+    @ApiModelProperty("考点结束时间")
+    private String endTime;
+}

+ 45 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/bo/ExamApplyResultBo.java

@@ -0,0 +1,45 @@
+package com.zhongzheng.modules.exam.bo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import java.io.Serializable;
+
+/**
+ * @author yangdamao
+ * @date 2023年06月20日 11:22
+ */
+@Data
+public class ExamApplyResultBo implements Serializable {
+
+    @ApiModelProperty("考生姓名")
+    private String userName;
+
+    @ApiModelProperty("考生身份证号")
+    private String idCard;
+
+    @ApiModelProperty("联系方式")
+    private String telphone;
+
+    @ApiModelProperty("岗位名称")
+    private String majorName;
+
+    @ApiModelProperty("考试状态:0 待登记 1正常 2缺考 3作弊 4替考")
+    private Integer applyStatus;
+
+    @ApiModelProperty("成绩")
+    private Long score;
+
+    @ApiModelProperty("证书编码")
+    private String certificateCode;
+
+    @ApiModelProperty("当前时间戳")
+    @NotBlank(message = "当前时间戳不能为空")
+    private Long stamp;
+
+    @ApiModelProperty("签名")
+    @NotBlank(message = "签名不能为空")
+    private String sign;
+
+}

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

@@ -44,4 +44,6 @@ private static final long serialVersionUID=1L;
     private Integer fromPlat;
     /** 智慧考场ID */
     private Long centerId;
+    /** 是否默认标签:1是 0否 */
+    private Integer sign;
 }

+ 11 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/mapper/ExamApplyMapper.java

@@ -1,11 +1,14 @@
 package com.zhongzheng.modules.exam.mapper;
 
+import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.zhongzheng.modules.exam.bo.ExamApplyDetailBo;
 import com.zhongzheng.modules.exam.bo.ExamApplyQueryBo;
 import com.zhongzheng.modules.exam.bo.ExamApplyRoomQueryBo;
 import com.zhongzheng.modules.exam.bo.ExamNumberGoodsQueryBo;
 import com.zhongzheng.modules.exam.domain.ExamApply;
 import com.zhongzheng.modules.exam.vo.*;
+import com.zhongzheng.modules.user.domain.UserSubscribe;
 import com.zhongzheng.modules.user.vo.UserStudyRecordExport;
 import org.apache.ibatis.annotations.Param;
 
@@ -76,4 +79,12 @@ public interface ExamApplyMapper extends BaseMapper<ExamApply> {
     List<ExamApplyPlaceVo> getPlaceList(ExamApplyRoomQueryBo bo);
 
     List<UserStudyRecordExport> getUserStudyRecord(@Param("orderGoodsId") Long orderGoodsId,@Param("userId") Long userId);
+
+    UserSubscribe getExamApplyByUser(@Param("userId") Long userId,@Param("majorName") String majorName);
+
+    @InterceptorIgnore(tenantLine = "true")
+    List<ExamApplyDetailVo> getExamInfo(ExamApplyDetailBo bo);
+
+    @InterceptorIgnore(tenantLine = "true")
+    List<ExamApplyUserDetailVo> getExamUserInfo(ExamApplyDetailVo bo);
 }

+ 4 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/service/IExamApplyService.java

@@ -84,4 +84,8 @@ public interface IExamApplyService extends IService<ExamApply> {
     String getSendmailUrl(List<Long> ids);
 
     Boolean sendmail(ExamApplySendmailBo bo);
+
+	void examApplyResult(ExamApplyResultBo bo);
+
+    List<ExamApplyDetailVo> examApplyDetail(ExamApplyDetailBo bo);
 }

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

@@ -30,15 +30,9 @@ import com.zhongzheng.modules.bank.domain.QuestionBusiness;
 import com.zhongzheng.modules.bank.service.IExamService;
 import com.zhongzheng.modules.bank.service.IQuestionBusinessService;
 import com.zhongzheng.modules.exam.bo.*;
-import com.zhongzheng.modules.exam.domain.ExamApply;
-import com.zhongzheng.modules.exam.domain.ExamApplySite;
-import com.zhongzheng.modules.exam.domain.ExamApplySiteTime;
-import com.zhongzheng.modules.exam.domain.ExamApplyUser;
+import com.zhongzheng.modules.exam.domain.*;
 import com.zhongzheng.modules.exam.mapper.ExamApplyMapper;
-import com.zhongzheng.modules.exam.service.IExamApplyService;
-import com.zhongzheng.modules.exam.service.IExamApplySiteService;
-import com.zhongzheng.modules.exam.service.IExamApplySiteTimeService;
-import com.zhongzheng.modules.exam.service.IExamApplyUserService;
+import com.zhongzheng.modules.exam.service.*;
 import com.zhongzheng.modules.exam.vo.*;
 import com.zhongzheng.modules.goods.service.IGoodsService;
 import com.zhongzheng.modules.goods.vo.GoodsVo;
@@ -85,6 +79,8 @@ public class ExamApplyServiceImpl extends ServiceImpl<ExamApplyMapper, ExamApply
     @Autowired
     private IExamService iExamService;
     @Autowired
+    private IExamSiteService iExamSiteService;
+    @Autowired
     private IActivityRecommendService iActivityRecommendService;
     @Autowired
     private IActivityRecommendGoodsService iActivityRecommendGoodsService;
@@ -830,6 +826,68 @@ public class ExamApplyServiceImpl extends ServiceImpl<ExamApplyMapper, ExamApply
         return true;
     }
 
+    @Override
+    public void examApplyResult(ExamApplyResultBo bo) {
+        //获取用户
+        User user = iUserService.getOne(new LambdaQueryWrapper<User>().eq(User::getIdCard, EncryptHandler.encrypt(bo.getIdCard())).last("limit 1"));
+        if (ObjectUtils.isNull(user)){
+            throw new CustomException("用户信息获取有误!");
+        }
+        //获取考试
+        UserSubscribe subscribe = baseMapper.getExamApplyByUser(user.getUserId(),bo.getMajorName());
+        if (ObjectUtils.isNull(subscribe)){
+            throw new CustomException("用户考试信息获取有误!");
+        }
+
+        //考试状态
+        if (ObjectUtils.isNotNull(bo.getApplyStatus())){
+            subscribe.setSubscribeStatus(bo.getApplyStatus());
+        }
+
+        //成绩
+        if (ObjectUtils.isNotNull(bo.getScore())){
+            subscribe.setPerformance(bo.getScore());
+        }
+
+        //证书
+        if (StringUtils.isNotBlank(bo.getCertificateCode())){
+            subscribe.setCertificateCode(bo.getCertificateCode());
+        }
+        subscribe.setUpdateTime(DateUtils.getNowTime());
+        iUserSubscribeService.updateById(subscribe);
+    }
+
+    @Override
+    public List<ExamApplyDetailVo> examApplyDetail(ExamApplyDetailBo bo) {
+        List<ExamApplyDetailVo> vo = baseMapper.getExamInfo(bo);
+        if (CollectionUtils.isEmpty(vo)){
+            return new ArrayList<>();
+        }
+        //获取考试学员
+        vo.forEach(item -> {
+            //考场名称和考试名称
+            ExamSite site = iExamSiteService.getById(item.getSiteId());
+            if (ObjectUtils.isNotNull(site)){
+                item.setSiteName(site.getSiteAddress());
+            }
+            ExamApply examApply = getById(item.getApplyId());
+            if (ObjectUtils.isNotNull(examApply)){
+                item.setApplyName(examApply.getApplyName());
+            }
+            List<ExamApplyUserDetailVo> examUserInfo = baseMapper.getExamUserInfo(item);
+            if (CollectionUtils.isNotEmpty(examUserInfo)){
+                examUserInfo.forEach(user -> {
+                    //身份证隐藏
+                    String decrypt = EncryptHandler.decrypt(user.getIdCard());
+                    String content = decrypt.replaceAll("(\\d{4})\\d{10}(\\w{4})", "$1****$2");
+                    user.setIdCard(content);
+                });
+                item.setUserDetailVos(examUserInfo);
+            }
+        });
+        return vo;
+    }
+
     private void userStudyRecord(String userPath, List<UserSubscribe> list) {
         Map<Long, List<UserSubscribe>> map = list.stream().collect(Collectors.groupingBy(UserSubscribe::getUserId));
         map.forEach((k, v) -> {

+ 30 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/vo/ExamApplyDetailVo.java

@@ -0,0 +1,30 @@
+package com.zhongzheng.modules.exam.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * @author yangdamao
+ * @date 2023年06月26日 15:13
+ */
+@Data
+public class ExamApplyDetailVo implements Serializable {
+    private Long applyId;
+    private Long siteId;
+    @ApiModelProperty("考试日期")
+    private Long examTime;
+    @ApiModelProperty("考场名称")
+    private String siteName;
+    @ApiModelProperty("考试名称")
+    private String applyName;
+    @ApiModelProperty("开始时间")
+    private String startTime;
+    @ApiModelProperty("结束时间")
+    private String endTime;
+    @ApiModelProperty("学员信息")
+    private List<ExamApplyUserDetailVo> userDetailVos;
+
+}

+ 4 - 2
zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/vo/ExamApplyGoodsVo.java

@@ -1,11 +1,9 @@
 package com.zhongzheng.modules.exam.vo;
 
 import cn.afterturn.easypoi.excel.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;
 
 
 
@@ -41,4 +39,8 @@ public class ExamApplyGoodsVo {
 	/** 考试开始时间段 */
 	@Excel(name = "商品标题",width = 30)
 	private String goodsName;
+	@ApiModelProperty("考试时间段")
+	private String applyMoment;
+	@ApiModelProperty("考试时间")
+	private Long applyTime;
 }

+ 20 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/vo/ExamApplyUserDetailVo.java

@@ -0,0 +1,20 @@
+package com.zhongzheng.modules.exam.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @author yangdamao
+ * @date 2023年06月26日 15:13
+ */
+@Data
+public class ExamApplyUserDetailVo implements Serializable {
+    @ApiModelProperty("学员姓名")
+    private String userName;
+    @ApiModelProperty("座位号")
+    private Integer seatNum;
+    @ApiModelProperty("身份证")
+    private String idCard;
+}

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/bo/GoodsAddBo.java

@@ -194,4 +194,7 @@ public class GoodsAddBo {
     /** 提交官方审核备注说明 */
     @ApiModelProperty("提交官方审核备注说明")
     private String commitPeriodRemark;
+    /** 班级类型 1基础班 2强化班 3私塾班 */
+    @ApiModelProperty("班级类型 1基础班 2强化班 3私塾班")
+    private Integer gradeType;
 }

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/bo/GoodsEditBo.java

@@ -228,4 +228,7 @@ public class GoodsEditBo {
     /** 提交官方审核备注说明 */
     @ApiModelProperty("提交官方审核备注说明")
     private String commitPeriodRemark;
+    /** 班级类型 1基础班 2强化班 3私塾班 */
+    @ApiModelProperty("班级类型 1基础班 2强化班 3私塾班")
+    private Integer gradeType;
 }

+ 33 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/bo/GoodsNodeCopyTenantBo.java

@@ -0,0 +1,33 @@
+package com.zhongzheng.modules.goods.bo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * @author yangdamao
+ * @date 2022年12月28日 9:28
+ */
+@Data
+public class GoodsNodeCopyTenantBo implements Serializable {
+
+    @ApiModelProperty("机构ID")
+    private List<Long> tenantId;
+
+    @ApiModelProperty("商品ID")
+    private Long goodsId;
+    @ApiModelProperty("课程ID")
+    private Long courseId;
+    @ApiModelProperty("模块ID")
+    private Long modelId;
+    @ApiModelProperty("章ID")
+    private Long chapterId;
+    @ApiModelProperty("节ID")
+    private Long sectionId;
+
+    @ApiModelProperty("类型:1课程 2模块 3章 4节")
+    private Integer type;
+
+}

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

@@ -210,5 +210,8 @@ public class GoodsQueryBo extends BaseEntity {
 	/** 提交官方审核备注说明 */
 	@ApiModelProperty("提交官方审核备注说明")
 	private String commitPeriodRemark;
+	/** 班级类型 1基础班 2强化班 3私塾班 */
+	@ApiModelProperty("班级类型 1基础班 2强化班 3私塾班")
+	private Integer gradeType;
 
 }

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

@@ -1,6 +1,7 @@
 package com.zhongzheng.modules.goods.domain;
 
 import com.baomidou.mybatisplus.annotation.*;
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.NoArgsConstructor;
 import lombok.experimental.Accessors;
@@ -156,4 +157,6 @@ private static final long serialVersionUID=1L;
     private Integer commitPeriodStatus;
     /** 提交官方审核备注说明 */
     private String commitPeriodRemark;
+    /** 班级类型 1基础班 2强化班 3私塾班 */
+    private Integer gradeType;
 }

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/mapper/GoodsMapper.java

@@ -72,4 +72,7 @@ public interface GoodsMapper extends BaseMapper<Goods> {
 
     @InterceptorIgnore(tenantLine = "true")
     Goods getGoodsByIdNotTenant(Long goodsId);
+
+    @InterceptorIgnore(tenantLine = "true")
+    Goods getGoodsByTenantTwo(@Param("goodsName") String goodsName,@Param("code") String code,@Param("tenantId") Long tenantId);
 }

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

@@ -130,4 +130,8 @@ public interface IGoodsService extends IService<Goods> {
     List<GoodsVo> getAlikeGoods(AlikeGoodsBo bo);
 
 	Goods getGoodsByIdNotTenant(Long goodsId);
+
+    Goods getGoodsByTenantTwo(String goodsName, String code, Long tenantId);
+
+    boolean goodsNodeCopyAddTenant(GoodsNodeCopyTenantBo bo);
 }

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

@@ -8,7 +8,6 @@ import cn.hutool.core.util.StrUtil;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
-
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
@@ -65,7 +64,6 @@ import com.zhongzheng.modules.polyv.service.IPolyvVideoService;
 import com.zhongzheng.modules.system.bo.GoodsCopyEnum;
 import com.zhongzheng.modules.system.domain.SysConfig;
 import com.zhongzheng.modules.system.domain.SysGoodsCopyRecord;
-import com.zhongzheng.modules.system.domain.SysTenant;
 import com.zhongzheng.modules.system.service.ISysConfigService;
 import com.zhongzheng.modules.system.service.ISysGoodsCopyRecordService;
 import com.zhongzheng.modules.system.service.ISysTenantService;
@@ -83,7 +81,6 @@ import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Propagation;
 import org.springframework.transaction.annotation.Transactional;
 
 import java.io.IOException;
@@ -574,6 +571,30 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
             menuListAddBo.setMenuList(bo.getMenuList());
             iCourseMenuService.insertByGoodsAddBo(menuListAddBo);
         }
+
+        //七大员商品,默认绑定七大员学员资料模板
+        CourseEducationType educationType = iCourseEducationTypeService.getById(add.getEducationTypeId());
+        CourseBusiness business = iCourseBusinessService.getById(add.getBusinessId());
+        if (educationType.getEducationName().contains("考前培训") && business.getBusinessName().contains("七大员")){
+            //获取七大员学员资料模版
+            List<ProfileTpBusiness> tpBusinessList = iProfileTpBusinessService.list(new LambdaQueryWrapper<ProfileTpBusiness>()
+                    .eq(ProfileTpBusiness::getEducationTypeId, add.getEducationTypeId())
+                    .eq(ProfileTpBusiness::getProjectId, add.getProjectId())
+                    .eq(ProfileTpBusiness::getBusinessId, add.getBusinessId()));
+            if (CollectionUtils.isNotEmpty(tpBusinessList)){
+                List<ProfileTp> profileTpList = iProfileTpService.list(new LambdaQueryWrapper<ProfileTp>()
+                .in(ProfileTp::getProfileTpId,tpBusinessList.stream().map(ProfileTpBusiness::getProfileTpId).collect(Collectors.toList()))
+                .eq(ProfileTp::getStatus,1));
+                profileTpList.forEach(item -> {
+                    if (StringUtils.isNotBlank(item.getGoodsIds())){
+                        List<String> goodsIds = Arrays.asList(item.getGoodsIds().split(","));
+                        goodsIds.add(add.getGoodsId().toString());
+                        item.setGoodsIds(goodsIds.stream().collect(Collectors.joining(",")));
+                    }
+                });
+                iProfileTpService.updateBatchById(profileTpList);
+            }
+        }
         return result;
     }
 
@@ -1604,7 +1625,7 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
                 disposeGoodsCourse(oldGoodsId,newGoodsId,newTenantId,newCourseMenuExamList,recordList);
                 //课程双师
                 disposeGoodsCourseTeacher(oldGoodsId,newGoodsId,newTenantId);
-                //商品试卷
+                //题库商品
                 disposeGoodsAttached(oldGoodsId,newGoodsId,newTenantId,recordList);
 
                 //处理商品试卷
@@ -2440,6 +2461,106 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
         }
         return null;
     }
+
+    private void disposeModule(Long oldModuleId,Long newTenantId,Long oldCourseId,Long newCourseId,List<SysGoodsCopyRecord> array){
+        CourseModule module = iCourseModuleService.getById(oldModuleId);
+        if (ObjectUtils.isNotNull(module)){
+            Long oid = module.getModuleId();
+            Long newModuleId = getNewIdByTenant(oid,GoodsCopyEnum.COURSE_MODULE.getType(),newTenantId);
+            if (ObjectUtils.isNull(newModuleId)){
+                module.setModuleId(null);
+                module.setTenantId(newTenantId);
+                iCourseModuleService.save(module);
+                newModuleId = module.getModuleId();
+                addSysGoodsRecord(oid,newModuleId,GoodsCopyEnum.COURSE_MODULE.getType(),newTenantId,array);
+            }
+
+            //删除之前的关联
+            iCourseModuleBusinessService.deleteByIdAndTenant(newModuleId,newTenantId);
+            //新关联
+            List<CourseModuleBusiness> moduleBusinessList = iCourseModuleBusinessService
+                    .list(new LambdaQueryWrapper<CourseModuleBusiness>()
+                            .eq(CourseModuleBusiness::getModuleId, oldModuleId));
+            if (CollectionUtils.isNotEmpty(moduleBusinessList)){
+                for (CourseModuleBusiness item : moduleBusinessList) {
+                    item.setId(null);
+                    item.setTenantId(newTenantId);
+                    item.setModuleId(newModuleId);
+                    item.setEducationTypeId(getNewEducationTypeId(item.getEducationTypeId(), newTenantId,array));
+                    item.setBusinessId(getNewBusinessId(item.getBusinessId(), newTenantId,array));
+                    item.setSubjectId(getNewSubjectId(item.getSubjectId(), newTenantId,array));
+                    item.setProjectId(getNewProjectTypeId(item.getProjectId(), newTenantId,array));
+                }
+                iCourseModuleBusinessService.saveBatch(moduleBusinessList);
+            }
+
+            //模块章
+            iCourseModuleChapterService.deleteByIdAndTenant(newModuleId,newTenantId);
+            List<CourseModuleChapter> moduleChapterList = iCourseModuleChapterService
+                    .list(new LambdaQueryWrapper<CourseModuleChapter>()
+                            .eq(CourseModuleChapter::getModuleId, oldModuleId));
+            if (CollectionUtils.isNotEmpty(moduleChapterList)){
+                for (CourseModuleChapter item : moduleChapterList) {
+                    item.setId(null);
+                    item.setModuleId(newModuleId);
+                    item.setTenantId(newTenantId);
+                    item.setChapterId(getNewChapterId(item.getChapterId(),newTenantId,array));
+                }
+                iCourseModuleChapterService.saveBatch(moduleChapterList);
+            }
+
+            //课程模块关联
+            List<CourseMenu> courseMenus = iCourseMenuService.selectByNotTenant(newCourseId,1,newModuleId,newTenantId);
+            if (CollectionUtils.isEmpty(courseMenus)){
+                List<CourseMenu> list = iCourseMenuService.list(new LambdaQueryWrapper<CourseMenu>()
+                        .eq(CourseMenu::getCourseId, oldCourseId)
+                        .eq(CourseMenu::getMenuId, oid)
+                        .eq(CourseMenu::getType, 1));
+                if (CollectionUtils.isNotEmpty(list)){
+                    for (CourseMenu item : list) {
+                        item.setId(null);
+                        item.setCourseId(newCourseId);
+                        item.setMenuId(newModuleId);
+                        item.setTenantId(newTenantId);
+                    }
+                    iCourseMenuService.saveBatch(list);
+                }
+            }
+
+            //课程模块试卷
+            iCourseMenuExamService.deleteModuleByIdTenant(newCourseId,newModuleId,newTenantId);
+            List<CourseMenuExam> examList = iCourseMenuExamService
+                    .list(new LambdaQueryWrapper<CourseMenuExam>()
+                    .eq(CourseMenuExam::getCourseId, oldCourseId)
+                    .eq(CourseMenuExam::getModuleId, oldModuleId));
+            if (CollectionUtils.isNotEmpty(examList)){
+                for (CourseMenuExam menuExam : examList) {
+                    if (ObjectUtils.isNotNull(menuExam.getChapterId()) || menuExam.getChapterId() != 0){
+                        Long newChapterId = getNewIdByTenant(menuExam.getChapterId(),GoodsCopyEnum.COURSE_CHAPTER.getType(),newTenantId);
+                        if (ObjectUtils.isNull(newChapterId)){
+                            continue;
+                        }
+                        menuExam.setChapterId(newChapterId);
+                    }
+                    if (ObjectUtils.isNotNull(menuExam.getSectionId()) || menuExam.getSectionId() != 0){
+                        Long newSectionId = getNewIdByTenant(menuExam.getSectionId(),GoodsCopyEnum.COURSE_SECTION.getType(),newTenantId);
+                        if (ObjectUtils.isNull(newSectionId)){
+                            continue;
+                        }
+                        menuExam.setSectionId(newSectionId);
+                    }
+                    menuExam.setId(null);
+                    menuExam.setCourseId(newCourseId);
+                    menuExam.setModuleId(newModuleId);
+                    menuExam.setExamId(getNewExamId(menuExam.getExamId(),newTenantId,array));
+                    menuExam.setTenantId(newTenantId);
+                }
+                iCourseMenuExamService.saveBatch(examList);
+            }
+        }
+
+    }
+
     private Long getNewChapterId(Long oldChapterId,Long newTenantId,List<SysGoodsCopyRecord> array){
         CourseChapter chapter = iCourseChapterService.getById(oldChapterId);
         if (ObjectUtils.isNotNull(chapter)){
@@ -4366,6 +4487,75 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
         return baseMapper.getGoodsByIdNotTenant(goodsId);
     }
 
+    @Override
+    public Goods getGoodsByTenantTwo(String goodsName, String code, Long tenantId) {
+        return baseMapper.getGoodsByTenantTwo(goodsName,code,tenantId);
+    }
+
+    @Override
+    public boolean goodsNodeCopyAddTenant(GoodsNodeCopyTenantBo bo) {
+        Goods goods = getById(bo.getGoodsId());
+        if (ObjectUtils.isNull(goods)){
+            throw new CustomException("商品信息获取有误");
+        }
+        Long oldGoodsId = goods.getGoodsId();
+        String tenantId = ServletUtils.getRequest().getHeader("TenantId");
+        switch (bo.getType()){
+            case 1://课程复制
+                bo.getTenantId().forEach(newTenantId -> {
+                    Goods newGoods = getGoodsByTenantTwo(goods.getGoodsName(), goods.getCode(), newTenantId);
+                    if (ObjectUtils.isNull(newGoods)){
+                        throw new CustomException("该机构不存在此商品,请先复制商品!");
+                    }
+                    Long newGoodsId = newGoods.getGoodsId();
+                    //商品课程
+                    List<CourseMenuExam> newCourseMenuExamList = new ArrayList<>();
+                    List<SysGoodsCopyRecord> recordList = new ArrayList<>();
+                    if (goods.getGoodsType() == 2){
+                        //题库商品
+                        disposeGoodsAttached(oldGoodsId,newGoodsId,newTenantId,recordList);
+                    }else {
+                        disposeGoodsCourse(oldGoodsId,newGoodsId,newTenantId,newCourseMenuExamList,recordList);
+                    }
+
+                    //处理商品试卷
+                    if (CollectionUtils.isNotEmpty(newCourseMenuExamList)){
+                        for (CourseMenuExam menuExam : newCourseMenuExamList) {
+                            menuExam.setExamId(getNewExamId(menuExam.getExamId(),newTenantId,recordList));
+                        }
+                        iCourseMenuExamService.saveBatch(newCourseMenuExamList);
+                    }
+                });
+                break;
+            case 2://模块复制
+                Course course = iCourseService.getById(bo.getCourseId());
+                bo.getTenantId().forEach(newTenantId -> {
+                    List<SysGoodsCopyRecord> recordList = new ArrayList<>();
+                    Long  newCourseId = iCourseService.getCourseByTenantTwo(course.getCourseName(), course.getCode(), newTenantId);
+                    if (ObjectUtils.isNull(newCourseId)){
+                        throw new CustomException("该机构不存在此商品课程,请先复制商品课程!");
+                    }
+                    disposeModule(bo.getModelId(),newTenantId,bo.getCourseId(),newCourseId,recordList);
+                });
+                break;
+            case 3://章复制
+                Course courseTwo = iCourseService.getById(bo.getCourseId());
+                bo.getTenantId().forEach(newTenantId -> {
+                    List<SysGoodsCopyRecord> recordList = new ArrayList<>();
+                    Long newCourseId = iCourseService.getCourseByTenantTwo(courseTwo.getCourseName(), courseTwo.getCode(), newTenantId);
+                    if (ObjectUtils.isNull(newCourseId)){
+                        throw new CustomException("该机构不存在此商品课程,请先复制商品课程!");
+                    }
+//                    disposeModule(bo.getModelId(),newTenantId,bo.getCourseId(),newCourseId,recordList);
+                });
+                break;
+
+
+        }
+
+        return false;
+    }
+
     @Override
     @Transactional(rollbackFor = Exception.class)
     public boolean updateGoodsRepair(UpdateGoodsRepairBo bo) {

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

@@ -361,4 +361,7 @@ public class GoodsVo {
 	private String commitPeriodRemark;
 	@ApiModelProperty("是否是二建二造")
 	private Boolean erJianErZao;
+	/** 班级类型 1基础班 2强化班 3私塾班 */
+	@ApiModelProperty("班级类型 1基础班 2强化班 3私塾班")
+	private Integer gradeType;
 }

+ 4 - 23
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/impl/ClassGradeUserServiceImpl.java

@@ -50,7 +50,6 @@ import com.zhongzheng.modules.order.service.IOrderGoodsService;
 import com.zhongzheng.modules.order.service.IOrderService;
 import com.zhongzheng.modules.order.vo.OrderGoodsVo;
 import com.zhongzheng.modules.system.domain.SysOldOrg;
-import com.zhongzheng.modules.system.service.ISysConfigService;
 import com.zhongzheng.modules.system.service.ISysOldOrgService;
 import com.zhongzheng.modules.user.bo.SubjectStudyRecordQueryBo;
 import com.zhongzheng.modules.user.bo.UserBankRecordQueryBo;
@@ -148,9 +147,6 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
     @Autowired
     private IUserService iUserService;
 
-    @Autowired
-    private ISysConfigService configService;
-
 
     @Value("${aliyun.oss.endpoint}")
     private String ALIYUN_OSS_ENDPOINT;
@@ -415,7 +411,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
         ClassGradeUserQueryBo queryBo = new ClassGradeUserQueryBo();
         queryBo.setGradeId(bo.getGradeId());
         queryBo.setUserId(bo.getUserId());
-        ClassPeriodStudentVo classPeriodStudentVo = baseMapper.userPeriodStatus (queryBo);
+        ClassPeriodStudentVo classPeriodStudentVo = baseMapper.userPeriodStatus(queryBo);
         Long secLong = 0L;
         Long studyLong = 0L;
 
@@ -585,10 +581,6 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
         if (Validator.isEmpty(userVo.getRealName()) || Validator.isEmpty(userVo.getIdCard()) || Validator.isEmpty(userVo.getTelPhone())) {
             return "用户信息缺失";
         }
-        if(Validator.isNotEmpty(configService.selectConfigByKeyNoCache("office.account"))){
-            OFFICIALPUSH_INFOACCOUNT = configService.selectConfigByKeyNoCache("office.account");
-            OFFICIALPUSH_TOKEN = configService.selectConfigByKeyNoCache("office.token");
-        }
         Map<String, String> params = new HashMap<>();
         params.put("zh", OFFICIALPUSH_INFOACCOUNT);
         params.put("bh", userVo.getOfficialName());
@@ -597,7 +589,6 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
         params.put("dh", userVo.getTelPhone());
         params.put("bmrq", DateUtils.timestampToDate(bmrq));
         String dataTxt = params.get("zh") + params.get("bh") + params.get("xm") + params.get("sfz") + params.get("dh") + params.get("bmrq");
-        log.info("报名信息推送参数" + dataTxt);
         String encrypted = dataSign(dataTxt, OFFICIALPUSH_TOKEN);
         params.put("SignMsg", encrypted);
         String respone = "";
@@ -644,14 +635,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
     public ClassPeriodStudentVo DecryptOfficialInfo(ClassGradeDecryptQueryBo bo) {
         String pars;
         try {
-            if(Validator.isNotEmpty(bo.getTenantId())){
-                ServletUtils.getRequestAttributes().getResponse().setHeader("TenantId", bo.getTenantId());
-            }
-            if(Validator.isNotEmpty(configService.selectConfigByKeyNoCache("office.account"))){
-                OFFICIALPUSH_INFOACCOUNT = configService.selectConfigByKeyNoCache("office.account");
-                OFFICIALPUSH_TOKEN = configService.selectConfigByKeyNoCache("office.token");
-            }
-            System.out.println(OFFICIALPUSH_TOKEN);
+            ServletUtils.getRequestAttributes().getResponse().setHeader("TenantId", bo.getTenantId());
             //     data = "DjqbGTiWrtqJvLSKObhAB1F+s1vPmc1XWNagrHjwlK1JiCO1CuicJEcP+MzZoUyiSfDLeV2GZio=";
             //     data ="Z4lUlc48qtBmZcg4tbNmt767KDeYhu6h+Xz8ySE5MqYSy3tF1/m2cTLtAQRlHV9X4JtXoCwapll/IiMVNyrOwsZD9Ujjf682";
             byte[] Keys = new byte[]{0x22, 0x34, 0x76, 0x58, (byte) 0x90, (byte) 0xAB, (byte) 0xAD, (byte) 0xBF};
@@ -803,10 +787,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
         if (Validator.isNotEmpty(userProfile) && userProfile.getStatus() != 1) {
             return "资料审核没通过";
         }*/
-        if(Validator.isNotEmpty(configService.selectConfigByKeyNoCache("office.account"))){
-            OFFICIALPUSH_INFOACCOUNT = configService.selectConfigByKeyNoCache("office.account");
-            OFFICIALPUSH_TOKEN = configService.selectConfigByKeyNoCache("office.token");
-        }
+
         UserStudyRecordQueryBo studyRecordQueryBo = new UserStudyRecordQueryBo();
         studyRecordQueryBo.setUserId(bo.getUserId());
         studyRecordQueryBo.setGradeId(userVo.getGradeId());
@@ -2763,7 +2744,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
         List<StudyAccountStatusVo> list = new ArrayList<>();
         for (CourseProjectTypeVo courseProjectTypeVo : courseProjectTypeVoList) {
             CourseBusinessQueryBo bo2 = new CourseBusinessQueryBo();
-            bo2.setEducationId(bo.getEducationTypeId().intValue());
+            bo2.setEducationId(bo.getEducationTypeId());
             bo2.setProjectId(courseProjectTypeVo.getId().intValue());
             List<Integer> status2 = Arrays.asList(1);
             bo2.setStatus(status2);

+ 11 - 10
zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/service/impl/InformServiceImpl.java

@@ -2,9 +2,14 @@ package com.zhongzheng.modules.inform.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.Wrappers;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.github.pagehelper.Page;
 import com.zhongzheng.common.utils.DateUtils;
 import com.zhongzheng.common.utils.SecurityUtils;
+import com.zhongzheng.common.utils.ServletUtils;
 import com.zhongzheng.modules.bank.bo.QuestionChapterExamQueryBo;
 import com.zhongzheng.modules.bank.bo.QuestionModuleChapterQueryBo;
 import com.zhongzheng.modules.bank.mapper.QuestionChapterExamMapper;
@@ -22,30 +27,25 @@ import com.zhongzheng.modules.goods.bo.GoodsQueryBo;
 import com.zhongzheng.modules.goods.mapper.GoodsAttachedMapper;
 import com.zhongzheng.modules.goods.vo.GoodsAttachedVo;
 import com.zhongzheng.modules.inform.bo.*;
+import com.zhongzheng.modules.inform.domain.Inform;
 import com.zhongzheng.modules.inform.domain.InformCourse;
 import com.zhongzheng.modules.inform.domain.InformExam;
 import com.zhongzheng.modules.inform.domain.InformUser;
+import com.zhongzheng.modules.inform.mapper.InformMapper;
 import com.zhongzheng.modules.inform.service.IInformCourseService;
 import com.zhongzheng.modules.inform.service.IInformExamService;
+import com.zhongzheng.modules.inform.service.IInformService;
 import com.zhongzheng.modules.inform.service.IInformUserService;
 import com.zhongzheng.modules.inform.vo.CourseInformVo;
 import com.zhongzheng.modules.inform.vo.GoodsInformAttachedVo;
 import com.zhongzheng.modules.inform.vo.InformUserVo;
+import com.zhongzheng.modules.inform.vo.InformVo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import com.github.pagehelper.Page;
-import com.zhongzheng.modules.inform.domain.Inform;
-import com.zhongzheng.modules.inform.mapper.InformMapper;
-import com.zhongzheng.modules.inform.vo.InformVo;
-import com.zhongzheng.modules.inform.service.IInformService;
 import org.springframework.transaction.annotation.Transactional;
 
 import java.util.ArrayList;
 import java.util.Collection;
-import java.util.Collections;
 import java.util.List;
 import java.util.stream.Collectors;
 
@@ -303,6 +303,7 @@ public class InformServiceImpl extends ServiceImpl<InformMapper, Inform> impleme
 
     @Override
     public List<CourseInformVo> listGoodsCourse(GoodsQueryBo bo) {
+        String tenantId = ServletUtils.getRequest().getHeader("TenantId");
         List<CourseInformVo> courseInformVos = baseMapper.listGoodsCourse(bo);
         for (CourseInformVo courseInformVo : courseInformVos) {
             CourseMenuQueryBo courseMenuQueryBo = new CourseMenuQueryBo();
@@ -310,7 +311,7 @@ public class InformServiceImpl extends ServiceImpl<InformMapper, Inform> impleme
             List<CourseMenuVo> list = iCourseMenuService.selectList(courseMenuQueryBo);
             for (CourseMenuVo courseMenuVo : list) {
                 if (courseMenuVo.getType().equals(1)){
-                    List<CourseModuleChapterVo> listById = courseModuleChapterMapper.getListById(courseMenuVo.getMenuId());
+                    List<CourseModuleChapterVo> listById = courseModuleChapterMapper.getListById(courseMenuVo.getMenuId(),Long.valueOf(tenantId));
                     for (CourseModuleChapterVo courseModuleChapterVo : listById) {
                         courseModuleChapterVo.setCourseChapterSectionList(courseChapterSectionMapper.getInformById(courseModuleChapterVo.getChapterId()));
                     }

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/bo/OrderBusinessConfigAddBo.java

@@ -33,4 +33,7 @@ public class OrderBusinessConfigAddBo {
     /** 状态 1有效 0无效 */
     @ApiModelProperty("状态 1有效 0无效")
     private Integer status;
+    /** 班级类型 1基础班 2强化班 3私塾班 */
+    @ApiModelProperty("班级类型 1基础班 2强化班 3私塾班")
+    private Integer gradeType;
 }

+ 4 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/bo/OrderBusinessConfigEditBo.java

@@ -36,5 +36,9 @@ public class OrderBusinessConfigEditBo {
     /** 状态 1有效 0无效 */
     @ApiModelProperty("状态 1有效 0无效")
     private Integer status;
+    /** 班级类型 1基础班 2强化班 3私塾班 */
+    @ApiModelProperty("班级类型 1基础班 2强化班 3私塾班")
+    private Integer gradeType;
+
 
 }

+ 6 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/bo/OrderBusinessConfigQueryBo.java

@@ -50,4 +50,10 @@ public class OrderBusinessConfigQueryBo extends BaseEntity {
 	/** 状态 1有效 0无效 */
 	@ApiModelProperty("状态 1有效 0无效")
 	private List<Integer> status;
+	/** 班级类型 1基础班 2强化班 3私塾班 */
+	@ApiModelProperty("班级类型 1基础班 2强化班 3私塾班")
+	private Integer gradeType;
+	/** 科目ID */
+	@ApiModelProperty("科目ID")
+	private Long subjectId;
 }

+ 1 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/domain/Order.java

@@ -141,7 +141,7 @@ private static final long serialVersionUID=1L;
     /** 审核状态:0待审核,1已通过,2未通过,3已撤销 */
     private Integer checkStatus;
     /** 退款状态:0待审核,1正常,2未退款,3已完成,4未通过 */
-    private Integer refundStatus;
+    private Integer orderRefundStatus;
     /** 账款状态:0未结清,1已结清 */
     private Integer creditStatus;
     /** 发票状态:0未开票,1已开票 */

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/domain/OrderBusinessConfig.java

@@ -38,4 +38,6 @@ private static final long serialVersionUID=1L;
     private Long updateTime;
     /** 状态 1有效 0无效 */
     private Integer status;
+    /** 班级类型 1基础班 2强化班 3私塾班 */
+    private Integer gradeType;
 }

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/domain/OrderGoods.java

@@ -37,6 +37,8 @@ private static final long serialVersionUID=1L;
     private String orderSn;
     /** 商品id */
     private Long goodsId;
+    /** 商品年份 */
+    private String goodsYear;
     /** 商品采集数据 */
     private String goodsInputData;
     /** 商品标准价格 */

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

@@ -18,7 +18,6 @@ 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.common.utils.ServletUtils;
 import com.zhongzheng.common.utils.ToolsUtils;
 import com.zhongzheng.common.utils.http.HttpUtils;
 import com.zhongzheng.modules.activity.domain.ActivityOrder;
@@ -35,7 +34,6 @@ import com.zhongzheng.modules.distribution.service.IDistributionRebateService;
 import com.zhongzheng.modules.distribution.service.IDistributionSellerService;
 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.grade.domain.ClassGradeUser;
 import com.zhongzheng.modules.grade.service.IClassGradeService;
 import com.zhongzheng.modules.grade.service.IClassGradeUserService;
@@ -58,10 +56,8 @@ import com.zhongzheng.modules.order.vo.OrderGoodsVo;
 import com.zhongzheng.modules.order.vo.OrderShareGoodsVo;
 import com.zhongzheng.modules.order.vo.OrderShareToOldVo;
 import com.zhongzheng.modules.system.service.ISysUserService;
-import com.zhongzheng.modules.top.financial.bo.OrderRefundPayBo;
 import com.zhongzheng.modules.top.goods.domain.TopOldOrderCheck;
 import com.zhongzheng.modules.top.goods.domain.TopOldOrderCheckLog;
-import com.zhongzheng.modules.top.goods.domain.TopOldOrderRefund;
 import com.zhongzheng.modules.top.goods.service.ITopOldOrderCheckLogService;
 import com.zhongzheng.modules.top.goods.service.ITopOldOrderCheckService;
 import com.zhongzheng.modules.top.goods.service.ITopOldOrderRefundService;
@@ -283,7 +279,7 @@ public class OrderGoodsRefundServiceImpl extends ServiceImpl<OrderGoodsRefundMap
         this.save(add);
         //订单状态修改
         iOrderService.update(new LambdaUpdateWrapper<Order>()
-                        .set(Order::getRefundStatus,0)//待审核
+                        .set(Order::getOrderRefundStatus,0)//待审核
                         .set(Order::getOrderRefund,orderGoods.getGoodsReceived())
                         .eq(Order::getOrderSn,orderGoods.getOrderSn()));
         //修改订单状态
@@ -473,7 +469,7 @@ public class OrderGoodsRefundServiceImpl extends ServiceImpl<OrderGoodsRefundMap
             order.setUpdateTime(DateUtils.getNowTime());
             order.setOrderStatus(Order.REFUND_PART);
         }
-        order.setRefundStatus(3);//退款已完成
+        order.setOrderRefundStatus(3);//退款已完成
 
         //已退金额
         BigDecimal add = BigDecimal.ZERO;

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

@@ -494,7 +494,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
             orderGoods.setCompany(bo.getOrderStudent().getCompany());
             //成交价
             orderGoods.setGoodsRealPrice(goods.getStandPrice());
-
+            orderGoods.setGoodsYear(goods.getYear().toString());
             orderGoods.setCreateTime(DateUtils.getNowTime());
             orderGoods.setUpdateTime(DateUtils.getNowTime());
 
@@ -632,7 +632,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
             }
             //成交价
             orderGoods.setGoodsRealPrice(g.getGoodsRealPrice());
-
+            orderGoods.setGoodsYear(goods.getYear().toString());
             orderGoods.setCreateTime(DateUtils.getNowTime());
             orderGoods.setUpdateTime(DateUtils.getNowTime());
             orderGoods.setGoodsReceived(g.getGoodsReceived());
@@ -814,6 +814,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
             body = "中正祥粤云-" + goods.getGoodsName();
             OrderGoods orderGoods = BeanUtil.toBean(g, OrderGoods.class);
             orderGoods.setOrderSn(out_trade_no);
+            orderGoods.setGoodsYear(goods.getYear().toString());
             if (g.getGoodsInputData() != null) {
                 orderGoods.setGoodsInputData(JSON.toJSONString(g.getGoodsInputData()));
             }
@@ -975,7 +976,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
 
     private void orderCostHandle(Order add,Integer type) {
         add.setCheckStatus(1);//C端订单不需要审核
-        add.setRefundStatus(1);
+        add.setOrderRefundStatus(1);
         add.setInvoiceStatus(0);
         add.setFinishStatus(type == 1? 1:0);
         add.setCreditStatus(0);
@@ -1221,6 +1222,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
             //成交价
             orderGoods.setStatus(1);
             orderGoods.setCreateTime(DateUtils.getNowTime());
+            orderGoods.setGoodsYear(goods.getYear().toString());
             orderGoods.setUpdateTime(DateUtils.getNowTime());
             if (StringUtils.isNotBlank(g.getDistributionCode())){
                 //分销订单
@@ -1405,6 +1407,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
             orderGoods.setCompany(bo.getOrderStudent().getCompany());*/
             //成交价
             orderGoods.setStatus(1);
+            orderGoods.setGoodsYear(goods.getYear().toString());
             orderGoods.setGoodsRealPrice(goods.getStandPrice());
             orderGoods.setGoodsPrice(goods.getStandPrice());
             orderGoods.setCreateTime(DateUtils.getNowTime());
@@ -1899,23 +1902,23 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
         payStatusList.add(4);
         orderGoodsQueryBo.setPayStatusList(payStatusList);
         List<OrderGoodsVo> list1 = iOrderGoodsService.selectList(orderGoodsQueryBo);
-        for (OrderGoodsVo goodsVo : list1) {
-            if (Validator.isNotEmpty(goodsVo.getServiceEndTime()) && (goodsVo.getServiceEndTime().longValue() > (System.currentTimeMillis() / 1000))) {
-                if (goodsVo.getGoodsType() == 1) {
-                    if (Validator.isNotEmpty(goodsVo.getGradeId())) {
-                        ClassGrade grade = iClassGradeService.getOne(new LambdaQueryWrapper<ClassGrade>()
-                                .eq(ClassGrade::getGradeId, goodsVo.getGradeId()));
-                        //不存在班级有效期才校验服务期是否过期
-                        if (Validator.isEmpty(grade.getClassEndTime())) {
-                            throw new CustomException("存在已购买【学习服务期未过期】的视频商品,不可以重复购买商品", 511);
-                        }
-                    }
-                }
-                if (goodsVo.getGoodsType() == 2) {
-                    throw new CustomException("存在已购买【学习服务期未过期】的题库商品,不可以重复购买商品", 511);
-                }
-            }
-        }
+//        for (OrderGoodsVo goodsVo : list1) {
+//            if (Validator.isNotEmpty(goodsVo.getServiceEndTime()) && (goodsVo.getServiceEndTime().longValue() > (System.currentTimeMillis() / 1000))) {
+//                if (goodsVo.getGoodsType() == 1) {
+//                    if (Validator.isNotEmpty(goodsVo.getGradeId())) {
+//                        ClassGrade grade = iClassGradeService.getOne(new LambdaQueryWrapper<ClassGrade>()
+//                                .eq(ClassGrade::getGradeId, goodsVo.getGradeId()));
+//                        //不存在班级有效期才校验服务期是否过期
+//                        if (Validator.isEmpty(grade.getClassEndTime())) {
+//                            throw new CustomException("存在已购买【学习服务期未过期】的视频商品,不可以重复购买商品", 511);
+//                        }
+//                    }
+//                }
+//                if (goodsVo.getGoodsType() == 2) {
+//                    throw new CustomException("存在已购买【学习服务期未过期】的题库商品,不可以重复购买商品", 511);
+//                }
+//            }
+//        }
         if (list1 != null && list1.size() > 0) {
             return list1.get(0).getOrderGoodsId();
         }

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/vo/OrderBusinessConfigVo.java

@@ -46,4 +46,7 @@ public class OrderBusinessConfigVo {
 	private String educationName;
 	@ApiModelProperty("项目名称")
 	private String projectName;
+	/** 班级类型 1基础班 2强化班 3私塾班 */
+	@ApiModelProperty("班级类型 1基础班 2强化班 3私塾班")
+	private Integer gradeType;
 }

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/schedule/service/IScheduleService.java

@@ -109,4 +109,7 @@ public interface IScheduleService extends IService<PolyvVideo> {
     void makeDivideSellerMonthBill();
 
     void makeDivideBrokerageMonthBill();
+
+    void createExamApply();
+
 }

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 454 - 237
zhongzheng-system/src/main/java/com/zhongzheng/modules/schedule/service/impl/ScheduleServiceImpl.java


+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/top/goods/bo/TopOldOrderGoodsAddBo.java

@@ -22,6 +22,9 @@ public class TopOldOrderGoodsAddBo {
     /** 商品id */
     @ApiModelProperty("商品id")
     private Long goodsId;
+    /** 商品年份 */
+    @ApiModelProperty("商品年份")
+    private String goodsYear;
     /** 商品标准价格 */
     @ApiModelProperty("商品标准价格")
     private BigDecimal goodsPrice;

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

@@ -33,6 +33,8 @@ private static final long serialVersionUID=1L;
     private String orderSn;
     /** 商品id */
     private Long goodsId;
+    /** 商品年份 */
+    private String goodsYear;
     /** 商品标准价格 */
     private BigDecimal goodsPrice;
     /** 商品成交价格 */

+ 42 - 3
zhongzheng-system/src/main/java/com/zhongzheng/modules/top/goods/service/impl/TopOldOrderServiceImpl.java

@@ -260,6 +260,16 @@ public class TopOldOrderServiceImpl extends ServiceImpl<TopOldOrderMapper, TopOl
         if (ObjectUtils.isNotNull(orderVo.getOrderReceived()) && ObjectUtils.isNotNull(orderVo.getOrderRefunded())) {
             orderVo.setOrderPractical(orderVo.getOrderReceived().subtract(orderVo.getOrderRefunded()));
         }
+        TopOldOrderCheckLog checkLog = topOldOrderCheckLogService
+                .getOne(new LambdaQueryWrapper<TopOldOrderCheckLog>()
+                        .eq(TopOldOrderCheckLog::getOrderSn, orderSn)
+                        .eq(TopOldOrderCheckLog::getType, 1)//B端订单审核
+                        .eq(TopOldOrderCheckLog::getCheckSign, 1)
+                        .last("limit 1"));
+        if (ObjectUtils.isNotNull(checkLog)){
+            orderVo.setCheckReason(checkLog.getCheckReason());
+        }
+
         return orderVo;
     }
 
@@ -585,6 +595,7 @@ public class TopOldOrderServiceImpl extends ServiceImpl<TopOldOrderMapper, TopOl
         edit.setCreateTime(DateUtils.getNowTime());
         edit.setUpdateTime(DateUtils.getNowTime());
         edit.setCheckStatus(0);
+        edit.setRefundStatus(order.getRefundStatus());
         //未收账款
         if (ObjectUtils.isNull(bo.getOrderReceived()) || bo.getOrderReceived().compareTo(new BigDecimal("0.00")) == 0) {
             edit.setOrderUncollected(bo.getPayPrice());
@@ -1028,6 +1039,24 @@ public class TopOldOrderServiceImpl extends ServiceImpl<TopOldOrderMapper, TopOl
         for (TopOldOrderGoodsListVo item : list) {
             item.setUserCount(userCount);
             item.setCheckStatusStr(item.getCheckStr(item.getCheckStatus()));
+            //退款发起原因和审核意见
+            TopOldOrderRefund orderRefund = topOldOrderRefundService
+                    .getOne(new LambdaQueryWrapper<TopOldOrderRefund>()
+                    .eq(TopOldOrderRefund::getOrderGoodsId, item.getOrderGoodsId())
+                    .eq(TopOldOrderRefund::getStatus,1)
+                    .orderByDesc(TopOldOrderRefund::getCreateTime).last("limit 1"));
+            if (ObjectUtils.isNotNull(orderRefund)){
+                item.setRefundReason(orderRefund.getApplyReason());
+
+                List<TopOldOrderCheckLog> logList = topOldOrderCheckLogService
+                        .list(new LambdaQueryWrapper<TopOldOrderCheckLog>()
+                        .eq(TopOldOrderCheckLog::getRefundSn, orderRefund.getRefundSn())
+                        .eq(TopOldOrderCheckLog::getStatus, 1));
+                if (CollectionUtils.isNotEmpty(logList)){
+                    String collect = logList.stream().map(TopOldOrderCheckLog::getCheckReason).collect(Collectors.joining(","));
+                    item.setCheckReason(collect);
+                }
+            }
         }
         return list;
     }
@@ -1071,6 +1100,7 @@ public class TopOldOrderServiceImpl extends ServiceImpl<TopOldOrderMapper, TopOl
                     brokerageFlag = true;
                 }
                 oldOrder.setCheckStatus(bo.getCheckStatus());
+                checkLog.setCheckStatus(1);
                 break;
             case 2://拒绝 恢复原本的佣金
                 if (StringUtils.isNotBlank(oldOrder.getCostJson())
@@ -1091,6 +1121,8 @@ public class TopOldOrderServiceImpl extends ServiceImpl<TopOldOrderMapper, TopOl
                 } else {
                     oldOrder.setCheckStatus(bo.getCheckStatus());
                 }
+                checkLog.setCheckStatus(-1);
+                checkLog.setCheckReason(bo.getCheckReason());
                 break;
             default:
                 break;
@@ -1106,6 +1138,7 @@ public class TopOldOrderServiceImpl extends ServiceImpl<TopOldOrderMapper, TopOl
         }
 
         updateById(oldOrder);
+        topOldOrderCheckLogService.updateById(checkLog);
 
         if (bo.getCheckStatus() == 1 && oldOrder.getFinishSign() == 0 && oldOrder.getOrderUncollected().compareTo(BigDecimal.ZERO) == 0) {
             //订单审核通过,账款已结清,满足完单条件
@@ -1985,7 +2018,13 @@ public class TopOldOrderServiceImpl extends ServiceImpl<TopOldOrderMapper, TopOl
             //新云学堂C端
             User user = userService.getById(orderVo.getUserId());
             vo.setApplyName(String.format("%s(%s)", tenant.getTenantName(), user.getRealname()));
-        } else {
+        }else if (orderVo.getOrderFrom() == 2){
+            vo.setPayType(orderVo.getPayType());
+            List<TopOldOrderGoods> list = topOrderGoodsService
+                    .list(new LambdaQueryWrapper<TopOldOrderGoods>()
+                    .eq(TopOldOrderGoods::getOrderSn, orderVo.getOrderSn()));
+            vo.setApplyName(String.format("%s(%s)", tenant.getTenantName(),list.get(0).getUserName()));
+        }else {
             vo.setApplyName(String.format("%s(%s)", tenant.getTenantName(), orderVo.getCreateUsername()));
         }
         vo.setCheckType(1);
@@ -2243,7 +2282,7 @@ public class TopOldOrderServiceImpl extends ServiceImpl<TopOldOrderMapper, TopOl
                         .in(OrderGoods::getOrderGoodsId, orderGoodsIds));
 
                 orderService.update(new LambdaUpdateWrapper<Order>()
-                        .set(Order::getRefundStatus, 4) //未通过
+                        .set(Order::getOrderRefundStatus, 4) //未通过
                         .eq(Order::getOrderSn, refundList.get(0).getOrderSn()));
             }
 
@@ -2366,7 +2405,7 @@ public class TopOldOrderServiceImpl extends ServiceImpl<TopOldOrderMapper, TopOl
 
             if (periodStatus == 2) {
                 orderService.update(new LambdaUpdateWrapper<Order>()
-                        .set(Order::getRefundStatus, 2) //未退款
+                        .set(Order::getOrderRefundStatus, 2) //未退款
                         .eq(Order::getOrderSn, refundList.get(0).getOrderSn()));
             }
         }

+ 7 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/top/goods/vo/TopOldOrderGoodsListVo.java

@@ -31,6 +31,9 @@ public class TopOldOrderGoodsListVo {
 	/** 商品id */
 	@ApiModelProperty("商品id")
 	private Long goodsId;
+	/** 商品年份 */
+	@ApiModelProperty("商品年份")
+	private String goodsYear;
 	/** 商品标准价格 */
 	@ApiModelProperty("商品标准价格")
 	private BigDecimal goodsPrice;
@@ -75,6 +78,10 @@ public class TopOldOrderGoodsListVo {
 	private Integer userCount;
 	@ApiModelProperty("学员状态:0待审核,1已通过,2未通过,3已撤销,-1已取消")
 	private Integer checkStatus;
+	@ApiModelProperty("退款申请原因")
+	private String refundReason;
+	@ApiModelProperty("审核意见")
+	private String checkReason;
 
 	private Long signId;
 

+ 3 - 3
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/bo/UserAppTelphoneLoginBo.java

@@ -4,8 +4,6 @@ import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
-import javax.validation.constraints.NotNull;
-
 
 /**
  * 客户端用户编辑对象 user
@@ -18,7 +16,9 @@ import javax.validation.constraints.NotNull;
 public class UserAppTelphoneLoginBo {
 
     @ApiModelProperty("标识")
-    @NotNull(message = "标识不能为空")
     private String sign;
 
+    @ApiModelProperty("用户账号")
+    private String userAccount;
+
 }

+ 45 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/bo/UserLiveAccountLoginBo.java

@@ -0,0 +1,45 @@
+package com.zhongzheng.modules.user.bo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotNull;
+
+
+/**
+ * 客户端用户编辑对象 user
+ *
+ * @author ruoyi
+ * @date 2021-06-08
+ */
+@Data
+@ApiModel("客户端用户账号直播统一登录对象")
+public class UserLiveAccountLoginBo {
+    @ApiModelProperty("手机号/身份证")
+    @NotNull(message = "账号不能为空")
+    private String account;
+    @ApiModelProperty("密码")
+    @NotNull(message = "密码不能为空")
+    private String pwd;
+
+    @ApiModelProperty("手机号")
+    private String tel;
+    @ApiModelProperty("验证码")
+    private String code;
+
+    @ApiModelProperty("直播路径")
+    private String liveUrl;
+
+    @ApiModelProperty("用户账号")
+    private String user_account;
+
+    @ApiModelProperty("参数")
+    private String param;
+
+    @ApiModelProperty("路径类型:1,H5 2,PC")
+    private Integer urlType;
+
+    @ApiModelProperty("登录类型:1直播")
+    private Integer type;
+}

+ 10 - 2
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/mapper/UserMapper.java

@@ -1,14 +1,13 @@
 package com.zhongzheng.modules.user.mapper;
 
 import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.zhongzheng.modules.user.bo.RanKingUserQuery;
 import com.zhongzheng.modules.user.bo.UserQueryBo;
 import com.zhongzheng.modules.user.bo.UserStudyRecordQueryBo;
 import com.zhongzheng.modules.user.domain.User;
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.zhongzheng.modules.user.vo.RanKingUser;
 import com.zhongzheng.modules.user.vo.UserStudyRecordVo;
-import com.zhongzheng.modules.user.vo.UserVo;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
@@ -64,4 +63,13 @@ public interface UserMapper extends BaseMapper<User> {
 
     @InterceptorIgnore(tenantLine = "true")
     void editUserInfo(UserQueryBo bo);
+
+    @InterceptorIgnore(tenantLine = "true")
+    List<User> getUserByTel(@Param("account")String account);
+
+    @InterceptorIgnore(tenantLine = "true")
+    Long getUserOrderCount(@Param("userId")Long userId,@Param("tenantId") Long tenantId,@Param("code") String code,@Param("goodsName") String goodsName);
+
+    @InterceptorIgnore(tenantLine = "true")
+    User getUserByAccount(@Param("userAccount")String userAccount);
 }

+ 8 - 4
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/IUserService.java

@@ -1,12 +1,9 @@
 package com.zhongzheng.modules.user.service;
 
-import com.zhongzheng.common.core.domain.entity.SysUser;
-import com.zhongzheng.modules.course.bo.CourseBusinessQueryBo;
+import com.baomidou.mybatisplus.extension.service.IService;
 import com.zhongzheng.modules.user.bo.*;
 import com.zhongzheng.modules.user.domain.User;
 import com.zhongzheng.modules.user.vo.*;
-import com.baomidou.mybatisplus.extension.service.IService;
-import org.apache.ibatis.annotations.Param;
 
 import java.math.BigDecimal;
 import java.util.Collection;
@@ -129,4 +126,11 @@ public interface IUserService extends IService<User> {
 
 	void batchUpdateTelId();
 
+	UserLiveAccountLoginVo liveUnifyLogin(UserLiveAccountLoginBo bo);
+
+	Map<String, Object> automaticAccountLogin(UserAppTelphoneLoginBo bo);
+
+	UserLiveAccountLoginVo smsLiveUnifyLogin(UserLiveAccountLoginBo bo);
+
+	UserLiveAccountLoginVo liveUnifyLoginRefresh(UserLiveAccountLoginBo bo);
 }

+ 4 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/impl/UserStudyRecordServiceImpl.java

@@ -1501,6 +1501,10 @@ public class UserStudyRecordServiceImpl extends ServiceImpl<UserStudyRecordMappe
 
     @Override
     public List<SubjectStudyRecordVo> listSubject(SubjectStudyRecordQueryBo bo) {
+        String tenantId = ServletUtils.getRequest().getHeader("TenantId");
+        if (StringUtils.isNotBlank(tenantId)){
+            bo.setTenantId(Long.valueOf(tenantId));
+        }
         List<SubjectStudyRecordVo> subjectStudyRecordVos = baseMapper.listSubject(bo);
         return subjectStudyRecordVos;
     }

+ 70 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/impl/UserSubscribeServiceImpl.java

@@ -32,8 +32,13 @@ import com.zhongzheng.modules.course.mapper.CourseMapper;
 import com.zhongzheng.modules.course.service.IMajorService;
 import com.zhongzheng.modules.exam.bo.ExamApplyQueryBo;
 import com.zhongzheng.modules.exam.bo.ExamApplySiteTimeJson;
+import com.zhongzheng.modules.exam.bo.ExamApplySiteTimeTwoAddBo;
+import com.zhongzheng.modules.exam.domain.ExamApplySite;
+import com.zhongzheng.modules.exam.domain.ExamApplySiteTime;
 import com.zhongzheng.modules.exam.mapper.ExamApplyMapper;
+import com.zhongzheng.modules.exam.service.IExamApplyService;
 import com.zhongzheng.modules.exam.service.IExamApplySiteService;
+import com.zhongzheng.modules.exam.service.IExamApplySiteTimeService;
 import com.zhongzheng.modules.exam.vo.ExamApplySiteTimeTwoVo;
 import com.zhongzheng.modules.exam.vo.ExamApplySiteVo;
 import com.zhongzheng.modules.exam.vo.ExamApplyVo;
@@ -112,6 +117,12 @@ public class UserSubscribeServiceImpl extends ServiceImpl<UserSubscribeMapper, U
     @Autowired
     private IExamApplySiteService iExamApplySiteService;
 
+    @Autowired
+    private IExamApplyService iExamApplyService;
+
+    @Autowired
+    private IExamApplySiteTimeService iExamApplySiteTimeService;
+
     @Autowired
     private IMajorService majorService;
 
@@ -2000,6 +2011,36 @@ public class UserSubscribeServiceImpl extends ServiceImpl<UserSubscribeMapper, U
         if (System.currentTimeMillis()/1000 > time){
             throw new CustomException("当前选择的考试时间已过期,请重新预约,选择未过期考试时间");
         }
+        //生成座位号
+        ExamApplySite applySite = iExamApplySiteService.getOne(new LambdaQueryWrapper<ExamApplySite>()
+                .eq(ExamApplySite::getApplyId, bo.getApplyId())
+                .eq(ExamApplySite::getSiteId, bo.getSiteId())
+                .last("limit 1"));
+        if (ObjectUtils.isNull(applySite)){
+            throw new CustomException("考试地点查询有误,请检查");
+        }
+        List<ExamApplySiteTime> siteTimeList = iExamApplySiteTimeService.list(new LambdaQueryWrapper<ExamApplySiteTime>()
+                .eq(ExamApplySiteTime::getApplyId, bo.getApplyId())
+                .eq(ExamApplySiteTime::getApplySiteId, applySite.getId())
+                .eq(ExamApplySiteTime::getExamTime, bo.getApplySiteExamTime()));
+        if (CollectionUtils.isEmpty(siteTimeList)){
+            throw new CustomException("考试时间查询有误,请检查");
+        }
+        ExamApplySiteTime examApplySiteTime = siteTimeList.stream().filter(item -> {
+            List<ExamApplySiteTimeTwoAddBo> siteTimeTwoAddBos = JSONArray.parseArray(item.getSiteTime(), ExamApplySiteTimeTwoAddBo.class);
+            ExamApplySiteTimeTwoAddBo twoAddBo = siteTimeTwoAddBos.get(0);
+            return twoAddBo.getStartTime().equals(bo.getApplySiteStartTime()) && twoAddBo.getEndTime().equals(bo.getApplySiteEndTime());
+        }).findFirst().orElse(null);
+        if (ObjectUtils.isNull(examApplySiteTime)){
+            throw new CustomException("预约考试时间不存在,请重新选择");
+        }
+        //考场人数
+        List<ExamApplySiteTimeTwoAddBo> siteTimeTwoAddBos = JSONArray.parseArray(examApplySiteTime.getSiteTime(), ExamApplySiteTimeTwoAddBo.class);
+        Long userNum = siteTimeTwoAddBos.get(0).getNum();
+
+        //生成座位号
+        Integer tNum = getSeatNumber(bo,userNum);
+        add.setSeatNumber(tNum.toString());
         //要求非必填考点
         if(Validator.isNotEmpty(bo.getApplySiteAddress())){
             ExamApplyQueryBo queryTimeBo = new ExamApplyQueryBo();
@@ -2052,6 +2093,35 @@ public class UserSubscribeServiceImpl extends ServiceImpl<UserSubscribeMapper, U
         return add.getSubscribeId();
     }
 
+    private Integer getSeatNumber(UserSubscribeAddBo bo,Long userNum) {
+        List<UserSubscribe> list = list(new LambdaQueryWrapper<UserSubscribe>().eq(UserSubscribe::getApplyId, bo.getApplyId())
+                .eq(UserSubscribe::getApplySiteStartTime, bo.getApplySiteStartTime())
+                .eq(UserSubscribe::getApplySiteEndTime, bo.getApplySiteEndTime())
+                .eq(UserSubscribe::getSubscribeStatus, 1)
+                .eq(UserSubscribe::getSiteId, bo.getSiteId()));
+        if (CollectionUtils.isEmpty(list)){
+            return 1;
+        }
+        if (list.size() >= userNum){
+            throw new CustomException("本场考试已预约满,请选择其他场次!");
+        }
+        if (list.stream().allMatch(x -> ObjectUtils.isNull(x.getSeatNumber()))){
+            return 1;
+        }
+        Integer num = 0;
+        randomNum(list,num);
+        return num;
+    }
+
+    private void randomNum(List<UserSubscribe> list, Integer num) {
+        Random random = new Random();
+        Integer tNum = 1 + random.nextInt(50);
+        if (list.stream().anyMatch(x -> Integer.parseInt(x.getSeatNumber()) == tNum)){
+            randomNum(list,num);
+        }
+        num = tNum;
+    }
+
     private String drawReport(String imageStr, UserSubscribeSignReportBo bo){
         Font font = new Font("宋体", Font.BOLD, 48);// 添加字体的属性设置 微软雅黑
         String imgName = null;

+ 29 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/vo/UserLiveAccountLoginVo.java

@@ -0,0 +1,29 @@
+package com.zhongzheng.modules.user.vo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+
+/**
+ * 客户端用户编辑对象 user
+ *
+ * @author ruoyi
+ * @date 2021-06-08
+ */
+@Data
+@ApiModel("客户端用户账号直播统一登录对象")
+public class UserLiveAccountLoginVo {
+
+    @ApiModelProperty("手机号/身份证")
+    private String user_account;
+
+    @ApiModelProperty("手机号")
+    private String tel;
+
+    @ApiModelProperty("跳转路径")
+    private String url;
+
+    @ApiModelProperty("机构ID")
+    private Long tenantId;
+}

+ 34 - 0
zhongzheng-system/src/main/resources/mapper/modules/course/CourseBusinessMapper.xml

@@ -126,4 +126,38 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         LEFT JOIN order_input_template t ON b.template_status = t.id
         WHERE b.id = #{businessId} and b.tenant_id = #{tenantId}
     </select>
+
+    <select id="queryAllList" parameterType="com.zhongzheng.modules.course.bo.CourseBusinessQueryBo"  resultMap="CourseBusinessVoResult">
+        SELECT
+        b.id as business_id,
+        b.business_name,
+        b.alias_name,
+        e.education_name,
+        e.id as education_id,
+        p.project_name,
+        p.id as project_id
+        FROM
+        course_business b
+        LEFT JOIN course_project_type p on b.project_id =p.id
+        LEFT JOIN course_education_type e ON p.education_id = e.id
+        where 1=1
+        and p.status = 1
+        and b.status = 1
+        <if test="businessName != null and businessName != ''">
+            AND b.business_name = #{businessName}
+        </if>
+        <if test="encoder != null and encoder != ''">
+            AND b.encoder = #{encoder}
+        </if>
+        <if test="projectId != null and projectId != ''">
+            AND p.id = #{projectId}
+        </if>
+        <if test="educationId != null and educationId != ''">
+            AND e.id = #{educationId}
+        </if>
+        <if test="id != null and id != ''">
+            AND b.id = #{id}
+        </if>
+        order by b.sort
+    </select>
 </mapper>

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

@@ -770,4 +770,12 @@
     <select id="getCourseByTenant" parameterType="map" resultType="com.zhongzheng.modules.course.domain.Course">
         select * from course where code = #{code} and tenant_id = #{newTenantId}
     </select>
+
+    <select id="getCourseByNotTenant" parameterType="java.lang.Long" resultType="com.zhongzheng.modules.course.domain.Course">
+        select * from course where course_id = #{cid}
+    </select>
+
+    <select id="getCourseByTenantTwo" parameterType="map" resultType="java.lang.Long">
+        select * from course where course_name = #{courseName} and code = #{code} and tenant_id = #{tenantId}
+    </select>
 </mapper>

+ 4 - 0
zhongzheng-system/src/main/resources/mapper/modules/course/CourseMenuExamMapper.xml

@@ -49,4 +49,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         delete from course_menu_exam where course_id = #{newCourseId} and tenant_id = #{newTenantId}
     </delete>
 
+    <delete id="deleteModuleByIdTenant" parameterType="map">
+        delete from course_menu_exam where course_id = #{newCourseId} and module_id = #{newModuleId} and tenant_id = #{newTenantId}
+    </delete>
+
 </mapper>

+ 4 - 0
zhongzheng-system/src/main/resources/mapper/modules/course/CourseMenuMapper.xml

@@ -368,4 +368,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             and usr.course_id=#{courseId}
             AND usr.current_status =1
     </select>
+
+    <select id="selectByNotTenant" parameterType="map"  resultType="com.zhongzheng.modules.course.domain.CourseMenu">
+        SELECT * FROM `course_menu` WHERE course_id = #{newCourseId} AND menu_id = #{newModuleId} AND type = #{type} AND tenant_id = #{newTenantId}
+    </select>
 </mapper>

+ 1 - 1
zhongzheng-system/src/main/resources/mapper/modules/course/CourseModuleChapterMapper.xml

@@ -54,7 +54,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             cmc.id,
             cmc.module_id,
                (SELECT
-                    count(ccs.section_id) from course_chapter_section ccs where ccs.chapter_id = cc.chapter_id) as section_num
+                    count(ccs.section_id) from course_chapter_section ccs where ccs.chapter_id = cc.chapter_id AND ccs.tenant_id = #{tenantId}) as section_num
         FROM
             course_module_chapter cmc
                 LEFT JOIN course_chapter cc ON cmc.chapter_id = cc.chapter_id

+ 10 - 1
zhongzheng-system/src/main/resources/mapper/modules/course/CourseSectionMapper.xml

@@ -252,6 +252,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </select>
 
     <select id="getSectionByTenant" parameterType="map" resultType="com.zhongzheng.modules.course.domain.CourseSection">
-        SELECT * from course_section where code = #{code} and teacher_id = #{newTenantId}
+        SELECT * from course_section where code = #{code} and tenant_id = #{newTenantId}
     </select>
+
+    <select id="getSectionByNotTenant" parameterType="java.lang.Long" resultType="com.zhongzheng.modules.course.domain.CourseSection">
+        SELECT * from course_section where section_id = #{sid}
+    </select>
+
+    <select id="getSectionByTenantTwo" parameterType="map" resultType="com.zhongzheng.modules.course.domain.CourseSection">
+        SELECT * from course_section where `name` = #{name} and code = #{code} and tenant_id = #{tenantId}
+    </select>
+
 </mapper>

+ 68 - 0
zhongzheng-system/src/main/resources/mapper/modules/exam/ExamApplyMapper.xml

@@ -523,4 +523,72 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             chapter_id,
             section_id
     </select>
+
+
+    <select id="getExamApplyByUser" parameterType="map" resultType="com.zhongzheng.modules.user.domain.UserSubscribe">
+        SELECT
+            *
+        FROM
+            user_subscribe us
+                LEFT JOIN goods g ON us.goods_id = g.goods_id
+                LEFT JOIN major m ON g.major_id = m.id
+        WHERE
+            us.user_id = #{userId}
+          AND INSTR( m.category_name, #{majorName} ) > 0
+          AND us.subscribe_status = 1
+        ORDER BY
+            us.create_time DESC
+            LIMIT 1
+    </select>
+
+    <select id="getExamInfo" parameterType="com.zhongzheng.modules.exam.bo.ExamApplyDetailBo" resultType="com.zhongzheng.modules.exam.vo.ExamApplyDetailVo">
+        SELECT
+        us.apply_id AS apply_id,
+        us.site_id AS site_id,
+        us.apply_site_exam_time AS exam_time,
+        us.apply_site_start_time AS start_time,
+        us.apply_site_end_time AS end_time
+        FROM
+        user_subscribe us
+        WHERE
+        us.subscribe_status = 1
+        <if test="examStartTime != null and examStartTime != ''">
+            AND us.apply_site_exam_time <![CDATA[ >= ]]> #{examStartTime}
+        </if>
+        <if test="examEndTime != null and examEndTime != ''">
+            AND us.apply_site_exam_time <![CDATA[ <= ]]> #{examEndTime}
+        </if>
+        <if test="startTime != null and startTime != ''">
+            AND us.apply_site_start_time = #{startTime}
+        </if>
+        <if test="endTime != null and endTime != ''">
+            AND us.apply_site_end_time = #{endTime}
+        </if>
+        AND us.tenant_id = 867735392558919680
+        GROUP BY
+        us.apply_id,
+        us.apply_site_exam_time,
+        us.site_id,
+        us.apply_site_start_time,
+        us.apply_site_end_time
+    </select>
+
+    <select id="getExamUserInfo" parameterType="com.zhongzheng.modules.exam.vo.ExamApplyDetailVo" resultType="com.zhongzheng.modules.exam.vo.ExamApplyUserDetailVo">
+        SELECT
+            us.seat_number AS seatNum,
+            u.realname AS userName,
+            u.id_card AS idCard
+        FROM
+            user_subscribe us
+                LEFT JOIN `user` u ON us.user_id = u.user_id
+                AND u.tenant_id = 867735392558919680
+        WHERE
+            us.subscribe_status = 1
+          AND us.apply_id = #{applyId}
+          AND us.apply_site_exam_time = #{examTime}
+          AND us.site_id = #{siteId}
+          AND us.apply_site_start_time = #{startTime}
+          AND us.apply_site_end_time = #{endTime}
+          AND us.tenant_id = 867735392558919680
+    </select>
 </mapper>

+ 9 - 0
zhongzheng-system/src/main/resources/mapper/modules/goods/GoodsMapper.xml

@@ -53,6 +53,7 @@
         <result property="certificateTpId" column="certificate_tp_id"/>
         <result property="commitPeriodStatus" column="commit_period_status"/>
         <result property="commitPeriodRemark" column="commit_period_remark"/>
+        <result property="gradeType" column="grade_type"/>
     </resultMap>
 
     <resultMap type="com.zhongzheng.modules.goods.vo.GoodsVo" id="GoodsResultVo">
@@ -139,6 +140,7 @@
         <result property="goodsLearningOrder" column="goods_learning_order"/>
         <result property="commitPeriodStatus" column="commit_period_status"/>
         <result property="commitPeriodRemark" column="commit_period_remark"/>
+        <result property="gradeType" column="grade_type"/>
     </resultMap>
 
     <resultMap type="com.zhongzheng.modules.exam.vo.ExamNumberGoodsVo" id="ExamNumberGoodsVoResult">
@@ -785,6 +787,13 @@
         FROM `goods`
         WHERE goods_id = #{goodsId}
     </select>
+
+    <select id="getGoodsByTenantTwo" parameterType="map" resultType="com.zhongzheng.modules.goods.domain.Goods">
+        SELECT *
+        FROM `goods`
+        WHERE goods_name = #{goodsName} and code = #{code} and tenant_id = #{tenantId}
+    </select>
+
     <update id="updateByTenant" parameterType="com.zhongzheng.modules.goods.domain.Goods">
         UPDATE goods
         SET `year`                  = #{year},

+ 5 - 2
zhongzheng-system/src/main/resources/mapper/modules/grade/ClassGradeUserMapper.xml

@@ -216,6 +216,7 @@
         <result property="studyEndTime" column="study_end_time"/>
         <result property="auditNum" column="audit_num"/>
         <result property="sort" column="sort"/>
+
         <result property="sectionType" column="section_type"/>
         <result property="realLiveStartTime" column="real_live_start_time"/>
         <result property="realLiveEndTime" column="real_live_end_time"/>
@@ -1194,11 +1195,12 @@
         <if test="userId != null and userId !='' ">
             #{userId} as user_id,
         </if>
+
         (SELECT e.exam_name FROM exam e where cme.exam_id = e.exam_id) as type_name,
         null as class_hours,
         4 as type,
-        cme.module_id,
-        cme.chapter_id
+        cme.chapter_id,
+        cme.module_id
         FROM
         course_menu_exam cme
         LEFT JOIN exam e ON cme.exam_id = e.exam_id
@@ -1256,6 +1258,7 @@
             and u.user_id = #{userId}
             ) as realname,
         </if>
+
         <if test="userId != null and userId !='' ">
             #{userId} as user_id,
         </if>

+ 8 - 0
zhongzheng-system/src/main/resources/mapper/modules/order/OrderBusinessConfigMapper.xml

@@ -11,6 +11,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="createTime" column="create_time"/>
         <result property="updateTime" column="update_time"/>
         <result property="status" column="status"/>
+        <result property="gradeType" column="grade_type"/>
     </resultMap>
 
     <resultMap type="com.zhongzheng.modules.order.vo.OrderBusinessConfigVo" id="OrderBusinessConfigVoResult">
@@ -21,6 +22,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="businessName" column="business_name"/>
         <result property="educationName" column="education_name"/>
         <result property="projectName" column="project_name"/>
+        <result property="gradeType" column="grade_type"/>
     </resultMap>
 
     <select id="getList" parameterType="com.zhongzheng.modules.order.bo.OrderBusinessConfigQueryBo" resultMap="OrderBusinessConfigVoResult">
@@ -37,6 +39,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         LEFT JOIN course_education_type cet ON cet.id = cpt.education_id
         WHERE
         obc.`status` = 1
+        <if test="gradeType != null and gradeType != ''">
+            and obc.grade_type = #{gradeType}
+        </if>
         <if test="businessId != null and businessId != ''">
             and obc.business_id = #{businessId}
         </if>
@@ -46,6 +51,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <if test="educationId != null and educationId != ''">
             and cet.id = #{educationId}
         </if>
+        <if test="subjectId != null and subjectId != ''">
+            and (SELECT COUNT(obcg.id) FROM order_business_config_goods obcg  where obcg.subject_id = #{subjectId} AND obcg.config_id = obc.id AND obcg.`status` = 1) > 0
+        </if>
     </select>
 
     <select id="getDetail" parameterType="com.zhongzheng.modules.order.bo.OrderBusinessConfigQueryBo" resultMap="OrderBusinessConfigVoResult">

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

@@ -800,6 +800,7 @@
         <result property="goodsPrice" column="goods_price"/>
         <result property="goodsRealPrice" column="goods_real_price"/>
         <result property="checkStatus" column="check_status"/>
+        <result property="goodsYear" column="goods_year"/>
     </resultMap>
 
     <select id="listByOrderSn" parameterType="com.zhongzheng.modules.top.goods.bo.TopOldOrderGoodsQuery" resultMap="getlist">
@@ -816,6 +817,7 @@
             CONCAT( cb.business_name, cpt.project_name ) AS business_name,
             og.goods_price,
             og.goods_real_price,
+            og.goods_year,
             1 as check_status
         FROM
             order_goods og

+ 2 - 0
zhongzheng-system/src/main/resources/mapper/modules/top/TopOldOrderGoodsMapper.xml

@@ -40,6 +40,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="goodsRealPrice" column="goods_real_price"/>
         <result property="signId" column="sign_id"/>
         <result property="checkStatus" column="check_status"/>
+        <result property="goodsYear" column="goods_year"/>
     </resultMap>
 
     <select id="getListByQuery" parameterType="com.zhongzheng.modules.top.goods.bo.TopOldOrderGoodsQuery" resultMap="getlist">
@@ -53,6 +54,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             business_name,
             goods_price,
             goods_real_price,
+            goods_year,
             sign_id,
             check_status
         FROM

+ 42 - 0
zhongzheng-system/src/main/resources/mapper/modules/user/UserMapper.xml

@@ -463,4 +463,46 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             user_id = #{userId}
     </select>
 
+    <select id="getUserByTel" parameterType="java.lang.String" resultType="com.zhongzheng.modules.user.domain.User">
+        SELECT
+            *
+        FROM
+            `user`
+        WHERE
+            status = 1
+            AND(id_card = #{account,typeHandler=com.zhongzheng.common.type.EncryptHandler}
+            OR telphone = #{account,typeHandler=com.zhongzheng.common.type.EncryptHandler})
+    </select>
+
+    <select id="getUserByAccount" parameterType="java.lang.String" resultType="com.zhongzheng.modules.user.domain.User">
+        SELECT
+            *
+        FROM
+            `user`
+        WHERE
+            status = 1
+          AND user_account = #{userAccount}
+    </select>
+
+    <select id="getUserOrderCount" parameterType="map" resultType="java.lang.Long">
+        SELECT
+            COUNT(o.order_sn)
+        FROM
+            `order` o
+                INNER JOIN order_goods og ON o.order_sn = og.order_sn
+                AND og.tenant_id = #{tenantId}
+                INNER JOIN goods g ON og.goods_id = g.goods_id
+                AND g.tenant_id = #{tenantId}
+        WHERE
+            o.`status` = 1
+            AND o.user_id = #{userId}
+            AND g.`code` = #{code}
+            AND g.goods_name = #{goodsName}
+            AND og.refund_status != 2
+	        AND og.pay_status IN ( 2, 3, 4 )
+	        AND g.`status` = 1
+	        AND og.`status` = 1
+	        AND o.tenant_id = #{tenantId}
+    </select>
+
 </mapper>

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

@@ -265,18 +265,61 @@
         r.subject_id,
         r.course_id,
         r.course_name,
-        (SELECT subject_name FROM course_subject s where s.id = r.subject_id) as subject_name,
-        (CASE WHEN (SELECT COUNT(id) FROM course_menu m where m.course_id = r.course_id and m.type in (1,2,3))> 0 THEN
+        (SELECT subject_name FROM course_subject s where s.id = r.subject_id
+        <if test="tenantId != null and tenantId !=''">
+            and s.tenant_id=#{tenantId}
+        </if>
+            ) as subject_name,
+        (CASE WHEN (SELECT COUNT(id) FROM course_menu m where m.course_id = r.course_id and m.type in (1,2,3)
+        <if test="tenantId != null and tenantId !=''">
+            and m.tenant_id=#{tenantId}
+        </if>)> 0 THEN
         '1' ELSE '0' END) as begin_status,
-        (SELECT COUNT(id) FROM course_menu m where m.course_id = r.course_id and m.type in (1)) as module_num,
+        (SELECT COUNT(id) FROM course_menu m where m.course_id = r.course_id and m.type in (1)
+        <if test="tenantId != null and tenantId !=''">
+            and m.tenant_id=#{tenantId}
+        </if>) as module_num,
         (SELECT COUNT(id)+(SELECT COUNT(p.id) FROM course_module_chapter p LEFT JOIN course_menu m on m.menu_id =
-        p.module_id where m.course_id = r.course_id and m.type in (1)) FROM course_menu m where m.course_id = r.course_id
+        p.module_id
+        <if test="tenantId != null and tenantId !=''">
+            and m.tenant_id=#{tenantId}
+        </if>
+        where m.course_id = r.course_id and m.type in (1)
+        <if test="tenantId != null and tenantId !=''">
+            and p.tenant_id=#{tenantId}
+        </if>) FROM course_menu m where m.course_id = r.course_id
+        <if test="tenantId != null and tenantId !=''">
+            and m.tenant_id=#{tenantId}
+        </if>
         and m.type in (2)) as chapter_num,
         (SELECT COUNT(id)+(SELECT COUNT(n.id) FROM course_chapter_section n LEFT JOIN course_module_chapter p on
-        n.chapter_id = p.chapter_id LEFT JOIN course_menu m on m.menu_id = p.module_id where m.course_id = r.course_id
-        and m.type in (1))+(SELECT COUNT(n.id) FROM course_chapter_section n LEFT JOIN course_menu m on m.menu_id =
-        n.chapter_id where m.course_id = r.course_id and m.type in (2)) FROM course_menu m where m.course_id =
-        r.course_id and m.type in (3)) as section_num,
+        n.chapter_id = p.chapter_id
+        <if test="tenantId != null and tenantId !=''">
+            and p.tenant_id=#{tenantId}
+        </if>
+            LEFT JOIN course_menu m on m.menu_id = p.module_id
+        <if test="tenantId != null and tenantId !=''">
+            and m.tenant_id=#{tenantId}
+        </if>
+        where m.course_id = r.course_id
+        and m.type in (1)
+        <if test="tenantId != null and tenantId !=''">
+            and n.tenant_id=#{tenantId}
+        </if>
+            )+(SELECT COUNT(n.id) FROM course_chapter_section n LEFT JOIN course_menu m on m.menu_id =
+        n.chapter_id
+        <if test="tenantId != null and tenantId !=''">
+            and m.tenant_id=#{tenantId}
+        </if>
+            where m.course_id = r.course_id and m.type in (2)
+        <if test="tenantId != null and tenantId !=''">
+            and n.tenant_id=#{tenantId}
+        </if>) FROM course_menu m where m.course_id =
+        r.course_id and m.type in (3)
+        <if test="tenantId != null and tenantId !=''">
+            and m.tenant_id=#{tenantId}
+        </if>
+            ) as section_num,
         (select COUNT(DISTINCT course_id,module_id,chapter_id,section_id) FROM user_study_record c where 1=1
         AND c.course_id = r.course_id
         and c.current_status=1
@@ -286,6 +329,9 @@
         <if test="orderGoodsId != null and orderGoodsId !=''">
             and c.order_goods_id=#{orderGoodsId}
         </if>
+        <if test="tenantId != null and tenantId !=''">
+            and c.tenant_id=#{tenantId}
+        </if>
         and c.user_id=#{userId} and c.status = 1 and c.goods_id = #{goodsId}) as record_num,
         (SELECT IFNULL(SUM(cs.duration_time),0) from (select DISTINCT c.section_id,c.course_id FROM user_study_record c where 1=1
         and c.current_status=1
@@ -295,10 +341,20 @@
         <if test="orderGoodsId != null and orderGoodsId !=''">
             and c.order_goods_id=#{orderGoodsId}
         </if>
-        and c.user_id=#{userId} and c.status = 1 and c.goods_id = #{goodsId})cc LEFT JOIN  course_section cs on cc.section_id = cs.section_id WHERE  cc.course_id = r.course_id) as record_time
+        <if test="tenantId != null and tenantId !=''">
+            and c.tenant_id=#{tenantId}
+        </if>
+        and c.user_id=#{userId} and c.status = 1 and c.goods_id = #{goodsId})cc LEFT JOIN  course_section cs on cc.section_id = cs.section_id
+        <if test="tenantId != null and tenantId !=''">
+            and cs.tenant_id=#{tenantId}
+        </if>
+        WHERE  cc.course_id = r.course_id) as record_time
         FROM
         course r
         LEFT JOIN goods_course c ON c.course_id = r.course_id
+        <if test="tenantId != null and tenantId !=''">
+            and c.tenant_id=#{tenantId}
+        </if>
         where 1=1
         <if test="goodsId != null and goodsId !=''">
             and c.goods_id =#{goodsId}

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.