yangdamao 1 год назад
Родитель
Сommit
f3530c2466
69 измененных файлов с 1911 добавлено и 106 удалено
  1. 74 0
      run-prod.sh
  2. 1 0
      zhongzheng-admin-saas/src/main/java/com/zhongzheng/controller/order/TopOldOrderController.java
  3. 2 0
      zhongzheng-admin-saas/src/main/resources/application-prod.yml
  4. 1 0
      zhongzheng-admin-saas/src/main/resources/application.yml
  5. 17 4
      zhongzheng-admin/src/main/java/com/zhongzheng/controller/common/CommonController.java
  6. 3 1
      zhongzheng-admin/src/main/java/com/zhongzheng/controller/course/CourseController.java
  7. 60 0
      zhongzheng-admin/src/main/java/com/zhongzheng/controller/grade/ClassGradeController.java
  8. 1 1
      zhongzheng-admin/src/main/java/com/zhongzheng/controller/order/OrderBusinessConfigController.java
  9. 2 1
      zhongzheng-admin/src/main/java/com/zhongzheng/controller/schedule/ScheduleController.java
  10. 2 0
      zhongzheng-admin/src/main/resources/application-prod.yml
  11. 1 0
      zhongzheng-admin/src/main/resources/application.yml
  12. 1 0
      zhongzheng-api/src/main/java/com/zhongzheng/controller/goods/GoodsController.java
  13. 9 0
      zhongzheng-api/src/main/java/com/zhongzheng/controller/grade/ClassGradeController.java
  14. 2 0
      zhongzheng-api/src/main/resources/application-prod.yml
  15. 1 0
      zhongzheng-api/src/main/resources/application.yml
  16. 3 0
      zhongzheng-framework/src/main/java/com/zhongzheng/framework/config/SecurityConfig.java
  17. 14 13
      zhongzheng-framework/src/main/java/com/zhongzheng/framework/web/service/SysLoginService.java
  18. 13 12
      zhongzheng-system/src/main/java/com/zhongzheng/modules/base/service/impl/CertificateTpServiceImpl.java
  19. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/bo/CourseProgressQueryBo.java
  20. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/mapper/CourseMapper.java
  21. 14 9
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseServiceImpl.java
  22. 1 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/service/impl/ExamApplyServiceImpl.java
  23. 1 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/bo/GoodsAddBo.java
  24. 1 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/bo/GoodsEditBo.java
  25. 4 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/domain/Goods.java
  26. 25 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/mapper/GoodsMapper.java
  27. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/IGoodsService.java
  28. 90 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/impl/GoodsServiceImpl.java
  29. 4 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/vo/GoodsUserVo.java
  30. 14 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/vo/GoodsVo.java
  31. 28 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/vo/MakeGoodsVo.java
  32. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/bo/ClassGradeAddBo.java
  33. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/bo/ClassGradeEditBo.java
  34. 8 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/bo/ClassGradeUserQueryBo.java
  35. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/bo/SevenPushAuthAddBo.java
  36. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/domain/ClassGrade.java
  37. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/domain/ClassGradeUser.java
  38. 34 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/mapper/ClassGradeUserMapper.java
  39. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/IClassGradeService.java
  40. 14 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/IClassGradeUserService.java
  41. 129 22
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/impl/ClassGradeServiceImpl.java
  42. 216 9
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/impl/ClassGradeUserServiceImpl.java
  43. 38 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/impl/UserPeriodServiceImpl.java
  44. 99 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/vo/ClassGradeStudentAllExportVo.java
  45. 8 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/vo/ClassGradeStudentVo.java
  46. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/vo/ClassGradeUserVo.java
  47. 7 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/vo/ClassGradeVo.java
  48. 92 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/vo/ClassPeriodStudentExportProcessVo.java
  49. 79 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/vo/ClassPeriodStudentNewVo.java
  50. 5 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/vo/ClassPeriodStudentVo.java
  51. 20 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/vo/SyncUserCourseStudyRec.java
  52. 23 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/vo/UserPeriodTotalVo.java
  53. 1 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/order/service/IOrderBusinessConfigService.java
  54. 4 2
      zhongzheng-system/src/main/java/com/zhongzheng/modules/order/service/impl/OrderBusinessConfigServiceImpl.java
  55. 4 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/order/service/impl/OrderGoodsServiceImpl.java
  56. 4 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/order/vo/OrderGoodsVo.java
  57. 4 2
      zhongzheng-system/src/main/java/com/zhongzheng/modules/schedule/service/IScheduleService.java
  58. 58 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/schedule/service/impl/ScheduleServiceImpl.java
  59. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/mapper/UserStudyRecordPhotoMapper.java
  60. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/IUserSubscribeService.java
  61. 5 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/impl/UserStudyRecordServiceImpl.java
  62. 11 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/impl/UserSubscribeServiceImpl.java
  63. 28 8
      zhongzheng-system/src/main/resources/mapper/modules/course/CourseMapper.xml
  64. 30 0
      zhongzheng-system/src/main/resources/mapper/modules/goods/GoodsMapper.xml
  65. 63 13
      zhongzheng-system/src/main/resources/mapper/modules/grade/ClassGradeMapper.xml
  66. 482 2
      zhongzheng-system/src/main/resources/mapper/modules/grade/ClassGradeUserMapper.xml
  67. 7 1
      zhongzheng-system/src/main/resources/mapper/modules/order/OrderBusinessConfigMapper.xml
  68. 3 1
      zhongzheng-system/src/main/resources/mapper/modules/order/OrderGoodsMapper.xml
  69. 17 0
      zhongzheng-system/src/main/resources/mapper/modules/user/UserStudyRecordPhotoMapper.xml

+ 74 - 0
run-prod.sh

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

+ 1 - 0
zhongzheng-admin-saas/src/main/java/com/zhongzheng/controller/order/TopOldOrderController.java

@@ -188,6 +188,7 @@ public class TopOldOrderController extends BaseController {
     @GetMapping("/commissionListExport")
     public AjaxResult<List<TopOldOrderSellerExportVo>> commissionListExport(TopDivideOrderQueryBo bo) {
         List<TopOldOrderCommissionExportVo> list = iTopOldOrderService.commissionListExport(bo);
+
         ExcelUtil<TopOldOrderCommissionExportVo> util = new ExcelUtil<TopOldOrderCommissionExportVo>(TopOldOrderCommissionExportVo.class);
         return util.exportExcel(list, "佣金结算列表");
     }

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

@@ -190,6 +190,8 @@ exam:
     subscribeSaveExam: http://39.108.7.155:9099/cd/subscribe/save/exam
     subscribeUpdateExam: http://39.108.7.155:9099/cd/subscribe/update/exam
     subscribeAddExamNum: http://39.108.7.155:9099/cd/subscribe/add/num
+    subscribeAddExamResult: http://39.108.7.155:9099/cd/exam/add/exam/result
+    subscribeAddCertificate: http://39.108.7.155:9099/cd/exam/add/exam/result/certificate
     question: http://120.79.166.78:19013/common/question/getMeasureList
     questionDetail: http://120.79.166.78:19013/common/question/getTopicList
 

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

@@ -307,6 +307,7 @@ aliyun:
     todayExamNotRecordTeachWarn: SMS_257702971  #学员打卡教务提醒(每日一练)
     noFinishExamNoteCode: SMS_262460267  #未做完试卷通知
     orderServiceEndRemind : SMS_465555251  #学生购买未学习
+    classEndRemind : SMS_465955572
 
 distributionOldPay:
       host: http://test.jqbao.net/System/BussinessApi/AddRedPackData

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

@@ -50,10 +50,7 @@ import com.zhongzheng.modules.distribution.vo.DistributionSellerVo;
 import com.zhongzheng.modules.exam.bo.*;
 import com.zhongzheng.modules.exam.service.IExamApplyService;
 import com.zhongzheng.modules.exam.vo.ExamApplyDetailVo;
-import com.zhongzheng.modules.goods.bo.AlikeGoodsBo;
-import com.zhongzheng.modules.goods.bo.GoodsQueryBo;
-import com.zhongzheng.modules.goods.bo.GoodsStudyUrlBo;
-import com.zhongzheng.modules.goods.bo.UserGoodsListBo;
+import com.zhongzheng.modules.goods.bo.*;
 import com.zhongzheng.modules.goods.service.IGoodsService;
 import com.zhongzheng.modules.goods.vo.*;
 import com.zhongzheng.modules.grade.bo.*;
@@ -396,6 +393,13 @@ public class CommonController extends BaseController {
         return AjaxResult.success(base);
     }
 
+    @ApiOperation("学员学时图片修改")
+    @PostMapping("common/student/image/spin")
+    public AjaxResult updateStudentImageSpin(@RequestBody UpdateStudentImageBo bo) {
+        iUserSubscribeService.updateStudentImageSpin(bo);
+        return AjaxResult.success();
+    }
+
     @ApiOperation("获取外部题库商品(山东题库)")
     @PostMapping("common/external/question")
     public AjaxResult getExternalQuestion(@RequestBody ExternalQuestionBo bo) {
@@ -902,4 +906,13 @@ public class CommonController extends BaseController {
         return AjaxResult.success();
     }
 
+    /**
+     * 回复试卷业务层次
+     */
+    @ApiOperation("回复试卷业务层次")
+    @GetMapping("/common/free/update/exam/business")
+    public AjaxResult<Void> updateExamBusiness() {
+        return toAjax(iGoodsService.updateExamBusiness() ? 1 : 0);
+    }
+
 }

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

@@ -236,7 +236,9 @@ public class CourseController extends BaseController {
         }
         for(CourseProgressQueryBo queryBo : bo.getTelphoneList()){
             User user = iUserService.getOne(new LambdaQueryWrapper<User>()
-                    .eq(User::getTelphone, EncryptHandler.encrypt(queryBo.getTelphone())).last("limit 1"));
+                    .and(x -> x.eq(StringUtils.isNotBlank(queryBo.getTelphone()),User::getTelphone,EncryptHandler.encrypt(queryBo.getTelphone())).or()
+                    .eq(StringUtils.isNotBlank(queryBo.getIdCard()),User::getIdCard,EncryptHandler.encrypt(queryBo.getIdCard())))
+                    .last("limit 1"));
             if(Validator.isEmpty(user)){
                 continue;
             }

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

@@ -28,6 +28,8 @@ import com.zhongzheng.modules.grade.bo.*;
 import com.zhongzheng.modules.grade.domain.ClassGrade;
 import com.zhongzheng.modules.grade.service.*;
 import com.zhongzheng.modules.grade.vo.*;
+import com.zhongzheng.modules.order.bo.OrderQueryBo;
+import com.zhongzheng.modules.order.vo.OrderListExportVo;
 import com.zhongzheng.modules.user.entity.ClientLoginUser;
 import io.swagger.models.auth.In;
 import lombok.RequiredArgsConstructor;
@@ -217,6 +219,15 @@ public class ClassGradeController extends BaseController {
         return getDataTable(list);
     }
 
+    @ApiOperation("导出所有班级用户列表")
+    @PreAuthorize("@ss.hasPermi('grade:grade:list')")
+    @GetMapping("/listGradeAllExport")
+    public AjaxResult<ClassGradeStudentAllExportVo> listGradeAllExport(ClassGradeUserQueryBo bo) {
+        List<ClassGradeStudentAllExportVo> list = iClassGradeService.listGradeAllExport(bo);
+        ExcelUtil<ClassGradeStudentAllExportVo> util = new ExcelUtil<>(ClassGradeStudentAllExportVo.class);
+        return util.exportExcel(list,"报班学员记录");
+    }
+
     /**
      * 导出班级学员列表
      */
@@ -255,6 +266,39 @@ public class ClassGradeController extends BaseController {
         return getDataTable(list);
     }
 
+    /**
+     * 查询学时学员记录列表
+     */
+    @ApiOperation("查询学员学时列表")
+    @PreAuthorize("@ss.hasPermi('grade:user:list')")
+    @GetMapping("/listUserPeriod/manage")
+    public TableDataInfo<ClassPeriodStudentVo> listUserPeriodManage(ClassGradeUserQueryBo bo) {
+        startPage();
+        List<ClassPeriodStudentVo> list = iClassGradeUserService.listUserPeriodManage(bo);
+        return getDataTable(list);
+    }
+
+
+    /**
+     * 查询学时学员记录统计
+     */
+    @ApiOperation("查询学时学员记录统计")
+    @GetMapping("/listUserPeriod/total")
+    public AjaxResult<UserPeriodTotalVo> listUserPeriodTotal(ClassGradeUserQueryBo bo) {
+        return AjaxResult.success(iClassGradeUserService.listUserPeriodTotal(bo));
+    }
+
+    /**
+     * 查询学时学员记录列表(新)
+     */
+    @ApiOperation("查询学员学时列表(新)")
+    @GetMapping("/listUserPeriod/new")
+    public TableDataInfo<ClassPeriodStudentNewVo> listUserPeriodNew(ClassGradeUserQueryBo bo) {
+        startPage();
+        List<ClassPeriodStudentNewVo> list = iClassGradeUserService.listUserPeriodNew(bo);
+        return getDataTable(list);
+    }
+
     /**
      * 查询学时学员记录列表
      */
@@ -267,6 +311,14 @@ public class ClassGradeController extends BaseController {
         return getDataTable(list);
     }
 
+    @ApiOperation("导出学员学时学习记录列表")
+    @GetMapping("/exportListUserPeriodRecord")
+    public AjaxResult<ClassPeriodStudentExportProcessVo> exportListUserPeriodRecord(ClassGradeUserQueryBo bo) {
+        List<ClassPeriodStudentExportProcessVo> list = iClassGradeUserService.exportListUserPeriodRecord(bo);
+        ExcelUtil<ClassPeriodStudentExportProcessVo> util = new ExcelUtil<>(ClassPeriodStudentExportProcessVo.class);
+        return util.exportExcel(list,"学员学时学习记录列表");
+    }
+
     /**
      * 班级管理列表
      */
@@ -297,6 +349,14 @@ public class ClassGradeController extends BaseController {
         return getDataTable(list);
     }
 
+    @ApiOperation("查询学员视频学习记录列表")
+    @GetMapping("/listUserVideoRecord/new")
+    public TableDataInfo<ClassPeriodStudentVo> listUserVideoRecordNew(ClassGradeUserQueryBo bo) {
+        startPage();
+        List<ClassPeriodStudentVo> list = iClassGradeUserService.listUserVideoRecordNew(bo);
+        return getDataTable(list);
+    }
+
     /**
      * 查询学时学员记录列表
      */

+ 1 - 1
zhongzheng-admin/src/main/java/com/zhongzheng/controller/order/OrderBusinessConfigController.java

@@ -95,7 +95,7 @@ public class OrderBusinessConfigController extends BaseController {
     @PreAuthorize("@ss.hasPermi('system:config:add')")
     @Log(title = "录单配置", businessType = BusinessType.INSERT)
     @PostMapping("/withEntity")
-    public AjaxResult<OrderBusinessConfig> addWithEntity(@RequestBody OrderBusinessConfigAddBo bo) {
+    public AjaxResult<OrderBusinessConfigVo> addWithEntity(@RequestBody OrderBusinessConfigAddBo bo) {
         return AjaxResult.success(iOrderBusinessConfigService.insertByAddBoWithEntity(bo));
     }
 

+ 2 - 1
zhongzheng-admin/src/main/java/com/zhongzheng/controller/schedule/ScheduleController.java

@@ -96,10 +96,11 @@ public class ScheduleController extends BaseController {
         return AjaxResult.success();
     }
 
-    @ApiOperation("二建服务到期提醒")
+    @ApiOperation("二建服务和班级到期提醒")
     @GetMapping("/sendServiceEnd")
     public AjaxResult sendServiceEnd() {
         iScheduleService.sendServiceEnd();
+        iScheduleService.sendClassTenAndFifteenEnd();
         return AjaxResult.success();
     }
 

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

@@ -190,6 +190,8 @@ exam:
     subscribeSaveExam: http://39.108.7.155:9099/cd/subscribe/save/exam
     subscribeUpdateExam: http://39.108.7.155:9099/cd/subscribe/update/exam
     subscribeAddExamNum: http://39.108.7.155:9099/cd/subscribe/add/num
+    subscribeAddExamResult: http://39.108.7.155:9099/cd/exam/add/exam/result
+    subscribeAddCertificate: http://39.108.7.155:9099/cd/exam/add/exam/result/certificate
     question: http://120.79.166.78:19013/common/question/getMeasureList
     questionDetail: http://120.79.166.78:19013/common/question/getTopicList
 

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

@@ -307,3 +307,4 @@ aliyun:
     todayExamNotRecordTeachWarn: SMS_257702971  #学员打卡教务提醒(每日一练)
     noFinishExamNoteCode: SMS_262460267  #未做完试卷通知
     orderServiceEndRemind : SMS_465555251  #学生购买未学习
+    classEndRemind : SMS_465955572

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

@@ -277,6 +277,7 @@ public class GoodsController extends BaseController {
         ClientLoginUser loginUser = wxTokenService.getLoginUser(ServletUtils.getRequest());
         bo.setUserId(loginUser.getUser().getUserId());
         startPage();
+
         List<OrderGoodsVo> list = iOrderGoodsService.listUserVideoLive(bo);
         return getDataTable(list);
     }

+ 9 - 0
zhongzheng-api/src/main/java/com/zhongzheng/controller/grade/ClassGradeController.java

@@ -114,4 +114,13 @@ public class ClassGradeController extends BaseController {
         bo.setUserId(loginUser.getUser().getUserId());
         return AjaxResult.success(iClassGradeUserService.checkFinishRequiredCourse(bo));
     }
+
+    @ApiOperation("检查是否有二建班级10天过期")
+    @PreAuthorize("@ss.hasPermi('grade:user:list')")
+    @GetMapping("/checkTenClassGradeUser")
+    public AjaxResult<List<ClassGradeUserGoodsVo>> checkTenClassGradeUser(ClassGradeUserQueryBo bo) {
+        ClientLoginUser loginUser = wxTokenService.getLoginUser(ServletUtils.getRequest());
+        bo.setUserId(loginUser.getUser().getUserId());
+        return AjaxResult.success(iClassGradeUserService.checkTenClassGradeUser(bo));
+    }
 }

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

@@ -203,6 +203,8 @@ exam:
     subscribeSaveExam: http://39.108.7.155:9099/cd/subscribe/save/exam
     subscribeUpdateExam: http://39.108.7.155:9099/cd/subscribe/update/exam
     subscribeAddExamNum: http://39.108.7.155:9099/cd/subscribe/add/num
+    subscribeAddExamResult: http://39.108.7.155:9099/cd/exam/add/exam/result
+    subscribeAddCertificate: http://39.108.7.155:9099/cd/exam/add/exam/result/certificate
     question: http://120.79.166.78:19013/common/question/getMeasureList
     questionDetail: http://120.79.166.78:19013/common/question/getTopicList
 

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

@@ -305,3 +305,4 @@ aliyun:
     todayExamNotRecordTeachWarn: SMS_257702971  #学员打卡教务提醒(每日一练)
     noFinishExamNoteCode: SMS_262460267  #未做完试卷通知
     orderServiceEndRemind : SMS_465555251  #学生购买未学习
+    classEndRemind : SMS_465955572

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

@@ -146,6 +146,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
                 .antMatchers("/common/external/question").anonymous()
                 .antMatchers("/common/replenish/exam").anonymous()
                 .antMatchers("/common/student/image/update").anonymous()
+                .antMatchers("/common/student/image/spin").anonymous()
                 .antMatchers("/common/platform/pay").anonymous()
                 .antMatchers("/common/platform/pay/handle").anonymous()
                 .antMatchers("/common/alike/goods").anonymous()
@@ -160,8 +161,10 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
                 .antMatchers("/grade/grade/listPeriod").anonymous()
                 .antMatchers("/course/business/queryFullId").anonymous()
                 .antMatchers("/grade/grade/listUserPeriod").anonymous()
+                .antMatchers("/grade/grade/listUserPeriod/new").anonymous()
                 .antMatchers("/grade/grade/listPeriodAudit").anonymous()
                 .antMatchers("/grade/grade/listUserVideoRecord").anonymous()
+                .antMatchers("/grade/grade/listUserVideoRecord/new").anonymous()
                 .antMatchers("/swagger-ui.html").anonymous()
                 .antMatchers("/swagger-resources/**").anonymous()
                 .antMatchers("/webjars/**").anonymous()

+ 14 - 13
zhongzheng-framework/src/main/java/com/zhongzheng/framework/web/service/SysLoginService.java

@@ -93,19 +93,20 @@ public class SysLoginService
      */
     public String login(String username, String password, String code, String uuid,String smsCode,String tel)
     {
-//        String verifyKey = Constants.CAPTCHA_CODE_KEY + uuid;
-//        String captcha = redisCache.getCacheObject(verifyKey);
-//        redisCache.deleteObject(verifyKey);
-//        if (captcha == null)
-//        {
-//            AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.expire")));
-//            throw new CaptchaExpireException();
-//        }
-//        if (!code.equalsIgnoreCase(captcha))
-//        {
-//            AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.error")));
-//            throw new CaptchaException();
-//        }
+        String verifyKey = Constants.CAPTCHA_CODE_KEY + uuid;
+        String captcha = redisCache.getCacheObject(verifyKey);
+        redisCache.deleteObject(verifyKey);
+        if (captcha == null)
+        {
+            AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.expire")));
+            throw new CaptchaExpireException();
+        }
+        if (!code.equalsIgnoreCase(captcha))
+        {
+            AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.error")));
+            throw new CaptchaException();
+        }
+
 //        iUserLoginErrorService.checkLimit(username);
         // 用户验证
         Authentication authentication = null;

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

@@ -205,6 +205,7 @@ public class CertificateTpServiceImpl extends ServiceImpl<CertificateTpMapper, C
         bo.setPageSize(null);
         bo.setPageNum(null);
         GoodsVo goodsVo = iGoodsService.selectDetail(bo.getGoodsId());
+        goodsVo.setSelfClassHours(goodsVo.getClassHours());
         //获取培训开始时间
         UserStudyRecordQueryBo studyRecordQueryBo = new UserStudyRecordQueryBo();
         studyRecordQueryBo.setUserId(bo.getUserId());
@@ -371,8 +372,8 @@ public class CertificateTpServiceImpl extends ServiceImpl<CertificateTpMapper, C
             for(CourseChapterVo chapterVo : chapterList){
                 totalHour+=chapterVo.getSectionNum();
             }
-            goodsVo.setClassHours(new BigDecimal(totalHour));
-            vo.setClassHours(totalHour+"");
+            goodsVo.setClassHours(goodsVo.getSelfClassHours());
+            vo.setClassHours(goodsVo.getSelfClassHours()+"");
             vo.setDateY(nowDate.substring(0, 4));
             vo.setDateM(nowDate.substring(5, 7));
             vo.setDateD(nowDate.substring(8, 10));
@@ -406,8 +407,8 @@ public class CertificateTpServiceImpl extends ServiceImpl<CertificateTpMapper, C
             for(CourseChapterVo chapterVo : chapterList){
                 totalHour+=chapterVo.getSectionNum();
             }
-            goodsVo.setClassHours(new BigDecimal(totalHour));
-            vo.setClassHours(totalHour+"");
+            goodsVo.setClassHours(goodsVo.getSelfClassHours());
+            vo.setClassHours(goodsVo.getSelfClassHours()+"");
             vo.setDateY(nowDate.substring(0, 4));
             vo.setDateM(nowDate.substring(5, 7));
             vo.setDateD(nowDate.substring(8, 10));
@@ -441,8 +442,8 @@ public class CertificateTpServiceImpl extends ServiceImpl<CertificateTpMapper, C
             for(CourseChapterVo chapterVo : chapterList){
                 totalHour+=chapterVo.getSectionNum();
             }
-            goodsVo.setClassHours(new BigDecimal(totalHour));
-            vo.setClassHours(totalHour+"");
+            goodsVo.setClassHours(goodsVo.getSelfClassHours());
+            vo.setClassHours(goodsVo.getSelfClassHours()+"");
             vo.setDateY(nowDate.substring(0, 4));
             vo.setDateM(nowDate.substring(5, 7));
             vo.setDateD(nowDate.substring(8, 10));
@@ -476,8 +477,8 @@ public class CertificateTpServiceImpl extends ServiceImpl<CertificateTpMapper, C
             for(CourseChapterVo chapterVo : chapterList){
                 totalHour+=chapterVo.getSectionNum();
             }
-            goodsVo.setClassHours(new BigDecimal(totalHour));
-            vo.setClassHours(totalHour+"");
+            goodsVo.setClassHours(goodsVo.getSelfClassHours());
+            vo.setClassHours(goodsVo.getSelfClassHours()+"");
             vo.setDateY(nowDate.substring(0, 4));
             vo.setDateM(nowDate.substring(5, 7));
             vo.setDateD(nowDate.substring(8, 10));
@@ -511,8 +512,8 @@ public class CertificateTpServiceImpl extends ServiceImpl<CertificateTpMapper, C
             for(CourseChapterVo chapterVo : chapterList){
                 totalHour+=chapterVo.getSectionNum();
             }
-            goodsVo.setClassHours(new BigDecimal(totalHour));
-            vo.setClassHours(totalHour+"");
+            goodsVo.setClassHours(goodsVo.getSelfClassHours());
+            vo.setClassHours(goodsVo.getSelfClassHours()+"");
             vo.setDateY(nowDate.substring(0, 4));
             vo.setDateM(nowDate.substring(5, 7));
             vo.setDateD(nowDate.substring(8, 10));
@@ -546,8 +547,8 @@ public class CertificateTpServiceImpl extends ServiceImpl<CertificateTpMapper, C
             for(CourseChapterVo chapterVo : chapterList){
                 totalHour+=chapterVo.getSectionNum();
             }
-            goodsVo.setClassHours(new BigDecimal(totalHour));
-            vo.setClassHours(totalHour+"");
+            goodsVo.setClassHours(goodsVo.getSelfClassHours());
+            vo.setClassHours(goodsVo.getSelfClassHours()+"");
     //        vo.setClassHours(goodsVo.getClassHours().setScale( 0, BigDecimal.ROUND_HALF_UP )+"");
             vo.setDateY(nowDate.substring(0, 4));
             vo.setDateM(nowDate.substring(5, 7));

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/bo/CourseProgressQueryBo.java

@@ -27,4 +27,7 @@ public class CourseProgressQueryBo extends BaseEntity {
 	@ApiModelProperty("手机号码")
 	private String telphone;
 
+	@ApiModelProperty("身份证")
+	private String idCard;
+
 }

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/mapper/CourseMapper.java

@@ -17,6 +17,7 @@ import com.zhongzheng.modules.order.bo.SpecialQuestionBo;
 import com.zhongzheng.modules.order.vo.SpecialQuestionVo;
 import com.zhongzheng.modules.user.bo.SubjectStudyRecordQueryBo;
 import com.zhongzheng.modules.user.bo.UserPlanQueryBo;
+import com.zhongzheng.modules.user.domain.UserSubscribe;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
@@ -83,4 +84,5 @@ public interface CourseMapper extends BaseMapper<Course> {
 
     Long getStudyCourseNum(SubjectStudyRecordQueryBo subjectStudyRecordQueryBo);
 
+    UserSubscribe getUserSub(@Param("userId") Long userId,@Param("goodsId") Long goodsId);
 }

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

@@ -64,6 +64,7 @@ import com.zhongzheng.modules.grade.service.IUserPeriodStatusService;
 import com.zhongzheng.modules.grade.vo.ClassGradeVo;
 import com.zhongzheng.modules.grade.vo.UserPeriodVo;
 import com.zhongzheng.modules.order.bo.SpecialQuestionBo;
+import com.zhongzheng.modules.order.domain.OrderGoods;
 import com.zhongzheng.modules.order.vo.SpecialQuestionVo;
 import com.zhongzheng.modules.order.service.IOrderGoodsService;
 import com.zhongzheng.modules.system.domain.SysTenant;
@@ -151,6 +152,8 @@ public class CourseServiceImpl extends ServiceImpl<CourseMapper, Course> impleme
     @Autowired
     private IGoodsService iGoodsService;
     @Autowired
+    private IOrderGoodsService iOrderGoodsService;
+    @Autowired
     private IGoodsQuestionRelService iGoodsQuestionRelService;
     @Autowired
     private IQuestionMerchantService iQuestionMerchantService;
@@ -781,6 +784,8 @@ public class CourseServiceImpl extends ServiceImpl<CourseMapper, Course> impleme
             goodsUserVo.setOfficialName(classGradeVo.getOfficialName());
             goodsUserVo.setPeriodWaitTime(classGradeVo.getPeriodWaitTime());
             goodsUserVo.setOpenQuestion(0);
+            goodsUserVo.setSevenPushReason(classGradeVo.getSevenPushReason());
+            goodsUserVo.setSevenPushDate(classGradeVo.getSevenPushDate());
             Long secLong = 0L;
             Long studyLong = 0L;
             SubjectStudyRecordQueryBo subjectStudyRecordQueryBo = new SubjectStudyRecordQueryBo();
@@ -809,12 +814,7 @@ public class CourseServiceImpl extends ServiceImpl<CourseMapper, Course> impleme
                 if (ObjectUtils.isNotNull(classGradeVo.getPeriodStatus())
                         && classGradeVo.getPeriodStatus() == 1
                         && (DateUtils.getNowTime() >= goodsUserVo.getServiceStartTime() && DateUtils.getNowTime() <= goodsUserVo.getServiceEndTime())){
-                    UserSubscribe userSubscribe = iUserSubscribeService.getOne(new LambdaQueryWrapper<UserSubscribe>()
-                            .eq(UserSubscribe::getUserId, bo.getUserId())
-                            .eq(UserSubscribe::getGoodsId, goodsUserVo.getGoodsId())
-                            .eq(UserSubscribe::getSubscribeStatus, 1)
-                            .orderByDesc(UserSubscribe::getCreateTime)
-                            .last("limit 1"));
+                    UserSubscribe userSubscribe = baseMapper.getUserSub(bo.getUserId(),goodsUserVo.getGoodsId());
                     if (ObjectUtils.isNull(userSubscribe)){
                         goodsUserVo.setSubscribeSign(1);
                     }else if (userSubscribe.getSubscribeStatus() == 1 && ObjectUtils.isNotNull(userSubscribe.getExamStatus())
@@ -1009,9 +1009,14 @@ public class CourseServiceImpl extends ServiceImpl<CourseMapper, Course> impleme
             goodsUserVo.setPeriodStatus(classGradeVo.getPeriodStatus());
             goodsUserVo.setSignId(classGradeVo.getId());
             goodsUserVo.setOfficialStatus(classGradeVo.getOfficialStatus());
-            goodsUserVo.setClassStatus(classGradeVo.getClassStatus());
-            goodsUserVo.setClassStartTime(classGradeVo.getClassStartTime());
-            goodsUserVo.setClassEndTime(classGradeVo.getClassEndTime());
+
+            String businessName = iGoodsService.getGoodsBusinessName(goodsUserVo.getGoodsId());
+            if (businessName.contains("继续教育") &&
+                    (businessName.contains("二级建造师") || businessName.contains("二级造价师") || businessName.contains("施工现场专业人员"))){
+                goodsUserVo.setClassStatus(classGradeVo.getClassStatus());
+                goodsUserVo.setClassStartTime(classGradeVo.getClassStartTime());
+                goodsUserVo.setClassEndTime(classGradeVo.getClassEndTime());
+            }
         }
         return goodsUserVos;
     }

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

@@ -1392,7 +1392,7 @@ public class ExamApplyServiceImpl extends ServiceImpl<ExamApplyMapper, ExamApply
             ossRequest.setFile(multipartFile);
             try {
                 String upload = ossService.upload(ossRequest);
-                subscribe.setCertificateUrl(upload);
+                subscribe.setCertificateUrl(ALIYUN_OSS_ENDPOINT+upload);
                 ExamApplyCertificateBo examAp = new ExamApplyCertificateBo();
                 examAp.setCertificateUrl(upload);
                 examAp.setCertificateEndTime(timeTwo);

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

@@ -221,4 +221,5 @@ public class GoodsAddBo {
     private Integer viewSign;
     @ApiModelProperty("寄件标签:1是 0否")
     private Integer mailSign;
+    private String makeGoodsIds;
 }

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

@@ -255,4 +255,5 @@ public class GoodsEditBo {
     private Integer viewSign;
     @ApiModelProperty("寄件标签:1是 0否")
     private Integer mailSign;
+    private String makeGoodsIds;
 }

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

@@ -188,4 +188,8 @@ private static final long serialVersionUID=1L;
     /** 寄件标签:1是 0否 */
     @TableField(updateStrategy=FieldStrategy.IGNORED)
     private Integer mailSign;
+
+    /** 前培和补考商品关联多个 */
+    @TableField(updateStrategy=FieldStrategy.IGNORED)
+    private String makeGoodsIds;
 }

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

@@ -2,6 +2,10 @@ package com.zhongzheng.modules.goods.mapper;
 
 import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.zhongzheng.modules.bank.domain.Exam;
+import com.zhongzheng.modules.bank.domain.QuestionBusiness;
+import com.zhongzheng.modules.bank.domain.QuestionChapter;
+import com.zhongzheng.modules.bank.domain.QuestionModule;
 import com.zhongzheng.modules.course.bo.CourseQueryBo;
 import com.zhongzheng.modules.course.bo.ExternalQuestionBo;
 import com.zhongzheng.modules.course.bo.ReplenishExamBo;
@@ -40,6 +44,8 @@ public interface GoodsMapper extends BaseMapper<Goods> {
 
     Long getRandomQuestionNum(@Param("goodsId")Long goodsId,@Param("examPaperId") Long examPaperId);
 
+    List<MakeGoodsVo> getMakeGoodsList(@Param("makeGoodsIds")String makeGoodsIds);
+
     int queryUpGoods();
 
     List<GoodsVo> selectListToInput(GoodsQueryBo bo);
@@ -110,4 +116,23 @@ public interface GoodsMapper extends BaseMapper<Goods> {
 
     @InterceptorIgnore(tenantLine = "true")
     Integer getCourseExamNumNoTenant(Long goodsId);
+
+    @InterceptorIgnore(tenantLine = "true")
+    List<QuestionModule> getModuleExam();
+
+    @InterceptorIgnore(tenantLine = "true")
+    SysGoodsCopyRecord getSysGoodsCopy(@Param("moduleExamId") Long moduleExamId,@Param("type")Integer type);
+
+    @InterceptorIgnore(tenantLine = "true")
+    List<QuestionBusiness> getModuleExamBusiness(@Param("oldId")Long oldId,@Param("type")Integer type);
+
+    @InterceptorIgnore(tenantLine = "true")
+    Integer saveExamBusiness(QuestionBusiness bs);
+
+    @InterceptorIgnore(tenantLine = "true")
+    List<QuestionChapter> getChapterExam();
+
+    @InterceptorIgnore(tenantLine = "true")
+    List<Exam> getExam();
+
 }

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

@@ -167,4 +167,7 @@ public interface IGoodsService extends IService<Goods> {
     Integer getCourseNum(Long goodsId);
 
     Integer getCourseExamNum(Long goodsId);
+
+    Boolean updateExamBusiness();
+
 }

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

@@ -515,6 +515,9 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
 //                goodsVo.setSpecTemplateId(relation.getSpecTemplateId());
 //            }
 //        }
+        if(Validator.isNotEmpty(goodsVo.getMakeGoodsIds())){
+            goodsVo.setMakeGoodsVoList(this.baseMapper.getMakeGoodsList(goodsVo.getMakeGoodsIds()));
+        }
         //多规格下的价格区间
         if (ObjectUtils.isNotNull(goodsVo.getSpecTemplateId())) {
             List<GoodsSpecAttributeRelation> list = goodsSpecAttributeRelationService
@@ -5298,6 +5301,93 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
         return baseMapper.getCourseExamNumNoTenant(goodsId);
     }
 
+    @Override
+    public Boolean updateExamBusiness() {
+        //模块卷
+        List<QuestionModule> modules = baseMapper.getModuleExam();
+        if (CollectionUtils.isNotEmpty(modules)){
+            modules.forEach(item -> {
+                Long tenantId = item.getTenantId();
+                SysGoodsCopyRecord copyRecord = baseMapper.getSysGoodsCopy(item.getModuleExamId(),46);
+                if (ObjectUtils.isNull(copyRecord)){
+                    return;
+                }
+                List<QuestionBusiness> businesses = baseMapper.getModuleExamBusiness(copyRecord.getOldId(),4);
+                if (CollectionUtils.isEmpty(businesses)){
+                    return;
+                }
+                //同步模块卷业务层次
+                businesses.forEach(bs -> {
+                    bs.setId(null);
+                    bs.setMajorId(item.getModuleExamId());
+                    bs.setEducationTypeId(getNewIdByTenant(bs.getEducationTypeId(),14,tenantId));
+                    bs.setProjectId(getNewIdByTenant(bs.getProjectId(),22,tenantId));
+                    bs.setBusinessId(getNewIdByTenant(bs.getBusinessId(),9,tenantId));
+                    bs.setSubjectId(getNewIdByTenant(bs.getSubjectId(),26,tenantId));
+                    bs.setTenantId(tenantId);
+                    baseMapper.saveExamBusiness(bs);
+                });
+            });
+        }
+
+        //章卷
+        List<QuestionChapter> chapters = baseMapper.getChapterExam();
+        if (CollectionUtils.isNotEmpty(chapters)){
+            chapters.forEach(item -> {
+                Long tenantId = item.getTenantId();
+                SysGoodsCopyRecord copyRecord = baseMapper.getSysGoodsCopy(item.getChapterExamId(),44);
+                if (ObjectUtils.isNull(copyRecord)){
+                    return;
+                }
+                List<QuestionBusiness> businesses = baseMapper.getModuleExamBusiness(copyRecord.getOldId(),3);
+                if (CollectionUtils.isEmpty(businesses)){
+                    return;
+                }
+
+                //同步模块卷业务层次
+                businesses.forEach(bs -> {
+                    bs.setId(null);
+                    bs.setMajorId(item.getChapterExamId());
+                    bs.setEducationTypeId(getNewIdByTenant(bs.getEducationTypeId(),14,tenantId));
+                    bs.setProjectId(getNewIdByTenant(bs.getProjectId(),22,tenantId));
+                    bs.setBusinessId(getNewIdByTenant(bs.getBusinessId(),9,tenantId));
+                    bs.setSubjectId(getNewIdByTenant(bs.getSubjectId(),26,tenantId));
+                    bs.setTenantId(tenantId);
+
+                    baseMapper.saveExamBusiness(bs);
+                });
+            });
+        }
+
+        //试卷
+        List<Exam> exam = baseMapper.getExam();
+        if (CollectionUtils.isNotEmpty(exam)){
+            exam.forEach(item -> {
+                Long tenantId = item.getTenantId();
+                SysGoodsCopyRecord copyRecord = baseMapper.getSysGoodsCopy(item.getExamId(),28);
+                if (ObjectUtils.isNull(copyRecord)){
+                    return;
+                }
+                List<QuestionBusiness> businesses = baseMapper.getModuleExamBusiness(copyRecord.getOldId(),2);
+                if (CollectionUtils.isEmpty(businesses)){
+                    return;
+                }
+                //同步模块卷业务层次
+                businesses.forEach(bs -> {
+                    bs.setId(null);
+                    bs.setMajorId(item.getExamId());
+                    bs.setEducationTypeId(getNewIdByTenant(bs.getEducationTypeId(),14,tenantId));
+                    bs.setProjectId(getNewIdByTenant(bs.getProjectId(),22,tenantId));
+                    bs.setBusinessId(getNewIdByTenant(bs.getBusinessId(),9,tenantId));
+                    bs.setSubjectId(getNewIdByTenant(bs.getSubjectId(),26,tenantId));
+                    bs.setTenantId(tenantId);
+
+                    baseMapper.saveExamBusiness(bs);
+                });
+            });
+        }
+        return true;
+    }
 
     private void updateHandoutsId(Long goodsId, String tenantId, Long handoutsId) {
         baseMapper.updateHandoutsId(goodsId, tenantId, handoutsId);

+ 4 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/vo/GoodsUserVo.java

@@ -454,4 +454,8 @@ public class GoodsUserVo {
 
 	@ApiModelProperty("标签Id")
 	private Long signId;
+
+	private String sevenPushReason;
+
+	private String sevenPushDate;
 }

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

@@ -125,6 +125,10 @@ public class GoodsVo {
 	@Excel(name = "封面地址")
 	@ApiModelProperty("封面地址")
 	private String coverUrl;
+
+	@Excel(name = "学时")
+	@ApiModelProperty("学时")
+	private BigDecimal selfClassHours;
 	/** 学时 */
 	@Excel(name = "学时")
 	@ApiModelProperty("学时")
@@ -406,4 +410,14 @@ public class GoodsVo {
 	private Integer viewSign;
 	@ApiModelProperty("寄件标签:1是 0否")
 	private Integer mailSign;
+
+	private Long orderGoodsId;
+
+	private Long periodWaitTime;
+
+	@ApiModelProperty("前培和补考商品关联多个")
+	private String makeGoodsIds;
+
+	private List<MakeGoodsVo> makeGoodsVoList;
+
 }

+ 28 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/vo/MakeGoodsVo.java

@@ -0,0 +1,28 @@
+package com.zhongzheng.modules.goods.vo;
+
+import com.zhongzheng.common.annotation.Excel;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+@Data
+@ApiModel("补考商品视图对象")
+public class MakeGoodsVo {
+
+    private static final long serialVersionUID = 1L;
+
+    /** 前培和补考商品关联 */
+    @Excel(name = "前培和补考商品关联")
+    @ApiModelProperty("前培和补考商品关联")
+    private Long makeGoodsId;
+
+    /** 前培和补考商品关联 */
+    @Excel(name = "前培和补考商品关联")
+    @ApiModelProperty("前培和补考商品关联商品名")
+    private String makeGoodsName;
+
+    /** 前培和补考商品关联 */
+    @Excel(name = "前培和补考商品关联")
+    @ApiModelProperty("前培和补考商品关联编码")
+    private String makeGoodsCode;
+}

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

@@ -93,4 +93,7 @@ public class ClassGradeAddBo {
     /** 官方学习地址 */
     @ApiModelProperty("官方学习地址")
     private String officialLearningUrl;
+
+    @ApiModelProperty("班级提前截止天数")
+    private Integer pastDueDay;
 }

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

@@ -111,4 +111,7 @@ public class ClassGradeEditBo {
     /** 官方学习地址 */
     @ApiModelProperty("官方学习地址")
     private String officialLearningUrl;
+
+    @ApiModelProperty("班级提前截止天数")
+    private Integer pastDueDay;
 }

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

@@ -315,4 +315,12 @@ public class ClassGradeUserQueryBo extends BaseEntity {
 	@ApiModelProperty("录单订单编号")
 	private String inputOrderSn;
 
+	private List<Long> tenantIds;
+
+	private List<Long> educationTypeIds;
+
+	private List<Long> projectIds;
+
+	private Long educationId;
+
 }

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/bo/SevenPushAuthAddBo.java

@@ -34,4 +34,6 @@ public class SevenPushAuthAddBo {
 
     @ApiModelProperty("失败原因")
     private String sevenPushReason;
+
+    private String sevenPushDate;
 }

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

@@ -98,4 +98,6 @@ private static final long serialVersionUID=1L;
 
     @TableField(exist = false)
     private Boolean isNewClass;
+
+    private Integer pastDueDay;
 }

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

@@ -88,5 +88,7 @@ private static final long serialVersionUID=1L;
     private Integer sevenPushCheck;
 
     private String sevenPushReason;
+
+    private String sevenPushDate;
 }
 

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

@@ -6,6 +6,7 @@ import com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo;
 import com.zhongzheng.modules.grade.domain.ClassGradeUser;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.zhongzheng.modules.grade.vo.*;
+import com.zhongzheng.modules.order.domain.OrderGoods;
 import com.zhongzheng.modules.user.bo.UserQueryBo;
 import com.zhongzheng.modules.user.bo.UserUsbRecordBo;
 import com.zhongzheng.modules.user.domain.User;
@@ -34,12 +35,20 @@ public interface ClassGradeUserMapper extends BaseMapper<ClassGradeUser> {
 
     List<ClassPeriodStudentVo> listUserPeriod(ClassGradeUserQueryBo bo);
 
+    List<ClassPeriodStudentVo> exportUserPeriod(ClassGradeUserQueryBo bo);
+
     List<ClassPeriodStudentVo> listUserWeekPeriod(ClassGradeUserQueryBo bo);
 
     Long listUserWeekStudyTime(ClassGradeUserQueryBo bo);
 
     List<ClassPeriodStudentVo> listUserVideoRecord(ClassGradeUserQueryBo bo);
 
+    @InterceptorIgnore(tenantLine = "true")
+    List<ClassPeriodStudentVo> listUserVideoRecordNew(ClassGradeUserQueryBo bo);
+
+    @InterceptorIgnore(tenantLine = "true")
+    Long listUserVideoRecordNew_COUNT(ClassGradeUserQueryBo bo);
+
     List<ClassPeriodStudentVo> listUserPeriodExport(ClassGradeUserQueryBo bo);
 
     List<ClassPeriodUserVo> listPeriod(ClassGradeUserQueryBo bo);
@@ -64,8 +73,14 @@ public interface ClassGradeUserMapper extends BaseMapper<ClassGradeUser> {
 
     List<Long> selectStart(@Param("userId") Long userId,@Param("goodsId") Long goodsId,@Param("gradeId") Long gradeId,@Param("orderGoodsId") Long orderGoodsId);
 
+    @InterceptorIgnore(tenantLine = "true")
+    List<Long> selectStartNew(@Param("userId") Long userId,@Param("goodsId") Long goodsId,@Param("gradeId") Long gradeId,@Param("orderGoodsId") Long orderGoodsId);
+
     Long selectStartNoPhoto(@Param("userId") Long userId,@Param("goodsId") Long goodsId,@Param("gradeId") Long gradeId,@Param("orderGoodsId") Long orderGoodsId);
 
+    @InterceptorIgnore(tenantLine = "true")
+    Long selectStartNoPhotoNew(@Param("userId") Long userId,@Param("goodsId") Long goodsId,@Param("gradeId") Long gradeId,@Param("orderGoodsId") Long orderGoodsId);
+
     List<Long> selectEnd(@Param("userId") Long userId,@Param("goodsId") Long goodsId,@Param("gradeId") Long gradeId);
 
     List<ClassGradeUserGoodsVo> sendClassGradeUser();
@@ -74,6 +89,10 @@ public interface ClassGradeUserMapper extends BaseMapper<ClassGradeUser> {
 
     List<ClassGradeUserGoodsVo> sendTenClassGradeUser();
 
+    List<ClassGradeUserGoodsVo> sendTenAndFifteenClassGradeUser();
+
+    List<ClassGradeUserGoodsVo> checkTenClassGradeUser(@Param("userId") Long userId,@Param("startTime") Long startTime,@Param("endTime") Long endTime);
+
     List<ClassGradeUserGoodsVo> sendFiveClassGradeUser();
 
     Long selectUserCount(User bo);
@@ -123,4 +142,19 @@ public interface ClassGradeUserMapper extends BaseMapper<ClassGradeUser> {
     List<Long> getFinishRequiredCourse(ClassGradeUserQueryBo bo);
 
 
+    OrderGoods getOrderGoods(@Param("userId") Long userId, @Param("goodsId")Long goodsId);
+
+    @InterceptorIgnore(tenantLine = "true")
+    List<ClassPeriodStudentNewVo> listUserPeriodNew(ClassGradeUserQueryBo bo);
+
+    @InterceptorIgnore(tenantLine = "true")
+    Long listUserPeriodNew_COUNT(ClassGradeUserQueryBo bo);
+
+    @InterceptorIgnore(tenantLine = "true")
+    Long getEduIdByTenant(@Param("tenantId") Long tenantId,@Param("eduName") String eduName);
+
+    @InterceptorIgnore(tenantLine = "true")
+    Long getProIdByTenant(@Param("tenantId") Long tenantId,@Param("proName") String proName,@Param("eduId") Long eduId);
+
+    Long listUserPeriodTotal(Integer periodStatus);
 }

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/IClassGradeService.java

@@ -58,6 +58,8 @@ public interface IClassGradeService extends IService<ClassGrade> {
 
 	List<ClassGradeStudentVo> listGradeAll(ClassGradeUserQueryBo bo);
 
+	List<ClassGradeStudentAllExportVo> listGradeAllExport(ClassGradeUserQueryBo bo);
+
     boolean editUserGrade(ClassGradeUserAddQueryBo bo);
 
 	List<ClassGradeUserListVo> listGradeInform(ClassGradeQueryBo bo);

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

@@ -95,6 +95,8 @@ public interface IClassGradeUserService extends IService<ClassGradeUser> {
 
 	List<ClassPeriodStudentVo> listUserPeriodRecord(ClassGradeUserQueryBo bo);
 
+	List<ClassPeriodStudentExportProcessVo> exportListUserPeriodRecord(ClassGradeUserQueryBo bo);
+
 	List<ClassPeriodStudentVo> listUserPeriodWeekRecord(ClassGradeUserQueryBo bo);
 
 	List<ClassPeriodStudentVo> listUserVideoRecord(ClassGradeUserQueryBo bo);
@@ -125,6 +127,9 @@ public interface IClassGradeUserService extends IService<ClassGradeUser> {
 
 	List<ClassGradeUserGoodsVo> sendTenClassGradeUser();
 
+
+	List<ClassGradeUserGoodsVo> checkTenClassGradeUser(ClassGradeUserQueryBo bo);
+
 	List<ClassGradeUserGoodsVo> sendFiveClassGradeUser();
 
 	Long selectList(User bo);
@@ -159,4 +164,13 @@ public interface IClassGradeUserService extends IService<ClassGradeUser> {
 	boolean resetQdyCheckInfo();
 
 	List<ClassPeriodStudentVo> listUserPeriodRecordNew(ClassGradeUserQueryBo bo);
+
+    List<ClassPeriodStudentNewVo> listUserPeriodNew(ClassGradeUserQueryBo bo);
+
+    List<ClassPeriodStudentVo> listUserVideoRecordNew(ClassGradeUserQueryBo bo);
+
+	List<ClassPeriodStudentVo> listUserPeriodManage(ClassGradeUserQueryBo bo);
+
+	UserPeriodTotalVo listUserPeriodTotal(ClassGradeUserQueryBo bo);
+
 }

+ 129 - 22
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/impl/ClassGradeServiceImpl.java

@@ -660,8 +660,8 @@ public class ClassGradeServiceImpl extends ServiceImpl<ClassGradeMapper, ClassGr
                     }
                 }
             }
-
-            if (bo.getStatus() != -1) {
+            if(Validator.isNotEmpty(bo.getStatus())){
+                if (bo.getStatus() != -1) {
            /* LambdaQueryWrapper<ClassGrade> lqw = Wrappers.lambdaQuery();
             lqw.eq(ClassGrade::getClassName, update.getClassName());
             lqw.eq(ClassGrade::getStatus, 1);
@@ -676,31 +676,32 @@ public class ClassGradeServiceImpl extends ServiceImpl<ClassGradeMapper, ClassGr
                     throw new RuntimeException("班级名称不能重复");
                 }
             }*/
-            }
-            if (bo.getStatus() == -1) { //删除判断班级是否人数空
-                ClassGradeUserQueryBo classGradeUserQueryBo = new ClassGradeUserQueryBo();
-                classGradeUserQueryBo.setGradeId(bo.getGradeId());
-                List<ClassGradeStudentVo> list = this.listGrade(classGradeUserQueryBo);
-                if (list.size() > 0) {
-                    throw new RuntimeException("班级还有学员,无法删除");
-                }
-                ClassGrade grade = getById(bo.getGradeId());
-                if (StringUtils.isNotBlank(grade.getOfficialName())) {
-                    throw new RuntimeException("二建/二造班级无法删除,请联系技术人员!");
                 }
-            }
-            if (bo.getStatus() == 0) {  //更新为无效
-                ClassGradeVo oldGrade = this.queryById(bo.getGradeId());
-                if (oldGrade.getStatus() == 1) {
+                if (bo.getStatus() == -1) { //删除判断班级是否人数空
                     ClassGradeUserQueryBo classGradeUserQueryBo = new ClassGradeUserQueryBo();
                     classGradeUserQueryBo.setGradeId(bo.getGradeId());
                     List<ClassGradeStudentVo> list = this.listGrade(classGradeUserQueryBo);
                     if (list.size() > 0) {
-                        throw new RuntimeException("班级还有学员,无法设置为无效");
+                        throw new RuntimeException("班级还有学员,无法删除");
+                    }
+                    ClassGrade grade = getById(bo.getGradeId());
+                    if (StringUtils.isNotBlank(grade.getOfficialName())) {
+                        throw new RuntimeException("二建/二造班级无法删除,请联系技术人员!");
                     }
                 }
-                if (StringUtils.isNotBlank(oldGrade.getOfficialName()) && sysTenant.getShareClass() == 1) {
-                    throw new RuntimeException("二建/二造班级无法设置为无效,请联系技术人员!");
+                if (bo.getStatus() == 0) {  //更新为无效
+                    ClassGradeVo oldGrade = this.queryById(bo.getGradeId());
+                    if (oldGrade.getStatus() == 1) {
+                        ClassGradeUserQueryBo classGradeUserQueryBo = new ClassGradeUserQueryBo();
+                        classGradeUserQueryBo.setGradeId(bo.getGradeId());
+                        List<ClassGradeStudentVo> list = this.listGrade(classGradeUserQueryBo);
+                        if (list.size() > 0) {
+                            throw new RuntimeException("班级还有学员,无法设置为无效");
+                        }
+                    }
+                    if (StringUtils.isNotBlank(oldGrade.getOfficialName()) && sysTenant.getShareClass() == 1) {
+                        throw new RuntimeException("二建/二造班级无法设置为无效,请联系技术人员!");
+                    }
                 }
             }
             //更改班主任
@@ -876,6 +877,9 @@ public class ClassGradeServiceImpl extends ServiceImpl<ClassGradeMapper, ClassGr
         if(Validator.isNotEmpty(entity.getOfficialName())){
             entity.setOfficialName(entity.getOfficialName().trim());
         }
+        if(Validator.isNotEmpty(entity.getPastDueDay())&&entity.getPastDueDay()<10){
+            throw new CustomException("班级提前截止天数错误");
+        }
     }
 
     @Override
@@ -975,6 +979,69 @@ public class ClassGradeServiceImpl extends ServiceImpl<ClassGradeMapper, ClassGr
 
             }
 
+          /*  List<Long> timeList = classGradeUserMapper.selectStart(classGradeStudentVo.getUserId(), classGradeStudentVo.getGoodsId(), classGradeStudentVo.getGradeId(),classGradeStudentVo.getOrderGoodsId());
+            if (!org.springframework.util.CollectionUtils.isEmpty(timeList)) {
+                //查找开始学习时间
+                classGradeStudentVo.setStartTime(timeList.get(0));
+            }else{
+                classGradeStudentVo.setStartTime(classGradeUserMapper.selectStartNoPhoto(classGradeStudentVo.getUserId(), classGradeStudentVo.getGoodsId(), classGradeStudentVo.getGradeId(),classGradeStudentVo.getOrderGoodsId())
+                );
+            }*/
+            //BigDecimal divide = new BigDecimal(studyLong.toString()).divide(new BigDecimal(secLong.toString()),2,BigDecimal.ROUND_HALF_UP);
+            //classGradeStudentVo.setStudyNum(divide.multiply(new BigDecimal("100")).longValue());
+            classGradeStudentVo.setSecAllNum(secLong);
+            classGradeStudentVo.setStuAllNum(studyLong);
+            /*UserUpdateQueryBo userUpdateQueryBo = new UserUpdateQueryBo();
+            userUpdateQueryBo.setUserId(classGradeStudentVo.getUserId());
+            classGradeStudentVo.setUserUpdates(iUserUpdateService.queryList(userUpdateQueryBo));*/
+            /*if (Validator.isNotEmpty(classGradeStudentVo.getRebuyOrderGoodsId()) && classGradeStudentVo.getRebuyOrderGoodsId().longValue() > 0) {
+                classGradeStudentVo.setRebuy(orderMapper.getGradePeriod(classGradeStudentVo.getRebuyOrderGoodsId(), classGradeStudentVo.getUserId()));
+            }*/
+/*            if (ObjectUtils.isNotNull(classGradeStudentVo.getOrgId())){
+                SysTenant tenant = iSysTenantService.getById(classGradeStudentVo.getOrgId());
+                if (ObjectUtils.isNotNull(tenant)){
+                    classGradeStudentVo.setTenantName(tenant.getTenantName());
+                }
+            }*/
+        }
+        return classGradeStudentVos;
+    }
+
+    @Override
+    public List<ClassGradeStudentAllExportVo> listGradeAllExport(ClassGradeUserQueryBo bo) {
+        if (Validator.isNotEmpty(bo.getIdCard()) && Validator.isNotEmpty(bo.getIdCards())) {
+            String idCard = bo.getIdCard();
+            List<String> idCards = bo.getIdCards();
+            Set<String> set = new HashSet<>();
+            for (String id : idCards) {
+                set.add(id);
+            }
+            set.add(idCard);
+            if (Validator.isNotEmpty(set)) {
+                bo.setIdCards(new ArrayList<>(set));
+            }
+            bo.setIdCard(null);
+        }
+        //查找班级学员
+        List<ClassGradeStudentVo> classGradeStudentVos = baseMapper.listGradeAll(bo);
+        List<ClassGradeStudentAllExportVo> eList = new ArrayList<>();
+        //得到每个学员的课程学习记录
+        for (ClassGradeStudentVo classGradeStudentVo : classGradeStudentVos) {
+            Long secLong = 0L;
+            Long studyLong = 0L;
+
+            SubjectStudyRecordQueryBo subjectStudyRecordQueryBo = new SubjectStudyRecordQueryBo();
+            subjectStudyRecordQueryBo.setGoodsId(classGradeStudentVo.getGoodsId());
+            subjectStudyRecordQueryBo.setUserId(classGradeStudentVo.getUserId());
+            subjectStudyRecordQueryBo.setGradeId(bo.getGradeId());
+            subjectStudyRecordQueryBo.setOrderGoodsId(classGradeStudentVo.getOrderGoodsId());
+            List<SubjectStudyRecordVo> subjectStudyRecordVos = iUserStudyRecordService.listSubject(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();
+
+            }
+
             List<Long> timeList = classGradeUserMapper.selectStart(classGradeStudentVo.getUserId(), classGradeStudentVo.getGoodsId(), classGradeStudentVo.getGradeId(),classGradeStudentVo.getOrderGoodsId());
             if (!org.springframework.util.CollectionUtils.isEmpty(timeList)) {
                 //查找开始学习时间
@@ -999,8 +1066,48 @@ public class ClassGradeServiceImpl extends ServiceImpl<ClassGradeMapper, ClassGr
                     classGradeStudentVo.setTenantName(tenant.getTenantName());
                 }
             }
+            ClassGradeStudentAllExportVo exportVo = BeanUtil.toBean(classGradeStudentVo,ClassGradeStudentAllExportVo.class);
+            exportVo.setHourStr((classGradeStudentVo.getRecordNum()+classGradeStudentVo.getStuAllNum())+"/"+(classGradeStudentVo.getExamNum()+classGradeStudentVo.getSecAllNum()));
+            exportVo.setServiceTimeStr(DateUtils.timestampToDateFormat(classGradeStudentVo.getServiceStartTime(),DateUtils.YYYY_MM_DD_HH_MM_SS)+"至"+DateUtils.timestampToDateFormat(classGradeStudentVo.getServiceEndTime(),DateUtils.YYYY_MM_DD_HH_MM_SS));
+            exportVo.setVideoStr(classGradeStudentVo.getStuAllNum()+"/"+classGradeStudentVo.getSecAllNum());
+            exportVo.setExamStr(classGradeStudentVo.getRecordNum()+"/"+classGradeStudentVo.getExamNum());
+            exportVo.setStudyStartStr(DateUtils.timestampToDateFormat(classGradeStudentVo.getStartTime(),DateUtils.YYYY_MM_DD_HH_MM_SS));
+            exportVo.setStudyEndStr(DateUtils.timestampToDateFormat(classGradeStudentVo.getEndTime(),DateUtils.YYYY_MM_DD_HH_MM_SS));
+            if(classGradeStudentVo.getPeriodStatus()==-1||classGradeStudentVo.getPeriodStatus()==0){
+                exportVo.setStudyStatusStr("未学完");
+            }else{
+                exportVo.setStudyStatusStr("已完成");
+            }
+            if(Validator.isEmpty(classGradeStudentVo.getStudyCount())){
+                classGradeStudentVo.setStudyCount(0L);
+            }
+            if(Validator.isEmpty(classGradeStudentVo.getUseStudyCount())){
+                classGradeStudentVo.setUseStudyCount(0);
+            }
+            exportVo.setTotalStudyCount(classGradeStudentVo.getUseStudyCount()+classGradeStudentVo.getStudyCount().intValue());
+            if(Validator.isNotEmpty(classGradeStudentVo.getUserStatus())&&classGradeStudentVo.getUserStatus()==1){
+                exportVo.setUserStatus("变更");
+            }else{
+                exportVo.setUserStatus("未变更");
+            }
+            if(Validator.isNotEmpty(classGradeStudentVo.getOfficialStatus())&&classGradeStudentVo.getOfficialStatus()==1){
+                exportVo.setOfficialStatus("是");
+            }else{
+                exportVo.setOfficialStatus("否");
+            }
+            if(Validator.isNotEmpty(classGradeStudentVo.getPeriodStatus())&&classGradeStudentVo.getPeriodStatus()==1){
+                exportVo.setPeriodStatus("通过");
+            }else{
+                exportVo.setPeriodStatus("未通过");
+            }
+            if(Validator.isNotEmpty(classGradeStudentVo.getPeriodPlush())&&classGradeStudentVo.getPeriodPlush()==1){
+                exportVo.setPeriodPlush("是");
+            }else{
+                exportVo.setPeriodPlush("否");
+            }
+            eList.add(exportVo);
         }
-        return classGradeStudentVos;
+        return eList;
     }
 
     @Override
@@ -1735,7 +1842,7 @@ public class ClassGradeServiceImpl extends ServiceImpl<ClassGradeMapper, ClassGr
     @Override
     public List<ClassGradeVo> searchGradeList(ClassGradeQueryBo bo) {
         List<ClassGradeVo> classGradeVos = entity2Vo(baseMapper.searchGradeList(bo));
-        if (CollectionUtils.isEmpty(classGradeVos)) {
+        if (Validator.isEmpty(classGradeVos)||CollectionUtils.isEmpty(classGradeVos)) {
             return new ArrayList<>();
         }
         classGradeVos.forEach(item -> {

+ 216 - 9
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/impl/ClassGradeUserServiceImpl.java

@@ -67,8 +67,10 @@ import com.zhongzheng.modules.order.service.IOrderInputService;
 import com.zhongzheng.modules.order.service.IOrderService;
 import com.zhongzheng.modules.order.vo.OrderGoodsVo;
 import com.zhongzheng.modules.system.domain.SysOldOrg;
+import com.zhongzheng.modules.system.domain.SysTenant;
 import com.zhongzheng.modules.system.service.ISysConfigService;
 import com.zhongzheng.modules.system.service.ISysOldOrgService;
+import com.zhongzheng.modules.system.service.ISysTenantService;
 import com.zhongzheng.modules.system.service.ISysUserService;
 import com.zhongzheng.modules.user.bo.*;
 import com.zhongzheng.modules.user.domain.User;
@@ -77,6 +79,7 @@ import com.zhongzheng.modules.user.mapper.UserStudyRecordPhotoMapper;
 import com.zhongzheng.modules.user.service.*;
 import com.zhongzheng.modules.user.vo.*;
 import org.apache.commons.lang3.StringUtils;
+import org.apache.ibatis.annotations.Param;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -129,6 +132,9 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
     @Autowired
     private ISysUserService iSysUserService;
 
+    @Autowired
+    private ISysTenantService iSysTenantService;
+
     @Autowired
     private IOrderService iOrderService;
 
@@ -181,6 +187,9 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
     @Autowired
     private IUserExamRecordService iUserExamRecordService;
 
+    @Autowired
+    private IMajorService iMajorService;
+
     @Value("${aliyun.oss.endpoint}")
     private String ALIYUN_OSS_ENDPOINT;
 
@@ -217,8 +226,6 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
     @Autowired
     private ISysOldOrgService sysOldOrgService;
 
-    @Autowired
-    private IMajorService iMajorService;
 
     @Autowired
     private IGoodsAttachedService iGoodsAttachedService;
@@ -660,6 +667,8 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
             return "用户信息缺失";
         }
         userVo.setRealName(ToolsUtils.removeAllTrim(userVo.getRealName()));
+        userVo.setIdCard(ToolsUtils.removeAllTrim(userVo.getIdCard()));
+        userVo.setTelPhone(ToolsUtils.removeAllTrim(userVo.getTelPhone()));
         if(fullName.contains("继续教育")&&fullName.contains("施工现场专业人员")){
             return pushSevenOfficialInfo(bo,userVo,orderGoods,goods);
         }
@@ -787,6 +796,8 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
         if (Validator.isEmpty(userVo.getEduLevel()) || Validator.isEmpty(userVo.getCompanyName()) || Validator.isEmpty(userVo.getSex())) {
             return "用户详细信息缺失";
         }
+        userVo.setCompanyName(ToolsUtils.removeAllTrim(userVo.getCompanyName()));
+        userVo.setEduLevel(ToolsUtils.removeAllTrim(userVo.getEduLevel()));
         if(Validator.isEmpty(goods.getMajorId())){
             throw new CustomException("商品专业不存在");
         }
@@ -940,6 +951,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
     @Override
     public boolean resetQdyCheckInfo(){
         this.baseMapper.updateListUserNoTenant("培训周期时间未到");
+        this.baseMapper.updateListUserNoTenant("无需2024继续教育");
         return true;
     }
 
@@ -972,6 +984,137 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
         return classPeriodStudentVos;
     }
 
+    @Override
+    public List<ClassPeriodStudentNewVo> listUserPeriodNew(ClassGradeUserQueryBo bo) {
+        //查询机构
+        String tenantId = ServletUtils.getRequest().getHeader("TenantId");
+        SysTenant sysTenant = iSysTenantService.getById(tenantId);
+        if (ObjectUtils.isNotNull(sysTenant) && sysTenant.getSevenClass() == 1){
+            //七大员继教共享祥粤
+            List<SysTenant> sysTenants = iSysTenantService.list(new LambdaQueryWrapper<SysTenant>()
+                    .eq(SysTenant::getSevenClass, 1)
+                    .eq(SysTenant::getStatus, 1));
+            if (!CollectionUtils.isEmpty(sysTenants)){
+                List<Long> tenantIds = new ArrayList<>();
+                List<Long> educationTypeIds = new ArrayList<>();
+                List<Long> projectIds = new ArrayList<>();
+                for (SysTenant tenant : sysTenants) {
+                    tenantIds.add(tenant.getTenantId());
+                    Long eduId = baseMapper.getEduIdByTenant(tenant.getTenantId(),"继续教育");
+                    if (ObjectUtils.isNotNull(eduId)){
+                        educationTypeIds.add(eduId);
+                        Long proId = baseMapper.getProIdByTenant(tenant.getTenantId(),"继续教育",eduId);
+                        if (ObjectUtils.isNotNull(proId)){
+                            projectIds.add(proId);
+                        }
+                    }
+                }
+                bo.setTenantIds(tenantIds);
+                bo.setEducationTypeIds(educationTypeIds);
+                bo.setProjectIds(projectIds);
+            }
+        }else {
+            bo.setTenantIds(Arrays.asList(Long.valueOf(tenantId)));
+            bo.setEducationTypeIds(Arrays.asList(bo.getEducationId()));
+            bo.setProjectIds(Arrays.asList(bo.getProjectId()));
+        }
+        //查询班级学员信息
+        List<ClassPeriodStudentNewVo> classPeriodStudentVos = baseMapper.listUserPeriodNew(bo);
+        //查找学员学习记录
+        for (ClassPeriodStudentNewVo classPeriodStudentVo : classPeriodStudentVos) {
+            classPeriodStudentVo.setIdCard(EncryptHandler.decrypt(classPeriodStudentVo.getIdCard()));
+            classPeriodStudentVo.setTelPhone(EncryptHandler.decrypt(classPeriodStudentVo.getTelPhone()));
+            List<Long> timeList = baseMapper.selectStartNew(classPeriodStudentVo.getUserId(), classPeriodStudentVo.getGoodsId(), classPeriodStudentVo.getGradeId(),classPeriodStudentVo.getOrderGoodsId());
+            if (!CollectionUtils.isEmpty(timeList)) {
+                //查找开始学习时间
+                classPeriodStudentVo.setStartTime(timeList.get(0));
+            }else{
+                classPeriodStudentVo.setStartTime(baseMapper.selectStartNoPhotoNew(classPeriodStudentVo.getUserId(), classPeriodStudentVo.getGoodsId(), classPeriodStudentVo.getGradeId(),classPeriodStudentVo.getOrderGoodsId())
+                );
+            }
+        }
+        return classPeriodStudentVos;
+    }
+
+    @Override
+    public List<ClassPeriodStudentVo> listUserVideoRecordNew(ClassGradeUserQueryBo bo) {
+        //查询机构
+        String tenantId = ServletUtils.getRequest().getHeader("TenantId");
+        SysTenant sysTenant = iSysTenantService.getById(tenantId);
+        if (ObjectUtils.isNotNull(sysTenant) && sysTenant.getSevenClass() == 1){
+            //七大员继教共享祥粤
+            List<SysTenant> sysTenants = iSysTenantService.list(new LambdaQueryWrapper<SysTenant>()
+                    .eq(SysTenant::getSevenClass, 1)
+                    .eq(SysTenant::getStatus, 1));
+            if (!CollectionUtils.isEmpty(sysTenants)){
+                List<Long> tenantIds = new ArrayList<>();
+                List<Long> educationTypeIds = new ArrayList<>();
+                List<Long> projectIds = new ArrayList<>();
+                for (SysTenant tenant : sysTenants) {
+                    tenantIds.add(tenant.getTenantId());
+                    Long eduId = baseMapper.getEduIdByTenant(tenant.getTenantId(),"继续教育");
+                    if (ObjectUtils.isNotNull(eduId)){
+                        educationTypeIds.add(eduId);
+                        Long proId = baseMapper.getProIdByTenant(tenant.getTenantId(),"继续教育",eduId);
+                        if (ObjectUtils.isNotNull(proId)){
+                            projectIds.add(proId);
+                        }
+                    }
+                }
+                bo.setTenantIds(tenantIds);
+                bo.setEducationTypeIds(educationTypeIds);
+                bo.setProjectIds(projectIds);
+            }
+        }else {
+            bo.setTenantIds(Arrays.asList(Long.valueOf(tenantId)));
+            bo.setEducationTypeIds(Arrays.asList(bo.getEducationId()));
+            bo.setProjectIds(Arrays.asList(bo.getProjectId()));
+        }
+        //查询班级学员信息
+        List<ClassPeriodStudentVo> classPeriodStudentVos = baseMapper.listUserVideoRecordNew(bo);
+        //查找学员学习记录
+        for (ClassPeriodStudentVo classPeriodStudentVo : classPeriodStudentVos) {
+            //取学时所有拍照最新的一张
+            String recentPhoto = userStudyRecordPhotoMapper.selectGradeRecentOnePhotoNew(classPeriodStudentVo.getUserId(), classPeriodStudentVo.getGradeId(),classPeriodStudentVo.getOrderGoodsId());
+            if (Validator.isNotEmpty(recentPhoto)) {
+                classPeriodStudentVo.setIdCardImg1(recentPhoto);
+            }
+        }
+        return classPeriodStudentVos;
+    }
+
+    @Override
+    public List<ClassPeriodStudentVo> listUserPeriodManage(ClassGradeUserQueryBo bo) {
+        //查询班级学员信息
+        List<ClassPeriodStudentVo> classPeriodStudentVos = baseMapper.listUserPeriod(bo);
+        //查找学员学习记录
+        for (ClassPeriodStudentVo classPeriodStudentVo : classPeriodStudentVos) {
+            List<Long> timeList = baseMapper.selectStart(classPeriodStudentVo.getUserId(),
+                    classPeriodStudentVo.getGoodsId(), classPeriodStudentVo.getGradeId(),classPeriodStudentVo.getOrderGoodsId());
+            if (!CollectionUtils.isEmpty(timeList)) {
+                //查找开始学习时间
+                classPeriodStudentVo.setStartTime(timeList.get(0));
+            }else{
+                classPeriodStudentVo.setStartTime(baseMapper.selectStartNoPhoto(classPeriodStudentVo.getUserId(),
+                        classPeriodStudentVo.getGoodsId(), classPeriodStudentVo.getGradeId(),classPeriodStudentVo.getOrderGoodsId())
+                );
+            }
+        }
+        return classPeriodStudentVos;
+    }
+
+    @Override
+    public UserPeriodTotalVo listUserPeriodTotal(ClassGradeUserQueryBo bo) {
+        Long firstPeriodNum = baseMapper.listUserPeriodTotal(2);
+        Long recheckNum = baseMapper.listUserPeriodTotal(3);
+        Long noPassNum = baseMapper.listUserPeriodTotal(0);
+        UserPeriodTotalVo totalVo = new UserPeriodTotalVo();
+        totalVo.setFirstPeriodNum(firstPeriodNum);
+        totalVo.setRecheckNum(recheckNum);
+        totalVo.setNoPassNum(noPassNum);
+        return totalVo;
+    }
+
     @Override
     public ClassPeriodStudentVo DecryptOfficialInfo(ClassGradeDecryptQueryBo bo) {
         String pars;
@@ -2074,7 +2217,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
             }
 
             //查询学员最近人脸照
-            LambdaQueryWrapper<UserStudyRecordPhoto> lqw = Wrappers.lambdaQuery();
+           /* LambdaQueryWrapper<UserStudyRecordPhoto> lqw = Wrappers.lambdaQuery();
             lqw.eq(UserStudyRecordPhoto::getUserId, classPeriodStudentVo.getUserId());
             lqw.orderByDesc(UserStudyRecordPhoto::getCreateTime).last(" limit 5");
             List<UserStudyRecordPhoto> userStudyRecordPhotoList = iUserStudyRecordPhotoService.list(lqw);
@@ -2084,7 +2227,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                     recenPhotosList.add(userStudyRecordPhoto.getPhoto());
                 }
             });
-            classPeriodStudentVo.setRecenPhotosList(recenPhotosList);
+            classPeriodStudentVo.setRecenPhotosList(recenPhotosList);*/
         }
         return classPeriodStudentVos;
     }
@@ -2167,6 +2310,43 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
         return classPeriodStudentVos;
     }
 
+    @Override
+    public List<ClassPeriodStudentExportProcessVo> exportListUserPeriodRecord(ClassGradeUserQueryBo bo) {
+        //查询班级学员信息
+        List<ClassPeriodStudentVo> classPeriodStudentVos = baseMapper.exportUserPeriod(bo);
+        List<ClassPeriodStudentExportProcessVo> exlist = new ArrayList<>();
+        //查找学员学习记录
+        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());
+            List<SubjectStudyRecordVo> subjectStudyRecordVos = iUserStudyRecordService.listSubject(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);
+
+            ClassPeriodStudentExportProcessVo vo = BeanUtil.toBean(classPeriodStudentVo,ClassPeriodStudentExportProcessVo.class);
+            String process = (studyLong+classPeriodStudentVo.getRecordNum())+"/"+(secLong+classPeriodStudentVo.getExamNum());
+            vo.setProcess(process);
+
+            Major major = iMajorService.getById(classPeriodStudentVo.getMajorId());
+            if (ObjectUtils.isNotNull(major)){
+                vo.setCategoryName(major.getCategoryName());
+            }
+            exlist.add(vo);
+        }
+        return exlist;
+    }
+
     @Override
     public List<ClassPeriodStudentVo> listUserPeriodWeekRecord(ClassGradeUserQueryBo bo) {
         //查询班级学员信息
@@ -3597,6 +3777,21 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
         return newList;
     }
 
+    @Override
+    public List<ClassGradeUserGoodsVo> checkTenClassGradeUser(ClassGradeUserQueryBo bo) {
+        Long startTime = 16*24*3600L;
+        Long endTime = 1*24*3600L;
+        List<ClassGradeUserGoodsVo> list = baseMapper.checkTenClassGradeUser(bo.getUserId(),startTime,endTime);
+        List<ClassGradeUserGoodsVo> list1 = new ArrayList<>();
+        for(ClassGradeUserGoodsVo vo : list){
+            String businessName = iGoodsService.getGoodsBusinessName(vo.getGoodsId());
+            if (businessName.contains("继续教育二级建造师") ){
+                list1.add(vo);
+            }
+        }
+        return list1;
+    }
+
     @Override
     public List<ClassGradeUserGoodsVo> sendFiveClassGradeUser() {
         List<ClassGradeUserGoodsVo> userList = baseMapper.sendFiveClassGradeUser();
@@ -3754,6 +3949,18 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
         //查询旧系统是否有学习
         String businessName = iGoodsService.getGoodsBusinessName(bo.getGoodsId());
         if (businessName.contains("继续教育二级建造师") || businessName.contains("继续教育二级造价师")){
+            OrderGoods orderGoods = baseMapper.getOrderGoods(bo.getUserId(),bo.getGoodsId());
+            if (ObjectUtils.isNotNull(orderGoods)){
+                ClassGradeUser classGradeUser = getOne(new LambdaQueryWrapper<ClassGradeUser>()
+                        .eq(ClassGradeUser::getOrderGoodsId, orderGoods.getOrderGoodsId())
+                        .eq(ClassGradeUser::getUserId, bo.getUserId())
+                        .eq(ClassGradeUser::getStatus, 1)
+                        .last("limit 1"));
+                if (ObjectUtils.isNotNull(classGradeUser) && ObjectUtils.isNotNull(classGradeUser.getPeriodWaitTime())){
+                    //重修
+                    return 0L;
+                }
+            }
             User user = iUserService.getById(bo.getUserId());
             Integer type = "继续教育二级建造师".equals(businessName)?1:2;
             String param = String.format("idnum=%s&type=%s",EncryptHandler.decrypt(user.getIdCard()),type);
@@ -3769,12 +3976,11 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
             } catch (Exception e) {
                 throw new CustomException(e.getMessage());
             }
-        }
-        Long aLong = baseMapper.checkFinishRequiredCourse(bo);
-        if (aLong > 0){
             List<Long> goodsIds = baseMapper.getFinishRequiredCourse(bo);
-            Goods goods = iGoodsService.getById(goodsIds.get(0));
-            throw new CustomException("请按顺序学习,把【"+goods.getGoodsName()+"】学习完成,再学习另一个课程");
+            if(Validator.isNotEmpty(goodsIds)&&goodsIds.size()>0){
+                Goods goods = iGoodsService.getById(goodsIds.get(0));
+                throw new CustomException("请按顺序学习,把【"+goods.getGoodsName()+"】学习完成,再学习另一个课程");
+            }
         }
         return 0L;
     }
@@ -3858,6 +4064,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
         gradeUser.setId(bo.getGradeUserId());
         gradeUser.setSevenPushCheck(bo.getPushStatus()+1);
         gradeUser.setSevenPushReason(bo.getSevenPushReason());
+        gradeUser.setSevenPushDate(bo.getSevenPushDate());
         gradeUser.setUpdateTime(DateUtils.getNowTime());
         return this.baseMapper.updateGradeUser(gradeUser);
     }

+ 38 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/impl/UserPeriodServiceImpl.java

@@ -20,7 +20,10 @@ 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.base.bo.UserProfileFit;
+import com.zhongzheng.modules.base.domain.UserProfile;
 import com.zhongzheng.modules.base.service.ICertificateTpService;
+import com.zhongzheng.modules.base.service.IUserProfileService;
 import com.zhongzheng.modules.course.bo.CourseBusinessQueryBo;
 import com.zhongzheng.modules.course.bo.CourseChapterSectionQueryBo;
 import com.zhongzheng.modules.course.bo.CourseMenuQueryBo;
@@ -208,12 +211,18 @@ public class UserPeriodServiceImpl extends ServiceImpl<UserPeriodMapper, UserPer
     @Autowired
     private ICourseModuleService iCourseModuleService;
 
+    @Autowired
+    private IUserProfileService iUserProfileService;
+
     @Value("${oldStudySys.syncPath}")
     private String SYNC_PATH;
 
     @Value("${exam.subscribeSave}")
     private String EXAM_SUBSCRIBE_SAVE;
 
+    @Value("${aliyun.oss.endpoint}")
+    private String ALIYUN_OSS_ENDPOINT;
+
     @Override
     public UserPeriodVo queryById(Long id) {
         UserPeriod db = this.baseMapper.selectById(id);
@@ -731,6 +740,35 @@ public class UserPeriodServiceImpl extends ServiceImpl<UserPeriodMapper, UserPer
         studyRec.setCourseBuyTime(DateUtils.timestampToDateFormat(orderGoods.getCreateTime(),DateUtils.YYYY_MM_DD_HH_MM_SS));
         studyRec.setClassNo(classGrade.getOfficialName());
         studyRec.setOrderGoodsId(orderGoods.getOrderGoodsId());
+        studyRec.setWorkYear(userVo.getWorkYear());
+        studyRec.setGraduationTime(userVo.getGraduationTime());
+        studyRec.setCompanyName(userVo.getCompanyName());
+        studyRec.setUnitContact(userVo.getUnitContact());
+        studyRec.setUnitTel(userVo.getUnitTel());
+        studyRec.setEduLevel(userVo.getEduLevel());
+        UserProfile profile = iUserProfileService.getOne(new LambdaQueryWrapper<UserProfile>()
+                .eq(UserProfile::getOrderGoodsId, gradeUser.getOrderGoodsId())
+                .eq(UserProfile::getTypeStatus, 1)
+                .eq(UserProfile::getCurrentStatus, 1)
+                .in(UserProfile::getStatus, new ArrayList<Integer>(Arrays.asList(1,2)))
+                .orderByDesc(UserProfile::getId)
+                .last("limit 1"));
+        if(Validator.isNotEmpty(profile)){
+            Map<String, String> maps = JSONObject.parseObject(profile.getKeyValue(), Map.class);
+            if(maps.containsKey("commitment_seal")){
+                String commitment_seal = ALIYUN_OSS_ENDPOINT + "/" + JSONObject.parseObject(String.valueOf(maps.get("commitment_seal")), UserProfileFit.class).getValue();
+                studyRec.setCommitmentSeal(commitment_seal);
+            }
+            if(maps.containsKey("school")){
+                String school = JSONObject.parseObject(String.valueOf(maps.get("school")), UserProfileFit.class).getValue();
+                studyRec.setSchool(school);
+            }
+            if(maps.containsKey("major")){
+                String major = JSONObject.parseObject(String.valueOf(maps.get("major")), UserProfileFit.class).getValue();
+                studyRec.setMajor(major);
+            }
+        }
+
         Long bmrq = 0L;
         if(Validator.isNotEmpty(classGrade.getClassStartTime())){
             if(classGrade.getClassStartTime().longValue()<orderGoods.getCreateTime().longValue()){

+ 99 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/vo/ClassGradeStudentAllExportVo.java

@@ -0,0 +1,99 @@
+package com.zhongzheng.modules.grade.vo;
+
+import com.zhongzheng.common.annotation.Excel;
+import com.zhongzheng.modules.user.vo.UserUpdateVo;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.util.List;
+
+
+/**
+ * 学员记录视图对象 mall_package
+ *
+ * @author ruoyi
+ * @date 2021-11-10
+ */
+@Data
+@ApiModel("学员视图对象")
+public class ClassGradeStudentAllExportVo {
+	private static final long serialVersionUID = 1L;
+
+
+	/** 学员编码 */
+	@Excel(name = "学员姓名")
+	@ApiModelProperty("学员姓名")
+	private String realname;
+
+
+	/** 学员编码 */
+	@Excel(name = "学员身份证")
+	@ApiModelProperty("学员身份证")
+	private String idCard;
+
+	/** 学员编码 */
+	@Excel(name = "学员电话")
+	@ApiModelProperty("学员电话")
+	private String telPhone;
+
+
+	@Excel(name = "工作单位")
+	private String companyName;
+
+	@ApiModelProperty("班级名称")
+	@Excel(name = "班级名称")
+	private String gradeName;
+
+	@Excel(name = "学时")
+	private String hourStr;
+
+	@Excel(name = "学习服务期")
+	@ApiModelProperty("学习服务期")
+	private String serviceTimeStr;
+
+	@Excel(name = "视频学习(节)")
+	private String videoStr;
+
+	@Excel(name = "做题进度(章卷)")
+	private String examStr;
+
+	@Excel(name = "学习开始")
+	private String studyStartStr;
+
+	@Excel(name = "学习结束")
+	private String studyEndStr;
+
+	@Excel(name = "学习状态")
+	private String studyStatusStr;
+
+	@Excel(name = "学习机会(总共)")
+	@ApiModelProperty("学习机会(总共)")
+	private Integer totalStudyCount;
+
+	@Excel(name = "学习机会(消耗)")
+	@ApiModelProperty("学习机会(消耗)")
+	private Integer useStudyCount;
+
+	@Excel(name = "学习机会(剩余)")
+	@ApiModelProperty("学习机会(剩余)")
+	private Long studyCount;
+
+	@Excel(name = "资料变更")
+	@ApiModelProperty("资料是否变更过 1变更 0未变更")
+	private String userStatus;
+
+	@Excel(name = "信息上报")
+	@ApiModelProperty("官方推送状态 1是 0否")
+	private String officialStatus;
+
+	@Excel(name = "学时审核")
+	@ApiModelProperty("学时审批状态 0 未通过 1通过 2待审核")
+	private String periodStatus;
+
+	@Excel(name = "学时上报")
+	@ApiModelProperty("是否学时推送 0未推送 1推送")
+	private String periodPlush;
+
+}

+ 8 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/vo/ClassGradeStudentVo.java

@@ -202,6 +202,9 @@ public class ClassGradeStudentVo {
 	@ApiModelProperty("项目名")
 	private String projectName;
 
+	@ApiModelProperty("教育名称")
+	private String educationName;
+
 	@ApiModelProperty("用户是否绑定微信")
 	private Integer userBindWx;
 	@ApiModelProperty("用户是否关注微信")
@@ -258,4 +261,9 @@ public class ClassGradeStudentVo {
 	@ApiModelProperty("审核状态  1通过 3不通过 2待审")
 	private Integer profileStatus;
 
+	/** 开班状态 0未开班 1开班 */
+	@Excel(name = "开班状态 0未开班 1开班")
+	@ApiModelProperty("开班状态 0未开班 1开班")
+	private Integer classStatus;
+
 }

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

@@ -178,4 +178,6 @@ public class ClassGradeUserVo {
 	private Integer sevenPushCheck;
 
 	private String sevenPushReason;
+
+	private String sevenPushDate;
 }

+ 7 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/vo/ClassGradeVo.java

@@ -220,4 +220,11 @@ public class ClassGradeVo {
 
 	@ApiModelProperty("七大员信息推送权限失败原因")
 	private String sevenPushReason;
+
+	@ApiModelProperty("审核通过时间")
+	private Long periodTime;
+
+	private String sevenPushDate;
+
+	private Integer pastDueDay;
 }

+ 92 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/vo/ClassPeriodStudentExportProcessVo.java

@@ -0,0 +1,92 @@
+package com.zhongzheng.modules.grade.vo;
+
+import com.zhongzheng.common.annotation.Excel;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.util.List;
+
+
+/**
+ * 学员记录视图对象 mall_package
+ *
+ * @author ruoyi
+ * @date 2021-11-10
+ */
+@Data
+@ApiModel("学员学时视图对象")
+public class ClassPeriodStudentExportProcessVo {
+	private static final long serialVersionUID = 1L;
+
+
+	/** 学员编码 */
+	@Excel(name = "学员姓名")
+	@ApiModelProperty("学员姓名")
+	private String realName;
+
+
+	/** 学员编码 */
+	@Excel(name = "学员身份证")
+	@ApiModelProperty("学员身份证")
+	private String idCard;
+
+	/** 学员编码 */
+	@Excel(name = "学员电话")
+	@ApiModelProperty("学员电话")
+	private String telPhone;
+
+
+	@Excel(name = "单号")
+	@ApiModelProperty("单号")
+	private String orderSn;
+
+
+	@Excel(name = "学习进度")
+	@ApiModelProperty("学习进度")
+	private String process;
+
+	/** 学习进度 */
+	@ApiModelProperty("已学节数")
+	private Long stuAllNum;
+
+
+	/** 学习进度 */
+	@ApiModelProperty("总节数")
+	private Long secAllNum;
+
+
+	/** 节数 */
+	@ApiModelProperty("试卷数")
+	private Long examNum;
+
+
+	/** 已做试卷 */
+	@ApiModelProperty("已做试卷")
+	private Long recordNum;
+
+
+	@ApiModelProperty("商品名称")
+	private String goodsName;
+
+	/** 业务名称 */
+	@ApiModelProperty("业务名称")
+	private String businessName;
+
+	/** 项目名称 */
+	@ApiModelProperty("项目名称")
+	private String projectName;
+
+
+	/** 项目名称 */
+	@ApiModelProperty("教育名")
+	private String educationName;
+
+	@Excel(name = "专业名")
+	@ApiModelProperty("专业名")
+	private String categoryName;
+
+
+
+}

+ 79 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/vo/ClassPeriodStudentNewVo.java

@@ -0,0 +1,79 @@
+package com.zhongzheng.modules.grade.vo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+
+/**
+ * 学员记录视图对象 mall_package
+ *
+ * @author ruoyi
+ * @date 2021-11-10
+ */
+@Data
+@ApiModel("学员学时视图对象")
+public class ClassPeriodStudentNewVo {
+	private static final long serialVersionUID = 1L;
+
+	/** $pkColumn.columnComment */
+	@ApiModelProperty("$pkColumn.columnComment")
+	private Long id;
+
+	/** 学员ID */
+	@ApiModelProperty("学员ID")
+	private Long userId;
+
+	/** 商品ID */
+	@ApiModelProperty("商品ID")
+	private Long goodsId;
+
+	/** 班级id */
+	@ApiModelProperty("班级id")
+	private Long gradeId;
+
+	/** 订单商品ID */
+	@ApiModelProperty("订单商品ID")
+	private Long orderGoodsId;
+
+	/** 1 进入 0移除 */
+	@ApiModelProperty("1 进入 0移除")
+	private Integer status;
+
+	/** 学员编码 */
+	@ApiModelProperty("学员姓名")
+	private String realName;
+
+	/** 学员编码 */
+	@ApiModelProperty("学员身份证")
+	private String idCard;
+
+	/** 学员编码 */
+	@ApiModelProperty("学员电话")
+	private String telPhone;
+
+	/** 学习有效期开始 */
+	@ApiModelProperty("学习开始")
+	private Long startTime;
+	/** 学习有效期结束 */
+	@ApiModelProperty("学习结束")
+	private Long endTime;
+
+	@ApiModelProperty("审核状态  1通过 3不通过 2待审")
+	private Integer profileStatus;
+
+	@ApiModelProperty("班级名称")
+	private String className;
+
+	@ApiModelProperty("商品名称")
+	private String goodsName;
+
+	@ApiModelProperty("学习年份")
+	private String sevenYear;
+
+	@ApiModelProperty("业务名称")
+	private String fullName;
+
+	private String tenantId;
+
+}

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

@@ -264,4 +264,9 @@ public class ClassPeriodStudentVo {
 	@ApiModelProperty("商品年份")
 	private String goodsYear;
 
+	@ApiModelProperty("订单号")
+	private String orderSn;
+
+	private Long majorId;
+
 }

+ 20 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/vo/SyncUserCourseStudyRec.java

@@ -2,6 +2,7 @@ package com.zhongzheng.modules.grade.vo;
 
 import cn.afterturn.easypoi.excel.annotation.ExcelTarget;
 import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
 import java.util.List;
@@ -49,4 +50,23 @@ public class SyncUserCourseStudyRec {
 
     private List<SyncUserChapterList> ChapterList;
 
+    @ApiModelProperty("工作年限")
+    private String workYear;
+    @ApiModelProperty("毕业时间")
+    private String graduationTime;
+    @ApiModelProperty("毕业专业")
+    private String major;
+    @ApiModelProperty("公司名称")
+    private String companyName;
+    @ApiModelProperty("单位联系人")
+    private String unitContact;
+    @ApiModelProperty("单位联系电话")
+    private String unitTel;
+    @ApiModelProperty("毕业学校")
+    private String school;
+    @ApiModelProperty("承诺书")
+    private String commitmentSeal;
+    @ApiModelProperty("学历")
+    private String eduLevel;
+
 }

+ 23 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/vo/UserPeriodTotalVo.java

@@ -0,0 +1,23 @@
+package com.zhongzheng.modules.grade.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @author yangdamao
+ * @date 2024年05月10日 14:15
+ */
+@Data
+public class UserPeriodTotalVo implements Serializable {
+
+    @ApiModelProperty("初审数量")
+    private Long firstPeriodNum;
+
+    @ApiModelProperty("复审数量")
+    private Long recheckNum;
+
+    @ApiModelProperty("不通过数量")
+    private Long noPassNum;
+}

+ 1 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/service/IOrderBusinessConfigService.java

@@ -39,7 +39,7 @@ public interface IOrderBusinessConfigService extends IService<OrderBusinessConfi
 	 */
 	Boolean insertByAddBo(OrderBusinessConfigAddBo bo);
 
-	OrderBusinessConfig insertByAddBoWithEntity(OrderBusinessConfigAddBo bo);
+	OrderBusinessConfigVo insertByAddBoWithEntity(OrderBusinessConfigAddBo bo);
 
 	/**
 	 * 根据编辑业务对象修改录单配置

+ 4 - 2
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/service/impl/OrderBusinessConfigServiceImpl.java

@@ -96,13 +96,15 @@ public class OrderBusinessConfigServiceImpl extends ServiceImpl<OrderBusinessCon
     }
 
     @Override
-    public OrderBusinessConfig insertByAddBoWithEntity(OrderBusinessConfigAddBo bo) {
+    public OrderBusinessConfigVo insertByAddBoWithEntity(OrderBusinessConfigAddBo bo) {
         OrderBusinessConfig add = BeanUtil.toBean(bo, OrderBusinessConfig.class);
         validEntityBeforeSave(add);
         add.setCreateTime(DateUtils.getNowTime());
         add.setUpdateTime(DateUtils.getNowTime());
         this.save(add);
-        return add;
+        OrderBusinessConfigQueryBo queryBo = new OrderBusinessConfigQueryBo();
+        queryBo.setId(add.getId());
+        return this.baseMapper.getDetail(queryBo);
     }
 
     @Override

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

@@ -646,7 +646,8 @@ public class OrderGoodsServiceImpl extends ServiceImpl<OrderGoodsMapper, OrderGo
                 if(Validator.isEmpty(classGradeVo)){
                     continue;
                 }
-                if (fullName.contains("继续教育")){
+                if (fullName.contains("继续教育") &&
+                        ((fullName.contains("二级建造师")) || (fullName.contains("二级造价师")) ||(fullName.contains("施工现场专业人员")))){
                     goodsVo.setGoodsName(classGradeVo.getClassName());
                 }
                 goodsVo.setPeriodStatus(classGradeVo.getPeriodStatus());
@@ -662,6 +663,8 @@ public class OrderGoodsServiceImpl extends ServiceImpl<OrderGoodsMapper, OrderGo
                 goodsVo.setLearnStatus(classGradeVo.getLearnStatus());
                 goodsVo.setPeriodWaitTime(classGradeVo.getPeriodWaitTime());
                 goodsVo.setSubscribeSign(0);
+                goodsVo.setSevenPushReason(classGradeVo.getSevenPushReason());
+                goodsVo.setSevenPushDate(classGradeVo.getSevenPushDate());
                 LambdaQueryWrapper<UserSubscribe> lq = Wrappers.lambdaQuery();
                 lq.eq(UserSubscribe::getOrderGoodsId, goodsVo.getOrderGoodsId());
                 lq.eq(UserSubscribe::getSubscribeStatus, 1);

+ 4 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/vo/OrderGoodsVo.java

@@ -386,4 +386,8 @@ public class OrderGoodsVo {
 
 	@ApiModelProperty("失败原因")
 	private String pushFailReason;
+
+	private String sevenPushReason;
+
+	private String sevenPushDate;
 }

+ 4 - 2
zhongzheng-system/src/main/java/com/zhongzheng/modules/schedule/service/IScheduleService.java

@@ -20,10 +20,12 @@ public interface IScheduleService extends IService<PolyvVideo> {
 
     void updateExamSend(UserQueryBo bo);
 
-    void timeSend(UserQueryBo bo);
-
     void sendServiceEnd();
 
+    void sendClassTenAndFifteenEnd();
+
+    void timeSend(UserQueryBo bo);
+
     void closeTimeOutOrder();
 
     void updateIssue(UserQueryBo bo) throws ParseException;

+ 58 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/schedule/service/impl/ScheduleServiceImpl.java

@@ -66,6 +66,7 @@ import com.zhongzheng.modules.goods.vo.GoodsVo;
 import com.zhongzheng.modules.grade.bo.ClassGradeQueryBo;
 import com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo;
 import com.zhongzheng.modules.grade.domain.*;
+import com.zhongzheng.modules.grade.mapper.ClassGradeUserMapper;
 import com.zhongzheng.modules.grade.service.*;
 import com.zhongzheng.modules.grade.vo.ClassGradeUserGoodsVo;
 import com.zhongzheng.modules.grade.vo.ClassGradeVo;
@@ -352,7 +353,8 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
     private ISysTaskService iSysTaskService;
     @Autowired
     private OssService ossService;
-
+    @Autowired
+    private ClassGradeUserMapper classGradeUserMapper;
 
     @Value("${aliyun.sms.OpenTheGoodsCode}")
     private String OpenTheGoodsCode;
@@ -402,6 +404,9 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
     @Value("${aliyun.sms.orderServiceEndRemind}")
     private String orderServiceEndRemind;
 
+    @Value("${aliyun.sms.classEndRemind}")
+    private String classEndRemind;
+
     @Autowired
     private RedisCache redisCache;
 
@@ -639,6 +644,58 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
 
     }
 
+    @Override
+    public void sendClassTenAndFifteenEnd() {
+        InformRemindVo informRemindVo = informRemindService.queryByName("二建继教班级有效期倒计时15,10天");
+        if(Validator.isNotEmpty(informRemindVo)){
+            List<ClassGradeUserGoodsVo> list = classGradeUserMapper.sendTenAndFifteenClassGradeUser();
+            for (ClassGradeUserGoodsVo goodsVo : list) {
+                GoodsVo goods = iGoodsService.queryById(goodsVo.getGoodsId());
+                if (!CollectionUtils.isEmpty(informRemindVo.getInformRemindBusiness()) && !CollectionUtils.isEmpty(informRemindVo.getInformRemindBusiness().stream().filter(informRemindBusinessVo -> informRemindBusinessVo.getBusinessId().equals(goods.getBusinessId())).collect(Collectors.toList()))) {
+                    UserVo userVo = iUserService.queryById(goodsVo.getUserId());
+                    int day = DateUtils.dayBetween(goodsVo.getClassEndTime(),DateUtils.getNowTime())-1;
+                    if (informRemindVo.getWayStatus().equals(1)) {
+                        InformUserAddBo informUserAddBo = new InformUserAddBo();
+                        informUserAddBo.setUserId(goodsVo.getUserId());
+                        informUserAddBo.setSendStatus(1);
+                        informUserAddBo.setSendTime(DateUtils.getNowTime());
+                        informUserAddBo.setCreateTime(DateUtils.getNowTime());
+                        informUserAddBo.setUpdateTime(DateUtils.getNowTime());
+                        informUserAddBo.setRemindId(informRemindVo.getId());
+                        informUserAddBo.setSystemStatus(1);
+                        informUserAddBo.setGradeId(goodsVo.getGradeId());
+                        informUserAddBo.setOrderGoodsId(goodsVo.getOrderGoodsId());
+                        informUserAddBo.setRemind("二建继教班级有效期还剩"+day+"天提醒");
+                        informUserAddBo.setGoodsId(goodsVo.getGoodsId());
+                        informUserAddBo.setText("尊敬的用户:您购买的课程二建继教班级有效期还剩"+day+"天,请在"+DateUtils.timestampToDateFormat(goodsVo.getClassEndTime(),DateUtils.YYYY__MM__DD)+"前完成学习及考试,到期未完成学时将清零,需重新学习。");
+                        iInformUserService.insertByAddBo(informUserAddBo);
+                    }
+                    if (informRemindVo.getNoteStatus().equals(1)) {
+                        InformUserAddBo informUserAddBo = new InformUserAddBo();
+                        informUserAddBo.setUserId(goodsVo.getUserId());
+                        informUserAddBo.setSendStatus(1);
+                        informUserAddBo.setSendTime(DateUtils.getNowTime());
+                        informUserAddBo.setCreateTime(DateUtils.getNowTime());
+                        informUserAddBo.setUpdateTime(DateUtils.getNowTime());
+                        informUserAddBo.setRemindId(informRemindVo.getId());
+                        informUserAddBo.setSystemStatus(3);
+                        informUserAddBo.setOrderGoodsId(goodsVo.getOrderGoodsId());
+                        informUserAddBo.setGradeId(goodsVo.getGradeId());
+                        informUserAddBo.setRemind("二建继教班级有效期还剩"+day+"天提醒");
+                        informUserAddBo.setGoodsId(goodsVo.getGoodsId());
+                        informUserAddBo.setText("尊敬的用户:您购买的课程二建继班级有效期还剩"+day+"天,请在"+DateUtils.timestampToDateFormat(goodsVo.getClassEndTime(),DateUtils.YYYY__MM__DD)+"前完成学习及考试,到期未完成学时将清零,需重新学习。");
+                        Map<String, Object> param = new HashMap<>();
+                        param.put("date", DateUtils.timestampToDateFormat(goodsVo.getClassEndTime(),DateUtils.YYYY__MM__DD));
+                        param.put("day", day);
+                        if (Validator.isNotEmpty(IAliSmsService.sendInformSms(userVo.getTelphone(), JSON.toJSONString(param), classEndRemind))) {
+                            iInformUserService.insertByAddBo(informUserAddBo);
+                        }
+                    }
+                }
+            }
+        }
+    }
+
     private void sendClassEnd() {
         List<ClassGradeUserGoodsVo> classTwentyGradeUserVos = iClassGradeUserService.sendTwentyClassGradeUser();
         List<ClassGradeUserGoodsVo> classTenGradeUserVos = iClassGradeUserService.sendTenClassGradeUser();

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/mapper/UserStudyRecordPhotoMapper.java

@@ -18,6 +18,9 @@ public interface UserStudyRecordPhotoMapper extends BaseMapper<UserStudyRecordPh
 
     String selectGradeRecentOnePhoto(@Param("userId") Long userId,@Param("gradeId") Long gradeId,@Param("orderGoodsId") Long orderGoodsId);
 
+    @InterceptorIgnore(tenantLine = "true")
+    String selectGradeRecentOnePhotoNew(@Param("userId") Long userId,@Param("gradeId") Long gradeId,@Param("orderGoodsId") Long orderGoodsId);
+
     List<String> selectGradePhotoWeek(@Param("userId") Long userId,@Param("gradeId") Long gradeId,@Param("searchWeekStartTime") Long searchWeekStartTime,@Param("searchWeekEndTime") Long searchWeekEndTime,@Param("orderGoodsId") Long orderGoodsId);
 
     @InterceptorIgnore(tenantLine = "true")

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/IUserSubscribeService.java

@@ -129,4 +129,6 @@ public interface IUserSubscribeService extends IService<UserSubscribe> {
 	List<UserApplyRecordVo> listUserApply(UserApplyRecordBo bo);
 
 	List<UserPromiseRecordVo> listPromise(UserPromiseRecordBo bo);
+
+	void updateStudentImageSpin(UpdateStudentImageBo bo);
 }

+ 5 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/impl/UserStudyRecordServiceImpl.java

@@ -496,7 +496,11 @@ public class UserStudyRecordServiceImpl extends ServiceImpl<UserStudyRecordMappe
                 }else{
                     throw new CustomException("未报名推送成功,无法学习",600);
                 }
-
+                ClassGradeUserQueryBo userQueryBo = new ClassGradeUserQueryBo();
+                userQueryBo.setGoodsId(bo.getGoodsId());
+                userQueryBo.setGradeId(bo.getGradeId());
+                userQueryBo.setUserId(bo.getUserId());
+                iClassGradeUserService.checkFinishRequiredCourse(userQueryBo);
             }
 
         }

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

@@ -2624,6 +2624,7 @@ public class UserSubscribeServiceImpl extends ServiceImpl<UserSubscribeMapper, U
         add.setApplySiteAddress(site.getSiteAddress());
         add.setSubscribeStatus(1);
         add.setExamStatus(0);
+        add.setStudentType(bo.getStudentType());
         add.setCreateTime(DateUtils.getNowTime());
         add.setUpdateTime(DateUtils.getNowTime());
         add.setExamineeCode(ServletUtils.getEncoded("ZZ"+ ToolsUtils.autoGenericCode(String.valueOf(add.getApplyId()),4) +ToolsUtils.autoGenericCode(String.valueOf(add.getUserId()),4)));
@@ -3005,6 +3006,16 @@ public class UserSubscribeServiceImpl extends ServiceImpl<UserSubscribeMapper, U
         return recordVos;
     }
 
+    @Override
+    public void updateStudentImageSpin(UpdateStudentImageBo bo) {
+        try {
+            ossService.processObject(bo.getImageUrl(),bo.getImageUrl(),String.format("image/rotate,%s",180));
+        }catch (Exception e){
+            e.printStackTrace();
+            throw new CustomException("修改图片错误!");
+        }
+    }
+
     private String applyTimeTransition(String time){
         List<String> collect = Arrays.stream(time.split(":")).collect(Collectors.toList());
         StringBuffer result = new StringBuffer();

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

@@ -267,6 +267,8 @@
         <result property="periodWaitTime" column="period_wait_time"/>
         <result property="officialStatusMsg" column="official_status_msg"/>
         <result property="sevenPushReason" column="seven_push_reason"/>
+        <result property="periodTime" column="period_time"/>
+        <result property="sevenPushDate" column="seven_push_date"/>
     </resultMap>
 
 
@@ -920,7 +922,9 @@
             cg.official_name,
             cgu.period_wait_time,
             cgu.seven_push_reason,
-            cgu.official_status_msg
+            cgu.official_status_msg,
+            cgu.period_time,
+            cgu.seven_push_date
         FROM
             class_grade_user cgu
                 LEFT JOIN class_grade cg on cgu.grade_id = cg.grade_id
@@ -1090,14 +1094,30 @@
         SELECT
             COUNT( DISTINCT course_id, module_id, chapter_id, section_id )
         FROM
-            user_study_record c
+            user_study_record
         WHERE
-          AND c.current_status = 1
-          AND c.grade_id = #{gradeId}
-          AND c.order_goods_id = #{orderGoodsId}
-          AND c.user_id = #{userId}
-          and c.status = 1
-          and c.goods_id = #{goodsId}
+            current_status = 1
+          AND grade_id = #{gradeId}
+          AND order_goods_id = #{orderGoodsId}
+          AND user_id = #{userId}
+          AND status = 1
+          AND goods_id = #{goodsId}
+    </select>
+
+    <select id="getUserSub" parameterType="java.lang.Long" resultType="com.zhongzheng.modules.user.domain.UserSubscribe">
+        SELECT
+            us.*
+        FROM
+            user_subscribe us
+                LEFT JOIN exam_apply ea ON us.apply_id = ea.apply_id
+        WHERE
+            us.subscribe_status = 1
+          AND us.user_id = #{userId}
+          AND us.goods_id = #{goodsId}
+          AND ea.`status` = 1
+        ORDER BY
+            us.create_time
+            LIMIT 1
     </select>
 
     <select id="getOrderGoodsIds" parameterType="com.zhongzheng.modules.course.bo.CourseQueryBo" resultType="java.lang.Long">

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

@@ -155,6 +155,7 @@
         <result property="firstChoiceGoods" column="first_choice_goods"/>
         <result property="aliasName" column="alias_name"/>
         <result property="moreCertificateStatus" column="more_certificate_status"/>
+        <result property="makeGoodsIds" column="make_goods_ids"/>
     </resultMap>
 
     <resultMap type="com.zhongzheng.modules.exam.vo.ExamNumberGoodsVo" id="ExamNumberGoodsVoResult">
@@ -659,6 +660,10 @@
                                            WHERE goods_id = #{goodsId} AND type = 3), ''))))
     </select>
 
+    <select id="getMakeGoodsList" parameterType="map" resultType="com.zhongzheng.modules.goods.vo.MakeGoodsVo">
+        select g.goods_id as make_goods_id,g.goods_name as make_goods_name,g.code as make_goods_code from goods g where  FIND_IN_SET(g.goods_id,#{makeGoodsIds})
+    </select>
+
     <select id="getRandomQuestionNum" parameterType="map" resultType="Long">
         SELECT count(DISTINCT eq.question_id) question_num
         FROM exam_question eq
@@ -970,6 +975,31 @@
         WHERE goods_name = #{goodsName} and code = #{code} and tenant_id = #{tenantId}
     </select>
 
+    <select id="getModuleExam" resultType="com.zhongzheng.modules.bank.domain.QuestionModule">
+        SELECT * FROM question_module qm WHERE (SELECT COUNT( qb.id)FROM question_business qb WHERE qb.major_id = qm.module_exam_id AND qb.type = 4) &lt;= 0 AND `status` = 1
+    </select>
+
+    <select id="getChapterExam" resultType="com.zhongzheng.modules.bank.domain.QuestionChapter">
+        SELECT * FROM question_chapter qm WHERE (SELECT COUNT( qb.id)FROM question_business qb WHERE qb.major_id = qm.chapter_exam_id AND qb.type = 3) &lt;= 0 AND `status` = 1
+    </select>
+
+    <select id="getExam" resultType="com.zhongzheng.modules.bank.domain.Exam">
+        SELECT * FROM exam qm WHERE (SELECT COUNT( qb.id)FROM question_business qb WHERE qb.major_id = qm.exam_id AND qb.type = 2) &lt;= 0 AND `status` = 1
+    </select>
+
+    <select id="getSysGoodsCopy" parameterType="map" resultType="com.zhongzheng.modules.system.domain.SysGoodsCopyRecord">
+        SELECT * FROM sys_goods_copy_record WHERE new_id = #{moduleExamId} AND type = #{type} LIMIT 1
+    </select>
+
+    <select id="getModuleExamBusiness" parameterType="map" resultType="com.zhongzheng.modules.bank.domain.QuestionBusiness">
+        SELECT * FROM question_business WHERE major_id = #{oldId} AND type = #{type} AND tenant_id = 867735392558919680
+    </select>
+
+    <insert id="saveExamBusiness" parameterType="com.zhongzheng.modules.bank.domain.QuestionBusiness" >
+        INSERT INTO question_business (education_type_id,business_id,tenant_id,project_id,subject_id,major_id,type)
+        VALUES(#{educationTypeId},#{businessId},#{tenantId},#{projectId},#{subjectId},#{majorId},#{type})
+    </insert>
+
     <update id="updateByTenant" parameterType="com.zhongzheng.modules.goods.domain.Goods">
         UPDATE goods
         SET `year`                  = #{year},

+ 63 - 13
zhongzheng-system/src/main/resources/mapper/modules/grade/ClassGradeMapper.xml

@@ -25,6 +25,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="interfaceAccountId" column="interface_account_id"/>
         <result property="interfacePeriodId" column="interface_period_id"/>
         <result property="officialLearningUrl" column="official_learning_url"/>
+        <result property="pastDueDay" column="past_due_day"/>
     </resultMap>
 
     <resultMap type="com.zhongzheng.modules.grade.vo.ClassGradeVo" id="ClassGradeVoResult">
@@ -60,6 +61,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="projectId" column="project_id"/>
         <result property="goodsId" column="goods_id"/>
         <result property="sevenCode" column="seven_code"/>
+        <result property="pastDueDay" column="past_due_day"/>
     </resultMap>
 
     <resultMap type="com.zhongzheng.modules.grade.vo.ClassGradeUserListVo" id="ClassGradeUserListVo">
@@ -170,6 +172,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="reason" column="reason"/>
         <result property="projectName" column="project_name"/>
         <result property="businessName" column="business_name"/>
+        <result property="educationName" column="education_name"/>
         <result property="sevenYear" column="seven_year"/>
         <result property="orgId" column="org_id"/>
 
@@ -186,6 +189,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="gradeName" column="class_name"/>
         <result property="endTime" column="end_time"/>
         <result property="profileStatus" column="profile_status"/>
+        <result property="classStatus" column="class_status"/>
     </resultMap>
 
 
@@ -306,7 +310,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             AND (#{classStartTime} BETWEEN g.class_start_time and g.class_end_time or #{classEndTime} BETWEEN g.class_start_time and g.class_end_time)
         </if>
         <if test="pastDue != null or pastDue != null ">
-            AND ((unix_timestamp(now())+6*24*3600) &lt; g.class_end_time or g.class_start_time is null)
+            AND ((unix_timestamp(now())+g.past_due_day*24*3600) &lt; g.class_end_time or g.class_start_time is null)
         </if>
         <if test="educationTypeId != null and educationTypeId !='' ">
             AND (
@@ -405,6 +409,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         cgu.official_status_num,
         u.user_account,
         u.user_id,
+        u.company_name,
         cgu.`status`,
         u.realname,
         og.goods_id,
@@ -451,7 +456,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         ueg.exam_number,
         ueg.do_number,
         ueg.expend_number,
-        ueg.expend_before
+        ueg.expend_before,
+        up.`status` as profile_status,
+        cet.education_name
         FROM
         class_grade_user cgu
         LEFT JOIN class_grade cg ON cgu.grade_id = cg.grade_id
@@ -461,8 +468,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         LEFT JOIN major m ON g.major_id = m.id
         LEFT JOIN course_business cb ON g.business_id = cb.id
         LEFT JOIN course_project_type cpt ON g.project_id = cpt.id
+        LEFT JOIN course_education_type cet ON g.education_type_id = cet.id
         LEFT JOIN user_wx_follow uwf ON u.union_id = uwf.union_id
         LEFT JOIN user_exam_goods ueg ON ueg.order_goods_id = og.order_goods_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="sevenCode != null and sevenCode !='' ">
             AND cg.seven_code = #{sevenCode}
@@ -488,12 +497,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <if test="studyCountMore != null and studyCountMore == 0 ">
             AND og.study_count = 0
         </if>
+        <if test="periodStatus != null ">
+            AND cgu.period_status = #{periodStatus}
+        </if>
         <if test="officialStatus != null and officialStatus == 1 ">
             AND cgu.official_status = 1
         </if>
         <if test="officialStatus != null and officialStatus == 0 ">
             AND (cgu.official_status is NULL or cgu.official_status=0)
         </if>
+        <if test="periodPlush != null and periodPlush == 1 ">
+            AND cgu.period_plush = 1
+        </if>
+        <if test="periodPlush != null and periodPlush == 0 ">
+            AND (cgu.period_plush is NULL or cgu.period_plush=0)
+        </if>
         <if test="realname != null and realname != ''">
             AND u.realname like concat('%', #{realname}, '%')
         </if>
@@ -512,6 +530,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             #{item,typeHandler=com.zhongzheng.common.type.EncryptHandler}
             </foreach>
         </if>
+        <if test="searchKey != null and searchKey != ''">
+            AND (cg.class_name like concat('%', #{searchKey}, '%') or u.realname like concat('%', #{searchKey}, '%') or u.company_name like concat('%', #{searchKey}, '%'))
+        </if>
         <if test="orderSn != null and orderSn != ''">
             AND og.order_sn = #{orderSn}
         </if>
@@ -588,12 +609,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         g.study_end_time,
         cg.class_start_time,
         cg.class_end_time,
+        cg.class_status,
         cg.interface_push_id,
         cgu.official_status,
         cgu.official_status_msg,
         cgu.period_plush_msg,
         cgu.learn_status,
-        cgu.period_wait_time as end_time,
+  <!--      cgu.period_wait_time as end_time,  -->
+        (case WHEN (select COUNT(uu.id) FROM user_update uu where cgu.user_id = uu.user_id and uu.status = 2) >0 then 1 ELSE 0 end) as user_status,
         (SELECT COUNT(m.id) FROM course_menu_exam m LEFT JOIN goods_course c on m.course_id=c.course_id   where c.goods_id=og.goods_id and m.type  in (1,3) ) as exam_num,
         (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.user_id = u.user_id and ubr.grade_id = cgu.grade_id and ubr.order_goods_id = cgu.order_goods_id and ubr.report_status=1 and ubr.current_status = 1) as record_num,
         (og.study_count) as study_count,
@@ -612,13 +635,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         cgu.tenant_id as org_id,
         cb.business_name,
         cpt.project_name,
-        (SELECT IFNULL(SUM(usr.study_duration),0) from user_study_record usr where usr.user_id = cgu.user_id and usr.grade_id = cgu.grade_id) as user_study_duration,
         (SELECT count(*) from class_grade_user cgu where cgu.order_goods_id = og.order_goods_id) as use_study_count,
         ueg.exam_number,
         ueg.do_number,
         ueg.expend_number,
         ueg.expend_before,
-        up.`status` as profile_status
+        up.`status` as profile_status,
+        cet.education_name
         FROM
         class_grade_user cgu
         LEFT JOIN class_grade cg ON cgu.grade_id = cg.grade_id
@@ -628,6 +651,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         LEFT JOIN major m ON g.major_id = m.id
         LEFT JOIN course_business cb ON g.business_id = cb.id
         LEFT JOIN course_project_type cpt ON g.project_id = cpt.id
+        LEFT JOIN course_education_type cet ON g.education_type_id = cet.id
         LEFT JOIN user_exam_goods ueg ON ueg.order_goods_id = og.order_goods_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
@@ -655,6 +679,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <if test="studyCountMore != null and studyCountMore == 0 ">
             AND og.study_count = 0
         </if>
+        <if test="periodStatus != null ">
+            AND cgu.period_status = #{periodStatus}
+        </if>
         <if test="officialStatus != null and officialStatus == 1 ">
             AND cgu.official_status = 1
         </if>
@@ -721,6 +748,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <if test="hasInterface != null and hasInterface == 2">
             AND cg.no_interface_account_id is not null
         </if>
+        order by cgu.id desc
     </select>
 
     <select id="listGradeInform" parameterType="com.zhongzheng.modules.grade.bo.ClassGradeQueryBo" resultMap="ClassGradeUserListVo">
@@ -1303,6 +1331,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         g.class_end_time,
         g.learning_status,
         g.remark,
+        g.status,
         (SELECT COUNT(a.id) FROM class_grade_user a where a.grade_id = g.grade_id and a.status =1) as student_num,
         (
         SELECT
@@ -1348,14 +1377,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             AND u.realname  like concat('%', #{userName}, '%')
             ) >0
         </if>
-        <if test="classStatus != null  ">
-            AND g.class_status =  #{classStatus}
+          AND  g.status != -1
+        <if test="classStatus != null and  classStatus==0">
+            AND (g.class_status =  #{classStatus} or g.class_status  is null )
+        </if>
+        <if test="classStatus != null and  classStatus==1">
+            AND g.class_status =  1 and g.class_end_time >= unix_timestamp(now())
+        </if>
+        <if test="classStatus != null and  classStatus == 2 ">
+            AND g.class_status =  1 and unix_timestamp(now()) > g.class_end_time
         </if>
         <if test="atFull != null and atFull !='' ">
             AND (SELECT COUNT(a.id) FROM class_grade_user a where a.grade_id = g.grade_id and a.status =1) &lt; g.student_upper
         </if>
-        <if test="classStartTime != null and classStartTime != ''  and classEndTime != null and classEndTime != ''">
-            AND (#{classStartTime} BETWEEN g.class_start_time and g.class_end_time or #{classEndTime} BETWEEN g.class_start_time and g.class_end_time)
+        <if test="classStartTime != null and classStartTime != ''  ">
+            AND g.class_start_time >=#{classStartTime}
+        </if>
+        <if test="classEndTime != null and classEndTime != ''  ">
+            AND #{classEndTime} >= g.class_end_time
         </if>
         <if test="pastDue != null or pastDue != null ">
             AND ((unix_timestamp(now())+10*24*3600) &lt; g.class_end_time or g.class_start_time is null)
@@ -1383,6 +1422,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         g.class_end_time,
         g.learning_status,
         g.remark,
+        g.status,
         (SELECT COUNT(c.id) FROM class_grade_user c where a.grade_id = c.grade_id and c.status =1) as student_num,
         (
         SELECT
@@ -1412,6 +1452,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         LEFT JOIN course_business cb ON d.business_id = cb.id
         WHERE
         1 = 1
+        AND  g.status != -1
         <if test="status != null and status.size()!=0 ">
             AND g.status in
             <foreach collection="status" item="item" index="index" open="(" close=")" separator=",">
@@ -1430,14 +1471,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             AND d.goods_name  like concat('%', #{searchKey}, '%')
             ) >0)
         </if>
-        <if test="classStatus != null  ">
-            AND g.class_status =  #{classStatus}
+        <if test="classStatus != null and  classStatus==0">
+            AND (g.class_status =  #{classStatus} or g.class_status   is null )
+        </if>
+        <if test="classStatus != null and  classStatus==1">
+            AND g.class_status =  1 and g.class_end_time >= unix_timestamp(now())
+        </if>
+        <if test="classStatus != null and  classStatus == 2 ">
+            AND g.class_status =  1 and unix_timestamp(now()) > g.class_end_time
         </if>
         <if test="atFull != null and atFull !='' ">
             AND (SELECT COUNT(a.id) FROM class_grade_user a where a.grade_id = g.grade_id and a.status =1) &lt; g.student_upper
         </if>
-        <if test="classStartTime != null and classStartTime != ''  and classEndTime != null and classEndTime != ''">
-            AND (#{classStartTime} BETWEEN g.class_start_time and g.class_end_time or #{classEndTime} BETWEEN g.class_start_time and g.class_end_time)
+        <if test="classStartTime != null and classStartTime != ''  ">
+            AND g.class_start_time >=#{classStartTime}
+        </if>
+        <if test="classEndTime != null and classEndTime != ''  ">
+            AND #{classEndTime} >= g.class_end_time
         </if>
         <if test="pastDue != null or pastDue != null ">
             AND ((unix_timestamp(now())+10*24*3600) &lt; g.class_end_time or g.class_start_time is null)

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

@@ -147,6 +147,8 @@
         <result property="goodsYear" column="goods_year"/>
         <result property="createTime" column="create_time"/>
         <result property="profileStatus" column="profile_status"/>
+        <result property="orderSn" column="order_sn"/>
+        <result property="majorId" column="major_id"/>
     </resultMap>
 
     <resultMap type="com.zhongzheng.modules.grade.vo.ClassPeriodUserVo" id="ClassPeriodUserVo">
@@ -420,6 +422,105 @@
         order by up.create_time desc
     </select>
 
+    <select id="listUserVideoRecordNew" parameterType="com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo"
+            resultMap="ClassPeriodStudentVo">
+        SELECT
+        up.* ,cg.class_name,cs.duration_time,u.id_card,u.realname,u.one_inch_photos,u.company_name,cs.`name` as section_name,ups.record_start_time,ups.record_end_time,ups.update_time as on_line_time
+        FROM
+        user_period up
+        LEFT JOIN user_period_status ups ON up.id = ups.period_id
+        LEFT JOIN class_grade cg on up.grade_id = cg.grade_id
+        LEFT JOIN  goods g ON up.goods_id = g.goods_id
+        LEFT JOIN course_section cs ON up.section_id = cs.section_id
+        LEFT JOIN `user` u ON up.user_id = u.user_id
+        WHERE
+        up.grade_id > 0  and up.type = 1
+        <if test="businessId != null and businessId != ''">
+            AND g.business_id = #{businessId}
+        </if>
+        <if test="projectIds != null and projectIds.size()!=0 ">
+            AND g.project_id in
+            <foreach collection="projectIds" item="item" index="index" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+        <if test="educationTypeIds != null and educationTypeIds.size()!=0 ">
+            AND g.education_type_id in
+            <foreach collection="educationTypeIds" item="item" index="index" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+        <if test="realname != null and realname != ''">
+            AND u.realname like concat('%', #{realname}, '%')
+        </if>
+        <if test="telphone != null and telphone != ''">
+            AND u.telphone = #{telphone`,typeHandler=com.zhongzheng.common.type.EncryptHandler`}
+        </if>
+        <if test="idCard != null and idCard != ''">
+            AND u.id_card = #{idCard,typeHandler=com.zhongzheng.common.type.EncryptHandler}
+        </if>
+        <if test="companyName != null and companyName != ''">
+            AND u.company_name like concat('%', #{companyName}, '%')
+        </if>
+        <if test="tenantIds != null and tenantIds.size()!=0 ">
+            AND up.tenant_id in
+            <foreach collection="tenantIds" item="item" index="index" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+        order by up.create_time desc
+    </select>
+
+
+    <select id="listUserVideoRecordNew_COUNT" parameterType="com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo"
+            resultType="java.lang.Long">
+        SELECT
+        count(up.id)
+        FROM
+        user_period up
+        LEFT JOIN user_period_status ups ON up.id = ups.period_id
+        LEFT JOIN class_grade cg on up.grade_id = cg.grade_id
+        LEFT JOIN  goods g ON up.goods_id = g.goods_id
+        LEFT JOIN course_section cs ON up.section_id = cs.section_id
+        LEFT JOIN `user` u ON up.user_id = u.user_id
+        WHERE
+        up.grade_id > 0  and up.type = 1
+        <if test="businessId != null and businessId != ''">
+            AND g.business_id = #{businessId}
+        </if>
+        <if test="projectIds != null and projectIds.size()!=0 ">
+            AND g.project_id in
+            <foreach collection="projectIds" item="item" index="index" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+        <if test="educationTypeIds != null and educationTypeIds.size()!=0 ">
+            AND g.education_type_id in
+            <foreach collection="educationTypeIds" item="item" index="index" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+        <if test="realname != null and realname != ''">
+            AND u.realname like concat('%', #{realname}, '%')
+        </if>
+        <if test="telphone != null and telphone != ''">
+            AND u.telphone = #{telphone`,typeHandler=com.zhongzheng.common.type.EncryptHandler`}
+        </if>
+        <if test="idCard != null and idCard != ''">
+            AND u.id_card = #{idCard,typeHandler=com.zhongzheng.common.type.EncryptHandler}
+        </if>
+        <if test="companyName != null and companyName != ''">
+            AND u.company_name like concat('%', #{companyName}, '%')
+        </if>
+        <if test="tenantIds != null and tenantIds.size()!=0 ">
+            AND up.tenant_id in
+            <foreach collection="tenantIds" item="item" index="index" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+        order by up.create_time desc
+    </select>
+
 
     <select id="listUserPeriod" parameterType="com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo"
             resultMap="ClassPeriodStudentVo">
@@ -449,6 +550,8 @@
         cgu.period_status_num,
         cgu.period_time,
         cgu.order_goods_id,
+        og.order_sn,
+        g.major_id,
         /*    IFNULL(ge.exam_num,0) as exam_num, */
         <if test="userPhoto != null and userPhoto == 1">
             up.key_value,
@@ -572,6 +675,289 @@
         </if>
     </select>
 
+
+    <select id="listUserPeriodNew_COUNT" parameterType="com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo"
+            resultType="java.lang.Long">
+        SELECT
+        count(cgu.id)
+        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 user_profile up on u.user_id =up.user_id and up.goods_id = og.goods_id and cgu.order_goods_id = up.order_goods_id and up.type_status=1 and up.current_status = 1
+        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
+        where 1=1
+        and cgu.`status` =1
+        and cb.`period_check_sign` = 1
+        <if test="projectIds != null and projectIds.size()!=0 ">
+            AND g.project_id in
+            <foreach collection="projectIds" item="item" index="index" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+        <if test="educationTypeIds != null and educationTypeIds.size()!=0 ">
+            AND g.education_type_id in
+            <foreach collection="educationTypeIds" item="item" index="index" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+        <if test="periodStatus != null ">
+            and cgu.period_status = #{periodStatus}
+        </if>
+        <if test="searchKey != null and searchKey != '' ">
+            and u.realname like concat('%', #{searchKey}, '%')
+        </if>
+        <if test="idCard != null and idCard !='' ">
+            AND u.id_card = #{idCard,typeHandler=com.zhongzheng.common.type.EncryptHandler}
+        </if>
+        <if test="tenantIds != null and tenantIds.size()!=0 ">
+            AND cgu.tenant_id in
+            <foreach collection="tenantIds" item="item" index="index" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+        order by cgu.update_time desc
+    </select>
+
+    <select id="listUserPeriodNew" parameterType="com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo"
+            resultType="com.zhongzheng.modules.grade.vo.ClassPeriodStudentNewVo">
+        SELECT
+        u.user_id,
+        u.realname,
+        og.goods_id,
+        u.id_card,
+        cgu.grade_id,
+        u.telphone,
+        up.`status` as profile_status,
+        g.goods_name,
+        cg.class_name,
+        cgu.order_goods_id,
+        (SELECT og.seven_year FROM order_goods og  where og.order_goods_id = cgu.order_goods_id ) as seven_year,
+        cgu.period_wait_time as end_time,
+        cgu.tenant_id,
+        CONCAT(cet.education_name,cpt.project_name,cb.business_name) AS fullName
+        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 user_profile up on u.user_id =up.user_id and up.goods_id = og.goods_id and cgu.order_goods_id = up.order_goods_id and up.type_status=1 and up.current_status = 1
+        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
+        where 1=1
+        and cgu.`status` =1
+        and cb.`period_check_sign` = 1
+        <if test="projectIds != null and projectIds.size()!=0 ">
+            AND g.project_id in
+            <foreach collection="projectIds" item="item" index="index" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+        <if test="educationTypeIds != null and educationTypeIds.size()!=0 ">
+            AND g.education_type_id in
+            <foreach collection="educationTypeIds" item="item" index="index" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+        <if test="periodStatus != null ">
+            and cgu.period_status = #{periodStatus}
+        </if>
+        <if test="searchKey != null and searchKey != '' ">
+            and u.realname like concat('%', #{searchKey}, '%')
+        </if>
+        <if test="idCard != null and idCard !='' ">
+            AND u.id_card = #{idCard,typeHandler=com.zhongzheng.common.type.EncryptHandler}
+        </if>
+        <if test="tenantIds != null and tenantIds.size()!=0 ">
+            AND cgu.tenant_id in
+            <foreach collection="tenantIds" item="item" index="index" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+        order by cgu.update_time desc
+    </select>
+
+    <select id="getEduIdByTenant" parameterType="map" resultType="java.lang.Long">
+        SELECT id FROM course_education_type WHERE tenant_id = #{tenantId} AND education_name = #{eduName} AND `status` = 1 LIMIT 1
+    </select>
+
+    <select id="getProIdByTenant" parameterType="map" resultType="java.lang.Long">
+        SELECT id FROM course_project_type WHERE tenant_id = #{tenantId} AND project_name = #{proName}  AND education_id = #{eduId} AND `status` = 1 LIMIT 1
+    </select>
+
+    <select id="exportUserPeriod" 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,
+        u.company_name,
+        up.`status` as profile_status,
+        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,
+        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,
+        og.order_sn,
+        g.major_id,
+        IFNULL(ge.exam_num,0) as exam_num,
+        <if test="userPhoto != null and userPhoto == 1">
+            up.key_value,
+        </if>
+        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
+        <if test="userPhoto == null">
+            /* ,(select COUNT(up.id) from user_period up LEFT JOIN user_period_status ups on up.id=ups.period_id where up.goods_id = og.goods_id and up.grade_id = cgu.grade_id and up.order_goods_id = cgu.order_goods_id and up.user_id = u.user_id
+            and ups.period_status=0 and ups.`status`=0 and (SELECT COUNT(upss.id) from user_period_status upss where upss.id = ups.id and upss.period_status = 1 and upss.`status` = 2) > 0 ) as rebuild_num */
+        </if>
+        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 user_profile up on u.user_id =up.user_id and up.goods_id = og.goods_id and cgu.order_goods_id = up.order_goods_id and up.type_status=1 and up.current_status = 1
+        LEFT JOIN goods g on og.goods_id = g.goods_id
+        LEFT JOIN course_business cb ON g.business_id = cb.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
+        and cb.`period_check_sign` = 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}, '%')
+            or u.company_name like concat('%', #{searchKey}, '%'))
+        </if>
+        <if test="inputOrderSn != null and inputOrderSn != '' ">
+            and (select count(*) from `order` o where o.order_sn =og.order_sn and o.input_order_sn =  #{inputOrderSn})>0
+        </if>
+        <if test="companyName != null and companyName != '' ">
+            and u.company_name like concat('%', #{companyName}, '%')
+        </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>
+        <if test="periodStatus != 2 and periodStatus != 3">
+            order by cgu.update_time desc
+        </if>
+        <if test="periodStatus == 2 ">
+            order by cgu.period_wait_time,cgu.create_time
+        </if>
+        <if test="periodStatus == 3 ">
+            order by cgu.period_ing_time,cgu.create_time
+        </if>
+    </select>
+
+    <select id="listUserPeriodTotal" parameterType="java.lang.Integer" resultType="java.lang.Long">
+        SELECT
+            COUNT( cgu.id )
+        FROM
+            class_grade_user cgu
+                LEFT JOIN order_goods og ON cgu.order_goods_id = og.order_goods_id
+                LEFT JOIN goods g ON og.goods_id = g.goods_id
+                LEFT JOIN course_business cb ON g.business_id = cb.id
+        WHERE
+            cgu.`status` = 1
+          AND cb.period_check_sign = 1
+          AND cgu.period_status = #{periodStatus}
+    </select>
+
     <select id="listUserWeekStudyTime" parameterType="com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo"
             resultType="Long">
         SELECT
@@ -1436,6 +1822,25 @@
         rp.create_time ASC
     </select>
 
+    <select id="selectStartNew" parameterType="map" resultType="long">
+        SELECT
+        rp.create_time
+        FROM
+        user_study_record_photo rp
+        LEFT JOIN user_period_status ups ON rp.period_id = ups.id
+        LEFT JOIN user_period up ON up.id = ups.period_id
+        WHERE
+        1=1
+        <if test="orderGoodsId != null ">
+            AND (up.order_goods_id = #{orderGoodsId} or up.order_goods_id is null)
+        </if>
+        AND ups.period_status = 1
+        AND up.grade_id = #{gradeId}
+        AND up.user_id = #{userId}
+        ORDER BY
+        rp.create_time ASC
+    </select>
+
     <select id="selectStartNoPhoto" parameterType="map" resultType="long">
         SELECT
         ups.record_start_time
@@ -1455,6 +1860,25 @@
         limit 1
     </select>
 
+    <select id="selectStartNoPhotoNew" parameterType="map" resultType="long">
+        SELECT
+        ups.record_start_time
+        FROM
+        user_period_status ups
+        LEFT JOIN user_period up ON up.id = ups.period_id
+        WHERE
+        1=1
+        <if test="orderGoodsId != null ">
+            AND (up.order_goods_id = #{orderGoodsId} or up.order_goods_id is null)
+        </if>
+        AND ups.period_status = 1
+        AND up.grade_id = #{gradeId}
+        AND up.user_id = #{userId}
+        ORDER BY
+        ups.record_start_time ASC
+        limit 1
+    </select>
+
     <select id="selectEnd" parameterType="map" resultType="long">
         SELECT
             usr.end_time
@@ -1521,6 +1945,47 @@
           AND unix_timestamp(now()) BETWEEN cg.class_end_time-864000 and cg.class_end_time-777600
     </select>
 
+    <select id="sendTenAndFifteenClassGradeUser"  resultMap="ClassGradeUserGoodsVoResult">
+
+        SELECT
+            cgu.user_id,
+            cgu.order_goods_id,
+            cg.class_start_time,
+            cg.class_end_time,
+            og.goods_id,
+            cg.grade_id
+        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
+        where 1=1
+          and cgu.status = 1
+          AND (unix_timestamp(now()) BETWEEN cg.class_end_time-950400 and cg.class_end_time-864000 or
+               unix_timestamp(now()) BETWEEN cg.class_end_time-1382400 and cg.class_end_time-1296000)
+    </select>
+
+    <select id="checkTenClassGradeUser" parameterType="map" resultMap="ClassGradeUserGoodsVoResult">
+
+        SELECT
+            cgu.user_id,
+            cgu.order_goods_id,
+            cg.class_end_time,
+            og.goods_id,
+            g.goods_name,
+            cg.class_name as grade_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 goods g ON g.goods_id = og.goods_id
+        where 1=1
+          and cg.status = 1
+          and cgu.status = 1
+          and cgu.user_id = #{userId}
+          and (cgu.period_status = -1 or cgu.period_status = 0)
+          AND unix_timestamp(now()) BETWEEN cg.class_end_time-#{startTime} and cg.class_end_time-#{endTime}
+    </select>
+
 
     <select id="sendFiveClassGradeUser"  resultMap="ClassGradeUserGoodsVoResult">
 
@@ -1724,9 +2189,11 @@
         WHERE
             cgu.user_id = #{userId}
           AND cgu.period_status = -1
+          AND cgu.period_wait_time is null
           AND (unix_timestamp(now())  BETWEEN cg.class_start_time and cg.class_end_time)
           and g.business_id = #{businessId}
           and g.goods_id != #{goodsId}
+          and cgu.`status` = 1
           AND (
             SELECT
             IFNULL( count(*), 0 )
@@ -1734,10 +2201,23 @@
             user_period up
             WHERE
             1 = 1
-          AND up.user_id = cgu.user_id
-          AND up.grade_id = cgu.grade_id
+          AND up.order_goods_id = cgu.order_goods_id
             )>0
     </select>
+    <select id="getOrderGoods" parameterType="java.lang.Long" resultType="com.zhongzheng.modules.order.domain.OrderGoods">
+        SELECT
+            og.*
+        FROM
+            order_goods og
+            LEFT JOIN `order` o ON og.order_sn = o.order_sn
+        WHERE
+            o.user_id = #{userId}
+            AND og.goods_id = #{goodsId}
+            AND og.refund_status != 2
+	        AND og.pay_status != 1
+	        AND og.`status` = 1
+	        AND o.`status` = 1
+    </select>
 
     <select id="getSevenPeriodStartTime" parameterType="com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo" resultType="java.lang.Long">
         SELECT

+ 7 - 1
zhongzheng-system/src/main/resources/mapper/modules/order/OrderBusinessConfigMapper.xml

@@ -44,9 +44,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         LEFT JOIN course_project_type cpt ON cb.project_id = cpt.id
         LEFT JOIN course_education_type cet ON cet.id = cpt.education_id
         WHERE
-        obc.`status` = 1
+        1=1
         and cet.`status` = 1
         and cb.`status` = 1
+        <if test="status != null and status.size()!=0 ">
+            AND obc.`status` in
+            <foreach collection="status" item="item" index="index" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
         <if test="gradeType != null and gradeType != ''">
             and obc.grade_type = #{gradeType}
         </if>

+ 3 - 1
zhongzheng-system/src/main/resources/mapper/modules/order/OrderGoodsMapper.xml

@@ -973,13 +973,15 @@
         SELECT
             og.*,o.user_id
         FROM
-             order_goods og
+            order_goods og
                 LEFT JOIN `order` o on og.order_sn = o.order_sn
                 LEFT JOIN goods g on og.goods_id = g.goods_id
                 LEFT JOIN inform_remind_business irb on  irb.business_id = g.business_id
+                LEFT JOIN class_grade_user cgu on cgu.order_goods_id = og.order_goods_id
         where 1=1
           and irb.remind_id =#{remindId}
           and og.status = 1
+          and cgu.period_status in (0,-1)
           AND og.service_end_time BETWEEN ( unix_timestamp(now()) + 864000) AND (unix_timestamp(now()) + 950400)
     </select>
 

+ 17 - 0
zhongzheng-system/src/main/resources/mapper/modules/user/UserStudyRecordPhotoMapper.xml

@@ -68,6 +68,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             LIMIT 1
     </select>
 
+    <select id="selectGradeRecentOnePhotoNew" parameterType="map" resultType="string">
+        SELECT
+            rp.photo
+        FROM
+            user_period up
+                LEFT JOIN user_period_status ups ON up.id = ups.period_id
+                LEFT JOIN user_study_record_photo rp ON ups.id = rp.period_id
+        WHERE
+            up.grade_id = #{gradeId}
+          AND up.user_id = #{userId}
+          AND (up.order_goods_id = #{orderGoodsId} or up.order_goods_id is null)
+          AND rp.photo IS NOT NULL
+        ORDER BY
+            rp.id DESC
+            LIMIT 1
+    </select>
+
     <select id="listByPhoto" parameterType="java.lang.String" resultType="com.zhongzheng.modules.user.domain.UserStudyRecordPhoto">
         SELECT * FROM `user_study_record_photo` WHERE photo = #{imageUrl}
     </select>