Sfoglia il codice sorgente

Merge branch 'seven'

yangdamao 2 anni fa
parent
commit
bc5e26b63f
100 ha cambiato i file con 1358 aggiunte e 174 eliminazioni
  1. 2 0
      zhongzheng-admin-saas/src/main/resources/application-dev.yml
  2. 2 0
      zhongzheng-admin-saas/src/main/resources/application-pre.yml
  3. 2 0
      zhongzheng-admin-saas/src/main/resources/application-prod.yml
  4. 9 0
      zhongzheng-admin/src/main/java/com/zhongzheng/controller/common/CommonController.java
  5. 2 1
      zhongzheng-admin/src/main/resources/application-dev.yml
  6. 2 0
      zhongzheng-admin/src/main/resources/application-pre.yml
  7. 2 0
      zhongzheng-admin/src/main/resources/application-prod.yml
  8. 2 0
      zhongzheng-api/src/main/java/com/zhongzheng/controller/goods/GoodsController.java
  9. 16 0
      zhongzheng-api/src/main/java/com/zhongzheng/controller/order/OrderController.java
  10. 8 0
      zhongzheng-api/src/main/java/com/zhongzheng/controller/user/UserStudyRecordController.java
  11. 3 1
      zhongzheng-api/src/main/resources/application-dev.yml
  12. 2 0
      zhongzheng-api/src/main/resources/application-pre.yml
  13. 2 0
      zhongzheng-api/src/main/resources/application-prod.yml
  14. 2 2
      zhongzheng-system/src/main/java/com/zhongzheng/modules/alioss/service/impl/OssServiceImpl.java
  15. 5 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/base/service/impl/CertificateTpServiceImpl.java
  16. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/base/vo/ShoppingCartVo.java
  17. 2 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/collect/service/impl/CollectQuestionServiceImpl.java
  18. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/bo/CourseChapterAddBo.java
  19. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/bo/CourseChapterEditBo.java
  20. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/domain/CourseChapter.java
  21. 6 6
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/mapper/CourseChapterSectionMapper.java
  22. 1 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/mapper/CourseMapper.java
  23. 7 7
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/mapper/CourseMenuMapper.java
  24. 2 2
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/mapper/CourseModuleChapterMapper.java
  25. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseBusinessServiceImpl.java
  26. 15 8
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseChapterSectionServiceImpl.java
  27. 15 12
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseMenuServiceImpl.java
  28. 7 3
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseModuleChapterServiceImpl.java
  29. 5 2
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseServiceImpl.java
  30. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/vo/CourseChapterVo.java
  31. 1 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/vo/CourseUserChapterSectionVo.java
  32. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/vo/CourseUserMenuVo.java
  33. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/vo/CourseUserModuleChapterVo.java
  34. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/bo/GoodsAddBo.java
  35. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/bo/GoodsEditBo.java
  36. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/bo/GoodsSectionListBo.java
  37. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/domain/Goods.java
  38. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/mapper/GoodsMapper.java
  39. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/IGoodsService.java
  40. 10 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/impl/GoodsServiceImpl.java
  41. 5 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/vo/GoodsUserVo.java
  42. 5 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/vo/GoodsVo.java
  43. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/bo/ClassGradeUserTempQueryBo.java
  44. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/bo/UserPeriodAddBo.java
  45. 1 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/bo/UserPeriodEditBo.java
  46. 1 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/bo/UserPeriodQueryBo.java
  47. 2 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/domain/ClassGrade.java
  48. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/domain/ClassGradeUserTemp.java
  49. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/domain/UserPeriod.java
  50. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/mapper/ClassGradeMapper.java
  51. 3 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/mapper/ClassGradeUserMapper.java
  52. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/IClassGradeService.java
  53. 5 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/IClassGradeUserService.java
  54. 16 2
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/impl/ClassGradeServiceImpl.java
  55. 452 18
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/impl/ClassGradeUserServiceImpl.java
  56. 1 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/impl/ClassGradeUserTempServiceImpl.java
  57. 53 9
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/impl/UserPeriodServiceImpl.java
  58. 1 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/vo/ClassGradeUserVo.java
  59. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/vo/ClassGradeVo.java
  60. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/vo/ClassNpUserInfoVo.java
  61. 4 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/vo/ClassPeriodChapterVo.java
  62. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/vo/ClassPeriodSectionVo.java
  63. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/vo/ClassPeriodStudentExportVo.java
  64. 1 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/vo/ClassPeriodStudentVo.java
  65. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/vo/ClassPeriodVo.java
  66. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/vo/UserPeriodVo.java
  67. 12 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/order/bo/OrderGoodsAddBo.java
  68. 9 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/order/bo/OrderGoodsEditBo.java
  69. 6 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/order/bo/OrderGoodsQueryBo.java
  70. 15 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/order/bo/OrderGoodsSevenBo.java
  71. 8 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/order/domain/OrderGoods.java
  72. 4 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/order/mapper/OrderGoodsMapper.java
  73. 6 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/order/service/IOrderGoodsService.java
  74. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/order/service/IOrderService.java
  75. 6 6
      zhongzheng-system/src/main/java/com/zhongzheng/modules/order/service/impl/OrderGoodsRefundServiceImpl.java
  76. 24 2
      zhongzheng-system/src/main/java/com/zhongzheng/modules/order/service/impl/OrderGoodsServiceImpl.java
  77. 130 15
      zhongzheng-system/src/main/java/com/zhongzheng/modules/order/service/impl/OrderServiceImpl.java
  78. 17 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/order/vo/OrderGoodsVo.java
  79. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/schedule/service/impl/ScheduleServiceImpl.java
  80. 5 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/mapper/UserStudyRecordMapper.java
  81. 3 3
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/mapper/UserStudyRecordPhotoMapper.java
  82. 2 2
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/IUserStudyRecordPhotoService.java
  83. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/IUserStudyRecordService.java
  84. 16 4
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/impl/UserBankRecordServiceImpl.java
  85. 4 4
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/impl/UserStudyRecordPhotoServiceImpl.java
  86. 174 14
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/impl/UserStudyRecordServiceImpl.java
  87. 3 3
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/impl/UserSubscribeServiceImpl.java
  88. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/wx/service/impl/WxPayServiceImpl.java
  89. 2 0
      zhongzheng-system/src/main/resources/mapper/modules/base/ShoppingCartMapper.xml
  90. 1 0
      zhongzheng-system/src/main/resources/mapper/modules/course/CourseChapterMapper.xml
  91. 5 0
      zhongzheng-system/src/main/resources/mapper/modules/course/CourseChapterSectionMapper.xml
  92. 7 1
      zhongzheng-system/src/main/resources/mapper/modules/course/CourseMapper.xml
  93. 14 0
      zhongzheng-system/src/main/resources/mapper/modules/course/CourseMenuMapper.xml
  94. 4 1
      zhongzheng-system/src/main/resources/mapper/modules/course/CourseModuleChapterMapper.xml
  95. 2 1
      zhongzheng-system/src/main/resources/mapper/modules/exam/ExamApplyMapper.xml
  96. 18 1
      zhongzheng-system/src/main/resources/mapper/modules/goods/GoodsMapper.xml
  97. 3 0
      zhongzheng-system/src/main/resources/mapper/modules/grade/ClassGradeMapper.xml
  98. 103 34
      zhongzheng-system/src/main/resources/mapper/modules/grade/ClassGradeUserMapper.xml
  99. 1 0
      zhongzheng-system/src/main/resources/mapper/modules/grade/UserPeriodMapper.xml
  100. 3 1
      zhongzheng-system/src/main/resources/mapper/modules/grade/UserPeriodStatusMapper.xml

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

@@ -140,6 +140,8 @@ officialPush:
     periodPath: http://jypt-dev.gdcic.net/organjxjy/XueshiShenqing
     infoAccount: peixunjigou
     token: 0ca175b9c0f726a831d895e26933246
+    sevenInfoPath: http://sgry.gdcic.net/organjxjy/ShangBaoMingdan
+    sevenPeriodPath: http://sgry.gdcic.net/organjxjy/XueshiShenqing
 
 distributionOldPay:
     host: http://gdxypx.xy.com/System/BussinessApi/AddRedPackData

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

@@ -140,6 +140,8 @@ officialPush:
     periodPath: https://jypt.gdcic.net/organjxjy/XueshiShenqing
     infoAccount: GDSXY
     token: 01b5d9833987efdff54483cdc9720da6
+    sevenInfoPath: http://sgry.gdcic.net/organjxjy/ShangBaoMingdan
+    sevenPeriodPath: http://sgry.gdcic.net/organjxjy/XueshiShenqing
 
 distributionOldPay:
     host: https://www.xyyxt.net/System/BussinessApi/AddRedPackData

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

@@ -140,6 +140,8 @@ officialPush:
     periodPath: https://jypt.gdcic.net/organjxjy/XueshiShenqing
     infoAccount: GDSXY
     token: 01b5d9833987efdff54483cdc9720da6
+    sevenInfoPath: http://sgry.gdcic.net/organjxjy/ShangBaoMingdan
+    sevenPeriodPath: http://sgry.gdcic.net/organjxjy/XueshiShenqing
 
 distributionOldPay:
     host: https://www.xyyxt.net/System/BussinessApi/AddRedPackData

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

@@ -604,6 +604,15 @@ public class CommonController extends BaseController {
         return AjaxResult.success(iClassGradeUserService.DecryptOfficialInfo(bo));
     }
 
+
+    @ApiOperation("七大员学时抽查")
+    @PreAuthorize("@ss.hasPermi('system:withdrawal:add')")
+    @Log(title = "学时抽查", businessType = BusinessType.INSERT)
+    @PostMapping("/common/free/decryptSevenOfficialInfo")
+    public AjaxResult<ClassPeriodStudentVo> decryptSevenOfficialInfo(@RequestBody ClassGradeDecryptQueryBo bo) {
+        return AjaxResult.success(iClassGradeUserService.DecryptSevenOfficialInfo(bo));
+    }
+
     @ApiOperation("学时抽查加密")
     @PreAuthorize("@ss.hasPermi('system:withdrawal:add')")
     @PostMapping("/common/free/encryptDes")

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

@@ -140,7 +140,8 @@ officialPush:
     periodPath: https://jypt-dev.gdcic.net/organjxjy/XueshiShenqing
     infoAccount: peixunjigou
     token: 0ca175b9c0f726a831d895e26933246
-
+    sevenInfoPath: http://sgry-dev.gdcic.net/organjxjy/ShangBaoMingdan
+    sevenPeriodPath: http://sgry-dev.gdcic.net/organjxjy/XueshiShenqing
 
 
 distributionOldPay:

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

@@ -140,6 +140,8 @@ officialPush:
     periodPath: https://jypt-dev.gdcic.net/organjxjy/XueshiShenqing
     infoAccount: peixunjigou
     token: 0ca175b9c0f726a831d895e26933246
+    sevenInfoPath: http://sgry-dev.gdcic.net/organjxjy/ShangBaoMingdan
+    sevenPeriodPath: http://sgry-dev.gdcic.net/organjxjy/XueshiShenqing
 
 distributionOldPay:
     host: http://test.jqbao.net/System/BussinessApi/AddRedPackData

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

@@ -140,6 +140,8 @@ officialPush:
     periodPath: https://jypt.gdcic.net/organjxjy/XueshiShenqing
     infoAccount: GDSXY
     token: 01b5d9833987efdff54483cdc9720da6
+    sevenInfoPath: http://sgry.gdcic.net/organjxjy/ShangBaoMingdan
+    sevenPeriodPath: http://sgry.gdcic.net/organjxjy/XueshiShenqing
 
 distributionOldPay:
     host: https://www.xyyxt.net/System/BussinessApi/AddRedPackData

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

@@ -2,6 +2,7 @@ package com.zhongzheng.controller.goods;
 
 import cn.hutool.core.lang.Validator;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import com.zhongzheng.common.core.controller.BaseController;
 import com.zhongzheng.common.core.domain.AjaxResult;
 import com.zhongzheng.common.core.page.PageDomain;
@@ -32,6 +33,7 @@ import com.zhongzheng.modules.goods.service.IGoodsSpecTemplateService;
 import com.zhongzheng.modules.goods.vo.*;
 import com.zhongzheng.modules.grade.bo.UserPeriodQueryBo;
 import com.zhongzheng.modules.grade.service.IUserPeriodService;
+import com.zhongzheng.modules.order.bo.OrderGoodsSevenBo;
 import com.zhongzheng.modules.order.domain.OrderGoods;
 import com.zhongzheng.modules.order.domain.OrderGoodsFree;
 import com.zhongzheng.modules.order.service.IOrderGoodsFreeService;

+ 16 - 0
zhongzheng-api/src/main/java/com/zhongzheng/controller/order/OrderController.java

@@ -211,4 +211,20 @@ public class OrderController extends BaseController {
         ClientLoginUser loginUser = wxTokenService.getLoginUser(ServletUtils.getRequest());
         return AjaxResult.success(iOrderService.getHaveBuyGoodsNotExpired(bo.getGoodsId(),loginUser.getUser().getUserId()));
     }
+
+    @ApiOperation("七大员课程学习校验")
+    @GetMapping("/study/check/{orderGoodsId}")
+    public AjaxResult<Void> studyCheck(@PathVariable("orderGoodsId") Long orderGoodsId) {
+        ClientLoginUser loginUser = wxTokenService.getLoginUser(ServletUtils.getRequest());
+        return toAjax(iOrderService.studyCheck(orderGoodsId,loginUser.getUser().getUserId()) ? 1 : 0);
+    }
+
+    /**
+     * 获取订单商品
+     */
+    @ApiOperation("获取订单商品")
+    @GetMapping("/seven/year/{orderGoodsId}")
+    public AjaxResult<String> getOrderSevenYear(@PathVariable("orderGoodsId")Long orderGoodsId) {
+        return AjaxResult.success("成功",iOrderGoodsService.getOrderSevenYear(orderGoodsId));
+    }
 }

+ 8 - 0
zhongzheng-api/src/main/java/com/zhongzheng/controller/user/UserStudyRecordController.java

@@ -197,4 +197,12 @@ public class UserStudyRecordController extends BaseController {
         bo.setUserId(loginUser.getUser().getUserId());
         return AjaxResult.success(iUserStudyRecordService.queryLiveLast(bo));
     }
+
+    @ApiOperation("继教七大员公共课程同步")
+    @GetMapping("/syncSevenPublicClass")
+    public AjaxResult<Integer> syncSevenPublicClass(UserStudyRecordQueryBo bo){
+        ClientLoginUser loginUser = wxTokenService.getLoginUser(ServletUtils.getRequest());
+        bo.setUserId(loginUser.getUser().getUserId());
+        return AjaxResult.success(iUserStudyRecordService.syncSevenPublicClass(bo.getOrderGoodsId(),bo.getUserId()));
+    }
 }

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

@@ -143,6 +143,8 @@ officialPush:
     periodPath: https://jypt-dev.gdcic.net/organjxjy/XueshiShenqing
     infoAccount: peixunjigou
     token: 0ca175b9c0f726a831d895e26933246
+    sevenInfoPath: http://sgry.gdcic.net/organjxjy/ShangBaoMingdan
+    sevenPeriodPath: http://sgry.gdcic.net/organjxjy/XueshiShenqing
 
 distributionOldPay:
     host: http://gdxypx.xy.com/System/BussinessApi/AddRedPackData
@@ -174,4 +176,4 @@ oldSys:
 invoice:
     host: http://192.168.1.222:7077/sys/common/openMplatform/log
 
-liveHost: http://192.168.1.222:6009
+liveHost: http://192.168.1.222:6009

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

@@ -140,6 +140,8 @@ officialPush:
     periodPath: https://jypt-dev.gdcic.net/organjxjy/XueshiShenqing
     infoAccount: peixunjigou
     token: 0ca175b9c0f726a831d895e26933246
+    sevenInfoPath: http://sgry.gdcic.net/organjxjy/ShangBaoMingdan
+    sevenPeriodPath: http://sgry.gdcic.net/organjxjy/XueshiShenqing
 
 distributionOldPay:
     host: http://test.jqbao.net/System/BussinessApi/AddRedPackData

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

@@ -152,6 +152,8 @@ officialPush:
     periodPath: https://jypt.gdcic.net/organjxjy/XueshiShenqing
     infoAccount: GDSXY
     token: 01b5d9833987efdff54483cdc9720da6
+    sevenInfoPath: http://sgry.gdcic.net/organjxjy/ShangBaoMingdan
+    sevenPeriodPath: http://sgry.gdcic.net/organjxjy/XueshiShenqing
 
 distributionOldPay:
     host: https://www.xyyxt.net/System/BussinessApi/AddRedPackData

+ 2 - 2
zhongzheng-system/src/main/java/com/zhongzheng/modules/alioss/service/impl/OssServiceImpl.java

@@ -492,7 +492,7 @@ public class OssServiceImpl implements OssService {
     @Override
     public void zipPeopleDownload(ClassPeriodStudentExportVo vo, ZipOutputStream outStream) {
         //学时照片
-        List<String> list = iUserStudyRecordPhotoService.selectGradePhoto(vo.getUserId(),vo.getGradeId());
+        List<String> list = iUserStudyRecordPhotoService.selectGradePhoto(vo.getUserId(),vo.getGradeId(),vo.getOrderGoodsId());
         zipFile(list, outStream,vo.getRealName()+"-"+vo.getIdCard()+"-"+vo.getGradeId()+"/"+"学习照片");  //
         //个人资料
         List<String> listInfo = new ArrayList<>();
@@ -511,7 +511,7 @@ public class OssServiceImpl implements OssService {
     @Override
     public void zipPeopleWeekDownload(ClassPeriodStudentExportVo vo, ZipOutputStream outStream, WeekDataVo weekDataVo) {
         //学时照片
-        List<String> list = iUserStudyRecordPhotoService.selectGradePhotoWeek(vo.getUserId(),vo.getGradeId(),weekDataVo.getSearchWeekStartTime(),weekDataVo.getSearchWeekEndTime());
+        List<String> list = iUserStudyRecordPhotoService.selectGradePhotoWeek(vo.getUserId(),vo.getGradeId(),weekDataVo.getSearchWeekStartTime(),weekDataVo.getSearchWeekEndTime(),vo.getOrderGoodsId());
         zipFile(list, outStream,weekDataVo.getWeekCxt()+"/"+vo.getRealName()+"-"+vo.getIdCard()+"-"+vo.getGradeId()+"/"+"学习照片");  //
         //个人资料
         List<String> listInfo = new ArrayList<>();

+ 5 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/base/service/impl/CertificateTpServiceImpl.java

@@ -6,6 +6,7 @@ import cn.hutool.core.util.StrUtil;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.github.pagehelper.Page;
@@ -162,7 +163,10 @@ public class CertificateTpServiceImpl extends ServiceImpl<CertificateTpMapper, C
         studyRecordQueryBo.setGradeId(bo.getGradeId());
         UserStudyRecordVo studyRecordVo = iUserStudyRecordService.queryLast(studyRecordQueryBo);
         //获取培训结束时间
-        ClassGradeUser classGradeUser = iClassGradeUserService.getOne(new LambdaQueryWrapper<ClassGradeUser>().eq(ClassGradeUser::getUserId, bo.getUserId()).eq(ClassGradeUser::getGradeId,bo.getGradeId()).last("limit 1"));
+        ClassGradeUser classGradeUser = iClassGradeUserService.getOne(new LambdaQueryWrapper<ClassGradeUser>()
+                .eq(ClassGradeUser::getUserId, bo.getUserId())
+                .eq(ObjectUtils.isNotNull(bo.getOrderGoodsId()),ClassGradeUser::getOrderGoodsId, bo.getOrderGoodsId())
+                .eq(ClassGradeUser::getGradeId,bo.getGradeId()).last("limit 1"));
         //获取章列表
         List<CourseChapterVo> chapterList =  iClassGradeUserService.findChapterList(bo);
         UserVo userVo = iUserService.queryById(bo.getUserId());

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/base/vo/ShoppingCartVo.java

@@ -70,4 +70,6 @@ public class ShoppingCartVo {
 	private Integer choiceStatus;
 	@ApiModelProperty("班级列表")
 	private List<ClassGradeVo> gradeList;
+	@ApiModelProperty("七大员继教可选年份")
+	private String sevenYear;
 }

+ 2 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/collect/service/impl/CollectQuestionServiceImpl.java

@@ -67,7 +67,8 @@ public class CollectQuestionServiceImpl extends ServiceImpl<CollectQuestionMappe
                 .eq(CollectQuestion::getGoodsId,goodsId)
                 .last("limit 1"));
         if(Validator.isEmpty(info)){
-            throw new CustomException("没收藏数据");
+            return null;
+//            throw new CustomException("没收藏数据");
         }
         return info;
     }

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/bo/CourseChapterAddBo.java

@@ -53,4 +53,6 @@ public class CourseChapterAddBo {
     /** 导入编号 */
     @ApiModelProperty("导入编号")
     private String importNo;
+    @ApiModelProperty("公共标识:1公共章 0非公共章")
+    private Integer commonSign;
 }

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

@@ -64,4 +64,7 @@ public class CourseChapterEditBo {
     /** 导入编号 */
     @ApiModelProperty("导入编号")
     private String importNo;
+
+    @ApiModelProperty("公共标识:1公共章 0非公共章")
+    private Integer commonSign;
 }

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/domain/CourseChapter.java

@@ -52,5 +52,7 @@ private static final long serialVersionUID=1L;
 
     @TableField(exist = false)
     private Long oId;
+    /** 公共标识:1公共章 0非公共章 */
+    private String commonSign;
 
 }

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

@@ -30,22 +30,22 @@ public interface CourseChapterSectionMapper extends BaseMapper<CourseChapterSect
     List<CourseUserChapterSectionVo> sectionExamList(CourseMenuQueryBo bo);
 
     Integer rebuildCheck(@Param("typeId") Long typeId,@Param("gradeId") Long gradeId,
-                         @Param("userId") Long userId,@Param("moduleId") Long moduleId,@Param("chapterId") Long chapterId,@Param("examId") Long examId,@Param("courseId") Long courseId);
+                         @Param("userId") Long userId,@Param("moduleId") Long moduleId,@Param("chapterId") Long chapterId,@Param("examId") Long examId,@Param("courseId") Long courseId,@Param("orderGoodsId") Long orderGoodsId);
 
     Integer learningCheck(@Param("typeId") Long typeId,@Param("gradeId") Long gradeId,
-                          @Param("userId") Long userId,@Param("moduleId") Long moduleId,@Param("chapterId") Long chapterId,@Param("examId") Long examId,@Param("courseId") Long courseId);
+                          @Param("userId") Long userId,@Param("moduleId") Long moduleId,@Param("chapterId") Long chapterId,@Param("examId") Long examId,@Param("courseId") Long courseId,@Param("orderGoodsId") Long orderGoodsId);
 
     Integer auditCheck(@Param("typeId") Long typeId,@Param("gradeId") Long gradeId,
-                       @Param("userId") Long userId,@Param("moduleId") Long moduleId,@Param("chapterId") Long chapterId,@Param("examId") Long examId,@Param("courseId") Long courseId);
+                       @Param("userId") Long userId,@Param("moduleId") Long moduleId,@Param("chapterId") Long chapterId,@Param("examId") Long examId,@Param("courseId") Long courseId,@Param("orderGoodsId") Long orderGoodsId);
 
     Integer learningExamCheck(@Param("typeId") Long typeId,@Param("gradeId") Long gradeId,
-                          @Param("userId") Long userId,@Param("moduleId") Long moduleId,@Param("chapterId") Long chapterId,@Param("examId") Long examId,@Param("courseId") Long courseId);
+                          @Param("userId") Long userId,@Param("moduleId") Long moduleId,@Param("chapterId") Long chapterId,@Param("examId") Long examId,@Param("courseId") Long courseId,@Param("orderGoodsId") Long orderGoodsId);
 
     Integer learningSectionExamCheck(@Param("typeId") Long typeId,@Param("gradeId") Long gradeId,
-                              @Param("userId") Long userId,@Param("moduleId") Long moduleId,@Param("chapterId") Long chapterId,@Param("examId") Long examId,@Param("courseId") Long courseId,@Param("sectionId") Long sectionId);
+                              @Param("userId") Long userId,@Param("moduleId") Long moduleId,@Param("chapterId") Long chapterId,@Param("examId") Long examId,@Param("courseId") Long courseId,@Param("sectionId") Long sectionId,@Param("orderGoodsId") Long orderGoodsId);
 
     Long getStudyDuration(@Param("typeId") Long typeId,@Param("gradeId") Long gradeId,
-                          @Param("userId") Long userId,@Param("moduleId") Long moduleId,@Param("chapterId") Long chapterId,@Param("examId") Long examId,@Param("courseId") Long courseId);
+                          @Param("userId") Long userId,@Param("moduleId") Long moduleId,@Param("chapterId") Long chapterId,@Param("examId") Long examId,@Param("courseId") Long courseId,@Param("orderGoodsId") Long orderGoodsId);
 
     @InterceptorIgnore(tenantLine = "true")
     void deleteByIdAndTenant(@Param("chapterId") Long chapterId,@Param("newTenantId") Long newTenantId);

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

@@ -47,7 +47,7 @@ public interface CourseMapper extends BaseMapper<Course> {
     Long rebuildNext(ClassGradeUserQueryBo bo);
 
     //不传班级可能出现用户重复购买情况
-    ClassGradeVo gradeIdSelect(@Param("userId") Long userId, @Param("goodsId") Long goodsId, @Param("gradeId") Long gradeId);
+    ClassGradeVo gradeIdSelect(@Param("userId") Long userId, @Param("goodsId") Long goodsId, @Param("gradeId") Long gradeId, @Param("orderGoodsId") Long orderGoodsId);
 
     @InterceptorIgnore(tenantLine = "true")
     ClassGradeVo gradeIdSelectTenant(@Param("userId") Long userId, @Param("goodsId") Long goodsId, @Param("gradeId") Long gradeId,@Param("tenantId") Long tenantId);

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

@@ -21,19 +21,19 @@ public interface CourseMenuMapper extends BaseMapper<CourseMenu> {
 
     List<CourseUserMenuVo> menuList(CourseMenuQueryBo bo);
 
-    Integer rebuildCheck(@Param("sectionId") Long id,@Param("gradeId") Long gradeId,@Param("userId")Long userId,@Param("courseId")Long courseId);
+    Integer rebuildCheck(@Param("sectionId") Long id,@Param("gradeId") Long gradeId,@Param("userId")Long userId,@Param("courseId")Long courseId,@Param("orderGoodsId") Long orderGoodsId);
 
-    Integer rebuildSectionCheck(@Param("sectionId") Long id,@Param("moduleId") Long moduleId,@Param("chapterId") Long chapterId,@Param("gradeId") Long gradeId,@Param("userId")Long userId,@Param("courseId")Long courseId);
+    Integer rebuildSectionCheck(@Param("sectionId") Long id,@Param("moduleId") Long moduleId,@Param("chapterId") Long chapterId,@Param("gradeId") Long gradeId,@Param("userId")Long userId,@Param("courseId")Long courseId,@Param("orderGoodsId") Long orderGoodsId);
 
-    Integer rebuildChapterCheck(@Param("chapterId")Long id,@Param("gradeId") Long gradeId,@Param("userId") Long userId,@Param("courseId")Long courseId);
+    Integer rebuildChapterCheck(@Param("chapterId")Long id,@Param("gradeId") Long gradeId,@Param("userId") Long userId,@Param("courseId")Long courseId,@Param("orderGoodsId") Long orderGoodsId);
 
-    Integer rebuildModuleCheck(@Param("moduleId")Long id,@Param("gradeId") Long gradeId,@Param("userId") Long userId,@Param("courseId")Long courseId);
+    Integer rebuildModuleCheck(@Param("moduleId")Long id,@Param("gradeId") Long gradeId,@Param("userId") Long userId,@Param("courseId")Long courseId,@Param("orderGoodsId") Long orderGoodsId);
 
-    Integer learningCheck(@Param("sectionId") Long id,@Param("gradeId") Long gradeId,@Param("userId")Long userId,@Param("courseId")Long courseId);
+    Integer learningCheck(@Param("sectionId") Long id,@Param("gradeId") Long gradeId,@Param("userId")Long userId,@Param("courseId")Long courseId,@Param("orderGoodsId") Long orderGoodsId);
 
-    Long getStudyDuration(@Param("sectionId") Long id,@Param("gradeId") Long gradeId,@Param("userId")Long userId,@Param("courseId")Long courseId);
+    Long getStudyDuration(@Param("sectionId") Long id,@Param("gradeId") Long gradeId,@Param("userId")Long userId,@Param("courseId")Long courseId,@Param("orderGoodsId") Long orderGoodsId);
 
-    Integer auditCheck(@Param("sectionId") Long id,@Param("gradeId") Long gradeId,@Param("userId")Long userId,@Param("courseId")Long courseId);
+    Integer auditCheck(@Param("sectionId") Long id,@Param("gradeId") Long gradeId,@Param("userId")Long userId,@Param("courseId")Long courseId,@Param("orderGoodsId") Long orderGoodsId);
 
     List<CourseUserMenuVo> getGoodsMenuList(CourseMenuQueryBo bo);
 

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

@@ -21,12 +21,12 @@ public interface CourseModuleChapterMapper extends BaseMapper<CourseModuleChapte
 
     List<CourseUserModuleChapterVo> chapterList(CourseMenuQueryBo bo);
 
-    Integer rebuildChapterCheck(@Param("moduleId") Long moduleId,@Param("chapterId") Long chapterId,@Param("gradeId") Long gradeId,@Param("userId") Long userId,@Param("examId") Long examId);
+    Integer rebuildChapterCheck(@Param("moduleId") Long moduleId,@Param("chapterId") Long chapterId,@Param("gradeId") Long gradeId,@Param("userId") Long userId,@Param("examId") Long examId,@Param("orderGoodsId") Long orderGoodsId);
 
     List<CourseUserModuleChapterVo> examList(CourseMenuQueryBo bo);
 
     Integer learningExamCheck(@Param("typeId") Long typeId,@Param("gradeId") Long gradeId,
-                              @Param("userId") Long userId,@Param("moduleId") Long moduleId,@Param("chapterId") Long chapterId,@Param("examId") Long examId,@Param("courseId") Long courseId);
+                              @Param("userId") Long userId,@Param("moduleId") Long moduleId,@Param("chapterId") Long chapterId,@Param("examId") Long examId,@Param("courseId") Long courseId,@Param("orderGoodsId") Long orderGoodsId);
 
     @InterceptorIgnore(tenantLine = "true")
     void deleteByIdAndTenant(@Param("newModuleId") Long newModuleId,@Param("newTenantId") Long newTenantId);

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

@@ -62,6 +62,9 @@ public class CourseBusinessServiceImpl extends ServiceImpl<CourseBusinessMapper,
             if(fullName.equals("继续教育二级建造师")||fullName.equals("继续教育二级造价师")||fullName.equals("考前培训七大员施工现场专业人员")){
                 vo.setGoodsLearningOrder(2);
             }
+            if(fullName.contains("继续教育")&&fullName.contains("施工现场专业人员")){
+                vo.setGoodsLearningOrder(2);
+            }
         }
         return BeanUtil.toBean(vo, CourseBusinessVo.class);
     }

+ 15 - 8
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseChapterSectionServiceImpl.java

@@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.github.pagehelper.Page;
+import com.zhongzheng.common.exception.CustomException;
 import com.zhongzheng.modules.course.bo.CourseChapterSectionAddBo;
 import com.zhongzheng.modules.course.bo.CourseChapterSectionEditBo;
 import com.zhongzheng.modules.course.bo.CourseChapterSectionQueryBo;
@@ -139,6 +140,9 @@ public class CourseChapterSectionServiceImpl extends ServiceImpl<CourseChapterSe
 
     @Override
     public List<CourseUserChapterSectionVo> sectionList(CourseMenuQueryBo bo) {
+        if(Validator.isEmpty(bo.getOrderGoodsId())){
+            throw new CustomException("OrderGoodsId缺失");
+        }
         List<CourseUserChapterSectionVo> courseUserChapterSectionVos = courseChapterSectionMapper.sectionList(bo);
         List<CourseUserChapterSectionVo> examList = null;
         if (!CollectionUtils.isEmpty(courseUserChapterSectionVos)) {
@@ -154,31 +158,31 @@ public class CourseChapterSectionServiceImpl extends ServiceImpl<CourseChapterSe
             for (CourseUserChapterSectionVo courseMenuVo : courseUserChapterSectionVos) {
                 if (courseMenuVo.getType().equals(1)) {
                     //节
-                    Integer rebuild = baseMapper.rebuildCheck(courseMenuVo.getTypeId(), courseMenuVo.getGradeId(), bo.getUserId(), bo.getModuleId(), bo.getChapterId(), null,bo.getCourseId());
+                    Integer rebuild = baseMapper.rebuildCheck(courseMenuVo.getTypeId(), courseMenuVo.getGradeId(), bo.getUserId(), bo.getModuleId(), bo.getChapterId(), null,bo.getCourseId(),bo.getOrderGoodsId());
                     if (rebuild > 0) {
                         courseMenuVo.setRebuild(1);
                     }
-                    Integer audit = baseMapper.auditCheck(courseMenuVo.getTypeId(), courseMenuVo.getGradeId(), bo.getUserId(), bo.getModuleId(), bo.getChapterId(), 0L,bo.getCourseId());
+                    Integer audit = baseMapper.auditCheck(courseMenuVo.getTypeId(), courseMenuVo.getGradeId(), bo.getUserId(), bo.getModuleId(), bo.getChapterId(), 0L,bo.getCourseId(),bo.getOrderGoodsId());
                     if (audit > 0) {
                         courseMenuVo.setAudit(1L);
                     }
-                    Integer learning = baseMapper.learningCheck(courseMenuVo.getTypeId(), courseMenuVo.getGradeId(), bo.getUserId(), bo.getModuleId(), bo.getChapterId(), null,bo.getCourseId());
+                    Integer learning = baseMapper.learningCheck(courseMenuVo.getTypeId(), courseMenuVo.getGradeId(), bo.getUserId(), bo.getModuleId(), bo.getChapterId(), null,bo.getCourseId(),bo.getOrderGoodsId());
                     if (learning > 0) {
                         courseMenuVo.setLearning(1L);
                     }
-                    Long studyDuration = baseMapper.getStudyDuration(courseMenuVo.getTypeId(), courseMenuVo.getGradeId(), bo.getUserId(), bo.getModuleId(), bo.getChapterId(), 0L,bo.getCourseId());
+                    Long studyDuration = baseMapper.getStudyDuration(courseMenuVo.getTypeId(), courseMenuVo.getGradeId(), bo.getUserId(), bo.getModuleId(), bo.getChapterId(), 0L,bo.getCourseId(),bo.getOrderGoodsId());
                     courseMenuVo.setStudyDuration(studyDuration);
                 } else {
                     //章卷
-                    Integer rebuild = baseMapper.rebuildCheck(0L, courseMenuVo.getGradeId(), bo.getUserId(), bo.getModuleId(), bo.getChapterId(), courseMenuVo.getTypeId(),bo.getCourseId());
+                    Integer rebuild = baseMapper.rebuildCheck(0L, courseMenuVo.getGradeId(), bo.getUserId(), bo.getModuleId(), bo.getChapterId(), courseMenuVo.getTypeId(),bo.getCourseId(),bo.getOrderGoodsId());
                     if (rebuild > 0) {
                         courseMenuVo.setRebuild(1);
                     }
-                    Integer audit = baseMapper.auditCheck(0L, courseMenuVo.getGradeId(), bo.getUserId(), bo.getModuleId(), bo.getChapterId(), courseMenuVo.getTypeId(),bo.getCourseId());
+                    Integer audit = baseMapper.auditCheck(0L, courseMenuVo.getGradeId(), bo.getUserId(), bo.getModuleId(), bo.getChapterId(), courseMenuVo.getTypeId(),bo.getCourseId(),bo.getOrderGoodsId());
                     if (rebuild > 0) {
                         courseMenuVo.setAudit(1L);
                     }
-                    Integer learning = baseMapper.learningExamCheck(0L, courseMenuVo.getGradeId(), bo.getUserId(), bo.getModuleId(), bo.getChapterId(), courseMenuVo.getTypeId(),bo.getCourseId());
+                    Integer learning = baseMapper.learningExamCheck(0L, courseMenuVo.getGradeId(), bo.getUserId(), bo.getModuleId(), bo.getChapterId(), courseMenuVo.getTypeId(),bo.getCourseId(),bo.getOrderGoodsId());
                    if(Validator.isNotEmpty(learning)){
                        courseMenuVo.setLearning(new Long(learning));
                    }
@@ -196,9 +200,12 @@ public class CourseChapterSectionServiceImpl extends ServiceImpl<CourseChapterSe
 
     @Override
     public List<CourseUserChapterSectionVo> sectionExamList(CourseMenuQueryBo bo) {
+        if(Validator.isEmpty(bo.getOrderGoodsId())){
+            throw new CustomException("OrderGoodsId缺失");
+        }
         List<CourseUserChapterSectionVo> examList = baseMapper.sectionExamList(bo);
         for(CourseUserChapterSectionVo vo : examList){
-            Integer learning = baseMapper.learningSectionExamCheck(0L, vo.getGradeId(), bo.getUserId(), bo.getModuleId(), bo.getChapterId(), vo.getTypeId(),bo.getCourseId(),vo.getSectionId());
+            Integer learning = baseMapper.learningSectionExamCheck(0L, vo.getGradeId(), bo.getUserId(), bo.getModuleId(), bo.getChapterId(), vo.getTypeId(),bo.getCourseId(),vo.getSectionId(),bo.getOrderGoodsId());
             if(Validator.isNotEmpty(learning)){
                 vo.setLearning(new Long(learning));
             }

+ 15 - 12
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseMenuServiceImpl.java

@@ -232,34 +232,37 @@ public class CourseMenuServiceImpl extends ServiceImpl<CourseMenuMapper, CourseM
     public List<CourseUserMenuVo> menuList(CourseMenuQueryBo bo) {
         List<CourseUserMenuVo> courseMenuVos = baseMapper.menuList(bo);
         if (bo.getUserId() != null) {
+            if(Validator.isEmpty(bo.getOrderGoodsId())){
+                throw new CustomException("订单商品缺失");
+            }
             for (CourseUserMenuVo courseMenuVo : courseMenuVos) {
                 //为节的时候查询重修情况,和是否已学习
                 if (courseMenuVo.getType().equals(3)) {
-                    Integer rebuild = baseMapper.rebuildCheck(courseMenuVo.getMenuId(), courseMenuVo.getGradeId(), bo.getUserId(),bo.getCourseId());
+                    Integer rebuild = baseMapper.rebuildCheck(courseMenuVo.getMenuId(), courseMenuVo.getGradeId(), bo.getUserId(),bo.getCourseId(),bo.getOrderGoodsId());
                     if (rebuild > 0) {
                         courseMenuVo.setRebuild(1);
                     }
-                    Integer audit = baseMapper.auditCheck(courseMenuVo.getMenuId(), courseMenuVo.getGradeId(), bo.getUserId(),bo.getCourseId());
+                    Integer audit = baseMapper.auditCheck(courseMenuVo.getMenuId(), courseMenuVo.getGradeId(), bo.getUserId(),bo.getCourseId(),bo.getOrderGoodsId());
                     if (audit > 0) {
                         courseMenuVo.setAudit(1L);
                     }
-                    Integer learning = baseMapper.learningCheck(courseMenuVo.getMenuId(), courseMenuVo.getGradeId(), bo.getUserId(),bo.getCourseId());
+                    Integer learning = baseMapper.learningCheck(courseMenuVo.getMenuId(), courseMenuVo.getGradeId(), bo.getUserId(),bo.getCourseId(),bo.getOrderGoodsId());
                     if (learning > 0) {
                         courseMenuVo.setLearning(1L);
                     }
-                    Long studyDuration = baseMapper.getStudyDuration(courseMenuVo.getMenuId(), courseMenuVo.getGradeId(), bo.getUserId(),bo.getCourseId());
+                    Long studyDuration = baseMapper.getStudyDuration(courseMenuVo.getMenuId(), courseMenuVo.getGradeId(), bo.getUserId(),bo.getCourseId(),bo.getOrderGoodsId());
                     courseMenuVo.setStudyDuration(studyDuration);
                 }
                 //为章的时候查询重修情况
                 if (courseMenuVo.getType().equals(2)){
-                    Integer rebuild = baseMapper.rebuildChapterCheck(courseMenuVo.getMenuId(), courseMenuVo.getGradeId(), bo.getUserId(),bo.getCourseId());
+                    Integer rebuild = baseMapper.rebuildChapterCheck(courseMenuVo.getMenuId(), courseMenuVo.getGradeId(), bo.getUserId(),bo.getCourseId(),bo.getOrderGoodsId());
                     if (rebuild > 0) {
                         courseMenuVo.setRebuild(1);
                     }
                 }
                 //为模块的时候查询重修情况
                 if (courseMenuVo.getType().equals(1)){
-                    Integer rebuild = baseMapper.rebuildModuleCheck(courseMenuVo.getMenuId(), courseMenuVo.getGradeId(), bo.getUserId(),bo.getCourseId());
+                    Integer rebuild = baseMapper.rebuildModuleCheck(courseMenuVo.getMenuId(), courseMenuVo.getGradeId(), bo.getUserId(),bo.getCourseId(),bo.getOrderGoodsId());
                     if (rebuild > 0) {
                         courseMenuVo.setRebuild(1);
                     }
@@ -288,31 +291,31 @@ public class CourseMenuServiceImpl extends ServiceImpl<CourseMenuMapper, CourseM
                 }
                 //为节的时候查询重修情况,和是否已学习
                 if (courseMenuVo.getType().equals(3)) {
-                    Integer rebuild = baseMapper.rebuildCheck(courseMenuVo.getMenuId(), courseMenuVo.getGradeId(), bo.getUserId(),courseMenuVo.getCourseId());
+                    Integer rebuild = baseMapper.rebuildCheck(courseMenuVo.getMenuId(), courseMenuVo.getGradeId(), bo.getUserId(),courseMenuVo.getCourseId(),bo.getOrderGoodsId());
                     if (rebuild > 0) {
                         courseMenuVo.setRebuild(1);
                     }
-                    Integer audit = baseMapper.auditCheck(courseMenuVo.getMenuId(), courseMenuVo.getGradeId(), bo.getUserId(),courseMenuVo.getCourseId());
+                    Integer audit = baseMapper.auditCheck(courseMenuVo.getMenuId(), courseMenuVo.getGradeId(), bo.getUserId(),courseMenuVo.getCourseId(),bo.getOrderGoodsId());
                     if (audit > 0) {
                         courseMenuVo.setAudit(1L);
                     }
-                    Integer learning = baseMapper.learningCheck(courseMenuVo.getMenuId(), courseMenuVo.getGradeId(), bo.getUserId(),courseMenuVo.getCourseId());
+                    Integer learning = baseMapper.learningCheck(courseMenuVo.getMenuId(), courseMenuVo.getGradeId(), bo.getUserId(),courseMenuVo.getCourseId(),bo.getOrderGoodsId());
                     if (learning > 0) {
                         courseMenuVo.setLearning(1L);
                     }
-                    Long studyDuration = baseMapper.getStudyDuration(courseMenuVo.getMenuId(), courseMenuVo.getGradeId(), bo.getUserId(),courseMenuVo.getCourseId());
+                    Long studyDuration = baseMapper.getStudyDuration(courseMenuVo.getMenuId(), courseMenuVo.getGradeId(), bo.getUserId(),courseMenuVo.getCourseId(),bo.getOrderGoodsId());
                     courseMenuVo.setStudyDuration(studyDuration);
                 }
                 //为章的时候查询重修情况
                 if (courseMenuVo.getType().equals(2)){
-                    Integer rebuild = baseMapper.rebuildChapterCheck(courseMenuVo.getMenuId(), courseMenuVo.getGradeId(), bo.getUserId(),courseMenuVo.getCourseId());
+                    Integer rebuild = baseMapper.rebuildChapterCheck(courseMenuVo.getMenuId(), courseMenuVo.getGradeId(), bo.getUserId(),courseMenuVo.getCourseId(),bo.getOrderGoodsId());
                     if (rebuild > 0) {
                         courseMenuVo.setRebuild(1);
                     }
                 }
                 //为模块的时候查询重修情况
                 if (courseMenuVo.getType().equals(1)){
-                    Integer rebuild = baseMapper.rebuildModuleCheck(courseMenuVo.getMenuId(), courseMenuVo.getGradeId(), bo.getUserId(),courseMenuVo.getCourseId());
+                    Integer rebuild = baseMapper.rebuildModuleCheck(courseMenuVo.getMenuId(), courseMenuVo.getGradeId(), bo.getUserId(),courseMenuVo.getCourseId(),bo.getOrderGoodsId());
                     if (rebuild > 0) {
                         courseMenuVo.setRebuild(1);
                     }

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

@@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.github.pagehelper.Page;
+import com.zhongzheng.common.exception.CustomException;
 import com.zhongzheng.common.utils.ServletUtils;
 import com.zhongzheng.modules.course.bo.CourseMenuQueryBo;
 import com.zhongzheng.modules.course.bo.CourseModuleChapterAddBo;
@@ -112,10 +113,13 @@ public class CourseModuleChapterServiceImpl extends ServiceImpl<CourseModuleChap
 
     @Override
     public List<CourseUserModuleChapterVo> chapterList(CourseMenuQueryBo bo) {
+        if(Validator.isEmpty(bo.getOrderGoodsId())){
+            throw new CustomException("OrderGoodsId缺失");
+        }
         List<CourseUserModuleChapterVo> courseUserModuleChapterVos = baseMapper.chapterList(bo);
         List<CourseUserModuleChapterVo> examList = baseMapper.examList(bo);
         for(CourseUserModuleChapterVo vo : examList){
-            Integer learning = baseMapper.learningExamCheck(0L, vo.getGradeId(), bo.getUserId(), bo.getModuleId(), bo.getChapterId(), vo.getTypeId(),bo.getCourseId());
+            Integer learning = baseMapper.learningExamCheck(0L, vo.getGradeId(), bo.getUserId(), bo.getModuleId(), bo.getChapterId(), vo.getTypeId(),bo.getCourseId(),bo.getOrderGoodsId());
             if(Validator.isNotEmpty(learning)){
                 vo.setLearning(new Long(learning));
             }
@@ -133,14 +137,14 @@ public class CourseModuleChapterServiceImpl extends ServiceImpl<CourseModuleChap
             }
             if(courseUserModuleChapterVo.getType()==1){
                 //查询章是否重修章
-                Integer rebuild = baseMapper.rebuildChapterCheck(courseUserModuleChapterVo.getModuleId(),courseUserModuleChapterVo.getChapterId(), courseUserModuleChapterVo.getGradeId(), bo.getUserId(),null);
+                Integer rebuild = baseMapper.rebuildChapterCheck(courseUserModuleChapterVo.getModuleId(),courseUserModuleChapterVo.getChapterId(), courseUserModuleChapterVo.getGradeId(), bo.getUserId(),null,bo.getOrderGoodsId());
                 if (rebuild > 0) {
                     courseUserModuleChapterVo.setRebuild(1);
                 }
             }
             if(courseUserModuleChapterVo.getType()==2){
                 //查询模块卷是否重修
-                Integer rebuild = baseMapper.rebuildChapterCheck(courseUserModuleChapterVo.getModuleId(),null, courseUserModuleChapterVo.getGradeId(), bo.getUserId(),courseUserModuleChapterVo.getTypeId());
+                Integer rebuild = baseMapper.rebuildChapterCheck(courseUserModuleChapterVo.getModuleId(),null, courseUserModuleChapterVo.getGradeId(), bo.getUserId(),courseUserModuleChapterVo.getTypeId(),bo.getOrderGoodsId());
                 if (rebuild > 0) {
                     courseUserModuleChapterVo.setRebuild(1);
                 }

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

@@ -43,6 +43,7 @@ import com.zhongzheng.modules.grade.service.IUserPeriodService;
 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.service.IOrderGoodsService;
 import com.zhongzheng.modules.user.bo.SubjectStudyRecordQueryBo;
 import com.zhongzheng.modules.user.bo.UserPlanQueryBo;
 import com.zhongzheng.modules.user.domain.UserBankRecord;
@@ -449,7 +450,7 @@ public class CourseServiceImpl extends ServiceImpl<CourseMapper, Course> impleme
         //用户课程得详细信息
         for (GoodsUserVo goodsUserVo : goodsUserVos) {
             //获得当前所在班级
-            ClassGradeVo classGradeVo = baseMapper.gradeIdSelect(goodsUserVo.getUserId(),goodsUserVo.getGoodsId(),goodsUserVo.getGradeId());
+            ClassGradeVo classGradeVo = baseMapper.gradeIdSelect(goodsUserVo.getUserId(),goodsUserVo.getGoodsId(),goodsUserVo.getGradeId(),goodsUserVo.getOrderGoodsId());
             if(Validator.isEmpty(classGradeVo)){
                 continue;
             }
@@ -485,6 +486,7 @@ public class CourseServiceImpl extends ServiceImpl<CourseMapper, Course> impleme
             subjectStudyRecordQueryBo.setGoodsId(goodsUserVo.getGoodsId());
             subjectStudyRecordQueryBo.setUserId(bo.getUserId());
             subjectStudyRecordQueryBo.setGradeId(goodsUserVo.getGradeId());
+            subjectStudyRecordQueryBo.setOrderGoodsId(goodsUserVo.getOrderGoodsId());
             List<SubjectStudyRecordVo> subjectStudyRecordVos = iUserStudyRecordService.listSubject(subjectStudyRecordQueryBo);
             for (SubjectStudyRecordVo subjectStudyRecordVo : subjectStudyRecordVos) {
                 secLong = new BigDecimal(secLong.toString()).add(new BigDecimal(subjectStudyRecordVo.getSectionNum().toString())).longValue();
@@ -622,7 +624,7 @@ public class CourseServiceImpl extends ServiceImpl<CourseMapper, Course> impleme
         //用户课程得详细信息
         for (GoodsUserVo goodsUserVo : goodsUserVos) {
             //获得当前所在班级
-            ClassGradeVo classGradeVo = baseMapper.gradeIdSelect(goodsUserVo.getUserId(),goodsUserVo.getGoodsId(),goodsUserVo.getGradeId());
+            ClassGradeVo classGradeVo = baseMapper.gradeIdSelect(goodsUserVo.getUserId(),goodsUserVo.getGoodsId(),goodsUserVo.getGradeId(),goodsUserVo.getOrderGoodsId());
             if(Validator.isEmpty(classGradeVo)){
                 continue;
             }
@@ -632,6 +634,7 @@ public class CourseServiceImpl extends ServiceImpl<CourseMapper, Course> impleme
             subjectStudyRecordQueryBo.setGoodsId(goodsUserVo.getGoodsId());
             subjectStudyRecordQueryBo.setUserId(bo.getUserId());
             subjectStudyRecordQueryBo.setGradeId(goodsUserVo.getGradeId());
+            subjectStudyRecordQueryBo.setOrderGoodsId(goodsUserVo.getOrderGoodsId());
             List<SubjectStudyRecordVo> subjectStudyRecordVos = iUserStudyRecordService.listSubject(subjectStudyRecordQueryBo);
             for (SubjectStudyRecordVo subjectStudyRecordVo : subjectStudyRecordVos) {
                 secLong = new BigDecimal(secLong.toString()).add(new BigDecimal(subjectStudyRecordVo.getSectionNum().toString())).longValue();

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/vo/CourseChapterVo.java

@@ -81,4 +81,6 @@ public class CourseChapterVo {
 	@Excel(name = "导入编号")
 	@ApiModelProperty("导入编号")
 	private String importNo;
+	@ApiModelProperty("公共标识:1公共章 0非公共章")
+	private Integer commonSign;
 }

+ 1 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/vo/CourseUserChapterSectionVo.java

@@ -123,4 +123,5 @@ public class CourseUserChapterSectionVo {
 	private String teacherName;
 	@ApiModelProperty("观看时长(秒)")
 	private Long studyDuration;
+	private Long orderGoodsId;
 }

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/vo/CourseUserMenuVo.java

@@ -98,4 +98,7 @@ public class CourseUserMenuVo {
 	@ApiModelProperty("商品ID")
 	private Long goodsId;
 
+	@ApiModelProperty("公共标识:1公共章 0非公共章")
+	private Integer commonSign;
+
 }

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/vo/CourseUserModuleChapterVo.java

@@ -101,4 +101,6 @@ public class CourseUserModuleChapterVo {
 	private Long doNum;
 	@ApiModelProperty("1已学习")
 	private Long learning;
+	@ApiModelProperty("公共标识:1公共章 0非公共章")
+	private Integer commonSign;
 }

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

@@ -197,4 +197,7 @@ public class GoodsAddBo {
     /** 班级类型 1基础班 2强化班 3私塾班 */
     @ApiModelProperty("班级类型 1基础班 2强化班 3私塾班")
     private Integer gradeType;
+    /** 七大员继教可选年份 */
+    @ApiModelProperty("七大员继教可选年份")
+    private String sevenYear;
 }

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

@@ -231,4 +231,7 @@ public class GoodsEditBo {
     /** 班级类型 1基础班 2强化班 3私塾班 */
     @ApiModelProperty("班级类型 1基础班 2强化班 3私塾班")
     private Integer gradeType;
+    /** 七大员继教可选年份 */
+    @ApiModelProperty("七大员继教可选年份")
+    private String sevenYear;
 }

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

@@ -23,4 +23,7 @@ public class GoodsSectionListBo implements Serializable {
 
     @ApiModelProperty("是否重修目录:1是 0否")
     private Integer rebuild;
+
+    @ApiModelProperty("订单商品ID")
+    private Long orderGoodsId;
 }

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

@@ -159,4 +159,6 @@ private static final long serialVersionUID=1L;
     private String commitPeriodRemark;
     /** 班级类型 1基础班 2强化班 3私塾班 */
     private Integer gradeType;
+    /** 七大员继教可选年份 */
+    private String sevenYear;
 }

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

@@ -78,4 +78,6 @@ public interface GoodsMapper extends BaseMapper<Goods> {
 
     @InterceptorIgnore(tenantLine = "true")
     void updateHandoutsId(@Param("goodsId") Long goodsId,@Param("tenantId") Long tenantId,@Param("handoutsId") Long handoutsId);
+
+    String getGoodsBusinessName(Long goodsId);
 }

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

@@ -142,4 +142,6 @@ public interface IGoodsService extends IService<Goods> {
 	Goods queryGoodsByIdTenant(Long goodsId, Long tenantId);
 
     boolean goodsHandoutsCopyAddTenant(GoodsHandoutsCopyTenantBo bo);
+
+	String getGoodsBusinessName(Long goodsId);
 }

+ 10 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/impl/GoodsServiceImpl.java

@@ -945,7 +945,7 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
     public GoodsVo selectUserDetail(CourseQueryBo bo) {
         GoodsVo goodsVo = baseMapper.selectUserDetail(bo);
         //获得当前所在班级
-        ClassGradeVo classGradeVo = courseMapper.gradeIdSelect(bo.getUserId(), bo.getGoodsId(), null);
+        ClassGradeVo classGradeVo = courseMapper.gradeIdSelect(bo.getUserId(), bo.getGoodsId(), null,null);
         if (Validator.isNotEmpty(classGradeVo)) {
             goodsVo.setGradeId(classGradeVo.getGradeId());
         }
@@ -953,10 +953,14 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
         queryBo.setId(goodsVo.getBusinessId());
         String fullName = iCourseBusinessService.queryFullName(queryBo);
         goodsVo.setErJianErZao(false);
+        goodsVo.setJjShiGongYuan(false);
         if(Validator.isNotEmpty(fullName)){
             if(fullName.equals("继续教育二级建造师")||fullName.equals("继续教育二级造价师")){
                 goodsVo.setErJianErZao(true);
             }
+            if(fullName.contains("继续教育")&&fullName.contains("施工现场专业人员")){
+                goodsVo.setJjShiGongYuan(true);
+            }
         }
         return goodsVo;
     }
@@ -4961,6 +4965,11 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
         return true;
     }
 
+    @Override
+    public String getGoodsBusinessName(Long goodsId) {
+        return baseMapper.getGoodsBusinessName(goodsId);
+    }
+
     private void updateHandoutsId(Long goodsId, Long tenantId, Long handoutsId) {
         baseMapper.updateHandoutsId(goodsId,tenantId,handoutsId);
     }

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

@@ -415,4 +415,9 @@ public class GoodsUserVo {
 
 	@ApiModelProperty("大于0开始学习")
 	private Integer studyStatus;
+
+	@ApiModelProperty("七大员继教商品年份")
+	private String sevenYear;
+	@ApiModelProperty("七大员继教订单商品年份")
+	private String orderYear;
 }

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

@@ -366,5 +366,9 @@ public class GoodsVo {
 	private Integer gradeType;
 	@ApiModelProperty("官方班级名称")
 	private String officialName;
-
+	/** 七大员继教可选年份 */
+	@ApiModelProperty("七大员继教可选年份")
+	private String sevenYear;
+	@ApiModelProperty("是否是继教施工员")
+	private Boolean jjShiGongYuan;
 }

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

@@ -54,4 +54,6 @@ public class ClassGradeUserTempQueryBo extends BaseEntity {
 	/** 订单编号 */
 	@ApiModelProperty("订单编号")
 	private String orderSn;
+	@ApiModelProperty("七大员继教商品年份")
+	private String sevenYear;
 }

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

@@ -51,4 +51,7 @@ public class UserPeriodAddBo {
     /** 班级ID */
     @ApiModelProperty("班级ID")
     private Long gradeId;
+    /** 订单商品ID */
+    @ApiModelProperty("订单商品ID")
+    private Long orderGoodsId;
 }

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

@@ -82,4 +82,5 @@ public class UserPeriodEditBo {
     @ApiModelProperty("打回操作平台 1自有系统 2老系统")
     private Integer rollBackPlat;
 
+
 }

+ 1 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/bo/UserPeriodQueryBo.java

@@ -88,4 +88,5 @@ public class UserPeriodQueryBo extends BaseEntity {
 
 	@ApiModelProperty("周查询结束时间")
 	private Long searchWeekEndTime;
+	private Long orderGoodsId;
 }

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

@@ -22,7 +22,8 @@ import com.zhongzheng.common.annotation.Excel;
 @TableName("class_grade")
 public class ClassGrade implements Serializable {
     public static final Integer INIT_UPPER = 300;  //初始人数
-    public static final Integer INIT_UPPER2 = 1000000;  //初始人数
+    public static final Integer INIT_UPPER2 = 100000;  //初始人数
+    public static final Integer INIT_UPPER3 = 1000;  //初始人数
 
 private static final long serialVersionUID=1L;
 

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

@@ -48,4 +48,6 @@ private static final long serialVersionUID=1L;
     private Long goodsId;
     /** 订单编号 */
     private String orderSn;
+    /** 七大员继教商品年份 */
+    private String sevenYear;
 }

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

@@ -50,4 +50,6 @@ private static final long serialVersionUID=1L;
     private Long chapterId;
     /** 班级ID */
     private Long gradeId;
+    /** 订单商品ID */
+    private Long orderGoodsId;
 }

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

@@ -7,6 +7,7 @@ import com.zhongzheng.modules.grade.bo.*;
 import com.zhongzheng.modules.grade.domain.ClassGrade;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.zhongzheng.modules.grade.vo.*;
+import com.zhongzheng.modules.order.domain.OrderGoods;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.Collection;
@@ -86,4 +87,5 @@ public interface ClassGradeMapper extends BaseMapper<ClassGrade> {
 
     @InterceptorIgnore(tenantLine = "true")
     void UpGradeInterfaceByTenant(ClassGradeOpenUpBo upBo);
+
 }

+ 3 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/mapper/ClassGradeUserMapper.java

@@ -42,7 +42,7 @@ public interface ClassGradeUserMapper extends BaseMapper<ClassGradeUser> {
 
     ClassPeriodStudentVo userPeriodStatus(ClassGradeUserQueryBo bo);
 
-    List<ClassPeriodChapterVo> listperiodChapter(@Param("moduleId") Long id,@Param("goodsId") Long goodsId,@Param("courseId") Long courseId,@Param("userId") Long userId,@Param("gradeId") Long gradeId);
+    List<ClassPeriodChapterVo> listperiodChapter(@Param("moduleId") Long id,@Param("goodsId") Long goodsId,@Param("courseId") Long courseId,@Param("userId") Long userId,@Param("gradeId") Long gradeId,@Param("orderGoodsId") Long orderGoodsId);
 
     List<ClassPeriodSectionVo> listPeriodSection(@Param("chapterId") Long id,@Param("goodsId") Long goodsId,@Param("courseId") Long courseId,@Param("userId") Long userId);
 
@@ -92,4 +92,6 @@ public interface ClassGradeUserMapper extends BaseMapper<ClassGradeUser> {
     Long getPeriodStartTime(ClassGradeUserQueryBo bo);
 
     Long getPeriodEndTime(ClassGradeUserQueryBo bo);
+
+    List<ClassGradeUser> getClassInfoByUser(Long userId);
 }

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

@@ -104,4 +104,6 @@ public interface IClassGradeService extends IService<ClassGrade> {
 	void openOfficialGrade(ClassGradeOpenBo bo);
 
 	List<ClassNpUserInfoVo> otherClassUserList(ClassNpUserInfoBo bo);
+
+
 }

+ 5 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/IClassGradeUserService.java

@@ -55,13 +55,15 @@ public interface IClassGradeUserService extends IService<ClassGradeUser> {
 	String pushOfficialInfo(ClassGradeUserQueryBo bo);
 
 
-
 	ClassPeriodStudentVo DecryptOfficialInfo(ClassGradeDecryptQueryBo bo);
 
+	ClassPeriodStudentVo DecryptSevenOfficialInfo(ClassGradeDecryptQueryBo bo);
+
 	String pushOfficialInfoMore(List<ClassGradeUserQueryBo> list);
 
 	String pushOfficialPeriod(ClassGradeUserQueryBo bo);
 
+
 	String pushOfficialPeriodMore(List<ClassGradeUserQueryBo> list);
 
 	Map<String,Object> exportPo(ClassGradeUserQueryBo bo);
@@ -139,4 +141,6 @@ public interface IClassGradeUserService extends IService<ClassGradeUser> {
 
 	Long checkFinishRequiredCourse(ClassGradeUserQueryBo bo);
 
+    List<ClassGradeUser> getClassInfoByUser(Long userId);
+
 }

+ 16 - 2
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/impl/ClassGradeServiceImpl.java

@@ -41,7 +41,9 @@ import com.zhongzheng.modules.inform.service.IInformRemindService;
 import com.zhongzheng.modules.inform.service.IInformUserService;
 import com.zhongzheng.modules.inform.vo.InformRemindBusinessVo;
 import com.zhongzheng.modules.inform.vo.InformRemindVo;
+import com.zhongzheng.modules.order.domain.OrderGoods;
 import com.zhongzheng.modules.order.mapper.OrderMapper;
+import com.zhongzheng.modules.order.service.IOrderGoodsService;
 import com.zhongzheng.modules.system.domain.SysOldOrg;
 import com.zhongzheng.modules.system.domain.SysTenant;
 import com.zhongzheng.modules.system.service.ISysOldOrgService;
@@ -154,6 +156,9 @@ public class ClassGradeServiceImpl extends ServiceImpl<ClassGradeMapper, ClassGr
     @Autowired
     private ISysOldOrgService sysOldOrgService;
 
+    @Autowired
+    private IOrderGoodsService iOrderGoodsService;
+
     @Autowired
     private com.zhongzheng.modules.alisms.service.IAliSmsService IAliSmsService;
 
@@ -179,6 +184,7 @@ public class ClassGradeServiceImpl extends ServiceImpl<ClassGradeMapper, ClassGr
         return entity2Vo(baseMapper.queryList(classGradeQueryBo)).get(0);
     }
 
+
     @Override
     @DataScope(businessAlias = "cb")
     public List<ClassGradeVo> queryList(ClassGradeQueryBo bo) {
@@ -199,6 +205,9 @@ public class ClassGradeServiceImpl extends ServiceImpl<ClassGradeMapper, ClassGr
         if (CollectionUtils.isEmpty(classGradeVos)) {
             return new ArrayList<>();
         }
+        for (ClassGradeVo classGradeVo : classGradeVos) {
+            classGradeVo.setStudentNumAll(classGradeVo.getStudentNum());
+        }
         return classGradeVos;
     }
 
@@ -685,6 +694,7 @@ public class ClassGradeServiceImpl extends ServiceImpl<ClassGradeMapper, ClassGr
             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();
@@ -1233,8 +1243,12 @@ public class ClassGradeServiceImpl extends ServiceImpl<ClassGradeMapper, ClassGr
             UserStudyRecord startRecord = iUserStudyRecordService.getStudyRecord(item.getUserId(), item.getGradeId(), "ASC");
             if (ObjectUtils.isNotNull(startRecord)) {
                 item.setBeginTime(DateUtils.timestampToDateFormat(startRecord.getCreateTime(), date));
-                UserStudyRecord endRecord = iUserStudyRecordService.getStudyRecord(item.getUserId(), item.getGradeId(), "DESC");
-                item.setApplyTime(DateUtils.timestampToDateFormat(endRecord.getCreateTime(), date));
+                if (ObjectUtils.isNotNull(item.getFinishStatus()) && item.getFinishStatus() == 1){
+                    //已学完
+                    UserStudyRecord endRecord = iUserStudyRecordService.getStudyRecord(item.getUserId(), item.getGradeId(), "DESC");
+                    item.setApplyTime(DateUtils.timestampToDateFormat(endRecord.getCreateTime(), date));
+                }
+
             }
             //科目名称
             if (StringUtils.isNotBlank(item.getSubjectIds())) {

+ 452 - 18
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/impl/ClassGradeUserServiceImpl.java

@@ -36,6 +36,7 @@ import com.zhongzheng.modules.course.vo.CourseBusinessVo;
 import com.zhongzheng.modules.course.vo.CourseChapterVo;
 import com.zhongzheng.modules.course.vo.CourseProjectTypeVo;
 import com.zhongzheng.modules.goods.domain.Goods;
+import com.zhongzheng.modules.goods.domain.GoodsCourse;
 import com.zhongzheng.modules.goods.service.IGoodsService;
 import com.zhongzheng.modules.goods.vo.GoodsVo;
 import com.zhongzheng.modules.grade.bo.*;
@@ -174,12 +175,22 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
     @Value("${officialPush.token}")
     private String OFFICIALPUSH_TOKEN;
 
+    @Value("${officialPush.sevenInfoPath}")
+    private String OFFICIALPUSH_SEVEN_INFOPATH;
+
+    @Value("${officialPush.sevenPeriodPath}")
+    private String OFFICIALPUSH_SEVEN_PERIODPATH;
+
+
     @Autowired
     private IUserPeriodService iUserPeriodService;
 
     @Autowired
     private ISysOldOrgService sysOldOrgService;
 
+    private String SEVEN_OFFICIALPUSH_INFOACCOUNT;
+    private String SEVEN_OFFICIALPUSH_TOKEN;
+
     private static final Logger log = LoggerFactory.getLogger(ClassGradeUserServiceImpl.class);
 
     @Override
@@ -419,9 +430,13 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
         if (Validator.isEmpty(bo.getGradeId())) {
             throw new CustomException("参数错误");
         }
+        if (Validator.isEmpty(bo.getOrderGoodsId())) {
+            throw new CustomException("OrderGoods参数错误");
+        }
         ClassGradeUserQueryBo queryBo = new ClassGradeUserQueryBo();
         queryBo.setGradeId(bo.getGradeId());
         queryBo.setUserId(bo.getUserId());
+        queryBo.setOrderGoodsId(bo.getOrderGoodsId());
         ClassPeriodStudentVo classPeriodStudentVo = baseMapper.userPeriodStatus(queryBo);
         Long secLong = 0L;
         Long studyLong = 0L;
@@ -430,6 +445,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
         subjectStudyRecordQueryBo.setGoodsId(classPeriodStudentVo.getGoodsId());
         subjectStudyRecordQueryBo.setUserId(bo.getUserId());
         subjectStudyRecordQueryBo.setGradeId(bo.getGradeId());
+        subjectStudyRecordQueryBo.setOrderGoodsId(bo.getOrderGoodsId());
         List<SubjectStudyRecordVo> subjectStudyRecordVos = iUserStudyRecordService.listSubject(subjectStudyRecordQueryBo);
         for (SubjectStudyRecordVo subjectStudyRecordVo : subjectStudyRecordVos) {
             secLong = new BigDecimal(secLong.toString()).add(new BigDecimal(subjectStudyRecordVo.getSectionNum().toString())).longValue();
@@ -448,6 +464,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
         classGradeUserQueryBo.setGradeId(bo.getGradeId());
         classGradeUserQueryBo.setUserId(bo.getUserId());
         classGradeUserQueryBo.setGoodsId(classPeriodStudentVo.getGoodsId());
+        classGradeUserQueryBo.setOrderGoodsId(bo.getOrderGoodsId());
         List<ClassPeriodUserVo> classPeriodUserVos1 = baseMapper.listPeriod(classGradeUserQueryBo);
         ClassPeriodUserVo classPeriodUserVos = classPeriodUserVos1.get(0);
         classPeriodUserVos.setPending(classPeriodStudentVo.getSecAllNum() - classPeriodUserVos.getPass() - classPeriodUserVos.getCheat());
@@ -499,10 +516,13 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
         if (Validator.isEmpty(bo.getGradeId())) {
             throw new CustomException("参数错误");
         }
-
+        if (Validator.isEmpty(bo.getOrderGoodsId())) {
+            throw new CustomException("OrderGoodsId参数错误");
+        }
         LambdaQueryWrapper<ClassGradeUser> classGradeUser = Wrappers.lambdaQuery();
         classGradeUser.eq(ClassGradeUser::getUserId, bo.getUserId());
         classGradeUser.eq(ClassGradeUser::getGradeId, bo.getGradeId());
+        classGradeUser.eq(ClassGradeUser::getOrderGoodsId, bo.getOrderGoodsId());
         ClassGradeUser classGradeUser1 = new ClassGradeUser();
         classGradeUser1.setPeriodStatus(gradePeriodStatus);
         if (gradePeriodStatus == 2) {
@@ -541,6 +561,8 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
      */
     @Override
     public String pushOfficialInfo(ClassGradeUserQueryBo bo) {
+        OFFICIALPUSH_INFOACCOUNT = null;
+        OFFICIALPUSH_TOKEN = null;
         log.info("报名信息推送" + JSON.toJSONString(bo));
         //暂时先关闭信息推送入口
 //        if (true){
@@ -576,10 +598,18 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
         OrderGoodsQueryBo goodsQueryBo = new OrderGoodsQueryBo();
         goodsQueryBo.setUserId(bo.getUserId());
         goodsQueryBo.setGradeId(userVo.getGradeId());
+        goodsQueryBo.setOrderGoodsId(userVo.getOrderGoodsId());
         OrderGoodsVo orderGoods = iOrderGoodsService.gradeGoods(goodsQueryBo);
         if (Validator.isEmpty(orderGoods)) {
             return "班级商品不存在";
         }
+        Goods goods = iGoodsService.getOne(new LambdaQueryWrapper<Goods>().eq(Goods::getGoodsId,orderGoods.getGoodsId()));
+        CourseBusinessQueryBo queryBo = new CourseBusinessQueryBo();
+        queryBo.setId(goods.getBusinessId());
+        String fullName = iCourseBusinessService.queryFullName(queryBo);
+        if(fullName.contains("继续教育")&&fullName.contains("施工现场专业人员")){
+            return pushSevenOfficialInfo(bo,userVo,orderGoods);
+        }
         Long bmrq = 0L;
         if (Validator.isEmpty(userVo.getClassStartTime())) {
             return "班级开始时间缺失";
@@ -647,6 +677,121 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
         }
     }
 
+
+    public String pushSevenOfficialInfo(ClassGradeUserQueryBo bo,ClassGradeUserVo userVo,OrderGoodsVo orderGoods) {
+        SEVEN_OFFICIALPUSH_INFOACCOUNT=null;
+        SEVEN_OFFICIALPUSH_TOKEN=null;
+        log.info("报名信息推送" + JSON.toJSONString(bo));
+        //暂时先关闭信息推送入口
+//        if (true){
+//            return "";
+//        }
+//        ClassGradeUserVo userVo = this.baseMapper.selectUser(bo);
+        if (Validator.isEmpty(userVo)) {
+            return "用户不存在";
+        }
+        if (Validator.isEmpty(userVo.getInterfacePushId())) {
+            return "没开通信息推送";
+        } else {
+            ClassGradeInterface gradeInterface = iClassGradeInterfaceService.getById(userVo.getInterfacePushId());
+            if (gradeInterface.getType() != 1) {
+                return "没开通信息推送";
+            }
+        }
+        if (Validator.isEmpty(userVo.getOfficialName())) {
+            return "没配置班号";
+        }
+        if (Validator.isEmpty(userVo.getClassStatus()) || userVo.getClassStatus() != 1) {
+            return "未开班";
+        }
+        if (Validator.isNotEmpty(userVo.getClassStartTime())) {
+            long nowTime = System.currentTimeMillis() / 1000;
+            if (userVo.getClassStartTime().longValue() > nowTime) {
+                return "班级有效期未开始";
+            }
+            if (nowTime > userVo.getClassEndTime().longValue()) {
+                return "班级有效期已结束";
+            }
+        }
+       /* OrderGoodsQueryBo goodsQueryBo = new OrderGoodsQueryBo();
+        goodsQueryBo.setUserId(bo.getUserId());
+        goodsQueryBo.setGradeId(userVo.getGradeId());
+        goodsQueryBo.setOrderGoodsId(userVo.getOrderGoodsId());
+        OrderGoodsVo orderGoods = iOrderGoodsService.gradeGoods(goodsQueryBo);*/
+        if (Validator.isEmpty(orderGoods)) {
+            return "班级商品不存在";
+        }
+        Long bmrq = 0L;
+        if (Validator.isEmpty(userVo.getClassStartTime())) {
+            return "班级开始时间缺失";
+        }
+        if (userVo.getClassStartTime().longValue() < orderGoods.getCreateTime().longValue()) {
+            bmrq = orderGoods.getCreateTime();
+        } else {
+            bmrq = userVo.getClassStartTime();
+        }
+        if (Validator.isEmpty(userVo.getRealName()) || Validator.isEmpty(userVo.getIdCard()) || Validator.isEmpty(userVo.getTelPhone())) {
+            return "用户信息缺失";
+        }
+        if (Validator.isEmpty(orderGoods.getSevenYear())) {
+            return "商品年份缺失";
+        }
+        if(Validator.isNotEmpty(configService.selectConfigByKeyNoCache("seven.office.account"))){
+            SEVEN_OFFICIALPUSH_INFOACCOUNT = configService.selectConfigByKeyNoCache("seven.office.account");
+            SEVEN_OFFICIALPUSH_TOKEN = configService.selectConfigByKeyNoCache("seven.office.token");
+        }
+        Map<String, String> params = new HashMap<>();
+        params.put("zh", SEVEN_OFFICIALPUSH_INFOACCOUNT);
+        params.put("bh", userVo.getOfficialName());
+        params.put("year", orderGoods.getSevenYear());
+        params.put("xm", userVo.getRealName());
+        params.put("sfz", userVo.getIdCard());
+        params.put("dh", userVo.getTelPhone());
+        params.put("bmrq", DateUtils.timestampToDate(bmrq));
+        String dataTxt = params.get("zh") + params.get("bh") + params.get("year") + params.get("xm") + params.get("sfz") + params.get("dh") + params.get("bmrq");
+        log.info("报名信息推送参数"+ dataTxt);
+        String encrypted = dataSign(dataTxt, SEVEN_OFFICIALPUSH_TOKEN);
+        params.put("SignMsg", encrypted);
+        String respone = "";
+        try {
+            respone = HttpUtils.postFormBody(OFFICIALPUSH_SEVEN_INFOPATH, params);
+            if (Validator.isEmpty(respone)) {
+                return "响应信息空";
+            }
+            String[] split = respone.split("\\|");
+            if (split.length < 2) {
+                return "推送接口返回数据错误";
+            }
+            if (split[0].equals("OK")) {
+                //推送成功
+                LambdaUpdateWrapper<ClassGradeUser> objectLambdaUpdateWrapper = Wrappers.lambdaUpdate();
+                objectLambdaUpdateWrapper.eq(ClassGradeUser::getId, userVo.getId());
+                objectLambdaUpdateWrapper.set(ClassGradeUser::getOfficialStatus, 1);
+                objectLambdaUpdateWrapper.set(ClassGradeUser::getOfficialStatusMsg, respone);
+                objectLambdaUpdateWrapper.set(ClassGradeUser::getUpdateTime, DateUtils.getNowTime());
+                objectLambdaUpdateWrapper.set(ClassGradeUser::getOfficialStatusTime, DateUtils.getNowTime());
+                objectLambdaUpdateWrapper.set(ClassGradeUser::getOfficialStatusNum, userVo.getOfficialStatusNum() + 1);
+                this.update(null, objectLambdaUpdateWrapper);
+
+                //修改资料变更状态
+
+                return null;
+            } else {
+                //推送失败
+                LambdaUpdateWrapper<ClassGradeUser> objectLambdaUpdateWrapper = Wrappers.lambdaUpdate();
+                objectLambdaUpdateWrapper.eq(ClassGradeUser::getId, userVo.getId());
+                objectLambdaUpdateWrapper.set(ClassGradeUser::getOfficialStatusMsg, respone);
+                objectLambdaUpdateWrapper.set(ClassGradeUser::getUpdateTime, DateUtils.getNowTime());
+                objectLambdaUpdateWrapper.set(ClassGradeUser::getOfficialStatusTime, DateUtils.getNowTime());
+                this.update(null, objectLambdaUpdateWrapper);
+                return respone;
+            }
+        } catch (IOException e) {
+            //    throw new CustomException("请求错误");
+            return null;
+        }
+    }
+
     @Override
     public ClassPeriodStudentVo DecryptOfficialInfo(ClassGradeDecryptQueryBo bo) {
         String pars;
@@ -688,7 +833,9 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
         ClassGradeUser classGradeUser = null;
         ClassGrade grade = null;
         for (ClassGrade classGrade : classGradeList) {
-            classGradeUser = iClassGradeUserService.getOne(new LambdaQueryWrapper<ClassGradeUser>().eq(ClassGradeUser::getGradeId, classGrade.getGradeId()).eq(ClassGradeUser::getUserId, user.getUserId()).last("limit 1"));
+            classGradeUser = iClassGradeUserService.getOne(new LambdaQueryWrapper<ClassGradeUser>()
+                    .eq(ClassGradeUser::getGradeId, classGrade.getGradeId())
+                    .eq(ClassGradeUser::getUserId, user.getUserId()).last("limit 1"));
             if (Validator.isNotEmpty(classGradeUser)) {
                 grade = classGrade;
                 break;
@@ -714,6 +861,103 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
         studentVo.setGoodsId(orderGoods.getGoodsId());
         studentVo.setGoodsName(goods.getGoodsName());
         studentVo.setFullName(fullName);
+        studentVo.setOrderGoodsId(orderGoods.getOrderGoodsId());
+        String userName = "erjian";
+        if(fullName.equals("继续教育二级建造师")){
+            studentVo.setGradeType(1);
+        }
+        if(fullName.equals("继续教育二级造价师")){
+            studentVo.setGradeType(2);
+            userName = "erzao";
+        }
+        SysUser sysUser = iSysUserService.getOne(new LambdaQueryWrapper<SysUser>()
+                .eq(SysUser::getUserName, userName).last("limit 1"));
+        LoginUser loginUser = new LoginUser();
+        loginUser.setUser(sysUser);
+
+        studentVo.setToken(iUserService.createToken(loginUser));
+        return studentVo;
+    }
+
+    @Override
+    public ClassPeriodStudentVo DecryptSevenOfficialInfo(ClassGradeDecryptQueryBo bo) {
+        SEVEN_OFFICIALPUSH_INFOACCOUNT=null;
+        SEVEN_OFFICIALPUSH_TOKEN=null;
+        String pars;
+        try {
+            if(Validator.isNotEmpty(bo.getTenantId())){
+                ServletUtils.getRequestAttributes().getResponse().setHeader("TenantId", bo.getTenantId());
+            }
+            if(Validator.isNotEmpty(configService.selectConfigByKeyNoCache("seven.office.account"))){
+                SEVEN_OFFICIALPUSH_INFOACCOUNT = configService.selectConfigByKeyNoCache("seven.office.account");
+                SEVEN_OFFICIALPUSH_TOKEN = configService.selectConfigByKeyNoCache("seven.office.token");
+            }
+            byte[] Keys = new byte[]{0x22, 0x34, 0x76, 0x58, (byte) 0x90, (byte) 0xAB, (byte) 0xAD, (byte) 0xBF};
+            byte[] rgbKey = SEVEN_OFFICIALPUSH_TOKEN.substring(0, 8).getBytes("UTF-8");
+            pars = ToolsUtils.decryptDesNew(bo.getData(), SEVEN_OFFICIALPUSH_TOKEN.substring(0, 8));
+        } catch (Exception e) {
+            throw new CustomException("解析错误");
+        }
+        Map<String, String> split = Splitter.on("&").withKeyValueSeparator("=").split(pars);
+        String idCard = split.get("idnum");
+        String datetime = split.get("datetime");
+        String year = split.get("year");
+        if (Validator.isEmpty(datetime)) {
+            throw new CustomException("数据错误");
+        }
+        String datetimeStr = datetime.substring(0, 8);
+        if (!DateUtils.dateTimeNow(DateUtils.YYYYMMDD).equals(datetimeStr)) {
+            throw new CustomException("数据错误");
+        }
+        User user = iUserService.getOne(new LambdaQueryWrapper<User>().eq(User::getIdCard, EncryptHandler.encrypt(idCard)).last("limit 1"));
+        if (Validator.isEmpty(user)) {
+            throw new CustomException("身份证查无用户");
+        }
+        String bh = split.get("bh");
+        List<ClassGrade> classGradeList = iClassGradeService.list(new LambdaQueryWrapper<ClassGrade>().eq(ClassGrade::getOfficialName, bh));
+        if (Validator.isEmpty(classGradeList) || classGradeList.size() == 0) {
+            throw new CustomException("班级不存在");
+        }
+        ClassGradeUser classGradeUser = null;
+        ClassGrade grade = null;
+        OrderGoods orderGoods = null;
+        for (ClassGrade classGrade : classGradeList) {
+            LambdaQueryWrapper<ClassGradeUser> lqw = Wrappers.lambdaQuery();
+            lqw.eq(ClassGradeUser::getGradeId, classGrade.getGradeId());
+            lqw.eq(ClassGradeUser::getUserId,  user.getUserId());
+            List<ClassGradeUser> gradeUserList = iClassGradeUserService.list(lqw);
+            for (ClassGradeUser gu : gradeUserList) {
+                OrderGoods og = iOrderGoodsService.getOne(new LambdaQueryWrapper<OrderGoods>().eq(OrderGoods::getOrderGoodsId, gu.getOrderGoodsId())
+                        .eq(OrderGoods::getSevenYear, year));
+                if (Validator.isNotEmpty(og)) {
+                    grade = classGrade;
+                    orderGoods = og;
+                    classGradeUser = gu;
+                    break;
+                }
+            }
+        }
+        if (Validator.isEmpty(classGradeUser)) {
+            throw new CustomException("班级用户不存在");
+        }
+
+        if (Validator.isEmpty(orderGoods)) {
+            throw new CustomException("订单商品不存在");
+        }
+        Goods goods = iGoodsService.getOne(new LambdaQueryWrapper<Goods>().eq(Goods::getGoodsId, orderGoods.getGoodsId()));
+        CourseBusinessQueryBo queryBo = new CourseBusinessQueryBo();
+        queryBo.setId(goods.getBusinessId());
+        String fullName = iCourseBusinessService.queryFullName(queryBo);
+        ClassPeriodStudentVo studentVo = new ClassPeriodStudentVo();
+        studentVo.setGradeId(grade.getGradeId());
+        studentVo.setClassName(grade.getClassName());
+        studentVo.setRealName(user.getRealname());
+        studentVo.setUserId(user.getUserId());
+        studentVo.setIdCard(idCard);
+        studentVo.setGoodsId(orderGoods.getGoodsId());
+        studentVo.setGoodsName(goods.getGoodsName());
+        studentVo.setFullName(fullName);
+        studentVo.setOrderGoodsId(orderGoods.getOrderGoodsId());
         String userName = "erjian";
         if(fullName.equals("继续教育二级建造师")){
             studentVo.setGradeType(1);
@@ -759,15 +1003,14 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
      */
     @Override
     public String pushOfficialPeriod(ClassGradeUserQueryBo bo) {
+        OFFICIALPUSH_INFOACCOUNT = null;
+        OFFICIALPUSH_TOKEN = null;
         //企业ID
         String tenant = ServletUtils.getRequest().getHeader("TenantId");
         SysOldOrg org = sysOldOrgService.list(new LambdaQueryWrapper<SysOldOrg>()
                 .eq(SysOldOrg::getTenantId, tenant)
                 .last("limit 1")).stream().findFirst().orElse(null);
-        //共享班级关闭学时推送入口
-        if (org.getShareClass() == 1) {
-            return "";
-        }
+
 //        if (true){
 //            return "";
 //        }
@@ -808,11 +1051,22 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
         OrderGoodsQueryBo goodsQueryBo = new OrderGoodsQueryBo();
         goodsQueryBo.setUserId(bo.getUserId());
         goodsQueryBo.setGradeId(userVo.getGradeId());
+        goodsQueryBo.setOrderGoodsId(bo.getOrderGoodsId());
         OrderGoodsVo orderGoods = iOrderGoodsService.gradeGoods(goodsQueryBo);
         if (Validator.isEmpty(orderGoods)) {
             return "班级商品不存在";
         }
-
+        Goods goods = iGoodsService.getOne(new LambdaQueryWrapper<Goods>().eq(Goods::getGoodsId,orderGoods.getGoodsId()));
+        CourseBusinessQueryBo queryBo = new CourseBusinessQueryBo();
+        queryBo.setId(goods.getBusinessId());
+        String fullName = iCourseBusinessService.queryFullName(queryBo);
+        if(fullName.contains("继续教育")&&fullName.contains("施工现场专业人员")){
+            return pushSevenOfficialPeriod(bo,userVo,orderGoods);
+        }
+        //共享班级关闭学时推送入口
+        if (org.getShareClass() == 1) {
+            return "";
+        }
        /* UserProfile userProfile = iUserProfileService.getOne(new LambdaQueryWrapper<UserProfile>()
                 .eq(UserProfile::getUserId, bo.getUserId()).eq(UserProfile::getGoodsId, orderGoods.getGoodsId())
                 .eq(UserProfile::getCurrentStatus, 1).eq(UserProfile::getTypeStatus, 1)
@@ -836,6 +1090,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
         Long startTime = baseMapper.getPeriodStartTime(userQueryBo);
         Long endTime = baseMapper.getPeriodEndTime(userQueryBo);
 
+
         Map<String, String> params = new HashMap<>();
         params.put("zh", OFFICIALPUSH_INFOACCOUNT);
         params.put("bh", userVo.getOfficialName());
@@ -880,6 +1135,121 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
         }
     }
 
+    public String pushSevenOfficialPeriod(ClassGradeUserQueryBo bo,ClassGradeUserVo userVo,OrderGoodsVo orderGoods) {
+        SEVEN_OFFICIALPUSH_INFOACCOUNT=null;
+        SEVEN_OFFICIALPUSH_TOKEN=null;
+ //       ClassGradeUserVo userVo = this.baseMapper.selectUser(bo);
+        if (Validator.isEmpty(userVo)) {
+            return "用户不存在";
+        }
+        if (Validator.isEmpty(userVo.getInterfacePushId())) {
+            return "没开通信息推送";
+        }
+        if (Validator.isEmpty(userVo.getOfficialName())) {
+            return "没配置班号";
+        }
+        if (Validator.isEmpty(userVo.getClassStatus()) || userVo.getClassStatus() != 1) {
+            return "未开班";
+        }
+        if (Validator.isNotEmpty(userVo.getPeriodPlush())&&userVo.getPeriodPlush()==1) {
+            return "该用户已推送过";
+        }
+        if (Validator.isNotEmpty(userVo.getClassStartTime())) {
+            long nowTime = System.currentTimeMillis() / 1000;
+            if (userVo.getClassStartTime().longValue() > nowTime) {
+                return "班级有效期未开始";
+            }
+            if (Validator.isEmpty(userVo.getPeriodWaitTime())) {
+                return "审核状态错误";
+            }
+            //只要待审核时间早于班级结束时间就允许推送
+            if (userVo.getPeriodWaitTime().longValue() >= userVo.getClassEndTime().longValue()) {
+                return "班级有效期已结束";
+            }
+        }
+        if (userVo.getPeriodStatus() != 1) {
+            return "学时审核没通过";
+        }
+
+       /* OrderGoodsQueryBo goodsQueryBo = new OrderGoodsQueryBo();
+        goodsQueryBo.setUserId(bo.getUserId());
+        goodsQueryBo.setGradeId(userVo.getGradeId());
+        goodsQueryBo.setOrderGoodsId(bo.getOrderGoodsId());
+        OrderGoodsVo orderGoods = iOrderGoodsService.gradeGoods(goodsQueryBo);*/
+        if (Validator.isEmpty(orderGoods)) {
+            return "班级商品不存在";
+        }
+
+       /* UserProfile userProfile = iUserProfileService.getOne(new LambdaQueryWrapper<UserProfile>()
+                .eq(UserProfile::getUserId, bo.getUserId()).eq(UserProfile::getGoodsId, orderGoods.getGoodsId())
+                .eq(UserProfile::getCurrentStatus, 1).eq(UserProfile::getTypeStatus, 1)
+                .last("limit 1"));
+        if (Validator.isNotEmpty(userProfile) && userProfile.getStatus() != 1) {
+            return "资料审核没通过";
+        }*/
+
+        UserStudyRecordQueryBo studyRecordQueryBo = new UserStudyRecordQueryBo();
+        studyRecordQueryBo.setUserId(bo.getUserId());
+        studyRecordQueryBo.setGradeId(userVo.getGradeId());
+        studyRecordQueryBo.setOrderGoodsId(bo.getOrderGoodsId());
+        //第一条学习记录
+        UserStudyRecordVo firstVo = iUserStudyRecordService.queryFirst(studyRecordQueryBo);
+        if(Validator.isNotEmpty(configService.selectConfigByKeyNoCache("seven.office.account"))){
+            SEVEN_OFFICIALPUSH_INFOACCOUNT = configService.selectConfigByKeyNoCache("seven.office.account");
+            SEVEN_OFFICIALPUSH_TOKEN = configService.selectConfigByKeyNoCache("seven.office.token");
+        }
+        ClassGradeUserQueryBo userQueryBo = new ClassGradeUserQueryBo();
+        userQueryBo.setUserId(bo.getUserId());
+        userQueryBo.setGradeId(userVo.getGradeId());
+        userQueryBo.setOrderGoodsId(bo.getOrderGoodsId());
+        Long startTime = baseMapper.getPeriodStartTime(userQueryBo);
+        Long endTime = baseMapper.getPeriodEndTime(userQueryBo);
+
+        Map<String, String> params = new HashMap<>();
+        params.put("zh", SEVEN_OFFICIALPUSH_INFOACCOUNT);
+        params.put("bh", userVo.getOfficialName());
+        params.put("year", orderGoods.getSevenYear());
+        params.put("xm", userVo.getRealName());
+        params.put("sfz", userVo.getIdCard());
+        params.put("ksrq", DateUtils.timestampToDate(startTime));
+        params.put("jsrq", DateUtils.timestampToDate(endTime));
+        String dataTxt = params.get("zh") + params.get("bh") + params.get("year") + params.get("xm") + params.get("sfz") + params.get("ksrq") + params.get("jsrq");
+        String encrypted = dataSign(dataTxt, SEVEN_OFFICIALPUSH_TOKEN);
+        params.put("SignMsg", encrypted);
+        String respone = "";
+        log.info("学时信息推送参数"+ dataTxt);
+        try {
+            respone = HttpUtils.postFormBody(OFFICIALPUSH_SEVEN_PERIODPATH, params);
+            log.info("学时信息推送参数结果"+ respone);
+            String[] split = respone.split("\\|");
+            if (split.length < 2) {
+                return "推送接口返回数据错误";
+            }
+            if (split[0].equals("OK")) {
+                //推送成功
+                LambdaUpdateWrapper<ClassGradeUser> objectLambdaUpdateWrapper = Wrappers.lambdaUpdate();
+                objectLambdaUpdateWrapper.eq(ClassGradeUser::getId, userVo.getId());
+                objectLambdaUpdateWrapper.set(ClassGradeUser::getPeriodPlush, 1);
+                objectLambdaUpdateWrapper.set(ClassGradeUser::getPeriodPlushMsg, respone);
+                objectLambdaUpdateWrapper.set(ClassGradeUser::getUpdateTime, DateUtils.getNowTime());
+                objectLambdaUpdateWrapper.set(ClassGradeUser::getPeriodPlushTime, DateUtils.getNowTime());
+                objectLambdaUpdateWrapper.set(ClassGradeUser::getPeriodStatusNum, userVo.getPeriodStatusNum() + 1);
+                this.update(null, objectLambdaUpdateWrapper);
+                return null;
+            } else {
+                //推送失败
+                LambdaUpdateWrapper<ClassGradeUser> objectLambdaUpdateWrapper = Wrappers.lambdaUpdate();
+                objectLambdaUpdateWrapper.eq(ClassGradeUser::getId, userVo.getId());
+                objectLambdaUpdateWrapper.set(ClassGradeUser::getPeriodPlushMsg, respone);
+                objectLambdaUpdateWrapper.set(ClassGradeUser::getUpdateTime, DateUtils.getNowTime());
+                this.update(null, objectLambdaUpdateWrapper);
+                return respone;
+            }
+        } catch (IOException e) {
+            throw new CustomException("请求错误");
+        }
+    }
+
     /**
      * 批量学时推送
      *
@@ -1005,6 +1375,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                 subjectStudyRecordQueryBo.setGoodsId(classPeriodStudentVo.getGoodsId());
                 subjectStudyRecordQueryBo.setUserId(classPeriodStudentVo.getUserId());
                 subjectStudyRecordQueryBo.setGradeId(bo.getGradeId());
+                subjectStudyRecordQueryBo.setOrderGoodsId(bo.getOrderGoodsId());
                 User user = iUserService.getOne(new LambdaQueryWrapper<User>().eq(User::getUserId, classPeriodStudentVo.getUserId()));
                 if (Validator.isNotEmpty(user.getOneInchPhotos())) {
                     classPeriodStudentVo.setOneInchPhotos(ALIYUN_OSS_ENDPOINT + "/" + user.getOneInchPhotos());
@@ -1026,6 +1397,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                 ClassGradeUserQueryBo classGradeUserQueryBo1 = new ClassGradeUserQueryBo();
                 classGradeUserQueryBo1.setUserId(classPeriodStudentVo.getUserId());
                 classGradeUserQueryBo1.setGradeId(classPeriodStudentVo.getGradeId());
+                classGradeUserQueryBo1.setOrderGoodsId(classPeriodStudentVo.getOrderGoodsId());
                 classGradeUserQueryBo1.setGoodsId(classPeriodStudentVo.getGoodsId());
                 classGradeUserQueryBo1.setSearchWeekStartTime(weekDataVo.getSearchWeekStartTime());
                 classGradeUserQueryBo1.setSearchWeekEndTime(weekDataVo.getSearchWeekEndTime());
@@ -1422,6 +1794,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
             classGradeUserQueryBo.setGradeId(classPeriodStudentVo.getGradeId());
             classGradeUserQueryBo.setUserId(classPeriodStudentVo.getUserId());
             classGradeUserQueryBo.setGoodsId(classPeriodStudentVo.getGoodsId());
+            classGradeUserQueryBo.setOrderGoodsId(classPeriodStudentVo.getOrderGoodsId());
             //    List<ClassPeriodUserVo> classPeriodUserVos1 = baseMapper.listPeriod(classGradeUserQueryBo);
             //    ClassPeriodUserVo classPeriodUserVos = classPeriodUserVos1.get(0);
             //    classPeriodUserVos.setPending(classPeriodStudentVo.getSecAllNum()-classPeriodUserVos.getPass()-classPeriodUserVos.getCheat());
@@ -1437,7 +1810,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                 classPeriodStudentVo.setStartTime(baseMapper.selectStart(classPeriodStudentVo.getUserId(), classPeriodStudentVo.getGoodsId(), classPeriodStudentVo.getGradeId()).get(0));
             }
             //取学时所有拍照最新的一张
-            String recentPhoto = userStudyRecordPhotoMapper.selectGradeRecentOnePhoto(classPeriodStudentVo.getUserId(), classPeriodStudentVo.getGradeId());
+            String recentPhoto = userStudyRecordPhotoMapper.selectGradeRecentOnePhoto(classPeriodStudentVo.getUserId(), classPeriodStudentVo.getGradeId(),classPeriodStudentVo.getOrderGoodsId());
             if (Validator.isNotEmpty(recentPhoto)) {
                 classPeriodStudentVo.setIdCardImg1(recentPhoto);
             }
@@ -1497,7 +1870,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                 classPeriodStudentVo.setStartTime(baseMapper.selectStart(classPeriodStudentVo.getUserId(), classPeriodStudentVo.getGoodsId(), classPeriodStudentVo.getGradeId()).get(0));
             }*/
             //取学时所有拍照最新的一张
-            String recentPhoto = userStudyRecordPhotoMapper.selectGradeRecentOnePhoto(classPeriodStudentVo.getUserId(), classPeriodStudentVo.getGradeId());
+            String recentPhoto = userStudyRecordPhotoMapper.selectGradeRecentOnePhoto(classPeriodStudentVo.getUserId(), classPeriodStudentVo.getGradeId(),classPeriodStudentVo.getOrderGoodsId());
             if (Validator.isNotEmpty(recentPhoto)) {
                 classPeriodStudentVo.setIdCardImg1(recentPhoto);
             }
@@ -1523,7 +1896,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
         //查找学员学习记录
         for (ClassPeriodStudentVo classPeriodStudentVo : classPeriodStudentVos) {
             //取学时所有拍照最新的一张
-            String recentPhoto = userStudyRecordPhotoMapper.selectGradeRecentOnePhoto(classPeriodStudentVo.getUserId(), classPeriodStudentVo.getGradeId());
+            String recentPhoto = userStudyRecordPhotoMapper.selectGradeRecentOnePhoto(classPeriodStudentVo.getUserId(), classPeriodStudentVo.getGradeId(),classPeriodStudentVo.getOrderGoodsId());
             if (Validator.isNotEmpty(recentPhoto)) {
                 classPeriodStudentVo.setIdCardImg1(recentPhoto);
             }
@@ -1550,6 +1923,9 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
 
     @Override
     public List<UserPeriodExportVo> listUserStudyRecord(ClassGradeUserQueryBo bo) {
+        if(Validator.isEmpty(bo.getOrderGoodsId())){
+            throw new CustomException("缺失OrderGoodsId");
+        }
         //学习记录
         ClassGradeUserQueryBo cGQB = new ClassGradeUserQueryBo();
         cGQB.setGoodsId(bo.getGoodsId());
@@ -1564,11 +1940,12 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
         Long gradeId = bo.getGradeId();
         Long userId = bo.getUserId();
         Long goodsId = bo.getGoodsId();
+        Long orderGoodsId = bo.getOrderGoodsId();
         for (ClassPeriodVo classPeriodVo : list) {
             //为模块搜索下面的章 和节 并搜索学时记录
             if (classPeriodVo.getType() == 1) {
                 moduleName = classPeriodVo.getTypeName();
-                List<ClassPeriodChapterVo> classPeriodChapterVos = baseMapper.listperiodChapter(classPeriodVo.getId(), goodsId, classPeriodVo.getCourseId(), userId, gradeId);
+                List<ClassPeriodChapterVo> classPeriodChapterVos = baseMapper.listperiodChapter(classPeriodVo.getId(), goodsId, classPeriodVo.getCourseId(), userId, gradeId,orderGoodsId);
                 for (ClassPeriodChapterVo classPeriodChapterVo : classPeriodChapterVos) {
                     if (classPeriodChapterVo.getType() == 2) {
                         chapterName = classPeriodChapterVo.getTypeName();
@@ -1766,6 +2143,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
         cGQB.setGoodsId(bo.getGoodsId());
         cGQB.setUserId(bo.getUserId());
         cGQB.setGradeId(bo.getGradeId());
+        cGQB.setOrderGoodsId(bo.getOrderGoodsId());
         List<ClassPeriodVo> list = listPeriodAudit(cGQB);
         String moduleName = "";
         String chapterName = "";
@@ -1775,11 +2153,12 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
         Long gradeId = bo.getGradeId();
         Long userId = bo.getUserId();
         Long goodsId = bo.getGoodsId();
+        Long orderGoodsId = bo.getOrderGoodsId();
         for (ClassPeriodVo classPeriodVo : list) {
             //为模块搜索下面的章 和节 并搜索学时记录
             if (classPeriodVo.getType() == 1) {
                 moduleName = classPeriodVo.getTypeName();
-                List<ClassPeriodChapterVo> classPeriodChapterVos = baseMapper.listperiodChapter(classPeriodVo.getId(), goodsId, classPeriodVo.getCourseId(), userId, gradeId);
+                List<ClassPeriodChapterVo> classPeriodChapterVos = baseMapper.listperiodChapter(classPeriodVo.getId(), goodsId, classPeriodVo.getCourseId(), userId, gradeId,orderGoodsId);
                 for (ClassPeriodChapterVo classPeriodChapterVo : classPeriodChapterVos) {
                     if (classPeriodChapterVo.getType() == 2) {
                         chapterName = classPeriodChapterVo.getTypeName();
@@ -1797,6 +2176,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                                 userPeriodQueryBo.setChapterId(classPeriodChapterVo.getId());
                                 userPeriodQueryBo.setModuleId(classPeriodVo.getId());
                                 userPeriodQueryBo.setGradeId(gradeId);
+                                userPeriodQueryBo.setOrderGoodsId(orderGoodsId);
                                 userPeriodQueryBo.setSearchWeekStartTime(bo.getSearchWeekStartTime());
                                 userPeriodQueryBo.setSearchWeekEndTime(bo.getSearchWeekEndTime());
                                 List<UserPeriodStatusVo> userPeriodStatusVos = userPeriodStatusService.selectPeriodStatus(userPeriodQueryBo);
@@ -1819,6 +2199,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                                 classPeriodSectionVo.setChapterId(classPeriodChapterVo.getId());
                                 classPeriodSectionVo.setGoodsId(goodsId);
                                 classPeriodSectionVo.setGradeId(gradeId);
+                                classPeriodSectionVo.setOrderGoodsId(orderGoodsId);
                                 if (!CollectionUtils.isEmpty(userPeriodStatusVos)) {
                                     studyList.add(mergeData(i, moduleName, chapterName, sectionName, classPeriodSectionVo, (new BigDecimal(0)), false));
                                 }
@@ -1833,6 +2214,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                                 userPeriodQueryBo.setChapterId(classPeriodChapterVo.getId());
                                 userPeriodQueryBo.setModuleId(classPeriodVo.getId());
                                 userPeriodQueryBo.setGradeId(gradeId);
+                                userPeriodQueryBo.setOrderGoodsId(orderGoodsId);
                                 userPeriodQueryBo.setSearchWeekStartTime(bo.getSearchWeekStartTime());
                                 userPeriodQueryBo.setSearchWeekEndTime(bo.getSearchWeekEndTime());
                                 List<UserPeriodStatusVo> userPeriodStatusVos = userPeriodStatusService.selectPeriodStatus(userPeriodQueryBo);
@@ -1855,6 +2237,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                                 classPeriodSectionVo.setChapterId(classPeriodChapterVo.getId());
                                 classPeriodSectionVo.setGoodsId(goodsId);
                                 classPeriodSectionVo.setGradeId(gradeId);
+                                classPeriodSectionVo.setOrderGoodsId(orderGoodsId);
                                 if (!CollectionUtils.isEmpty(userPeriodStatusVos)) {
                                     studyList.add(mergeData(i, moduleName, chapterName, sectionName, classPeriodSectionVo, classPeriodChapterVo.getPerformance(), true));
                                 }
@@ -1879,6 +2262,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                     userPeriodQueryBo.setChapterId(classPeriodVo.getId());
                     userPeriodQueryBo.setModuleId(0L);
                     userPeriodQueryBo.setGradeId(gradeId);
+                    userPeriodQueryBo.setOrderGoodsId(orderGoodsId);
                     userPeriodQueryBo.setSearchWeekStartTime(bo.getSearchWeekStartTime());
                     userPeriodQueryBo.setSearchWeekEndTime(bo.getSearchWeekEndTime());
                     List<UserPeriodStatusVo> userPeriodStatusVos = userPeriodStatusService.selectPeriodStatus(userPeriodQueryBo);
@@ -1901,6 +2285,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                     classPeriodSectionVo.setChapterId(classPeriodVo.getId());
                     classPeriodSectionVo.setGoodsId(goodsId);
                     classPeriodSectionVo.setGradeId(gradeId);
+                    classPeriodSectionVo.setOrderGoodsId(orderGoodsId);
                     if (!CollectionUtils.isEmpty(userPeriodStatusVos)) {
                         studyList.add(mergeData(i, moduleName, chapterName, sectionName, classPeriodSectionVo, (new BigDecimal(0)), false));
                     }
@@ -1918,6 +2303,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                     userPeriodQueryBo.setChapterId(classPeriodVo.getId());
                     userPeriodQueryBo.setModuleId(0L);
                     userPeriodQueryBo.setGradeId(bo.getGradeId());
+                    userPeriodQueryBo.setOrderGoodsId(orderGoodsId);
                     userPeriodQueryBo.setSearchWeekStartTime(bo.getSearchWeekStartTime());
                     userPeriodQueryBo.setSearchWeekEndTime(bo.getSearchWeekEndTime());
                     List<UserPeriodStatusVo> userPeriodStatusVos = userPeriodStatusService.selectPeriodStatus(userPeriodQueryBo);
@@ -1940,6 +2326,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                     classPeriodSectionVo.setChapterId(classPeriodVo.getId());
                     classPeriodSectionVo.setGoodsId(goodsId);
                     classPeriodSectionVo.setGradeId(gradeId);
+                    classPeriodSectionVo.setOrderGoodsId(orderGoodsId);
                     if (!CollectionUtils.isEmpty(userPeriodStatusVos)) {
                         studyList.add(mergeData(i, moduleName, chapterName, sectionName, classPeriodSectionVo, classPeriodVo.getPerformance(), true));
                     }
@@ -1959,6 +2346,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                 userPeriodQueryBo.setChapterId(0L);
                 userPeriodQueryBo.setModuleId(0L);
                 userPeriodQueryBo.setGradeId(bo.getGradeId());
+                userPeriodQueryBo.setOrderGoodsId(orderGoodsId);
                 userPeriodQueryBo.setSearchWeekStartTime(bo.getSearchWeekStartTime());
                 userPeriodQueryBo.setSearchWeekEndTime(bo.getSearchWeekEndTime());
                 List<UserPeriodStatusVo> userPeriodStatusVos = userPeriodStatusService.selectPeriodStatus(userPeriodQueryBo);
@@ -1981,6 +2369,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                 classPeriodVo.setChapterId(0L);
                 classPeriodVo.setGoodsId(bo.getGoodsId());
                 classPeriodVo.setGradeId(bo.getGradeId());
+                classPeriodVo.setOrderGoodsId(bo.getOrderGoodsId());
                 ClassPeriodSectionVo classPeriodSectionVo = BeanUtil.toBean(classPeriodVo, ClassPeriodSectionVo.class);
                 if (!CollectionUtils.isEmpty(userPeriodStatusVos)) {
                     studyList.add(mergeData(i, moduleName, chapterName, sectionName, classPeriodSectionVo, (new BigDecimal(0)), false));
@@ -1998,6 +2387,9 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
      */
     @Override
     public List<UserPeriodExportV2Vo> listUserStudyRecordV2(ClassGradeUserQueryBo bo) {
+        if(Validator.isEmpty(bo.getOrderGoodsId())){
+            throw new CustomException("缺失OrderGoodsId");
+        }
         //查找最外层课程目录 模块 章 节
         List<ClassPeriodVo> classPeriodVos = baseMapper.listPeriodAudit(bo);
         classPeriodVos.addAll(baseMapper.listPeriodAuditSection(bo));
@@ -2010,12 +2402,13 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
         Long gradeId = bo.getGradeId();
         Long userId = bo.getUserId();
         Long goodsId = bo.getGoodsId();
+        Long orderGoodsId = bo.getOrderGoodsId();
         Long courseId = bo.getCourseId();
         for (ClassPeriodVo classPeriodVo : classPeriodVos) {
             //为模块搜索下面的章 和节 并搜索学时记录
             if (classPeriodVo.getType() == 1) {
                 moduleName = classPeriodVo.getTypeName();
-                List<ClassPeriodChapterVo> classPeriodChapterVos = baseMapper.listperiodChapter(classPeriodVo.getId(), goodsId, classPeriodVo.getCourseId(), userId, gradeId);
+                List<ClassPeriodChapterVo> classPeriodChapterVos = baseMapper.listperiodChapter(classPeriodVo.getId(), goodsId, classPeriodVo.getCourseId(), userId, gradeId,orderGoodsId);
                 for (ClassPeriodChapterVo classPeriodChapterVo : classPeriodChapterVos) {
                     if (classPeriodChapterVo.getType() == 2) {
                         chapterName = classPeriodChapterVo.getTypeName();
@@ -2034,6 +2427,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                                 recordQueryBo.setChapterId(classPeriodChapterVo.getId());
                                 recordQueryBo.setModuleId(classPeriodVo.getId());
                                 recordQueryBo.setGradeId(gradeId);
+                                recordQueryBo.setOrderGoodsId(orderGoodsId);
                                 studyList.add(mergeDataV2(i, moduleName, chapterName, sectionName, classPeriodSectionVo, recordQueryBo));
                             } else {
                                 //章卷
@@ -2042,6 +2436,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                                 classPeriodSectionVo.setChapterId(classPeriodChapterVo.getId());
                                 classPeriodSectionVo.setGoodsId(goodsId);
                                 classPeriodSectionVo.setGradeId(gradeId);
+                                classPeriodSectionVo.setOrderGoodsId(orderGoodsId);
                                 classPeriodSectionVo.setUserId(classPeriodSectionVo.getUserId());
                                 studyList.add(mergeEamDataV2(i, moduleName, chapterName, sectionName, classPeriodSectionVo));
                             }
@@ -2065,6 +2460,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                     recordQueryBo.setChapterId(classPeriodVo.getId());
                     recordQueryBo.setModuleId(classPeriodVo.getId());
                     recordQueryBo.setGradeId(gradeId);
+                    recordQueryBo.setOrderGoodsId(orderGoodsId);
                     studyList.add(mergeDataV2(i, moduleName, chapterName, sectionName, classPeriodSectionVo, recordQueryBo));
                 }
                 List<ClassPeriodSectionVo> classPeriodSectionVos1 = baseMapper.listPeriodSectionExam(classPeriodVo.getId(), goodsId, classPeriodVo.getCourseId(), userId);
@@ -2077,6 +2473,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                     classPeriodSectionVo.setChapterId(classPeriodVo.getId());
                     classPeriodSectionVo.setGoodsId(goodsId);
                     classPeriodSectionVo.setGradeId(gradeId);
+                    classPeriodSectionVo.setOrderGoodsId(orderGoodsId);
                     classPeriodSectionVo.setUserId(classPeriodSectionVo.getUserId());
                     studyList.add(mergeEamDataV2(i, moduleName, chapterName, sectionName, classPeriodSectionVo));
                 }
@@ -2094,6 +2491,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                 userPeriodQueryBo.setUserId(classPeriodVo.getUserId());
                 userPeriodQueryBo.setChapterId(0L);
                 userPeriodQueryBo.setModuleId(0L);
+                userPeriodQueryBo.setOrderGoodsId(orderGoodsId);
                 userPeriodQueryBo.setGradeId(bo.getGradeId());
                 UserStudyRecordQueryBo recordQueryBo = BeanUtil.toBean(userPeriodQueryBo, UserStudyRecordQueryBo.class);
 
@@ -2113,6 +2511,9 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
 
     @Override
     public List<UserPeriodExportV2Vo> listUserStudyRecordV2Week(ClassGradeUserQueryBo bo) {
+        if(Validator.isEmpty(bo.getOrderGoodsId())){
+            throw new CustomException("orderGoodsId缺失");
+        }
         //查找最外层课程目录 模块 章 节
         List<ClassPeriodVo> classPeriodVos = baseMapper.listPeriodAudit(bo);
         classPeriodVos.addAll(baseMapper.listPeriodAuditSection(bo));
@@ -2126,11 +2527,12 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
         Long userId = bo.getUserId();
         Long goodsId = bo.getGoodsId();
         Long courseId = bo.getCourseId();
+        Long orderGoodsId = bo.getOrderGoodsId();
         for (ClassPeriodVo classPeriodVo : classPeriodVos) {
             //为模块搜索下面的章 和节 并搜索学时记录
             if (classPeriodVo.getType() == 1) {
                 moduleName = classPeriodVo.getTypeName();
-                List<ClassPeriodChapterVo> classPeriodChapterVos = baseMapper.listperiodChapter(classPeriodVo.getId(), goodsId, classPeriodVo.getCourseId(), userId, gradeId);
+                List<ClassPeriodChapterVo> classPeriodChapterVos = baseMapper.listperiodChapter(classPeriodVo.getId(), goodsId, classPeriodVo.getCourseId(), userId, gradeId,orderGoodsId);
                 for (ClassPeriodChapterVo classPeriodChapterVo : classPeriodChapterVos) {
                     if (classPeriodChapterVo.getType() == 2) {
                         chapterName = classPeriodChapterVo.getTypeName();
@@ -2152,6 +2554,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                                 recordQueryBo.setChapterId(classPeriodChapterVo.getId());
                                 recordQueryBo.setModuleId(classPeriodVo.getId());
                                 recordQueryBo.setGradeId(gradeId);
+                                recordQueryBo.setOrderGoodsId(orderGoodsId);
                                 recordQueryBo.setSearchWeekStartTime(bo.getSearchWeekStartTime());
                                 recordQueryBo.setSearchWeekEndTime(bo.getSearchWeekEndTime());
                                 studyList.add(mergeDataV2(i, moduleName, chapterName, sectionName, classPeriodSectionVo, recordQueryBo));
@@ -2162,6 +2565,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                                 classPeriodSectionVo.setChapterId(classPeriodChapterVo.getId());
                                 classPeriodSectionVo.setGoodsId(goodsId);
                                 classPeriodSectionVo.setGradeId(gradeId);
+                                classPeriodSectionVo.setOrderGoodsId(orderGoodsId);
                                 classPeriodSectionVo.setUserId(classPeriodSectionVo.getUserId());
                                 classPeriodSectionVo.setSearchWeekStartTime(bo.getSearchWeekStartTime());
                                 classPeriodSectionVo.setSearchWeekEndTime(bo.getSearchWeekEndTime());
@@ -2187,6 +2591,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                     recordQueryBo.setChapterId(classPeriodVo.getId());
                     recordQueryBo.setModuleId(classPeriodVo.getId());
                     recordQueryBo.setGradeId(gradeId);
+                    recordQueryBo.setOrderGoodsId(orderGoodsId);
                     recordQueryBo.setSearchWeekStartTime(bo.getSearchWeekStartTime());
                     recordQueryBo.setSearchWeekEndTime(bo.getSearchWeekEndTime());
                     studyList.add(mergeDataV2(i, moduleName, chapterName, sectionName, classPeriodSectionVo, recordQueryBo));
@@ -2201,6 +2606,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                     classPeriodSectionVo.setChapterId(classPeriodVo.getId());
                     classPeriodSectionVo.setGoodsId(goodsId);
                     classPeriodSectionVo.setGradeId(gradeId);
+                    classPeriodSectionVo.setOrderGoodsId(orderGoodsId);
                     classPeriodSectionVo.setUserId(classPeriodSectionVo.getUserId());
                     classPeriodSectionVo.setSearchWeekStartTime(bo.getSearchWeekStartTime());
                     classPeriodSectionVo.setSearchWeekEndTime(bo.getSearchWeekEndTime());
@@ -2221,6 +2627,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                 userPeriodQueryBo.setChapterId(0L);
                 userPeriodQueryBo.setModuleId(0L);
                 userPeriodQueryBo.setGradeId(bo.getGradeId());
+                userPeriodQueryBo.setOrderGoodsId(orderGoodsId);
                 UserStudyRecordQueryBo recordQueryBo = BeanUtil.toBean(userPeriodQueryBo, UserStudyRecordQueryBo.class);
                 recordQueryBo.setSearchWeekStartTime(bo.getSearchWeekStartTime());
                 recordQueryBo.setSearchWeekEndTime(bo.getSearchWeekEndTime());
@@ -2241,6 +2648,9 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
 
     @Override
     public List<ClassPeriodUserVo> listPeriod(ClassGradeUserQueryBo bo) {
+        if(Validator.isEmpty(bo.getOrderGoodsId())){
+            throw new CustomException("缺少OrderGoodsId");
+        }
         //班级学员信息
         List<ClassPeriodUserVo> classPeriodUserVos = baseMapper.listPeriod(bo);
         for (ClassPeriodUserVo classPeriodUserVo : classPeriodUserVos) {
@@ -2289,6 +2699,10 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
 
     @Override
     public List<ClassPeriodVo> listPeriodAudit(ClassGradeUserQueryBo bo) {
+        if(Validator.isEmpty(bo.getOrderGoodsId())){
+            throw new CustomException("缺少OrderGoodsId");
+        }
+        OrderGoods og = iOrderGoodsService.getOne(new LambdaQueryWrapper<OrderGoods>().eq(OrderGoods::getOrderGoodsId, bo.getOrderGoodsId()));
         //查找最外层课程目录 模块 章 节
         List<ClassPeriodVo> classPeriodVos = baseMapper.listPeriodAudit(bo);
         classPeriodVos.addAll(baseMapper.listPeriodAuditSection(bo));
@@ -2299,7 +2713,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
         for (ClassPeriodVo classPeriodVo : classPeriodVos) {
             //为模块搜索下面的章 和节 并搜索学时记录
             if (classPeriodVo.getType() == 1) {
-                List<ClassPeriodChapterVo> classPeriodChapterVos = baseMapper.listperiodChapter(classPeriodVo.getId(), bo.getGoodsId(), classPeriodVo.getCourseId(), bo.getUserId(), bo.getGradeId());
+                List<ClassPeriodChapterVo> classPeriodChapterVos = baseMapper.listperiodChapter(classPeriodVo.getId(), bo.getGoodsId(), classPeriodVo.getCourseId(), bo.getUserId(), bo.getGradeId(),bo.getOrderGoodsId());
                 Collections.sort(classPeriodChapterVos);
                 classPeriodChapterVos.addAll(baseMapper.listperiodModuleExam(bo.getGoodsId(), classPeriodVo.getCourseId(), bo.getUserId(), classPeriodVo.getId()));
                 for (ClassPeriodChapterVo classPeriodChapterVo : classPeriodChapterVos) {
@@ -2321,6 +2735,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                                 userPeriodQueryBo.setChapterId(classPeriodChapterVo.getId());
                                 userPeriodQueryBo.setModuleId(classPeriodVo.getId());
                                 userPeriodQueryBo.setGradeId(bo.getGradeId());
+                                userPeriodQueryBo.setOrderGoodsId(bo.getOrderGoodsId());
                                 List<UserPeriodStatusVo> userPeriodStatusVos = userPeriodStatusService.selectPeriodStatus(userPeriodQueryBo);
                                 if (!CollectionUtils.isEmpty(userPeriodStatusVos)) {
                                     int numIndex = userPeriodStatusVos.size() - 1;
@@ -2338,7 +2753,9 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                                         classPeriodSectionVo.setStudyStartTime(photoList.get(0).getCreateTime());
                                     }
                                     if ((startTotalTime == 0L && Validator.isNotEmpty(classPeriodSectionVo.getStudyStartTime())) || (Validator.isNotEmpty(classPeriodSectionVo.getStudyStartTime()) && (startTotalTime.longValue() > classPeriodSectionVo.getStudyStartTime().longValue()))) {
-                                        startTotalTime = classPeriodSectionVo.getStudyStartTime();
+                                        if(og.getSevenClassCopy()==1||classPeriodChapterVo.getCommonSign()==0){
+                                            startTotalTime = classPeriodSectionVo.getStudyStartTime();
+                                        }
                                     }
                                     if ((endTotalTime == 0L && (Validator.isNotEmpty(classPeriodSectionVo.getStudyEndTime()))) || (Validator.isNotEmpty(classPeriodSectionVo.getStudyEndTime()) && endTotalTime.longValue() < classPeriodSectionVo.getStudyEndTime().longValue())) {
                                         endTotalTime = classPeriodSectionVo.getStudyEndTime();
@@ -2366,6 +2783,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                                 classPeriodSectionVo.setChapterId(classPeriodChapterVo.getId());
                                 classPeriodSectionVo.setGoodsId(bo.getGoodsId());
                                 classPeriodSectionVo.setGradeId(bo.getGradeId());
+                                classPeriodSectionVo.setOrderGoodsId(bo.getOrderGoodsId());
                             } else {
                                 UserPeriodQueryBo userPeriodQueryBo = new UserPeriodQueryBo();
                                 userPeriodQueryBo.setExamId(classPeriodSectionVo.getId());
@@ -2375,6 +2793,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                                 userPeriodQueryBo.setChapterId(classPeriodChapterVo.getId());
                                 userPeriodQueryBo.setModuleId(classPeriodVo.getId());
                                 userPeriodQueryBo.setGradeId(bo.getGradeId());
+                                userPeriodQueryBo.setOrderGoodsId(bo.getOrderGoodsId());
                                 userPeriodQueryBo.setType(2);
                                 List<UserPeriodStatusVo> userPeriodStatusVos = userPeriodStatusService.selectPeriodStatus(userPeriodQueryBo);
                                 if (!CollectionUtils.isEmpty(userPeriodStatusVos)) {
@@ -2411,6 +2830,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                                 classPeriodSectionVo.setChapterId(classPeriodChapterVo.getId());
                                 classPeriodSectionVo.setGoodsId(bo.getGoodsId());
                                 classPeriodSectionVo.setGradeId(bo.getGradeId());
+                                classPeriodSectionVo.setOrderGoodsId(bo.getOrderGoodsId());
                             }
                         }
                         classPeriodChapterVo.setStudyEndTime(ChapterEndTime);
@@ -2424,6 +2844,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                         userPeriodQueryBo.setUserId(classPeriodChapterVo.getUserId());
                         userPeriodQueryBo.setModuleId(classPeriodVo.getId());
                         userPeriodQueryBo.setGradeId(bo.getGradeId());
+                        userPeriodQueryBo.setOrderGoodsId(bo.getOrderGoodsId());
                         userPeriodQueryBo.setType(3);
                         List<UserPeriodStatusVo> userPeriodStatusVos = userPeriodStatusService.selectPeriodStatus(userPeriodQueryBo);
                         if (!CollectionUtils.isEmpty(userPeriodStatusVos)) {
@@ -2471,6 +2892,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                     userPeriodQueryBo.setChapterId(classPeriodVo.getId());
                     userPeriodQueryBo.setModuleId(0L);
                     userPeriodQueryBo.setGradeId(bo.getGradeId());
+                    userPeriodQueryBo.setOrderGoodsId(bo.getOrderGoodsId());
                     List<UserPeriodStatusVo> userPeriodStatusVos = userPeriodStatusService.selectPeriodStatus(userPeriodQueryBo);
                     if (!CollectionUtils.isEmpty(userPeriodStatusVos)) {
                         int numIndex = userPeriodStatusVos.size() - 1;
@@ -2488,7 +2910,9 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                             classPeriodSectionVo.setStudyStartTime(photoList.get(0).getCreateTime());
                         }
                         if ((startTotalTime == 0L && Validator.isNotEmpty(classPeriodSectionVo.getStudyStartTime())) || (Validator.isNotEmpty(classPeriodSectionVo.getStudyStartTime()) && startTotalTime.longValue() > classPeriodSectionVo.getStudyStartTime().longValue())) {
-                            startTotalTime = classPeriodSectionVo.getStudyStartTime();
+                            if(og.getSevenClassCopy()==1||classPeriodVo.getCommonSign()==0){
+                                startTotalTime = classPeriodSectionVo.getStudyStartTime();
+                            }
                         }
                         if (endTotalTime == 0L || (Validator.isNotEmpty(classPeriodSectionVo.getStudyEndTime()) && endTotalTime.longValue() < classPeriodSectionVo.getStudyEndTime().longValue())) {
                             endTotalTime = classPeriodSectionVo.getStudyEndTime();
@@ -2516,6 +2940,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                     classPeriodSectionVo.setChapterId(classPeriodVo.getId());
                     classPeriodSectionVo.setGoodsId(bo.getGoodsId());
                     classPeriodSectionVo.setGradeId(bo.getGradeId());
+                    classPeriodSectionVo.setOrderGoodsId(bo.getOrderGoodsId());
                 }
                 List<ClassPeriodSectionVo> classPeriodSectionVos1 = baseMapper.listPeriodSectionExam(classPeriodVo.getId(), bo.getGoodsId(), classPeriodVo.getCourseId(), bo.getUserId());
                 for (ClassPeriodSectionVo classPeriodSectionVo : classPeriodSectionVos1) {
@@ -2527,6 +2952,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                     userPeriodQueryBo.setChapterId(classPeriodVo.getId());
                     userPeriodQueryBo.setModuleId(0L);
                     userPeriodQueryBo.setGradeId(bo.getGradeId());
+                    userPeriodQueryBo.setOrderGoodsId(bo.getOrderGoodsId());
                     List<UserPeriodStatusVo> userPeriodStatusVos = userPeriodStatusService.selectPeriodStatus(userPeriodQueryBo);
                     if (!CollectionUtils.isEmpty(userPeriodStatusVos)) {
                         int numIndex = userPeriodStatusVos.size() - 1;
@@ -2563,6 +2989,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                     classPeriodSectionVo.setChapterId(classPeriodVo.getId());
                     classPeriodSectionVo.setGoodsId(bo.getGoodsId());
                     classPeriodSectionVo.setGradeId(bo.getGradeId());
+                    classPeriodSectionVo.setOrderGoodsId(bo.getOrderGoodsId());
                 }
                 classPeriodSectionVos.addAll(classPeriodSectionVos1);
                 classPeriodVo.setClassPeriodSectionList(classPeriodSectionVos);
@@ -2581,6 +3008,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                 userPeriodQueryBo.setChapterId(0L);
                 userPeriodQueryBo.setModuleId(0L);
                 userPeriodQueryBo.setGradeId(bo.getGradeId());
+                userPeriodQueryBo.setOrderGoodsId(bo.getOrderGoodsId());
                 List<UserPeriodStatusVo> userPeriodStatusVos = userPeriodStatusService.selectPeriodStatus(userPeriodQueryBo);
                 if (!CollectionUtils.isEmpty(userPeriodStatusVos)) {
                     int numIndex = userPeriodStatusVos.size() - 1;
@@ -2620,6 +3048,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                 classPeriodVo.setChapterId(0L);
                 classPeriodVo.setGoodsId(bo.getGoodsId());
                 classPeriodVo.setGradeId(bo.getGradeId());
+                classPeriodVo.setOrderGoodsId(bo.getOrderGoodsId());
             }
 
         }
@@ -2641,7 +3070,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
 
     @Override
     public List<ClassPeriodChapterVo> listPeriodAuditChapter(ClassGradeUserQueryBo bo) {
-        List<ClassPeriodChapterVo> classPeriodChapterVos = baseMapper.listperiodChapter(bo.getModuleId(), bo.getGoodsId(), bo.getCourseId(), bo.getUserId(), bo.getGradeId());
+        List<ClassPeriodChapterVo> classPeriodChapterVos = baseMapper.listperiodChapter(bo.getModuleId(), bo.getGoodsId(), bo.getCourseId(), bo.getUserId(), bo.getGradeId(),bo.getOrderGoodsId());
         return classPeriodChapterVos;
     }
 
@@ -2878,6 +3307,11 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
         return baseMapper.checkFinishRequiredCourse(bo);
     }
 
+    @Override
+    public List<ClassGradeUser> getClassInfoByUser(Long userId) {
+        return baseMapper.getClassInfoByUser(userId);
+    }
+
 
     /**
      * 实体类转化成视图对象

+ 1 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/impl/ClassGradeUserTempServiceImpl.java

@@ -45,6 +45,7 @@ public class ClassGradeUserTempServiceImpl extends ServiceImpl<ClassGradeUserTem
         lqw.eq(bo.getStatus() != null, ClassGradeUserTemp::getStatus, bo.getStatus());
         lqw.eq(bo.getFromType() != null, ClassGradeUserTemp::getFromType, bo.getFromType());
         lqw.eq(StrUtil.isNotBlank(bo.getOrderSn()), ClassGradeUserTemp::getOrderSn, bo.getOrderSn());
+        lqw.eq(StrUtil.isNotBlank(bo.getSevenYear()), ClassGradeUserTemp::getSevenYear, bo.getSevenYear());
         return entity2Vo(this.list(lqw));
     }
 

+ 53 - 9
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/impl/UserPeriodServiceImpl.java

@@ -27,10 +27,7 @@ import com.zhongzheng.modules.course.domain.CourseBusiness;
 import com.zhongzheng.modules.course.domain.CourseEducationType;
 import com.zhongzheng.modules.course.domain.CourseProjectType;
 import com.zhongzheng.modules.course.service.*;
-import com.zhongzheng.modules.course.vo.CourseChapterSectionVo;
-import com.zhongzheng.modules.course.vo.CourseMenuVo;
-import com.zhongzheng.modules.course.vo.CourseModuleChapterVo;
-import com.zhongzheng.modules.course.vo.CourseVo;
+import com.zhongzheng.modules.course.vo.*;
 import com.zhongzheng.modules.goods.bo.GoodsCourseQueryBo;
 import com.zhongzheng.modules.goods.domain.Goods;
 import com.zhongzheng.modules.goods.service.IGoodsCourseService;
@@ -173,6 +170,9 @@ public class UserPeriodServiceImpl extends ServiceImpl<UserPeriodMapper, UserPer
     @Autowired
     private ICourseChapterSectionService iCourseChapterSectionService;
 
+    @Autowired
+    private ICourseChapterService iCourseChapterService;
+
     @Value("${oldStudySys.syncPath}")
     private String SYNC_PATH;
 
@@ -288,6 +288,15 @@ public class UserPeriodServiceImpl extends ServiceImpl<UserPeriodMapper, UserPer
         classGradeUserQueryBo.setUserId(userPeriodVo.getUserId());
         classGradeUserQueryBo.setGradeId(userPeriodVo.getGradeId());
         classGradeUserQueryBo.setGoodsId(userPeriodVo.getGoodsId());
+        if(Validator.isNotEmpty(userPeriodVo.getOrderGoodsId())){
+            classGradeUserQueryBo.setOrderGoodsId(userPeriodVo.getOrderGoodsId());
+            bo.setOrderGoodsId(userPeriodVo.getOrderGoodsId());
+        }else{
+            //非七大员
+            ClassGradeUser classGradeUser =iClassGradeUserService.getOne(new LambdaQueryWrapper<ClassGradeUser>().eq(ClassGradeUser::getGradeId, userPeriodVo.getGradeId()).eq(ClassGradeUser::getUserId, userPeriodVo.getUserId()).last("limit 1"));
+            classGradeUserQueryBo.setOrderGoodsId(classGradeUser.getOrderGoodsId());
+            bo.setOrderGoodsId(classGradeUser.getOrderGoodsId());
+        }
         Integer gradePeriodStatus = iClassGradeUserService.updateUserPeriodStatus(classGradeUserQueryBo);
         //发送审核不通过消息
         bo.setStatus(gradePeriodStatus);
@@ -326,17 +335,19 @@ public class UserPeriodServiceImpl extends ServiceImpl<UserPeriodMapper, UserPer
     @Override
     @Transactional(rollbackFor = Exception.class)
     public boolean editPeriodAll(UserPeriodEditBo bo) {
+        Long orderGoodsId = null;
         CourseBusiness business = null;
         for (Long id : bo.getIds()) {
             UserPeriodStatusVo oldData = userPeriodStatusService.queryById(id);
             Long goodsId;
             String userName = "系统自动审核通过";
+            UserPeriod period = getById(oldData.getPeriodId());
             if (ObjectUtils.isNotNull(bo.getGoodsId())){
                 goodsId = bo.getGoodsId();
             }else {
-                UserPeriod period = getById(oldData.getPeriodId());
                 goodsId = period.getGoodsId();
             }
+            orderGoodsId = period.getOrderGoodsId();
             //获取业务学时审核数据
             Goods goods = iGoodsService.getById(goodsId);
             business = iCourseBusinessService.getById(goods.getBusinessId());
@@ -380,12 +391,31 @@ public class UserPeriodServiceImpl extends ServiceImpl<UserPeriodMapper, UserPer
             userPeriods.eq(UserPeriodStatus::getPeriodStatus, 1);
             userPeriods.eq(UserPeriodStatus::getStatus, 2);
             userPeriodStatusService.update(userPeriodStatus, userPeriods);
+
+            CourseChapterVo chapterVo = iCourseChapterService.queryById(period.getChapterId());
+            if(Validator.isNotEmpty(chapterVo)&&Validator.isNotEmpty(chapterVo.getCommonSign())&&chapterVo.getCommonSign()==1){
+                if(bo.getStatus()==0){
+                    LambdaUpdateWrapper<OrderGoods> objectLambdaUpdateWrapper = Wrappers.lambdaUpdate();
+                    objectLambdaUpdateWrapper.eq(OrderGoods::getOrderGoodsId, period.getOrderGoodsId());
+                    objectLambdaUpdateWrapper.set(OrderGoods::getSevenClassStatus, 4);
+                    iOrderGoodsService.update(null, objectLambdaUpdateWrapper);
+                }
+            }
         }
         //更新班级学员信息
         ClassGradeUserQueryBo classGradeUserQueryBo = new ClassGradeUserQueryBo();
         classGradeUserQueryBo.setUserId(bo.getUserId());
         classGradeUserQueryBo.setGradeId(bo.getGradeId());
         classGradeUserQueryBo.setGoodsId(bo.getGoodsId());
+        if(Validator.isNotEmpty(orderGoodsId)){
+            classGradeUserQueryBo.setOrderGoodsId(orderGoodsId);
+            bo.setOrderGoodsId(orderGoodsId);
+        }else{
+            //非七大员
+            ClassGradeUser classGradeUser =iClassGradeUserService.getOne(new LambdaQueryWrapper<ClassGradeUser>().eq(ClassGradeUser::getGradeId, bo.getGradeId()).eq(ClassGradeUser::getUserId, bo.getUserId()).last("limit 1"));
+            classGradeUserQueryBo.setOrderGoodsId(classGradeUser.getOrderGoodsId());
+            bo.setOrderGoodsId(classGradeUser.getOrderGoodsId());
+        }
         Integer gradePeriodStatus = iClassGradeUserService.updateUserPeriodStatus(classGradeUserQueryBo);
         //发送审核不通过消息
         if (gradePeriodStatus == 0) {
@@ -408,6 +438,7 @@ public class UserPeriodServiceImpl extends ServiceImpl<UserPeriodMapper, UserPer
         ClassGradeUser classGradeUser = iClassGradeUserService.getOne(new LambdaQueryWrapper<ClassGradeUser>()
                 .eq(ClassGradeUser::getUserId, bo.getUserId())
                 .eq(ClassGradeUser::getGradeId, bo.getGradeId())
+                .eq(ClassGradeUser::getOrderGoodsId, bo.getOrderGoodsId())
                 .last("limit 1"));
         //获取业务学时审核数据
         Goods goods = iGoodsService.getById(bo.getGoodsId());
@@ -415,7 +446,7 @@ public class UserPeriodServiceImpl extends ServiceImpl<UserPeriodMapper, UserPer
         String userName = "系统自动审核通过";
         if (ObjectUtils.isNull(business.getPeriodType()) || business.getPeriodType() == 1){
             //人工审核
-            if (Validator.isEmpty(bo.getUserId()) || Validator.isEmpty(bo.getGoodsId()) || Validator.isEmpty(bo.getGradeId())) {
+            if (Validator.isEmpty(bo.getOrderGoodsId()) ||Validator.isEmpty(bo.getUserId()) || Validator.isEmpty(bo.getGoodsId()) || Validator.isEmpty(bo.getGradeId())) {
                 throw new CustomException("参数不全");
             }
             if (Validator.isEmpty(classGradeUser) || classGradeUser.getPeriodStatus() != 3) {
@@ -441,6 +472,7 @@ public class UserPeriodServiceImpl extends ServiceImpl<UserPeriodMapper, UserPer
         ClassGradeUserQueryBo queryBo = new ClassGradeUserQueryBo();
         queryBo.setGradeId(bo.getGradeId());
         queryBo.setUserId(bo.getUserId());
+        queryBo.setOrderGoodsId(bo.getOrderGoodsId());
         ClassPeriodStudentVo classPeriodStudentVo = classGradeUserMapper.userPeriodStatus(queryBo);
         if (Validator.isEmpty(classPeriodStudentVo.getClassStartTime())) {
             //没设置永久有效
@@ -457,6 +489,17 @@ public class UserPeriodServiceImpl extends ServiceImpl<UserPeriodMapper, UserPer
             classGradeUserQueryBo.setUserId(bo.getUserId());
             classGradeUserQueryBo.setGradeId(bo.getGradeId());
             classGradeUserQueryBo.setGoodsId(bo.getGoodsId());
+            classGradeUserQueryBo.setOrderGoodsId(bo.getOrderGoodsId());
+
+            ClassGradeUser gradeUser = iClassGradeUserService.getOne(new LambdaQueryWrapper<ClassGradeUser>().eq(ClassGradeUser::getUserId,bo.getUserId()).eq(ClassGradeUser::getGradeId,bo.getGradeId()).last("limit 1"));
+            if(Validator.isNotEmpty(gradeUser)){
+                OrderGoods newOrderGoods = iOrderGoodsService.getOne(new LambdaQueryWrapper<OrderGoods>().eq(OrderGoods::getOrderGoodsId, gradeUser.getOrderGoodsId()));
+                if(newOrderGoods.getSevenClassStatus()==1||newOrderGoods.getSevenClassStatus()==2){
+                    newOrderGoods.setSevenClassStatus(3);
+                    newOrderGoods.setUpdateTime(DateUtils.getNowTime());
+                    iOrderGoodsService.updateById(newOrderGoods);
+                }
+            }
             periodPass(classGradeUserQueryBo);
             //发送消息
             bo.setStatus(1);
@@ -911,12 +954,13 @@ public class UserPeriodServiceImpl extends ServiceImpl<UserPeriodMapper, UserPer
     @Override
     @Transactional(rollbackFor = Exception.class)
     public Boolean rollbackPeriod(UserPeriodEditBo bo) {
-        if (Validator.isEmpty(bo.getUserId()) || Validator.isEmpty(bo.getGoodsId()) || Validator.isEmpty(bo.getGradeId())) {
+        if (Validator.isEmpty(bo.getUserId()) || Validator.isEmpty(bo.getGoodsId()) || Validator.isEmpty(bo.getGradeId())|| Validator.isEmpty(bo.getOrderGoodsId())) {
             throw new CustomException("参数不全");
         }
         ClassGradeUser classGradeUser = iClassGradeUserService.getOne(new LambdaQueryWrapper<ClassGradeUser>()
                 .eq(ClassGradeUser::getUserId, bo.getUserId())
                 .eq(ClassGradeUser::getGradeId, bo.getGradeId())
+                .eq(ClassGradeUser::getOrderGoodsId, bo.getOrderGoodsId())
                 .last("limit 1"));
         if (Validator.isEmpty(classGradeUser) || classGradeUser.getPeriodStatus() != 3) {
             throw new CustomException("非审核中状态无法打回操作");
@@ -977,7 +1021,7 @@ public class UserPeriodServiceImpl extends ServiceImpl<UserPeriodMapper, UserPer
             return;
         }
         redisCache.setCacheObject(key, 1L, 10, TimeUnit.SECONDS);//1分钟
-        ClassGradeUser gradeUser = iClassGradeUserService.getOne(new LambdaQueryWrapper<ClassGradeUser>().eq(ClassGradeUser::getUserId,bo.getUserId()).eq(ClassGradeUser::getGradeId,bo.getGradeId()).last("limit 1"));
+        ClassGradeUser gradeUser = iClassGradeUserService.getOne(new LambdaQueryWrapper<ClassGradeUser>().eq(ClassGradeUser::getUserId,bo.getUserId()).eq(ClassGradeUser::getGradeId,bo.getGradeId()).eq(ClassGradeUser::getOrderGoodsId,bo.getOrderGoodsId()).last("limit 1"));
         if(Validator.isNotEmpty(gradeUser)){
             bo.setOrderGoodsId(gradeUser.getOrderGoodsId());
         }
@@ -1088,7 +1132,7 @@ public class UserPeriodServiceImpl extends ServiceImpl<UserPeriodMapper, UserPer
             return;
         }
         redisCache.setCacheObject(key, 1L, 10, TimeUnit.SECONDS);//1分钟
-        ClassGradeUser gradeUser = iClassGradeUserService.getOne(new LambdaQueryWrapper<ClassGradeUser>().eq(ClassGradeUser::getUserId,bo.getUserId()).eq(ClassGradeUser::getGradeId,bo.getGradeId()).last("limit 1"));
+        ClassGradeUser gradeUser = iClassGradeUserService.getOne(new LambdaQueryWrapper<ClassGradeUser>().eq(ClassGradeUser::getUserId,bo.getUserId()).eq(ClassGradeUser::getGradeId,bo.getGradeId()).eq(ClassGradeUser::getOrderGoodsId,bo.getOrderGoodsId()).last("limit 1"));
         if(Validator.isNotEmpty(gradeUser)){
             bo.setOrderGoodsId(gradeUser.getOrderGoodsId());
         }

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

@@ -159,4 +159,5 @@ public class ClassGradeUserVo {
 	@Excel(name = "学习记录同步到老系统时间")
 	@ApiModelProperty("学习记录同步到老系统时间")
 	private Long toOldTime;
+	private Long orderGoodsId;
 }

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

@@ -197,4 +197,7 @@ public class ClassGradeVo {
 	private Long goodsId;
 	@ApiModelProperty("用户ID")
 	private Long userId;
+
+	@ApiModelProperty("七大员继教年份")
+	private String sevenYear;
 }

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

@@ -17,6 +17,8 @@ public class ClassNpUserInfoVo implements Serializable {
 
     private Long userId;
 
+    private Integer finishStatus;
+
     private Long gradeId;
 
     private String subjectIds;

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

@@ -139,6 +139,10 @@ public class ClassPeriodChapterVo implements Comparable<ClassPeriodChapterVo> {
 	@ApiModelProperty("模塊ID")
 	private Long moduleId;
 
+	@ApiModelProperty("公共标识:1公共章 0非公共章")
+	private Integer commonSign;
+
+
 	@Override
 	public int compareTo(ClassPeriodChapterVo o) {
 		return this.getSort() - o.getSort();

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

@@ -182,6 +182,8 @@ public class ClassPeriodSectionVo implements Comparable<ClassPeriodSectionVo> {
 
 	@ApiModelProperty("周查询结束时间")
 	private Long searchWeekEndTime;
+
+	private Long orderGoodsId;
 	@Override
 	public int compareTo(ClassPeriodSectionVo o) {
 		return this.getSort() - o.getSort();

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

@@ -75,4 +75,6 @@ public class ClassPeriodStudentExportVo {
 	private String idCardImg2Oss;
 
 	private String oneInchPhotosOss;
+
+	private Long orderGoodsId;
 }

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

@@ -229,4 +229,5 @@ public class ClassPeriodStudentVo {
 	private String fullName;
 	@ApiModelProperty("")
 	private String token;
+	private Long orderGoodsId;
 }

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

@@ -215,6 +215,8 @@ public class ClassPeriodVo implements Comparable<ClassPeriodVo> {
 	@Excel(name = "做卷类型  1测试 2考试")
 	@ApiModelProperty("做题类型  1测试 2考试")
 	private Integer doType;
+	@ApiModelProperty("公共标识:1公共章 0非公共章")
+	private Integer commonSign;
 	@Override
 	public int compareTo(ClassPeriodVo o) {
 		if(o.getCourseSort()==this.getCourseSort()){

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

@@ -63,4 +63,7 @@ public class UserPeriodVo {
 	/** 班级ID */
 	@ApiModelProperty("班级ID")
 	private Long gradeId;
+
+	@ApiModelProperty("订单商品ID")
+	private Long orderGoodsId;
 }

+ 12 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/bo/OrderGoodsAddBo.java

@@ -87,4 +87,16 @@ public class OrderGoodsAddBo {
     private String distributionCode;
     @ApiModelProperty("分销链编码")
     private String distributionLinkCode;
+    /** 七大员继教商品年份 */
+    @ApiModelProperty("七大员继教商品年份")
+    private String sevenYear;
+    /** 七大员公共课版本号 */
+    @ApiModelProperty("七大员公共课版本号")
+    private Integer sevenClassVersion;
+    /** 0 未学习 1学习中 2已学完  3已审核 4待重修 */
+    @ApiModelProperty("0 未学习 1学习中 2已学完  3已审核 4待重修")
+    private Integer sevenClassStatus;
+    /** 复制状态 1自学 2复制 */
+    @ApiModelProperty("复制状态 1自学 2复制")
+    private Integer sevenClassCopy;
 }

+ 9 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/bo/OrderGoodsEditBo.java

@@ -107,4 +107,13 @@ public class OrderGoodsEditBo {
     /** 关闭原因 */
     @ApiModelProperty("关闭原因")
     private String closeReason;
+    /** 七大员公共课版本号 */
+    @ApiModelProperty("七大员公共课版本号")
+    private Integer sevenClassVersion;
+    /** 0 未学习 1学习中 2已学完  3已审核 4待重修 */
+    @ApiModelProperty("0 未学习 1学习中 2已学完  3已审核 4待重修")
+    private Integer sevenClassStatus;
+    /** 复制状态 1自学 2复制 */
+    @ApiModelProperty("复制状态 1自学 2复制")
+    private Integer sevenClassCopy;
 }

+ 6 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/bo/OrderGoodsQueryBo.java

@@ -103,5 +103,10 @@ public class OrderGoodsQueryBo extends BaseEntity {
 	private Integer rebuyOrderGoodsId;
 	@ApiModelProperty("商品类型 1视频2题库 3面授 4服务 5组合")
 	private Integer goodsType;
-
+	/** 七大员公共课版本号 */
+	@ApiModelProperty("七大员公共课版本号")
+	private Integer sevenClassVersion;
+	/** 0 未学习 1学习中 2已学完  3已审核 4待重修 */
+	@ApiModelProperty("0 未学习 1学习中 2已学完  3已审核 4待重修")
+	private Integer sevenClassStatus;
 }

+ 15 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/bo/OrderGoodsSevenBo.java

@@ -0,0 +1,15 @@
+package com.zhongzheng.modules.order.bo;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @author yangdamao
+ * @date 2023年08月25日 9:41
+ */
+@Data
+public class OrderGoodsSevenBo implements Serializable {
+
+    private Long orderGoodsId;
+}

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

@@ -94,4 +94,12 @@ private static final long serialVersionUID=1L;
     private Integer divideModel;
     @ApiModelProperty("分成钱")
     private BigDecimal divideMoney;
+    /** 七大员商品年份 */
+    private String sevenYear;
+    /** 七大员公共课版本号 */
+    private Integer sevenClassVersion;
+    /** 0 未学习 1学习中 2已学完  3已审核 4待重修 */
+    private Integer sevenClassStatus;
+    /** 复制状态 1自学 2复制 */
+    private Long sevenClassCopy;
 }

+ 4 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/mapper/OrderGoodsMapper.java

@@ -68,4 +68,8 @@ public interface OrderGoodsMapper extends BaseMapper<OrderGoods> {
     String getBusinessById(@Param("orderGoodsId") Long orderGoodsId);
 
     List<OrderGoods> getApplyOrderGoods(@Param("goodsIds")List<Long> goodsIds,@Param("userId") Long userId);
+
+    OrderGoods getSevenLastOne(@Param("projectId")Integer projectId,@Param("sevenYear")String sevenYear,@Param("userId")Long userId);
+
+    Long countOrderGoodsByYear(@Param("sevenYear") String sevenYear,@Param("goodsId") Long goodsId,@Param("userId") Long userId);
 }

+ 6 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/service/IOrderGoodsService.java

@@ -118,4 +118,10 @@ public interface IOrderGoodsService extends IService<OrderGoods> {
     String getBusinessById(Long orderGoodsId);
 
     List<OrderGoods> getApplyOrderGoods(List<Long> goodsIds, Long userId);
+
+    OrderGoods getSevenLastOne(Integer projectId,String sevenYear,Long userId);
+
+    Long countOrderGoodsByYear(String sevenYear, Long goodsId, Long userId);
+
+    String getOrderSevenYear(Long orderGoodsId);
 }

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

@@ -113,4 +113,6 @@ public interface IOrderService extends IService<Order> {
 	boolean arrangeGrade(String goodsName, Long goodsId, Long orderGoodsId, Long gradeId, Long userId, String orderSn, Long businessId);
 
 	Map<String, String> getActivityGoods(OrderAddBo bo);
+
+    Boolean studyCheck(Long orderGoodsId, Long userId);
 }

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

@@ -190,11 +190,11 @@ public class OrderGoodsRefundServiceImpl extends ServiceImpl<OrderGoodsRefundMap
     @Override
     @Transactional(rollbackFor = Exception.class)
     public Boolean placeRefundSmallOrder(OrderGoodsRefundAddBo bo) {
-        if(Validator.isEmpty(bo.getGoodsId())||Validator.isEmpty(bo.getOrderSn())){
+        if(Validator.isEmpty(bo.getGoodsId())||Validator.isEmpty(bo.getOrderSn())||Validator.isEmpty(bo.getOrderGoodsId())){
             throw new CustomException("参数缺失");
         }
         OrderGoods orderGoods = iOrderGoodsService.getOne(new LambdaQueryWrapper<OrderGoods>().eq(OrderGoods::getOrderSn,bo.getOrderSn())
-                .eq(OrderGoods::getGoodsId, bo.getGoodsId()));
+                .eq(OrderGoods::getGoodsId, bo.getGoodsId()).eq(OrderGoods::getOrderGoodsId, bo.getOrderGoodsId()));
         if(Validator.isEmpty(orderGoods)){
             throw new CustomException("订单商品数据错误");
         }
@@ -245,7 +245,7 @@ public class OrderGoodsRefundServiceImpl extends ServiceImpl<OrderGoodsRefundMap
             }
             //判断是否已标记
             ClassGradeUser classGradeUser = iClassGradeUserService.getOne(new LambdaQueryWrapper<ClassGradeUser>().eq(ClassGradeUser::getGradeId,orderGoods.getGradeId())
-                    .eq(ClassGradeUser::getUserId,order.getUserId()));
+                    .eq(ClassGradeUser::getUserId,order.getUserId()).eq(ClassGradeUser::getOrderGoodsId,orderGoods.getOrderGoodsId()));
             if(Validator.isNotEmpty(classGradeUser)&&Validator.isNotEmpty(classGradeUser.getLearnStatus())&&classGradeUser.getLearnStatus()==1){
                 throw new CustomException("已标记开通不满足退款");
             }
@@ -352,11 +352,11 @@ public class OrderGoodsRefundServiceImpl extends ServiceImpl<OrderGoodsRefundMap
     @Transactional(rollbackFor = Exception.class)
     public Boolean placeRefundInputOrder(List<OrderGoodsRefundAddBo> bos) {
         for(OrderGoodsRefundAddBo bo : bos){
-            if(Validator.isEmpty(bo.getGoodsId())||Validator.isEmpty(bo.getOrderSn())){
+            if(Validator.isEmpty(bo.getGoodsId())||Validator.isEmpty(bo.getOrderSn())||Validator.isEmpty(bo.getOrderGoodsId())){
                 throw new CustomException("参数缺失");
             }
             OrderGoods orderGoods = iOrderGoodsService.getOne(new LambdaQueryWrapper<OrderGoods>().eq(OrderGoods::getOrderSn,bo.getOrderSn())
-                    .eq(OrderGoods::getGoodsId, bo.getGoodsId()));
+                    .eq(OrderGoods::getGoodsId, bo.getGoodsId()).eq(OrderGoods::getOrderGoodsId, bo.getOrderGoodsId()));
             if(Validator.isEmpty(orderGoods)){
                 throw new CustomException("订单商品数据错误");
             }
@@ -391,7 +391,7 @@ public class OrderGoodsRefundServiceImpl extends ServiceImpl<OrderGoodsRefundMap
                 }
                 //判断是否已标记
                 ClassGradeUser classGradeUser = iClassGradeUserService.getOne(new LambdaQueryWrapper<ClassGradeUser>().eq(ClassGradeUser::getGradeId,orderGoods.getGradeId())
-                        .eq(ClassGradeUser::getUserId,order.getUserId()));
+                        .eq(ClassGradeUser::getUserId,order.getUserId()).eq(ClassGradeUser::getOrderGoodsId,orderGoods.getOrderGoodsId()));
                 if(Validator.isNotEmpty(classGradeUser)&&Validator.isNotEmpty(classGradeUser.getLearnStatus())&&classGradeUser.getLearnStatus()==1){
                     throw new CustomException("已标记开通不满足退款");
                 }

+ 24 - 2
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/service/impl/OrderGoodsServiceImpl.java

@@ -574,7 +574,7 @@ public class OrderGoodsServiceImpl extends ServiceImpl<OrderGoodsMapper, OrderGo
             if(goodsVo.getGoodsType()==1){
                 //视频商品
                 //获得当前所在班级
-                ClassGradeVo classGradeVo = courseMapper.gradeIdSelect(goodsVo.getUserId(),goodsVo.getGoodsId(),goodsVo.getGradeId());
+                ClassGradeVo classGradeVo = courseMapper.gradeIdSelect(goodsVo.getUserId(),goodsVo.getGoodsId(),goodsVo.getGradeId(),goodsVo.getOrderGoodsId());
                 if(Validator.isEmpty(classGradeVo)){
                     continue;
                 }
@@ -687,6 +687,9 @@ public class OrderGoodsServiceImpl extends ServiceImpl<OrderGoodsMapper, OrderGo
 
     @Override
     public List<GoodsSectionListVo> getGoodsSectionList(GoodsSectionListBo bo) {
+        if(Validator.isEmpty(bo.getOrderGoodsId())){
+            throw new CustomException("订单商品ID");
+        }
         List<GoodsSectionListVo> resultVos = baseMapper.getGoodsSectionList(bo.getGoodsId());
         if (CollectionUtils.isEmpty(resultVos)){
             return new ArrayList<>();
@@ -696,7 +699,7 @@ public class OrderGoodsServiceImpl extends ServiceImpl<OrderGoodsMapper, OrderGo
         }
         //获取需要重修的节
         resultVos.forEach(item -> {
-            Integer rebuild = courseMenuMapper.rebuildSectionCheck(item.getSectionId(),item.getModuleId(), item.getChapterId(),bo.getGradeId(), bo.getUserId(),item.getCourseId());
+            Integer rebuild = courseMenuMapper.rebuildSectionCheck(item.getSectionId(),item.getModuleId(), item.getChapterId(),bo.getGradeId(), bo.getUserId(),item.getCourseId(),bo.getOrderGoodsId());
             if (rebuild > 0) {
                 item.setRebuild(1);
             }
@@ -724,6 +727,25 @@ public class OrderGoodsServiceImpl extends ServiceImpl<OrderGoodsMapper, OrderGo
         return baseMapper.getApplyOrderGoods(goodsIds,userId);
     }
 
+    @Override
+    public OrderGoods getSevenLastOne(Integer projectId,String sevenYear,Long userId) {
+        return baseMapper.getSevenLastOne(projectId,sevenYear,userId);
+    }
+
+    @Override
+    public Long countOrderGoodsByYear(String sevenYear, Long goodsId, Long userId) {
+        return baseMapper.countOrderGoodsByYear(sevenYear, goodsId, userId);
+    }
+
+    @Override
+    public String getOrderSevenYear(Long orderGoodsId) {
+        OrderGoods orderGoods = getById(orderGoodsId);
+        if (ObjectUtils.isNull(orderGoods)){
+            return "";
+        }
+        return orderGoods.getSevenYear();
+    }
+
     private boolean checkUnique(Long GoodsId,Long UserId) {
         ShoppingCart info = iShoppingCartService.getOne(new LambdaQueryWrapper<ShoppingCart>()
                 .eq(ShoppingCart::getUserId,UserId).eq(ShoppingCart::getGoodsId,GoodsId).last("limit 1"));

+ 130 - 15
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/service/impl/OrderServiceImpl.java

@@ -478,6 +478,13 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
             if (goods.getGoodsStatus() != 1) {
                 throw new CustomException(goods.getGoodsName() + "商品已下架,请重新选择商品下单");
             }
+            //校验是否有重复商品
+            if (StringUtils.isNotBlank(g.getSevenYear())){
+                Long count = iOrderGoodsService.countOrderGoodsByYear(g.getSevenYear(),g.getGoodsId(),bo.getUserId());
+                if (count > 0){
+                    throw new CustomException(goods.getGoodsName() + ",请勿重复购买相同年份的商品");
+                }
+            }
             OrderGoods orderGoods = BeanUtil.toBean(g, OrderGoods.class);
             orderGoods.setOrderSn(out_trade_no);
             if (g.getGoodsInputData() != null) {
@@ -517,7 +524,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
 
                 Long gradeId = null;
                 //判断是否购买历史班级都过期
-                canRepeatBuy = this.canBuyRepeatGoods(g.getGoodsId(), bo.getUserId());
+                canRepeatBuy = this.canBuyRepeatGoods(g.getGoodsId(), bo.getUserId(),g.getSevenYear());
                 if (g.getGoodsInputData() != null) {
                     gradeId = g.getGoodsInputData().getGradeId();
                     if (Validator.isNotEmpty(oldOrderGoodsId)) {
@@ -619,6 +626,13 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
             if (Validator.isEmpty(goods)) {
                 throw new CustomException("商品不存在", 510);
             }
+            //校验是否有重复商品
+            if (StringUtils.isNotBlank(g.getSevenYear())){
+                Long count = iOrderGoodsService.countOrderGoodsByYear(g.getSevenYear(),g.getGoodsId(),bo.getUserId());
+                if (count > 0){
+                    throw new CustomException(goods.getGoodsName() + ",请勿重复购买相同年份的商品");
+                }
+            }
 //            if (goods.getGoodsStatus() != 1) {
 //                throw new CustomException(goods.getGoodsName()+"商品已下架,请重新选择商品下单", 510);
 //            }
@@ -658,7 +672,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
 
                 Long gradeId = null;
                 //判断是否购买历史班级都过期
-                canRepeatBuy = this.canBuyRepeatGoods(g.getGoodsId(), bo.getUserId());
+                canRepeatBuy = this.canBuyRepeatGoods(g.getGoodsId(), bo.getUserId(),g.getSevenYear());
                 if (g.getGoodsInputData() != null) {
                     gradeId = g.getGoodsInputData().getGradeId();
                     if (Validator.isNotEmpty(oldOrderGoodsId)) {
@@ -811,6 +825,13 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
             if (goods.getGoodsStatus() != 1) {
                 throw new CustomException(goods.getGoodsName() + "商品已下架,请重新选择商品下单");
             }
+            //校验是否有重复商品
+            if (StringUtils.isNotBlank(g.getSevenYear())){
+                Long count = iOrderGoodsService.countOrderGoodsByYear(g.getSevenYear(),g.getGoodsId(),bo.getUserId());
+                if (count > 0){
+                    throw new CustomException(goods.getGoodsName() + ",请勿重复购买相同年份的商品");
+                }
+            }
             body = "中正祥粤云-" + goods.getGoodsName();
             OrderGoods orderGoods = BeanUtil.toBean(g, OrderGoods.class);
             orderGoods.setOrderSn(out_trade_no);
@@ -882,7 +903,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
                 }
                 Long gradeId = null;
                 //判断是否购买历史班级都过期
-                canRepeatBuy = this.canBuyRepeatGoods(g.getGoodsId(), bo.getUserId());
+                canRepeatBuy = this.canBuyRepeatGoods(g.getGoodsId(), bo.getUserId(),g.getSevenYear());
                 if (g.getGoodsInputData() != null) {
                     gradeId = g.getGoodsInputData().getGradeId();
                     if (Validator.isNotEmpty(oldOrderGoodsId)) {
@@ -1204,6 +1225,13 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
             if (goods.getGoodsStatus() != 1) {
                 throw new CustomException(goods.getGoodsName() + "商品已下架,请重新选择商品下单");
             }
+            //校验是否有重复商品
+            if (StringUtils.isNotBlank(g.getSevenYear())){
+                Long count = iOrderGoodsService.countOrderGoodsByYear(g.getSevenYear(),g.getGoodsId(),bo.getUserId());
+                if (count > 0){
+                    throw new CustomException(goods.getGoodsName() + ",请勿重复购买相同年份的商品");
+                }
+            }
             body = "中正祥粤云-" + goods.getGoodsName();
             OrderGoods orderGoods = BeanUtil.toBean(g, OrderGoods.class);
             orderGoods.setOrderSn(out_trade_no);
@@ -1275,7 +1303,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
                 }
                 Long gradeId = null;
                 //判断是否购买历史班级都过期
-                canRepeatBuy = this.canBuyRepeatGoods(g.getGoodsId(), bo.getUserId());
+                canRepeatBuy = this.canBuyRepeatGoods(g.getGoodsId(), bo.getUserId(),g.getSevenYear());
                 if (g.getGoodsInputData() != null) {
                     gradeId = g.getGoodsInputData().getGradeId();
                     if (Validator.isNotEmpty(oldOrderGoodsId)) {
@@ -1390,6 +1418,13 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
             if (goods.getGoodsStatus() != 1) {
                 throw new CustomException(goods.getGoodsName() + "商品已下架,请重新选择商品下单");
             }
+            //校验是否有重复商品
+            if (StringUtils.isNotBlank(g.getSevenYear())){
+                Long count = iOrderGoodsService.countOrderGoodsByYear(g.getSevenYear(),g.getGoodsId(),bo.getUserId());
+                if (count > 0){
+                    throw new CustomException(goods.getGoodsName() + ",请勿重复购买相同年份的商品");
+                }
+            }
             body = "中正祥粤云-" + goods.getGoodsName();
             OrderGoods orderGoods = BeanUtil.toBean(g, OrderGoods.class);
             orderGoods.setOrderSn(out_trade_no);
@@ -1431,7 +1466,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
                 }
                 Long gradeId = null;
                 //判断是否购买历史班级都过期
-                canRepeatBuy = this.canBuyRepeatGoods(g.getGoodsId(), bo.getUserId());
+                canRepeatBuy = this.canBuyRepeatGoods(g.getGoodsId(), bo.getUserId(),g.getSevenYear());
                 if (g.getGoodsInputData() != null) {
                     gradeId = g.getGoodsInputData().getGradeId();
                     if (Validator.isNotEmpty(oldOrderGoodsId)) {
@@ -1926,7 +1961,21 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
     }
 
     //检查是否允许重复购买视频商品
-    public boolean canBuyRepeatGoods(Long goodsId, Long userId) {
+    public boolean canBuyRepeatGoods(Long goodsId, Long userId,String sevenYear) {
+        String businessName = iGoodsService.getGoodsBusinessName(goodsId);
+        if (businessName.contains("继续教育") && businessName.contains("施工现场专业人员")){
+            //判断是否有锁定的班级
+            ClassGradeUserTempQueryBo gradeUserTempQueryBo = new ClassGradeUserTempQueryBo();
+            gradeUserTempQueryBo.setUserId(userId);
+            gradeUserTempQueryBo.setGoodsId(goodsId);
+            gradeUserTempQueryBo.setSevenYear(sevenYear);
+            gradeUserTempQueryBo.setStatus(ClassGradeUserTemp.STATUS_LOCK);
+            List<ClassGradeUserTempVo> list1 = iClassGradeUserTempService.queryList(gradeUserTempQueryBo);
+            if (list1 != null && list1.size() > 0) {
+                throw new CustomException("当前所购买商品,存在订单未支付", 510);
+            }
+            return true;
+        }
         //判断是否还有未过期的班级
         ClassGradeQueryBo bo = new ClassGradeQueryBo();
         bo.setUserId(userId);
@@ -1955,6 +2004,10 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
 
     //检查是否购买过商品
     public boolean checkBuyGoods(Long goodsId, Long userId, Integer goodsType) {
+        String businessName = iGoodsService.getGoodsBusinessName(goodsId);
+        if (businessName.contains("继续教育") && businessName.contains("施工现场专业人员")){
+            return true;
+        }
         OrderGoodsQueryBo bo = new OrderGoodsQueryBo();
         bo.setUserId(userId);
         bo.setGoodsId(goodsId);
@@ -1986,6 +2039,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
         if (classNum > 0){
             throw new CustomException("该学员已在此商品有效期内的班级,无法加入新的有效期班级,请查看该学员此商品下的班级");
         }*/
+        OrderGoods orderGoods = iOrderGoodsService.getById(orderGoodsId);
         //指定班级
         if (gradeId != null && gradeId > 0) {
             ClassGradeVo classGradeVo = iClassGradeService.queryById(gradeId);
@@ -2013,12 +2067,13 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
             //预留0空位避免超人数
             if ((classGradeVo.getStudentUpper() - studentNum - locakStudentNum) > 0) {
                 ClassGradeUser gradeUser = iClassGradeUserService.getOne(new LambdaQueryWrapper<ClassGradeUser>().eq(ClassGradeUser::getGradeId, gradeId)
+                        .eq(ClassGradeUser::getOrderGoodsId,orderGoodsId)
                         .eq(ClassGradeUser::getUserId, userId));
                 //不在此班级内
                 if (Validator.isEmpty(gradeUser)) {
                     //班级还有剩位,直接锁定班级
                     if (iClassGradeService.checkEjjjPeopleNumLimit(businessId, gradeId)) { //判断全系统平台二建班级人数是否超300
-                        return lockGrade(orderGoodsId, gradeId, userId, goodsId, orderSn);
+                        return lockGrade(orderGoodsId, gradeId, userId, goodsId, orderSn,orderGoods.getSevenYear());
                     }
 
                 }
@@ -2043,11 +2098,12 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
                 gradeId = classGradeVo.getGradeId();
                 //班级还有剩位,直接锁定班级
                 ClassGradeUser gradeUser = iClassGradeUserService.getOne(new LambdaQueryWrapper<ClassGradeUser>().eq(ClassGradeUser::getGradeId, gradeId)
+                        .eq(ClassGradeUser::getOrderGoodsId,orderGoodsId)
                         .eq(ClassGradeUser::getUserId, userId));
                 //不在此班级内
                 if (Validator.isEmpty(gradeUser)) {
                     if (iClassGradeService.checkEjjjPeopleNumLimit(businessId, gradeId)) { //判断全系统平台二建班级人数是否超300
-                        return lockGrade(orderGoodsId, gradeId, userId, goodsId, orderSn);
+                        return lockGrade(orderGoodsId, gradeId, userId, goodsId, orderSn,orderGoods.getSevenYear());
                     }
                 }
             }
@@ -2064,7 +2120,14 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
         if (isConfigTp) {
             classGrade.setClassStatus(0);
             classGrade.setLearningStatus(2);//待定
-            classGrade.setStudentUpper(ClassGrade.INIT_UPPER); //上限300
+            //七大员继教默认上限1000
+            String businessFullName = iGoodsService.getGoodsBusinessName(goodsId);
+            if (businessFullName.contains("继续教育") && businessFullName.contains("施工现场专业人员")){
+                //七大员继教
+                classGrade.setStudentUpper(ClassGrade.INIT_UPPER3); //上限1000
+            }else {
+                classGrade.setStudentUpper(ClassGrade.INIT_UPPER); //上限300
+            }
 
             //企业ID
             String tenant = ServletUtils.getRequest().getHeader("TenantId");
@@ -2126,7 +2189,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
         classGradeGoods.setUpdateTime(DateUtils.getNowTime());
         iClassGradeGoodsService.save(classGradeGoods);
         //锁定班级
-        lockGrade(orderGoodsId, classGrade.getGradeId(), userId, goodsId, orderSn);
+        lockGrade(orderGoodsId, classGrade.getGradeId(), userId, goodsId, orderSn,orderGoods.getSevenYear());
         return true;
     }
 
@@ -2190,7 +2253,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
                 }
                 Long gradeId = null;
                 //判断是否购买历史班级都过期
-                canRepeatBuy = this.canBuyRepeatGoods(g.getGoodsId(), bo.getUserId());
+                canRepeatBuy = this.canBuyRepeatGoods(g.getGoodsId(), bo.getUserId(),g.getSevenYear());
                 if (g.getGoodsInputData() != null) {
                     gradeId = g.getGoodsInputData().getGradeId();
                     if (Validator.isNotEmpty(oldOrderGoodsId)) {
@@ -2257,6 +2320,44 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
         return payResult;
     }
 
+    @Override
+    public Boolean studyCheck(Long orderGoodsId, Long userId) {
+        OrderGoods orderGoods = iOrderGoodsService.getById(orderGoodsId);
+        if (ObjectUtils.isNull(orderGoods)){
+            throw new CustomException("数据错误");
+        }
+        String businessName = iGoodsService.getGoodsBusinessName(orderGoods.getGoodsId());
+        if (!(businessName.contains("继续教育") && businessName.contains("施工现场专业人员"))){
+            return true;
+        }
+        Order order = getOne(new LambdaQueryWrapper<Order>().eq(Order::getOrderSn, orderGoods.getOrderSn()));
+        if (!order.getUserId().equals(userId)){
+            throw new CustomException("订单数据不匹配");
+        }
+        ClassGradeUser gradeUserTwo = iClassGradeUserService.getOne(new LambdaQueryWrapper<ClassGradeUser>()
+                .eq(ClassGradeUser::getUserId,userId)
+                .eq(ClassGradeUser::getStatus, 1)
+                .eq(ClassGradeUser::getOrderGoodsId, orderGoodsId)
+                .last("limit 1"));
+        if (ObjectUtils.isNotNull(gradeUserTwo) && gradeUserTwo.getPeriodStatus() == 1 && gradeUserTwo.getFinishStatus() == 1){
+            return true;
+        }
+
+        //校验是否有正在学习的七大员继教课程
+        List<ClassGradeUser> classGradeUser = iClassGradeUserService.getClassInfoByUser(userId);
+        if (CollectionUtils.isEmpty(classGradeUser)){
+            return true;
+        }
+        if (classGradeUser.stream().noneMatch(x -> x.getOrderGoodsId().equals(orderGoodsId))){
+            ClassGradeUser gradeUser = classGradeUser.stream().findFirst().orElse(null);
+            OrderGoods orderGoodsTwo = iOrderGoodsService.getById(gradeUser.getOrderGoodsId());
+            Goods goods = iGoodsService.getById(orderGoodsTwo.getGoodsId());
+            throw new CustomException(String.format("请先学完【%s】课程!",goods.getGoodsName()));
+        }
+
+        return true;
+    }
+
     private String createGradeCode(Long goodsId, CourseBusinessVo business) {
 
         Goods goods = iGoodsService.getById(goodsId);
@@ -2363,7 +2464,10 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
                 throw new CustomException("该班级不支持该商品使用");
             }
             //判断用户是否在此班过
-            ClassGradeUser gradeUser = iClassGradeUserService.getOne(new LambdaQueryWrapper<ClassGradeUser>().eq(ClassGradeUser::getUserId, userId).eq(ClassGradeUser::getGradeId, gradeId).last("limit 1"));
+            ClassGradeUser gradeUser = iClassGradeUserService.getOne(new LambdaQueryWrapper<ClassGradeUser>()
+                    .eq(ClassGradeUser::getUserId, userId)
+                    .eq(ObjectUtils.isNotNull(orderGoodsId),ClassGradeUser::getOrderGoodsId, orderGoodsId)
+                    .eq(ClassGradeUser::getGradeId, gradeId).last("limit 1"));
             if (Validator.isEmpty(gradeUser)) {
                 LambdaQueryWrapper<ClassGradeUser> lqw = new LambdaQueryWrapper<>();
                 lqw.eq(ClassGradeUser::getGradeId, gradeId);
@@ -2403,7 +2507,10 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
                 //有空位则进入班级
                 gradeId = classGradeVo.getGradeId();
                 //判断用户是否在此班过
-                ClassGradeUser gradeUser = iClassGradeUserService.getOne(new LambdaQueryWrapper<ClassGradeUser>().eq(ClassGradeUser::getUserId, userId).eq(ClassGradeUser::getGradeId, gradeId).last("limit 1"));
+                ClassGradeUser gradeUser = iClassGradeUserService.getOne(new LambdaQueryWrapper<ClassGradeUser>()
+                        .eq(ObjectUtils.isNotNull(orderGoodsId),ClassGradeUser::getOrderGoodsId, orderGoodsId)
+                        .eq(ClassGradeUser::getUserId, userId)
+                        .eq(ClassGradeUser::getGradeId, gradeId).last("limit 1"));
                 if (Validator.isEmpty(gradeUser)) {
                     //班级还有剩位,直接加入班级
                     if (iClassGradeService.checkEjjjPeopleNumLimit(businessId, gradeId)) { //判断全系统平台二建班级人数是否超300
@@ -2424,7 +2531,14 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
         if (isConfigTp) {
             classGrade.setClassStatus(0);
             classGrade.setLearningStatus(2);//待定
-            classGrade.setStudentUpper(ClassGrade.INIT_UPPER); //上限300
+            //七大员继教默认上限1000
+            String businessFullName = iGoodsService.getGoodsBusinessName(goodsId);
+            if (businessFullName.contains("继续教育") && businessFullName.contains("施工现场专业人员")){
+                //七大员继教
+                classGrade.setStudentUpper(ClassGrade.INIT_UPPER3); //上限1000
+            }else {
+                classGrade.setStudentUpper(ClassGrade.INIT_UPPER); //上限300
+            }
         } else {
             classGrade.setLearningStatus(1);//即刻
             classGrade.setStudentUpper(ClassGrade.INIT_UPPER2); //上限1000000
@@ -2511,7 +2625,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
      * @param orderSn
      * @return
      */
-    public boolean lockGrade(Long orderGoodsId, Long gradeId, Long userId, Long goodsId, String orderSn) {
+    public boolean lockGrade(Long orderGoodsId, Long gradeId, Long userId, Long goodsId, String orderSn,String sevenYear) {
         //锁定班级
         ClassGradeUserTemp classGradeUserTemp = new ClassGradeUserTemp();
         classGradeUserTemp.setUserId(userId);
@@ -2520,6 +2634,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
         classGradeUserTemp.setFromType(1);
         classGradeUserTemp.setGoodsId(goodsId);
         classGradeUserTemp.setOrderSn(orderSn);
+        classGradeUserTemp.setSevenYear(sevenYear);
         classGradeUserTemp.setCreateTime(DateUtils.getNowTime());
         classGradeUserTemp.setUpdateTime(DateUtils.getNowTime());
         iClassGradeUserTempService.save(classGradeUserTemp);

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

@@ -346,4 +346,21 @@ public class OrderGoodsVo {
 
 	@ApiModelProperty("是否可以预约标识:1未参加考试 2已参加考试 3考试成绩未通过")
 	private Integer subscribeSign;
+	/** 七大员公共课版本号 */
+	@Excel(name = "七大员公共课版本号")
+	@ApiModelProperty("七大员公共课版本号")
+	private Integer sevenClassVersion;
+	/** 0 未学习 1学习中 2已学完  3已审核 4待重修 */
+	@Excel(name = "0 未学习 1学习中 2已学完  3已审核 4待重修")
+	@ApiModelProperty("0 未学习 1学习中 2已学完  3已审核 4待重修")
+	private Integer sevenClassStatus;
+
+	@ApiModelProperty("七大员继教商品可选年份")
+	private String sevenYear;
+	@ApiModelProperty("七大员继教订单商品年份")
+	private String orderYear;
+	/** 复制状态 1自学 2复制 */
+	@Excel(name = "复制状态 1自学 2复制")
+	@ApiModelProperty("复制状态 1自学 2复制")
+	private Integer sevenClassCopy;
 }

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/schedule/service/impl/ScheduleServiceImpl.java

@@ -2183,6 +2183,7 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
             ClassGradeUserQueryBo queryBo = new ClassGradeUserQueryBo();
             queryBo.setGradeId(vo.getGradeId());
             queryBo.setUserId(vo.getUserId());
+            queryBo.setOrderGoodsId(vo.getOrderGoodsId());
             String result = iClassGradeUserService.pushOfficialInfo(queryBo);
         }
     }
@@ -2199,6 +2200,7 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
             ClassGradeUserQueryBo queryBo = new ClassGradeUserQueryBo();
             queryBo.setGradeId(vo.getGradeId());
             queryBo.setUserId(vo.getUserId());
+            queryBo.setOrderGoodsId(vo.getOrderGoodsId());
             String result = iClassGradeUserService.pushOfficialPeriod(queryBo);
         }
     }

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

@@ -6,6 +6,7 @@ import com.zhongzheng.modules.course.bo.CourseSectionDetailBo;
 import com.zhongzheng.modules.course.bo.CourseSectionDetailVo;
 import com.zhongzheng.modules.course.bo.CourseStatementBo;
 import com.zhongzheng.modules.course.bo.CourseStatementVo;
+import com.zhongzheng.modules.grade.domain.UserPeriod;
 import com.zhongzheng.modules.grade.domain.UserPeriodStatus;
 import com.zhongzheng.modules.grade.vo.ClassPeriodVo;
 import com.zhongzheng.modules.grade.vo.UserPeriodStatusVo;
@@ -109,4 +110,8 @@ public interface UserStudyRecordMapper extends BaseMapper<UserStudyRecord> {
 
     @InterceptorIgnore(tenantLine = "true")
     UserStudyRecord getStudyRecord(@Param("userId") Long userId,@Param("gradeId") Long gradeId,@Param("sort") String sort);
+
+    UserStudyRecord getSevenStudyRecord(@Param("orderGoodsId") Long orderGoodsId,@Param("gradeId") Long gradeId);
+
+    UserPeriod selectSevenUserPeriod(UserStudyRecord bo);
 }

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

@@ -14,11 +14,11 @@ import java.util.List;
  * @date 2021-12-16
  */
 public interface UserStudyRecordPhotoMapper extends BaseMapper<UserStudyRecordPhoto> {
-    List<String> selectGradePhoto(@Param("userId") Long userId,@Param("gradeId") Long gradeId);
+    List<String> selectGradePhoto(@Param("userId") Long userId,@Param("gradeId") Long gradeId,@Param("orderGoodsId") Long orderGoodsId);
 
-    String selectGradeRecentOnePhoto(@Param("userId") Long userId,@Param("gradeId") Long gradeId);
+    String selectGradeRecentOnePhoto(@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);
+    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")
     List<UserStudyRecordPhoto> listByPhoto(@Param("imageUrl") String imageUrl);

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

@@ -53,9 +53,9 @@ public interface IUserStudyRecordPhotoService extends IService<UserStudyRecordPh
 	 */
 	Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
 
-	List<String> selectGradePhoto(Long userId,Long gradeId);
+	List<String> selectGradePhoto(Long userId,Long gradeId,Long orderGoodsId);
 
-	List<String> selectGradePhotoWeek(Long userId,Long gradeId,Long searchWeekStartTime,Long searchWeekEndTime);
+	List<String> selectGradePhotoWeek(Long userId,Long gradeId,Long searchWeekStartTime,Long searchWeekEndTime,Long orderGoodsId);
 
     List<UserStudyRecordPhoto> getListByPhoto(String imageUrl);
 

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

@@ -142,4 +142,6 @@ public interface IUserStudyRecordService extends IService<UserStudyRecord> {
 	List<UserWatchStatisticsVo> getUserWatchStatistics(CourseSectionDetailBo bo);
 
     UserStudyRecord getStudyRecord(Long userId, Long gradeId, String asc);
+
+	Integer syncSevenPublicClass(Long orderGoodsId,Long userId);
 }

+ 16 - 4
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/impl/UserBankRecordServiceImpl.java

@@ -19,6 +19,8 @@ import com.zhongzheng.modules.grade.domain.UserPeriod;
 import com.zhongzheng.modules.grade.domain.UserPeriodStatus;
 import com.zhongzheng.modules.grade.service.IUserPeriodService;
 import com.zhongzheng.modules.grade.service.IUserPeriodStatusService;
+import com.zhongzheng.modules.order.domain.OrderGoods;
+import com.zhongzheng.modules.order.service.IOrderGoodsService;
 import com.zhongzheng.modules.user.bo.*;
 import com.zhongzheng.modules.user.domain.User;
 import com.zhongzheng.modules.user.domain.UserBankRecord;
@@ -84,7 +86,8 @@ public class UserBankRecordServiceImpl extends ServiceImpl<UserBankRecordMapper,
     @Autowired
     private IExamPaperService iExamPaperService;
 
-
+    @Autowired
+    private IOrderGoodsService iOrderGoodsService;
 
     private static Logger log = LoggerFactory.getLogger(UserBankRecordServiceImpl.class);
 
@@ -185,6 +188,9 @@ public class UserBankRecordServiceImpl extends ServiceImpl<UserBankRecordMapper,
 
     @Override
     public Boolean updateByEditBo(UserBankRecordEditBo bo) {
+        if(Validator.isEmpty(bo.getOrderGoodsId())){
+            throw new CustomException("OrderGoodsId缺失");
+        }
         UserBankRecord update = BeanUtil.toBean(bo, UserBankRecord.class);
         validEntityBeforeSave(update);
         update.setStatus(1);
@@ -198,6 +204,7 @@ public class UserBankRecordServiceImpl extends ServiceImpl<UserBankRecordMapper,
             userStudyRecord.setUserId(bo.getUserId());
             userStudyRecord.setGoodsId(bo.getGoodsId());
             userStudyRecord.setGradeId(bo.getGradeId());
+            userStudyRecord.setOrderGoodsId(bo.getOrderGoodsId());
             userStudyRecord.setStatus(1);
             iUserStudyRecordService.studyFinish(userStudyRecord);
         }
@@ -206,15 +213,20 @@ public class UserBankRecordServiceImpl extends ServiceImpl<UserBankRecordMapper,
 
     private void updateExam(UserBankRecordVo userBankRecordVo,UserBankRecord add) {
         //试卷及格绑定成绩和记录做题,待审,通过不记录
-
+        OrderGoods orderGoods = iOrderGoodsService.getOne(new LambdaQueryWrapper<OrderGoods>().eq(OrderGoods::getOrderGoodsId, userBankRecordVo.getOrderGoodsId()));
+        UserBankRecordVo bakVo =  BeanUtil.toBean(userBankRecordVo, UserBankRecordVo.class);
+        if(Validator.isEmpty(orderGoods.getSevenYear())){
+            bakVo.setOrderGoodsId(null);
+        }
         if(userBankRecordVo.getType()==1||userBankRecordVo.getType()==3){ //章卷 模块卷才进来
-            if (userStudyRecordMapper.selectStudyExamRecord(userBankRecordVo)  < 1 && Validator.isNotEmpty(add.getReportStatus())&& add.getReportStatus().equals(1)){
+            if (userStudyRecordMapper.selectStudyExamRecord(bakVo)  < 1 && Validator.isNotEmpty(add.getReportStatus())&& add.getReportStatus().equals(1)){
                 //增加一条审核记录
                 UserPeriod userPeriod = new UserPeriod();
                 userPeriod.setUserId(userBankRecordVo.getUserId());
                 userPeriod.setCourseId(userBankRecordVo.getCourseId());
                 userPeriod.setExamId(userBankRecordVo.getExamId());
                 userPeriod.setGoodsId(userBankRecordVo.getGoodsId());
+                userPeriod.setOrderGoodsId(userBankRecordVo.getOrderGoodsId());
                 if(userBankRecordVo.getType()==1){
                     userPeriod.setType(2);
                 }
@@ -250,7 +262,7 @@ public class UserBankRecordServiceImpl extends ServiceImpl<UserBankRecordMapper,
             }
 
             //待重修
-            if (userStudyRecordMapper.selectStudyExamRecordOr(userBankRecordVo) > 0 && add.getReportStatus().equals(1)){
+            if (userStudyRecordMapper.selectStudyExamRecordOr(bakVo) > 0 && add.getReportStatus().equals(1)){
                 //将待重修改为待审核
                 UserPeriodStatus userPeriodStatus = userStudyRecordMapper.selectStudyExamRecordCount(userBankRecordVo);
                 userPeriodStatus.setStatus(2);

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

@@ -127,13 +127,13 @@ public class UserStudyRecordPhotoServiceImpl extends ServiceImpl<UserStudyRecord
     }
 
     @Override
-    public List<String> selectGradePhoto(Long userId, Long gradeId) {
-        return this.baseMapper.selectGradePhoto(userId,gradeId);
+    public List<String> selectGradePhoto(Long userId, Long gradeId,Long orderGoodsId) {
+        return this.baseMapper.selectGradePhoto(userId,gradeId, orderGoodsId);
     }
 
     @Override
-    public List<String> selectGradePhotoWeek(Long userId, Long gradeId,Long searchWeekStartTime,Long searchWeekEndTime) {
-        return this.baseMapper.selectGradePhotoWeek(userId,gradeId,searchWeekStartTime,searchWeekEndTime);
+    public List<String> selectGradePhotoWeek(Long userId, Long gradeId,Long searchWeekStartTime,Long searchWeekEndTime,Long orderGoodsId) {
+        return this.baseMapper.selectGradePhotoWeek(userId,gradeId,searchWeekStartTime,searchWeekEndTime, orderGoodsId);
     }
 
     @Override

+ 174 - 14
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/impl/UserStudyRecordServiceImpl.java

@@ -17,10 +17,7 @@ import com.zhongzheng.common.utils.DateUtils;
 import com.zhongzheng.common.utils.ServletUtils;
 import com.zhongzheng.common.utils.ip.IpUtils;
 import com.zhongzheng.modules.course.bo.*;
-import com.zhongzheng.modules.course.domain.CourseBusiness;
-import com.zhongzheng.modules.course.domain.CourseMenuExam;
-import com.zhongzheng.modules.course.domain.CoursePhotoLog;
-import com.zhongzheng.modules.course.domain.CourseSection;
+import com.zhongzheng.modules.course.domain.*;
 import com.zhongzheng.modules.course.mapper.CourseChapterSectionMapper;
 import com.zhongzheng.modules.course.service.*;
 import com.zhongzheng.modules.course.vo.CourseChapterSectionVo;
@@ -28,6 +25,7 @@ import com.zhongzheng.modules.course.vo.CourseSectionVo;
 import com.zhongzheng.modules.course.vo.CourseVo;
 import com.zhongzheng.modules.goods.bo.GoodsCourseQueryBo;
 import com.zhongzheng.modules.goods.domain.Goods;
+import com.zhongzheng.modules.goods.domain.GoodsCourse;
 import com.zhongzheng.modules.goods.service.IGoodsCourseService;
 import com.zhongzheng.modules.goods.service.IGoodsService;
 import com.zhongzheng.modules.goods.vo.GoodsVo;
@@ -48,6 +46,8 @@ import com.zhongzheng.modules.inform.service.IInformRemindService;
 import com.zhongzheng.modules.inform.service.IInformUserService;
 import com.zhongzheng.modules.inform.vo.InformRemindBusinessVo;
 import com.zhongzheng.modules.inform.vo.InformRemindVo;
+import com.zhongzheng.modules.order.domain.OrderGoods;
+import com.zhongzheng.modules.order.service.IOrderGoodsService;
 import com.zhongzheng.modules.order.vo.OrderGoodsVo;
 import com.zhongzheng.modules.polyv.bo.PolyvLiveQueryBo;
 import com.zhongzheng.modules.polyv.service.IPolyvLiveService;
@@ -158,6 +158,12 @@ public class UserStudyRecordServiceImpl extends ServiceImpl<UserStudyRecordMappe
     @Autowired
     private IGoodsCourseService iGoodsCourseService;
 
+    @Autowired
+    private IOrderGoodsService iOrderGoodsService;
+
+    @Autowired
+    private ICourseMenuService iCourseMenuService;
+
     @Override
     public UserStudyRecordVo queryById(Long recordId) {
         UserStudyRecord db = this.baseMapper.selectById(recordId);
@@ -174,6 +180,7 @@ public class UserStudyRecordServiceImpl extends ServiceImpl<UserStudyRecordMappe
         lqw.eq(bo.getModuleId() != null, UserStudyRecord::getModuleId, bo.getModuleId());
         lqw.eq(bo.getChapterId() != null, UserStudyRecord::getChapterId, bo.getChapterId());
         lqw.eq(bo.getGradeId() != null, UserStudyRecord::getGradeId, bo.getGradeId());
+        lqw.eq(bo.getOrderGoodsId() != null, UserStudyRecord::getOrderGoodsId, bo.getOrderGoodsId());
         lqw.eq( UserStudyRecord::getCurrentStatus, 1);
         UserStudyRecord last = this.getOne(lqw.ge(UserStudyRecord::getFirstStartTime,0).last("limit 1"));
         if(Validator.isEmpty(last)){
@@ -222,7 +229,7 @@ public class UserStudyRecordServiceImpl extends ServiceImpl<UserStudyRecordMappe
             vo.setSectionType(sectionVo.getSectionType());
             vo.setLiveUrl(sectionVo.getLiveUrl());
             vo.setRecordingUrl(sectionVo.getRecordingUrl());
-            Integer learning = courseChapterSectionMapper.learningCheck(vo.getSectionId(), vo.getGradeId(), bo.getUserId(), vo.getModuleId(), vo.getChapterId(), 0L,vo.getCourseId());
+            Integer learning = courseChapterSectionMapper.learningCheck(vo.getSectionId(), vo.getGradeId(), bo.getUserId(), vo.getModuleId(), vo.getChapterId(), 0L,vo.getCourseId(),vo.getOrderGoodsId());
             if (learning > 0) {
                 vo.setLearning(1L);
             }
@@ -280,6 +287,10 @@ public class UserStudyRecordServiceImpl extends ServiceImpl<UserStudyRecordMappe
         lqw.eq(bo.getStudyDuration() != null, UserStudyRecord::getStudyDuration, bo.getStudyDuration());
         lqw.eq(bo.getStartTime() != null, UserStudyRecord::getStartTime, bo.getStartTime());
         lqw.eq(bo.getEndTime() != null, UserStudyRecord::getEndTime, bo.getEndTime());
+        lqw.eq(bo.getOrderGoodsId() != null, UserStudyRecord::getOrderGoodsId, bo.getOrderGoodsId());
+        lqw.eq(bo.getGradeId() != null, UserStudyRecord::getGradeId, bo.getGradeId());
+        lqw.eq(bo.getChapterId() != null, UserStudyRecord::getChapterId, bo.getChapterId());
+        lqw.eq(bo.getCurrentStatus() != null, UserStudyRecord::getCurrentStatus, bo.getCurrentStatus());
         return entity2Vo(this.list(lqw));
     }
 
@@ -348,7 +359,7 @@ public class UserStudyRecordServiceImpl extends ServiceImpl<UserStudyRecordMappe
         if(courseSectionVo.getSectionType()==1&&Validator.isNotEmpty(bo.getStatus())&&bo.getStatus()==1){
             if(Validator.isNotEmpty(goodsVo)){
                 if(Validator.isNotEmpty(fullName)){
-                    if(fullName.equals("继续教育二级建造师")||fullName.equals("继续教育二级造价师")||fullName.equals("考前培训七大员施工现场专业人员")){
+                    if(fullName.equals("继续教育二级建造师")||fullName.equals("继续教育二级造价师")||fullName.equals("考前培训七大员施工现场专业人员")||(fullName.contains("继续教育")&&fullName.contains("施工现场专业人员"))){
                         if(Validator.isNotEmpty(courseSectionVo.getDurationTime())||Validator.isNotEmpty(bo.getVideoCurrentTime())){
                             Long videoTime = 0L;
                             if(Validator.isNotEmpty(courseSectionVo.getDurationTime())&&courseSectionVo.getDurationTime().longValue()>0){
@@ -360,6 +371,9 @@ public class UserStudyRecordServiceImpl extends ServiceImpl<UserStudyRecordMappe
                             if(fullName.equals("考前培训七大员施工现场专业人员")){
                                 num = 3;
                             }
+                            if(fullName.contains("继续教育")&&fullName.contains("施工现场专业人员")){
+                                num =  (int)Math.ceil(videoTime.intValue()/(46*60));
+                            }
                             UserPeriodQueryBo userPeriodQueryBo2 = new UserPeriodQueryBo();
                             userPeriodQueryBo2.setSectionId(bo.getSectionId());
                             userPeriodQueryBo2.setCourseId(bo.getCourseId());
@@ -528,7 +542,7 @@ public class UserStudyRecordServiceImpl extends ServiceImpl<UserStudyRecordMappe
         }
 
         //新增学时记录,照片
-        userPeriodSave(add, bo);
+        userPeriodSave(add, bo,fullName);
         //判断有无学习结束
         studyFinish(add);
         //完成当天学习计划
@@ -539,12 +553,16 @@ public class UserStudyRecordServiceImpl extends ServiceImpl<UserStudyRecordMappe
 
     @Override
     public void studyFinish(UserStudyRecord bo) {
+        if(Validator.isEmpty(bo.getOrderGoodsId())){
+            throw new CustomException("OrderGoodsId缺失");
+        }
         //获得当前所在班级
         if (bo.getStatus() != null && bo.getStatus().equals(1)){
             ClassGradeUserQueryBo gradeUserQueryBo = new ClassGradeUserQueryBo();
             gradeUserQueryBo.setGoodsId(bo.getGoodsId());
             gradeUserQueryBo.setUserId(bo.getUserId());
             gradeUserQueryBo.setGradeId(bo.getGradeId());
+            gradeUserQueryBo.setOrderGoodsId(bo.getOrderGoodsId());
             ClassPeriodStudentVo classPeriodStudentVo = iClassGradeUserService.getUserPeriodStatus(gradeUserQueryBo);
             Integer gradePeriodStatus = classPeriodStudentVo.getGradePeriodStatus();
            /* Long secLong = 0L;
@@ -562,8 +580,10 @@ public class UserStudyRecordServiceImpl extends ServiceImpl<UserStudyRecordMappe
             //发送课时完成
             //获取旧信息
             ClassGradeUser gradeUser =iClassGradeUserService.getOne(new LambdaQueryWrapper<ClassGradeUser>()
-                    .eq(ClassGradeUser::getUserId,bo.getUserId()).eq(ClassGradeUser::getGradeId,bo.getGradeId()
-                    ).eq(ClassGradeUser::getStatus,1).eq(ClassGradeUser::getChangeGrade,0).eq(ClassGradeUser::getPeriodStatus,-1).last("limit 1"));
+                    .eq(ClassGradeUser::getUserId,bo.getUserId())
+                    .eq(ObjectUtils.isNotNull(bo.getOrderGoodsId()),ClassGradeUser::getOrderGoodsId, bo.getOrderGoodsId())
+                    .eq(ClassGradeUser::getGradeId,bo.getGradeId())
+                    .eq(ClassGradeUser::getStatus,1).eq(ClassGradeUser::getChangeGrade,0).eq(ClassGradeUser::getPeriodStatus,-1).last("limit 1"));
             //原本未审核才可进来
             if(Validator.isNotEmpty(gradeUser)&&gradeUser.getPeriodStatus()==-1){
                 //最新数据学完变为待审核
@@ -571,6 +591,7 @@ public class UserStudyRecordServiceImpl extends ServiceImpl<UserStudyRecordMappe
                     LambdaQueryWrapper<ClassGradeUser> classGradeUser = Wrappers.lambdaQuery();
                     classGradeUser.eq(ClassGradeUser::getUserId, bo.getUserId());
                     classGradeUser.eq(ClassGradeUser::getGradeId, bo.getGradeId());
+                    classGradeUser.eq(ObjectUtils.isNotNull(bo.getOrderGoodsId()),ClassGradeUser::getOrderGoodsId, bo.getOrderGoodsId());
                     ClassGradeUser classGradeUser1 = new ClassGradeUser();
                     classGradeUser1.setPeriodStatus(2);
                     classGradeUser1.setPeriodWaitTime(DateUtils.getNowTime());
@@ -590,12 +611,14 @@ public class UserStudyRecordServiceImpl extends ServiceImpl<UserStudyRecordMappe
                         editBo.setGoodsId(bo.getGoodsId());
                         editBo.setGradeId(bo.getGradeId());
                         editBo.setUserId(bo.getUserId());
+                        editBo.setOrderGoodsId(bo.getOrderGoodsId());
                         iUserPeriodService.editPeriodAll(editBo);
                         //复审
                         UserPeriodEditBo confirm = new UserPeriodEditBo();
                         confirm.setGoodsId(bo.getGoodsId());
                         confirm.setGradeId(bo.getGradeId());
                         confirm.setUserId(bo.getUserId());
+                        confirm.setOrderGoodsId(bo.getOrderGoodsId());
                         iUserPeriodService.confirmPeriod(confirm);
                         return;
                     }
@@ -733,6 +756,7 @@ public class UserStudyRecordServiceImpl extends ServiceImpl<UserStudyRecordMappe
             section.setGradeId(bo.getGradeId());
             section.setUserId(bo.getUserId());
             section.setCourseId(bo.getCourseId());
+            section.setOrderGoodsId(bo.getOrderGoodsId());
             section.setStudyStatus(baseMapper.getStudyStatus(section));
         }
         return sectionList;
@@ -740,7 +764,7 @@ public class UserStudyRecordServiceImpl extends ServiceImpl<UserStudyRecordMappe
 
     @Override
     public List<ClassPeriodVo> menuAllListWithExam(UserStudyRecordQueryBo bo) {
-        if(Validator.isEmpty(bo.getCourseId())){
+        if(Validator.isEmpty(bo.getCourseId())||Validator.isEmpty(bo.getOrderGoodsId())){
             throw new CustomException("参数缺失");
         }
         //存储整个目录节列表
@@ -825,6 +849,7 @@ public class UserStudyRecordServiceImpl extends ServiceImpl<UserStudyRecordMappe
             section.setGradeId(bo.getGradeId());
             section.setUserId(bo.getUserId());
             section.setCourseId(bo.getCourseId());
+            section.setOrderGoodsId(bo.getOrderGoodsId());
             if(section.getType()<4){
                 section.setStudyStatus(baseMapper.getStudyStatus(section));
             }else{
@@ -933,6 +958,7 @@ public class UserStudyRecordServiceImpl extends ServiceImpl<UserStudyRecordMappe
                 section.setGradeId(bo.getGradeId());
                 section.setUserId(bo.getUserId());
                 section.setCourseId(bo.getCourseId());
+                section.setOrderGoodsId(bo.getOrderGoodsId());
                 if(section.getType()<4){
                     section.setStudyStatus(baseMapper.getStudyStatus(section));
                 }else{
@@ -1005,7 +1031,7 @@ public class UserStudyRecordServiceImpl extends ServiceImpl<UserStudyRecordMappe
     public SectionStudyRecordVo getUserWatchLast(UserStudyRecordQueryBo bo) {
         SectionStudyRecordVo vo = this.baseMapper.getUserWatchLast(bo);
         if(Validator.isNotEmpty(vo)){
-            Integer learning = courseChapterSectionMapper.learningCheck(vo.getSectionId(), vo.getGradeId(), bo.getUserId(), vo.getModuleId(), vo.getChapterId(), 0L,vo.getCourseId());
+            Integer learning = courseChapterSectionMapper.learningCheck(vo.getSectionId(), vo.getGradeId(), bo.getUserId(), vo.getModuleId(), vo.getChapterId(), 0L,vo.getCourseId(),vo.getOrderGoodsId());
             if (learning > 0) {
                 vo.setLearning(1L);
             }
@@ -1018,7 +1044,7 @@ public class UserStudyRecordServiceImpl extends ServiceImpl<UserStudyRecordMappe
     public SectionStudyRecordVo getUserStudyLast(UserStudyRecordQueryBo bo) {
         SectionStudyRecordVo vo = this.baseMapper.getUserWatchLast(bo);
         if(Validator.isNotEmpty(vo)){
-            Integer learning = courseChapterSectionMapper.learningCheck(vo.getSectionId(), vo.getGradeId(), bo.getUserId(), vo.getModuleId(), vo.getChapterId(), 0L,vo.getCourseId());
+            Integer learning = courseChapterSectionMapper.learningCheck(vo.getSectionId(), vo.getGradeId(), bo.getUserId(), vo.getModuleId(), vo.getChapterId(), 0L,vo.getCourseId(),vo.getOrderGoodsId());
             if (learning > 0) {
                 vo.setLearning(1L);
             }
@@ -1208,6 +1234,132 @@ public class UserStudyRecordServiceImpl extends ServiceImpl<UserStudyRecordMappe
         return baseMapper.getStudyRecord(userId, gradeId, asc);
     }
 
+    @Transactional(rollbackFor = Exception.class)
+    @Override
+    public Integer syncSevenPublicClass(Long orderGoodsId,Long userId) {
+        if(Validator.isEmpty(orderGoodsId)||Validator.isEmpty(userId)){
+            throw new CustomException("参数错误");
+        }
+        OrderGoods newOrderGoods = iOrderGoodsService.getOne(new LambdaQueryWrapper<OrderGoods>().eq(OrderGoods::getOrderGoodsId, orderGoodsId));
+        if(newOrderGoods.getSevenClassStatus()==1||newOrderGoods.getSevenClassStatus()==2||newOrderGoods.getSevenClassStatus()==3){
+            return 0;
+        }
+        Goods goods = iGoodsService.getOne(new LambdaQueryWrapper<Goods>().eq(Goods::getGoodsId, newOrderGoods.getGoodsId()));
+        String fullName;
+        CourseBusinessQueryBo queryBusinessBo = new CourseBusinessQueryBo();
+        queryBusinessBo.setId(goods.getBusinessId());
+        fullName = iCourseBusinessService.queryFullName(queryBusinessBo);
+        if(!fullName.contains("继续教育")||!fullName.contains("施工现场专业人员")){
+            return 0;
+        }
+        if(Validator.isEmpty(newOrderGoods.getSevenYear())){
+            return 0;
+        }
+        OrderGoods oldOrderGoods = iOrderGoodsService.getSevenLastOne(goods.getProjectId(),newOrderGoods.getSevenYear(),userId);
+        if(Validator.isEmpty(oldOrderGoods)){
+            newOrderGoods.setSevenClassVersion(newOrderGoods.getSevenClassVersion()+1);
+            newOrderGoods.setSevenClassStatus(1);
+            newOrderGoods.setUpdateTime(DateUtils.getNowTime());
+            iOrderGoodsService.updateById(newOrderGoods);
+            return 1;
+        }
+        if(newOrderGoods.getSevenClassStatus()==4){
+            newOrderGoods.setSevenClassVersion(oldOrderGoods.getSevenClassVersion()+1);
+            newOrderGoods.setSevenClassStatus(1);
+            newOrderGoods.setUpdateTime(DateUtils.getNowTime());
+            iOrderGoodsService.updateById(newOrderGoods);
+            return 1;
+        }
+        UserStudyRecord userStudyRecord = baseMapper.getSevenStudyRecord(oldOrderGoods.getOrderGoodsId(),oldOrderGoods.getGradeId());
+        if(Validator.isEmpty(userStudyRecord)){
+            throw new CustomException("公共章学习数据错误");
+        }
+        LambdaQueryWrapper<GoodsCourse> lqwCourse = Wrappers.lambdaQuery();
+        lqwCourse.eq(GoodsCourse::getGoodsId, goods.getGoodsId());
+        List<GoodsCourse> courseList = iGoodsCourseService.list(lqwCourse);
+        Long courseId = null;
+        for(GoodsCourse course : courseList){
+            CourseMenu courseMenu = iCourseMenuService.getOne(new LambdaQueryWrapper<CourseMenu>().eq(CourseMenu::getCourseId, course.getCourseId())
+                    .eq(CourseMenu::getType, 2).eq(CourseMenu::getMenuId, userStudyRecord.getChapterId()).eq(CourseMenu::getParentId, 0));
+            if(Validator.isNotEmpty(courseMenu)){
+                courseId = course.getCourseId();
+            }
+        }
+        if(Validator.isEmpty(courseId)){
+            throw new CustomException("课程定位错误");
+        }
+        String key = "SYNC_SEVEN_Record:"+orderGoodsId;
+        Long keyStatus = redisCache.getCacheObject(key);
+        if(Validator.isNotEmpty(keyStatus)&&keyStatus==100L){
+            return 100;
+        }
+        redisCache.setCacheObject(key, 100L,5, TimeUnit.SECONDS);
+        LambdaQueryWrapper<UserStudyRecord> lqw = Wrappers.lambdaQuery();
+        lqw.eq(UserStudyRecord::getOrderGoodsId, userStudyRecord.getOrderGoodsId());
+        lqw.eq(UserStudyRecord::getGradeId, userStudyRecord.getGradeId());
+        lqw.eq(UserStudyRecord::getChapterId, userStudyRecord.getChapterId());
+        lqw.eq(UserStudyRecord::getCurrentStatus, 1);
+        List<UserStudyRecord> list = this.list(lqw);
+        for(UserStudyRecord vo : list){
+            UserStudyRecord copyVo = BeanUtil.toBean(vo, UserStudyRecord.class);
+            copyVo.setOrderGoodsId(newOrderGoods.getOrderGoodsId());
+            copyVo.setGradeId(newOrderGoods.getGradeId());
+            copyVo.setGoodsId(newOrderGoods.getGoodsId());
+            copyVo.setCourseId(courseId);
+            copyVo.setRecordId(null);
+            this.save(copyVo);
+            Long periodId = null;
+            UserPeriod copyUserPeriod = baseMapper.selectSevenUserPeriod(copyVo);
+            UserPeriodStatus copyUserPeriodStatus;
+            UserPeriod userPeriod = baseMapper.selectSevenUserPeriod(vo);
+            if(Validator.isEmpty(userPeriod)){
+                throw new CustomException("学时数据错误");
+            }
+            UserPeriodStatus userPeriodStatus = iUserPeriodStatusService.getOne(new LambdaQueryWrapper<UserPeriodStatus>()
+                    .eq(UserPeriodStatus::getPeriodId, userPeriod.getId())
+                    .eq(UserPeriodStatus::getStatus, 1)
+                    .eq(UserPeriodStatus::getPeriodStatus, 1));
+            if(Validator.isEmpty(copyUserPeriod)){
+                copyUserPeriod = BeanUtil.toBean(userPeriod, UserPeriod.class);
+                copyUserPeriod.setOrderGoodsId(newOrderGoods.getOrderGoodsId());
+                copyUserPeriod.setGradeId(newOrderGoods.getGradeId());
+                copyUserPeriod.setGoodsId(newOrderGoods.getGoodsId());
+                copyUserPeriod.setCourseId(courseId);
+                copyUserPeriod.setId(null);
+                iUserPeriodService.save(copyUserPeriod);
+
+                copyUserPeriodStatus = BeanUtil.toBean(userPeriodStatus, UserPeriodStatus.class);
+                copyUserPeriodStatus.setPeriodId(copyUserPeriod.getId());
+                copyUserPeriodStatus.setId(null);
+                iUserPeriodStatusService.save(copyUserPeriodStatus);
+            }else{
+                copyUserPeriodStatus = iUserPeriodStatusService.getOne(new LambdaQueryWrapper<UserPeriodStatus>()
+                        .eq(UserPeriodStatus::getPeriodId, copyUserPeriod.getId())
+                        .eq(UserPeriodStatus::getStatus, 1)
+                        .eq(UserPeriodStatus::getPeriodStatus, 1));
+            }
+            LambdaQueryWrapper<UserStudyRecordPhoto> lqwPhoto = Wrappers.lambdaQuery();
+            lqwPhoto.eq(UserStudyRecordPhoto::getPeriodId, userPeriodStatus.getId());
+            lqwPhoto.eq(UserStudyRecordPhoto::getRecordId, vo.getRecordId());
+            lqwPhoto.eq(UserStudyRecordPhoto::getStatus, 1);
+            List<UserStudyRecordPhoto> listPhoto = userStudyRecordPhotoService.list(lqwPhoto);
+            for(UserStudyRecordPhoto photo : listPhoto){
+                UserStudyRecordPhoto copyPhoto = BeanUtil.toBean(photo, UserStudyRecordPhoto.class);
+                copyPhoto.setRecordId(copyVo.getRecordId());
+                copyPhoto.setPeriodId(copyUserPeriodStatus.getId());
+                copyPhoto.setId(null);
+                userStudyRecordPhotoService.save(copyPhoto);
+            }
+        }
+        newOrderGoods.setSevenClassVersion(oldOrderGoods.getSevenClassVersion());
+        newOrderGoods.setSevenClassStatus(2);
+        newOrderGoods.setSevenClassCopy(oldOrderGoods.getOrderGoodsId());
+        newOrderGoods.setUpdateTime(DateUtils.getNowTime());
+        iOrderGoodsService.updateById(newOrderGoods);
+        redisCache.deleteObject(key);
+        return 2;
+    }
+
 
     /**
      * 获取最后一次看完的节
@@ -1248,11 +1400,15 @@ public class UserStudyRecordServiceImpl extends ServiceImpl<UserStudyRecordMappe
     }
 
 
-    private void userPeriodSave(UserStudyRecord entity, UserStudyRecordAddBo bo) {
+    private void userPeriodSave(UserStudyRecord entity, UserStudyRecordAddBo bo,String businessFullName) {
         //记录学时审核
         Long periodId = null;
+        UserStudyRecord bakStudyRecord =  BeanUtil.toBean(entity, UserStudyRecord.class);
+        if(!businessFullName.contains("继续教育")||!businessFullName.contains("施工现场专业人员")){
+            bakStudyRecord.setOrderGoodsId(null);
+        }
         // 学习无记录加一条学时审核记录
-        if (baseMapper.selectStudyRecord(entity) < 1) {
+        if ( baseMapper.selectStudyRecord(bakStudyRecord) < 1) {
             UserPeriod userPeriod = new UserPeriod();
             userPeriod.setUserId(entity.getUserId());
             userPeriod.setCourseId(entity.getCourseId());
@@ -1264,6 +1420,7 @@ public class UserStudyRecordServiceImpl extends ServiceImpl<UserStudyRecordMappe
             userPeriod.setModuleId(entity.getModuleId());
             userPeriod.setChapterId(entity.getChapterId());
             userPeriod.setGradeId(entity.getGradeId());
+            userPeriod.setOrderGoodsId(entity.getOrderGoodsId());
             iUserPeriodService.save(userPeriod);
             periodId = userPeriod.getId();
             UserPeriodStatus userPeriodStatusAddBo = new UserPeriodStatus();
@@ -1566,4 +1723,7 @@ public class UserStudyRecordServiceImpl extends ServiceImpl<UserStudyRecordMappe
     public SectionStudyRecordVo listExamRecord(SubjectStudyRecordQueryBo bo) {
         return this.baseMapper.listExamRecord(bo);
     }
+
+
+
 }

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

@@ -941,7 +941,7 @@ public class UserSubscribeServiceImpl extends ServiceImpl<UserSubscribeMapper, U
             Long goodsId = null;
             for (Long item : goodsIds) {
                 //获得当前所在班级
-                ClassGradeVo classGradeVo = courseMapper.gradeIdSelect(userId,item,null);
+                ClassGradeVo classGradeVo = courseMapper.gradeIdSelect(userId,item,null,null);
                 if(Validator.isEmpty(classGradeVo)||classGradeVo.getPeriodStatus()!=1){
                     continue;
                 }
@@ -964,7 +964,7 @@ public class UserSubscribeServiceImpl extends ServiceImpl<UserSubscribeMapper, U
 
             userSubscribeAddBo.setGoodsId(goodsId);
             //获得当前所在班级
-            ClassGradeVo classGradeVo = courseMapper.gradeIdSelect(userId,goodsId,null);
+            ClassGradeVo classGradeVo = courseMapper.gradeIdSelect(userId,goodsId,null,null);
             if(Validator.isEmpty(classGradeVo)||classGradeVo.getPeriodStatus()!=1){
                 userSubscribeImport.setCause("该学员学时审核未通过");
                 userSubscribeImports.add(userSubscribeImport);
@@ -1202,7 +1202,7 @@ public class UserSubscribeServiceImpl extends ServiceImpl<UserSubscribeMapper, U
             userSubscribeAddBo.setApplyId(applyId);
 
             //获得当前所在班级
-            ClassGradeVo classGradeVo = courseMapper.gradeIdSelect(userId,goodsId,null);
+            ClassGradeVo classGradeVo = courseMapper.gradeIdSelect(userId,goodsId,null,null);
             if(Validator.isEmpty(classGradeVo)||classGradeVo.getPeriodStatus()!=1){
                 userSubscribeImport.setCause("该学员学时审核未通过");
                 userSubscribeImports.add(userSubscribeImport);

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

@@ -1000,10 +1000,12 @@ public class WxPayServiceImpl implements IWxPayService {
     @Override
     public boolean joinLockGrade(String orderSn, Long goodsId, Long orderGoodsId) {
         GoodsVo goodsVo = iGoodsService.queryById(goodsId);
+        OrderGoods orderGoods = iOrderGoodsService.getById(orderGoodsId);
         if (goodsVo.getGoodsType().equals(1)) {
             LambdaQueryWrapper<ClassGradeUserTemp> lqwLock = new LambdaQueryWrapper<>();
             lqwLock.eq(ClassGradeUserTemp::getOrderSn, orderSn);
             lqwLock.eq(ClassGradeUserTemp::getGoodsId, goodsId);
+            lqwLock.eq(StringUtils.isNotBlank(orderGoods.getSevenYear()),ClassGradeUserTemp::getSevenYear,orderGoods.getSevenYear());
             lqwLock.eq(ClassGradeUserTemp::getStatus, ClassGradeUserTemp.STATUS_LOCK);
             ClassGradeUserTemp classGradeUserTemp = iClassGradeUserTempService.getOne(lqwLock);
             if (classGradeUserTemp != null) {

+ 2 - 0
zhongzheng-system/src/main/resources/mapper/modules/base/ShoppingCartMapper.xml

@@ -31,6 +31,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="classHours" column="class_hours"/>
         <result property="distributionCode" column="distribution_code"/>
         <result property="choiceStatus" column="choice_status"/>
+        <result property="sevenYear" column="seven_year"/>
     </resultMap>
 
     <select id="selectList" parameterType="com.zhongzheng.modules.base.bo.ShoppingCartQueryBo"  resultMap="ShoppingCartVoResult">
@@ -47,6 +48,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             g.goods_status,
             g.project_id,
             g.class_hours,
+            g.seven_year,
             ot.type AS template_type,
             cet.education_name,
             cpt.project_name,

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

@@ -32,6 +32,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="createTime" column="create_time"/>
         <result property="updateTime" column="update_time"/>
         <result property="importNo" column="import_no"/>
+        <result property="commonSign" column="common_sign"/>
         <collection property="businessList" column="chapter_id" select="findBusinessList"/>
         <collection property="moduleList" column="chapter_id" select="findModuleList"/>
         <collection property="courseList" column="chapter_id" select="findCourseList"/>

+ 5 - 0
zhongzheng-system/src/main/resources/mapper/modules/course/CourseChapterSectionMapper.xml

@@ -250,6 +250,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
           and up.chapter_id=#{chapterId}
           and up.course_id=#{courseId}
           and up.section_id=#{typeId}
+        and (up.order_goods_id=#{orderGoodsId} or up.order_goods_id is null )
             <if test="examId != null and examId > 0">
                 and up.exam_id=#{examId}
                 and up.`type` = 2
@@ -271,6 +272,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
           and usr.course_id=#{courseId}
           and usr.section_id=#{typeId}
           AND usr.current_status =1
+          and usr.order_goods_id=#{orderGoodsId}
     </select>
 
     <select id="learningExamCheck" parameterType="map"  resultType="integer">
@@ -285,6 +287,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
           AND ubr.course_id=#{courseId}
           AND ubr.chapter_id = #{chapterId}
           AND ubr.exam_id = #{examId}
+          AND ubr.order_goods_id = #{orderGoodsId}
           AND ubr.current_status = 1
           AND ubr.type = 1
         ORDER BY
@@ -305,6 +308,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
           AND ubr.chapter_id = #{chapterId}
           AND ubr.section_id = #{sectionId}
           AND ubr.exam_id = #{examId}
+          AND ubr.order_goods_id = #{orderGoodsId}
           AND ubr.current_status = 1
           AND ubr.type = 2
         ORDER BY
@@ -328,6 +332,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
           and up.exam_id=#{examId}
           AND ups.period_status =1
           and ups.`status` = 1
+          and (up.order_goods_id=#{orderGoodsId} or up.order_goods_id is null )
     </select>
 
     <delete id="deleteByIdAndTenant" parameterType="map" >

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

@@ -198,6 +198,8 @@
         <result property="orderGoodsId" column="order_goods_id"/>
         <result property="profileStatus" column="profile_status"/>
         <result property="profileTpStatus" column="profile_tp_status"/>
+        <result property="sevenYear" column="seven_year"/>
+        <result property="orderYear" column="order_year"/>
 
         <result property="subExamStatus" column="sub_exam_status"/>
         <result property="subPerformance" column="sub_performance"/>
@@ -531,6 +533,7 @@
         og.grade_id,
         og.service_start_time,
         og.service_end_time,
+        og.seven_year as order_year,
         cb.goods_learning_order,
         (SELECT cet.education_name FROM  course_education_type cet  where cet.id = g.education_type_id) as education_name,
         (SELECT cet.project_name FROM  course_project_type cet where cet.id = g.project_id) as project_name,
@@ -776,7 +779,7 @@
         m.type in (1,3)
         and c.goods_id = #{goodsId}) as exam_num,
         (SELECT COUNT(DISTINCT ubr.module_id,ubr.chapter_id,ubr.exam_id) FROM user_bank_record ubr LEFT JOIN class_grade_goods cgg on cgg.goods_id
-        = ubr.goods_id where ubr.`status`=1 and ubr.report_status=1 and ubr.grade_id = cg.grade_id and ubr.user_id = cgu.user_id and ubr.current_status = 1) as record_num,
+        = ubr.goods_id where ubr.`status`=1 and ubr.report_status=1 and ubr.grade_id = cg.grade_id and ubr.order_goods_id = cgu.order_goods_id and ubr.user_id = cgu.user_id and ubr.current_status = 1) as record_num,
             cgu.grade_id,
             cg.class_start_time,
             cg.class_end_time,
@@ -802,6 +805,9 @@
             1=1
         <if test="gradeId != null and gradeId != ''">
             and cg.grade_id = #{gradeId}
+        </if>
+        <if test="orderGoodsId != null and orderGoodsId != ''">
+            and cgu.order_goods_id = #{orderGoodsId}
         </if>
           and cg.`status` =1 and cgg.goods_id = #{goodsId} and cgu.change_grade = 0 and cgu.user_id=#{userId}
         order by cg.create_time desc LIMIT 1

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

@@ -56,6 +56,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="liveUrl" column="live_url"/>
         <result property="teacherName" column="teacher_name"/>
         <result property="goodsId" column="goods_id"/>
+        <result property="commonSign" column="common_sign"/>
     </resultMap>
 
     <select id="getList" parameterType="com.zhongzheng.modules.course.bo.CourseMenuQueryBo"  resultMap="CourseMenuResultVo">
@@ -152,6 +153,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                     cs.`name`
                 END menu_name,
             CASE
+                WHEN m.type = 1 THEN
+                    0
+                WHEN m.type = 2 THEN
+                    cc.common_sign
+                WHEN m.type = 3 THEN
+                    0
+                END common_sign,
+            CASE
 
                 WHEN m.type = 1 THEN
                     0
@@ -266,6 +275,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
           and up.course_id=#{courseId}
           and up.section_id=#{sectionId}
           AND ups.period_status =1
+          and (up.order_goods_id = #{orderGoodsId} or up.order_goods_id is null )
           and (ups.`status` = 0 or ups.`status` = 3)
     </select>
 
@@ -286,6 +296,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
           and up.chapter_id= #{chapterId}
           and up.course_id=#{courseId}
           and up.section_id=#{sectionId}
+          and (up.order_goods_id=#{orderGoodsId} or up.order_goods_id is null )
           AND ups.period_status =1
           and (ups.`status` = 0 or ups.`status` = 3)
     </select>
@@ -305,6 +316,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
           and up.section_id=#{sectionId}
           AND ups.period_status =1
           and ups.`status` = 1
+          and (up.order_goods_id=#{orderGoodsId} or up.order_goods_id is null )
     </select>
 
     <select id="rebuildChapterCheck" parameterType="map"  resultType="Integer">
@@ -335,6 +347,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
           AND up.module_id= #{moduleId}
           AND up.course_id=#{courseId}
           AND ups.period_status =1
+          and (up.order_goods_id=#{orderGoodsId} or up.order_goods_id is null )
           and (ups.`status` = 0 or ups.`status` = 3)
     </select>
     <select id="learningCheck" parameterType="map"  resultType="Integer">
@@ -351,6 +364,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
           and up.section_id=#{sectionId}
           and up.course_id=#{courseId}
           AND ups.period_status =1
+          and (up.order_goods_id=#{orderGoodsId} or up.order_goods_id is null )
           and ups.record_end_time is not null
     </select>
 

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

@@ -45,6 +45,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="doNum" column="do_num"/>
         <result property="type" column="type"/>
         <result property="typeId" column="type_id"/>
+        <result property="commonSign" column="common_sign"/>
     </resultMap>
 
     <select id="getListById" parameterType="Long"  resultMap="CourseModuleChapterResultVo">
@@ -100,6 +101,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         WHERE
         ubr.user_id = #{userId}
         AND ubr.exam_id = e.exam_id
+        AND order_goods_id = #{orderGoodsId}
         AND grade_id = #{gradeId} and `type` = 3) do_num,
         e.exam_id as type_id,
         #{gradeId} as grade_id,
@@ -114,7 +116,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         any_value ( ubr.performance ) performance,
         ubr.exam_id
         FROM
-        ( SELECT record_id, report_status, exam_id, performance FROM user_bank_record WHERE user_id = #{userId} AND grade_id = #{gradeId} and `type` = 3 ORDER BY record_id DESC LIMIT 9999 ) ubr
+        ( SELECT record_id, report_status, exam_id, performance FROM user_bank_record WHERE user_id = #{userId} AND grade_id = #{gradeId} AND order_goods_id = #{orderGoodsId} and `type` = 3 ORDER BY record_id DESC LIMIT 9999 ) ubr
         GROUP BY
         ubr.exam_id)ubr1 on e.exam_id = ubr1.exam_id
         where 1=1
@@ -133,6 +135,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             up.grade_id =#{gradeId}
           AND up.user_id = #{userId}
           AND up.module_id= #{moduleId}
+        and (up.order_goods_id=#{orderGoodsId} or up.order_goods_id is null )
         <if test="chapterId != null ">
           and up.chapter_id=#{chapterId}
         </if>

+ 2 - 1
zhongzheng-system/src/main/resources/mapper/modules/exam/ExamApplyMapper.xml

@@ -231,7 +231,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         order by ea.create_time desc
     </select>
 
-    <select id="countGradePeriod" parameterType="long" resultType="integer">
+    <select id="countGradePeriod" parameterType="com.zhongzheng.modules.exam.bo.ExamApplyQueryBo" resultType="integer">
         SELECT
             COUNT(cg.grade_id)
         FROM
@@ -241,6 +241,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             1 = 1
           AND cgu.user_id = #{userId}
           and cgu.grade_id = #{gradeId}
+          and cgu.order_goods_id = #{orderGoodsId}
           AND cgu.period_status = 1
           and cg.`status` =1
           and cgu.`status` =1

+ 18 - 1
zhongzheng-system/src/main/resources/mapper/modules/goods/GoodsMapper.xml

@@ -100,6 +100,7 @@
         <result property="specialGoods" column="special_goods"/>
         <result property="externalLink" column="external_link"/>
         <result property="externalLinkStatus" column="external_link_status"/>
+        <result property="sevenYear" column="seven_year"/>
 
         <result property="supplyName" column="supply_name"/>
         <result property="educationName" column="education_name"/>
@@ -141,6 +142,7 @@
         <result property="commitPeriodStatus" column="commit_period_status"/>
         <result property="commitPeriodRemark" column="commit_period_remark"/>
         <result property="gradeType" column="grade_type"/>
+        <result property="optionalYear" column="optional_year"/>
     </resultMap>
 
     <resultMap type="com.zhongzheng.modules.exam.vo.ExamNumberGoodsVo" id="ExamNumberGoodsVoResult">
@@ -587,9 +589,12 @@
                          LEFT JOIN class_grade_goods cgg on cgg.grade_id = cgu.grade_id
                          LEFT JOIN class_grade cg on cg.grade_id = cgu.grade_id
                 where cgu.user_id = #{userId}
+                  <if test="orderGoodsId != null and orderGoodsId != ''">
+                      and cgu.order_goods_id = #{orderGoodsId}
+                  </if>
                   and cgg.goods_id = g.goods_id
                   and cg.`status` = 1
-                  and unix_timestamp(now()) BETWEEN cg.class_start_time and cg.class_end_time)    as grade_id
+                  and unix_timestamp(now()) BETWEEN cg.class_start_time and cg.class_end_time limit 1)    as grade_id
         FROM goods g
                  LEFT JOIN pay_supply ps ON g.supply_id = ps.supply_id
                  LEFT JOIN course_education_type cet ON g.education_type_id = cet.id
@@ -939,4 +944,16 @@
         UPDATE goods SET handouts_id = #{handoutsId} WHERE goods_id = #{goodsId} and tenant_id = #{tenantId}
     </update>
 
+    <select id="getGoodsBusinessName" parameterType="java.lang.Long" resultType="java.lang.String">
+        SELECT
+            CONCAT( cet.education_name, cb.business_name, cpt.project_name )
+        FROM
+            goods g
+                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
+            g.goods_id = #{goodsId}
+    </select>
+
 </mapper>

+ 3 - 0
zhongzheng-system/src/main/resources/mapper/modules/grade/ClassGradeMapper.xml

@@ -200,6 +200,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="createTimeLong" column="createTimeLong"/>
         <result property="doTimeLong" column="doTimeLong"/>
         <result property="reportStatu" column="reportStatu"/>
+        <result property="finishStatus" column="finishStatus"/>
         <result property="studyQueueStatus" column="studyQueueStatus"/>
         <result property="applyTimeLong" column="applyTimeLong"/>
         <result property="userId" column="user_id"/>
@@ -947,6 +948,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             cg.class_start_time as createTimeLong,
             cgu.official_status_time as doTimeLong,
             cgu.official_status as reportStatu,
+            cgu.finish_status as finishStatus,
             cgu.period_plush as studyQueueStatus,
             cgu.period_wait_time as applyTimeLong,
             u.user_id,
@@ -1084,4 +1086,5 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <update id="UpGradeInterfaceByTenant" parameterType="com.zhongzheng.modules.grade.bo.ClassGradeOpenUpBo" >
         update class_grade set interface_push_id = #{interfacePushId} where grade_id = #{gradeId}
     </update>
+
 </mapper>

+ 103 - 34
zhongzheng-system/src/main/resources/mapper/modules/grade/ClassGradeUserMapper.xml

@@ -66,6 +66,7 @@
         <result property="toOldStatus" column="to_old_status"/>
         <result property="toOldResult" column="to_old_result"/>
         <result property="toOldTime" column="to_old_time"/>
+        <result property="orderGoodsId" column="order_goods_id"/>
     </resultMap>
 
 
@@ -130,6 +131,7 @@
         <result property="recordStartTime" column="record_start_time"/>
         <result property="recordEndTime" column="record_end_time"/>
         <result property="onLineTime" column="on_line_time"/>
+        <result property="orderGoodsId" column="order_goods_id"/>
     </resultMap>
 
     <resultMap type="com.zhongzheng.modules.grade.vo.ClassPeriodUserVo" id="ClassPeriodUserVo">
@@ -183,6 +185,7 @@
         <result property="realLiveStartTime" column="real_live_start_time"/>
         <result property="realLiveEndTime" column="real_live_end_time"/>
         <result property="realDuration" column="real_duration"/>
+        <result property="commonSign" column="common_sign"/>
     </resultMap>
 
     <resultMap type="com.zhongzheng.modules.grade.vo.ClassPeriodChapterVo" id="ClassPeriodChapterVo">
@@ -201,6 +204,7 @@
         <result property="sort" column="sort"/>
         <result property="doType" column="do_type"/>
         <result property="moduleId" column="module_id"/>
+        <result property="commonSign" column="common_sign"/>
     </resultMap>
 
     <resultMap type="com.zhongzheng.modules.grade.vo.ClassPeriodSectionVo" id="ClassPeriodSectionVo">
@@ -260,7 +264,7 @@
           AND g.change_grade = 0
         AND g.grade_id = #{gradeId}
         AND g.user_id = #{userId}
-
+        AND g.order_goods_id = #{orderGoodsId}
     </select>
 
     <select id="select" parameterType="com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo"
@@ -349,6 +353,9 @@
         <if test="educationTypeId != null and educationTypeId != ''">
             AND g.education_type_id = #{educationTypeId}
         </if>
+        <if test="projectId != null and projectId != ''">
+            AND g.project_id = #{projectId}
+        </if>
         <if test="realname != null and realname != ''">
             AND u.realname like concat('%', #{realname}, '%')
         </if>
@@ -391,6 +398,7 @@
         cgu.period_plush,
         cgu.period_status_num,
         cgu.period_time,
+        cgu.order_goods_id,
         IFNULL(ge.exam_num,0) as exam_num,
         <if test="userPhoto != null and userPhoto == 1">
             up.key_value,
@@ -398,9 +406,9 @@
         cgu.period_wait_time as end_time,
         (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.grade_id = cgu.grade_id and ubr.user_id = cgu.user_id and ubr.current_status = 1) as record_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.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 = (SELECT cgg.goods_id FROM class_grade_goods cgg where cg.grade_id=cgg.grade_id) and up.grade_id = cgu.grade_id and up.user_id = u.user_id
+            ,(select COUNT(up.id) from user_period up LEFT JOIN user_period_status ups on up.id=ups.period_id where up.goods_id = (SELECT cgg.goods_id FROM class_grade_goods cgg where cg.grade_id=cgg.grade_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
@@ -440,6 +448,9 @@
         <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>
@@ -557,6 +568,7 @@
         cgu.period_plush,
         cgu.period_status_num,
         cgu.period_time,
+        cgu.order_goods_id,
         <if test="userPhoto != null and userPhoto == 1">
             up.key_value,
         </if>
@@ -680,6 +692,7 @@
         cg.class_name,
         cgu.period_plush,
         cgu.period_status_num,
+        cgu.order_goods_id,
         (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,
         <if test="userPhoto != null and userPhoto == 1">
@@ -772,7 +785,7 @@
         g.study_start_time,
         g.study_end_time,
         (SELECT COUNT(DISTINCT ubr.module_id,ubr.chapter_id,ubr.exam_id) FROM user_bank_record ubr LEFT JOIN class_grade_goods cgg on cgg.goods_id
-        = ubr.goods_id where ubr.`status`=1 and ubr.report_status=1 and ubr.`type` in (1,3) and ubr.grade_id = cg.grade_id and ubr.user_id = cgu.user_id and ubr.current_status = 1) as record_num,
+        = ubr.goods_id where ubr.`status`=1 and ubr.report_status=1 and ubr.`type` in (1,3) and ubr.grade_id = cg.grade_id and ubr.order_goods_id = cgu.order_goods_id and ubr.user_id = cgu.user_id and ubr.current_status = 1) as record_num,
         cgu.user_id,
         cgg.goods_id
         FROM
@@ -799,6 +812,9 @@
         <if test="userId != null ">
             and cgu.user_id = #{userId}
         </if>
+        <if test="orderGoodsId != null ">
+            and cgu.order_goods_id = #{orderGoodsId}
+        </if>
         LIMIT 1
     </select>
 
@@ -824,26 +840,26 @@
         cgu.order_goods_id,
         (SELECT COUNT(m.id) FROM course_menu_exam m LEFT JOIN goods_course c on m.course_id=c.course_id LEFT JOIN
         class_grade_goods cgg on cgg.goods_id = c.goods_id where cg.grade_id=cgg.grade_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.report_status =1 and ubr.user_id=#{userId} and ubr.grade_id=cgu.grade_id and ubr.current_status=1) as record_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.report_status =1 and ubr.user_id=#{userId} and ubr.grade_id=cgu.grade_id and ubr.order_goods_id=cgu.order_goods_id and ubr.current_status=1) as record_num,
         (SELECT COUNT(DISTINCT up.course_id,up.module_id,up.chapter_id,up.section_id) FROM user_period up LEFT JOIN user_period_status ups on up.id = ups.period_id where
-        ups.`status` =1 and ups.period_status = 1 and up.goods_id=#{goodsId} and up.user_id = #{userId} and up.grade_id = cgu.grade_id and up.`type` = 1) as pass,
+        ups.`status` =1 and ups.period_status = 1 and up.goods_id=#{goodsId} and up.user_id = #{userId} and up.grade_id = cgu.grade_id and up.order_goods_id=cgu.order_goods_id and up.`type` = 1) as pass,
         (SELECT COUNT(DISTINCT up.course_id,up.module_id,up.chapter_id,up.section_id) FROM user_period up LEFT JOIN user_period_status ups on up.id = ups.period_id where
-        ups.`status` =2 and up.grade_id = cg.grade_id  and ups.period_status = 1 and up.goods_id=#{goodsId} and up.grade_id = cg.grade_id and up.user_id = #{userId} and up.`type` = 1) as pending,
+        ups.`status` =2 and up.grade_id = cg.grade_id  and ups.period_status = 1 and up.goods_id=#{goodsId} and up.grade_id = cg.grade_id and up.order_goods_id=cgu.order_goods_id and up.user_id = #{userId} and up.`type` = 1) as pending,
         (SELECT
         COUNT(DISTINCT up.course_id,up.module_id,up.chapter_id,up.section_id) FROM user_period up LEFT JOIN user_period_status ups on up.id = ups.period_id where ups.`status`
-        =0 and ups.period_status = 1 and up.goods_id=#{goodsId} and up.grade_id = cg.grade_id and  up.user_id = #{userId} and up.`type` = 1) as cheat,
+        =0 and ups.period_status = 1 and up.goods_id=#{goodsId} and up.grade_id = cg.grade_id and up.order_goods_id=cgu.order_goods_id and  up.user_id = #{userId} and up.`type` = 1) as cheat,
         (SELECT COUNT(DISTINCT up.course_id,up.module_id,up.chapter_id,up.section_id) FROM user_period up LEFT JOIN user_period_status ups on up.id = ups.period_id where
-        ups.`status` =1 and ups.period_status = 1 and up.goods_id=#{goodsId} and up.user_id = #{userId} and up.grade_id = cg.grade_id and up.`type` in (2,3)) as exam_pass,
+        ups.`status` =1 and ups.period_status = 1 and up.goods_id=#{goodsId} and up.user_id = #{userId} and up.order_goods_id=cgu.order_goods_id and up.grade_id = cg.grade_id and up.`type` in (2,3)) as exam_pass,
         (SELECT
         COUNT(DISTINCT up.course_id,up.module_id,up.chapter_id,up.section_id) FROM user_period up LEFT JOIN user_period_status ups on up.id = ups.period_id where ups.`status`
-        =0 and ups.period_status = 1 and up.goods_id=#{goodsId} and up.grade_id = cg.grade_id and up.user_id = #{userId} and up.`type`  in (2,3)) as exam_cheat,
+        =0 and ups.period_status = 1 and up.goods_id=#{goodsId} and up.grade_id = cg.grade_id and up.order_goods_id=cgu.order_goods_id and up.user_id = #{userId} and up.`type`  in (2,3)) as exam_cheat,
         (SELECT
         COUNT(DISTINCT up.course_id,up.module_id,up.chapter_id,up.section_id) FROM user_period up LEFT JOIN user_period_status ups on up.id = ups.period_id where ups.`status`
-        =2 and ups.period_status = 1 and up.goods_id=#{goodsId} and up.grade_id = cg.grade_id and up.user_id = #{userId} and up.`type`  in (2,3)) as exam_pending,
+        =2 and ups.period_status = 1 and up.goods_id=#{goodsId} and up.grade_id = cg.grade_id and up.order_goods_id=cgu.order_goods_id and up.user_id = #{userId} and up.`type`  in (2,3)) as exam_pending,
         (SELECT up.key_value FROM user_profile up where up.goods_id = #{goodsId} and up.user_id =#{userId} and up.order_goods_id = cgu.order_goods_id and up.current_status = 1 and up.`status` = 1 and up.type_status =1 LIMIT 1) as key_value
         <if test="userId != null and userId !='' ">
-            ,(SELECT MIN(first_start_time) from user_study_record where user_id = #{userId} and grade_id = #{gradeId}) as study_start_time,
-            (SELECT MAX(end_time) from user_study_record where user_id = #{userId} and grade_id = #{gradeId}) as study_end_time
+            ,(SELECT MIN(first_start_time) from user_study_record where user_id = #{userId} and grade_id = #{gradeId} and order_goods_id=#{orderGoodsId}) as study_start_time,
+            (SELECT MAX(end_time) from user_study_record where user_id = #{userId} and grade_id = #{gradeId} and order_goods_id=#{orderGoodsId}) as study_end_time
         </if>
         FROM
         class_grade_user cgu
@@ -861,6 +877,9 @@
         <if test="periodStatus != null and periodStatus !='' ">
             and cgu.period_status = #{periodStatus}
         </if>
+        <if test="orderGoodsId != null and orderGoodsId !='' ">
+            and cgu.order_goods_id = #{orderGoodsId}
+        </if>
         LIMIT 1
     </select>
 
@@ -879,6 +898,7 @@
         and u.user_id = #{userId}
     </if>) as user_id,
         (SELECT cm.module_name FROM course_module cm where cm.menu_id = cm.module_id) as type_name,
+        0 as common_sign,
         (SELECT COUNT(ccs.section_id) FROM course_chapter_section ccs LEFT JOIN course_module_chapter cmc on
         cmc.chapter_id=ccs.chapter_id where cmc.module_id=cm.menu_id) as class_hours,
         1 as type,
@@ -908,13 +928,14 @@
         and u.user_id = #{userId}
     </if>) as user_id,
         (SELECT cc.`name` FROM course_chapter cc where cm.menu_id = cc.chapter_id) as type_name,
+        (SELECT cc.common_sign FROM course_chapter cc where cm.menu_id = cc.chapter_id) as common_sign,
         (SELECT COUNT(ccs.section_id) FROM course_chapter_section ccs where ccs.chapter_id=cm.menu_id) as class_hours,
         2 as type,
         (SELECT usr.create_time FROM user_study_record usr LEFT JOIN course_chapter_section ccs on usr.section_id =
-        ccs.section_id and ccs.chapter_id = usr.chapter_id where ccs.chapter_id = cm.menu_id AND usr.current_status = 1 AND usr.user_id=#{userId} and usr.course_id = cm.course_id and usr.goods_id = gc.goods_id and usr.grade_id = #{gradeId} ORDER BY usr.create_time ASC
+        ccs.section_id and ccs.chapter_id = usr.chapter_id where ccs.chapter_id = cm.menu_id AND usr.current_status = 1 AND usr.user_id=#{userId} and usr.course_id = cm.course_id and usr.goods_id = gc.goods_id and usr.grade_id = #{gradeId} and usr.order_goods_id = #{orderGoodsId} ORDER BY usr.create_time ASC
         limit 1) as study_start_time,
         (SELECT usr.update_time FROM user_study_record usr LEFT JOIN course_chapter_section ccs on usr.section_id =
-        ccs.section_id and ccs.chapter_id = usr.chapter_id where ccs.chapter_id = cm.menu_id AND usr.current_status = 1 AND usr.user_id=#{userId} and usr.course_id = cm.course_id and usr.goods_id = gc.goods_id and usr.grade_id = #{gradeId} ORDER BY usr.create_time DESC
+        ccs.section_id and ccs.chapter_id = usr.chapter_id where ccs.chapter_id = cm.menu_id AND usr.current_status = 1 AND usr.user_id=#{userId} and usr.course_id = cm.course_id and usr.goods_id = gc.goods_id and usr.grade_id = #{gradeId} and usr.order_goods_id = #{orderGoodsId} ORDER BY usr.create_time DESC
         limit 1) as study_end_time
         FROM
         course_menu cm
@@ -962,7 +983,7 @@
         <if test="goodsId != null and goodsId !='' ">
             and gc.goods_id = #{goodsId}
         </if>
-        <if test="courseId != null and courseId !='' ">
+        <if test="courseId != null  ">
             and gc.course_id=#{courseId}
         </if>
         AND cm.type=3
@@ -1077,6 +1098,7 @@
         SELECT
         cmc.sort,
         cc.chapter_id as id,
+        cc.common_sign,
         cm.course_id,
         ( SELECT u.realname FROM `user` u WHERE 1=1 <if test="userId != null and userId !='' ">
         and u.user_id = #{userId}
@@ -1097,10 +1119,10 @@
         WHERE
         ccs.chapter_id = cc.chapter_id
         AND usr.current_status = 1
-        <if test="courseId != null and courseId !='' ">
+        <if test="courseId != null ">
             AND usr.course_id=#{courseId}
         </if>
-        <if test="moduleId != null and moduleId !='' ">
+        <if test="moduleId != null">
             AND usr.module_id=#{moduleId}
         </if>
         <if test="goodsId != null and goodsId !='' ">
@@ -1112,6 +1134,9 @@
         <if test="userId != null and userId !='' ">
             AND usr.user_id=#{userId}
         </if>
+        <if test="orderGoodsId != null and orderGoodsId !='' ">
+            AND usr.order_goods_id=#{orderGoodsId}
+        </if>
         ORDER BY
         usr.create_time ASC
         LIMIT 1
@@ -1125,10 +1150,10 @@
         WHERE
         ccs.chapter_id = cc.chapter_id
         AND usr.current_status = 1
-        <if test="courseId != null and courseId !='' ">
+        <if test="courseId != null ">
             AND usr.course_id=#{courseId}
         </if>
-        <if test="moduleId != null and moduleId !='' ">
+        <if test="moduleId != null">
             AND usr.module_id=#{moduleId}
         </if>
         <if test="goodsId != null and goodsId !='' ">
@@ -1140,6 +1165,9 @@
         <if test="userId != null and userId !='' ">
             AND usr.user_id=#{userId}
         </if>
+        <if test="orderGoodsId != null and orderGoodsId !='' ">
+            AND usr.order_goods_id=#{orderGoodsId}
+        </if>
         ORDER BY
         usr.create_time DESC
         LIMIT 1
@@ -1153,21 +1181,24 @@
         WHERE 1=1
         AND ubr.current_status = 1
         AND ubr.report_status = 1
-        <if test="moduleId != null and moduleId !='' ">
+        <if test="moduleId != null ">
             AND ubr.module_id=#{moduleId}
         </if>
-        <if test="goodsId != null and goodsId !='' ">
+        <if test="goodsId != null">
             AND ubr.goods_id=#{goodsId}
         </if>
-        <if test="moduleId != null and moduleId !='' ">
+        <if test="moduleId != null ">
             AND cme.module_id=#{moduleId}
         </if>
-        <if test="courseId != null and courseId !='' ">
+        <if test="courseId != null">
             AND cme.course_id =#{courseId}
         </if>
         <if test="userId != null and userId !='' ">
             AND ubr.user_id=#{userId}
         </if>
+        <if test="orderGoodsId != null and orderGoodsId !='' ">
+            AND ubr.order_goods_id=#{orderGoodsId}
+        </if>
         AND cme.chapter_id = cmc.chapter_id
         LIMIT 1 ) AS performance
         FROM
@@ -1176,10 +1207,10 @@
         LEFT JOIN course_chapter cc ON cmc.chapter_id = cc.chapter_id
         WHERE
         1 = 1
-        <if test="moduleId != null and moduleId !='' ">
+        <if test="moduleId != null ">
             AND cmc.module_id=#{moduleId}
         </if>
-        <if test="courseId != null and courseId !='' ">
+        <if test="courseId != null">
             AND cm.course_id =#{courseId}
         </if>
     </select>
@@ -1208,13 +1239,13 @@
         LEFT JOIN exam e ON cme.exam_id = e.exam_id
         WHERE 1=1
         AND  cme.type=1
-        <if test="courseId != null and courseId !='' ">
+        <if test="courseId != null">
             AND  cme.course_id=#{courseId}
         </if>
-        <if test="chapterId != null and chapterId !='' ">
+        <if test="chapterId != null">
             AND cme.chapter_id =#{chapterId}
         </if>
-        <if test="moduleId != null and moduleId !='' ">
+        <if test="moduleId != null">
             AND cme.module_id =#{moduleId}
         </if>
     </select>
@@ -1242,10 +1273,10 @@
         LEFT JOIN exam e ON cme.exam_id = e.exam_id
         WHERE 1=1
         AND  cme.type=3
-        <if test="courseId != null and courseId !='' ">
+        <if test="courseId != null">
             AND  cme.course_id=#{courseId}
         </if>
-        <if test="moduleId != null and moduleId !='' ">
+        <if test="moduleId != null">
             AND cme.module_id =#{moduleId}
         </if>
     </select>
@@ -1278,7 +1309,7 @@
         LEFT JOIN course_section cs ON ccs.section_id = cs.section_id
         WHERE
         1 = 1
-        <if test="chapterId != null and chapterId !='' ">
+        <if test="chapterId != null">
             AND ccs.chapter_id = #{chapterId}
         </if>
         ORDER BY
@@ -1309,10 +1340,10 @@
         WHERE 1=1
         and cme.module_id =0
         and cme.type =1
-        <if test="courseId != null and courseId !='' ">
+        <if test="courseId != null">
             AND  cme.course_id=#{courseId}
         </if>
-        <if test="chapterId != null and chapterId !='' ">
+        <if test="chapterId != null ">
             AND cme.chapter_id = #{chapterId}
         </if>
     </select>
@@ -1590,6 +1621,9 @@
             usr.current_status = 1
           AND usr.user_id = #{userId}
           AND usr.grade_id = #{gradeId}
+        <if test="orderGoodsId != null and orderGoodsId !='' ">
+            AND usr.order_goods_id = #{orderGoodsId}
+        </if>
           AND P.create_time IS NOT NULL
         ORDER BY
             P.create_time
@@ -1606,9 +1640,44 @@
             1 = 1
           AND up.user_id = #{userId}
           AND up.grade_id = #{gradeId}
+         <if test="orderGoodsId != null and orderGoodsId !='' ">
+          AND up.order_goods_id = #{orderGoodsId}
+         </if>
           AND ups.period_status = 1
         ORDER BY
             ups.record_end_time DESC
             LIMIT 1
     </select>
+
+    <select id="getClassInfoByUser" parameterType="java.lang.Long" resultType="com.zhongzheng.modules.grade.domain.ClassGradeUser">
+        SELECT
+            cgu.*
+        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_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
+                cgu.`status` = 1
+                AND INSTR( CONCAT( cet.education_name, cb.business_name, cpt.project_name ), "继续教育" ) > 0
+                AND INSTR( CONCAT( cet.education_name, cb.business_name, cpt.project_name ), "施工现场专业人员" ) > 0
+                AND og.`status` = 1
+                AND og.refund_status != 2
+	            AND og.pay_status IN ( 2, 3, 4 )
+	            AND cgu.period_status != 1
+	            AND cgu.finish_status = 0
+	            AND (
+	            SELECT
+	            	COUNT( usr.record_id )
+	            FROM
+	            	user_study_record usr
+	            WHERE
+	            	usr.order_goods_id = cgu.order_goods_id
+	            	AND usr.user_id = cgu.user_id
+	            	AND usr.current_status = 1
+	            ) > 0
+	            AND cgu.user_id = #{userId}
+    </select>
 </mapper>

+ 1 - 0
zhongzheng-system/src/main/resources/mapper/modules/grade/UserPeriodMapper.xml

@@ -16,6 +16,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="updateTime" column="update_time"/>
         <result property="moduleId" column="module_id"/>
         <result property="chapterId" column="chapter_id"/>
+        <result property="orderGoodsId" column="order_goods_id"/>
     </resultMap>
 
     <select id="checkGoodsChange" parameterType="com.zhongzheng.modules.grade.bo.UserPeriodQueryBo" resultType="Long">

+ 3 - 1
zhongzheng-system/src/main/resources/mapper/modules/grade/UserPeriodStatusMapper.xml

@@ -68,7 +68,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <if test="moduleId != null ">
             and up.module_id = #{moduleId}
         </if>
-
+        <if test="orderGoodsId != null ">
+            and (up.order_goods_id = #{orderGoodsId} or up.order_goods_id is NULL )
+        </if>
         <if test="chapterId != null">
             and up.chapter_id = #{chapterId}
         </if>

Some files were not shown because too many files changed in this diff