yangdamao 1 سال پیش
والد
کامیت
badba2c01e
72فایلهای تغییر یافته به همراه2234 افزوده شده و 123 حذف شده
  1. 13 49
      run-prod.sh
  2. 4 0
      zhongzheng-admin-saas/src/main/resources/application-dev.yml
  3. 40 4
      zhongzheng-admin/src/main/java/com/zhongzheng/controller/common/CommonController.java
  4. 2 0
      zhongzheng-admin/src/main/java/com/zhongzheng/controller/grade/ClassGradeController.java
  5. 111 0
      zhongzheng-admin/src/main/java/com/zhongzheng/controller/user/DangAnController.java
  6. 9 0
      zhongzheng-admin/src/main/java/com/zhongzheng/controller/user/UserController.java
  7. 4 0
      zhongzheng-admin/src/main/resources/application-dev.yml
  8. 4 0
      zhongzheng-api/src/main/resources/application-dev.yml
  9. 2 0
      zhongzheng-framework/src/main/java/com/zhongzheng/framework/config/SecurityConfig.java
  10. 7 1
      zhongzheng-framework/src/main/java/com/zhongzheng/framework/web/service/UserServiceImpl.java
  11. 5 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/IQuestionService.java
  12. 603 17
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/impl/QuestionServiceImpl.java
  13. 27 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/vo/ExternalQuestionChildTopicVo.java
  14. 20 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/vo/ExternalQuestionChildVo.java
  15. 28 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/vo/ExternalQuestionDetailVo.java
  16. 25 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/vo/ExternalQuestionVo.java
  17. 22 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/vo/QuestionDetailVo.java
  18. 27 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/vo/QuestionInfoVo.java
  19. 31 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/base/service/impl/UserProfileServiceImpl.java
  20. 4 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseServiceImpl.java
  21. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/bo/GoodsAddBo.java
  22. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/bo/GoodsEditBo.java
  23. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/domain/Goods.java
  24. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/vo/GoodsVo.java
  25. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/bo/ClassGradeUserQueryBo.java
  26. 28 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/bo/UserSubQueryBo.java
  27. 4 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/mapper/ClassGradeUserMapper.java
  28. 4 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/IClassGradeUserService.java
  29. 79 5
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/impl/ClassGradeUserServiceImpl.java
  30. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/vo/ClassPeriodSectionVo.java
  31. 24 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/vo/ClassPeriodStudentVo.java
  32. 4 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/vo/ClassPeriodUserVo.java
  33. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/vo/ClassPeriodVo.java
  34. 5 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/vo/UserPeriodItemExportVo.java
  35. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/order/mapper/OrderMapper.java
  36. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/order/service/IOrderService.java
  37. 8 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/order/service/impl/OrderGoodsServiceImpl.java
  38. 69 2
      zhongzheng-system/src/main/java/com/zhongzheng/modules/order/service/impl/OrderServiceImpl.java
  39. 6 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/order/vo/OrderListVo.java
  40. 1 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/top/goods/service/impl/TopGoodsServiceImpl.java
  41. 130 32
      zhongzheng-system/src/main/java/com/zhongzheng/modules/top/goods/service/impl/TopOldOrderServiceImpl.java
  42. 1 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/top/goods/vo/TopOldOrderVo.java
  43. 9 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/top/goods/vo/TopOrderGoodsUpVo.java
  44. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/top/goods/vo/TopRefundUserVo.java
  45. 1 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/top/system/service/impl/TopCostCategoryServiceImpl.java
  46. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/bo/UserBankRecordAddBo.java
  47. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/bo/UserBankRecordEditBo.java
  48. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/bo/UserExamRecordAddBo.java
  49. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/bo/UserExamRecordEditBo.java
  50. 8 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/bo/UserQueryBo.java
  51. 7 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/domain/User.java
  52. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/domain/UserBankRecord.java
  53. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/domain/UserExamRecord.java
  54. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/mapper/UserMapper.java
  55. 8 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/mapper/UserStudyRecordMapper.java
  56. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/IUserService.java
  57. 8 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/IUserStudyRecordService.java
  58. 23 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/impl/UserStudyRecordServiceImpl.java
  59. 17 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/vo/ExamStudyRecordVo.java
  60. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/vo/SectionStudyRecordVo.java
  61. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/vo/UserBankRecordVo.java
  62. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/vo/UserExamRecordVo.java
  63. 11 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/vo/UserVo.java
  64. 30 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/wx/service/impl/WxPayServiceImpl.java
  65. 252 0
      zhongzheng-system/src/main/resources/mapper/modules/grade/ClassGradeUserMapper.xml
  66. 102 0
      zhongzheng-system/src/main/resources/mapper/modules/order/OrderMapper.xml
  67. 1 1
      zhongzheng-system/src/main/resources/mapper/modules/top/TopOldOrderGoodsMapper.xml
  68. 11 5
      zhongzheng-system/src/main/resources/mapper/modules/top/TopOldOrderMapper.xml
  69. 2 0
      zhongzheng-system/src/main/resources/mapper/modules/user/UserBankRecordMapper.xml
  70. 2 0
      zhongzheng-system/src/main/resources/mapper/modules/user/UserExamRecordMapper.xml
  71. 31 0
      zhongzheng-system/src/main/resources/mapper/modules/user/UserMapper.xml
  72. 308 0
      zhongzheng-system/src/main/resources/mapper/modules/user/UserStudyRecordMapper.xml

+ 13 - 49
run-prod.sh

@@ -1,63 +1,24 @@
-#!/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秒内随机
-sleep 5
-echo "等待后继续"
-
 #!/usr/bin/env bash
 # 定义应用组名
 group_admin_name='zhongzheng'
 # 定义应用名称
-app_admin_name='zhongzheng-saas-admin'
+app_admin_name='zhongzheng-saas-admin-top'
 # 定义应用版本
 app_admin_version='1.0-SNAPSHOT'
 # 定义应用环境
 profile_active='prod'
-echo '----copy jar admin----'
+echo '----copy jar admin top----'
 docker stop ${app_admin_name}
-echo '----stop container admin----'
+echo '----stop container admin top----'
 docker rm ${app_admin_name}
-echo '----rm container admin----'
+echo '----rm container admin top----'
 docker rmi ${group_admin_name}/${app_admin_name}:${app_admin_version}
-echo '----rm image admin----'
+echo '----rm image admin top----'
 # 打包编译docker镜像
-docker build -f /mydata/maven/build/Dockerfile-admi -t ${group_admin_name}/${app_admin_name}:${app_admin_version} .
-echo '----build image admin----'
+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 5030:5030 \
+-p 7077:7077 \
 --name ${app_admin_name} \
 --restart=always \
 --log-opt max-size=50m \
@@ -66,8 +27,11 @@ docker run \
 -e TZ="Asia/Shanghai" \
 -v /etc/localtime:/etc/localtime \
 -v /usr/share/fonts:/usr/share/fonts \
--v /data/logs/prod_admin:/logs \
+-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----'
+echo '----start container admin top----'
+
+
+

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

@@ -171,6 +171,8 @@ oldOrder:
 oldSys:
     host: http://gdxypx.xy.com
     goods: http://gdxypx.xy.com/WitSystem/BussinessApi/NewYxtLogin
+    question: http://192.168.1.121:8057/WordData/GetMeasureList
+    questionDetail: http://192.168.1.121:8057/WordData/GetTopicList
 
 invoice:
     host: http://192.168.1.222:7077/sys/common/openMplatform/log
@@ -187,6 +189,8 @@ exam:
     subscribeSaveExam: http://192.168.1.7:9099/cd/subscribe/save/exam
     subscribeUpdateExam: http://192.168.1.7:9099/cd/subscribe/update/exam
     subscribeAddExamNum: http://192.168.1.7:9099/cd/subscribe/add/num
+    question: http://120.79.166.78:19013/common/question/getMeasureList
+    questionDetail: http://120.79.166.78:19013/common/question/getTopicList
 
 shared:
     statistics: http://gdxypx.xy.com/WitSystem/BussinessApi/HighSeasData

+ 40 - 4
zhongzheng-admin/src/main/java/com/zhongzheng/controller/common/CommonController.java

@@ -107,6 +107,8 @@ import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
 import java.util.stream.Collectors;
 
 /**
@@ -171,7 +173,6 @@ public class CommonController extends BaseController {
     @Autowired
     private ClassGradeUserMapper classGradeUserMapper;
 
-
     @Autowired
     private IMajorService iMajorService;
     private IZsBankService iZsBankService;
@@ -836,14 +837,49 @@ public class CommonController extends BaseController {
     }
 
     @ApiOperation("新考题库导入")
-    @PostMapping("/common/question/import")
-    public AjaxResult<Void> questionImport(@RequestBody String param) {
-        iQuestionService.questionImport(param);
+    @GetMapping("/common/question/import")
+    public AjaxResult<Void> questionImport() {
+        iQuestionService.questionImport();
         return AjaxResult.success();
     }
 
     @ApiOperation("批量生成证书")
     @PreAuthorize("@ss.hasPermi('system:withdrawal:add')")
+    @PostMapping("/common/free/sevenPushAuthCallBack")
+    public AjaxResult sevenPushAuthCallBack(@RequestBody SevenPushAuthAddBo bo) {
+        String htmlv = "<img src=\"https://file-dev.xyyxt.net/web/Uploads/qdytopic/Imageqdy343-4.png\" />";
+        Pattern pattern = Pattern.compile("<img.*?src=\"(.*?)\"");
+
+        Matcher matcher = pattern.matcher(htmlv);
+        while (matcher.find()) {
+            System.out.println("Image URL found: " + matcher.group(1));
+        }
+        return AjaxResult.success("成功");
+
+       /* while (matcher.find()) {
+            System.out.println("Image URL found: " + matcher.group(1));
+        }
+
+        ServletUtils.getRequestAttributes().getResponse().setHeader("TenantId", "867735392558919680");
+        if (!ToolsUtils.checkSignCwSnFromOldSys(bo.getGradeUserId().toString(), bo.getStamp().toString(), bo.getSign())) {
+            return AjaxResult.error("签名错误");
+        }
+        return AjaxResult.success("成功", iClassGradeUserService.sevenPushAuthCallBack(bo) ? 1 : 0);*/
+    }
+
+
+    @PostMapping("/common/question/getMeasureList")
+    public AjaxResult<String> getMeasureList() {
+        String aa = iQuestionService.getMeasureList();
+        return AjaxResult.success("操作成功",aa);
+    }
+
+    @PostMapping("/common/question/getTopicList")
+    public AjaxResult<String> getTopicList(@RequestBody String topParam) {
+        String aa = iQuestionService.getTopicList(topParam);
+        return AjaxResult.success("操作成功", aa);
+    }
+
     @PostMapping("/common/free/makeBatchCertificatePhoto")
     public AjaxResult makeBatchCertificatePhoto(@RequestBody ClassGradeUserQueryBo bo) {
         iCertificateTpService.makeBatchCertificatePhoto(bo);

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

@@ -771,4 +771,6 @@ public class ClassGradeController extends BaseController {
         return util.exportExcel(exportVos, goodsVo.getGoodsName());
     }
 
+
+
 }

+ 111 - 0
zhongzheng-admin/src/main/java/com/zhongzheng/controller/user/DangAnController.java

@@ -0,0 +1,111 @@
+package com.zhongzheng.controller.user;
+
+import com.zhongzheng.common.core.controller.BaseController;
+import com.zhongzheng.common.core.page.TableDataInfo;
+import com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo;
+import com.zhongzheng.modules.grade.service.IClassGradeUserService;
+import com.zhongzheng.modules.grade.vo.ClassPeriodStudentVo;
+import com.zhongzheng.modules.order.bo.OrderQueryBo;
+import com.zhongzheng.modules.order.service.IOrderService;
+import com.zhongzheng.modules.order.vo.OrderListVo;
+import com.zhongzheng.modules.user.bo.UserQueryBo;
+import com.zhongzheng.modules.user.bo.UserVisitLogQueryBo;
+import com.zhongzheng.modules.user.service.IUserStudyRecordService;
+import com.zhongzheng.modules.user.service.IUserVisitLogService;
+import com.zhongzheng.modules.user.vo.ExamStudyRecordVo;
+import com.zhongzheng.modules.user.vo.UserVisitLogVo;
+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.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+/**
+ * 用户档案Controller
+ *
+ * @author hjl
+ * @date 2022-08-17
+ */
+@Api(value = "用户档案控制器", tags = {"用户档案管理"})
+@RequiredArgsConstructor(onConstructor_ = @Autowired)
+@RestController
+@RequestMapping("/user/dangAn")
+public class DangAnController extends BaseController {
+
+    private final IClassGradeUserService iClassGradeUserService;
+
+    private final IOrderService iOrderService;
+
+    private final IUserStudyRecordService iUserStudyRecordService;
+
+    @ApiOperation("查询档案网课列表")
+    @PreAuthorize("@ss.hasPermi('grade:user:list')")
+    @GetMapping("/listVideoUserPeriod")
+    public TableDataInfo<ClassPeriodStudentVo> listVideoUserPeriod(ClassGradeUserQueryBo bo) {
+        startPage();
+        List<ClassPeriodStudentVo> list = iClassGradeUserService.listVideoUserPeriod(bo);
+        return getDataTable(list);
+    }
+
+    @ApiOperation("查询档案订单列表")
+    @PreAuthorize("@ss.hasPermi('grade:user:list')")
+    @GetMapping("/listOrder")
+    public TableDataInfo<OrderListVo> listDangAnOrder(OrderQueryBo bo) {
+        startPage();
+        List<OrderListVo> list = iOrderService.selectDangAnOrderList(bo);
+        return getDataTable(list);
+    }
+
+    /**
+     * 查询学员商品题库学习记录
+     */
+    @ApiOperation("查询档案题库列表")
+    @PreAuthorize("@ss.hasPermi('grade:student:list')")
+    @GetMapping("/listUserExam")
+    public TableDataInfo<ExamStudyRecordVo> listUserExam(UserQueryBo bo) {
+        startPage();
+        List<ExamStudyRecordVo> list = iUserStudyRecordService.querDangAnExamStudy(bo);
+        return getDataTable(list);
+    }
+
+    @ApiOperation("学员约考记录")
+    @GetMapping("/listUserSubscribe")
+    public TableDataInfo<ClassPeriodStudentVo> getListUserSubscribe(ClassGradeUserQueryBo bo) {
+        startPage();
+        List<ClassPeriodStudentVo> list = iClassGradeUserService.listVideoUserPeriod(bo);
+        return getDataTable(list);
+    }
+
+    @ApiOperation("查询档案报名列表")
+    @PreAuthorize("@ss.hasPermi('grade:user:list')")
+    @GetMapping("/listBKUserPeriod")
+    public TableDataInfo<ClassPeriodStudentVo> listBKUserPeriod(ClassGradeUserQueryBo bo) {
+        startPage();
+        List<ClassPeriodStudentVo> list = iClassGradeUserService.listBKUserPeriod(bo);
+        return getDataTable(list);
+    }
+
+    @ApiOperation("查询档案直播列表")
+    @PreAuthorize("@ss.hasPermi('grade:student:list')")
+    @GetMapping("/listUserLive")
+    public TableDataInfo<ExamStudyRecordVo> listUserLive(UserQueryBo bo) {
+        startPage();
+        List<ExamStudyRecordVo> list = iUserStudyRecordService.querDangAnLiveStudy(bo);
+        return getDataTable(list);
+    }
+
+    @ApiOperation("查询档案资料列表")
+    @PreAuthorize("@ss.hasPermi('grade:student:list')")
+    @GetMapping("/listUserHandouts")
+    public TableDataInfo<ExamStudyRecordVo> listUserHandouts(UserQueryBo bo) {
+        startPage();
+        List<ExamStudyRecordVo> list = iUserStudyRecordService.querDangAnHandoutsStudy(bo);
+        return getDataTable(list);
+    }
+
+}

+ 9 - 0
zhongzheng-admin/src/main/java/com/zhongzheng/controller/user/UserController.java

@@ -222,4 +222,13 @@ public class UserController extends BaseController {
     public AjaxResult<Void> updatePwd(@RequestBody UserAppUpdatePwdBo bo) {
         return toAjax(iUserService.updatePwdByClient(bo)? 1 : 0);
     }
+
+    @ApiOperation("查询档案列表")
+    @PreAuthorize("@ss.hasPermi('app:user:list')")
+    @GetMapping("/dangAnList")
+    public TableDataInfo<UserVo> dangAnList(UserQueryBo bo) {
+        startPage();
+        List<UserVo> list = iUserService.dangAnList(bo);
+        return getDataTable(list);
+    }
 }

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

@@ -172,6 +172,8 @@ oldOrder:
 oldSys:
     host: http://gdxypx.xy.com
     goods: http://gdxypx.xy.com/WitSystem/BussinessApi/NewYxtLogin
+    question: http://192.168.1.121:8057/WordData/GetMeasureList
+    questionDetail: http://192.168.1.121:8057/WordData/GetTopicList
 
 invoice:
     host: http://192.168.1.222:7077/sys/common/openMplatform/log
@@ -188,6 +190,8 @@ exam:
     subscribeSaveExam: http://192.168.1.7:9099/cd/subscribe/save/exam
     subscribeUpdateExam: http://192.168.1.7:9099/cd/subscribe/update/exam
     subscribeAddExamNum: http://192.168.1.7:9099/cd/subscribe/add/num
+    question: http://120.79.166.78:19013/common/question/getMeasureList
+    questionDetail: http://120.79.166.78:19013/common/question/getTopicList
 
 shared:
     statistics: http://gdxypx.xy.com/WitSystem/BussinessApi/HighSeasData

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

@@ -174,6 +174,8 @@ oldOrder:
 oldSys:
     host: http://gdxypx.xy.com
     goods: http://gdxypx.xy.com/System/BussinessApi/NewYxtLogin
+    question: http://192.168.1.121:8057/WordData/GetMeasureList
+    questionDetail: http://192.168.1.121:8057/WordData/GetTopicList
 
 invoice:
     host: http://192.168.1.222:7077/sys/common/openMplatform/log
@@ -190,6 +192,8 @@ exam:
     subscribeSaveExam: http://192.168.1.7:9099/cd/subscribe/save/exam
     subscribeUpdateExam: http://192.168.1.7:9099/cd/subscribe/update/exam
     subscribeAddExamNum: http://192.168.1.7:9099/cd/subscribe/add/num
+    question: http://120.79.166.78:19013/common/question/getMeasureList
+    questionDetail: http://120.79.166.78:19013/common/question/getTopicList
 
 shared:
     statistics: http://gdxypx.xy.com/WitSystem/BussinessApi/HighSeasData

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

@@ -152,6 +152,8 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
                 .antMatchers("/common/create/tenant/admin").anonymous()
                 .antMatchers("/common/create/tenant/admin/old").anonymous()
                 .antMatchers("/common/update/role").anonymous()
+                .antMatchers("/common/question/import").anonymous()
+                .antMatchers("/common/question/*").anonymous()
                 .antMatchers("/common/free/**").anonymous()
                 .antMatchers("/common/download**").anonymous()
                 .antMatchers("/common/download/resource**").anonymous()

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

@@ -235,6 +235,12 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
         return list;
     }
 
+    @Override
+    public List<UserVo> dangAnList(UserQueryBo bo) {
+        List<User> list = baseMapper.dangAnList(bo);
+        return entity2UserVo(list);
+    }
+
     @Override
     public List<UserStatstVo> statsList(UserQueryBo bo) {
         List<UserStatstVo> list = new ArrayList<>();
@@ -1749,7 +1755,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
                 share = sysTenant.getShareClass();
             }
         }
-        
+
         if(Validator.isEmpty(user)){
             iUserLoginErrorService.saveErrorLog(bo.getAccount());
             //判断旧系统是否有账号

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

@@ -109,5 +109,9 @@ public interface IQuestionService extends IService<Question> {
 
 	Long insertByAddBoImportBackId(QuestionAddBo bo, Integer no);
 
-    void questionImport(String param);
+    void questionImport();
+
+	String getMeasureList();
+
+	String getTopicList(String topParam);
 }

+ 603 - 17
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/impl/QuestionServiceImpl.java

@@ -6,10 +6,12 @@ import cn.hutool.core.util.StrUtil;
 import cn.hutool.http.HttpStatus;
 import com.alibaba.fastjson.JSON;
 
+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.StringUtils;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.github.pagehelper.Page;
@@ -17,37 +19,32 @@ import com.github.pagehelper.PageInfo;
 import com.zhongzheng.common.core.page.TableDataInfo;
 import com.zhongzheng.common.core.redis.RedisCache;
 import com.zhongzheng.common.exception.CustomException;
+import com.zhongzheng.common.type.EncryptHandler;
 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.alioss.service.OssService;
 import com.zhongzheng.modules.bank.bo.*;
-import com.zhongzheng.modules.bank.domain.Exam;
-import com.zhongzheng.modules.bank.domain.ExamQuestion;
-import com.zhongzheng.modules.bank.domain.Question;
-import com.zhongzheng.modules.bank.domain.QuestionBusiness;
+import com.zhongzheng.modules.bank.domain.*;
 import com.zhongzheng.modules.bank.mapper.QuestionMapper;
-import com.zhongzheng.modules.bank.service.IExamQuestionService;
-import com.zhongzheng.modules.bank.service.IExamService;
-import com.zhongzheng.modules.bank.service.IQuestionBusinessService;
-import com.zhongzheng.modules.bank.service.IQuestionService;
+import com.zhongzheng.modules.bank.service.*;
 import com.zhongzheng.modules.bank.vo.*;
-import com.zhongzheng.modules.course.domain.CourseBusiness;
-import com.zhongzheng.modules.course.domain.CourseEducationType;
-import com.zhongzheng.modules.course.domain.CourseProjectType;
-import com.zhongzheng.modules.course.domain.CourseSubject;
-import com.zhongzheng.modules.course.service.ICourseBusinessService;
-import com.zhongzheng.modules.course.service.ICourseEducationTypeService;
-import com.zhongzheng.modules.course.service.ICourseProjectTypeService;
-import com.zhongzheng.modules.course.service.ICourseSubjectService;
+import com.zhongzheng.modules.course.domain.*;
+import com.zhongzheng.modules.course.service.*;
 import com.zhongzheng.modules.exam.bo.ExamKnowledgeAddBo;
 import com.zhongzheng.modules.exam.bo.ExamKnowledgeBusinessAddBo;
 import com.zhongzheng.modules.exam.domain.ExamKnowledge;
+import com.zhongzheng.modules.exam.domain.ExamPaper;
+import com.zhongzheng.modules.exam.service.IExamApplyService;
 import com.zhongzheng.modules.exam.service.IExamKnowledgeService;
+import com.zhongzheng.modules.exam.service.IExamPaperService;
 import com.zhongzheng.modules.goods.bo.*;
 import com.zhongzheng.modules.goods.domain.Goods;
+import com.zhongzheng.modules.goods.domain.GoodsAttached;
 import com.zhongzheng.modules.goods.domain.GoodsExamTime;
+import com.zhongzheng.modules.goods.service.IGoodsAttachedService;
 import com.zhongzheng.modules.goods.service.IGoodsExamTimeService;
 import com.zhongzheng.modules.goods.service.IGoodsService;
 import com.zhongzheng.modules.goods.vo.BankGoodsExamVo;
@@ -77,9 +74,12 @@ import org.w3c.dom.NodeList;
 
 import java.io.IOException;
 import java.io.InputStream;
+import java.math.BigDecimal;
 import java.text.NumberFormat;
 import java.util.*;
 import java.util.concurrent.TimeUnit;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
 import java.util.stream.Collectors;
 
 /**
@@ -109,6 +109,9 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
     @Autowired
     private ICourseSubjectService iCourseSubjectService;
 
+    @Autowired
+    private ICourseSubjectProjectService iCourseSubjectProjectService;
+
     @Autowired
     private IExamKnowledgeService iExamKnowledgeService;
 
@@ -127,12 +130,30 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
     @Autowired
     private IUserExamSubscriptionService iUserExamSubscriptionService;
 
+    @Autowired
+    private IQuestionModuleService iQuestionModuleService;
+
+    @Autowired
+    private IQuestionChapterService iQuestionChapterService;
+
+    @Autowired
+    private IQuestionChapterExamService iQuestionChapterExamService;
+
+    @Autowired
+    private IQuestionModuleChapterService iQuestionModuleChapterService;
+
+    @Autowired
+    private IGoodsAttachedService iGoodsAttachedService;
+
     @Autowired
     private IUserService iUserService;
 
     @Autowired
     private IExamService iExamService;
 
+    @Autowired
+    private IExamPaperService iExamPaperService;
+
     @Autowired
     private IGoodsService iGoodsService;
 
@@ -142,9 +163,30 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
     @Autowired
     private OssService ossService;
 
+    @Autowired
+    private IMajorService iMajorService;
+
+    @Autowired
+    private IMajorProjectService iMajorProjectService;
+
     @Value("${aliyun.oss.endpoint}")
     private String ossHost;
 
+    @Value("${oldSys.question}")
+    private String QUESTION;
+
+    @Value("${oldSys.questionDetail}")
+    private String QUESTION_DETAIL;
+
+    @Value("${exam.question}")
+    private String EXAM_QUESTION;
+
+    @Value("${exam.questionDetail}")
+    private String EXAM_QUESTION_DETAIL;
+
+    @Value("${aliyun.oss.endpoint}")
+    private String OSS_PREFIX;
+
 
     @Override
     public QuestionVo queryById(Long questionId) {
@@ -3090,10 +3132,554 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
     }
 
     @Override
-    public void questionImport(String param) {
+    @Transactional
+    public void questionImport() {
+        String tenantId = ServletUtils.getRequest().getHeader("TenantId");
+        HashMap<String, String> map = new HashMap<>();
+        map.put("TenantId", tenantId);
+        String respone = HttpUtils.sendPostJsonHeader(EXAM_QUESTION, "",map);
+        List<ExternalQuestionVo> questionVos = JSONArray.parseArray(respone, ExternalQuestionVo.class);
+        //考前培训
+        CourseEducationType educationType = iCourseEducationTypeService
+                .getOne(new LambdaQueryWrapper<CourseEducationType>()
+                .eq(CourseEducationType::getEducationName, "考前培训")
+                .eq(CourseEducationType::getStatus, 1)
+                .last("limit 1"));
+
+        //施工现场人员
+        CourseProjectType projectType = iCourseProjectTypeService
+                .getOne(new LambdaQueryWrapper<CourseProjectType>()
+                .eq(CourseProjectType::getProjectName, "施工现场专业人员")
+                .eq(CourseProjectType::getEducationId, educationType.getId())
+                .eq(CourseProjectType::getStatus, 1)
+                .last("limit 1"));
+
+        //七大员
+        CourseBusiness business = iCourseBusinessService
+                .getOne(new LambdaQueryWrapper<CourseBusiness>()
+                .eq(CourseBusiness::getBusinessName, "七大员")
+                .eq(CourseBusiness::getProjectId, projectType.getId())
+                .eq(CourseBusiness::getStatus, 1)
+                .last("limit 1"));
+
+        //专业
+        List<MajorProject> list = iMajorProjectService
+                .list(new LambdaQueryWrapper<MajorProject>()
+                .eq(MajorProject::getProjectId, projectType.getId()));
+        List<Major> majorList = iMajorService.listByIds(list.stream().map(MajorProject::getMajorId).collect(Collectors.toList()));
+
+        //科目
+        List<CourseSubjectProject> list1 = iCourseSubjectProjectService
+                .list(new LambdaQueryWrapper<CourseSubjectProject>()
+                .eq(CourseSubjectProject::getProjectId, projectType.getId()));
+        List<CourseSubject> subjectList = iCourseSubjectService.listByIds(list1.stream().map(CourseSubjectProject::getSubjectId).collect(Collectors.toList()));
+
+
+        //七大员新考题库商品
+        List<ExternalQuestionVo> collect = questionVos.stream().filter(x -> x.getParentId() == 1)
+                .sorted(Comparator.comparing(ExternalQuestionVo::getSortNumber))
+                .collect(Collectors.toList());
+        for (ExternalQuestionVo item : collect) {
+            //专业顺序
+
+            //劳务员考核评价大纲及习题集
+            //施工员考核评价大纲及习题集(土建方向)
+            //施工员考核评价大纲及习题集(市政方向)
+            //施工员考核评价大纲及习题集(装饰方向)
+            //施工员考核评价大纲及习题集(设备方向)
+            //机械员考核评价大纲及习题集
+            //材料员考核评价大纲及习题集
+            //标准员考核评价大纲及习题集
+            //质量员考核评价大纲及习题集(土建方向)
+            //质量员考核评价大纲及习题集(市政方向)
+            //质量员考核评价大纲及习题集(装饰方向)
+            //质量员考核评价大纲及习题集(设备方向)
+            //资料员考核评价大纲及习题集
+            Major major = majorList.stream().filter(x -> x.getCategoryName().equals(item.getTopicNoteTypeNum())).findFirst().orElse(null);
+            Long majorId = 0L;
+            if (ObjectUtils.isNotNull(major)){
+                majorId = major.getId();
+            }
+
+            //科目
+            CourseSubject courseSubject = subjectList.stream().filter(x -> x.getSubjectName().equals(item.getTopicNoteTypeNum())).findFirst().orElse(null);
+            Long subjectId = 0L;
+            if (ObjectUtils.isNotNull(courseSubject)){
+                subjectId = courseSubject.getId();
+            }
+
+            //创建商品
+            Goods goods = new Goods();
+            goods.setGoodsName(item.getName());
+            goods.setYear(2023L);
+            goods.setSupplyId(2L);
+            goods.setCode(ServletUtils.getEncoded("SP"));
+            goods.setGoodsType(2);
+            goods.setEducationTypeId(educationType.getId());
+            goods.setBusinessId(business.getId());
+            goods.setProjectId(projectType.getId().intValue());
+            goods.setStandPrice(new BigDecimal("150.00"));
+            goods.setLowestPrice(new BigDecimal("150.00"));
+            goods.setCreateTime(DateUtils.getNowTime());
+            goods.setUpdateTime(DateUtils.getNowTime());
+            goods.setStatus(1);
+            goods.setGoodsStatus(0);
+            goods.setMajorId(majorId);
+            goods.setSubjectIds(subjectId.toString());
+            iGoodsService.save(goods);
+
+            String upStr1 = "web/Uploads/qdytopic/";
+            //题库
+            List<ExternalQuestionVo> questionVos1 = questionVos.stream()
+                    .filter(x -> x.getParentId().equals(item.getMeasureModelId())).sorted(Comparator.comparing(ExternalQuestionVo::getSortNumber)).collect(Collectors.toList());
+            if (CollectionUtils.isNotEmpty(questionVos1)){
+                for (ExternalQuestionVo item1 : questionVos1) {
+                    //模块卷
+                    QuestionModule module = new QuestionModule();
+                    module.setCode(ServletUtils.getEncoded("MJ"));
+                    module.setModuleName(item1.getName());
+                    module.setPublishStatus(1L);
+                    module.setStatus(1);
+                    module.setCreateTime(DateUtils.getNowTime());
+                    module.setUpdateTime(DateUtils.getNowTime());
+                    iQuestionModuleService.save(module);
+                    //模块卷业务层
+                    QuestionBusiness questionBusiness = new QuestionBusiness();
+                    questionBusiness.setEducationTypeId(educationType.getId());
+                    questionBusiness.setBusinessId(business.getId());
+                    questionBusiness.setProjectId(projectType.getId());
+                    questionBusiness.setMajorId(module.getModuleExamId());
+                    questionBusiness.setType(4);
+                    questionBusiness.setSubjectId(subjectId);
+                    iQuestionBusinessService.save(questionBusiness);
+                    //题库模块关联
+                    GoodsAttached goodsAttached = new GoodsAttached();
+                    goodsAttached.setGoodsId(goods.getGoodsId());
+                    goodsAttached.setMajorId(module.getModuleExamId());
+                    goodsAttached.setType(1);
+                    goodsAttached.setCreateTime(DateUtils.getNowTime());
+                    goodsAttached.setUpdateTime(DateUtils.getNowTime());
+                    iGoodsAttachedService.save(goodsAttached);
+
+                    //章卷
+                    List<ExternalQuestionVo> questionVos2 = questionVos.stream()
+                            .filter(x -> x.getParentId().equals(item1.getMeasureModelId()))
+                            .sorted(Comparator.comparing(ExternalQuestionVo::getSortNumber)).collect(Collectors.toList());
+                    for (ExternalQuestionVo item2 : questionVos2) {
+                        QuestionChapter questionChapter = new QuestionChapter();
+                        questionChapter.setName(item2.getName());
+                        questionChapter.setStatus(1);
+                        questionChapter.setCreateTime(DateUtils.getNowTime());
+                        questionChapter.setUpdateTime(DateUtils.getNowTime());
+                        questionChapter.setPublishStatus(1L);
+                        questionChapter.setCode(ServletUtils.getEncoded("ZJ"));
+                        iQuestionChapterService.save(questionChapter);
+
+                        //章卷业务
+                        QuestionBusiness questionBusiness1 = new QuestionBusiness();
+                        questionBusiness1.setEducationTypeId(educationType.getId());
+                        questionBusiness1.setBusinessId(business.getId());
+                        questionBusiness1.setProjectId(projectType.getId());
+                        questionBusiness1.setMajorId(questionChapter.getChapterExamId());
+                        questionBusiness1.setType(3);
+                        questionBusiness1.setSubjectId(subjectId);
+                        iQuestionBusinessService.save(questionBusiness1);
+
+                        //模块章卷关联
+                        QuestionModuleChapter moduleChapter = new QuestionModuleChapter();
+                        moduleChapter.setModuleExamId(module.getModuleExamId());
+                        moduleChapter.setChapterExamId(questionChapter.getChapterExamId());
+                        moduleChapter.setSort(item2.getSortNumber().longValue());
+                        iQuestionModuleChapterService.save(moduleChapter);
+
+                        if (ObjectUtils.isNotNull(item2.getIsTopic()) && item2.getIsTopic()){
+                            //获取题目内容
+                            String topParam = String.format("MeasureModelId=%s",item2.getMeasureModelId());
+                            String topRespone = HttpUtils.sendGet(QUESTION_DETAIL, topParam);
+                            List<ExternalQuestionDetailVo> questionDetailVos = JSONArray.parseArray(topRespone, ExternalQuestionDetailVo.class);
+
+                            if (CollectionUtils.isNotEmpty(questionDetailVos)){
+                                //处理图片
+                                handlePhoto(questionDetailVos);
+                                //创建试卷
+                                Exam exam = new Exam();
+                                exam.setCode(ServletUtils.getEncoded("SJ"));
+                                exam.setStatus(1);
+                                exam.setCreateTime(DateUtils.getNowTime());
+                                exam.setUpdateTime(DateUtils.getNowTime());
+                                exam.setExamName(item2.getName() + "测试卷");
+                                exam.setPublishStatus(1L);
+                                exam.setDoType(1);
+                                //试卷类型
+                                ExamPaper paper = iExamPaperService.getOne(new LambdaQueryWrapper<ExamPaper>()
+                                        .eq(ExamPaper::getPaperName, "普通练习")
+                                        .eq(ExamPaper::getStatus, 1)
+                                        .last("limit 1"));
+                                if (ObjectUtils.isNotNull(paper)){
+                                    exam.setExamPaperId(paper.getPaperId());
+                                }
+                                iExamService.save(exam);
+                                //试卷业务
+                                QuestionBusiness questionBusiness2 = new QuestionBusiness();
+                                questionBusiness2.setEducationTypeId(educationType.getId());
+                                questionBusiness2.setBusinessId(business.getId());
+                                questionBusiness2.setProjectId(projectType.getId());
+                                questionBusiness2.setMajorId(exam.getExamId());
+                                questionBusiness2.setType(2);
+                                questionBusiness2.setSubjectId(subjectId);
+                                iQuestionBusinessService.save(questionBusiness2);
+
+                                //章卷关联
+                                QuestionChapterExam chapterExam = new QuestionChapterExam();
+                                chapterExam.setChapterExamId(questionChapter.getChapterExamId());
+                                chapterExam.setExamId(exam.getExamId());
+                                chapterExam.setSort(item2.getSortNumber().longValue());
+                                iQuestionChapterExamService.save(chapterExam);
+                                for (ExternalQuestionDetailVo detailVo : questionDetailVos) {
+                                        switch (detailVo.getTopicType()){
+                                            case 1://单选题
+                                                Question question = new Question();
+                                                question.setContent(detailVo.getTitle());
+                                                question.setType(1);
+                                                question.setStatus(1);
+                                                question.setCreateTime(DateUtils.getNowTime());
+                                                question.setUpdateTime(DateUtils.getNowTime());
+                                                question.setAnalysisContent(detailVo.getDescription());
+                                                question.setPublishStatus(1);
+                                                question.setCode(ServletUtils.getEncoded("TM"));
+                                                question.setCreateBy("(系统)外部题库导入");
+                                                if (CollectionUtils.isNotEmpty(detailVo.getChildList())){
+                                                    List<QuestionDetailVo> detail = new ArrayList<>();
+                                                    Integer index = 0;
+                                                    for (int i = 0; i < detailVo.getChildList().size(); i++) {
+                                                        ExternalQuestionChildVo childVo = detailVo.getChildList().get(i);
+                                                        QuestionDetailVo questionDetailVo = new QuestionDetailVo();
+                                                        if (childVo.getOptionTitle().contains(upStr1)){
+                                                            questionDetailVo.setImgUrl(getImgUrl(childVo.getOptionTitle()));
+                                                            questionDetailVo.setContent("如图所示");
+                                                        }
+                                                        questionDetailVo.setOptionsId(i +1);
+                                                        if (ObjectUtils.isNotNull(childVo.getIsAnswer()) && childVo.getIsAnswer()){
+                                                            index = i + 1;
+                                                        }
+                                                        detail.add(questionDetailVo);
+                                                    }
+                                                    String s = JSONArray.toJSONString(detail);
+                                                    question.setAnswerQuestion(index.toString());
+                                                    question.setJsonStr(s);
+                                                }
+                                                save(question);
+                                                //题目业务
+                                                QuestionBusiness questionBusiness3 = new QuestionBusiness();
+                                                questionBusiness3.setEducationTypeId(educationType.getId());
+                                                questionBusiness3.setBusinessId(business.getId());
+                                                questionBusiness3.setProjectId(projectType.getId());
+                                                questionBusiness3.setMajorId(question.getQuestionId());
+                                                questionBusiness3.setType(1);
+                                                questionBusiness3.setSubjectId(subjectId);
+                                                iQuestionBusinessService.save(questionBusiness3);
+
+                                                //试卷题目关联
+                                                ExamQuestion examQuestion = new ExamQuestion();
+                                                examQuestion.setExamId(exam.getExamId());
+                                                examQuestion.setQuestionId(question.getQuestionId());
+                                                examQuestion.setSort(detailVo.getSortNumber());
+                                                examQuestion.setScore(BigDecimal.ZERO);
+                                                examQuestion.setPartScore(BigDecimal.ZERO);
+                                                iExamQuestionService.save(examQuestion);
+                                                break;
+                                            case 2://多选题
+                                                Question question1 = new Question();
+                                                question1.setContent(detailVo.getTitle());
+                                                question1.setType(2);
+                                                question1.setStatus(1);
+                                                question1.setCreateTime(DateUtils.getNowTime());
+                                                question1.setUpdateTime(DateUtils.getNowTime());
+                                                question1.setAnalysisContent(detailVo.getDescription());
+                                                question1.setPublishStatus(1);
+                                                question1.setCode(ServletUtils.getEncoded("TM"));
+                                                question1.setCreateBy("(系统)外部题库导入");
+                                                if (CollectionUtils.isNotEmpty(detailVo.getChildList())){
+                                                    List<QuestionDetailVo> detail = new ArrayList<>();
+                                                    List<String> index = new ArrayList<>();
+                                                    for (int i = 0; i < detailVo.getChildList().size(); i++) {
+                                                        ExternalQuestionChildVo childVo = detailVo.getChildList().get(i);
+                                                        QuestionDetailVo questionDetailVo = new QuestionDetailVo();
+                                                        if (childVo.getOptionTitle().contains(upStr1)){
+                                                            questionDetailVo.setImgUrl(getImgUrl(childVo.getOptionTitle()));
+                                                            questionDetailVo.setContent("如图所示");
+                                                        }
+                                                        questionDetailVo.setOptionsId(i + 1);
+                                                        if (ObjectUtils.isNotNull(childVo.getIsAnswer()) && childVo.getIsAnswer()){
+                                                            Integer x = i + 1;
+                                                            index.add(x +"");
+                                                        }
+                                                        detail.add(questionDetailVo);
+                                                    }
+                                                    String s = JSONArray.toJSONString(detail);
+                                                    question1.setAnswerQuestion(index.stream().collect(Collectors.joining(",")));
+                                                    question1.setJsonStr(s);
+                                                }
+                                                save(question1);
+                                                //题目业务
+                                                QuestionBusiness questionBusiness4 = new QuestionBusiness();
+                                                questionBusiness4.setEducationTypeId(educationType.getId());
+                                                questionBusiness4.setBusinessId(business.getId());
+                                                questionBusiness4.setProjectId(projectType.getId());
+                                                questionBusiness4.setMajorId(question1.getQuestionId());
+                                                questionBusiness4.setType(1);
+                                                questionBusiness4.setSubjectId(subjectId);
+                                                iQuestionBusinessService.save(questionBusiness4);
+
+                                                //试卷题目关联
+                                                ExamQuestion examQuestion1 = new ExamQuestion();
+                                                examQuestion1.setExamId(exam.getExamId());
+                                                examQuestion1.setQuestionId(question1.getQuestionId());
+                                                examQuestion1.setSort(detailVo.getSortNumber());
+                                                examQuestion1.setScore(BigDecimal.ZERO);
+                                                examQuestion1.setPartScore(BigDecimal.ZERO);
+                                                iExamQuestionService.save(examQuestion1);
+                                                break;
+                                            case 4://判断题
+                                                Question question2 = new Question();
+                                                question2.setContent(detailVo.getTitle());
+                                                question2.setType(3);
+                                                question2.setStatus(1);
+                                                question2.setCreateTime(DateUtils.getNowTime());
+                                                question2.setUpdateTime(DateUtils.getNowTime());
+                                                question2.setAnalysisContent(detailVo.getDescription());
+                                                question2.setPublishStatus(1);
+                                                question2.setCode(ServletUtils.getEncoded("TM"));
+                                                question2.setCreateBy("(系统)外部题库导入");
+                                                if (CollectionUtils.isNotEmpty(detailVo.getChildList())){
+                                                    ExternalQuestionChildVo childVo = detailVo.getChildList().stream().filter(x -> ObjectUtils.isNotNull(x.getIsAnswer()) && x.getIsAnswer()).findFirst().orElse(null);
+                                                    if (ObjectUtils.isNotNull(childVo)){
+                                                        if ("正确".equals(childVo.getOptionTitle())){
+                                                            question2.setAnswerQuestion("1");
+                                                        }else {
+                                                            question2.setAnswerQuestion("0");
+                                                        }
+                                                    }
+                                                }
+                                                save(question2);
+                                                //题目业务
+                                                QuestionBusiness questionBusiness5 = new QuestionBusiness();
+                                                questionBusiness5.setEducationTypeId(educationType.getId());
+                                                questionBusiness5.setBusinessId(business.getId());
+                                                questionBusiness5.setProjectId(projectType.getId());
+                                                questionBusiness5.setMajorId(question2.getQuestionId());
+                                                questionBusiness5.setType(1);
+                                                questionBusiness5.setSubjectId(subjectId);
+                                                iQuestionBusinessService.save(questionBusiness5);
+
+                                                //试卷题目关联
+                                                ExamQuestion examQuestion2 = new ExamQuestion();
+                                                examQuestion2.setExamId(exam.getExamId());
+                                                examQuestion2.setQuestionId(question2.getQuestionId());
+                                                examQuestion2.setSort(detailVo.getSortNumber());
+                                                examQuestion2.setScore(BigDecimal.ZERO);
+                                                examQuestion2.setPartScore(BigDecimal.ZERO);
+                                                iExamQuestionService.save(examQuestion2);
+                                                break;
+                                            case 5://案例题
+                                                Question question3 = new Question();
+                                                question3.setContent(detailVo.getTitle());
+                                                question3.setType(4);
+                                                question3.setStatus(1);
+                                                question3.setCreateTime(DateUtils.getNowTime());
+                                                question3.setUpdateTime(DateUtils.getNowTime());
+                                                question3.setPublishStatus(1);
+                                                question3.setCode(ServletUtils.getEncoded("TM"));
+                                                question3.setCreateBy("(系统)外部题库导入");
+                                                if (CollectionUtils.isNotEmpty(detailVo.getChildTopicLict())){
+                                                    List<QuestionInfoVo> infoVoList = new ArrayList<>();
+                                                    for (ExternalQuestionChildTopicVo topicVo : detailVo.getChildTopicLict()) {
+                                                        switch (topicVo.getTopicType()){
+                                                            case 1://单选
+                                                                QuestionInfoVo infoVo = new QuestionInfoVo();
+                                                                infoVo.setContent(topicVo.getTitle());
+                                                                infoVo.setAnalysisContent(topicVo.getDescription());
+                                                                infoVo.setType(1);
+                                                                if (CollectionUtils.isNotEmpty(topicVo.getChildList())){
+                                                                    List<QuestionDetailVo> voList = new ArrayList<>();
+                                                                    Integer index = 0;
+                                                                    for (int i = 0; i < topicVo.getChildList().size(); i++) {
+                                                                        ExternalQuestionChildVo childVo = topicVo.getChildList().get(i);
+                                                                        QuestionDetailVo detailVo1 = new QuestionDetailVo();
+                                                                        detailVo1.setOptionsId(i + 1);
+                                                                        if (childVo.getOptionTitle().contains(upStr1)){
+                                                                            detailVo1.setImgUrl(getImgUrl(childVo.getOptionTitle()));
+                                                                            detailVo1.setContent("如图所示");
+                                                                        }
+                                                                        if (ObjectUtils.isNotNull(childVo.getIsAnswer()) && childVo.getIsAnswer()){
+                                                                            index = i + 1;
+                                                                        }
+                                                                        voList.add(detailVo1);
+                                                                    }
+                                                                    infoVo.setAnswerQuestion(index.toString());
+                                                                    infoVo.setOptionsList(voList);
+                                                                }
+                                                                infoVoList.add(infoVo);
+                                                                break;
+                                                            case 2://多选
+                                                                QuestionInfoVo infoVo1 = new QuestionInfoVo();
+                                                                infoVo1.setContent(topicVo.getTitle());
+                                                                infoVo1.setAnalysisContent(topicVo.getDescription());
+                                                                infoVo1.setType(2);
+                                                                if (CollectionUtils.isNotEmpty(topicVo.getChildList())){
+                                                                    List<QuestionDetailVo> voList = new ArrayList<>();
+                                                                    List<String> indexList = new ArrayList<>();
+                                                                    for (int i = 0; i < topicVo.getChildList().size(); i++) {
+                                                                        ExternalQuestionChildVo childVo = topicVo.getChildList().get(i);
+                                                                        QuestionDetailVo detailVo1 = new QuestionDetailVo();
+                                                                        detailVo1.setOptionsId(i + 1);
+                                                                        if (childVo.getOptionTitle().contains(upStr1)){
+                                                                            detailVo1.setImgUrl(getImgUrl(childVo.getOptionTitle()));
+                                                                            detailVo1.setContent("如图所示");
+                                                                        }
+                                                                        if (ObjectUtils.isNotNull(childVo.getIsAnswer()) && childVo.getIsAnswer()){
+                                                                            Integer x = i + 1 ;
+                                                                            indexList.add(x+"");
+                                                                        }
+                                                                        voList.add(detailVo1);
+                                                                    }
+                                                                    infoVo1.setAnswerQuestion(indexList.stream().collect(Collectors.joining(",")));
+                                                                    infoVo1.setOptionsList(voList);
+                                                                }
+                                                                infoVoList.add(infoVo1);
+                                                                break;
+                                                            case 4://判断题
+                                                                QuestionInfoVo infoVo2 = new QuestionInfoVo();
+                                                                infoVo2.setContent(topicVo.getTitle());
+                                                                infoVo2.setAnalysisContent(topicVo.getDescription());
+                                                                infoVo2.setType(3);
+                                                                if (CollectionUtils.isNotEmpty(topicVo.getChildList())){
+                                                                    ExternalQuestionChildVo childVo = topicVo.getChildList().stream().filter(x -> ObjectUtils.isNotNull(x.getIsAnswer()) && x.getIsAnswer()).findFirst().orElse(null);
+                                                                    if (ObjectUtils.isNotNull(childVo)){
+                                                                        if ("正确".equals(childVo.getOptionTitle())){
+                                                                            infoVo2.setAnswerQuestion("1");
+                                                                        }else {
+                                                                            infoVo2.setAnswerQuestion("0");
+                                                                        }
+                                                                    }
+                                                                }
+                                                                infoVoList.add(infoVo2);
+                                                                break;
+                                                        }
+
+                                                    }
+                                                    question3.setJsonStr(JSONArray.toJSONString(infoVoList));
+                                                }
+                                                save(question3);
+                                                //题目业务
+                                                QuestionBusiness questionBusiness6 = new QuestionBusiness();
+                                                questionBusiness6.setEducationTypeId(educationType.getId());
+                                                questionBusiness6.setBusinessId(business.getId());
+                                                questionBusiness6.setProjectId(projectType.getId());
+                                                questionBusiness6.setMajorId(question3.getQuestionId());
+                                                questionBusiness6.setType(1);
+                                                questionBusiness6.setSubjectId(subjectId);
+                                                iQuestionBusinessService.save(questionBusiness6);
+
+                                                //试卷题目关联
+                                                ExamQuestion examQuestion3 = new ExamQuestion();
+                                                examQuestion3.setExamId(exam.getExamId());
+                                                examQuestion3.setQuestionId(question3.getQuestionId());
+                                                examQuestion3.setSort(detailVo.getSortNumber());
+                                                examQuestion3.setScore(BigDecimal.ZERO);
+                                                examQuestion3.setPartScore(BigDecimal.ZERO);
+                                                iExamQuestionService.save(examQuestion3);
+                                                break;
+                                        }
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+        }
+    }
+
+    @Override
+    public String getMeasureList() {
+        return HttpUtils.sendGet(QUESTION, "");
+    }
 
+    @Override
+    public String getTopicList(String topParam) {
+        return HttpUtils.sendGet(QUESTION_DETAIL, topParam);
     }
 
+    private void handlePhoto(List<ExternalQuestionDetailVo> questionDetailVos) {
+        String prefix = "\\Uploads\\qdytopic\\";
+        String upStr = OSS_PREFIX + "/web/Uploads/qdytopic/";
+        String upStr1 = "web/Uploads/qdytopic/";
+        for (ExternalQuestionDetailVo detailVo : questionDetailVos) {
+            if (StringUtils.isNotBlank(detailVo.getTitle()) && detailVo.getTitle().contains(prefix)){
+                String title = detailVo.getTitle();
+                String replace = title.replace(prefix, upStr);
+                detailVo.setTitle(replace);
+            }
+
+            if (StringUtils.isNotBlank(detailVo.getDescription()) && detailVo.getDescription().contains(prefix)){
+                String description = detailVo.getDescription();
+                String replace = description.replace(prefix, upStr);
+                detailVo.setDescription(replace);
+            }
+
+            if (CollectionUtils.isNotEmpty(detailVo.getChildList())){
+                List<ExternalQuestionChildVo> childList = detailVo.getChildList();
+                for (ExternalQuestionChildVo childVo : childList) {
+                    if (StringUtils.isNotBlank(childVo.getOptionTitle()) && childVo.getOptionTitle().contains(prefix)){
+                        String optionTitle = childVo.getOptionTitle();
+                        String replace = optionTitle.replace(prefix, upStr1);
+                        childVo.setOptionTitle(replace);
+                    }
+                }
+            }
+
+            if (CollectionUtils.isNotEmpty(detailVo.getChildTopicLict())){
+                List<ExternalQuestionChildTopicVo> childTopicLict = detailVo.getChildTopicLict();
+                for (ExternalQuestionChildTopicVo childTopicVo : childTopicLict) {
+                    if (StringUtils.isNotBlank(childTopicVo.getTitle()) && childTopicVo.getTitle().contains(prefix)){
+                        String optionTitle = childTopicVo.getTitle();
+                        String replace = optionTitle.replace(prefix, upStr);
+                        childTopicVo.setTitle(replace);
+                    }
+
+                    if (StringUtils.isNotBlank(childTopicVo.getDescription()) && childTopicVo.getDescription().contains(prefix)){
+                        String description = childTopicVo.getDescription();
+                        String replace = description.replace(prefix, upStr);
+                        childTopicVo.setDescription(replace);
+                    }
+
+                    if (CollectionUtils.isNotEmpty(childTopicVo.getChildList())){
+                        List<ExternalQuestionChildVo> childList = childTopicVo.getChildList();
+                        for (ExternalQuestionChildVo childVo : childList) {
+                            if (StringUtils.isNotBlank(childVo.getOptionTitle()) && childVo.getOptionTitle().contains(prefix)){
+                                String optionTitle = childVo.getOptionTitle();
+                                String replace = optionTitle.replace(prefix, upStr1);
+                                childVo.setOptionTitle(replace);
+                            }
+                        }
+                    }
+                }
+            }
+        }
+
+    }
+
+    private String getImgUrl(String img){
+        Matcher m = Pattern.compile("<img.*?src=\"(.*?)\"").matcher(img);
+        String filePath = "";
+        while(m.find())
+        {
+            filePath = m.group(1);
+        }
+        return filePath;
+    }
+
+
     private boolean checkNameUnique(Question entity) {
         Question info = getOne(new LambdaQueryWrapper<Question>()
                 .eq(Question::getPrefixName, entity.getPrefixName()).eq(Question::getContent, entity.getContent()).ne(Question::getStatus, -1).last("limit 1"));

+ 27 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/vo/ExternalQuestionChildTopicVo.java

@@ -0,0 +1,27 @@
+package com.zhongzheng.modules.bank.vo;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * @author yangdamao
+ * @date 2023年12月06日 16:28
+ */
+@Data
+public class ExternalQuestionChildTopicVo implements Serializable {
+
+    private Long measureId;
+
+    private String title;
+
+    private Integer topicType;
+
+    private String description;
+
+    private Integer sortNumber;
+
+    private List<ExternalQuestionChildVo> childList;
+
+}

+ 20 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/vo/ExternalQuestionChildVo.java

@@ -0,0 +1,20 @@
+package com.zhongzheng.modules.bank.vo;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @author yangdamao
+ * @date 2023年12月06日 16:28
+ */
+@Data
+public class ExternalQuestionChildVo implements Serializable {
+
+    private Long topicOptionId;
+
+    private String optionTitle;
+
+    private Boolean isAnswer;
+
+}

+ 28 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/vo/ExternalQuestionDetailVo.java

@@ -0,0 +1,28 @@
+package com.zhongzheng.modules.bank.vo;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * @author yangdamao
+ * @date 2023年12月06日 16:28
+ */
+@Data
+public class ExternalQuestionDetailVo implements Serializable {
+
+    private Long topicId;
+
+    private String title;
+
+    private Integer topicType;
+
+    private String description;
+
+    private Integer sortNumber;
+
+    private List<ExternalQuestionChildVo> childList;
+
+    private List<ExternalQuestionChildTopicVo> childTopicLict;
+}

+ 25 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/vo/ExternalQuestionVo.java

@@ -0,0 +1,25 @@
+package com.zhongzheng.modules.bank.vo;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @author yangdamao
+ * @date 2023年12月06日 16:28
+ */
+@Data
+public class ExternalQuestionVo implements Serializable {
+
+    private Long measureModelId;
+
+    private String name;
+
+    private Long parentId;
+
+    private Boolean isTopic;
+
+    private Integer sortNumber;
+
+    private String topicNoteTypeNum;
+}

+ 22 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/vo/QuestionDetailVo.java

@@ -0,0 +1,22 @@
+package com.zhongzheng.modules.bank.vo;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+
+/**
+ * 第三方题库视图对象 mall_package
+ *
+ * @author ruoyi
+ * @date 2023-08-03
+ */
+@Data
+public class QuestionDetailVo implements Serializable {
+
+	private String content;
+
+	private String imgUrl;
+
+	private Integer optionsId;
+}

+ 27 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/vo/QuestionInfoVo.java

@@ -0,0 +1,27 @@
+package com.zhongzheng.modules.bank.vo;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+
+/**
+ * 第三方题库视图对象 mall_package
+ *
+ * @author ruoyi
+ * @date 2023-08-03
+ */
+@Data
+public class QuestionInfoVo implements Serializable {
+
+	private String analysisContent;
+
+	private String answerQuestion;
+
+	private String content;
+
+	private Integer type;
+
+	private List<QuestionDetailVo> optionsList;
+}

+ 31 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/base/service/impl/UserProfileServiceImpl.java

@@ -501,7 +501,7 @@ public class UserProfileServiceImpl extends ServiceImpl<UserProfileMapper, UserP
         String keyValue = bo.getKeyValue();
         if (Validator.isNotEmpty(keyValue)) {
             Map<String, String> maps = JSONObject.parseObject(keyValue, Map.class);
-            String recent_photos, idcard_face_photo, idcard_national_photo,work_unit,idcard,name,education,apply_post,telphone,sex;
+            String recent_photos, idcard_face_photo, idcard_national_photo,work_unit,idcard,name,education,apply_post,telphone,sex,school,unit_contact,unit_tel,graduation_time,major;
             LambdaUpdateWrapper<User> objectLambdaUpdateWrapper = Wrappers.lambdaUpdate();
             objectLambdaUpdateWrapper.eq(User::getUserId, bo.getUserId());
             UserVo user = iUserService.queryById(bo.getUserId());
@@ -582,6 +582,36 @@ public class UserProfileServiceImpl extends ServiceImpl<UserProfileMapper, UserP
                     objectLambdaUpdateWrapper.set(User::getSex, sex.equals("男")?1:2);
                 }
             }
+            if (maps.containsKey("school")) {
+                school = JSONObject.parseObject(String.valueOf(maps.get("school")), UserProfileFit.class).getValue();
+                if(Validator.isNotEmpty(school)){
+                    objectLambdaUpdateWrapper.set(User::getSchool, school);
+                }
+            }
+            if (maps.containsKey("unit_contact")) {
+                unit_contact = JSONObject.parseObject(String.valueOf(maps.get("unit_contact")), UserProfileFit.class).getValue();
+                if(Validator.isNotEmpty(unit_contact)){
+                    objectLambdaUpdateWrapper.set(User::getUnitContact, unit_contact);
+                }
+            }
+            if (maps.containsKey("unit_tel")) {
+                unit_tel = JSONObject.parseObject(String.valueOf(maps.get("unit_tel")), UserProfileFit.class).getValue();
+                if(Validator.isNotEmpty(unit_tel)){
+                    objectLambdaUpdateWrapper.set(User::getUnitTel, unit_tel);
+                }
+            }
+            if (maps.containsKey("graduation_time")) {
+                graduation_time = JSONObject.parseObject(String.valueOf(maps.get("graduation_time")), UserProfileFit.class).getValue();
+                if(Validator.isNotEmpty(graduation_time)){
+                    objectLambdaUpdateWrapper.set(User::getGraduationTime, graduation_time);
+                }
+            }
+            if (maps.containsKey("major")) {
+                major = JSONObject.parseObject(String.valueOf(maps.get("major")), UserProfileFit.class).getValue();
+                if(Validator.isNotEmpty(major)){
+                    objectLambdaUpdateWrapper.set(User::getMajor, major);
+                }
+            }
             objectLambdaUpdateWrapper.set(User::getUpdateTime, DateUtils.getNowTime());
             iUserService.update(null, objectLambdaUpdateWrapper);
         }

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

@@ -893,7 +893,10 @@ public class CourseServiceImpl extends ServiceImpl<CourseMapper, Course> impleme
                     .eq(UserSubscribe::getSubscribeStatus,1)
                     .eq(UserSubscribe::getExamStatus,0)
                     .last("limit 1"));
-            if (ObjectUtils.isNotNull(userSubscribeTwo)){
+
+            String tenantId = ServletUtils.getRequest().getHeader("TenantId");
+            SysTenant tenant = iSysTenantService.getById(Long.valueOf(tenantId));
+            if (ObjectUtils.isNotNull(userSubscribeTwo) && tenant.getExamRoom() != 2){
                 Goods goods = iGoodsService.getById(goodsUserVo.getGoodsId());
                 if (ObjectUtils.isNull(goods.getQuestionGoodsId())){
                     //没有关联题库 是否购买过题库

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

@@ -214,4 +214,7 @@ public class GoodsAddBo {
     /** 1单证书 2多证书 */
     @ApiModelProperty("1单证书 2多证书")
     private Integer moreCertificateStatus;
+    /** 关联题库ids */
+    @ApiModelProperty("关联题库ids")
+    private String questionRelIds;
 }

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

@@ -248,4 +248,7 @@ public class GoodsEditBo {
     /** 1单证书 2多证书 */
     @ApiModelProperty("1单证书 2多证书")
     private Integer moreCertificateStatus;
+    /** 关联题库ids */
+    @ApiModelProperty("关联题库ids")
+    private String questionRelIds;
 }

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

@@ -178,4 +178,6 @@ private static final long serialVersionUID=1L;
     private Long firstChoiceGoods;
     /** 1单证书 2多证书 */
     private Integer moreCertificateStatus;
+    /** 关联题库ids */
+    private String questionRelIds;
 }

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

@@ -398,4 +398,7 @@ public class GoodsVo {
 	@Excel(name = "1单证书 2多证书")
 	@ApiModelProperty("1单证书 2多证书")
 	private Integer moreCertificateStatus;
+	/** 关联题库ids */
+	@ApiModelProperty("关联题库ids")
+	private String questionRelIds;
 }

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

@@ -307,4 +307,7 @@ public class ClassGradeUserQueryBo extends BaseEntity {
 	@ApiModelProperty("1单证书 2多证书")
 	private Integer moreCertificateStatus;
 
+
+
+
 }

+ 28 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/bo/UserSubQueryBo.java

@@ -0,0 +1,28 @@
+package com.zhongzheng.modules.grade.bo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @author yangdamao
+ * @date 2023年12月05日 10:32
+ */
+@Data
+public class UserSubQueryBo implements Serializable {
+
+    /** 分页大小 */
+    @ApiModelProperty("分页大小")
+    private Integer pageSize;
+    /** 当前页数 */
+    @ApiModelProperty("当前页数")
+    private Integer pageNum;
+    /** 排序列 */
+    @ApiModelProperty("排序列")
+    private String orderByColumn;
+    /** 排序的方向desc或者asc */
+    @ApiModelProperty(value = "排序的方向", example = "asc,desc")
+    private String isAsc;
+
+}

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

@@ -102,4 +102,8 @@ public interface ClassGradeUserMapper extends BaseMapper<ClassGradeUser> {
     Long getPeriodEndTime(ClassGradeUserQueryBo bo);
 
     List<ClassGradeUser> getClassInfoByUser(Long userId);
+
+    List<ClassPeriodStudentVo> listVideoUserPeriod(ClassGradeUserQueryBo bo);
+
+    List<ClassPeriodStudentVo> listBKUserPeriod(ClassGradeUserQueryBo bo);
 }

+ 4 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/IClassGradeUserService.java

@@ -142,6 +142,10 @@ public interface IClassGradeUserService extends IService<ClassGradeUser> {
 
     List<ClassGradeUser> getClassInfoByUser(Long userId);
 
+	List<ClassPeriodStudentVo> listVideoUserPeriod(ClassGradeUserQueryBo bo);
+
 	Boolean sevenPushAuthCallBack(SevenPushAuthAddBo bo);
 
+	List<ClassPeriodStudentVo> listBKUserPeriod(ClassGradeUserQueryBo bo);
+
 }

+ 79 - 5
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/impl/ClassGradeUserServiceImpl.java

@@ -1684,6 +1684,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
             exportVo.setStatus(vo.getReportStatus());
             exportVo.setScore(vo.getPerformance());
             exportVo.setRightRate(vo.getRightRate());
+            exportVo.setFromPlat(vo.getFromPlat());
             studyList.add(exportVo);
         }
         userPeriodExportVo.setRecordList(studyList);
@@ -1714,10 +1715,12 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                     exportVo.setStatus(0);
                     exportVo.setDurationTime(classPeriodSectionVo.getDurationTime());
                     exportVo.setSectionType(classPeriodSectionVo.getSectionType());
+                    exportVo.setFromPlat(vo.getFromPlat());
                     studyList.add(exportVo);
                 }
                 endTime = vo.getEndTime();
                 studyList.get(studyIndex).setStudyEndTime(endTime);
+                studyList.get(studyIndex).setVideoCurrentTime(vo.getVideoCurrentTime());
                 if (Validator.isNotEmpty(vo.getStatus()) && vo.getStatus() == 1) {
                     studyList.get(studyIndex).setStatus(1);
                     startTime = null;
@@ -2618,6 +2621,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                             } else {
                                 //章卷
                                 sectionName = classPeriodSectionVo.getTypeName();
+                                classPeriodSectionVo.setExamId(classPeriodSectionVo.getId());
                                 classPeriodSectionVo.setModuleId(classPeriodVo.getId());
                                 classPeriodSectionVo.setChapterId(classPeriodChapterVo.getId());
                                 classPeriodSectionVo.setGoodsId(goodsId);
@@ -2644,7 +2648,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                     recordQueryBo.setGoodsId(goodsId);
                     recordQueryBo.setUserId(classPeriodSectionVo.getUserId());
                     recordQueryBo.setChapterId(classPeriodVo.getId());
-                    recordQueryBo.setModuleId(classPeriodVo.getId());
+                    recordQueryBo.setModuleId(0L);
                     recordQueryBo.setGradeId(gradeId);
                     recordQueryBo.setOrderGoodsId(orderGoodsId);
                     studyList.add(mergeDataV2(i, moduleName, chapterName, sectionName, classPeriodSectionVo, recordQueryBo));
@@ -2654,8 +2658,8 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                     //章卷
                     i++;
                     sectionName = classPeriodSectionVo.getTypeName();
-                    sectionName = classPeriodSectionVo.getTypeName();
-                    classPeriodSectionVo.setModuleId(classPeriodVo.getId());
+                    classPeriodSectionVo.setExamId(classPeriodSectionVo.getId());
+                    classPeriodSectionVo.setModuleId(0L);
                     classPeriodSectionVo.setChapterId(classPeriodVo.getId());
                     classPeriodSectionVo.setGoodsId(goodsId);
                     classPeriodSectionVo.setGradeId(gradeId);
@@ -2747,6 +2751,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                             } else {
                                 //章卷
                                 sectionName = classPeriodSectionVo.getTypeName();
+                                classPeriodSectionVo.setExamId(classPeriodSectionVo.getId());
                                 classPeriodSectionVo.setModuleId(classPeriodVo.getId());
                                 classPeriodSectionVo.setChapterId(classPeriodChapterVo.getId());
                                 classPeriodSectionVo.setGoodsId(goodsId);
@@ -2775,7 +2780,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                     recordQueryBo.setGoodsId(goodsId);
                     recordQueryBo.setUserId(classPeriodSectionVo.getUserId());
                     recordQueryBo.setChapterId(classPeriodVo.getId());
-                    recordQueryBo.setModuleId(classPeriodVo.getId());
+                    recordQueryBo.setModuleId(0L);
                     recordQueryBo.setGradeId(gradeId);
                     recordQueryBo.setOrderGoodsId(orderGoodsId);
                     recordQueryBo.setSearchWeekStartTime(bo.getSearchWeekStartTime());
@@ -2788,7 +2793,8 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                     i++;
                     sectionName = classPeriodSectionVo.getTypeName();
                     sectionName = classPeriodSectionVo.getTypeName();
-                    classPeriodSectionVo.setModuleId(classPeriodVo.getId());
+                    classPeriodSectionVo.setExamId(classPeriodSectionVo.getId());
+                    classPeriodSectionVo.setModuleId(0L);
                     classPeriodSectionVo.setChapterId(classPeriodVo.getId());
                     classPeriodSectionVo.setGoodsId(goodsId);
                     classPeriodSectionVo.setGradeId(gradeId);
@@ -2902,9 +2908,13 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
         Long startTotalTime = 0L;
         Long endTotalTime = 0L;
         Long secTotalTime = 0L;
+        Long moduleTotal = 0L;
+        Long chapterTotal = 0L;
+        Long sectionTotal = 0L;
         for (ClassPeriodVo classPeriodVo : classPeriodVos) {
             //为模块搜索下面的章 和节 并搜索学时记录
             if (classPeriodVo.getType() == 1) {
+                moduleTotal++;
                 CourseModuleVo moduleVo = iCourseModuleService.queryById(classPeriodVo.getId());
                 classPeriodVo.setCommonGradeName(commonGradeName);
                 List<ClassPeriodChapterVo> classPeriodChapterVos = baseMapper.listperiodChapter(classPeriodVo.getId(), bo.getGoodsId(), classPeriodVo.getCourseId(), bo.getUserId(), bo.getGradeId(),bo.getOrderGoodsId());
@@ -2912,6 +2922,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                 classPeriodChapterVos.addAll(baseMapper.listperiodModuleExam(bo.getGoodsId(), classPeriodVo.getCourseId(), bo.getUserId(), classPeriodVo.getId()));
                 for (ClassPeriodChapterVo classPeriodChapterVo : classPeriodChapterVos) {
                     if (classPeriodChapterVo.getType() == 2) {
+                        chapterTotal++;
                         Long ChapterEndTime = 0L;
                         Long ChapterStartTime = 0L;
                         List<ClassPeriodSectionVo> classPeriodSectionVos = baseMapper.listPeriodSection(classPeriodChapterVo.getId(), bo.getGoodsId(), classPeriodVo.getCourseId(), bo.getUserId());
@@ -2919,6 +2930,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                         classPeriodSectionVos.addAll(baseMapper.listperiodExam(classPeriodChapterVo.getId(), bo.getGoodsId(), classPeriodVo.getCourseId(), bo.getUserId(), classPeriodVo.getId()));
                         for (ClassPeriodSectionVo classPeriodSectionVo : classPeriodSectionVos) {
                             if (classPeriodSectionVo.getType() == 3) {
+                                sectionTotal++;
                                 secTotalTime += classPeriodSectionVo.getDurationTime();
                                 //节
                                 UserPeriodQueryBo userPeriodQueryBo = new UserPeriodQueryBo();
@@ -3072,11 +3084,13 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
             }
             //为章搜索节记录和学时记录
             if (classPeriodVo.getType() == 2) {
+                chapterTotal++;
                 Long ChapterEndTime = 0L;
                 Long ChapterStartTime = 0L;
                 List<ClassPeriodSectionVo> classPeriodSectionVos = baseMapper.listPeriodSection(classPeriodVo.getId(), bo.getGoodsId(), classPeriodVo.getCourseId(), bo.getUserId());
                 Collections.sort(classPeriodSectionVos);
                 for (ClassPeriodSectionVo classPeriodSectionVo : classPeriodSectionVos) {
+                    sectionTotal++;
                     secTotalTime += classPeriodSectionVo.getDurationTime();
                     UserPeriodQueryBo userPeriodQueryBo = new UserPeriodQueryBo();
                     userPeriodQueryBo.setSectionId(classPeriodSectionVo.getId());
@@ -3193,6 +3207,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
 
             //为节搜索学时记录
             if (classPeriodVo.getType() == 3) {
+                sectionTotal++;
                 secTotalTime += classPeriodVo.getDurationTime();
                 UserPeriodQueryBo userPeriodQueryBo = new UserPeriodQueryBo();
                 userPeriodQueryBo.setSectionId(classPeriodVo.getId());
@@ -3250,6 +3265,9 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
             classPeriodVos.get(0).setStartTotalTime(startTotalTime);
             classPeriodVos.get(0).setEndTotalTime(endTotalTime);
             classPeriodVos.get(0).setSecTotalTime(secTotalTime);
+            classPeriodVos.get(0).setModuleTotal(moduleTotal);
+            classPeriodVos.get(0).setChapterTotal(chapterTotal);
+            classPeriodVos.get(0).setSectionTotal(sectionTotal);
 
         }
         return classPeriodVos;
@@ -3508,6 +3526,57 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
     }
 
     @Override
+    public List<ClassPeriodStudentVo> listVideoUserPeriod(ClassGradeUserQueryBo bo) {
+        //查询班级学员信息
+        List<ClassPeriodStudentVo> classPeriodStudentVos = baseMapper.listVideoUserPeriod(bo);
+        //查找学员学习记录
+        for (ClassPeriodStudentVo classPeriodStudentVo : classPeriodStudentVos) {
+            Long secLong = 0L;
+            Long studyLong = 0L;
+
+            SubjectStudyRecordQueryBo subjectStudyRecordQueryBo = new SubjectStudyRecordQueryBo();
+            subjectStudyRecordQueryBo.setGoodsId(classPeriodStudentVo.getGoodsId());
+            subjectStudyRecordQueryBo.setUserId(classPeriodStudentVo.getUserId());
+            subjectStudyRecordQueryBo.setGradeId(classPeriodStudentVo.getGradeId());
+            subjectStudyRecordQueryBo.setOrderGoodsId(classPeriodStudentVo.getOrderGoodsId());
+            List<SubjectStudyRecordVo> subjectStudyRecordVos = iUserStudyRecordService.listDangAnSubject(subjectStudyRecordQueryBo);
+            for (SubjectStudyRecordVo subjectStudyRecordVo : subjectStudyRecordVos) {
+                secLong = new BigDecimal(secLong.toString()).add(new BigDecimal(subjectStudyRecordVo.getSectionNum().toString())).longValue();
+                studyLong = new BigDecimal(studyLong.toString()).add(new BigDecimal(subjectStudyRecordVo.getRecordNum().toString())).longValue();
+            }
+            //总节数
+            classPeriodStudentVo.setSecAllNum(secLong);
+            //学习节数
+            classPeriodStudentVo.setStuAllNum(studyLong);
+
+            //总的审核状态按照策划规则
+            ClassGradeUserQueryBo classGradeUserQueryBo = new ClassGradeUserQueryBo();
+            classGradeUserQueryBo.setGradeId(classPeriodStudentVo.getGradeId());
+            classGradeUserQueryBo.setUserId(classPeriodStudentVo.getUserId());
+            classGradeUserQueryBo.setGoodsId(classPeriodStudentVo.getGoodsId());
+            List<ClassPeriodUserVo> classPeriodUserVos1 = baseMapper.listPeriod(classGradeUserQueryBo);
+            ClassPeriodUserVo classPeriodUserVos = classPeriodUserVos1.get(0);
+            classPeriodUserVos.setPending(classPeriodStudentVo.getSecAllNum() - classPeriodUserVos.getPass() - classPeriodUserVos.getCheat());
+            classPeriodUserVos.setExamPending(classPeriodUserVos.getExamNum() - classPeriodUserVos.getExamPass() - classPeriodUserVos.getExamCheat());
+            //當前班級學員審核狀態 -1不可审核 0待審  1未通过 2通过
+            Integer gradePeriodStatus = 0; //班级里的审核状态字段,保持一致 0 未通过 1通过 2待审核 -1 不可审核
+
+            classPeriodStudentVo.setAllStatus(changePeriodStatus(classPeriodStudentVo.getPeriodStatus()));
+
+            classPeriodStudentVo.setWaitRebuildNum(classPeriodUserVos.getCheat() + classPeriodUserVos.getExamCheat());
+            if (!CollectionUtils.isEmpty(baseMapper.selectStart(classPeriodStudentVo.getUserId(), classPeriodStudentVo.getGoodsId(), classPeriodStudentVo.getGradeId(),classPeriodStudentVo.getOrderGoodsId()))) {
+                //查找开始学习时间
+                classPeriodStudentVo.setStartTime(baseMapper.selectStart(classPeriodStudentVo.getUserId(), classPeriodStudentVo.getGoodsId(), classPeriodStudentVo.getGradeId(),classPeriodStudentVo.getOrderGoodsId()).get(0));
+            }else{
+                classPeriodStudentVo.setStartTime(baseMapper.selectStartNoPhoto(classPeriodStudentVo.getUserId(), classPeriodStudentVo.getGoodsId(), classPeriodStudentVo.getGradeId(),classPeriodStudentVo.getOrderGoodsId())
+                );
+            }
+
+        }
+        return classPeriodStudentVos;
+    }
+
+
     public Boolean sevenPushAuthCallBack(SevenPushAuthAddBo bo) {
         if(Validator.isEmpty(bo.getGradeUserId())||Validator.isEmpty(bo.getPushStatus())){
             throw new CustomException("参数缺失");
@@ -3527,6 +3596,11 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
         return this.update(null, objectLambdaUpdateWrapper);
     }
 
+    @Override
+    public List<ClassPeriodStudentVo> listBKUserPeriod(ClassGradeUserQueryBo bo) {
+        return this.baseMapper.listBKUserPeriod(bo);
+    }
+
 
 
 

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

@@ -184,6 +184,9 @@ public class ClassPeriodSectionVo implements Comparable<ClassPeriodSectionVo> {
 	private Long searchWeekEndTime;
 
 	private Long orderGoodsId;
+
+	@ApiModelProperty("试卷ID")
+	private Long examId;
 	@Override
 	public int compareTo(ClassPeriodSectionVo o) {
 		return this.getSort() - o.getSort();

+ 24 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/vo/ClassPeriodStudentVo.java

@@ -239,5 +239,29 @@ public class ClassPeriodStudentVo {
 	private Long cheat;
 	@ApiModelProperty("試卷作弊节")
 	private Long examCheat;
+	/** 业务名称 */
+	@ApiModelProperty("业务名称")
+	private String businessName;
+
+	/** 项目名称 */
+	@ApiModelProperty("项目名称")
+	private String projectName;
+
+
+	/** 项目名称 */
+	@ApiModelProperty("教育名")
+	private String educationName;
+
+	@ApiModelProperty("专业名")
+	private String categoryName;
+
+
 	private String tenantId;
+
+	@ApiModelProperty("创建时间")
+	private Long createTime;
+
+	@ApiModelProperty("商品年份")
+	private String goodsYear;
+
 }

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

@@ -146,4 +146,8 @@ public class ClassPeriodUserVo {
 	@ApiModelProperty("官方班级")
 	private String officialName;
 	private String sevenYear;
+
+	private Integer sex;
+	@ApiModelProperty("1有效 0无效")
+	private Integer gradeStatus;
 }

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

@@ -217,6 +217,9 @@ public class ClassPeriodVo implements Comparable<ClassPeriodVo> {
 	private Integer doType;
 	@ApiModelProperty("公共标识:1公共章 0非公共章")
 	private Integer commonSign;
+	private Long moduleTotal;
+	private Long chapterTotal;
+	private Long sectionTotal;
 	@ApiModelProperty("复制班级名称")
 	private String commonGradeName;
 	@Override

+ 5 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/vo/UserPeriodItemExportVo.java

@@ -43,5 +43,10 @@ public class UserPeriodItemExportVo {
 	@com.zhongzheng.common.annotation.Excel(name = "准确率")
 	@ApiModelProperty("准确率")
 	private BigDecimal rightRate;
+	@ApiModelProperty("来源平台 1小程序 2PC网站 3h5")
+	private Integer fromPlat;
+
+	@ApiModelProperty("视频当前播放时刻")
+	private Long videoCurrentTime;
 
 }

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/mapper/OrderMapper.java

@@ -23,6 +23,8 @@ import java.util.List;
 public interface OrderMapper extends BaseMapper<Order> {
     List<OrderListVo> selectListByBo(OrderQueryBo bo);
 
+    List<OrderListVo> selectDangAnOrderList(OrderQueryBo bo);
+
     Integer selectUserClass(@Param("goodsId") Long goodsId,@Param("userId") Long userId);
 
     List<OrderListVo> selectListApp(OrderQueryBo bo);

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/service/IOrderService.java

@@ -39,6 +39,8 @@ public interface IOrderService extends IService<Order> {
 
 	List<OrderListVo> selectList(OrderQueryBo bo);
 
+	List<OrderListVo> selectDangAnOrderList(OrderQueryBo bo);
+
 	List<OrderListVo> selectRebuyList(OrderQueryBo bo);
 
 	List<OrderUserCheckBuyBo> userCheckBuyList(List<OrderUserCheckBuyBo> list);

+ 8 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/service/impl/OrderGoodsServiceImpl.java

@@ -78,6 +78,8 @@ import com.zhongzheng.modules.order.vo.OrderListVo;
 import com.zhongzheng.modules.order.vo.OrderUserGoodsVo;
 import com.zhongzheng.modules.polyv.bo.PolyvLiveQueryBo;
 import com.zhongzheng.modules.polyv.service.IPolyvLiveService;
+import com.zhongzheng.modules.system.domain.SysTenant;
+import com.zhongzheng.modules.system.service.ISysTenantService;
 import com.zhongzheng.modules.top.goods.bo.TopOldOrderGoodsQuery;
 import com.zhongzheng.modules.top.goods.vo.TopOldOrderGoodsListVo;
 import com.zhongzheng.modules.user.bo.SubjectStudyRecordQueryBo;
@@ -192,6 +194,9 @@ public class OrderGoodsServiceImpl extends ServiceImpl<OrderGoodsMapper, OrderGo
     @Autowired
     private  IProfileTpService iProfileTpService;
 
+    @Autowired
+    private ISysTenantService iSysTenantService;
+
 
 
     @Override
@@ -744,7 +749,9 @@ public class OrderGoodsServiceImpl extends ServiceImpl<OrderGoodsMapper, OrderGo
                         .eq(UserSubscribe::getSubscribeStatus,1)
                         .eq(UserSubscribe::getExamStatus,0)
                         .last("limit 1"));
-                if (ObjectUtils.isNotNull(userSubscribeTwo)){
+                String tenantId = ServletUtils.getRequest().getHeader("TenantId");
+                SysTenant tenant = iSysTenantService.getById(Long.valueOf(tenantId));
+                if (ObjectUtils.isNotNull(userSubscribeTwo) &&  tenant.getExamRoom() != 2){
                     Goods goods = iGoodsService.getById(goodsVo.getGoodsId());
                     if (ObjectUtils.isNull(goods.getQuestionGoodsId())){
                         //没有关联题库 是否购买过题库

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

@@ -280,6 +280,40 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
         return orderListVos;
     }
 
+    @Override
+    public List<OrderListVo> selectDangAnOrderList(OrderQueryBo bo) {
+        if (Validator.isNotEmpty(bo.getOrderGoodsStatus())) {
+            if (bo.getOrderGoodsStatus() == -1) {
+                Integer[] orderStatus = new Integer[]{-2, -1};
+                bo.setOrderStatus(orderStatus);
+            } else if (bo.getOrderGoodsStatus() == 0) {
+                Integer[] orderStatus = new Integer[]{0};
+                bo.setOrderStatus(orderStatus);
+                bo.setGoodsPayStatus(1);
+            } else if (bo.getOrderGoodsStatus() == 1) {
+                //已支付 sql实现
+            } else if (bo.getOrderGoodsStatus() == 2) {
+                bo.setRefundStatus(2);
+            }
+        }
+        List<OrderListVo> orderListVos = this.baseMapper.selectDangAnOrderList(bo);
+        for (OrderListVo vo : orderListVos) {
+            //商品订单状态 -1关闭 0待支付 1已支付 2已退款
+            if (Validator.isEmpty(vo.getRefundStatus())) {
+                vo.setOrderGoodsStatus(-1);
+            } else if (vo.getRefundStatus() == 2) {
+                vo.setOrderGoodsStatus(2);
+            } else if (vo.getOrderStatus() < 0) {
+                vo.setOrderGoodsStatus(-1);
+            } else if (vo.getGoodsPayStatus() == 1) {
+                vo.setOrderGoodsStatus(0);
+            } else if (vo.getGoodsPayStatus() > 1) {
+                vo.setOrderGoodsStatus(1);
+            }
+        }
+        return orderListVos;
+    }
+
     @Override
     public List<OrderListVo> selectRebuyList(OrderQueryBo bo) {
         List<OrderListVo> orderListVos = this.baseMapper.selectRebuyList(bo);
@@ -874,13 +908,42 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
             //开通题库
             questionHandleTwo(orderGoods,goods);
         }else if (ObjectUtils.isNotNull(goods.getQuestionGoodsId())){
+            externalQuestionGoodsHandle(orderGoods,goods);
+        }
+        if (StringUtils.isNotBlank(goods.getQuestionRelIds())){
+            //关联题库商品
             questionGoodsHandle(orderGoods,goods);
         }
+
 //        //商品是否有活动模考
 //        iUserMockSubscribeService.addActivityMock(orderGoods.getGoodsId(),order.getUserId());
     }
 
-    private void questionGoodsHandle(OrderGoods orderGoods,Goods goods) {
+    private void questionGoodsHandle(OrderGoods orderGoods, Goods goods) {
+        List<String> goodsIds = Arrays.stream(goods.getQuestionRelIds().split(",")).collect(Collectors.toList());
+
+        for (String goodsId : goodsIds) {
+            //创建七大员题库商品订单
+            Goods questionGoods = iGoodsService.getById(goodsId);
+            OrderGoods add = new OrderGoods();
+            add.setOrderSn(orderGoods.getOrderSn());
+            add.setGoodsId(questionGoods.getGoodsId());
+            add.setGoodsYear(questionGoods.getYear().toString());
+            add.setGoodsPrice(questionGoods.getStandPrice());
+            add.setGoodsRealPrice(questionGoods.getStandPrice());
+            add.setCreateTime(DateUtils.getNowTime());
+            add.setUpdateTime(DateUtils.getNowTime());
+            add.setStatus(1);
+            add.setGoodsReceived(questionGoods.getStandPrice());
+            add.setRefundStatus(0);
+            add.setPayStatus(3);
+            add.setServiceStartTime(orderGoods.getServiceStartTime());
+            add.setServiceEndTime(orderGoods.getServiceEndTime());
+            iOrderGoodsService.save(add);
+        }
+    }
+
+    private void externalQuestionGoodsHandle(OrderGoods orderGoods,Goods goods) {
         //第三方题库商品
         Goods questionGoods = iGoodsService.getById(goods.getQuestionGoodsId());
         if (ObjectUtils.isNull(questionGoods) || questionGoods.getGoodsType() != 9){
@@ -1264,7 +1327,11 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
         add.setCheckStatus(1);//C端订单不需要审核
         add.setOrderRefundStatus(1);
         add.setInvoiceStatus(0);
-        add.setFinishStatus(type == 1? 1:0);
+        if (ObjectUtils.isNull(add.getPayPrice()) || add.getPayPrice().compareTo(BigDecimal.ZERO) == 0 ){
+            add.setFinishStatus(1);
+        }else {
+            add.setFinishStatus(type == 1? 1:0);
+        }
         add.setCreditStatus(0);
         add.setOrderBase(1);
         add.setOrderRefund(BigDecimal.ZERO);

+ 6 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/vo/OrderListVo.java

@@ -248,4 +248,10 @@ public class OrderListVo {
 
     @ApiModelProperty("审批状态 0 待审核 1初审通过 2复审通过待退款  -1初审不通过 -2复审不通过 3已退款")
     private Integer periodStatus;
+
+    @ApiModelProperty("服务有效期开始")
+    private Long serviceStartTime;
+
+    @ApiModelProperty("服务有效期结束")
+    private Long serviceEndTime;
 }

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

@@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.zhongzheng.common.exception.CustomException;
+import com.zhongzheng.common.type.EncryptHandler;
 import com.zhongzheng.common.utils.DateUtils;
 import com.zhongzheng.modules.bank.domain.*;
 import com.zhongzheng.modules.bank.service.*;

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

@@ -426,13 +426,13 @@ public class TopOldOrderServiceImpl extends ServiceImpl<TopOldOrderMapper, TopOl
                     item.setOrderCost(add);
                 }
                 //学员审核状态
-                int userCount = topOrderGoodsService.count(new LambdaQueryWrapper<TopOldOrderGoods>()
-                        .eq(TopOldOrderGoods::getCheckStatus, 0)
-                        .eq(TopOldOrderGoods::getOrderSn, item.getOrderSn())
-                        .eq(TopOldOrderGoods::getStatus, 1));
-                if (userCount > 0){
-                    item.setUserCheckStatus(0);
-                }
+//                int userCount = topOrderGoodsService.count(new LambdaQueryWrapper<TopOldOrderGoods>()
+//                        .eq(TopOldOrderGoods::getCheckStatus, 0)
+//                        .eq(TopOldOrderGoods::getOrderSn, item.getOrderSn())
+//                        .eq(TopOldOrderGoods::getStatus, 1));
+//                if (userCount > 0){
+//                    item.setUserCheckStatus(0);
+//                }
                 //退款审核角色
                 if (Arrays.asList(0, 2).contains(item.getRefundStatus())) {
                     String refundSn = "";
@@ -465,19 +465,39 @@ public class TopOldOrderServiceImpl extends ServiceImpl<TopOldOrderMapper, TopOl
                     }
                 }
                 //学员审核情况
-                int count = topOrderGoodsService.count(new LambdaQueryWrapper<TopOldOrderGoods>()
+                List<TopOldOrderGoods> list = topOrderGoodsService.list(new LambdaQueryWrapper<TopOldOrderGoods>()
                         .eq(TopOldOrderGoods::getOrderSn, item.getOrderSn())
-                        .eq(TopOldOrderGoods::getCheckStatus, 0)//待审核
+                        .isNotNull(TopOldOrderGoods::getRelSignId)
                         .eq(TopOldOrderGoods::getStatus, 1));
-                if (count > 0) {
-                    item.setStudentCheckStatus(0);
-                } else {
-                    item.setStudentCheckStatus(1);
+                if (CollectionUtils.isNotEmpty(list)){
+                    if (list.stream().anyMatch(x -> x.getCheckStatus() == 0)){
+                        item.setStudentCheckStatus(0);
+                    }else if (list.stream().allMatch(x -> x.getCheckStatus() == 1)){
+                        item.setStudentCheckStatus(1);
+                    }else if (list.stream().allMatch(x -> x.getCheckStatus() == 2)){
+                        item.setStudentCheckStatus(2);
+                    }
                 }
+
                 //订单金额
                 if (ObjectUtils.isNotNull(item.getRepairMoneyTotal())){
                     item.setOrderPrice(item.getOrderPrice().add(item.getRepairMoneyTotal()));
                 }
+                //实际账款:已收金额-税前奖金-退款金额+已付补款金额
+                BigDecimal orderPractical = BigDecimal.ZERO;
+                if (ObjectUtils.isNotNull(item.getOrderReceived())){
+                    orderPractical = orderPractical.add(item.getOrderReceived());
+                }
+                if (ObjectUtils.isNotNull(item.getPretaxBrokerage())){
+                    orderPractical = orderPractical.subtract(item.getPretaxBrokerage());
+                }
+                if (ObjectUtils.isNotNull(item.getOrderRefunded())){
+                    orderPractical = orderPractical.subtract(item.getOrderRefunded());
+                }
+                if (ObjectUtils.isNotNull(item.getRepairMoneyTotal())){
+                    orderPractical = orderPractical.add(item.getRepairMoneyTotal());
+                }
+                item.setOrderPractical(orderPractical);
             });
         }
         return orderVoList;
@@ -1173,7 +1193,6 @@ public class TopOldOrderServiceImpl extends ServiceImpl<TopOldOrderMapper, TopOl
             //旧系统订单
             list = topOrderGoodsService.getListByQuery(query);
             if (CollectionUtils.isNotEmpty(list)) {
-                list = list.stream().filter(x -> x.getCheckStatus() == 0 || x.getCheckStatus() == 1).collect(Collectors.toList());
                 List<TopOldOrderGoods> goodsList = topOrderGoodsService
                         .list(new LambdaQueryWrapper<TopOldOrderGoods>().eq(TopOldOrderGoods::getOrderSn, query.getOrderSn())
                                 .eq(TopOldOrderGoods::getStatus, 1)
@@ -1298,8 +1317,8 @@ public class TopOldOrderServiceImpl extends ServiceImpl<TopOldOrderMapper, TopOl
         //奖金
         TopOldOrder oldOrder = baseMapper.getOrderBySn(query.getOrderSn());
         BigDecimal money = BigDecimal.ZERO;
-        if (ObjectUtils.isNotNull(oldOrder.getPretaxBrokerage())){
-            money = oldOrder.getPretaxBrokerage().divide(new BigDecimal(list.size()));
+        if (ObjectUtils.isNotNull(oldOrder.getPretaxBrokerage()) && CollectionUtils.isNotEmpty(list)){
+            money = oldOrder.getPretaxBrokerage().divide(new BigDecimal(list.size()),2,BigDecimal.ROUND_CEILING);
         }
         //数据处理
         for (TopOldOrderGoodsListVo item : list) {
@@ -1328,6 +1347,9 @@ public class TopOldOrderServiceImpl extends ServiceImpl<TopOldOrderMapper, TopOl
         return list;
     }
 
+    public static void main(String[] args) {
+        System.out.println(EncryptHandler.decrypt("21bac9a89b8500cbad449f1e0644cf4fdcf042e4c2933c31a2a602da0d0f5f77"));
+    }
 
     @Override
     @Transactional(rollbackFor = Exception.class)
@@ -1507,7 +1529,8 @@ public class TopOldOrderServiceImpl extends ServiceImpl<TopOldOrderMapper, TopOl
                 if (!respone.contains("\"Status\":true") && respone.contains("\"ErrorCode\":1081")) {
                     throw new CustomException("业务员正在修改订单,请勿审核!");
                 } else if (!respone.contains("\"Status\":true")) {
-                    throw new CustomException("旧系统订单审核接口请求错误");
+                    JSONObject jsonObject = JSONObject.parseObject(respone);
+                    throw new CustomException(jsonObject.get("ErrorMessage").toString());
                 }
             } catch (IOException e) {
                 log.error("旧系统订单审核接口请求错误" + respone);
@@ -1725,7 +1748,6 @@ public class TopOldOrderServiceImpl extends ServiceImpl<TopOldOrderMapper, TopOl
 
         return true;
     }
-
     @Override
     @Transactional(rollbackFor = Exception.class)
     public boolean orderRefundPay(OrderRefundPayBo bo) {
@@ -1762,7 +1784,7 @@ public class TopOldOrderServiceImpl extends ServiceImpl<TopOldOrderMapper, TopOl
         }
         //退款金额
         BigDecimal refundPrice = orderRefundList.stream().map(TopOldOrderRefundVo::getRefundFee).reduce(BigDecimal.ZERO, BigDecimal::add);
-        if (order.getOrderFrom() == 3 && bo.getPayType() == 2) {
+        if (order.getOrderFrom() == 3 && bo.getPayType() != 1) {
             if (Validator.isEmpty(bo.getToBankAcount()) || Validator.isEmpty(bo.getToBankName()) || Validator.isEmpty(bo.getToBankTypeName())) {
                 throw new CustomException("支付参数错误");
             }
@@ -2218,7 +2240,7 @@ public class TopOldOrderServiceImpl extends ServiceImpl<TopOldOrderMapper, TopOl
             }
             for (TopOldOrderGoods orderGoods : orderGoodsList) {
                 business.add(orderGoods.getBusinessFullName());
-                goodsUpVos.add(getGoodsUp(orderGoods,studyVos));
+                TopOrderGoodsUpVo goodsUp = getGoodsUp(orderGoods, studyVos);
                 //获取修改前的数据
                 List<TopOldOrderGoods> list = topOrderGoodsService.list(new LambdaQueryWrapper<TopOldOrderGoods>()
                         .eq(TopOldOrderGoods::getOrderSn, orderGoods.getOrderSn())
@@ -2228,14 +2250,24 @@ public class TopOldOrderServiceImpl extends ServiceImpl<TopOldOrderMapper, TopOl
                     for (TopOldOrderGoods goods : list) {
                         business.add(orderGoods.getBusinessFullName());
                         goodsUpVos.add(getGoodsUp(goods,studyVos));
+                        if (!goods.getUserName().equals(orderGoods.getUserName())){
+                            goodsUp.setUserNameSign(1);
+                        }
+                        if (!goods.getUserCard().equals(orderGoods.getUserCard())){
+                            goodsUp.setUserCardSign(1);
+                        }
+                        if (!goods.getUserPhone().equals(orderGoods.getUserPhone())){
+                            goodsUp.setUserPhoneSign(1);
+                        }
                     }
                 }
+                goodsUpVos.add(goodsUp);
             }
         }else {
             //底单在新系统
             orderGoodsList.forEach(item -> {
                 business.add(item.getBusinessFullName());
-                goodsUpVos.add(getGoodsUpVo(item,orderVo.getInputOrderSn()));
+                TopOrderGoodsUpVo goodsUpVo = getGoodsUpVo(item, orderVo.getInputOrderSn());
                 //获取修改前的数据
                 List<TopOldOrderGoods> list = topOrderGoodsService.list(new LambdaQueryWrapper<TopOldOrderGoods>()
                         .eq(TopOldOrderGoods::getOrderSn, item.getOrderSn())
@@ -2245,8 +2277,18 @@ public class TopOldOrderServiceImpl extends ServiceImpl<TopOldOrderMapper, TopOl
                     for (TopOldOrderGoods goods : list) {
                         business.add(item.getBusinessFullName());
                         goodsUpVos.add(getGoodsUpVo(goods,orderVo.getInputOrderSn()));
+                        if (!goods.getUserName().equals(item.getUserName())){
+                            goodsUpVo.setUserNameSign(1);
+                        }
+                        if (!goods.getUserCard().equals(item.getUserCard())){
+                            goodsUpVo.setUserCardSign(1);
+                        }
+                        if (!goods.getUserPhone().equals(item.getUserPhone())){
+                            goodsUpVo.setUserPhoneSign(1);
+                        }
                     }
                 }
+                goodsUpVos.add(goodsUpVo);
             });
         }
 
@@ -3811,12 +3853,12 @@ public class TopOldOrderServiceImpl extends ServiceImpl<TopOldOrderMapper, TopOl
             Object data = jsonObject.get("Data");
             if (ObjectUtils.isNotNull(data)){
                 trendVos = JSONArray.parseArray(JSONObject.toJSONString(data),TopConversionRateTrendVo.class);
-                if (bo.getType() != 3){
-                    trendVos.forEach(item -> {
-                        Long aLong = DateUtils.dateTimeSec("yyyy/MM/dd", item.getDate());
-                        item.setDate(DateUtils.timestampToDateFormat(aLong,"yyyy-MM-dd"));
-                    });
-                }
+//                if (bo.getType() != 3){
+//                    trendVos.forEach(item -> {
+//                        Long aLong = DateUtils.dateTimeSec("yyyy/MM/dd", item.getDate());
+//                        item.setDate(DateUtils.timestampToDateFormat(aLong,"yyyy-MM-dd"));
+//                    });
+//                }
             }
         }catch (Exception e){
             e.printStackTrace();
@@ -4543,11 +4585,19 @@ public class TopOldOrderServiceImpl extends ServiceImpl<TopOldOrderMapper, TopOl
         if (CollectionUtils.isEmpty(refunds)) {
             return vo;
         }
+        Integer count = topOrderGoodsService
+                .count(new LambdaQueryWrapper<TopOldOrderGoods>()
+                .eq(TopOldOrderGoods::getOrderSn, orderSn)
+                .eq(TopOldOrderGoods::getCheckStatus, 1)
+                .eq(TopOldOrderGoods::getStatus, 1));
         vo.setOrderId(orderVo.getOrderId());
         vo.setOrderSn(orderVo.getOrderSn());
         vo.setOrderUncollected(orderVo.getOrderUncollected());
         vo.setOrderReceived(orderVo.getOrderReceived());
-        vo.setBrokerage(orderVo.getBrokerage());
+        BigDecimal decimal = orderVo.getPretaxBrokerage();
+        if (ObjectUtils.isNotNull(decimal) && count > 0){
+            decimal = orderVo.getPretaxBrokerage().divide(new BigDecimal(count), 2, RoundingMode.HALF_UP);
+        }
         vo.setInvoiceStatus(orderVo.getInvoiceStatus());
         Map<String, List<TopOldOrderRefundVo>> map = refunds.stream().collect(Collectors.groupingBy(TopOldOrderRefundVo::getRefundSn));
         if (map.keySet().size() > 1) {
@@ -4566,6 +4616,11 @@ public class TopOldOrderServiceImpl extends ServiceImpl<TopOldOrderMapper, TopOl
                         topRefundUserVo.setRealRefundFee(item.getRealRefundFee());
                         topRefundUserVo.setRefundReason(item.getApplyReason());
                         topRefundUserVo.setOrderSn(orderSn);
+                        BigDecimal decimal1 = orderVo.getPretaxBrokerage();
+                        if (ObjectUtils.isNotNull(decimal1) && count > 0){
+                            decimal1 = orderVo.getPretaxBrokerage().divide(new BigDecimal(count), 2, RoundingMode.HALF_UP);
+                            topRefundUserVo.setBrokerage(decimal1);
+                        }
                         if (item.getRefundType() == 1) {
                             //学员信息
                             Order one = orderService.getOne(new LambdaQueryWrapper<Order>().eq(Order::getOrderSn, item.getOrderSn()));
@@ -4600,13 +4655,17 @@ public class TopOldOrderServiceImpl extends ServiceImpl<TopOldOrderMapper, TopOl
             vo.setRefundFee(reduce);
             vo.setRefundReason(refunds.get(0).getApplyReason());
             vo.setApplyTime(refunds.get(0).getCreateTime());
-
             List<TopRefundUserVo> collect = refunds.stream().map(item -> {
                 TopRefundUserVo topRefundUserVo = new TopRefundUserVo();
                 topRefundUserVo.setRefundFee(item.getRefundFee());
                 topRefundUserVo.setRealRefundFee(item.getRealRefundFee());
                 topRefundUserVo.setRefundReason(item.getApplyReason());
                 topRefundUserVo.setOrderSn(orderSn);
+                BigDecimal decimal1 = orderVo.getPretaxBrokerage();
+                if (ObjectUtils.isNotNull(decimal1) && count > 0){
+                    decimal1 = orderVo.getPretaxBrokerage().divide(new BigDecimal(count), 2, RoundingMode.HALF_UP);
+                    topRefundUserVo.setBrokerage(decimal1);
+                }
                 if (item.getRefundType() == 1) {
                     //学员信息
                     Order one = orderService.getOne(new LambdaQueryWrapper<Order>().eq(Order::getOrderSn, item.getOrderSn()));
@@ -4634,6 +4693,8 @@ public class TopOldOrderServiceImpl extends ServiceImpl<TopOldOrderMapper, TopOl
             }).collect(Collectors.toList());
             vo.setRefundUserList(collect);
         }
+        int size = vo.getRefundUserList().size();
+        vo.setBrokerage(decimal.multiply(new BigDecimal(size)));
         // 申请退款审核人
         SysTenant tenant = sysTenantService.getById(orderVo.getTenantId());
         if (orderVo.getOrderFrom() == 1) {
@@ -4799,8 +4860,6 @@ public class TopOldOrderServiceImpl extends ServiceImpl<TopOldOrderMapper, TopOl
             default:
                 break;
         }
-        order.setUpdateTime(DateUtils.getNowTime());
-        updateById(order);
         //消息通知
         informRemindOrderCheck(String.format("【%s】订单审核%s【%s】", bo.getOrderSn(), bo.getCheckResult() == 1 ? "已通过" : "已拒绝", bo.getLoginName()));
         return true;
@@ -5113,7 +5172,16 @@ public class TopOldOrderServiceImpl extends ServiceImpl<TopOldOrderMapper, TopOl
                             }
                             if (order.getCheckStatus() != 1) {
                                 //账款未收完 不能完单
-                                throw new CustomException(String.format("订单未审核不能完单【%s】", orderSn));
+                                throw new CustomException(String.format("订单审核状态未通过,不能完单【%s】", orderSn));
+                            }
+                            if (order.getOrderFrom() == 1) {
+                                //新系统
+                                orderService.update(new LambdaUpdateWrapper<Order>()
+                                        .set(Order::getFinishStatus, bo.getFinishStatus())//未完单
+                                        .set(Order::getDivideStatus,2)//待审核
+                                        .eq(Order::getOrderSn, orderSn)
+                                        .eq(Order::getTenantId, order.getTenantId()));
+                                return;
                             }
                             //成本设置项
                             String costJson = order.getCostJson();
@@ -6363,6 +6431,21 @@ public class TopOldOrderServiceImpl extends ServiceImpl<TopOldOrderMapper, TopOl
             }
             bo.setBadBillList(badBillList);
         }
+        if(Validator.isNotEmpty(bo.getOverPayDay())&&bo.getOverPayDay()>0){
+            bo.setNotPayStatus(1);
+            if(bo.getOverPayDay()==1){
+                bo.setOverPayDayTime(DateUtils.getNowTime()-(7*24*3600));
+            }
+            else if(bo.getOverPayDay()==2){
+                bo.setOverPayDayTime(DateUtils.getNowTime()-(30*24*3600));
+            }
+            else if(bo.getOverPayDay()==3){
+                bo.setOverPayDayTime(DateUtils.getNowTime()-(182*24*3600));
+            }
+            else if(bo.getOverPayDay()==4){
+                bo.setOverPayDayTime(DateUtils.getNowTime()-(365*24*3600));
+            }
+        }
 
         List<TopOldOrderVo> list = this.baseMapper.queryReceiveList(bo);
 
@@ -6588,6 +6671,21 @@ public class TopOldOrderServiceImpl extends ServiceImpl<TopOldOrderMapper, TopOl
         if (Validator.isEmpty(bo.getTotalType())) {
             throw new CustomException("参数缺少");
         }
+        if(Validator.isNotEmpty(bo.getOverPayDay())&&bo.getOverPayDay()>0){
+            bo.setNotPayStatus(1);
+            if(bo.getOverPayDay()==1){
+                bo.setOverPayDayTime(DateUtils.getNowTime()-(7*24*3600));
+            }
+            else if(bo.getOverPayDay()==2){
+                bo.setOverPayDayTime(DateUtils.getNowTime()-(30*24*3600));
+            }
+            else if(bo.getOverPayDay()==3){
+                bo.setOverPayDayTime(DateUtils.getNowTime()-(182*24*3600));
+            }
+            else if(bo.getOverPayDay()==4){
+                bo.setOverPayDayTime(DateUtils.getNowTime()-(365*24*3600));
+            }
+        }
         if (bo.getTotalType() == 1) {
             String badBillJson = topConfigService.selectConfigByKeyNoCache("bad_bill");
             Calendar c = Calendar.getInstance();

+ 1 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/top/goods/vo/TopOldOrderVo.java

@@ -228,7 +228,7 @@ public class TopOldOrderVo {
 	@ApiModelProperty("角色名称")
 	private String roleName;
 
-	@ApiModelProperty("学员审核状态:0待审核,1已审核")
+	@ApiModelProperty("学员审核状态:0待审核,1已审核,2未通过")
 	private Integer studentCheckStatus;
 
 	@ApiModelProperty("退款审核角色名称")

+ 9 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/top/goods/vo/TopOrderGoodsUpVo.java

@@ -27,6 +27,15 @@ public class TopOrderGoodsUpVo implements Serializable {
     @ApiModelProperty("学员手机号")
     private String userPhone;
 
+    @ApiModelProperty("学员姓名修改标识")
+    private Integer userNameSign;
+
+    @ApiModelProperty("学员身份证修改标识")
+    private Integer userCardSign;
+
+    @ApiModelProperty("学员手机号修改标识")
+    private Integer userPhoneSign;
+
     @ApiModelProperty("商品名称")
     private String goodsName;
 

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

@@ -50,4 +50,7 @@ public class TopRefundUserVo {
     @ApiModelProperty("退款单号")
     private String refundSn;
 
+    @ApiModelProperty("奖金")
+    private BigDecimal brokerage;
+
 }

+ 1 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/top/system/service/impl/TopCostCategoryServiceImpl.java

@@ -102,7 +102,7 @@ public class TopCostCategoryServiceImpl extends ServiceImpl<TopCostCategoryMappe
         if(iTopCostTpItemService.count(new LambdaQueryWrapper<TopCostTpItem>()
                 .eq(TopCostTpItem::getItemCategory, entity.getCategoryId())
                 .ne(TopCostTpItem::getStatus, -1))>0){
-            throw new CustomException("该分类已被使用,无法编辑和删除");
+            throw new CustomException("该成本类别已被使用,无法编辑和删除");
         }
         if(Validator.isNotEmpty(entity.getStatus())&&entity.getStatus()==-1){
 

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

@@ -123,4 +123,6 @@ public class UserBankRecordAddBo {
     /** 做题模式 1章卷 2随机练习 */
     @ApiModelProperty("做题模式 1章卷 2随机练习 3模拟随机")
     private Long doMode;
+    @ApiModelProperty("来源平台 1小程序 2PC网站 3h5")
+    private Integer fromPlat;
 }

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

@@ -123,4 +123,6 @@ public class UserBankRecordEditBo {
     /** 模拟做题试卷ID */
     @ApiModelProperty("模拟做题试卷ID")
     private Long simulateExamId;
+    @ApiModelProperty("来源平台 1小程序 2PC网站 3h5")
+    private Integer fromPlat;
 }

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

@@ -94,4 +94,6 @@ public class UserExamRecordAddBo {
     /** 模拟做题试卷ID */
     @ApiModelProperty("模拟做题试卷ID")
     private Long simulateExamId;
+    @ApiModelProperty("来源平台 1小程序 2PC网站 3h5")
+    private Integer fromPlat;
 }

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

@@ -112,4 +112,6 @@ public class UserExamRecordEditBo {
     /** 模拟做题试卷ID */
     @ApiModelProperty("模拟做题试卷ID")
     private Long simulateExamId;
+    @ApiModelProperty("来源平台 1小程序 2PC网站 3h5")
+    private Integer fromPlat;
 }

+ 8 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/bo/UserQueryBo.java

@@ -211,4 +211,12 @@ public class UserQueryBo extends BaseEntity {
 
 	@ApiModelProperty("学员搜索关键字")
 	private String userKerWord;
+
+	@ApiModelProperty("商品名称")
+	private String goodsName;
+
+	private Integer goodsStatus;
+	@ApiModelProperty("教育类型id")
+	private Long educationTypeId;
+
 }

+ 7 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/domain/User.java

@@ -228,4 +228,11 @@ private static final long serialVersionUID=1L;
     /** 题库商家名称 */
     private String questionMerchantName;
 
+    private String unitContact;
+
+    private String unitTel;
+
+    private String school;
+
+    private String graduationTime;
 }

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/domain/UserBankRecord.java

@@ -100,4 +100,6 @@ private static final long serialVersionUID=1L;
     /** 模拟做题试卷ID */
     private Long simulateExamId;
 
+    private Integer fromPlat;
+
 }

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/domain/UserExamRecord.java

@@ -1,6 +1,7 @@
 package com.zhongzheng.modules.user.domain;
 
 import com.baomidou.mybatisplus.annotation.*;
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.NoArgsConstructor;
 import lombok.experimental.Accessors;
@@ -79,4 +80,6 @@ private static final long serialVersionUID=1L;
     private Long doMode;
     /** 模拟做题试卷ID */
     private Long simulateExamId;
+
+    private Integer fromPlat;
 }

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

@@ -35,6 +35,8 @@ public interface UserMapper extends BaseMapper<User> {
 //    @InterceptorIgnore(tenantLine = "true")
     List<User> selectListNoTenant(UserQueryBo bo);
 
+    List<User> dangAnList(UserQueryBo bo);
+
     List<UserStudyRecordVo> selectStudyRecordList(UserStudyRecordQueryBo bo);
 
     Integer selectByRankOneByTime(@Param("hourse") Integer toInt,@Param("startTime") long startTime,@Param("endTime") long endTime);

+ 8 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/mapper/UserStudyRecordMapper.java

@@ -40,6 +40,8 @@ public interface UserStudyRecordMapper extends BaseMapper<UserStudyRecord> {
 
     List<SubjectStudyRecordVo> listSubject(SubjectStudyRecordQueryBo bo);
 
+    List<SubjectStudyRecordVo> listDangAnSubject(SubjectStudyRecordQueryBo bo);
+
     @InterceptorIgnore(tenantLine = "true")
     List<SubjectStudyRecordVo> listSubjectTenant(SubjectStudyRecordQueryBo bo);
 
@@ -51,6 +53,12 @@ public interface UserStudyRecordMapper extends BaseMapper<UserStudyRecord> {
 
     List<ExamStudyRecordVo> querExamStudy(UserQueryBo bo);
 
+    List<ExamStudyRecordVo> querDangAnExamStudy(UserQueryBo bo);
+
+    List<ExamStudyRecordVo> querDangAnLiveStudy(UserQueryBo bo);
+
+    List<ExamStudyRecordVo> querDangAnHandoutsStudy(UserQueryBo bo);
+
     List<ExamSonStudyRecordVo> listExamSon(SubjectStudyRecordQueryBo bo);
 
     List<String> examTypes(Long id);

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/IUserService.java

@@ -35,6 +35,9 @@ public interface IUserService extends IService<User> {
 
 	List<UserVo> selectList(UserQueryBo bo);
 
+
+	List<UserVo> dangAnList(UserQueryBo bo);
+
 	List<UserStatstVo> statsList(UserQueryBo bo);
 
 	List<UserExportVo> selectListExport(UserQueryBo bo);

+ 8 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/IUserStudyRecordService.java

@@ -78,6 +78,8 @@ public interface IUserStudyRecordService extends IService<UserStudyRecord> {
 
 	List<GoodsStudyRecordVo> queryLiveGoods(UserQueryBo bo);
 
+	List<SubjectStudyRecordVo> listDangAnSubject(SubjectStudyRecordQueryBo bo);
+
 	List<SubjectStudyRecordVo> listSubject(SubjectStudyRecordQueryBo bo);
 
 	List<SubjectStudyRecordVo> listSubjectTenant(SubjectStudyRecordQueryBo bo);
@@ -86,6 +88,12 @@ public interface IUserStudyRecordService extends IService<UserStudyRecord> {
 
     List<ExamStudyRecordVo> querExamStudy(UserQueryBo bo);
 
+	List<ExamStudyRecordVo> querDangAnExamStudy(UserQueryBo bo);
+
+	List<ExamStudyRecordVo> querDangAnLiveStudy(UserQueryBo bo);
+
+	List<ExamStudyRecordVo> querDangAnHandoutsStudy(UserQueryBo bo);
+
     List<ExamSonStudyRecordVo> listExamSon(SubjectStudyRecordQueryBo bo);
 
 	SectionStudyRecordVo listExamRecord(SubjectStudyRecordQueryBo bo);

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

@@ -1899,6 +1899,11 @@ public class UserStudyRecordServiceImpl extends ServiceImpl<UserStudyRecordMappe
         return list;
     }
 
+    @Override
+    public List<SubjectStudyRecordVo> listDangAnSubject(SubjectStudyRecordQueryBo bo) {
+        return this.baseMapper.listDangAnSubject(bo);
+    }
+
     @Override
     public List<SubjectStudyRecordVo> listSubject(SubjectStudyRecordQueryBo bo) {
         String tenantId = ServletUtils.getRequest().getHeader("TenantId");
@@ -1951,6 +1956,24 @@ public class UserStudyRecordServiceImpl extends ServiceImpl<UserStudyRecordMappe
         return examStudyRecordVos;
     }
 
+    @Override
+    public List<ExamStudyRecordVo> querDangAnExamStudy(UserQueryBo bo) {
+        List<ExamStudyRecordVo> examStudyRecordVos = baseMapper.querDangAnExamStudy(bo);
+        return examStudyRecordVos;
+    }
+
+    @Override
+    public List<ExamStudyRecordVo> querDangAnLiveStudy(UserQueryBo bo) {
+        List<ExamStudyRecordVo> list = baseMapper.querDangAnLiveStudy(bo);
+        return list;
+    }
+
+    @Override
+    public List<ExamStudyRecordVo> querDangAnHandoutsStudy(UserQueryBo bo) {
+        List<ExamStudyRecordVo> list = baseMapper.querDangAnHandoutsStudy(bo);
+        return list;
+    }
+
     @Override
     public List<ExamSonStudyRecordVo> listExamSon(SubjectStudyRecordQueryBo bo) {
         List<ExamSonStudyRecordVo> examSonStudyRecordVos = baseMapper.listExamSon(bo);

+ 17 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/vo/ExamStudyRecordVo.java

@@ -101,5 +101,21 @@ public class ExamStudyRecordVo {
     @ApiModelProperty("服务有效期结束")
     private Long serviceEndTime;
     private Long orderGoodsId;
-
+    @ApiModelProperty("模块卷数量")
+    private Long moduleExamNum;
+    @ApiModelProperty("章卷数量")
+    private Long chapterExamNum;
+    @ApiModelProperty("专业")
+    private String categoryName;
+
+    @ApiModelProperty("模卷数量")
+    private Long moduleNum;
+    @ApiModelProperty("章数量")
+    private Long chapterNum;
+    @ApiModelProperty("节数量")
+    private Long sectionNum;
+    @ApiModelProperty("状态")
+    private Integer status;
+    @ApiModelProperty("文件数量")
+    private Long fileNum;
 }

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/vo/SectionStudyRecordVo.java

@@ -128,4 +128,7 @@ public class SectionStudyRecordVo {
     private Long examId;
     /** 题卷类型 1章卷 2节卷 3模块卷 */
     private Integer examType;
+    @ApiModelProperty("来源平台 1小程序 2PC网站 3h5")
+    private Integer fromPlat;
+
 }

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/vo/UserBankRecordVo.java

@@ -147,4 +147,6 @@ public class UserBankRecordVo {
 	@Excel(name = "模拟做题试卷ID")
 	@ApiModelProperty("模拟做题试卷ID")
 	private Long simulateExamId;
+	@ApiModelProperty("来源平台 1小程序 2PC网站 3h5")
+	private Integer fromPlat;
 }

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/vo/UserExamRecordVo.java

@@ -147,4 +147,6 @@ public class UserExamRecordVo {
 	@Excel(name = "模拟做题试卷ID")
 	@ApiModelProperty("模拟做题试卷ID")
 	private Long simulateExamId;
+	@ApiModelProperty("来源平台 1小程序 2PC网站 3h5")
+	private Integer fromPlat;
 }

+ 11 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/vo/UserVo.java

@@ -297,6 +297,17 @@ public class UserVo {
 	@ApiModelProperty("教务电话")
 	private String eduPhone;
 
+	@ApiModelProperty("单位联系人")
+	private String unitContact;
+
+	@ApiModelProperty("单位联系电话")
+	private String unitTel;
+
+	@ApiModelProperty("毕业院校")
+	private String school;
+	@ApiModelProperty("毕业时间")
+	private String graduationTime;
+
 	public void setNull(){
 		this.setOpenId(null);
 /*		this.setIdCardImg1(null);

+ 30 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/wx/service/impl/WxPayServiceImpl.java

@@ -536,6 +536,8 @@ public class WxPayServiceImpl implements IWxPayService {
                         distributionRebate(g);
                     }
                     //第三方题库商品
+                    externalQuestionGoodsHandle(g);
+                    //关联题库商品
                     questionGoodsHandle(g);
                 }
                 shareToOldSys(order,goodsList);
@@ -554,6 +556,34 @@ public class WxPayServiceImpl implements IWxPayService {
     }
 
     private void questionGoodsHandle(OrderGoods orderGoods) {
+        Goods goods = iGoodsService.getById(orderGoods.getGoodsId());
+        if (ObjectUtils.isNull(goods.getQuestionRelIds()) || StringUtils.isBlank(goods.getQuestionRelIds())){
+            return;
+        }
+        List<String> goodsIds = Arrays.stream(goods.getQuestionRelIds().split(",")).collect(Collectors.toList());
+
+        for (String goodsId : goodsIds) {
+            //创建七大员题库商品订单
+            Goods questionGoods = iGoodsService.getById(goodsId);
+            OrderGoods add = new OrderGoods();
+            add.setOrderSn(orderGoods.getOrderSn());
+            add.setGoodsId(questionGoods.getGoodsId());
+            add.setGoodsYear(questionGoods.getYear().toString());
+            add.setGoodsPrice(questionGoods.getStandPrice());
+            add.setGoodsRealPrice(questionGoods.getStandPrice());
+            add.setCreateTime(DateUtils.getNowTime());
+            add.setUpdateTime(DateUtils.getNowTime());
+            add.setStatus(1);
+            add.setGoodsReceived(questionGoods.getStandPrice());
+            add.setRefundStatus(0);
+            add.setPayStatus(3);
+            add.setServiceStartTime(orderGoods.getServiceStartTime());
+            add.setServiceEndTime(orderGoods.getServiceEndTime());
+            iOrderGoodsService.save(add);
+        }
+    }
+
+    private void externalQuestionGoodsHandle(OrderGoods orderGoods) {
         Goods goods = iGoodsService.getById(orderGoods.getGoodsId());
         if (ObjectUtils.isNull(goods.getQuestionGoodsId())){
             return;

+ 252 - 0
zhongzheng-system/src/main/resources/mapper/modules/grade/ClassGradeUserMapper.xml

@@ -140,6 +140,13 @@
         <result property="onLineTime" column="on_line_time"/>
         <result property="orderGoodsId" column="order_goods_id"/>
         <result property="sevenYear" column="seven_year"/>
+        <result property="businessName" column="business_name"/>
+        <result property="projectName" column="project_name"/>
+        <result property="educationName" column="education_name"/>
+        <result property="categoryName" column="category_name"/>
+        <result property="goodsYear" column="goods_year"/>
+        <result property="createTime" column="create_time"/>
+        <result property="profileStatus" column="profile_status"/>
     </resultMap>
 
     <resultMap type="com.zhongzheng.modules.grade.vo.ClassPeriodUserVo" id="ClassPeriodUserVo">
@@ -172,6 +179,8 @@
         <result property="classEndTime" column="class_end_time"/>
         <result property="officialName" column="official_name"/>
         <result property="sevenYear" column="seven_year"/>
+        <result property="gradeStatus" column="grade_status"/>
+        <result property="sex" column="sex"/>
     </resultMap>
 
     <resultMap type="com.zhongzheng.modules.grade.vo.ClassPeriodVo" id="ClassPeriodVo">
@@ -867,6 +876,7 @@
         u.id_card,
         u.user_id,
         u.telphone,
+        u.sex,
         g.goods_id,
         g.goods_name,
         cg.class_name,
@@ -874,6 +884,7 @@
         cg.class_start_time,
         cg.class_end_time,
         cg.official_name,
+        cg.status as grade_status,
         g.class_hours,
         u.one_inch_photos,
         u.id_card_img1,
@@ -1775,4 +1786,245 @@
 	            ) > 0
 	            AND cgu.user_id = #{userId}
     </select>
+
+    <select id="listVideoUserPeriod" parameterType="com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo"
+            resultMap="ClassPeriodStudentVo">
+        SELECT
+        u.user_account,
+        u.user_id,
+        cgu.`status`,
+        u.realname,
+        og.goods_id,
+        u.id_card,
+        cgu.grade_id,
+        u.telphone,
+        u.one_inch_photos,
+        g.class_hours as class_hours,
+        g.study_start_time as study_start_time,
+        g.study_end_time as study_end_time,
+        g.goods_name,
+        g.code as goods_code,
+        g.stand_price,
+        g.goods_id,
+        cgu.period_status,
+        cg.class_start_time,
+        cg.class_end_time,
+        cg.class_name,
+        cgu.period_plush,
+        cgu.period_status_num,
+        cgu.period_time,
+        cgu.order_goods_id,
+        IFNULL(ge.exam_num,0) as exam_num,
+        cgu.period_wait_time as end_time,
+        (SELECT og.seven_year FROM order_goods og  where og.order_goods_id = cgu.order_goods_id ) as seven_year,
+        (SELECT og.service_start_time FROM order_goods og  where og.order_goods_id = cgu.order_goods_id ) as service_start_time,
+        (SELECT og.service_end_time FROM order_goods og  where og.order_goods_id = cgu.order_goods_id ) as service_end_time,
+        (SELECT COUNT(DISTINCT ubr.module_id,ubr.chapter_id,ubr.exam_id) FROM user_bank_record ubr  where ubr.`status`=1 and ubr.`type` in (1,3) and ubr.report_status=1 and ubr.order_goods_id = cgu.order_goods_id and ubr.grade_id = cgu.grade_id and ubr.user_id = cgu.user_id and ubr.current_status = 1) as record_num,
+        cet.education_name,
+        cpt.project_name,
+        m.category_name,
+        cb.business_name
+        FROM
+        class_grade_user cgu
+        LEFT JOIN class_grade cg ON cgu.grade_id = cg.grade_id
+        LEFT JOIN order_goods og ON cgu.order_goods_id = og.order_goods_id
+        LEFT JOIN `user` u ON u.user_id = cgu.user_id
+        LEFT JOIN goods g on og.goods_id = g.goods_id
+        LEFT JOIN course_education_type cet ON g.education_type_id = cet.id
+        LEFT JOIN course_project_type cpt ON g.project_id = cpt.id
+        LEFT JOIN course_business cb ON g.business_id = cb.id
+        LEFT JOIN major m ON g.major_id = m.id
+        LEFT JOIN (SELECT
+        COUNT( m.id ) AS exam_num,
+        c.goods_id
+        FROM
+        course_menu_exam m
+        LEFT JOIN goods_course c ON m.course_id = c.course_id
+        where
+        m.type in (1,3)
+        GROUP BY c.goods_id ) ge on og.goods_id = ge.goods_id
+        where 1=1
+        and cgu.`status` =1
+        <if test="periodPlush != null and periodPlush != ''">
+            AND cgu.period_plush = #{periodPlush}
+        </if>
+        <if test="officialStatus != null and officialStatus != ''">
+            AND cgu.official_status = #{officialStatus}
+        </if>
+        <if test="changeGrade != null and changeGrade != ''">
+            AND cgu.change_grade = #{changeGrade}
+        </if>
+        <if test="profileStatus != null and profileStatus != ''">
+            AND up.status = #{profileStatus}
+        </if>
+        <if test="gradeId != null and gradeId !='' ">
+            and cgu.grade_id = #{gradeId}
+        </if>
+        <if test="businessId != null and businessId != ''">
+            AND g.business_id = #{businessId}
+        </if>
+        <if test="projectId != null and projectId != ''">
+            AND g.project_id = #{projectId}
+        </if>
+        <if test="educationTypeId != null and educationTypeId != ''">
+            AND g.education_type_id = #{educationTypeId}
+        </if>
+        <if test="schoolId != null and schoolId != ''">
+            AND g.school_id = #{schoolId}
+        </if>
+        <if test="majorId != null and majorId != ''">
+            AND g.major_id = #{majorId}
+        </if>
+        <if test="periodStatus != null ">
+            and cgu.period_status = #{periodStatus}
+        </if>
+        <if test="classStartTime != null and classStartTime != '' ">
+            AND cg.class_start_time >= #{classStartTime}
+        </if>
+        <if test="classEndTime != null and classEndTime != '' ">
+            AND #{classEndTime} >=  cg.class_end_time
+        </if>
+        <if test="studyStatus != null and studyStatus == 1 ">
+            and cgu.period_status = -1
+        </if>
+        <if test="studyStatus != null and studyStatus == 2 ">
+            and cgu.period_status != -1
+        </if>
+        <if test="className != null and className !='' ">
+            and  cg.class_name like concat('%', #{className}, '%')
+        </if>
+        <if test="searchKey != null and searchKey != '' ">
+            and (u.realname like concat('%', #{searchKey}, '%')
+            or u.id_card like concat('%', #{searchKey,typeHandler=com.zhongzheng.common.type.EncryptHandler}, '%')
+            or g.goods_name like concat('%', #{searchKey}, '%')
+            or cg.class_name like concat('%', #{searchKey}, '%'))
+        </if>
+        <if test="userId != null and userId !='' ">
+            AND cgu.user_id = #{userId}
+        </if>
+        <if test="idCard != null and idCard !='' ">
+            AND u.id_card = #{idCard,typeHandler=com.zhongzheng.common.type.EncryptHandler}
+        </if>
+        <if test="telphone != null and telphone !='' ">
+            AND u.telphone = #{telphone,typeHandler=com.zhongzheng.common.type.EncryptHandler}
+        </if>
+        <if test="searchStartTime != null and searchStartTime != '' ">
+            and (SELECT count(*) FROM user_study_record r where  r.order_goods_id = cgu.order_goods_id AND r.create_time >= #{searchStartTime} )>0
+        </if>
+        <if test="searchEndTime != null and searchEndTime != '' ">
+            and (SELECT count(*) FROM user_study_record r where  r.order_goods_id = cgu.order_goods_id AND #{searchEndTime} >= r.create_time )>0
+        </if>
+        <if test="periodStartTime != null and periodStartTime !='' ">
+            AND cgu.period_time >=#{periodStartTime}
+        </if>
+        <if test="periodEndTime != null and periodEndTime !='' ">
+            AND #{periodEndTime} >= cgu.period_time
+        </if>
+        order by cgu.create_time desc
+    </select>
+
+    <select id="listBKUserPeriod" parameterType="com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo"
+            resultMap="ClassPeriodStudentVo">
+        SELECT
+        g.goods_name,
+        g.create_time,
+        g.year as goods_year,
+        cet.education_name,
+        cpt.project_name,
+        m.category_name,
+        cb.business_name,
+        up.`status` as profile_status
+        FROM
+        class_grade_user cgu
+        LEFT JOIN class_grade cg ON cgu.grade_id = cg.grade_id
+        LEFT JOIN order_goods og ON cgu.order_goods_id = og.order_goods_id
+        LEFT JOIN `user` u ON u.user_id = cgu.user_id
+        LEFT JOIN goods g on og.goods_id = g.goods_id
+        LEFT JOIN course_education_type cet ON g.education_type_id = cet.id
+        LEFT JOIN course_project_type cpt ON g.project_id = cpt.id
+        LEFT JOIN course_business cb ON g.business_id = cb.id
+        LEFT JOIN major m ON g.major_id = m.id
+        LEFT JOIN user_profile up on  cgu.order_goods_id = up.order_goods_id and up.type_status=1 and up.current_status = 1
+        where 1=1
+        and cgu.`status` =1
+        <if test="profileStatus != null and profileStatus != ''">
+            AND up.`status` = #{profileStatus}
+        </if>
+        <if test="periodPlush != null and periodPlush != ''">
+            AND cgu.period_plush = #{periodPlush}
+        </if>
+        <if test="officialStatus != null and officialStatus != ''">
+            AND cgu.official_status = #{officialStatus}
+        </if>
+        <if test="changeGrade != null and changeGrade != ''">
+            AND cgu.change_grade = #{changeGrade}
+        </if>
+        <if test="profileStatus != null and profileStatus != ''">
+            AND up.status = #{profileStatus}
+        </if>
+        <if test="gradeId != null and gradeId !='' ">
+            and cgu.grade_id = #{gradeId}
+        </if>
+        <if test="businessId != null and businessId != ''">
+            AND g.business_id = #{businessId}
+        </if>
+        <if test="projectId != null and projectId != ''">
+            AND g.project_id = #{projectId}
+        </if>
+        <if test="educationTypeId != null and educationTypeId != ''">
+            AND g.education_type_id = #{educationTypeId}
+        </if>
+        <if test="schoolId != null and schoolId != ''">
+            AND g.school_id = #{schoolId}
+        </if>
+        <if test="majorId != null and majorId != ''">
+            AND g.major_id = #{majorId}
+        </if>
+        <if test="periodStatus != null ">
+            and cgu.period_status = #{periodStatus}
+        </if>
+        <if test="classStartTime != null and classStartTime != '' ">
+            AND cg.class_start_time >= #{classStartTime}
+        </if>
+        <if test="classEndTime != null and classEndTime != '' ">
+            AND #{classEndTime} >=  cg.class_end_time
+        </if>
+        <if test="studyStatus != null and studyStatus == 1 ">
+            and cgu.period_status = -1
+        </if>
+        <if test="studyStatus != null and studyStatus == 2 ">
+            and cgu.period_status != -1
+        </if>
+        <if test="className != null and className !='' ">
+            and  cg.class_name like concat('%', #{className}, '%')
+        </if>
+        <if test="searchKey != null and searchKey != '' ">
+            and (u.realname like concat('%', #{searchKey}, '%')
+            or u.id_card like concat('%', #{searchKey,typeHandler=com.zhongzheng.common.type.EncryptHandler}, '%')
+            or g.goods_name like concat('%', #{searchKey}, '%')
+            or cg.class_name like concat('%', #{searchKey}, '%'))
+        </if>
+        <if test="userId != null and userId !='' ">
+            AND u.user_id = #{userId}
+        </if>
+        <if test="idCard != null and idCard !='' ">
+            AND u.id_card = #{idCard,typeHandler=com.zhongzheng.common.type.EncryptHandler}
+        </if>
+        <if test="telphone != null and telphone !='' ">
+            AND u.telphone = #{telphone,typeHandler=com.zhongzheng.common.type.EncryptHandler}
+        </if>
+        <if test="searchStartTime != null and searchStartTime !='' ">
+            AND cgu.create_time >=#{searchStartTime}
+        </if>
+        <if test="searchEndTime != null and searchEndTime !='' ">
+            AND #{searchEndTime} >= cgu.create_time
+        </if>
+        <if test="periodStartTime != null and periodStartTime !='' ">
+            AND cgu.period_time >=#{periodStartTime}
+        </if>
+        <if test="periodEndTime != null and periodEndTime !='' ">
+            AND #{periodEndTime} >= cgu.period_time
+        </if>
+        order by cgu.create_time desc
+    </select>
 </mapper>

+ 102 - 0
zhongzheng-system/src/main/resources/mapper/modules/order/OrderMapper.xml

@@ -76,6 +76,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="goodsPayStatus" column="goods_pay_status"/>
         <result property="goodsType" column="goods_type"/>
         <result property="invoiceStatus" column="invoice_status"/>
+        <result property="serviceStartTime" column="service_start_time"/>
+        <result property="serviceEndTime" column="service_end_time"/>
     </resultMap>
 
     <select id="getGradePeriod" parameterType="Map" resultType="integer">
@@ -200,6 +202,106 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         ORDER BY o.order_id DESC
     </select>
 
+    <select id="selectDangAnOrderList" parameterType="com.zhongzheng.modules.order.bo.OrderQueryBo" resultMap="OrderResultVo">
+        SELECT
+        o.*,
+        g.goods_id,
+        g.goods_name,
+        g.year,
+        g.cover_url,
+        g.code,
+        g.goods_type,
+        og.goods_price,
+        og.rebuy_order_goods_id,
+        og.order_goods_id,
+        og.goods_real_price,
+        u.telphone,
+        u.realname,
+        u.id_card,
+        cet.education_name,
+        cpt.project_name,
+        cb.business_name,
+        og.goods_received,
+        og.refund_status,
+        og.pay_status as goods_pay_status,
+        og.service_start_time,
+        og.service_end_time
+        FROM
+        `order` o
+        LEFT JOIN order_goods og ON o.order_sn = og.order_sn
+        LEFT JOIN goods g ON og.goods_id = g.goods_id
+        LEFT JOIN `user` u ON o.user_id = u.user_id
+        LEFT JOIN course_education_type cet ON g.education_type_id = cet.id
+        LEFT JOIN course_project_type cpt ON g.project_id = cpt.id
+        LEFT JOIN course_business cb ON g.business_id = cb.id
+        WHERE 1=1
+
+        <if test="educationTypeId != null and educationTypeId != ''">
+            AND g.education_type_id = #{educationTypeId}
+        </if>
+        <if test="businessId != null and businessId != ''">
+            AND g.business_id = #{businessId}
+        </if>
+        <if test="orderSn != null and orderSn != ''">
+            AND o.order_sn = #{orderSn}
+        </if>
+        <if test="orderStatus != null ">
+            AND o.order_status in
+            <foreach collection="orderStatus" item="item" index="index" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+        <if test="status != null ">
+            AND o.status in
+            <foreach collection="status" item="item" index="index" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+        <if test="orderGoodsStatus == 1">
+            AND og.pay_status in (2,3,4) AND og.refund_status != 2
+        </if>
+        <if test="startTime != null">
+            AND o.create_time >= #{startTime}
+        </if>
+        <if test="endTime != null">
+            AND #{endTime} >= o.create_time
+        </if>
+        <if test="payStatus != null">
+            AND o.pay_status = #{payStatus}
+        </if>
+        <if test="goodsPayStatus != null">
+            AND og.pay_status = #{goodsPayStatus}
+        </if>
+        <if test="refundStatus != null">
+            AND og.refund_status = #{refundStatus}
+        </if>
+        <if test="goodsType != null">
+            AND g.goods_type = #{goodsType}
+        </if>
+        <if test="userId != null">
+            AND u.user_id = #{userId}
+        </if>
+        <if test="inputOrderSn != null">
+            AND o.input_order_sn = #{inputOrderSn}
+        </if>
+        <if test="searchKey != null and searchKey != ''">
+            AND (u.realname like concat('%', #{searchKey}, '%') or o.order_sn = #{searchKey} or u.id_card = #{searchKey} or g.goods_name like concat('%', #{searchKey}, '%'))
+        </if>
+        <if test="orderGoodsIds != null ">
+            AND og.order_goods_id in
+            <foreach collection="orderGoodsIds" item="item" index="index" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+        <if test="orderFroms != null ">
+            AND o.order_from in
+            <foreach collection="orderFroms" item="item" index="index" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+        ORDER BY o.order_id DESC
+    </select>
+
     <select id="selectRebuyList" parameterType="com.zhongzheng.modules.order.bo.OrderQueryBo" resultMap="OrderResultVo">
         SELECT
         o.*,

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

@@ -83,7 +83,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         WHERE
             order_sn = #{orderSn}
             AND `status` = 1
-            AND check_status != -1
+            AND check_status in (0,1)
 --           AND refund_status != 2
 -- 	      AND pay_status IN (2,3,4)
         <if test="userCard != null and userCard != ''">

+ 11 - 5
zhongzheng-system/src/main/resources/mapper/modules/top/TopOldOrderMapper.xml

@@ -227,10 +227,10 @@
         <if test="checkEndTime != null and checkEndTime != ''">
             AND ot.check_time <![CDATA[ <= ]]> #{checkEndTime}
         </if>
-        <if test="creditStatus != null and creditStatus != '' and creditStatus == 0">
+        <if test="creditStatus != null and creditStatus == 0">
             AND ot.order_received <![CDATA[ < ]]> ot.pay_price
         </if>
-        <if test="creditStatus != null and creditStatus != '' and creditStatus == 1">
+        <if test="creditStatus != null and creditStatus == 1">
             AND ot.pay_price = ot.order_received
         </if>
         <if test="invoiceStatus != null and invoiceStatus != ''">
@@ -328,10 +328,10 @@
         <if test="checkEndTime != null and checkEndTime != ''">
             AND o.pay_time <![CDATA[ <= ]]> #{checkEndTime}
         </if>
-        <if test="creditStatus != null and creditStatus != '' and creditStatus == 0">
+        <if test="creditStatus != null and creditStatus == 0">
             AND o.order_received <![CDATA[ < ]]> o.pay_price
         </if>
-        <if test="creditStatus != null and creditStatus != '' and creditStatus == 1">
+        <if test="creditStatus != null and creditStatus == 1">
             AND o.pay_price = o.order_received
         </if>
         <if test="repairSign != null and repairSign != '' and repairSign == 1">
@@ -434,7 +434,7 @@
             AND too.buy_time <![CDATA[ <= ]]> #{endTime}
         </if>
         <if test="keyNo != null and keyNo != ''">
-            AND (st.tenant_name like concat('%', #{keyNo}, '%') or too.create_no like concat('%', #{keyNo}, '%'))
+            AND (st.tenant_name like concat('%', #{keyNo}, '%') or too.create_no like concat('%', #{keyNo}, '%') or too.create_username like concat('%', #{keyNo}, '%'))
         </if>
         <if test="creditStatus != null and creditStatus != ''">
             AND too.credit_status = #{creditStatus}
@@ -442,6 +442,9 @@
         <if test="orderSn != null and orderSn != ''">
             AND too.order_sn = #{orderSn}
         </if>
+        <if test="overPayDayTime != null and overPayDayTime != ''">
+            AND #{overPayDayTime} >= too.predict_receive_time
+        </if>
         <if test="badBill != null and badBill == 1 and badBillList != null and badBillList.size()!=0 ">
             AND
             <foreach collection="badBillList" item="item" index="index" open="(" close=")" separator="or">
@@ -495,6 +498,9 @@
         <if test="orderSn != null and orderSn != ''">
             AND too.order_sn = #{orderSn}
         </if>
+        <if test="overPayDayTime != null and overPayDayTime != ''">
+            AND #{overPayDayTime} >= too.predict_receive_time
+        </if>
         <if test="badBill != null and badBill == 1 and badBillList != null and badBillList.size()!=0 ">
             AND
             <foreach collection="badBillList" item="item" index="index" open="(" close=")" separator="or">

+ 2 - 0
zhongzheng-system/src/main/resources/mapper/modules/user/UserBankRecordMapper.xml

@@ -26,6 +26,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="rightRate" column="right_rate"/>
         <result property="doMode" column="do_mode"/>
         <result property="simulateExamId" column="simulate_exam_id"/>
+        <result property="fromPlat" column="from_plat"/>
     </resultMap>
 
 
@@ -51,6 +52,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="rightRate" column="right_rate"/>
         <result property="doMode" column="do_mode"/>
         <result property="simulateExamId" column="simulate_exam_id"/>
+        <result property="fromPlat" column="from_plat"/>
     </resultMap>
 
     <select id="getUserBankList" parameterType="com.zhongzheng.modules.user.bo.UserBankRecordQueryBo" resultType="com.zhongzheng.modules.user.vo.UserBankRecordVo">

+ 2 - 0
zhongzheng-system/src/main/resources/mapper/modules/user/UserExamRecordMapper.xml

@@ -32,6 +32,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="commitTime" column="commit_time"/>
         <result property="doMode" column="do_mode"/>
         <result property="simulateExamId" column="simulate_exam_id"/>
+        <result property="fromPlat" column="from_plat"/>
     </resultMap>
 
     <resultMap type="com.zhongzheng.modules.user.vo.UserExamRecordVo" id="UserExamRecordVoResult">
@@ -64,6 +65,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="commitTime" column="commit_time"/>
         <result property="doMode" column="do_mode"/>
         <result property="simulateExamId" column="simulate_exam_id"/>
+        <result property="fromPlat" column="from_plat"/>
     </resultMap>
 
     <resultMap type="com.zhongzheng.modules.user.vo.UserExamWrongRecordVo" id="UserExamRecordQuestionVoResult">

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

@@ -60,6 +60,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="job" column="job"/>
         <result property="shareCode" column="share_code"/>
         <result property="pwdTime" column="pwd_time"/>
+        <result property="unitContact" column="unit_contact"/>
+        <result property="unitTel" column="unit_tel"/>
+        <result property="school" column="school"/>
+        <result property="graduationTime" column="graduation_time"/>
     </resultMap>
 
 
@@ -695,4 +699,31 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 	        AND o.tenant_id = #{tenantId}
     </select>
 
+    <select id="dangAnList" parameterType="com.zhongzheng.modules.user.bo.UserQueryBo" resultMap="UserResult">
+        SELECT u.* from `user` u where  1=1
+        <if test="telphone != null and telphone != ''" >
+            AND u.telphone like concat('%', #{telphone,typeHandler=com.zhongzheng.common.type.EncryptHandler}, '%')
+        </if>
+        <if test="idCard != null and idCard != ''" >
+            AND u.id_card like concat('%', #{idCard,typeHandler=com.zhongzheng.common.type.EncryptHandler}, '%')
+        </if>
+        <if test="realname != null and realname != ''" >
+            AND u.realname like concat('%', #{realname}, '%')
+        </if>
+        <if test="companyName != null and companyName != ''" >
+            AND u.company_name like concat('%', #{companyName}, '%')
+        </if>
+        <if test="educationTypeId != null and educationTypeId != ''" >
+            AND (SELECT count(*) FROM `order` o
+            LEFT JOIN order_goods og ON o.order_sn = og.order_sn
+            LEFT JOIN goods g ON og.goods_id = g.goods_id WHERE o.`status` = 1 AND og.pay_status IN ( 2, 3, 4 )  AND og.refund_status != 2 AND g.education_type_id = #{educationTypeId})>0
+        </if>
+        <if test="businessId != null and businessId != ''" >
+            AND (SELECT count(*) FROM `order` o
+            LEFT JOIN order_goods og ON o.order_sn = og.order_sn
+            LEFT JOIN goods g ON og.goods_id = g.goods_id WHERE o.`status` = 1 AND og.pay_status IN ( 2, 3, 4 )  AND og.refund_status != 2 AND g.business_id = #{businessId})>0
+        </if>
+        order by u.user_id desc
+    </select>
+
 </mapper>

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

@@ -99,6 +99,7 @@
         <result property="liveEndTime" column="live_end_time"/>
         <result property="recordingUrl" column="recording_url"/>
         <result property="updateTime" column="update_time"/>
+        <result property="fromPlat" column="from_plat"/>
     </resultMap>
 
     <resultMap type="com.zhongzheng.modules.user.vo.ExamStudyRecordVo" id="ExamStudyRecordVoResult">
@@ -120,6 +121,14 @@
         <result property="serviceStartTime" column="service_start_time"/>
         <result property="serviceEndTime" column="service_end_time"/>
         <result property="orderGoodsId" column="order_goods_id"/>
+        <result property="moduleExamNum" column="module_exam_num"/>
+        <result property="chapterExamNum" column="chapter_exam_num"/>
+        <result property="categoryName" column="category_name"/>
+        <result property="moduleNum" column="module_num"/>
+        <result property="chapterNum" column="chapter_num"/>
+        <result property="status" column="status"/>
+        <result property="sectionNum" column="section_num"/>
+        <result property="fileNum" column="file_num"/>
     </resultMap>
 
     <resultMap type="com.zhongzheng.modules.user.vo.ExamSonStudyRecordVo" id="ExamSonStudyRecordVoResult">
@@ -265,6 +274,69 @@
         ORDER BY o.create_time desc
     </select>
 
+    <select id="listDangAnSubject" parameterType="com.zhongzheng.modules.user.bo.SubjectStudyRecordQueryBo"
+            resultMap="SubjectStudyRecordVoResult">
+        SELECT
+        #{userId} as user_id,
+        r.subject_id,
+        r.course_id,
+        r.course_name,
+        (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
+        <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
+        <if test="gradeId != null and gradeId !=''">
+            and c.grade_id=#{gradeId}
+        </if>
+        <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
+        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}
+        </if>
+        <if test="courseId != null and courseId !=''">
+            and c.course_id =#{courseId}
+        </if>
+    </select>
+
 
     <select id="listSubject" parameterType="com.zhongzheng.modules.user.bo.SubjectStudyRecordQueryBo"
             resultMap="SubjectStudyRecordVoResult">
@@ -655,6 +727,242 @@
         ORDER BY s.create_time DESC
     </select>
 
+    <select id="querDangAnExamStudy" parameterType="com.zhongzheng.modules.user.bo.UserQueryBo"
+            resultMap="ExamStudyRecordVoResult">
+        SELECT
+        DISTINCT g.goods_id,
+        #{userId} as user_id,
+        s.create_time,
+        g.goods_name,
+        g.`year`,
+        g.`code`,
+        g.class_hours,
+        g.study_start_time,
+        g.study_end_time,
+        s.service_start_time,
+        s.service_end_time,
+        s.order_goods_id,
+        ( SELECT m.category_name FROM major m WHERE   m.id =g.major_id LIMIT 1) AS category_name,
+        ( SELECT i.business_name FROM course_business i WHERE i.id = g.business_id LIMIT 1) AS business_name,
+        ( SELECT p.project_name FROM course_project_type p WHERE p.id = g.project_id LIMIT 1) AS project_name,
+        (SELECT COUNT(*)  FROM goods_attached a where a.goods_id=g.goods_id and a.type = 1) as module_exam_num,
+        ((SELECT COUNT(a.id) FROM goods_attached e LEFT JOIN question_chapter_exam a on e.major_id =
+        a.chapter_exam_id where e.goods_id = g.goods_id and e.type=2)+(SELECT COUNT(h.id) FROM goods_attached e LEFT
+        JOIN question_module_chapter a on e.major_id = a.module_exam_id LEFT JOIN question_chapter_exam h on
+        a.chapter_exam_id = h.chapter_exam_id where e.goods_id = g.goods_id and e.type=1)) as chapter_exam_num,
+        ( SELECT e.education_name FROM course_education_type e WHERE e.id = g.education_type_id LIMIT 1) AS education_name,
+        (SELECT COUNT(a.id)+(SELECT COUNT(a.id) FROM goods_attached e LEFT JOIN question_chapter_exam a on e.major_id =
+        a.chapter_exam_id where e.goods_id = g.goods_id and e.type=2)+(SELECT COUNT(h.id) FROM goods_attached e LEFT
+        JOIN question_module_chapter a on e.major_id = a.module_exam_id LEFT JOIN question_chapter_exam h on
+        a.chapter_exam_id = h.chapter_exam_id where e.goods_id = g.goods_id and e.type=1) FROM goods_attached a where
+        a.goods_id=g.goods_id and a.type = 3) as exam_num,
+        (SELECT create_time FROM user_exam_record r where r.goods_id=g.goods_id AND r.do_mode = 1 AND r.user_id = #{userId} ORDER BY
+        create_time ASC LIMIT 1) as start_time,
+        (SELECT create_time FROM user_exam_record r where r.goods_id=g.goods_id AND r.do_mode = 1 AND r.user_id = #{userId} ORDER BY
+        create_time DESC LIMIT 1) as end_time,
+        (SELECT COUNT(DISTINCT exam_id) FROM user_exam_record r where r.goods_id=g.goods_id AND r.do_mode = 1 AND r.user_id = #{userId})
+        as stu_all_num,
+        s.service_start_time,
+        s.service_end_time
+        FROM
+        goods g
+        LEFT JOIN order_goods s ON g.goods_id = s.goods_id AND s.pay_status in (2,3,4)
+        LEFT JOIN `order` o ON o.order_sn = s.order_sn
+        WHERE
+        g.goods_type =2
+        <if test="userId != null and userId !=''">
+            AND o.user_id = #{userId}
+        </if>
+        <if test="businessId != null and businessId != ''">
+            AND g.business_id = #{businessId}
+        </if>
+        <if test="projectId != null and projectId != ''">
+            AND g.project_id = #{projectId}
+        </if>
+        <if test="educationTypeId != null and educationTypeId != ''">
+            AND g.education_type_id = #{educationTypeId}
+        </if>
+        <if test="goodsName != null and goodsName != '' ">
+            and g.goods_name like concat('%', #{goodsName}, '%')
+        </if>
+        <if test="goodsStatus != null and goodsStatus != '' ">
+            and g.`status` = #{goodsStatus}
+        </if>
+        <if test="studyStartTime != null and studyStartTime != '' ">
+            and (SELECT count(*) FROM user_exam_record r where r.goods_id=g.goods_id AND r.do_mode = 1 AND r.user_id = #{userId} AND r.create_time >= #{studyStartTime} )>0
+        </if>
+        <if test="studyEndTime != null and studyEndTime != '' ">
+            and (SELECT count(*) FROM user_exam_record r where r.goods_id=g.goods_id AND r.do_mode = 1 AND r.user_id = #{userId} AND #{studyEndTime} >= r.create_time )>0
+        </if>
+        ORDER BY s.create_time DESC
+    </select>
+
+    <select id="querDangAnHandoutsStudy" parameterType="com.zhongzheng.modules.user.bo.UserQueryBo"
+            resultMap="ExamStudyRecordVoResult">
+        SELECT
+        g.goods_id,
+        #{userId} as user_id,
+        s.create_time,
+        g.goods_name,
+        g.`year`,
+        g.`status`,
+        g.class_hours,
+        g.study_start_time,
+        g.study_end_time,
+        s.service_start_time,
+        s.service_end_time,
+        s.order_goods_id,
+        ( SELECT m.category_name FROM major m WHERE   m.id =g.major_id LIMIT 1) AS category_name,
+        ( SELECT i.business_name FROM course_business i WHERE i.id = g.business_id LIMIT 1) AS business_name,
+        ( SELECT p.project_name FROM course_project_type p WHERE p.id = g.project_id LIMIT 1) AS project_name,
+        s.service_start_time,
+        s.service_end_time,
+        ( SELECT count(*) FROM course_file cf WHERE  cf.handouts_id =g.handouts_id AND cf.type = 1 AND cf.`status` = 1 ) AS file_num,
+        FROM
+        goods g
+        LEFT JOIN order_goods s ON g.goods_id = s.goods_id
+        LEFT JOIN `order` o ON o.order_sn = s.order_sn
+        WHERE
+        where 1=1
+        AND s.refund_status in (0,1,3)
+        AND s.pay_status in (2,3,4)
+        AND o.`status` = 1
+        AND g.goods_type = 8
+        <if test="userId != null and userId !=''">
+            AND o.user_id = #{userId}
+        </if>
+        <if test="businessId != null and businessId != ''">
+            AND g.business_id = #{businessId}
+        </if>
+        <if test="projectId != null and projectId != ''">
+            AND g.project_id = #{projectId}
+        </if>
+        <if test="educationTypeId != null and educationTypeId != ''">
+            AND g.education_type_id = #{educationTypeId}
+        </if>
+        <if test="goodsName != null and goodsName != '' ">
+            and g.goods_name like concat('%', #{goodsName}, '%')
+        </if>
+        <if test="goodsStatus != null and goodsStatus != '' ">
+            and g.`status` = #{goodsStatus}
+        </if>
+        <if test="studyStartTime != null and studyStartTime != '' ">
+            and (SELECT count(*) FROM user_exam_record r where r.goods_id=g.goods_id AND r.do_mode = 1 AND r.user_id = #{userId} AND r.create_time >= #{studyStartTime} )>0
+        </if>
+        <if test="studyEndTime != null and studyEndTime != '' ">
+            and (SELECT count(*) FROM user_exam_record r where r.goods_id=g.goods_id AND r.do_mode = 1 AND r.user_id = #{userId} AND #{studyEndTime} >= r.create_time )>0
+        </if>
+        ORDER BY s.create_time DESC
+    </select>
+
+    <select id="querDangAnLiveStudy" parameterType="com.zhongzheng.modules.user.bo.UserQueryBo"
+            resultMap="ExamStudyRecordVoResult">
+        SELECT
+        g.goods_id,
+        #{userId} as user_id,
+        s.create_time,
+        g.goods_name,
+        g.`year`,
+        g.`status`,
+        g.class_hours,
+        g.study_start_time,
+        g.study_end_time,
+        s.service_start_time,
+        s.service_end_time,
+        s.order_goods_id,
+        ( SELECT m.category_name FROM major m WHERE   m.id =g.major_id LIMIT 1) AS category_name,
+        ( SELECT i.business_name FROM course_business i WHERE i.id = g.business_id LIMIT 1) AS business_name,
+        ( SELECT p.project_name FROM course_project_type p WHERE p.id = g.project_id LIMIT 1) AS project_name,
+        (SELECT COUNT(*)  FROM goods_course gc LEFT JOIN course_menu cm on cm.course_id = gc.course_id where gc.goods_id=g.goods_id and cm.type = 1 ) as module_num,
+        (( SELECT
+        COUNT( cm.id )
+        FROM
+        goods_course gc
+        LEFT JOIN course_menu cm ON cm.course_id = gc.course_id
+        WHERE
+        gc.goods_id = g.goods_id
+        AND cm.type = 2
+        )+(
+        SELECT
+        count( cmc.chapter_id )
+        FROM
+        goods_course gc
+        LEFT JOIN course_menu cm ON cm.course_id = gc.course_id
+        LEFT JOIN course_module_chapter cmc ON cm.menu_id = cmc.module_id
+        WHERE
+        gc.goods_id = g.goods_id
+        AND cm.type = 1)) as chapter_num,
+        ( SELECT e.education_name FROM course_education_type e WHERE e.id = g.education_type_id LIMIT 1) AS education_name,
+        (( SELECT
+        COUNT( cm.id )
+        FROM
+        goods_course gc
+        LEFT JOIN course_menu cm ON cm.course_id = gc.course_id
+        WHERE
+        gc.goods_id = g.goods_id
+        AND cm.type = 3
+        )+(
+        SELECT
+        count( ccs.section_id )
+        FROM
+        goods_course gc
+        LEFT JOIN course_menu cm ON cm.course_id = gc.course_id
+        LEFT JOIN course_chapter_section ccs ON cm.menu_id = ccs.chapter_id
+        WHERE
+        gc.goods_id = g.goods_id
+        AND cm.type = 2
+        )+(
+        SELECT
+        count( ccs.section_id )
+        FROM
+        goods_course gc
+        LEFT JOIN course_menu cm ON cm.course_id = gc.course_id
+        LEFT JOIN course_module_chapter cmc ON cm.menu_id = cmc.module_id
+        LEFT JOIN course_chapter_section ccs ON cmc.chapter_id = ccs.chapter_id
+        WHERE
+        gc.goods_id = g.goods_id
+        AND cm.type = 1)) as section_num,
+        (SELECT COUNT(DISTINCT section_id) FROM user_study_record r where r.order_goods_id=s.order_goods_id  AND r.current_status = 1)
+        as stu_all_num,
+        s.service_start_time,
+        s.service_end_time
+        FROM
+        goods g
+        LEFT JOIN order_goods s ON g.goods_id = s.goods_id
+        LEFT JOIN `order` o ON o.order_sn = s.order_sn
+        WHERE
+        where 1=1
+        AND s.refund_status in (0,1,3)
+        AND s.pay_status in (2,3,4)
+        AND o.`status` = 1
+        AND g.goods_type = 6
+        <if test="userId != null and userId !=''">
+            AND o.user_id = #{userId}
+        </if>
+        <if test="businessId != null and businessId != ''">
+            AND g.business_id = #{businessId}
+        </if>
+        <if test="projectId != null and projectId != ''">
+            AND g.project_id = #{projectId}
+        </if>
+        <if test="educationTypeId != null and educationTypeId != ''">
+            AND g.education_type_id = #{educationTypeId}
+        </if>
+        <if test="goodsName != null and goodsName != '' ">
+            and g.goods_name like concat('%', #{goodsName}, '%')
+        </if>
+        <if test="goodsStatus != null and goodsStatus != '' ">
+            and g.`status` = #{goodsStatus}
+        </if>
+        <if test="studyStartTime != null and studyStartTime != '' ">
+            and (SELECT count(*) FROM user_exam_record r where r.goods_id=g.goods_id AND r.do_mode = 1 AND r.user_id = #{userId} AND r.create_time >= #{studyStartTime} )>0
+        </if>
+        <if test="studyEndTime != null and studyEndTime != '' ">
+            and (SELECT count(*) FROM user_exam_record r where r.goods_id=g.goods_id AND r.do_mode = 1 AND r.user_id = #{userId} AND #{studyEndTime} >= r.create_time )>0
+        </if>
+        ORDER BY s.create_time DESC
+    </select>
+
     <select id="listExamSon" parameterType="com.zhongzheng.modules.user.bo.SubjectStudyRecordQueryBo"
             resultMap="ExamSonStudyRecordVoResult">
         SELECT