he2802 2 years ago
parent
commit
a41e54c683
100 changed files with 2662 additions and 135 deletions
  1. 28 2
      zhongzheng-admin/src/main/java/com/zhongzheng/controller/common/CommonController.java
  2. 25 0
      zhongzheng-admin/src/main/java/com/zhongzheng/controller/course/CourseController.java
  3. 20 0
      zhongzheng-admin/src/main/java/com/zhongzheng/controller/goods/GoodsController.java
  4. 24 0
      zhongzheng-admin/src/main/java/com/zhongzheng/controller/grade/ClassGradeController.java
  5. 1 1
      zhongzheng-admin/src/main/java/com/zhongzheng/controller/order/OrderBusinessConfigController.java
  6. 8 0
      zhongzheng-admin/src/main/java/com/zhongzheng/controller/schedule/ScheduleController.java
  7. 3 1
      zhongzheng-admin/src/main/resources/application-dev.yml
  8. 2 0
      zhongzheng-admin/src/main/resources/application-pre.yml
  9. 2 0
      zhongzheng-admin/src/main/resources/application-prod.yml
  10. 2 0
      zhongzheng-admin/src/main/resources/application.yml
  11. 79 0
      zhongzheng-api/src/main/java/com/zhongzheng/controller/bank/ExamTempController.java
  12. 95 30
      zhongzheng-api/src/main/java/com/zhongzheng/controller/bank/QuestionController.java
  13. 10 0
      zhongzheng-api/src/main/java/com/zhongzheng/controller/cmmon/CommonBankController.java
  14. 20 0
      zhongzheng-api/src/main/java/com/zhongzheng/controller/cmmon/CommonController.java
  15. 42 1
      zhongzheng-api/src/main/java/com/zhongzheng/controller/goods/GoodsController.java
  16. 10 0
      zhongzheng-api/src/main/java/com/zhongzheng/controller/polyv/PolyvVideoController.java
  17. 2 0
      zhongzheng-api/src/main/resources/application-dev.yml
  18. 2 0
      zhongzheng-api/src/main/resources/application-pre.yml
  19. 2 0
      zhongzheng-api/src/main/resources/application-prod.yml
  20. 2 0
      zhongzheng-api/src/main/resources/application.yml
  21. 23 0
      zhongzheng-common/src/main/java/com/zhongzheng/common/utils/DateUtils.java
  22. 3 0
      zhongzheng-framework/src/main/java/com/zhongzheng/framework/web/service/UserServiceImpl.java
  23. 108 5
      zhongzheng-framework/src/main/java/com/zhongzheng/framework/web/service/WxLoginService.java
  24. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/bo/ExamQueryBo.java
  25. 47 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/bo/ExamTempAddBo.java
  26. 56 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/bo/ExamTempEditBo.java
  27. 59 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/bo/ExamTempQueryBo.java
  28. 30 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/bo/ExamTempQuestionAddBo.java
  29. 37 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/bo/ExamTempQuestionEditBo.java
  30. 48 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/bo/ExamTempQuestionQueryBo.java
  31. 49 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/domain/ExamTemp.java
  32. 35 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/domain/ExamTempQuestion.java
  33. 1 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/mapper/ExamQuestionMapper.java
  34. 20 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/mapper/ExamTempMapper.java
  35. 14 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/mapper/ExamTempQuestionMapper.java
  36. 4 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/mapper/QuestionMapper.java
  37. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/IExamQuestionService.java
  38. 52 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/IExamTempQuestionService.java
  39. 57 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/IExamTempService.java
  40. 14 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/IQuestionService.java
  41. 5 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/impl/ExamQuestionServiceImpl.java
  42. 23 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/impl/ExamServiceImpl.java
  43. 98 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/impl/ExamTempQuestionServiceImpl.java
  44. 172 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/impl/ExamTempServiceImpl.java
  45. 10 2
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/impl/QuestionChapterServiceImpl.java
  46. 12 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/impl/QuestionModuleServiceImpl.java
  47. 195 2
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/impl/QuestionServiceImpl.java
  48. 39 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/vo/ExamTempQuestionVo.java
  49. 64 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/vo/ExamTempVo.java
  50. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/vo/ExamVo.java
  51. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/vo/QuestionModuleVo.java
  52. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/collect/bo/CollectQuestionAddBo.java
  53. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/collect/bo/CollectQuestionEditBo.java
  54. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/collect/bo/CollectQuestionQueryBo.java
  55. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/collect/domain/CollectQuestion.java
  56. 1 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/collect/service/impl/CollectQuestionServiceImpl.java
  57. 4 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/collect/vo/CollectQuestionVo.java
  58. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/bo/CourseQueryBo.java
  59. 11 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseChapterServiceImpl.java
  60. 12 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseModuleServiceImpl.java
  61. 12 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseSectionServiceImpl.java
  62. 8 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseServiceImpl.java
  63. 20 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/bo/ExamTodayRecordBo.java
  64. 5 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/mapper/ExamPaperMapper.java
  65. 4 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/service/IExamPaperService.java
  66. 2 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/service/impl/ExamApplyServiceImpl.java
  67. 10 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/service/impl/ExamPaperServiceImpl.java
  68. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/vo/ExamPaperVo.java
  69. 41 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/bo/BankGoodsExamAddBo.java
  70. 45 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/bo/SpecialExamRecordAddBo.java
  71. 40 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/bo/SpecialExamRecordQuery.java
  72. 26 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/bo/TodayExamSubscriptionBo.java
  73. 24 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/bo/TodayExamTobVo.java
  74. 36 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/bo/TodayExamWeekRecordDetailVo.java
  75. 26 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/bo/TodayExamWeekRecordVo.java
  76. 48 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/domain/GoodsExamTime.java
  77. 14 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/mapper/GoodsExamTimeMapper.java
  78. 14 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/IGoodsExamTimeService.java
  79. 1 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/IGoodsService.java
  80. 18 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/impl/GoodsExamTimeServiceImpl.java
  81. 42 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/impl/GoodsServiceImpl.java
  82. 69 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/vo/BankGoodsExamVo.java
  83. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/vo/GoodsAttachedVo.java
  84. 51 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/vo/GoodsExamTimeVo.java
  85. 4 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/vo/GoodsUserQuestionVo.java
  86. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/vo/GoodsUserVo.java
  87. 6 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/vo/GoodsVo.java
  88. 45 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/vo/SpecialExamRecordVo.java
  89. 6 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/bo/ClassGradeUserQueryBo.java
  90. 10 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/bo/UserPeriodQueryBo.java
  91. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/mapper/UserPeriodMapper.java
  92. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/IClassGradeUserService.java
  93. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/IUserPeriodService.java
  94. 68 6
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/impl/ClassGradeUserServiceImpl.java
  95. 195 81
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/impl/UserPeriodServiceImpl.java
  96. 4 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/vo/ClassPeriodStudentVo.java
  97. 0 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/vo/ClassPeriodVo.java
  98. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/vo/SyncUserChapterList.java
  99. 6 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/vo/SyncUserCourseStudyRec.java
  100. 40 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/order/bo/OrderShareMoneyAddBo.java

+ 28 - 2
zhongzheng-admin/src/main/java/com/zhongzheng/controller/common/CommonController.java

@@ -1,6 +1,7 @@
 package com.zhongzheng.controller.common;
 
 import cn.hutool.core.util.StrUtil;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.zhongzheng.common.config.RuoYiConfig;
 import com.zhongzheng.common.constant.Constants;
 import com.zhongzheng.common.core.domain.AjaxResult;
@@ -22,11 +23,15 @@ import com.zhongzheng.modules.grade.service.IUserPeriodService;
 import com.zhongzheng.modules.grade.vo.ClassPeriodStudentExportAllVo;
 import com.zhongzheng.modules.grade.vo.SyncGoodsExport;
 import com.zhongzheng.modules.order.bo.OrderAddBo;
+import com.zhongzheng.modules.order.domain.Order;
+import com.zhongzheng.modules.order.domain.OrderGoods;
+import com.zhongzheng.modules.order.service.IOrderGoodsService;
 import com.zhongzheng.modules.order.service.IOrderService;
 import com.zhongzheng.modules.order.service.impl.OrderServiceImpl;
 import com.zhongzheng.modules.system.service.ISysUserService;
 import com.zhongzheng.modules.user.vo.UserExportVo;
 import com.zhongzheng.modules.wx.bo.WxShareGoodsBo;
+import com.zhongzheng.modules.wx.service.IWxPayService;
 import io.swagger.annotations.ApiOperation;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -41,7 +46,9 @@ import org.springframework.web.multipart.MultipartFile;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 /**
  * 通用请求处理
@@ -66,6 +73,12 @@ public class CommonController
     @Autowired
     private WxLoginService wxLoginService;
 
+    @Autowired
+    private IOrderGoodsService iOrderGoodsService;
+
+    @Autowired
+    private IWxPayService iWxPayService;
+
     /**
      * 通用下载请求
      *
@@ -170,8 +183,8 @@ public class CommonController
     public AjaxResult<Void> testList()
     {
         UserPeriodEditBo queryBo = new UserPeriodEditBo();
-        queryBo.setGoodsId(916L);
-        queryBo.setGradeId(794L);
+        queryBo.setGoodsId(975L);
+        queryBo.setGradeId(862L);
         queryBo.setUserId(114L);
         iUserPeriodService.syncStudyLogToOld(queryBo);
         return AjaxResult.success();
@@ -208,4 +221,17 @@ public class CommonController
         String token = wxLoginService.shareGoodsCode(bo);
         return AjaxResult.success(token);
     }
+
+    @ApiOperation("推送分销商品")
+    @PostMapping("/toshareGoods")
+    public AjaxResult toshareGoods(@RequestBody WxShareGoodsBo bo)
+    {
+        String out_trade_no = "22110210122554298238";
+        Map<String, Object> map = new HashMap<>();
+        map.put("order_sn", out_trade_no);
+        List<OrderGoods> goodsList = iOrderGoodsService.listByMap(map);
+        Order order = iOrderService.getOne(new LambdaQueryWrapper<Order>().eq(Order::getOrderSn, out_trade_no));
+        iWxPayService.shareToOldSys(order,goodsList);
+        return AjaxResult.success();
+    }
 }

+ 25 - 0
zhongzheng-admin/src/main/java/com/zhongzheng/controller/course/CourseController.java

@@ -6,15 +6,23 @@ import java.util.Arrays;
 import java.util.stream.Collectors;
 
 import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.lang.Validator;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
+import com.zhongzheng.common.exception.CustomException;
+import com.zhongzheng.common.utils.ServletUtils;
 import com.zhongzheng.modules.course.bo.*;
 import com.zhongzheng.modules.course.service.ICourseService;
 import com.zhongzheng.modules.course.vo.CourseVo;
 import com.zhongzheng.modules.goods.bo.GoodsBatchDelBo;
 import com.zhongzheng.modules.goods.vo.ExportLiveGoodsVo;
+import com.zhongzheng.modules.goods.vo.GoodsUserVo;
 import com.zhongzheng.modules.order.vo.OrderGoodsLiveExportVo;
 import com.zhongzheng.modules.order.vo.OrderGoodsVo;
+import com.zhongzheng.modules.user.domain.User;
+import com.zhongzheng.modules.user.entity.ClientLoginUser;
+import com.zhongzheng.modules.user.service.IUserService;
 import com.zhongzheng.modules.user.service.IUserStudyRecordService;
 import lombok.RequiredArgsConstructor;
 import org.springframework.security.access.prepost.PreAuthorize;
@@ -50,6 +58,7 @@ public class CourseController extends BaseController {
 
     private final ICourseService iCourseService;
     private final IUserStudyRecordService iUserStudyRecordService;
+    private final IUserService iUserService;
 
     /**
      * 查询课程列表
@@ -190,5 +199,21 @@ public class CourseController extends BaseController {
         return toAjax(iCourseService.deleteWithValidByIds(Arrays.asList(courseIds), true) ? 1 : 0);
     }*/
 
+    /**
+     * 查询课程列表
+     */
+    @ApiOperation("查询用户拥有的商品")
+    @GetMapping("/goodsList")
+    public TableDataInfo<GoodsUserVo> goodsList(CourseQueryBo bo) {
+        User user = iUserService.getOne(new LambdaQueryWrapper<User>()
+                .eq(User::getTelphone, bo.getTelphone()).last("limit 1"));
+        if(Validator.isEmpty(user)){
+            throw new CustomException("该用户不存在");
+        }
+        startPage();
+        bo.setUserId(user.getUserId());
+        List<GoodsUserVo> list = iCourseService.goodsList(bo);
+        return getDataTable(list);
+    }
 
 }

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

@@ -10,6 +10,7 @@ import com.zhongzheng.common.utils.ServletUtils;
 import com.zhongzheng.modules.bank.bo.ExamQuestionQueryBo;
 import com.zhongzheng.modules.bank.service.IQuestionService;
 import com.zhongzheng.modules.bank.vo.ExamQuestionVo;
+import com.zhongzheng.modules.bank.vo.ExamVo;
 import com.zhongzheng.modules.exam.bo.ExamNumberGoodsQueryBo;
 import com.zhongzheng.modules.exam.vo.ExamNumberGoodsVo;
 import com.zhongzheng.modules.goods.bo.*;
@@ -294,4 +295,23 @@ public class GoodsController extends BaseController {
         List<GoodsUserQuestionVo> list = iQuestionService.listBankGoodsList(bo);
         return getDataTable(list);
     }
+
+    /**
+     * 获取题库商品每日一练试卷列表
+     */
+    @ApiOperation("获取题库商品每日一练试卷列表")
+    @GetMapping("/getBankGoodsExamList/{goodsId}")
+    public AjaxResult<List<BankGoodsExamVo>> getBankGoodsExamList(@PathVariable("goodsId") Long goodsId) {
+        List<BankGoodsExamVo> list = iQuestionService.getBankGoodsExamList(goodsId);
+        return AjaxResult.success(list);
+    }
+
+    /**
+     * 新增每日一练试卷时间
+     */
+    @ApiOperation("新增每日一练试卷时间")
+    @PostMapping("/addExamTime")
+    public AjaxResult<Void> addGoodsExamTime(@RequestBody List<BankGoodsExamAddBo> addBo) {
+        return toAjax(iQuestionService.addGoodsExamTime(addBo) ? 1 : 0);
+    }
 }

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

@@ -88,6 +88,21 @@ public class ClassGradeController extends BaseController {
         return getDataTable(list);
     }
 
+    /**
+     * 查询班级列表
+     */
+    @ApiOperation("查询商品班级列表")
+    @GetMapping("/listGoods")
+    public TableDataInfo<ClassGradeVo> listGoods(ClassGradeQueryBo bo) {
+        startPage();
+        bo.setStatus(new ArrayList<Integer>(Arrays.asList(1)));
+        bo.setPastDue(1L);
+        bo.setAtFull(1L);
+        List<ClassGradeVo> list = iClassGradeService.queryList(bo);
+        return getDataTable(list);
+    }
+
+
     /**
      * 查询班级列表
      */
@@ -462,6 +477,15 @@ public class ClassGradeController extends BaseController {
         return AjaxResult.success(iClassGradeUserService.sysChangeGrade(bo));
     }
 
+    /**
+     * 自由选新班
+     */
+    @ApiOperation("自由选新班")
+    @PostMapping("/changeGradeFree")
+    public AjaxResult changeGradeFree(@RequestBody ClassGradeUserChangeBo bo) {
+        return AjaxResult.success(iClassGradeUserService.changeGradeFree(bo));
+    }
+
     /**
      * 检查编辑数据是否有用户通过学时
      */

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

@@ -50,7 +50,7 @@ public class OrderBusinessConfigController extends BaseController {
     @GetMapping("/list")
     public TableDataInfo<OrderBusinessConfigVo> list(OrderBusinessConfigQueryBo bo) {
         startPage();
-        List<OrderBusinessConfigVo> list = iOrderBusinessConfigService.queryList(bo);
+        List<OrderBusinessConfigVo> list = iOrderBusinessConfigService.getList(bo);
         return getDataTable(list);
     }
 

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

@@ -366,4 +366,12 @@ public class ScheduleController extends BaseController {
         iScheduleService.refreshToken(bo);
         return AjaxResult.success();
     }
+
+    @ApiOperation("每日一练未打卡提醒")
+    @GetMapping("/toDayExamNotRecordWarn")
+    public AjaxResult toDayExamNotRecordWarn(){
+        iScheduleService.toDayExamNotRecordWarn();
+        return AjaxResult.success();
+    }
+
 }

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

@@ -130,10 +130,12 @@ certificate:
 
 liveGotoURL: http://120.79.166.78:19014/
 
-enCodeVersion: release
+enCodeVersion: develop
 
 oldStudySys:
     syncPath: http://gdxypx.xy.com/System/BussinessApi/PostUserStudyRecords
+    sharePath: http://192.168.1.210:8086/witsystem/dataapi/SaleOrder
+    shareCanclePath: http://192.168.1.210:8086/witsystem/dataapi/ordercance
 
 officialPush:
     infoPath: http://jypt-dev.gdcic.net/organjxjy/ShangBaoMingdan

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

@@ -134,6 +134,8 @@ enCodeVersion: trial
 
 oldStudySys:
     syncPath: http://test.jqbao.net/System/BussinessApi/PostUserStudyRecords
+    sharePath: http://test.jqbao.net/witsystem/dataapi/SaleOrder
+    shareCanclePath: http://test.jqbao.net/witsystem/dataapi/ordercance
 
 officialPush:
     infoPath: http://jypt-dev.gdcic.net/organjxjy/ShangBaoMingdan

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

@@ -134,6 +134,8 @@ enCodeVersion: release
 
 oldStudySys:
     syncPath: https://www.xyyxt.net/System/BussinessApi/PostUserStudyRecords
+    sharePath: https://www.xyyxt.net/witsystem/dataapi/SaleOrder
+    shareCanclePath: https://www.xyyxt.net/witsystem/dataapi/ordercance
 
 officialPush:
     infoPath: http://jypt.gdcic.net/organjxjy/ShangBaoMingdan

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

@@ -299,3 +299,5 @@ aliyun:
     longNotStudyStudentRemind: SMS_247910221  #学生长时间未学习
     longNotStudyTeacherRemind: SMS_247765294  #学生长时间未学习老师
     signCommitmentRemind: SMS_250390195  #签署承诺书提醒
+    todayExamNotRecordWarn: SMS_257713140  #学员打卡提醒(每日一练)
+    todayExamNotRecordTeachWarn: SMS_257702971  #学员打卡教务提醒(每日一练)

+ 79 - 0
zhongzheng-api/src/main/java/com/zhongzheng/controller/bank/ExamTempController.java

@@ -0,0 +1,79 @@
+package com.zhongzheng.controller.bank;
+
+import com.zhongzheng.common.annotation.Log;
+import com.zhongzheng.common.core.controller.BaseController;
+import com.zhongzheng.common.core.domain.AjaxResult;
+import com.zhongzheng.common.core.page.TableDataInfo;
+import com.zhongzheng.common.enums.BusinessType;
+import com.zhongzheng.common.utils.ServletUtils;
+import com.zhongzheng.framework.web.service.WxTokenService;
+import com.zhongzheng.modules.bank.bo.ExamTempAddBo;
+import com.zhongzheng.modules.bank.bo.ExamTempQueryBo;
+import com.zhongzheng.modules.bank.service.IExamTempService;
+import com.zhongzheng.modules.bank.vo.ExamTempVo;
+import com.zhongzheng.modules.user.entity.ClientLoginUser;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.RequiredArgsConstructor;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 随机生成试卷Controller
+ *
+ * @author hjl
+ * @date 2022-11-14
+ */
+@Api(value = "随机生成试卷控制器", tags = {"随机生成试卷管理"})
+@RequiredArgsConstructor(onConstructor_ = @Autowired)
+@RestController
+@RequestMapping("/bank/exam/temp")
+public class ExamTempController extends BaseController {
+
+    private final IExamTempService iExamTempService;
+
+    private final WxTokenService wxTokenService;
+
+    /**
+     * 查询随机生成试卷列表
+     */
+    @ApiOperation("查询随机生成试卷列表")
+    @PreAuthorize("@ss.hasPermi('system:temp:list')")
+    @GetMapping("/list")
+    public TableDataInfo<ExamTempVo> list(ExamTempQueryBo bo) {
+        startPage();
+        List<ExamTempVo> list = iExamTempService.queryList(bo);
+        return getDataTable(list);
+    }
+
+
+
+    /**
+     * 获取随机生成试卷详细信息
+     */
+    @ApiOperation("获取随机生成试卷详细信息")
+    @PreAuthorize("@ss.hasPermi('system:temp:query')")
+    @GetMapping("/{examId}")
+    public AjaxResult<ExamTempVo> getInfo(@PathVariable("examId" ) Long examId) {
+        return AjaxResult.success(iExamTempService.queryById(examId));
+    }
+
+    /**
+     * 新增随机生成试卷
+     */
+    @ApiOperation("新增随机生成试卷")
+    @PreAuthorize("@ss.hasPermi('system:temp:add')")
+    @Log(title = "随机生成试卷", businessType = BusinessType.INSERT)
+    @PostMapping()
+    public AjaxResult<ExamTempVo> add(@RequestBody ExamTempAddBo bo) {
+        ClientLoginUser loginUser = wxTokenService.getLoginUser(ServletUtils.getRequest());
+        bo.setUserId(loginUser.getUser().getUserId());
+        return AjaxResult.success(iExamTempService.insertByAddBo(bo));
+    }
+
+
+
+}

+ 95 - 30
zhongzheng-api/src/main/java/com/zhongzheng/controller/bank/QuestionController.java

@@ -1,44 +1,34 @@
 package com.zhongzheng.controller.bank;
 
-import cn.hutool.core.lang.Validator;
-import com.zhongzheng.common.annotation.Log;
+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.domain.model.LoginUser;
 import com.zhongzheng.common.core.page.TableDataInfo;
-import com.zhongzheng.common.enums.BusinessType;
 import com.zhongzheng.common.utils.ServletUtils;
-import com.zhongzheng.common.utils.poi.ExcelUtil;
-import com.zhongzheng.framework.web.service.TokenService;
 import com.zhongzheng.framework.web.service.WxTokenService;
-import com.zhongzheng.modules.bank.bo.QuestionAddBo;
-import com.zhongzheng.modules.bank.bo.QuestionBusinessQueryBo;
-import com.zhongzheng.modules.bank.bo.QuestionEditBo;
-import com.zhongzheng.modules.bank.bo.QuestionQueryBo;
-import com.zhongzheng.modules.bank.domain.QuestionBusiness;
 import com.zhongzheng.modules.bank.service.IQuestionBusinessService;
 import com.zhongzheng.modules.bank.service.IQuestionService;
-import com.zhongzheng.modules.bank.vo.QuestionImport;
-import com.zhongzheng.modules.bank.vo.QuestionVo;
-import com.zhongzheng.modules.course.bo.CourseQueryBo;
-import com.zhongzheng.modules.goods.bo.GoodsQueryBo;
+import com.zhongzheng.modules.exam.service.IExamPaperService;
+import com.zhongzheng.modules.exam.vo.ExamPaperVo;
+import com.zhongzheng.modules.goods.bo.*;
 import com.zhongzheng.modules.goods.service.IGoodsService;
+import com.zhongzheng.modules.goods.vo.GoodsExamTimeVo;
 import com.zhongzheng.modules.goods.vo.GoodsUserQuestionVo;
-import com.zhongzheng.modules.goods.vo.GoodsUserVo;
-import com.zhongzheng.modules.goods.vo.GoodsVo;
-import com.zhongzheng.modules.order.vo.OrderGoodsVo;
+import com.zhongzheng.modules.goods.vo.SpecialExamRecordVo;
 import com.zhongzheng.modules.user.bo.UserExamRecordQueryBo;
 import com.zhongzheng.modules.user.entity.ClientLoginUser;
 import com.zhongzheng.modules.user.service.IUserExamRecordService;
+import com.zhongzheng.modules.user.service.IUserExamSubscriptionService;
+import com.zhongzheng.modules.user.service.IUserSpecialExamRecordService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.RequiredArgsConstructor;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.util.CollectionUtils;
 import org.springframework.web.bind.annotation.*;
-import org.springframework.web.multipart.MultipartFile;
 
-import java.util.List;
+import java.util.*;
+import java.util.stream.Collectors;
 
 /**
  * 题库题目Controller
@@ -62,6 +52,12 @@ public class QuestionController extends BaseController {
 
     private final IUserExamRecordService iUserExamRecordService;
 
+    private final IUserSpecialExamRecordService iUserSpecialExamRecordService;
+
+    private final IExamPaperService iExamPaperService;
+
+    private final IUserExamSubscriptionService iUserExamSubscriptionService;
+
 
     /**
      * 查询商品列表
@@ -104,7 +100,6 @@ public class QuestionController extends BaseController {
             Long totalNum = iGoodsService.getQuestionNum(g.getGoodsId());
             g.setDoNum(doNum);
             g.setTotalNum(totalNum);
-
         }
         return getDataTable(list);
     }
@@ -119,15 +114,85 @@ public class QuestionController extends BaseController {
         ClientLoginUser loginUser = wxTokenService.getLoginUser(ServletUtils.getRequest());
         bo.setUserId(loginUser.getUser().getUserId());
         List<GoodsUserQuestionVo> list = iQuestionService.listUserFreeUnionBuyGoodsList(bo);
-        for (GoodsUserQuestionVo g : list) {
-            UserExamRecordQueryBo userExamRecordQueryBo = new UserExamRecordQueryBo();
-            userExamRecordQueryBo.setOrderGoodsId(g.getOrderGoodsId());
-            userExamRecordQueryBo.setUserId(loginUser.getUser().getUserId());
-            Long doNum = iUserExamRecordService.selectDoNum(userExamRecordQueryBo);
-            Long totalNum = iGoodsService.getQuestionNum(g.getGoodsId());
-            g.setDoNum(doNum);
-            g.setTotalNum(totalNum);
+        if (!CollectionUtils.isEmpty(list)){
+            for (GoodsUserQuestionVo g : list) {
+                UserExamRecordQueryBo userExamRecordQueryBo = new UserExamRecordQueryBo();
+                userExamRecordQueryBo.setOrderGoodsId(g.getOrderGoodsId());
+                userExamRecordQueryBo.setUserId(loginUser.getUser().getUserId());
+                Long doNum = iUserExamRecordService.selectDoNum(userExamRecordQueryBo);
+                Long totalNum = iGoodsService.getQuestionNum(g.getGoodsId());
+                g.setDoNum(doNum);
+                g.setTotalNum(totalNum);
+                //试卷类型
+                List<ExamPaperVo> paperVos = iExamPaperService.getGoodsExamPaperByGoodsId(g.getGoodsId());
+                paperVos = paperVos.stream().filter(x -> ObjectUtils.isNotNull(x.getPaperId())).collect(Collectors.collectingAndThen(Collectors
+                             .toCollection(() -> new TreeSet<>(Comparator.comparing(item -> item.getPaperId()))), ArrayList::new));
+                g.setPaperVos(paperVos);
+            }
         }
         return getDataTable(list);
     }
+
+    /**
+     * 获取每日一练当天的试卷信息
+     */
+    @ApiOperation("获取每日一练当天的试卷信息")
+    @GetMapping("/getToDayExam/{goodsId}")
+    public AjaxResult<GoodsExamTimeVo> getToDayExam(@PathVariable("goodsId") Long goodsId) {
+        ClientLoginUser loginUser = wxTokenService.getLoginUser(ServletUtils.getRequest());
+        return AjaxResult.success(iQuestionService.getToDayExam(goodsId,loginUser.getUser().getUserId()));
+    }
+
+    /**
+     * 每日一练试卷打卡
+     */
+    @ApiOperation("每日一练试卷打卡")
+    @PostMapping("/special/exam/record")
+    public AjaxResult<Void> specialExamRecord(@RequestBody SpecialExamRecordAddBo addBo) {
+        ClientLoginUser loginUser = wxTokenService.getLoginUser(ServletUtils.getRequest());
+        addBo.setUserId(loginUser.getUser().getUserId());
+        return toAjax(iUserSpecialExamRecordService.specialExamRecord(addBo)? 1 : 0);
+    }
+
+    /**
+     * 获取每日一练试卷打卡记录
+     */
+    @ApiOperation("获取每日一练试卷打卡记录")
+    @GetMapping("/get/special/record")
+    public AjaxResult<List<SpecialExamRecordVo>> getSpecialRecord(SpecialExamRecordQuery query) {
+        ClientLoginUser loginUser = wxTokenService.getLoginUser(ServletUtils.getRequest());
+        query.setUserId(loginUser.getUser().getUserId());
+        return AjaxResult.success(iUserSpecialExamRecordService.getSpecialRecord(query));
+    }
+
+    /**
+     * 每日一练消息提醒订阅
+     */
+    @ApiOperation("每日一练消息提醒订阅")
+    @PostMapping("/today/exam/subscription")
+    public AjaxResult<Void> todayExamSubscription(@RequestBody TodayExamSubscriptionBo bo) {
+        ClientLoginUser loginUser = wxTokenService.getLoginUser(ServletUtils.getRequest());
+        bo.setUserId(loginUser.getUser().getUserId());
+        return toAjax(iUserExamSubscriptionService.todayExamSubscription(bo)? 1 : 0);
+    }
+
+    /**
+     * 每日一练打卡排行榜
+     */
+    @ApiOperation("每日一练打卡排行榜")
+    @GetMapping("/todayExam/tob/{goodsId}")
+    public AjaxResult<List<TodayExamTobVo>> getTodayExamTob(@PathVariable("goodsId") Long goodsId) {
+        ClientLoginUser loginUser = wxTokenService.getLoginUser(ServletUtils.getRequest());
+        return AjaxResult.success(iQuestionService.getTodayExamTob(goodsId,loginUser.getUser().getUserId()));
+    }
+
+    /**
+     * 每日一练周记录详情
+     */
+    @ApiOperation("每日一练周记录详情")
+    @GetMapping("/todayExam/tob/weekRecord/{goodsId}")
+    public AjaxResult<TodayExamWeekRecordDetailVo> getTodayExamWeekRecord(@PathVariable("goodsId") Long goodsId) {
+        ClientLoginUser loginUser = wxTokenService.getLoginUser(ServletUtils.getRequest());
+        return AjaxResult.success(iQuestionService.getTodayExamWeekRecord(goodsId,loginUser.getUser().getUserId()));
+    }
 }

+ 10 - 0
zhongzheng-api/src/main/java/com/zhongzheng/controller/cmmon/CommonBankController.java

@@ -99,4 +99,14 @@ public class CommonBankController extends BaseController {
         List<ExamQuestionVo> list = iExamQuestionService.getAppList(bo);
         return AjaxResult.success(list);
     }
+
+    /**
+     * 查询随机练习试卷题目列表
+     */
+    @ApiOperation("查询随机练习试卷题目列表")
+    @GetMapping("/question/temp/list")
+    public AjaxResult<List<ExamQuestionVo>> questionTempList(ExamQuestionQueryBo bo) {
+        List<ExamQuestionVo> list = iExamQuestionService.getAppTempList(bo);
+        return AjaxResult.success(list);
+    }
 }

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

@@ -27,6 +27,8 @@ import com.zhongzheng.modules.goods.vo.GoodsUserVo;
 import com.zhongzheng.modules.goods.vo.GoodsVo;
 import com.zhongzheng.modules.order.domain.Printer;
 import com.zhongzheng.modules.system.service.ISysConfigService;
+import com.zhongzheng.modules.wx.bo.WxInfoBo;
+import com.zhongzheng.modules.wx.bo.WxInfoQuery;
 import com.zhongzheng.modules.wx.bo.WxServerBody;
 import com.zhongzheng.modules.wx.domain.*;
 import io.swagger.annotations.Api;
@@ -63,6 +65,24 @@ public class CommonController extends BaseController {
 
     private final IGoodsSpecTemplateService iGoodsSpecTemplateService;
 
+    /**
+     * 获取微信小程序信息(网页跳转小程序)
+     */
+    @ApiOperation("获取微信小程序信息(网页跳转小程序)")
+    @GetMapping("/get/wx/info")
+    public AjaxResult<WxInfoBo> getWxInfo(WxInfoQuery query) {
+        return AjaxResult.success(wxLoginService.getWxInfo(query));
+    }
+
+    /**
+     * 获取小程序首页链接
+     */
+    @ApiOperation("获取小程序首页链接")
+    @GetMapping("/get/small/link")
+    public AjaxResult<Void> getWxSmallLink() {
+        return AjaxResult.success(wxLoginService.getWxSmallLink());
+    }
+
     /**
      * 获取商品专题页指定商品信息
      */

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

@@ -13,6 +13,7 @@ import com.zhongzheng.modules.bank.bo.QuestionChapterExamQueryBo;
 import com.zhongzheng.modules.bank.bo.QuestionModuleChapterQueryBo;
 import com.zhongzheng.modules.bank.service.IQuestionChapterExamService;
 import com.zhongzheng.modules.bank.service.IQuestionModuleChapterService;
+import com.zhongzheng.modules.bank.service.IQuestionService;
 import com.zhongzheng.modules.bank.vo.ExamVo;
 import com.zhongzheng.modules.bank.vo.QuestionChapterVo;
 import com.zhongzheng.modules.collect.bo.CollectQuestionQueryBo;
@@ -26,6 +27,7 @@ import com.zhongzheng.modules.goods.service.IGoodsAttachedService;
 import com.zhongzheng.modules.goods.service.IGoodsService;
 import com.zhongzheng.modules.goods.service.IGoodsSpecTemplateService;
 import com.zhongzheng.modules.goods.vo.GoodsAttachedVo;
+import com.zhongzheng.modules.goods.vo.GoodsExamTimeVo;
 import com.zhongzheng.modules.goods.vo.GoodsSpecTemplateVo;
 import com.zhongzheng.modules.goods.vo.GoodsVo;
 import com.zhongzheng.modules.grade.bo.UserPeriodQueryBo;
@@ -114,23 +116,27 @@ public class GoodsController extends BaseController {
         UserExamWrongRecordQueryBo wBo = new UserExamWrongRecordQueryBo();
         wBo.setOrderGoodsId(orderGoodsId);
         wBo.setUserId(loginUser.getUser().getUserId());
+        wBo.setDoMode(1L);
         Long wrongNum = iUserExamWrongRecordService.recordNum(wBo);
         numMap.put("wrongNum",wrongNum);
 
         CollectQuestionQueryBo collectQuestionQueryBo = new CollectQuestionQueryBo();
         collectQuestionQueryBo.setOrderGoodsId(orderGoodsId);
         collectQuestionQueryBo.setUserId(loginUser.getUser().getUserId());
+        collectQuestionQueryBo.setDoMode(1L);
         Integer collectNum = iCollectQuestionService.collectNum(collectQuestionQueryBo);
         numMap.put("collectNum",collectNum);
 
         UserExamRecordQueryBo userExamRecordQueryBo = new UserExamRecordQueryBo();
         userExamRecordQueryBo.setOrderGoodsId(orderGoodsId);
         userExamRecordQueryBo.setUserId(loginUser.getUser().getUserId());
+        userExamRecordQueryBo.setDoMode(1L);
         Long doNum = iUserExamRecordService.selectDoNum(userExamRecordQueryBo);
         numMap.put("doNum",doNum);
 
         userExamRecordQueryBo.setOrderGoodsId(orderGoodsId);
         userExamRecordQueryBo.setUserId(loginUser.getUser().getUserId());
+        userExamRecordQueryBo.setDoMode(1L);
         Long rightNum = iUserExamRecordService.selectRightNum(userExamRecordQueryBo);
         numMap.put("rightNum",rightNum);
         OrderGoods orderGoods = iOrderGoodsService.getOne(new LambdaQueryWrapper<OrderGoods>()
@@ -152,6 +158,42 @@ public class GoodsController extends BaseController {
         return AjaxResult.success(numMap);
     }
 
+
+    @ApiOperation("获取题库订单商品随机练习题目数统计信息")
+    @GetMapping("/bank/questionTempNum/{orderGoodsId}")
+    public AjaxResult<Map<String,Object>> questionTempNum(@PathVariable("orderGoodsId" ) Long orderGoodsId) {
+        ClientLoginUser loginUser = wxTokenService.getLoginUser(ServletUtils.getRequest());
+
+        Map<String,Object> numMap = new HashMap<>();
+
+
+
+        UserExamRecordQueryBo userExamRecordQueryBo = new UserExamRecordQueryBo();
+        userExamRecordQueryBo.setOrderGoodsId(orderGoodsId);
+        userExamRecordQueryBo.setUserId(loginUser.getUser().getUserId());
+        userExamRecordQueryBo.setDoMode(2L);
+        Long doNum = iUserExamRecordService.selectDoNum(userExamRecordQueryBo);
+        numMap.put("doNum",doNum);
+
+        userExamRecordQueryBo.setOrderGoodsId(orderGoodsId);
+        userExamRecordQueryBo.setUserId(loginUser.getUser().getUserId());
+        userExamRecordQueryBo.setDoMode(2L);
+        Long rightNum = iUserExamRecordService.selectRightNum(userExamRecordQueryBo);
+        numMap.put("rightNum",rightNum);
+
+
+        OrderGoods orderGoods = iOrderGoodsService.getOne(new LambdaQueryWrapper<OrderGoods>()
+                .eq(OrderGoods::getOrderGoodsId, orderGoodsId));
+        if(Validator.isNotEmpty(orderGoods)){
+            Long goodsId = orderGoods.getGoodsId();
+            Long totalNum = iGoodsService.getQuestionNum(goodsId);
+            numMap.put("totalNum",totalNum);
+        }
+
+
+        return AjaxResult.success(numMap);
+    }
+
     @ApiOperation("查询商品题库目录列表")
     @GetMapping("/bank/list")
     public AjaxResult<List<GoodsAttachedVo>> bankList(GoodsAttachedQueryBo bo) {
@@ -253,5 +295,4 @@ public class GoodsController extends BaseController {
         return getDataTable(list);
     }
 
-
 }

+ 10 - 0
zhongzheng-api/src/main/java/com/zhongzheng/controller/polyv/PolyvVideoController.java

@@ -57,4 +57,14 @@ public class PolyvVideoController extends BaseController {
         map.put("uid","egsxlptzdq");
         return AjaxResult.success(map);
     }
+
+    @ApiOperation("获取保利威PC视频播放凭证")
+    @PreAuthorize("@ss.hasPermi('modules.polyv:video:query')")
+    @GetMapping("/sign/pc/{vid}")
+    public AjaxResult<String> getPlayPcSign(@PathVariable("vid") String vid) throws Exception {
+        ClientLoginUser loginUser = wxTokenService.getLoginUser(ServletUtils.getRequest());
+        String viewerId = String.valueOf(loginUser.getUser().getUserId());
+        String token = iPolyvVideoService.polyvbPcSignRequest(vid,viewerId);
+        return AjaxResult.success("成功",token);
+    }
 }

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

@@ -135,6 +135,8 @@ enCodeVersion: develop
 
 oldStudySys:
     syncPath: http://gdxypx.xy.com/System/PostUserStudyRecords
+    sharePath: http://192.168.1.210:8086/witsystem/dataapi/SaleOrder
+    shareCanclePath: http://192.168.1.210:8086/witsystem/dataapi/ordercance
 
 officialPush:
     infoPath: http://jypt-dev.gdcic.net/organjxjy/ShangBaoMingdan

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

@@ -134,6 +134,8 @@ enCodeVersion: trial
 
 oldStudySys:
     syncPath: http://test.jqbao.net/System/PostUserStudyRecords
+    sharePath: http://test.jqbao.net/witsystem/dataapi/SaleOrder
+    shareCanclePath: http://test.jqbao.net/witsystem/dataapi/ordercance
 
 officialPush:
     infoPath: http://jypt-dev.gdcic.net/organjxjy/ShangBaoMingdan

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

@@ -146,6 +146,8 @@ enCodeVersion: release
 
 oldStudySys:
     syncPath: https://www.xyyxt.net/System/PostUserStudyRecords
+    sharePath: https://www.xyyxt.net/witsystem/dataapi/SaleOrder
+    shareCanclePath: https://www.xyyxt.net/witsystem/dataapi/ordercance
 
 officialPush:
     infoPath: http://jypt.gdcic.net/organjxjy/ShangBaoMingdan

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

@@ -294,3 +294,5 @@ aliyun:
     longNotStudyStudentRemind: SMS_247910221  #学生长时间未学习
     longNotStudyTeacherRemind: SMS_247765294  #学生长时间未学习老师
     signCommitmentRemind: SMS_250390195  #签署承诺书提醒
+    todayExamNotRecordWarn: SMS_257713140  #学员打卡提醒(每日一练)
+    todayExamNotRecordTeachWarn: SMS_257702971  #学员打卡教务提醒(每日一练)

+ 23 - 0
zhongzheng-common/src/main/java/com/zhongzheng/common/utils/DateUtils.java

@@ -222,6 +222,29 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
         return cal.getTimeInMillis() / 1000;  //今天凌晨
     }
 
+    /**
+     * 获取明天凌晨时间戳
+     */
+    public static Long getTomorrowZeroTime()
+    {
+        Calendar cal = Calendar.getInstance();
+        cal.set(cal.get(Calendar.YEAR), cal.get(Calendar.MONTH), cal.get(Calendar.DAY_OF_MONTH), 0, 0, 0);
+        Calendar cal1 = Calendar.getInstance();
+        cal1.setTime(cal.getTime());
+        cal1.add(Calendar.DAY_OF_MONTH , +1);
+        return cal1.getTimeInMillis() / 1000; //明天凌晨
+    }
+
+    /**
+     * 获取当月第一天的凌晨时间戳
+     */
+    public static Long getToMonthZeroTime()
+    {
+        Calendar cal = Calendar.getInstance();
+        cal.set(cal.get(Calendar.YEAR), cal.get(Calendar.MONTH), 1, 0, 0, 0);
+        return cal.getTime().getTime()/1000;
+    }
+
 
     /**
      * 获取日期格式订单号

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

@@ -712,6 +712,9 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
         inertData.setCreateTime(DateUtils.getNowTime());
         inertData.setUpdateTime(DateUtils.getNowTime());
         inertData.setPassword(SecurityUtils.encryptPassword(bo.getPwd()));
+        if (Validator.isNotEmpty(bo.getShareCode())) {
+            inertData.setShareCode(bo.getShareCode());
+        }
         if(!save(inertData)){
             throw new CustomException("注册失败");
         }

+ 108 - 5
zhongzheng-framework/src/main/java/com/zhongzheng/framework/web/service/WxLoginService.java

@@ -7,6 +7,7 @@ import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
+import com.baomidou.mybatisplus.core.toolkit.StringUtils;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.google.zxing.BarcodeFormat;
 import com.google.zxing.client.j2se.MatrixToImageWriter;
@@ -29,9 +30,7 @@ import com.zhongzheng.modules.user.entity.ClientLoginUser;
 import com.zhongzheng.modules.user.mapper.UserMapper;
 import com.zhongzheng.modules.user.service.IUserService;
 import com.zhongzheng.modules.user.service.IUserWxFollowService;
-import com.zhongzheng.modules.wx.bo.TemplatData;
-import com.zhongzheng.modules.wx.bo.WxLoginBody;
-import com.zhongzheng.modules.wx.bo.WxShareGoodsBo;
+import com.zhongzheng.modules.wx.bo.*;
 import com.zhongzheng.modules.wx.service.IWxLoginService;
 import org.apache.commons.codec.binary.Base64;
 import org.slf4j.Logger;
@@ -128,6 +127,10 @@ public class WxLoginService implements IWxLoginService {
 
     private String small_wxEnCodeParam = "access_token=%s";
 
+    private String small_LinkUrl = "https://api.weixin.qq.com/wxa/generate_urllink";
+
+    private String small_LinkParam = "access_token=%s";
+
     @Autowired
     private IUserService iUserService;
 
@@ -279,7 +282,7 @@ public class WxLoginService implements IWxLoginService {
      * @param tel
      * @return
      */
-    public Boolean register_small(String openId, String unionId, String tel, String inviteCode) {
+    public Boolean register_small(String openId, String unionId, String tel, String inviteCode, String shareCode) {
         User bo = new User();
         bo.setOpenId(openId);
         bo.setUnionId(unionId);
@@ -305,6 +308,9 @@ public class WxLoginService implements IWxLoginService {
                 bo.setInviteUserAccount(inviteCode);
             }
         }
+        if (Validator.isNotEmpty(shareCode)) {
+            bo.setShareCode(shareCode);
+        }
         if (iUserService.save(bo)) {
             iSmsService.sendPwdSms(bo.getTelphone(), pwd);
         }
@@ -368,7 +374,7 @@ public class WxLoginService implements IWxLoginService {
             }
         }
         if (user == null) {
-            if (!register_small(openId, unionId, phoneNumber, loginBody.getInviteCode())) {
+            if (!register_small(openId, unionId, phoneNumber, loginBody.getInviteCode(),loginBody.getShareCode())) {
                 throw new CustomException("注册失败");
             }
             user = iUserService.getOne(new LambdaQueryWrapper<User>()
@@ -985,6 +991,103 @@ public class WxLoginService implements IWxLoginService {
         return result;
     }
 
+    @Override
+    public WxInfoBo getWxInfo(WxInfoQuery query) {
+        Long time = System.currentTimeMillis();
+        String nonceStr = UUID.randomUUID().toString();
+        String ticket = "";
+        String signature = "";
+        //获取ticket
+        String url = "https://api.weixin.qq.com/cgi-bin/ticket/getticket";
+        String param = String.format("access_token=%s&type=jsapi", getWxSmallAccessToken());
+        String result = HttpUtils.sendGet(url, param);
+        JSONObject jsonObject = JSONObject.parseObject(result);
+        if (Integer.valueOf(jsonObject.get("errcode").toString()) != 0){
+            //请求失败(可能是access_token过期或者失效)刷新access_token
+            String key = "WX_SMALL_ACCESS_TOKEN";
+            redisCache.deleteObject(key);
+            param = String.format("access_token=%s&type=jsapi", getWxSmallAccessToken());
+            result = HttpUtils.sendGet(url, param);
+            jsonObject = JSONObject.parseObject(result);
+        }
+        ticket = jsonObject.get("ticket").toString();
+        if (StringUtils.isBlank(ticket)){
+            throw new CustomException("微信ticket获取失败");
+        }
+
+        //签名 = 随机串 + ticket + 时间戳 + URL(当前页面)
+        signature = nonceStr+ticket+time+query.getWebUrl();
+
+        WxInfoBo bo = new WxInfoBo();
+        bo.setWxAppId(appid);
+        bo.setTimestamp(time);
+        bo.setSignature(signature);
+        bo.setNonceStr(nonceStr);
+        bo.setAppUrl("pages/index/index");
+        bo.setUsername("gh_9bdfc9ccd1fa");
+        return bo;
+    }
+
+    @Override
+    public String getWxSmallLink() {
+        String wxGzhAccessToken = getWxSmallAccessToken();
+        String param = String.format(small_LinkParam, wxGzhAccessToken);
+        String url = small_LinkUrl + "?" + param;
+        JSONObject obj = new JSONObject();
+        obj.put("path", "pages/index/index");
+        obj.put("is_expire",true);
+        obj.put("expire_type",1);
+        obj.put("expire_interval",1);
+        obj.put("env_version",enCodeVersion);
+        String result = HttpUtils.sendPost(url, obj);
+        if (result.contains("errcode")){
+            List<String> codes = Arrays.asList("40001", "42001");
+            JSONObject jsonObject = JSONObject.parseObject(result);
+            if(ObjectUtils.isNotNull(jsonObject.get("errcode")) && codes.contains(jsonObject.get("errcode").toString())){
+                //微信access_token 过期或者失效,刷新access_token
+                String key = "WX_SMALL_ACCESS_TOKEN";
+                redisCache.deleteObject(key);
+                String wxGzhAccessTokenTo = getWxSmallAccessToken();
+                String paramTo = String.format(small_LinkParam, wxGzhAccessTokenTo);
+                String urlTo = small_LinkUrl + "?" + paramTo;
+                result = HttpUtils.sendPost(urlTo, obj);
+            }
+        }
+        JSONObject jsonObject = JSONObject.parseObject(result);
+
+        return jsonObject.get("url_link").toString();
+    }
+
+    @Override
+    public String getWxSmallStudyCentreLink() {
+        String wxGzhAccessToken = getWxSmallAccessToken();
+        String param = String.format(small_LinkParam, wxGzhAccessToken);
+        String url = small_LinkUrl + "?" + param;
+        JSONObject obj = new JSONObject();
+        obj.put("path", "pages/learn/index");
+        obj.put("is_expire",true);
+        obj.put("expire_type",1);
+        obj.put("expire_interval",7);
+        obj.put("env_version",enCodeVersion);
+        String result = HttpUtils.sendPost(url, obj);
+        if (result.contains("errcode")){
+            List<String> codes = Arrays.asList("40001", "42001");
+            JSONObject jsonObject = JSONObject.parseObject(result);
+            if(ObjectUtils.isNotNull(jsonObject.get("errcode")) && codes.contains(jsonObject.get("errcode").toString())){
+                //微信access_token 过期或者失效,刷新access_token
+                String key = "WX_SMALL_ACCESS_TOKEN";
+                redisCache.deleteObject(key);
+                String wxGzhAccessTokenTo = getWxSmallAccessToken();
+                String paramTo = String.format(small_LinkParam, wxGzhAccessTokenTo);
+                String urlTo = small_LinkUrl + "?" + paramTo;
+                result = HttpUtils.sendPost(urlTo, obj);
+            }
+        }
+        JSONObject jsonObject = JSONObject.parseObject(result);
+
+        return jsonObject.get("url_link").toString();
+    }
+
     public Boolean subGzh(String openId) {
         String unionId = getWxGzhUserCgiInfo(openId);
         if (Validator.isNotEmpty(unionId)) {

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/bo/ExamQueryBo.java

@@ -89,4 +89,6 @@ public class ExamQueryBo extends BaseEntity {
 	private List<Long> examIds;
 	@ApiModelProperty("试卷类型名称")
 	private String paperName;
+	@ApiModelProperty("是否排除随机练习和每日一练试卷类型:1是,0否")
+	private Integer exclude;
 }

+ 47 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/bo/ExamTempAddBo.java

@@ -0,0 +1,47 @@
+package com.zhongzheng.modules.bank.bo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import java.util.Date;
+
+
+
+/**
+ * 随机生成试卷添加对象 exam_temp
+ *
+ * @author hjl
+ * @date 2022-11-14
+ */
+@Data
+@ApiModel("随机生成试卷添加对象")
+public class ExamTempAddBo {
+
+    /**  状态 1正常 0关闭 */
+    @ApiModelProperty(" 状态 1正常 0关闭")
+    private Integer status;
+    /** 更新时间 */
+    @ApiModelProperty("更新时间")
+    private Long updateTime;
+    /** 试卷名 */
+    @ApiModelProperty("试卷名")
+    private String examName;
+    /** 创建时间 */
+    @ApiModelProperty("创建时间")
+    private Long createTime;
+    /** 商品ID */
+    @ApiModelProperty("商品ID")
+    private Long goodsId;
+    /** 用户ID */
+    @ApiModelProperty("用户ID")
+    private Long userId;
+    /** 订单商品ID */
+    @ApiModelProperty("订单商品ID")
+    private Long orderGoodsId;
+    @ApiModelProperty("生成题目数量")
+    private Integer number;
+    /** 试卷类型id */
+    @ApiModelProperty("试卷类型id")
+    private Long examPaperId;
+}

+ 56 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/bo/ExamTempEditBo.java

@@ -0,0 +1,56 @@
+package com.zhongzheng.modules.bank.bo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import java.util.Date;
+
+
+/**
+ * 随机生成试卷编辑对象 exam_temp
+ *
+ * @author hjl
+ * @date 2022-11-14
+ */
+@Data
+@ApiModel("随机生成试卷编辑对象")
+public class ExamTempEditBo {
+
+    /** $column.columnComment */
+    @ApiModelProperty("$column.columnComment")
+    private Long examId;
+
+    /**  状态 1正常 0关闭 */
+    @ApiModelProperty(" 状态 1正常 0关闭")
+    private Integer status;
+
+    /** 更新时间 */
+    @ApiModelProperty("更新时间")
+    private Long updateTime;
+
+    /** 试卷名 */
+    @ApiModelProperty("试卷名")
+    private String examName;
+
+    /** 商品ID */
+    @ApiModelProperty("商品ID")
+    private Long goodsId;
+
+    /** 用户ID */
+    @ApiModelProperty("用户ID")
+    private Long userId;
+
+    /** 订单商品ID */
+    @ApiModelProperty("订单商品ID")
+    private Long orderGoodsId;
+
+    /** 题目数 */
+    @ApiModelProperty("题目数")
+    private Integer number;
+
+    /** 试卷类型id */
+    @ApiModelProperty("试卷类型id")
+    private Long examPaperId;
+
+}

+ 59 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/bo/ExamTempQueryBo.java

@@ -0,0 +1,59 @@
+package com.zhongzheng.modules.bank.bo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.util.Date;
+import java.util.Map;
+import java.util.HashMap;
+
+import com.zhongzheng.common.core.domain.BaseEntity;
+
+/**
+ * 随机生成试卷分页查询对象 exam_temp
+ *
+ * @author hjl
+ * @date 2022-11-14
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ApiModel("随机生成试卷分页查询对象")
+public class ExamTempQueryBo extends BaseEntity {
+
+	/** 分页大小 */
+	@ApiModelProperty("分页大小")
+	private Integer pageSize;
+	/** 当前页数 */
+	@ApiModelProperty("当前页数")
+	private Integer pageNum;
+	/** 排序列 */
+	@ApiModelProperty("排序列")
+	private String orderByColumn;
+	/** 排序的方向desc或者asc */
+	@ApiModelProperty(value = "排序的方向", example = "asc,desc")
+	private String isAsc;
+
+
+	/**  状态 1正常 0关闭 */
+	@ApiModelProperty(" 状态 1正常 0关闭")
+	private Integer status;
+	/** 试卷名 */
+	@ApiModelProperty("试卷名")
+	private String examName;
+	/** 商品ID */
+	@ApiModelProperty("商品ID")
+	private Long goodsId;
+	/** 用户ID */
+	@ApiModelProperty("用户ID")
+	private Long userId;
+	/** 订单商品ID */
+	@ApiModelProperty("订单商品ID")
+	private Long orderGoodsId;
+	@ApiModelProperty("生成题目数量")
+	private Integer number;
+	/** 试卷类型id */
+	@ApiModelProperty("试卷类型id")
+	private Long examPaperId;
+}

+ 30 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/bo/ExamTempQuestionAddBo.java

@@ -0,0 +1,30 @@
+package com.zhongzheng.modules.bank.bo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import java.util.Date;
+
+
+
+/**
+ * 随机试卷题目关系添加对象 exam_temp_question
+ *
+ * @author hjl
+ * @date 2022-11-14
+ */
+@Data
+@ApiModel("随机试卷题目关系添加对象")
+public class ExamTempQuestionAddBo {
+
+    /** 试卷ID */
+    @ApiModelProperty("试卷ID")
+    private Long examId;
+    /** 题目ID */
+    @ApiModelProperty("题目ID")
+    private Long questionId;
+    /** 排序 */
+    @ApiModelProperty("排序")
+    private Long sort;
+}

+ 37 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/bo/ExamTempQuestionEditBo.java

@@ -0,0 +1,37 @@
+package com.zhongzheng.modules.bank.bo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import java.util.Date;
+
+
+/**
+ * 随机试卷题目关系编辑对象 exam_temp_question
+ *
+ * @author hjl
+ * @date 2022-11-14
+ */
+@Data
+@ApiModel("随机试卷题目关系编辑对象")
+public class ExamTempQuestionEditBo {
+
+    /** $column.columnComment */
+    @ApiModelProperty("$column.columnComment")
+    private Long id;
+
+    /** 试卷ID */
+    @ApiModelProperty("试卷ID")
+    private Long examId;
+
+    /** 题目ID */
+    @ApiModelProperty("题目ID")
+    private Long questionId;
+
+    /** 排序 */
+    @ApiModelProperty("排序")
+    private Long sort;
+
+
+}

+ 48 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/bo/ExamTempQuestionQueryBo.java

@@ -0,0 +1,48 @@
+package com.zhongzheng.modules.bank.bo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.util.Date;
+import java.util.Map;
+import java.util.HashMap;
+
+import com.zhongzheng.common.core.domain.BaseEntity;
+
+/**
+ * 随机试卷题目关系分页查询对象 exam_temp_question
+ *
+ * @author hjl
+ * @date 2022-11-14
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ApiModel("随机试卷题目关系分页查询对象")
+public class ExamTempQuestionQueryBo extends BaseEntity {
+
+	/** 分页大小 */
+	@ApiModelProperty("分页大小")
+	private Integer pageSize;
+	/** 当前页数 */
+	@ApiModelProperty("当前页数")
+	private Integer pageNum;
+	/** 排序列 */
+	@ApiModelProperty("排序列")
+	private String orderByColumn;
+	/** 排序的方向desc或者asc */
+	@ApiModelProperty(value = "排序的方向", example = "asc,desc")
+	private String isAsc;
+
+
+	/** 试卷ID */
+	@ApiModelProperty("试卷ID")
+	private Long examId;
+	/** 题目ID */
+	@ApiModelProperty("题目ID")
+	private Long questionId;
+	/** 排序 */
+	@ApiModelProperty("排序")
+	private Long sort;
+}

+ 49 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/domain/ExamTemp.java

@@ -0,0 +1,49 @@
+package com.zhongzheng.modules.bank.domain;
+
+import com.baomidou.mybatisplus.annotation.*;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import lombok.experimental.Accessors;
+import java.io.Serializable;
+import java.util.Date;
+import java.math.BigDecimal;
+import com.zhongzheng.common.annotation.Excel;
+
+/**
+ * 随机生成试卷对象 exam_temp
+ *
+ * @author hjl
+ * @date 2022-11-14
+ */
+@Data
+@NoArgsConstructor
+@Accessors(chain = true)
+@TableName("exam_temp")
+public class ExamTemp implements Serializable {
+
+private static final long serialVersionUID=1L;
+
+    /** $column.columnComment */
+    @TableId(value = "exam_id")
+    private Long examId;
+    /**  状态 1正常 0关闭 */
+    private Integer status;
+    /** 更新时间 */
+    @TableField(fill = FieldFill.INSERT_UPDATE)
+    private Long updateTime;
+    /** 试卷名 */
+    private String examName;
+    /** 创建时间 */
+    @TableField(fill = FieldFill.INSERT)
+    private Long createTime;
+    /** 商品ID */
+    private Long goodsId;
+    /** 用户ID */
+    private Long userId;
+    /** 订单商品ID */
+    private Long orderGoodsId;
+    /** 题目数 */
+    private Integer number;
+    /** 试卷类型id */
+    private Long examPaperId;
+}

+ 35 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/domain/ExamTempQuestion.java

@@ -0,0 +1,35 @@
+package com.zhongzheng.modules.bank.domain;
+
+import com.baomidou.mybatisplus.annotation.*;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import lombok.experimental.Accessors;
+import java.io.Serializable;
+import java.util.Date;
+import java.math.BigDecimal;
+import com.zhongzheng.common.annotation.Excel;
+
+/**
+ * 随机试卷题目关系对象 exam_temp_question
+ *
+ * @author hjl
+ * @date 2022-11-14
+ */
+@Data
+@NoArgsConstructor
+@Accessors(chain = true)
+@TableName("exam_temp_question")
+public class ExamTempQuestion implements Serializable {
+
+private static final long serialVersionUID=1L;
+
+    /** $column.columnComment */
+    @TableId(value = "id")
+    private Long id;
+    /** 试卷ID */
+    private Long examId;
+    /** 题目ID */
+    private Long questionId;
+    /** 排序 */
+    private Long sort;
+}

+ 1 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/mapper/ExamQuestionMapper.java

@@ -18,5 +18,6 @@ import java.util.List;
 public interface ExamQuestionMapper extends BaseMapper<ExamQuestion> {
     List<ExamQuestionVo> getList(ExamQuestionQueryBo bo);
     List<ExamQuestionVo> getAppList(ExamQuestionQueryBo bo);
+    List<ExamQuestionVo> getAppTempList(ExamQuestionQueryBo bo);
 
 }

+ 20 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/mapper/ExamTempMapper.java

@@ -0,0 +1,20 @@
+package com.zhongzheng.modules.bank.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.zhongzheng.modules.bank.bo.ExamQueryBo;
+import com.zhongzheng.modules.bank.bo.ExamTempQueryBo;
+import com.zhongzheng.modules.bank.domain.ExamTemp;
+import com.zhongzheng.modules.bank.vo.ExamVo;
+import com.zhongzheng.modules.bank.vo.QuestionVo;
+
+import java.util.List;
+
+/**
+ * 随机生成试卷Mapper接口
+ *
+ * @author hjl
+ * @date 2022-11-14
+ */
+public interface ExamTempMapper extends BaseMapper<ExamTemp> {
+    List<QuestionVo> getQuestionList(ExamTempQueryBo bo);
+}

+ 14 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/mapper/ExamTempQuestionMapper.java

@@ -0,0 +1,14 @@
+package com.zhongzheng.modules.bank.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.zhongzheng.modules.bank.domain.ExamTempQuestion;
+
+/**
+ * 随机试卷题目关系Mapper接口
+ *
+ * @author hjl
+ * @date 2022-11-14
+ */
+public interface ExamTempQuestionMapper extends BaseMapper<ExamTempQuestion> {
+
+}

+ 4 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/mapper/QuestionMapper.java

@@ -7,7 +7,9 @@ import com.zhongzheng.modules.bank.vo.QuestionVo;
 import com.zhongzheng.modules.course.bo.CourseQueryBo;
 import com.zhongzheng.modules.course.vo.CourseVo;
 import com.zhongzheng.modules.goods.bo.GoodsQueryBo;
+import com.zhongzheng.modules.goods.vo.BankGoodsExamVo;
 import com.zhongzheng.modules.goods.vo.GoodsUserQuestionVo;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 
@@ -29,4 +31,6 @@ public interface QuestionMapper extends BaseMapper<Question> {
     List<GoodsUserQuestionVo> listBankGoodsList(GoodsQueryBo bo);
 
     List<GoodsUserQuestionVo> listUserFreeUnionBuyGoodsList(GoodsQueryBo bo);
+
+    List<BankGoodsExamVo> getBankGoodsExamList(@Param("goodsId") Long goodsId);
 }

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/IExamQuestionService.java

@@ -32,6 +32,8 @@ public interface IExamQuestionService extends IService<ExamQuestion> {
 
 	List<ExamQuestionVo> getAppList(ExamQuestionQueryBo bo);
 
+	List<ExamQuestionVo> getAppTempList(ExamQuestionQueryBo bo);
+
 	/**
 	 * 根据新增业务对象插入试卷题目关系
 	 * @param bo 试卷题目关系新增业务对象

+ 52 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/IExamTempQuestionService.java

@@ -0,0 +1,52 @@
+package com.zhongzheng.modules.bank.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.zhongzheng.modules.bank.bo.ExamTempQuestionAddBo;
+import com.zhongzheng.modules.bank.bo.ExamTempQuestionEditBo;
+import com.zhongzheng.modules.bank.bo.ExamTempQuestionQueryBo;
+import com.zhongzheng.modules.bank.domain.ExamTempQuestion;
+import com.zhongzheng.modules.bank.vo.ExamTempQuestionVo;
+
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * 随机试卷题目关系Service接口
+ *
+ * @author hjl
+ * @date 2022-11-14
+ */
+public interface IExamTempQuestionService extends IService<ExamTempQuestion> {
+	/**
+	 * 查询单个
+	 * @return
+	 */
+	ExamTempQuestionVo queryById(Long id);
+
+	/**
+	 * 查询列表
+	 */
+	List<ExamTempQuestionVo> queryList(ExamTempQuestionQueryBo bo);
+
+	/**
+	 * 根据新增业务对象插入随机试卷题目关系
+	 * @param bo 随机试卷题目关系新增业务对象
+	 * @return
+	 */
+	Boolean insertByAddBo(ExamTempQuestionAddBo bo);
+
+	/**
+	 * 根据编辑业务对象修改随机试卷题目关系
+	 * @param bo 随机试卷题目关系编辑业务对象
+	 * @return
+	 */
+	Boolean updateByEditBo(ExamTempQuestionEditBo bo);
+
+	/**
+	 * 校验并删除数据
+	 * @param ids 主键集合
+	 * @param isValid 是否校验,true-删除前校验,false-不校验
+	 * @return
+	 */
+	Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
+}

+ 57 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/IExamTempService.java

@@ -0,0 +1,57 @@
+package com.zhongzheng.modules.bank.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.zhongzheng.modules.bank.bo.ExamTempAddBo;
+import com.zhongzheng.modules.bank.bo.ExamTempEditBo;
+import com.zhongzheng.modules.bank.bo.ExamTempQueryBo;
+import com.zhongzheng.modules.bank.domain.ExamTemp;
+import com.zhongzheng.modules.bank.vo.ExamTempVo;
+import com.zhongzheng.modules.bank.vo.QuestionVo;
+
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * 随机生成试卷Service接口
+ *
+ * @author hjl
+ * @date 2022-11-14
+ */
+public interface IExamTempService extends IService<ExamTemp> {
+	/**
+	 * 查询单个
+	 * @return
+	 */
+	ExamTempVo queryById(Long examId);
+
+	/**
+	 * 查询列表
+	 */
+	List<ExamTempVo> queryList(ExamTempQueryBo bo);
+
+	List<QuestionVo> getQuestionList(ExamTempQueryBo bo);
+
+	/**
+	 * 根据新增业务对象插入随机生成试卷
+	 * @param bo 随机生成试卷新增业务对象
+	 * @return
+	 */
+	ExamTempVo insertByAddBo(ExamTempAddBo bo);
+
+
+
+	/**
+	 * 根据编辑业务对象修改随机生成试卷
+	 * @param bo 随机生成试卷编辑业务对象
+	 * @return
+	 */
+	Boolean updateByEditBo(ExamTempEditBo bo);
+
+	/**
+	 * 校验并删除数据
+	 * @param ids 主键集合
+	 * @param isValid 是否校验,true-删除前校验,false-不校验
+	 * @return
+	 */
+	Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
+}

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

@@ -8,10 +8,13 @@ import com.zhongzheng.modules.bank.bo.QuestionBatchDelBo;
 import com.zhongzheng.modules.bank.bo.QuestionEditBo;
 import com.zhongzheng.modules.bank.bo.QuestionQueryBo;
 import com.zhongzheng.modules.bank.domain.Question;
+import com.zhongzheng.modules.bank.vo.ExamVo;
 import com.zhongzheng.modules.bank.vo.QuestionImport;
 import com.zhongzheng.modules.bank.vo.QuestionImportV2;
 import com.zhongzheng.modules.bank.vo.QuestionVo;
-import com.zhongzheng.modules.goods.bo.GoodsQueryBo;
+import com.zhongzheng.modules.goods.bo.*;
+import com.zhongzheng.modules.goods.vo.BankGoodsExamVo;
+import com.zhongzheng.modules.goods.vo.GoodsExamTimeVo;
 import com.zhongzheng.modules.goods.vo.GoodsUserQuestionVo;
 import org.springframework.web.multipart.MultipartFile;
 
@@ -83,4 +86,14 @@ public interface IQuestionService extends IService<Question> {
 	Map<String,Object> importWordQuestionList(MultipartFile file, Long eduId, Long projectId, Long businessId, Long subjectId);
 
     boolean batchDelQuestion(QuestionBatchDelBo bo);
+
+    List<BankGoodsExamVo> getBankGoodsExamList(Long goodsId);
+
+	boolean addGoodsExamTime(List<BankGoodsExamAddBo> addBo);
+
+	GoodsExamTimeVo getToDayExam(Long goodsId,Long userId);
+
+	List<TodayExamTobVo> getTodayExamTob(Long goodsId, Long userId);
+
+	TodayExamWeekRecordDetailVo getTodayExamWeekRecord(Long goodsId, Long userId);
 }

+ 5 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/impl/ExamQuestionServiceImpl.java

@@ -59,6 +59,11 @@ public class ExamQuestionServiceImpl extends ServiceImpl<ExamQuestionMapper, Exa
         return examQuestionMapper.getAppList(bo);
     }
 
+    @Override
+    public List<ExamQuestionVo> getAppTempList(ExamQuestionQueryBo bo) {
+        return examQuestionMapper.getAppTempList(bo);
+    }
+
     /**
     * 实体类转化成视图对象
     *

+ 23 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/impl/ExamServiceImpl.java

@@ -5,6 +5,8 @@ import cn.hutool.core.lang.Validator;
 import cn.hutool.core.util.StrUtil;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
+import com.baomidou.mybatisplus.core.toolkit.StringUtils;
 import com.zhongzheng.common.exception.CustomException;
 import com.zhongzheng.common.utils.DateUtils;
 import com.zhongzheng.common.utils.ServletUtils;
@@ -27,7 +29,9 @@ import com.zhongzheng.modules.goods.bo.GoodsAttachedQueryBo;
 import com.zhongzheng.modules.goods.domain.GoodsAttached;
 import com.zhongzheng.modules.goods.service.IGoodsAttachedService;
 import com.zhongzheng.modules.goods.vo.GoodsAttachedVo;
+import com.zhongzheng.modules.user.bo.CheckUserExamRecordBo;
 import com.zhongzheng.modules.user.domain.User;
+import com.zhongzheng.modules.user.service.IUserExamRecordService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -65,6 +69,8 @@ public class ExamServiceImpl extends ServiceImpl<ExamMapper, Exam> implements IE
 
     @Autowired
     private ExamMapper examMapper;
+    @Autowired
+    private IUserExamRecordService iUserExamRecordService;
 
     @Override
     public ExamVo queryById(Long examId){
@@ -76,7 +82,14 @@ public class ExamServiceImpl extends ServiceImpl<ExamMapper, Exam> implements IE
 
     @Override
     public List<ExamVo> getList(ExamQueryBo bo) {
-        return examMapper.getList(bo);
+        List<ExamVo> list = examMapper.getList(bo);
+        if (ObjectUtils.isNotNull(bo.getExclude()) && bo.getExclude() == 1){
+            //排除随机练习和每日一练试卷类型
+            List<String> paperNames = Arrays.asList("每日一练", "随机练习");
+            list = list.stream().filter(x -> StringUtils.isBlank(x.getPaperName())
+                     || !paperNames.contains(x.getPaperName())).collect(Collectors.toList());
+        }
+        return list;
     }
 
     @Override
@@ -164,6 +177,9 @@ public class ExamServiceImpl extends ServiceImpl<ExamMapper, Exam> implements IE
     @Override
     @Transactional(rollbackFor = Exception.class)
     public Boolean updateByEditBo(ExamEditBo bo) {
+        if(Validator.isEmpty(bo.getExamId())){
+            throw new CustomException("试卷ID缺失");
+        }
         Exam update = BeanUtil.toBean(bo, Exam.class);
         validEntityBeforeSave(update);
         update.setUpdateTime(DateUtils.getNowTime());
@@ -278,10 +294,16 @@ public class ExamServiceImpl extends ServiceImpl<ExamMapper, Exam> implements IE
     }
 
     @Override
+    @Transactional(rollbackFor = Exception.class)
     public boolean batchDelExam(QuestionBatchDelBo bo) {
         if (CollectionUtils.isEmpty(bo.getIds())){
             throw new CustomException("试卷ID不能为空");
         }
+        CheckUserExamRecordBo checkBo = new CheckUserExamRecordBo();
+        checkBo.setExamIds(bo.getIds());
+        if (iUserExamRecordService.checkBatchUserExamRecord(checkBo) > 0){
+            throw new CustomException("存在学员已做过的试卷,不能删除,请检查!");
+        }
         return update(new LambdaUpdateWrapper<Exam>()
                 .set(Exam::getStatus,bo.getStatus())
                 .in(Exam::getExamId,bo.getIds()));

+ 98 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/impl/ExamTempQuestionServiceImpl.java

@@ -0,0 +1,98 @@
+package com.zhongzheng.modules.bank.service.impl;
+
+import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.util.StrUtil;
+import com.zhongzheng.common.utils.DateUtils;
+import com.zhongzheng.modules.bank.bo.ExamTempQuestionAddBo;
+import com.zhongzheng.modules.bank.bo.ExamTempQuestionEditBo;
+import com.zhongzheng.modules.bank.bo.ExamTempQuestionQueryBo;
+import com.zhongzheng.modules.bank.domain.ExamTempQuestion;
+import com.zhongzheng.modules.bank.mapper.ExamTempQuestionMapper;
+import com.zhongzheng.modules.bank.service.IExamTempQuestionService;
+import com.zhongzheng.modules.bank.vo.ExamTempQuestionVo;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.github.pagehelper.Page;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * 随机试卷题目关系Service业务层处理
+ *
+ * @author hjl
+ * @date 2022-11-14
+ */
+@Service
+public class ExamTempQuestionServiceImpl extends ServiceImpl<ExamTempQuestionMapper, ExamTempQuestion> implements IExamTempQuestionService {
+
+    @Override
+    public ExamTempQuestionVo queryById(Long id){
+        ExamTempQuestion db = this.baseMapper.selectById(id);
+        return BeanUtil.toBean(db, ExamTempQuestionVo.class);
+    }
+
+    @Override
+    public List<ExamTempQuestionVo> queryList(ExamTempQuestionQueryBo bo) {
+        LambdaQueryWrapper<ExamTempQuestion> lqw = Wrappers.lambdaQuery();
+        lqw.eq(bo.getExamId() != null, ExamTempQuestion::getExamId, bo.getExamId());
+        lqw.eq(bo.getQuestionId() != null, ExamTempQuestion::getQuestionId, bo.getQuestionId());
+        lqw.eq(bo.getSort() != null, ExamTempQuestion::getSort, bo.getSort());
+        return entity2Vo(this.list(lqw));
+    }
+
+    /**
+    * 实体类转化成视图对象
+    *
+    * @param collection 实体类集合
+    * @return
+    */
+    private List<ExamTempQuestionVo> entity2Vo(Collection<ExamTempQuestion> collection) {
+        List<ExamTempQuestionVo> voList = collection.stream()
+                .map(any -> BeanUtil.toBean(any, ExamTempQuestionVo.class))
+                .collect(Collectors.toList());
+        if (collection instanceof Page) {
+            Page<ExamTempQuestion> page = (Page<ExamTempQuestion>)collection;
+            Page<ExamTempQuestionVo> pageVo = new Page<>();
+            BeanUtil.copyProperties(page,pageVo);
+            pageVo.addAll(voList);
+            voList = pageVo;
+        }
+        return voList;
+    }
+
+    @Override
+    public Boolean insertByAddBo(ExamTempQuestionAddBo bo) {
+        ExamTempQuestion add = BeanUtil.toBean(bo, ExamTempQuestion.class);
+        validEntityBeforeSave(add);
+        return this.save(add);
+    }
+
+    @Override
+    public Boolean updateByEditBo(ExamTempQuestionEditBo bo) {
+        ExamTempQuestion update = BeanUtil.toBean(bo, ExamTempQuestion.class);
+        validEntityBeforeSave(update);
+        return this.updateById(update);
+    }
+
+    /**
+     * 保存前的数据校验
+     *
+     * @param entity 实体类数据
+     */
+    private void validEntityBeforeSave(ExamTempQuestion entity){
+        //TODO 做一些数据校验,如唯一约束
+    }
+
+    @Override
+    public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
+        if(isValid){
+            //TODO 做一些业务上的校验,判断是否需要校验
+        }
+        return this.removeByIds(ids);
+    }
+}

+ 172 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/impl/ExamTempServiceImpl.java

@@ -0,0 +1,172 @@
+package com.zhongzheng.modules.bank.service.impl;
+
+import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.lang.Validator;
+import cn.hutool.core.util.StrUtil;
+import com.zhongzheng.common.exception.CustomException;
+import com.zhongzheng.common.utils.DateUtils;
+import com.zhongzheng.common.utils.ServletUtils;
+import com.zhongzheng.modules.bank.bo.*;
+import com.zhongzheng.modules.bank.domain.ExamQuestion;
+import com.zhongzheng.modules.bank.domain.ExamTemp;
+import com.zhongzheng.modules.bank.domain.ExamTempQuestion;
+import com.zhongzheng.modules.bank.mapper.ExamTempMapper;
+import com.zhongzheng.modules.bank.service.IExamTempQuestionService;
+import com.zhongzheng.modules.bank.service.IExamTempService;
+import com.zhongzheng.modules.bank.vo.ExamTempVo;
+import com.zhongzheng.modules.bank.vo.QuestionVo;
+import com.zhongzheng.modules.course.domain.CourseBusiness;
+import com.zhongzheng.modules.exam.domain.ExamPaper;
+import com.zhongzheng.modules.exam.service.IExamPaperService;
+import com.zhongzheng.modules.order.domain.OrderGoods;
+import com.zhongzheng.modules.order.service.IOrderGoodsService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.github.pagehelper.Page;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * 随机生成试卷Service业务层处理
+ *
+ * @author hjl
+ * @date 2022-11-14
+ */
+@Service
+public class ExamTempServiceImpl extends ServiceImpl<ExamTempMapper, ExamTemp> implements IExamTempService {
+
+    @Autowired
+    private IOrderGoodsService iOrderGoodsService;
+
+    @Autowired
+    private IExamTempQuestionService iExamTempQuestionService;
+
+    @Autowired
+    private IExamPaperService iExamPaperService;
+
+    @Override
+    public ExamTempVo queryById(Long examId){
+        ExamTemp db = this.baseMapper.selectById(examId);
+        return BeanUtil.toBean(db, ExamTempVo.class);
+    }
+
+    @Override
+    public List<ExamTempVo> queryList(ExamTempQueryBo bo) {
+        LambdaQueryWrapper<ExamTemp> lqw = Wrappers.lambdaQuery();
+        lqw.eq(bo.getStatus() != null, ExamTemp::getStatus, bo.getStatus());
+        lqw.like(StrUtil.isNotBlank(bo.getExamName()), ExamTemp::getExamName, bo.getExamName());
+        lqw.eq(bo.getGoodsId() != null, ExamTemp::getGoodsId, bo.getGoodsId());
+        lqw.eq(bo.getUserId() != null, ExamTemp::getUserId, bo.getUserId());
+        return entity2Vo(this.list(lqw));
+    }
+
+    @Override
+    public List<QuestionVo> getQuestionList(ExamTempQueryBo bo) {
+        return this.baseMapper.getQuestionList(bo);
+    }
+
+    /**
+    * 实体类转化成视图对象
+    *
+    * @param collection 实体类集合
+    * @return
+    */
+    private List<ExamTempVo> entity2Vo(Collection<ExamTemp> collection) {
+        List<ExamTempVo> voList = collection.stream()
+                .map(any -> BeanUtil.toBean(any, ExamTempVo.class))
+                .collect(Collectors.toList());
+        if (collection instanceof Page) {
+            Page<ExamTemp> page = (Page<ExamTemp>)collection;
+            Page<ExamTempVo> pageVo = new Page<>();
+            BeanUtil.copyProperties(page,pageVo);
+            pageVo.addAll(voList);
+            voList = pageVo;
+        }
+        return voList;
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public ExamTempVo insertByAddBo(ExamTempAddBo bo) {
+        ExamTemp add = BeanUtil.toBean(bo, ExamTemp.class);
+        validEntityBeforeSave(add);
+        OrderGoods orderGoods = iOrderGoodsService.getOne(new LambdaQueryWrapper<OrderGoods>()
+                .eq(OrderGoods::getOrderGoodsId, bo.getOrderGoodsId()));
+        if(Validator.isEmpty(orderGoods)||!orderGoods.getGoodsId().equals(bo.getGoodsId())){
+            throw new CustomException("订单商品ID错误");
+        }
+        if(Validator.isEmpty(bo.getNumber())){
+            throw new CustomException("题目数量错误");
+        }
+        ExamPaper examPaper = iExamPaperService.getOne(new LambdaQueryWrapper<ExamPaper>().eq(ExamPaper::getStatus, 1).eq(ExamPaper::getPaperName,"随机练习").last("limit 1"));
+        if(Validator.isEmpty(examPaper)){
+            throw new CustomException("系统不存在随机练习试卷类型");
+        }
+        ExamTempQueryBo queryBo = new ExamTempQueryBo();
+        queryBo.setGoodsId(bo.getGoodsId());
+        queryBo.setOrderGoodsId(bo.getOrderGoodsId());
+        queryBo.setNumber(bo.getNumber());
+        List<QuestionVo> questionlist = getQuestionList(queryBo);
+
+        add.setExamName(ServletUtils.getEncoded("随机练习试卷-")+bo.getOrderGoodsId());
+        add.setExamPaperId(examPaper.getPaperId());
+        add.setCreateTime(DateUtils.getNowTime());
+        add.setUpdateTime(DateUtils.getNowTime());
+        boolean result = this.save(add);
+        if(questionlist.size()==0){
+            throw new CustomException("你的题目已经做完了");
+        }
+        if(questionlist!=null){
+            Collection<ExamTempQuestion> coll = new HashSet<>();
+            for(int i=0;i<questionlist.size();i++){
+                QuestionVo questionVo = questionlist.get(i);
+                ExamTempQuestion addItem = new ExamTempQuestion();
+                addItem.setExamId(add.getExamId());
+                addItem.setQuestionId(questionVo.getQuestionId());
+                addItem.setSort(new Long(i));
+                coll.add(addItem);
+                System.out.println(addItem);
+            }
+            if(!iExamTempQuestionService.saveBatch(coll)){
+                throw new CustomException("试卷绑定错误");
+            }
+        }
+        ExamTempVo examTempVo = BeanUtil.toBean(add, ExamTempVo.class);
+        examTempVo.setQuestionList(questionlist);
+        examTempVo.setDoMode(2);
+        return examTempVo;
+    }
+
+    @Override
+    public Boolean updateByEditBo(ExamTempEditBo bo) {
+        ExamTemp update = BeanUtil.toBean(bo, ExamTemp.class);
+        validEntityBeforeSave(update);
+        update.setUpdateTime(DateUtils.getNowTime());
+        return this.updateById(update);
+    }
+
+    /**
+     * 保存前的数据校验
+     *
+     * @param entity 实体类数据
+     */
+    private void validEntityBeforeSave(ExamTemp entity){
+        //TODO 做一些数据校验,如唯一约束
+    }
+
+    @Override
+    public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
+        if(isValid){
+            //TODO 做一些业务上的校验,判断是否需要校验
+        }
+        return this.removeByIds(ids);
+    }
+}

+ 10 - 2
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/impl/QuestionChapterServiceImpl.java

@@ -18,6 +18,8 @@ import com.zhongzheng.modules.bank.vo.QuestionChapterVo;
 import com.zhongzheng.modules.course.bo.CourseSectionAddBo;
 import com.zhongzheng.modules.goods.domain.GoodsAttached;
 import com.zhongzheng.modules.goods.service.IGoodsAttachedService;
+import com.zhongzheng.modules.user.bo.CheckUserExamRecordBo;
+import com.zhongzheng.modules.user.service.IUserExamRecordService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -47,8 +49,8 @@ public class QuestionChapterServiceImpl extends ServiceImpl<QuestionChapterMappe
     private QuestionChapterMapper questionChapterMapper;
     @Autowired
     private IGoodsAttachedService iGoodsAttachedService;
-
-
+    @Autowired
+    private IUserExamRecordService iUserExamRecordService;
     @Autowired
     private IQuestionModuleChapterService iQuestionModuleChapterService;
 
@@ -205,10 +207,16 @@ public class QuestionChapterServiceImpl extends ServiceImpl<QuestionChapterMappe
     }
 
     @Override
+    @Transactional(rollbackFor = Exception.class)
     public boolean batchDelChapterExam(QuestionBatchDelBo bo) {
         if (CollectionUtils.isEmpty(bo.getIds())){
             throw new CustomException("章卷ID不能为空");
         }
+        CheckUserExamRecordBo checkBo = new CheckUserExamRecordBo();
+        checkBo.setChapterExamIds(bo.getIds());
+        if (iUserExamRecordService.checkBatchUserExamRecord(checkBo) > 0){
+            throw new CustomException("存在学员已做过的章卷,不能删除,请检查!");
+        }
         return update(new LambdaUpdateWrapper<QuestionChapter>()
                 .set(QuestionChapter::getStatus,bo.getStatus())
                 .in(QuestionChapter::getChapterExamId,bo.getIds()));

+ 12 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/impl/QuestionModuleServiceImpl.java

@@ -19,6 +19,8 @@ import com.zhongzheng.modules.bank.vo.QuestionModuleVo;
 import com.zhongzheng.modules.course.domain.CourseModule;
 import com.zhongzheng.modules.goods.domain.GoodsAttached;
 import com.zhongzheng.modules.goods.service.IGoodsAttachedService;
+import com.zhongzheng.modules.user.bo.CheckUserExamRecordBo;
+import com.zhongzheng.modules.user.service.IUserExamRecordService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -54,6 +56,9 @@ public class QuestionModuleServiceImpl extends ServiceImpl<QuestionModuleMapper,
     @Autowired
     private IGoodsAttachedService iGoodsAttachedService;
 
+    @Autowired
+    private IUserExamRecordService iUserExamRecordService;
+
     @Override
     public QuestionModuleVo queryById(Long questionModuleId){
         QuestionModule db = this.baseMapper.selectById(questionModuleId);
@@ -186,12 +191,19 @@ public class QuestionModuleServiceImpl extends ServiceImpl<QuestionModuleMapper,
     }
 
     @Override
+    @Transactional(rollbackFor = Exception.class)
     public boolean batchDelModuleExam(QuestionBatchDelBo bo) {
         if (CollectionUtils.isEmpty(bo.getIds())){
             throw new CustomException("模块卷ID不能为空");
         }
+        CheckUserExamRecordBo checkBo = new CheckUserExamRecordBo();
+        checkBo.setModuleExamIds(bo.getIds());
+        if (iUserExamRecordService.checkBatchUserExamRecord(checkBo) > 0){
+            throw new CustomException("存在学员已做过的模块卷,不能删除,请检查!");
+        }
         return update(new LambdaUpdateWrapper<QuestionModule>()
                 .set(QuestionModule::getStatus,bo.getStatus())
+                .set(QuestionModule::getUpdateTime,DateUtils.getNowTime())
                 .in(QuestionModule::getModuleExamId,bo.getIds()));
     }
 }

+ 195 - 2
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/impl/QuestionServiceImpl.java

@@ -7,6 +7,7 @@ import cn.hutool.extra.tokenizer.Word;
 import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import com.zhongzheng.common.constant.Constants;
 import com.zhongzheng.common.core.domain.entity.SysUser;
 import com.zhongzheng.common.core.redis.RedisCache;
@@ -20,6 +21,7 @@ import com.zhongzheng.modules.bank.bo.*;
 import com.zhongzheng.modules.bank.domain.*;
 import com.zhongzheng.modules.bank.mapper.QuestionMapper;
 import com.zhongzheng.modules.bank.service.IExamQuestionService;
+import com.zhongzheng.modules.bank.service.IExamService;
 import com.zhongzheng.modules.bank.service.IQuestionBusinessService;
 import com.zhongzheng.modules.bank.service.IQuestionService;
 import com.zhongzheng.modules.bank.vo.*;
@@ -31,10 +33,27 @@ import com.zhongzheng.modules.exam.bo.ExamKnowledgeAddBo;
 import com.zhongzheng.modules.exam.bo.ExamKnowledgeBusinessAddBo;
 import com.zhongzheng.modules.exam.domain.ExamKnowledge;
 import com.zhongzheng.modules.exam.service.IExamKnowledgeService;
+import com.zhongzheng.modules.goods.bo.BankGoodsExamAddBo;
 import com.zhongzheng.modules.goods.bo.GoodsQueryBo;
+import com.zhongzheng.modules.goods.bo.TodayExamTobVo;
+import com.zhongzheng.modules.goods.bo.TodayExamWeekRecordDetailVo;
+import com.zhongzheng.modules.goods.domain.Goods;
+import com.zhongzheng.modules.goods.domain.GoodsExamTime;
+import com.zhongzheng.modules.goods.service.IGoodsExamTimeService;
 import com.zhongzheng.modules.goods.service.IGoodsService;
+import com.zhongzheng.modules.goods.vo.BankGoodsExamVo;
+import com.zhongzheng.modules.goods.vo.GoodsExamTimeVo;
 import com.zhongzheng.modules.goods.vo.GoodsUserQuestionVo;
 
+import com.zhongzheng.modules.user.bo.CheckUserExamRecordBo;
+import com.zhongzheng.modules.user.bo.UserSpecialExamRecord;
+import com.zhongzheng.modules.user.domain.User;
+import com.zhongzheng.modules.user.domain.UserExamRecord;
+import com.zhongzheng.modules.user.domain.UserExamSubscription;
+import com.zhongzheng.modules.user.service.IUserExamRecordService;
+import com.zhongzheng.modules.user.service.IUserExamSubscriptionService;
+import com.zhongzheng.modules.user.service.IUserService;
+import com.zhongzheng.modules.user.service.IUserSpecialExamRecordService;
 import org.apache.poi.openxml4j.opc.PackagePart;
 import org.apache.poi.xwpf.usermodel.XWPFDocument;
 import org.apache.poi.xwpf.usermodel.XWPFParagraph;
@@ -48,12 +67,14 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.github.pagehelper.Page;
 import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.unit.DataUnit;
 import org.springframework.web.multipart.MultipartFile;
 import org.w3c.dom.NamedNodeMap;
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
 
 import java.io.*;
+import java.text.NumberFormat;
 import java.util.*;
 import java.util.concurrent.TimeUnit;
 import java.util.stream.Collectors;
@@ -93,6 +114,24 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
     @Autowired
     private IExamQuestionService iExamQuestionService;
 
+    @Autowired
+    private IUserExamRecordService iUserExamRecordService;
+
+    @Autowired
+    private IGoodsExamTimeService goodsExamTimeService;
+
+    @Autowired
+    private IUserSpecialExamRecordService userSpecialExamRecordService;
+
+    @Autowired
+    private IUserExamSubscriptionService iUserExamSubscriptionService;
+
+    @Autowired
+    private IUserService iUserService;
+
+    @Autowired
+    private IExamService iExamService;
+
     @Autowired
     private IGoodsService iGoodsService;
 
@@ -727,8 +766,10 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
                     }
                 }
             }
+            String tempTxt = "";
             for(QuestionImportContent vo : question.getQuestionList()){
-                if(Validator.isNotEmpty(vo.getContent())){
+                if(Validator.isNotEmpty(vo.getContent())&&!tempTxt.equals(vo.getContent())){
+                    tempTxt = vo.getContent();
                     type = findType(vo.getType());
                     if(isFirst){
                         isFirst = false;
@@ -818,10 +859,13 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
         List<QuestionChildAddBo> optionsList = new ArrayList<>(); //题目选项
         List<Long> answerList = new ArrayList<>(); //答案选项
         Long j = 1L;
+        String tempTxt = list.get(startIndex).getContent();
         for(int i = startIndex;i<list.size();i++){
             QuestionImportContent entity = list.get(i);
             if(Validator.isNotEmpty(entity.getContent())&&i>startIndex){
-                break;
+                if(!tempTxt.equals(entity.getContent())){
+                    break;
+                }
             }
             if(Validator.isEmpty(entity.getOption())){
                 continue;
@@ -1716,15 +1760,164 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
     }
 
     @Override
+    @Transactional(rollbackFor = Exception.class)
     public boolean batchDelQuestion(QuestionBatchDelBo bo) {
         if (CollectionUtils.isEmpty(bo.getIds())){
             throw new CustomException("题目ID不能为空");
         }
+        CheckUserExamRecordBo checkBo = new CheckUserExamRecordBo();
+        checkBo.setQuestionIds(bo.getIds());
+        if (iUserExamRecordService.checkBatchUserExamRecord(checkBo) > 0){
+            throw new CustomException("存在学员已做过的题目,不能删除,请检查!");
+        }
         return update(new LambdaUpdateWrapper<Question>()
                 .set(Question::getStatus,bo.getStatus())
                 .in(Question::getQuestionId,bo.getIds()));
     }
 
+    @Override
+    public List<BankGoodsExamVo> getBankGoodsExamList(Long goodsId) {
+        Goods goods = iGoodsService.getById(goodsId);
+        if (ObjectUtils.isNull(goods)){
+            throw new CustomException("商品信息获取失败!");
+        }
+        //获取题库商品的所有试卷
+        List<BankGoodsExamVo> examAllList = baseMapper.getBankGoodsExamList(goodsId);
+        //筛选每日一练试卷
+        List<BankGoodsExamVo> examList = examAllList.stream().filter(item -> item.getPaperName().equals("每日一练")).collect(Collectors.toList());
+        //获取试卷时间
+        examList.forEach(item -> {
+            GoodsExamTime examTime = goodsExamTimeService.getOne(new LambdaQueryWrapper<GoodsExamTime>()
+                    .eq(GoodsExamTime::getGoodsId, goodsId)
+                    .eq(GoodsExamTime::getModuleExamId, item.getModuleExamId())
+                    .eq(GoodsExamTime::getChapterExamId, item.getChapterExamId())
+                    .eq(GoodsExamTime::getExamId, item.getExamId())
+                    .eq(GoodsExamTime::getStatus, 1));
+            if (ObjectUtils.isNotNull(examTime)){
+                item.setExamTime(examTime.getExamTime());
+            }
+        });
+        return examList;
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public boolean addGoodsExamTime(List<BankGoodsExamAddBo> addBo) {
+        Long goodsId = addBo.get(0).getGoodsId();
+        //先删除之前的时间
+        goodsExamTimeService.remove(new LambdaQueryWrapper<GoodsExamTime>()
+        .eq(GoodsExamTime::getGoodsId,goodsId));
+        //添加新时间
+        List<GoodsExamTime> entitys = addBo.stream().filter(x -> ObjectUtils.isNotNull(x.getExamTime())).map(item -> {
+            GoodsExamTime examTime = BeanUtil.toBean(item, GoodsExamTime.class);
+            examTime.setStatus(1);
+            examTime.setCreateTime(DateUtils.getNowTime());
+            examTime.setUpdateTime(DateUtils.getNowTime());
+            return examTime;
+        }).collect(Collectors.toList());
+
+        return goodsExamTimeService.saveBatch(entitys);
+    }
+
+    @Override
+    public GoodsExamTimeVo getToDayExam(Long goodsId,Long userId) {
+        Long todayZeroTime = DateUtils.getTodayZeroTime();
+        GoodsExamTime goodsExamTime = goodsExamTimeService.getOne(new LambdaQueryWrapper<GoodsExamTime>()
+                .eq(GoodsExamTime::getGoodsId, goodsId)
+                .eq(GoodsExamTime::getExamTime, todayZeroTime));
+        if (ObjectUtils.isNull(goodsExamTime)){
+            //当天没有设置试卷
+            return null;
+        }
+        GoodsExamTimeVo vo = BeanUtil.toBean(goodsExamTime, GoodsExamTimeVo.class);
+        Exam exam = iExamService.getById(vo.getExamId());
+        vo.setExamName(exam.getExamName());
+        //明日打卡试卷名称
+        GoodsExamTime goodsExamTimeTwo = goodsExamTimeService.getOne(new LambdaQueryWrapper<GoodsExamTime>()
+                .eq(GoodsExamTime::getGoodsId, goodsId)
+                .eq(GoodsExamTime::getExamTime, DateUtils.getTomorrowZeroTime()));
+        if (ObjectUtils.isNotNull(goodsExamTimeTwo)){
+            Exam examTwo = iExamService.getById(goodsExamTimeTwo.getExamId());
+            vo.setExamNameBelow(examTwo.getExamName());
+        }
+        //是否订阅消息
+        UserExamSubscription subscription = iUserExamSubscriptionService
+                .getOne(new LambdaQueryWrapper<UserExamSubscription>()
+                .eq(UserExamSubscription::getGoodsId, goodsId)
+                .eq(UserExamSubscription::getUserId, userId));
+        if (ObjectUtils.isNotNull(subscription) && subscription.getSubscriptionStatus() == 1){
+            vo.setSubscription(1);
+        }else {
+            vo.setSubscription(0);
+        }
+        //获取打卡记录
+        List<UserSpecialExamRecord> list = userSpecialExamRecordService.list(new LambdaQueryWrapper<UserSpecialExamRecord>()
+                .eq(UserSpecialExamRecord::getGoodsId, vo.getGoodsId()));
+        if (CollectionUtils.isNotEmpty(list)){
+            //我的累计打卡次数
+                Long recordCount = list.stream().filter(x -> x.getUserId().equals(userId)).count();
+            vo.setRecordCount(recordCount.intValue());
+            //打卡百分比
+            Map<Long, List<UserSpecialExamRecord>> collect = list.stream().collect(Collectors.groupingBy(UserSpecialExamRecord::getUserId));
+            Long count = collect.values().stream().filter(item -> item.size() < recordCount).count();
+            Long countAll = collect.keySet().stream().filter(x -> !x.equals(userId)).count();
+            String percent = getPercent(count.intValue(), countAll.intValue());
+            vo.setRecordPercentage(percent);
+            //当天是否打卡
+            Long record = list.stream().filter(item -> item.getUserId().equals(userId)
+                    && item.getGoodsId().equals(vo.getGoodsId()) && item.getModuleExamId().equals(vo.getModuleExamId())
+                    && item.getChapterExamId().equals(vo.getChapterExamId()) && item.getExamId().equals(vo.getExamId())
+                    && item.getRecordTime().equals(DateUtils.getTodayZeroTime())).count();
+            vo.setExamRecord(record > 0 ? 1:0);
+        }else {
+            vo.setRecordCount(0);
+            vo.setRecordPercentage("0.00%");
+            vo.setExamRecord(0);
+        }
+        return vo;
+    }
+
+    @Override
+    public List<TodayExamTobVo> getTodayExamTob(Long goodsId, Long userId) {
+        //获取商品的打卡记录
+        List<UserSpecialExamRecord> recordList = userSpecialExamRecordService
+                .list(new LambdaQueryWrapper<UserSpecialExamRecord>()
+                .eq(UserSpecialExamRecord::getGoodsId, goodsId));
+        if (CollectionUtils.isEmpty(recordList)){
+            return new ArrayList<>();
+        }
+        List<TodayExamTobVo> voList = new ArrayList<>();
+        recordList.stream().collect(Collectors.groupingBy(UserSpecialExamRecord::getUserId)).forEach((k,v) -> {
+            TodayExamTobVo vo = new TodayExamTobVo();
+            vo.setUserId(k);
+            vo.setRecordCount(v.size());
+            User user = iUserService.getById(k);
+            vo.setUserName(user.getNickname());
+        });
+        return voList.stream().sorted(Comparator.comparing(TodayExamTobVo::getRecordCount).reversed()).collect(Collectors.toList());
+    }
+
+    @Override
+    public TodayExamWeekRecordDetailVo getTodayExamWeekRecord(Long goodsId, Long userId) {
+       //获取每日一练的打卡记录
+        List<UserSpecialExamRecord> recordList = userSpecialExamRecordService
+                .list(new LambdaQueryWrapper<UserSpecialExamRecord>()
+                .eq(UserSpecialExamRecord::getUserId, userId)
+                .eq(UserSpecialExamRecord::getGoodsId, goodsId));
+
+        return null;
+    }
+
+    private String getPercent(Integer x,Integer y){
+        Double d1 = x * 1.0;
+        Double d2 = y * 1.0;
+
+        NumberFormat format = NumberFormat.getPercentInstance();
+        format.setMinimumFractionDigits(2);
+        return format.format(d1 / d2);
+    }
+
+
 
     private String removeNo(String txt) {
         int intIndex = txt.indexOf("、");

+ 39 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/vo/ExamTempQuestionVo.java

@@ -0,0 +1,39 @@
+package com.zhongzheng.modules.bank.vo;
+
+import com.zhongzheng.common.annotation.Excel;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import java.util.Date;
+
+
+
+/**
+ * 随机试卷题目关系视图对象 mall_package
+ *
+ * @author hjl
+ * @date 2022-11-14
+ */
+@Data
+@ApiModel("随机试卷题目关系视图对象")
+public class ExamTempQuestionVo {
+	private static final long serialVersionUID = 1L;
+
+	/** $pkColumn.columnComment */
+	@ApiModelProperty("$pkColumn.columnComment")
+	private Long id;
+
+	/** 试卷ID */
+	@Excel(name = "试卷ID")
+	@ApiModelProperty("试卷ID")
+	private Long examId;
+	/** 题目ID */
+	@Excel(name = "题目ID")
+	@ApiModelProperty("题目ID")
+	private Long questionId;
+	/** 排序 */
+	@Excel(name = "排序")
+	@ApiModelProperty("排序")
+	private Long sort;
+}

+ 64 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/vo/ExamTempVo.java

@@ -0,0 +1,64 @@
+package com.zhongzheng.modules.bank.vo;
+
+import com.zhongzheng.common.annotation.Excel;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import java.util.Date;
+import java.util.List;
+
+
+/**
+ * 随机生成试卷视图对象 mall_package
+ *
+ * @author hjl
+ * @date 2022-11-14
+ */
+@Data
+@ApiModel("随机生成试卷视图对象")
+public class ExamTempVo {
+	private static final long serialVersionUID = 1L;
+
+	/** $pkColumn.columnComment */
+	@ApiModelProperty("$pkColumn.columnComment")
+	private Long examId;
+
+	/**  状态 1正常 0关闭 */
+	@Excel(name = " 状态 1正常 0关闭")
+	@ApiModelProperty(" 状态 1正常 0关闭")
+	private Integer status;
+	/** 试卷名 */
+	@Excel(name = "试卷名")
+	@ApiModelProperty("试卷名")
+	private String examName;
+	/** 商品ID */
+	@Excel(name = "商品ID")
+	@ApiModelProperty("商品ID")
+	private Long goodsId;
+	/** 用户ID */
+	@Excel(name = "用户ID")
+	@ApiModelProperty("用户ID")
+	private Long userId;
+	/** 订单商品ID */
+	@Excel(name = "订单商品ID")
+	@ApiModelProperty("订单商品ID")
+	private Long orderGoodsId;
+
+	/** 做题模式 1章卷 2随机练习 */
+	@Excel(name = "做题模式 1章卷 2随机练习")
+	@ApiModelProperty("做题模式 1章卷 2随机练习")
+	private Integer doMode;
+
+	/** 生成题目数量 */
+	@Excel(name = "生成题目数量")
+	@ApiModelProperty("生成题目数量")
+	private Integer number;
+	@ApiModelProperty("题目列表")
+	private List<QuestionVo> questionList;
+
+	/** 试卷类型id */
+	@Excel(name = "试卷类型id")
+	@ApiModelProperty("试卷类型id")
+	private Long examPaperId;
+}

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/vo/ExamVo.java

@@ -144,5 +144,8 @@ public class ExamVo {
 	@ApiModelProperty("做的题目数")
 	private Long doQuestionNum;
 
+	@ApiModelProperty("试卷类型名称")
+	private String paperName;
+
 
 }

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/vo/QuestionModuleVo.java

@@ -81,4 +81,7 @@ public class QuestionModuleVo {
 	@ApiModelProperty("修改时间")
 	@Excel(name = "修改时间")
 	private Long updateTime;
+
+	@ApiModelProperty("题目数量")
+	private Integer questionNum;
 }

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/collect/bo/CollectQuestionAddBo.java

@@ -35,4 +35,7 @@ public class CollectQuestionAddBo {
     /** 订单商品ID */
     @ApiModelProperty("订单商品ID")
     private Long orderGoodsId;
+    /** 做题模式 1章卷 2随机练习 */
+    @ApiModelProperty("做题模式 1章卷 2随机练习")
+    private Long doMode;
 }

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/collect/bo/CollectQuestionEditBo.java

@@ -34,4 +34,7 @@ public class CollectQuestionEditBo {
     /** 订单商品ID */
     @ApiModelProperty("订单商品ID")
     private Long orderGoodsId;
+    /** 做题模式 1章卷 2随机练习 */
+    @ApiModelProperty("做题模式 1章卷 2随机练习")
+    private Long doMode;
 }

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/collect/bo/CollectQuestionQueryBo.java

@@ -61,4 +61,7 @@ public class CollectQuestionQueryBo extends BaseEntity {
 	/** 业务层次id */
 	@ApiModelProperty("业务层次id")
 	private Long businessId;
+	/** 做题模式 1章卷 2随机练习 */
+	@ApiModelProperty("做题模式 1章卷 2随机练习")
+	private Long doMode;
 }

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/collect/domain/CollectQuestion.java

@@ -44,4 +44,6 @@ private static final long serialVersionUID=1L;
     private Long goodsId;
     /** 订单商品ID */
     private Long orderGoodsId;
+    /** 做题模式 1章卷 2随机练习 */
+    private Long doMode;
 }

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

@@ -52,6 +52,7 @@ public class CollectQuestionServiceImpl extends ServiceImpl<CollectQuestionMappe
         lqw.eq(bo.getUserId() != null, CollectQuestion::getUserId, bo.getUserId());
         lqw.eq(bo.getGoodsId() != null, CollectQuestion::getGoodsId, bo.getGoodsId());
         lqw.eq(bo.getOrderGoodsId() != null, CollectQuestion::getOrderGoodsId, bo.getOrderGoodsId());
+        lqw.eq(bo.getDoMode() != null, CollectQuestion::getDoMode, bo.getDoMode());
         return this.count(lqw);
     }
 

+ 4 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/collect/vo/CollectQuestionVo.java

@@ -54,4 +54,8 @@ public class CollectQuestionVo {
 	@Excel(name = "订单商品ID")
 	@ApiModelProperty("订单商品ID")
 	private Long orderGoodsId;
+	/** 做题模式 1章卷 2随机练习 */
+	@Excel(name = "做题模式 1章卷 2随机练习")
+	@ApiModelProperty("做题模式 1章卷 2随机练习")
+	private Long doMode;
 }

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

@@ -108,4 +108,7 @@ public class CourseQueryBo extends BaseEntity {
 	/** 订单商品Id */
 	@ApiModelProperty("订单商品Id")
 	private Long orderGoodsId;
+
+	@ApiModelProperty("手机号码")
+	private String telphone;
 }

+ 11 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseChapterServiceImpl.java

@@ -18,6 +18,8 @@ import com.zhongzheng.modules.course.service.*;
 import com.zhongzheng.modules.course.vo.CourseChapterVo;
 import com.zhongzheng.modules.goods.bo.GoodsBatchDelBo;
 import com.zhongzheng.modules.goods.domain.GoodsAttached;
+import com.zhongzheng.modules.grade.bo.UserPeriodQueryBo;
+import com.zhongzheng.modules.grade.service.IUserPeriodService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -53,6 +55,9 @@ public class CourseChapterServiceImpl extends ServiceImpl<CourseChapterMapper, C
     @Autowired
     private ICourseModuleChapterService iCourseModuleChapterService;
 
+    @Autowired
+    private IUserPeriodService iUserPeriodService;
+
     @Override
     public CourseChapterVo queryById(Long chapterId){
         return this.baseMapper.getInfo(chapterId);
@@ -200,10 +205,16 @@ public class CourseChapterServiceImpl extends ServiceImpl<CourseChapterMapper, C
     }
 
     @Override
+    @Transactional(rollbackFor = Exception.class)
     public boolean batchDelChapter(GoodsBatchDelBo bo) {
         if (CollectionUtils.isEmpty(bo.getIds())){
             throw new CustomException("模块ID不能为空");
         }
+        UserPeriodQueryBo queryBo = new UserPeriodQueryBo();
+        queryBo.setChapterIds(bo.getIds());
+        if (iUserPeriodService.checkBatchGoodsStudy(queryBo) > 0){
+            throw new CustomException("存在已有学员学习的章,不能删除,请检查!");
+        }
         return update(new LambdaUpdateWrapper<CourseChapter>()
                 .set(CourseChapter::getStatus,bo.getStatus())
                 .in(CourseChapter::getChapterId,bo.getIds()));

+ 12 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseModuleServiceImpl.java

@@ -15,6 +15,8 @@ import com.zhongzheng.modules.course.service.*;
 import com.zhongzheng.modules.course.vo.CourseModuleVo;
 import com.zhongzheng.modules.goods.bo.GoodsBatchDelBo;
 import com.zhongzheng.modules.goods.domain.GoodsAttached;
+import com.zhongzheng.modules.grade.bo.UserPeriodQueryBo;
+import com.zhongzheng.modules.grade.service.IUserPeriodService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -50,6 +52,9 @@ public class CourseModuleServiceImpl extends ServiceImpl<CourseModuleMapper, Cou
     @Autowired
     private ICourseMenuService iCourseMenuService;
 
+    @Autowired
+    private IUserPeriodService iUserPeriodService;
+
     @Override
     public CourseModuleVo queryById(Long moduleId){
         CourseModule db = this.baseMapper.selectById(moduleId);
@@ -188,12 +193,19 @@ public class CourseModuleServiceImpl extends ServiceImpl<CourseModuleMapper, Cou
     }
 
     @Override
+    @Transactional(rollbackFor = Exception.class)
     public boolean batchDelModule(GoodsBatchDelBo bo) {
         if (CollectionUtils.isEmpty(bo.getIds())){
             throw new CustomException("模块ID不能为空");
         }
+        UserPeriodQueryBo queryBo = new UserPeriodQueryBo();
+        queryBo.setModuleIds(bo.getIds());
+        if (iUserPeriodService.checkBatchGoodsStudy(queryBo) > 0){
+            throw new CustomException("存在已有学员学习的模块,不能删除,请检查!");
+        }
         return update(new LambdaUpdateWrapper<CourseModule>()
                 .set(CourseModule::getStatus,bo.getStatus())
+                .set(CourseModule::getUpdateTime,DateUtils.getNowTime())
                 .in(CourseModule::getModuleId,bo.getIds()));
     }
 

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

@@ -25,6 +25,8 @@ import com.zhongzheng.modules.goods.bo.GoodsBatchDelBo;
 import com.zhongzheng.modules.goods.bo.GoodsCourseQueryBo;
 import com.zhongzheng.modules.goods.service.IGoodsCourseService;
 import com.zhongzheng.modules.goods.vo.GoodsCourseVo;
+import com.zhongzheng.modules.grade.bo.UserPeriodQueryBo;
+import com.zhongzheng.modules.grade.service.IUserPeriodService;
 import com.zhongzheng.modules.grade.vo.ClassPeriodVo;
 import com.zhongzheng.modules.polyv.bo.PolyvLiveQueryBo;
 import com.zhongzheng.modules.polyv.service.IPolyvLiveService;
@@ -98,6 +100,9 @@ public class CourseSectionServiceImpl extends ServiceImpl<CourseSectionMapper, C
     @Autowired
     private ICourseChapterService iCourseChapterService;
 
+    @Autowired
+    private IUserPeriodService iUserPeriodService;
+
     @Override
     public CourseSectionVo queryById(Long sectionId){
         CourseSection db = this.baseMapper.selectById(sectionId);
@@ -639,12 +644,19 @@ public class CourseSectionServiceImpl extends ServiceImpl<CourseSectionMapper, C
     }
 
     @Override
+    @Transactional(rollbackFor = Exception.class)
     public boolean batchDelSection(GoodsBatchDelBo bo) {
         if (CollectionUtils.isEmpty(bo.getIds())){
             throw new CustomException("节ID不能为空");
         }
+        UserPeriodQueryBo queryBo = new UserPeriodQueryBo();
+        queryBo.setSectionIds(bo.getIds());
+        if (iUserPeriodService.checkBatchGoodsStudy(queryBo) > 0){
+            throw new CustomException("存在已有学员学习的节,不能删除,请检查!");
+        }
         return update(new LambdaUpdateWrapper<CourseSection>()
                 .set(CourseSection::getStatus,bo.getStatus())
+                .set(CourseSection::getUpdateTime,DateUtils.getNowTime())
                 .in(CourseSection::getSectionId,bo.getIds()));
     }
 

+ 8 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseServiceImpl.java

@@ -34,6 +34,7 @@ import com.zhongzheng.modules.goods.vo.GoodsPeriodVo;
 import com.zhongzheng.modules.goods.vo.GoodsUserVo;
 import com.zhongzheng.modules.goods.vo.GoodsVo;
 import com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo;
+import com.zhongzheng.modules.grade.bo.UserPeriodQueryBo;
 import com.zhongzheng.modules.grade.bo.UserPeriodStatusAddBo;
 import com.zhongzheng.modules.grade.domain.UserPeriodStatus;
 import com.zhongzheng.modules.grade.service.IClassGradeUserService;
@@ -150,12 +151,19 @@ public class CourseServiceImpl extends ServiceImpl<CourseMapper, Course> impleme
     }
 
     @Override
+    @Transactional(rollbackFor = Exception.class)
     public boolean batchDelCourse(GoodsBatchDelBo bo) {
         if (CollectionUtils.isEmpty(bo.getIds())){
             throw new CustomException("课程ID不能为空");
         }
+        UserPeriodQueryBo queryBo = new UserPeriodQueryBo();
+        queryBo.setCourseIds(bo.getIds());
+        if (iUserPeriodService.checkBatchGoodsStudy(queryBo) > 0){
+            throw new CustomException("存在已有学员学习的课程,不能删除,请检查!");
+        }
         return update(new LambdaUpdateWrapper<Course>()
                 .set(Course::getStatus,bo.getStatus())
+                .set(Course::getUpdateTime,DateUtils.getNowTime())
                 .in(Course::getCourseId,bo.getIds()));
     }
 

+ 20 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/bo/ExamTodayRecordBo.java

@@ -0,0 +1,20 @@
+package com.zhongzheng.modules.exam.bo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @author yangdamao
+ * @date 2022年11月15日 15:23
+ */
+@Data
+public class ExamTodayRecordBo implements Serializable {
+
+    @ApiModelProperty("")
+    private Long userId;
+
+    @ApiModelProperty("")
+    private Long goodsId;
+}

+ 5 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/mapper/ExamPaperMapper.java

@@ -3,6 +3,7 @@ package com.zhongzheng.modules.exam.mapper;
 import com.zhongzheng.modules.exam.domain.ExamPaper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.zhongzheng.modules.exam.vo.ExamPaperVo;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 
@@ -14,4 +15,8 @@ import java.util.List;
  */
 public interface ExamPaperMapper extends BaseMapper<ExamPaper> {
     List<ExamPaperVo> getGoodsExamPaper(Long goodsId);
+
+    List<ExamPaperVo> getGoodsExamPaperByGoodsIds(@Param("goodsIds") List<Long> goodsIds);
+
+    List<ExamPaperVo> getGoodsExamPaperByGoodsId(@Param("goodsId") Long goodsId);
 }

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

@@ -51,4 +51,8 @@ public interface IExamPaperService extends IService<ExamPaper> {
 	Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
 
 	List<ExamPaperVo> getGoodsExamPaper(Long goodsId);
+
+	List<ExamPaperVo> getGoodsExamPaperByGoodsIds(List<Long> goodsId);
+
+	List<ExamPaperVo> getGoodsExamPaperByGoodsId(Long goodsId);
 }

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

@@ -326,7 +326,8 @@ public class ExamApplyServiceImpl extends ServiceImpl<ExamApplyMapper, ExamApply
         TableDataInfo tableDataInfo = new TableDataInfo();
         Exam exam = iExamService.getById(bo.getExamId());
         if (ObjectUtils.isNull(exam)){
-            throw new CustomException("获取试卷信息失败");
+//            throw new CustomException("获取试卷信息失败");
+            return new TableDataInfo<>();
         }
         //获取试卷业务层次信息
         QuestionBusiness business = iQuestionBusinessService.getOne(new LambdaQueryWrapper<QuestionBusiness>()

+ 10 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/service/impl/ExamPaperServiceImpl.java

@@ -128,4 +128,14 @@ public class ExamPaperServiceImpl extends ServiceImpl<ExamPaperMapper, ExamPaper
     public List<ExamPaperVo> getGoodsExamPaper(Long goodsId) {
         return this.baseMapper.getGoodsExamPaper(goodsId);
     }
+
+    @Override
+    public List<ExamPaperVo> getGoodsExamPaperByGoodsIds(List<Long> goodsId) {
+        return this.baseMapper.getGoodsExamPaperByGoodsIds(goodsId);
+    }
+
+    @Override
+    public List<ExamPaperVo> getGoodsExamPaperByGoodsId(Long goodsId) {
+        return this.baseMapper.getGoodsExamPaperByGoodsId(goodsId);
+    }
 }

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/vo/ExamPaperVo.java

@@ -40,4 +40,7 @@ public class ExamPaperVo {
 	@Excel(name = "编码SJ")
 	@ApiModelProperty("编码SJ")
 	private String encoder;
+
+	@ApiModelProperty("商品ID")
+	private Long goodsId;
 }

+ 41 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/bo/BankGoodsExamAddBo.java

@@ -0,0 +1,41 @@
+package com.zhongzheng.modules.goods.bo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @author yangdamao
+ * @date 2022年11月11日 14:25
+ */
+@Data
+@ApiModel("每日一练试卷时间新增对象")
+public class BankGoodsExamAddBo implements Serializable {
+    /**
+     * 商品id
+     */
+    @ApiModelProperty("商品id")
+    private Long goodsId;
+    /**
+     * 模块卷ID
+     */
+    @ApiModelProperty("模块卷ID")
+    private Long moduleExamId;
+    /**
+     * 章卷ID
+     */
+    @ApiModelProperty("章卷ID")
+    private Long chapterExamId;
+    /**
+     * 试卷ID
+     */
+    @ApiModelProperty("试卷ID")
+    private Long examId;
+    /**
+     * 每日一练时间
+     */
+    @ApiModelProperty("每日一练时间")
+    private Long examTime;
+}

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

@@ -0,0 +1,45 @@
+package com.zhongzheng.modules.goods.bo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @author yangdamao
+ * @date 2022年11月14日 9:24
+ */
+@Data
+public class SpecialExamRecordAddBo implements Serializable {
+
+    /**
+     * 用户ID
+     */
+    @ApiModelProperty("用户ID")
+    private Long userId;
+    /**
+     * 商品id
+     */
+    @ApiModelProperty("商品id")
+    private Long goodsId;
+    /**
+     * 模块卷ID
+     */
+    @ApiModelProperty("模块卷ID")
+    private Long moduleExamId;
+    /**
+     * 章卷ID
+     */
+    @ApiModelProperty("章卷ID")
+    private Long chapterExamId;
+    /**
+     * 试卷ID
+     */
+    @ApiModelProperty("试卷ID")
+    private Long examId;
+    /**
+     * 打卡时间
+     */
+    @ApiModelProperty("打卡时间")
+    private Long recordTime;
+}

+ 40 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/bo/SpecialExamRecordQuery.java

@@ -0,0 +1,40 @@
+package com.zhongzheng.modules.goods.bo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @author yangdamao
+ * @date 2022年11月14日 9:24
+ */
+@Data
+public class SpecialExamRecordQuery implements Serializable {
+
+    /**
+     * 用户ID
+     */
+    @ApiModelProperty("用户ID")
+    private Long userId;
+    /**
+     * 商品id
+     */
+    @ApiModelProperty("商品id")
+    private Long goodsId;
+    /**
+     * 模块卷ID
+     */
+    @ApiModelProperty("模块卷ID")
+    private Long moduleExamId;
+    /**
+     * 章卷ID
+     */
+    @ApiModelProperty("章卷ID")
+    private Long chapterExamId;
+    /**
+     * 试卷ID
+     */
+    @ApiModelProperty("试卷ID")
+    private Long examId;
+}

+ 26 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/bo/TodayExamSubscriptionBo.java

@@ -0,0 +1,26 @@
+package com.zhongzheng.modules.goods.bo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @author yangdamao
+ * @date 2022年11月15日 17:33
+ */
+@Data
+public class TodayExamSubscriptionBo implements Serializable {
+
+    @ApiModelProperty("用户ID")
+    private Long userId;
+
+    @ApiModelProperty("商品ID")
+    private Long goodsId;
+
+    @ApiModelProperty("订单商品ID")
+    private Long orderGoodsId;
+
+    @ApiModelProperty("是否订阅:1是 0否")
+    private Integer subscriptionStatus;
+}

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

@@ -0,0 +1,24 @@
+package com.zhongzheng.modules.goods.bo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @author yangdamao
+ * @date 2022年11月17日 9:44
+ */
+@Data
+public class TodayExamTobVo implements Serializable {
+
+    @ApiModelProperty("用户ID")
+    private Long userId;
+
+    @ApiModelProperty("用户昵称")
+    private String userName;
+
+    @ApiModelProperty("打卡次数")
+    private Integer recordCount;
+
+}

+ 36 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/bo/TodayExamWeekRecordDetailVo.java

@@ -0,0 +1,36 @@
+package com.zhongzheng.modules.goods.bo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * @author yangdamao
+ * @date 2022年11月17日 16:13
+ */
+@Data
+public class TodayExamWeekRecordDetailVo implements Serializable {
+
+    @ApiModelProperty("平均正确率")
+    private String accuracyAvg;
+
+    @ApiModelProperty("累计做题数")
+    private Integer doNum;
+
+    @ApiModelProperty("本周做题记录")
+    private List<TodayExamWeekRecordVo> resultList;
+
+    @ApiModelProperty("上周的做题正确率")
+    private String lastWeekAccuracyAvg;
+
+    @ApiModelProperty("本周的做题正确率")
+    private String weekAccuracyAvg;
+
+    @ApiModelProperty("上周的做题数")
+    private Integer lastWeekAccuracyDoNum;
+
+    @ApiModelProperty("本周的做题数")
+    private Integer weekAccuracyDoNum;
+}

+ 26 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/bo/TodayExamWeekRecordVo.java

@@ -0,0 +1,26 @@
+package com.zhongzheng.modules.goods.bo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @author yangdamao
+ * @date 2022年11月17日 16:18
+ */
+@Data
+public class TodayExamWeekRecordVo implements Serializable {
+
+    @ApiModelProperty("试卷ID")
+    private Long examId;
+
+    @ApiModelProperty("试卷名称")
+    private String examName;
+
+    @ApiModelProperty("练习次数")
+    private Integer examCount;
+
+    @ApiModelProperty("试卷时间")
+    private Long examTime;
+}

+ 48 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/domain/GoodsExamTime.java

@@ -0,0 +1,48 @@
+package com.zhongzheng.modules.goods.domain;
+
+import com.baomidou.mybatisplus.annotation.FieldFill;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+
+/**
+ * 商品试卷时间表 goods_exam_time
+ *
+ * @author  hjl
+ * @date 2021-10-28
+ */
+@Data
+@NoArgsConstructor
+@Accessors(chain = true)
+@TableName("goods_exam_time")
+public class GoodsExamTime implements Serializable {
+
+    /** $column.columnComment */
+    @TableId(value = "id")
+    private Long id;
+    /** 商品id */
+    private Long goodsId;
+    /** 模块卷ID */
+    private Long moduleExamId;
+    /** 章卷ID */
+    private Long chapterExamId;
+    /** 试卷ID */
+    private Long examId;
+    /** 每日一练时间 */
+    private Long examTime;
+    /** 1有效 0无效*/
+    private Integer status;
+    /** 添加时间 */
+    @TableField(fill = FieldFill.INSERT)
+    private Long createTime;
+    /** 修改时间 */
+    @TableField(fill = FieldFill.INSERT_UPDATE)
+    private Long updateTime;
+    /** 1有效 0无效*/
+    private Long tenantId;
+}

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

@@ -0,0 +1,14 @@
+package com.zhongzheng.modules.goods.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.zhongzheng.modules.goods.domain.GoodsExamTime;
+
+/**
+ * 商品附加产品Mapper接口
+ *
+ * @author  hjl
+ * @date 2021-10-28
+ */
+public interface GoodsExamTimeMapper extends BaseMapper<GoodsExamTime> {
+
+}

+ 14 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/IGoodsExamTimeService.java

@@ -0,0 +1,14 @@
+package com.zhongzheng.modules.goods.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.zhongzheng.modules.goods.domain.GoodsAttached;
+import com.zhongzheng.modules.goods.domain.GoodsExamTime;
+
+/**
+ * 商品附加产品Service接口
+ *
+ * @author  hjl
+ * @date 2021-10-28
+ */
+public interface IGoodsExamTimeService extends IService<GoodsExamTime> {
+}

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

@@ -9,6 +9,7 @@ import com.zhongzheng.modules.exam.bo.ExamNumberGoodsQueryBo;
 import com.zhongzheng.modules.exam.vo.ExamNumberGoodsVo;
 import com.zhongzheng.modules.goods.bo.*;
 import com.zhongzheng.modules.goods.domain.Goods;
+import com.zhongzheng.modules.goods.vo.BankGoodsExamVo;
 import com.zhongzheng.modules.goods.vo.GoodsSpecTemplateVo;
 import com.zhongzheng.modules.goods.vo.GoodsJzsVo;
 import com.zhongzheng.modules.goods.vo.GoodsVo;

+ 18 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/impl/GoodsExamTimeServiceImpl.java

@@ -0,0 +1,18 @@
+package com.zhongzheng.modules.goods.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.zhongzheng.modules.goods.domain.GoodsExamTime;
+import com.zhongzheng.modules.goods.mapper.GoodsExamTimeMapper;
+import com.zhongzheng.modules.goods.service.IGoodsExamTimeService;
+import org.springframework.stereotype.Service;
+
+/**
+ * 商品附加产品Service业务层处理
+ *
+ * @author  hjl
+ * @date 2021-10-28
+ */
+@Service
+public class GoodsExamTimeServiceImpl extends ServiceImpl<GoodsExamTimeMapper, GoodsExamTime> implements IGoodsExamTimeService {
+
+}

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

@@ -13,6 +13,7 @@ import com.zhongzheng.common.exception.CustomException;
 import com.zhongzheng.common.utils.DateUtils;
 import com.zhongzheng.common.utils.ServletUtils;
 import com.zhongzheng.modules.activity.bo.ActivityRecommendGoodsQueryBo;
+import com.zhongzheng.modules.bank.mapper.QuestionMapper;
 import com.zhongzheng.modules.course.bo.CourseMenuAddBo;
 import com.zhongzheng.modules.course.bo.CourseMenuListAddBo;
 import com.zhongzheng.modules.course.bo.CourseMenuQueryBo;
@@ -32,6 +33,7 @@ import com.zhongzheng.modules.grade.vo.ClassGradeVo;
 import com.zhongzheng.modules.grade.vo.SyncGoodsExport;
 import com.zhongzheng.modules.order.domain.OrderGoods;
 import com.zhongzheng.modules.order.service.IOrderGoodsService;
+import net.polyv.common.v1.util.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -105,6 +107,9 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
     @Autowired
     private  IGoodsSpecService goodsSpecService;
 
+    @Autowired
+    private QuestionMapper questionMapper;
+
     @Override
     public GoodsVo queryById(Long goodsId){
         Goods db = this.baseMapper.selectById(goodsId);
@@ -160,6 +165,18 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
                     goods.setSpecTemplateId(relation.getSpecTemplateId());
                 }
             }
+            //是否包含每日一练试卷
+            if (goods.getGoodsType() == 2){
+                //题库商品
+                List<BankGoodsExamVo> examVos = questionMapper.getBankGoodsExamList(goods.getGoodsId());
+                if (examVos.stream().filter(x -> StringUtils.isNotBlank(x.getPaperName())).anyMatch(x -> x.getPaperName().equals("每日一练"))){
+                    goods.setExamRecord(1);
+                }else {
+                    goods.setExamRecord(0);
+                }
+            }else {
+                goods.setExamRecord(0);
+            }
         });
         //继教二建统计学时
         if (Validator.isNotEmpty(bo.getChapterNum())) {
@@ -731,22 +748,47 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
     }
 
     @Override
+    @Transactional(rollbackFor = Exception.class)
     public boolean GoodsBatchUpdateStatusBo(GoodsBatchUpdateStatusBo bo) {
         if (CollectionUtils.isEmpty(bo.getGoodsIds())){
             throw new CustomException("商品ID不能为空");
         }
+        if (bo.getGoodsStatus() !=-1) {
+            List<Goods> goodsList = listByIds(bo.getGoodsIds());
+            if (goodsList.stream().anyMatch(x -> x.getStatus() == 0) && bo.getGoodsStatus() == 1) {
+                throw new CustomException("存在无效商品不允许上架,请检查!");
+            }
+            if (goodsList.stream().anyMatch(x -> Validator.isNotEmpty(x.getValidityEndTime())&&x.getValidityEndTime() < DateUtils.getNowTime()) && bo.getGoodsStatus() == 1) {
+                throw new CustomException("存在过期商品不允许上架,请检查!");
+            }
+        }
         return update(new LambdaUpdateWrapper<Goods>()
                 .set(Goods::getGoodsStatus,bo.getGoodsStatus())
+                .set(Goods::getUpdateTime,DateUtils.getNowTime())
                 .in(Goods::getGoodsId,bo.getGoodsIds()));
     }
 
     @Override
+    @Transactional(rollbackFor = Exception.class)
     public boolean batchDelGoods(GoodsBatchDelBo bo) {
         if (CollectionUtils.isEmpty(bo.getIds())){
             throw new CustomException("商品ID不能为空");
         }
+        if (bo.getStatus() ==-1||bo.getStatus() ==0) {
+            List<Long> payStatus = new ArrayList<>();
+            payStatus.add(2L);
+            payStatus.add(3L);
+            payStatus.add(4L);
+            //查看是否有出售过
+            List<OrderGoods> orderGoodsList = iOrderGoodsService.list(new LambdaQueryWrapper< OrderGoods >().in(OrderGoods::getGoodsId,bo.getIds())
+                    .in(OrderGoods::getPayStatus,payStatus).ne(OrderGoods::getRefundStatus,2));
+            if(CollectionUtils.isNotEmpty(orderGoodsList)){
+                throw new CustomException("存在已购买商品,无法改变状态,请检查!");
+            }
+        }
         return update(new LambdaUpdateWrapper<Goods>()
                 .set(Goods::getStatus,bo.getStatus())
+                .set(Goods::getUpdateTime,DateUtils.getNowTime())
                 .in(Goods::getGoodsId,bo.getIds()));
     }
 

+ 69 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/vo/BankGoodsExamVo.java

@@ -0,0 +1,69 @@
+package com.zhongzheng.modules.goods.vo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @author yangdamao
+ * @date 2022年11月11日 14:25
+ */
+@Data
+@ApiModel("每日一练试卷对象")
+public class BankGoodsExamVo implements Serializable {
+
+    @ApiModelProperty("id")
+    private Long id;
+    /**
+     * 商品id
+     */
+    @ApiModelProperty("商品id")
+    private Long goodsId;
+    /**
+     * 模块卷ID
+     */
+    @ApiModelProperty("模块卷ID")
+    private Long moduleExamId;
+    /**
+     * 章卷ID
+     */
+    @ApiModelProperty("章卷ID")
+    private Long chapterExamId;
+    /**
+     * 试卷ID
+     */
+    @ApiModelProperty("试卷ID")
+    private Long examId;
+    /**
+     * 试卷名称
+     */
+    @ApiModelProperty("试卷名称")
+    private String examName;
+    /**
+     * 试卷类型名称
+     */
+    @ApiModelProperty("试卷类型名称")
+    private String paperName;
+    /**
+     * 每日一练时间
+     */
+    @ApiModelProperty("每日一练时间")
+    private Long examTime;
+    /**
+     * 1有效 0无效
+     */
+    @ApiModelProperty("1有效 0无效")
+    private Integer status;
+    /**
+     * 添加时间
+     */
+    @ApiModelProperty("添加时间")
+    private Long createTime;
+    /**
+     * 修改时间
+     */
+    @ApiModelProperty("修改时间")
+    private Long updateTime;
+}

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/vo/GoodsAttachedVo.java

@@ -82,4 +82,6 @@ public class GoodsAttachedVo {
 	private Long publishStatus;
 	@ApiModelProperty("编码")
 	private String code;
+	@ApiModelProperty("试卷类型名称")
+	private String paperName;
 }

+ 51 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/vo/GoodsExamTimeVo.java

@@ -0,0 +1,51 @@
+package com.zhongzheng.modules.goods.vo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * 商品试卷时间表Vo
+ *
+ * @author  hjl
+ * @date 2021-10-28
+ */
+@Data
+@ApiModel("商品试卷时间表Vo")
+public class GoodsExamTimeVo implements Serializable {
+    @ApiModelProperty("id")
+    private Long id;
+    /** 商品id */
+    @ApiModelProperty("商品id")
+    private Long goodsId;
+    /** 模块卷ID */
+    @ApiModelProperty("模块卷ID")
+    private Long moduleExamId;
+    /** 章卷ID */
+    @ApiModelProperty("章卷ID")
+    private Long chapterExamId;
+    /** 试卷ID */
+    @ApiModelProperty("试卷ID")
+    private Long examId;
+    @ApiModelProperty("试卷名称")
+    private String examName;
+    /** 每日一练时间 */
+    @ApiModelProperty("每日一练时间")
+    private Long examTime;
+    /** 1有效 0无效*/
+    @ApiModelProperty("1有效 0无效")
+    private Integer status;
+    @ApiModelProperty("打卡次数")
+    private Integer recordCount;
+    @ApiModelProperty("打卡次数百分比")
+    private String recordPercentage;
+    @ApiModelProperty("是否打卡:1是 0否")
+    private Integer examRecord;
+    @ApiModelProperty("明日打卡试卷名称")
+    private String examNameBelow;
+    @ApiModelProperty("消息订阅状态:1已订阅 0未订阅")
+    private Integer subscription;
+
+}

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

@@ -1,6 +1,7 @@
 package com.zhongzheng.modules.goods.vo;
 
 import com.zhongzheng.common.annotation.Excel;
+import com.zhongzheng.modules.exam.vo.ExamPaperVo;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
@@ -274,4 +275,7 @@ public class GoodsUserQuestionVo {
 	private Long userId;
 	@ApiModelProperty("科目名称拼接")
 	private String subjectNames;
+
+	@ApiModelProperty("试卷类型集合")
+	private List<ExamPaperVo> paperVos;
 }

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

@@ -385,4 +385,7 @@ public class GoodsUserVo {
 	@Excel(name = "每天最大节学习数量")
 	@ApiModelProperty("每天最大节学习数量")
 	private Long sectionMaxNum;
+	@ApiModelProperty("0不限制 2限制整个目录顺序")
+	private Integer goodsLearningOrder;
+
 }

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

@@ -322,4 +322,10 @@ public class GoodsVo {
 	@ApiModelProperty("默认规格模板ID")
 	private Long specTemplateId;
 
+	@ApiModelProperty("业务层次学习顺序:1限制章下做卷顺序 0不限制 2限制整个目录顺序")
+	private Integer goodsLearningOrder;
+
+	@ApiModelProperty("是否包含每日一练试卷:1是 0否")
+	private Integer examRecord;
+
 }

+ 45 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/vo/SpecialExamRecordVo.java

@@ -0,0 +1,45 @@
+package com.zhongzheng.modules.goods.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @author yangdamao
+ * @date 2022年11月14日 9:24
+ */
+@Data
+public class SpecialExamRecordVo implements Serializable {
+
+    /**
+     * 用户ID
+     */
+    @ApiModelProperty("用户ID")
+    private Long userId;
+    /**
+     * 商品id
+     */
+    @ApiModelProperty("商品id")
+    private Long goodsId;
+    /**
+     * 模块卷ID
+     */
+    @ApiModelProperty("模块卷ID")
+    private Long moduleExamId;
+    /**
+     * 章卷ID
+     */
+    @ApiModelProperty("章卷ID")
+    private Long chapterExamId;
+    /**
+     * 试卷ID
+     */
+    @ApiModelProperty("试卷ID")
+    private Long examId;
+    /**
+     * 打卡时间
+     */
+    @ApiModelProperty("打卡时间")
+    private Long recordTime;
+}

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

@@ -263,4 +263,10 @@ public class ClassGradeUserQueryBo extends BaseEntity {
 
 	@ApiModelProperty("是否关注公众号 1是 0不是")
 	private Integer hasFollowWx;
+
+	@ApiModelProperty("查询审核通过开始时间")
+	private Long periodStartTime;
+
+	@ApiModelProperty("查询审核通过结束时间")
+	private Long periodEndTime;
 }

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

@@ -6,6 +6,7 @@ import lombok.Data;
 import lombok.EqualsAndHashCode;
 
 import java.util.Date;
+import java.util.List;
 import java.util.Map;
 import java.util.HashMap;
 
@@ -73,4 +74,13 @@ public class UserPeriodQueryBo extends BaseEntity {
 	private Long todayEndTime;
 	@ApiModelProperty("章卷ID")
 	private Long chapterExamId;
+
+	@ApiModelProperty("课程IDs")
+	private List<Long> courseIds;
+	@ApiModelProperty("模块IDs")
+	private List<Long> moduleIds;
+	@ApiModelProperty("章IDs")
+	private List<Long> chapterIds;
+	@ApiModelProperty("节IDs")
+	private List<Long> sectionIds;
 }

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

@@ -24,4 +24,6 @@ public interface UserPeriodMapper extends BaseMapper<UserPeriod> {
     Long selectCountConfirmPeriod(@Param("userId") Long userId, @Param("goodsId") Long goodsId);
 
     Long todayStudySectionNum(UserPeriodQueryBo bo);
+
+    Long checkBatchGoodsStudy(UserPeriodQueryBo bo);
 }

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

@@ -44,6 +44,8 @@ public interface IClassGradeUserService extends IService<ClassGradeUser> {
 
 	Boolean changeGrade(ClassGradeUserChangeBo bo);
 
+	Boolean changeGradeFree(ClassGradeUserChangeBo bo);
+
 	Boolean sysChangeGrade(ClassGradeUserSysChangeBo bo);
 
 	Integer updateUserPeriodStatus(ClassGradeUserQueryBo bo);

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

@@ -29,6 +29,8 @@ public interface IUserPeriodService extends IService<UserPeriod> {
 
 	Long checkGoodsStudy(UserPeriodQueryBo bo);
 
+	Long checkBatchGoodsStudy(UserPeriodQueryBo bo);
+
 	/**
 	 * 查询列表
 	 */

+ 68 - 6
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/impl/ClassGradeUserServiceImpl.java

@@ -45,9 +45,7 @@ import com.zhongzheng.modules.goods.vo.GoodsVo;
 import com.zhongzheng.modules.grade.bo.*;
 import com.zhongzheng.modules.grade.domain.ClassGrade;
 import com.zhongzheng.modules.grade.domain.StudyCountLog;
-import com.zhongzheng.modules.grade.service.IClassGradeService;
-import com.zhongzheng.modules.grade.service.IStudyCountLogService;
-import com.zhongzheng.modules.grade.service.IUserPeriodStatusService;
+import com.zhongzheng.modules.grade.service.*;
 import com.zhongzheng.modules.grade.vo.*;
 import com.zhongzheng.modules.order.bo.OrderGoodsQueryBo;
 import com.zhongzheng.modules.order.domain.OrderGoods;
@@ -79,7 +77,6 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.github.pagehelper.Page;
 import com.zhongzheng.modules.grade.domain.ClassGradeUser;
 import com.zhongzheng.modules.grade.mapper.ClassGradeUserMapper;
-import com.zhongzheng.modules.grade.service.IClassGradeUserService;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.CollectionUtils;
 
@@ -173,6 +170,9 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
     @Value("${officialPush.token}")
     private String OFFICIALPUSH_TOKEN;
 
+    @Autowired
+    private  IUserPeriodService iUserPeriodService;
+
     @Override
     public ClassGradeUserVo queryById(Long id) {
         ClassGradeUser db = this.baseMapper.selectById(id);
@@ -264,6 +264,68 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                 studyCountLog.setOldGradeId(bo.getOldGradeId());
                 iStudyCountLogService.save(studyCountLog);
             }
+            redisCache.unlockLua(redisLockEntity);
+        }
+        return true;
+    }
+
+    @Override
+    public Boolean changeGradeFree(ClassGradeUserChangeBo bo) {
+        if(Validator.isEmpty(bo.getUserId())||Validator.isEmpty(bo.getGradeId())||Validator.isEmpty(bo.getOrderGoodsId())||Validator.isEmpty(bo.getGoodsId())){
+            throw new CustomException("参数缺失");
+        }
+        OrderGoodsVo orderGoodsVo = iOrderGoodsService.queryById(bo.getOrderGoodsId());
+        Long oldGradeId = orderGoodsVo.getGradeId();
+        if(Validator.isEmpty(oldGradeId)){
+            throw new CustomException("参数错误");
+        }
+        UserPeriodQueryBo queryBo = new UserPeriodQueryBo();
+        queryBo.setGradeId(oldGradeId);
+        queryBo.setUserId(bo.getUserId());
+        Long logNum = iUserPeriodService.checkGoodsStudy(queryBo);
+        if(logNum.longValue()>0L){
+            throw new CustomException("已有学习数据,无法换班");
+        }
+        if(bo.getGradeId().longValue()==oldGradeId){
+            throw new CustomException("更换班级和老班级一样");
+        }
+        String requestId = IdUtil.simpleUUID();
+        RedisLockEntity redisLockEntity = new RedisLockEntity();
+        redisLockEntity.setLockKey(RedisLockEntity.KEY_LOCK_GRADE);
+        redisLockEntity.setRequestId(requestId);
+        if (redisCache.lock(redisLockEntity)) {
+            //分新班
+            Long newGradeId = iOrderService.sysChangeGrade(bo.getGoodsId(), bo.getOrderGoodsId(), bo.getGradeId(), bo.getUserId());
+            if (newGradeId > 0) {
+                //老班修改换班状态
+                ClassGradeUser classGradeUser = getOne(new LambdaQueryWrapper<ClassGradeUser>().eq(ClassGradeUser::getUserId, bo.getUserId())
+                        .eq(ClassGradeUser::getStatus, 1)
+                        .eq(ClassGradeUser::getGradeId, oldGradeId)
+                        .last("limit 1"));
+                if(Validator.isEmpty(classGradeUser)){
+                    throw new CustomException("数据错误");
+                }
+                removeById(classGradeUser.getId());
+
+                OrderGoods orderGoods = new OrderGoods();
+                orderGoods.setOrderGoodsId(bo.getOrderGoodsId());
+                orderGoods.setUpdateTime(DateUtils.getNowTime());
+                orderGoods.setGradeId(newGradeId);
+                iOrderGoodsService.updateById(orderGoods);
+                //记录消耗0次学习机会
+                StudyCountLog studyCountLog = new StudyCountLog();
+                studyCountLog.setGradeId(newGradeId);
+                studyCountLog.setStatus(-1);
+                studyCountLog.setOrderGoodsId(bo.getOrderGoodsId());
+                studyCountLog.setStudyCount(0L);
+                studyCountLog.setUserId(bo.getUserId());
+                studyCountLog.setCreateTime(DateUtils.getNowTime());
+                studyCountLog.setUpdateTime(DateUtils.getNowTime());
+                studyCountLog.setOldGradeId(oldGradeId);
+                iStudyCountLogService.save(studyCountLog);
+
+            }
+            redisCache.unlockLua(redisLockEntity);
         }
         return true;
     }
@@ -298,7 +360,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
             redisLockEntity.setRequestId(requestId);
             if (redisCache.lock(redisLockEntity)) {
                 //分新班
-                Long newGradeId = iOrderService.sysChangeGrade(goodsVo.getGoodsName(), item.getGoodsId(), item.getOrderGoodsId(), item.getGradeId(), item.getUserId(), goodsVo.getBusinessId());
+                Long newGradeId = iOrderService.sysChangeGrade(item.getGoodsId(), item.getOrderGoodsId(), item.getGradeId(), item.getUserId());
                 if (newGradeId > 0) {
                     //老班修改换班状态
                     ClassGradeUser classGradeUser = getOne(new LambdaQueryWrapper<ClassGradeUser>().eq(ClassGradeUser::getUserId, item.getUserId())
@@ -324,7 +386,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                     studyCountLog.setUserId(item.getUserId());
                     studyCountLog.setCreateTime(DateUtils.getNowTime());
                     studyCountLog.setUpdateTime(DateUtils.getNowTime());
-                    studyCountLog.setOldGradeId(item.getUserId());
+                    studyCountLog.setOldGradeId(item.getOldGradeId());
                     iStudyCountLogService.save(studyCountLog);
                     //老班学习记录去掉
 

+ 195 - 81
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/impl/UserPeriodServiceImpl.java

@@ -174,6 +174,11 @@ public class UserPeriodServiceImpl extends ServiceImpl<UserPeriodMapper, UserPer
         return this.baseMapper.checkGoodsStudy(bo);
     }
 
+    @Override
+    public Long checkBatchGoodsStudy(UserPeriodQueryBo bo) {
+        return this.baseMapper.checkBatchGoodsStudy(bo);
+    }
+
     @Override
     public List<UserPeriodVo> queryList(UserPeriodQueryBo bo) {
         LambdaQueryWrapper<UserPeriod> lqw = Wrappers.lambdaQuery();
@@ -458,10 +463,12 @@ public class UserPeriodServiceImpl extends ServiceImpl<UserPeriodMapper, UserPer
         CourseEducationType educationType = iCourseEducationTypeService.getOne(new LambdaQueryWrapper<CourseEducationType>().eq(CourseEducationType::getStatus, 1).eq(CourseEducationType::getEducationName,"继续教育").last("limit 1"));
         CourseProjectType projectType = iCourseProjectTypeService.getOne(new LambdaQueryWrapper<CourseProjectType>().eq(CourseProjectType::getStatus, 1).eq(CourseProjectType::getEducationId,educationType.getId()).eq(CourseProjectType::getProjectName,"建造师").last("limit 1"));
         CourseBusiness business = iCourseBusinessService.getOne(new LambdaQueryWrapper<CourseBusiness>().eq(CourseBusiness::getStatus, 1).eq(CourseBusiness::getProjectId,projectType.getId()).eq(CourseBusiness::getBusinessName,"二级").last("limit 1"));
-
+        CourseBusiness business7 = iCourseBusinessService.getOne(new LambdaQueryWrapper<CourseBusiness>().eq(CourseBusiness::getStatus, 1).eq(CourseBusiness::getBusinessName,"七大员新考").last("limit 1"));
         GoodsVo goodsVo = iGoodsService.queryById(bo.getGoodsId());
         if(goodsVo.getBusinessId().longValue()!=business.getId().longValue()){
-            throw new CustomException("非继续二建无法打回");
+            if(Validator.isNotEmpty(business7.getId())&&goodsVo.getBusinessId().longValue()!=business7.getId().longValue()){
+                throw new CustomException("非继续二建或七大员新考无法打回");
+            }
         }
         //查询此人学时审核是否有权限,老系统不进行权限校验
         if (bo.getRollBackPlat()!=2) {
@@ -500,16 +507,27 @@ public class UserPeriodServiceImpl extends ServiceImpl<UserPeriodMapper, UserPer
         CourseEducationType educationType = iCourseEducationTypeService.getOne(new LambdaQueryWrapper<CourseEducationType>().eq(CourseEducationType::getStatus, 1).eq(CourseEducationType::getEducationName,"继续教育").last("limit 1"));
         CourseProjectType projectType = iCourseProjectTypeService.getOne(new LambdaQueryWrapper<CourseProjectType>().eq(CourseProjectType::getStatus, 1).eq(CourseProjectType::getEducationId,educationType.getId()).eq(CourseProjectType::getProjectName,"建造师").last("limit 1"));
         CourseBusiness business = iCourseBusinessService.getOne(new LambdaQueryWrapper<CourseBusiness>().eq(CourseBusiness::getStatus, 1).eq(CourseBusiness::getProjectId,projectType.getId()).eq(CourseBusiness::getBusinessName,"二级").last("limit 1"));
+        CourseBusiness business7 = iCourseBusinessService.getOne(new LambdaQueryWrapper<CourseBusiness>().eq(CourseBusiness::getStatus, 1).eq(CourseBusiness::getBusinessName,"七大员新考").last("limit 1"));
+        GoodsVo goodsVo = iGoodsService.selectDetail(bo.getGoodsId());
 
-        GoodsVo goodsVo = iGoodsService.queryById(bo.getGoodsId());
         if(goodsVo.getBusinessId().longValue()!=business.getId().longValue()){
-            return null;
+            if(Validator.isNotEmpty(business7.getId())&&goodsVo.getBusinessId().longValue()!=business7.getId().longValue()){
+                return null;
+            }
         }
         UserVo userVo = iUserService.queryById(bo.getUserId());
         ClassGradeUser gradeUser = iClassGradeUserService.getOne(new LambdaQueryWrapper<ClassGradeUser>().eq(ClassGradeUser::getUserId,bo.getUserId()).eq(ClassGradeUser::getGradeId,bo.getGradeId()).last("limit 1"));
         OrderGoods orderGoods = iOrderGoodsService.getOne(new LambdaQueryWrapper<OrderGoods>().eq(OrderGoods::getOrderGoodsId,gradeUser.getOrderGoodsId()).last("limit 1"));
         ClassGrade classGrade = iClassGradeService.getOne(new LambdaQueryWrapper<ClassGrade>().eq(ClassGrade::getGradeId,gradeUser.getGradeId()).last("limit 1"));
         SyncUserCourseStudyRec studyRec = new SyncUserCourseStudyRec();
+        if(goodsVo.getBusinessId().longValue()==business.getId().longValue()){
+            studyRec.setCourseType(5);
+        }
+        if(Validator.isNotEmpty(business7.getId())&&goodsVo.getBusinessId().longValue()==business7.getId().longValue()){
+            studyRec.setCourseType(17);
+        }
+        studyRec.setCourseName(goodsVo.getGoodsName());
+        studyRec.setMajorName(goodsVo.getSubjectNames());
         studyRec.setName(userVo.getRealname());
         studyRec.setIdNum(userVo.getIdCard());
         studyRec.setMobile(userVo.getTelphone());
@@ -525,90 +543,186 @@ public class UserPeriodServiceImpl extends ServiceImpl<UserPeriodMapper, UserPer
         GoodsCourseQueryBo goodsCourseQueryBo = new GoodsCourseQueryBo();
         goodsCourseQueryBo.setGoodsId(goodsVo.getGoodsId());
         List<CourseVo> courseVoList = iGoodsCourseService.selectList(goodsCourseQueryBo);
-        for(CourseVo courseVo : courseVoList){
-            CourseMenuQueryBo menuQueryBo = new CourseMenuQueryBo();
-            menuQueryBo.setCourseId(courseVo.getCourseId());
-            List<CourseMenuVo> courseMenuVoList = iCourseMenuService.selectList(menuQueryBo);
-            courseMenuVoList.forEach(courseMenuVo -> {
-                if(courseMenuVo.getType()==1){
-                    //获取章信息
-                    List<CourseModuleChapterVo> courseModuleChapterVoList = iCourseModuleChapterService.getListById(courseMenuVo.getMenuId());
-                    courseModuleChapterVoList.forEach(courseModuleChapterVo -> {
-                        SyncUserChapterList syncUserChapterItem = new SyncUserChapterList();
-                        syncUserChapterItem.setChapterId(courseModuleChapterVo.getChapterId());
-                        syncUserChapterItem.setChapterName(courseModuleChapterVo.getName());
-
-                        UserPeriodQueryBo userPeriodQueryBo = new UserPeriodQueryBo();
-                        userPeriodQueryBo.setCourseId(courseVo.getCourseId());
-                        userPeriodQueryBo.setGoodsId(bo.getGoodsId());
-                        userPeriodQueryBo.setUserId(bo.getUserId());
-                        userPeriodQueryBo.setChapterId(courseModuleChapterVo.getChapterId());
-                        userPeriodQueryBo.setModuleId(courseMenuVo.getMenuId());
-                        userPeriodQueryBo.setGradeId(bo.getGradeId());
-                        userPeriodQueryBo.setType(2);
-                        List<UserPeriodStatusVo> userPeriodStatusVos = userPeriodStatusService.selectPeriodStatus(userPeriodQueryBo);
-                        if (!CollectionUtils.isEmpty(userPeriodStatusVos)&&userPeriodStatusVos.size()>0) {
-                            int numIndex = userPeriodStatusVos.size() - 1;
-                            UserPeriodStatusVo userPeriodStatusVo = userPeriodStatusVos.get(numIndex);
-                            LambdaQueryWrapper<UserStudyRecordPhoto> lqw = Wrappers.lambdaQuery();
-                            lqw.eq(UserStudyRecordPhoto::getPeriodId, userPeriodStatusVo.getId());
-                            List<UserStudyRecordPhoto> examPhoto = userStudyRecordPhotoService.list(lqw);
-                            if(Validator.isNotEmpty(examPhoto)&&examPhoto.size()>0){
-                                UserStudyRecordPhoto photo = examPhoto.get(0);
-                                syncUserChapterItem.setImageSrc(ossHost+"/"+photo.getPhoto());
-                                syncUserChapterItem.setImageTime(DateUtils.timestampToDateFormat(photo.getCreateTime(),DateUtils.YYYY_MM_DD_HH_MM_SS));
-                                syncUserChapterItem.setMatchData(Validator.isNotEmpty(photo.getSimilarity())?photo.getSimilarity().toString():null);
-                                syncUserChapterItem.setExamTime(DateUtils.timestampToDateFormat(userPeriodStatusVo.getRecordStartTime(),DateUtils.YYYY_MM_DD_HH_MM_SS));
-                                syncUserChapterItem.setExamScore(userPeriodStatusVo.getPerformance().toString());
-                                syncUserChapterItem.setStudyIP(userPeriodStatusVo.getIp());
+        //二建
+        if(goodsVo.getBusinessId().longValue()==business.getId().longValue()){
+            for(CourseVo courseVo : courseVoList){
+                CourseMenuQueryBo menuQueryBo = new CourseMenuQueryBo();
+                menuQueryBo.setCourseId(courseVo.getCourseId());
+                List<CourseMenuVo> courseMenuVoList = iCourseMenuService.selectList(menuQueryBo);
+                courseMenuVoList.forEach(courseMenuVo -> {
+                    if(courseMenuVo.getType()==1){
+                        //获取章信息
+                        List<CourseModuleChapterVo> courseModuleChapterVoList = iCourseModuleChapterService.getListById(courseMenuVo.getMenuId());
+                        courseModuleChapterVoList.forEach(courseModuleChapterVo -> {
+                            SyncUserChapterList syncUserChapterItem = new SyncUserChapterList();
+                            syncUserChapterItem.setChapterId(courseModuleChapterVo.getChapterId());
+                            syncUserChapterItem.setChapterName(courseModuleChapterVo.getName());
+
+                            UserPeriodQueryBo userPeriodQueryBo = new UserPeriodQueryBo();
+                            userPeriodQueryBo.setCourseId(courseVo.getCourseId());
+                            userPeriodQueryBo.setGoodsId(bo.getGoodsId());
+                            userPeriodQueryBo.setUserId(bo.getUserId());
+                            userPeriodQueryBo.setChapterId(courseModuleChapterVo.getChapterId());
+                            userPeriodQueryBo.setModuleId(courseMenuVo.getMenuId());
+                            userPeriodQueryBo.setGradeId(bo.getGradeId());
+                            userPeriodQueryBo.setType(2);
+                            List<UserPeriodStatusVo> userPeriodStatusVos = userPeriodStatusService.selectPeriodStatus(userPeriodQueryBo);
+                            if (!CollectionUtils.isEmpty(userPeriodStatusVos)&&userPeriodStatusVos.size()>0) {
+                                int numIndex = userPeriodStatusVos.size() - 1;
+                                UserPeriodStatusVo userPeriodStatusVo = userPeriodStatusVos.get(numIndex);
+                                LambdaQueryWrapper<UserStudyRecordPhoto> lqw = Wrappers.lambdaQuery();
+                                lqw.eq(UserStudyRecordPhoto::getPeriodId, userPeriodStatusVo.getId());
+                                List<UserStudyRecordPhoto> examPhoto = userStudyRecordPhotoService.list(lqw);
+                                if(Validator.isNotEmpty(examPhoto)&&examPhoto.size()>0){
+                                    UserStudyRecordPhoto photo = examPhoto.get(0);
+                                    syncUserChapterItem.setImageSrc(ossHost+"/"+photo.getPhoto());
+                                    syncUserChapterItem.setImageTime(DateUtils.timestampToDateFormat(photo.getCreateTime(),DateUtils.YYYY_MM_DD_HH_MM_SS));
+                                    syncUserChapterItem.setMatchData(Validator.isNotEmpty(photo.getSimilarity())?photo.getSimilarity().toString():null);
+                                    syncUserChapterItem.setExamTime(DateUtils.timestampToDateFormat(userPeriodStatusVo.getRecordStartTime(),DateUtils.YYYY_MM_DD_HH_MM_SS));
+                                    syncUserChapterItem.setExamScore(userPeriodStatusVo.getPerformance().toString());
+                                    syncUserChapterItem.setStudyIP(userPeriodStatusVo.getIp());
+                                }
+                            }
+                            List<ClassPeriodSectionVo> classPeriodSectionVos = classGradeUserMapper.listPeriodSection(courseModuleChapterVo.getChapterId(), bo.getGoodsId(), courseVo.getCourseId(), bo.getUserId());
+                            Collections.sort(classPeriodSectionVos);
+                            List<SyncUserStudyRec> RecList = new ArrayList<>();
+                            for (ClassPeriodSectionVo classPeriodSectionVo : classPeriodSectionVos) {
+                                SyncUserStudyRec syncUserStudyRec = new SyncUserStudyRec();
+                                syncUserStudyRec.setVideoId(classPeriodSectionVo.getId());
+                                syncUserStudyRec.setVideoKey(classPeriodSectionVo.getRecordingUrl());
+
+                                UserPeriodQueryBo userPeriodQueryBo2 = new UserPeriodQueryBo();
+                                userPeriodQueryBo2.setSectionId(classPeriodSectionVo.getId());
+                                userPeriodQueryBo2.setCourseId(courseVo.getCourseId());
+                                userPeriodQueryBo2.setGoodsId(bo.getGoodsId());
+                                userPeriodQueryBo2.setUserId(bo.getUserId());
+                                userPeriodQueryBo2.setChapterId(courseModuleChapterVo.getChapterId());
+                                userPeriodQueryBo2.setModuleId(courseMenuVo.getMenuId());
+                                userPeriodQueryBo2.setGradeId(bo.getGradeId());
+                                List<UserPeriodStatusVo> userPeriodStatusVos2 = userPeriodStatusService.selectPeriodStatus(userPeriodQueryBo2);
+                                if (!CollectionUtils.isEmpty(userPeriodStatusVos2)) {
+                                    int numIndex2 = userPeriodStatusVos2.size() - 1;
+                                    UserPeriodStatusVo userPeriodStatusVo = userPeriodStatusVos2.get(numIndex2);
+                                    LambdaQueryWrapper<UserStudyRecordPhoto> lqw = Wrappers.lambdaQuery();
+                                    lqw.eq(UserStudyRecordPhoto::getPeriodId, userPeriodStatusVo.getId());
+                                    List<UserStudyRecordPhoto> videoPhoto2 = userStudyRecordPhotoService.list(lqw);
+                                    syncUserStudyRec.setCreateTime(DateUtils.timestampToDateFormat(userPeriodStatusVo.getRecordStartTime(),DateUtils.YYYY_MM_DD_HH_MM_SS));
+                                    syncUserStudyRec.setEndTime(DateUtils.timestampToDateFormat(userPeriodStatusVo.getRecordEndTime(),DateUtils.YYYY_MM_DD_HH_MM_SS));
+                                    syncUserStudyRec.setStudyIP(userPeriodStatusVo.getIp());
+                                    List<SyncUserImageRc> ImgList = new ArrayList<>();
+                                    for (UserStudyRecordPhoto videoPhoto : videoPhoto2) {
+                                        SyncUserImageRc imageRc = new SyncUserImageRc();
+                                        imageRc.setImgSrc(ossHost+"/"+videoPhoto.getPhoto());
+                                        imageRc.setCreateTime(DateUtils.timestampToDateFormat(videoPhoto.getCreateTime(),DateUtils.YYYY_MM_DD_HH_MM_SS));
+                                        imageRc.setMatchData(Validator.isNotEmpty(videoPhoto.getSimilarity())?videoPhoto.getSimilarity().toString():null);
+                                        ImgList.add(imageRc);
+                                    }
+                                    syncUserStudyRec.setImgList(ImgList);
+                                }
+                                RecList.add(syncUserStudyRec);
                             }
-                        }
-                        List<ClassPeriodSectionVo> classPeriodSectionVos = classGradeUserMapper.listPeriodSection(courseModuleChapterVo.getChapterId(), bo.getGoodsId(), courseVo.getCourseId(), bo.getUserId());
-                        Collections.sort(classPeriodSectionVos);
-                        List<SyncUserStudyRec> RecList = new ArrayList<>();
-                        for (ClassPeriodSectionVo classPeriodSectionVo : classPeriodSectionVos) {
-                            SyncUserStudyRec syncUserStudyRec = new SyncUserStudyRec();
-                            syncUserStudyRec.setVideoId(classPeriodSectionVo.getId());
-                            syncUserStudyRec.setVideoKey(classPeriodSectionVo.getRecordingUrl());
-
-                            UserPeriodQueryBo userPeriodQueryBo2 = new UserPeriodQueryBo();
-                            userPeriodQueryBo2.setSectionId(classPeriodSectionVo.getId());
-                            userPeriodQueryBo2.setCourseId(courseVo.getCourseId());
-                            userPeriodQueryBo2.setGoodsId(bo.getGoodsId());
-                            userPeriodQueryBo2.setUserId(bo.getUserId());
-                            userPeriodQueryBo2.setChapterId(courseModuleChapterVo.getChapterId());
-                            userPeriodQueryBo2.setModuleId(courseMenuVo.getMenuId());
-                            userPeriodQueryBo2.setGradeId(bo.getGradeId());
-                            List<UserPeriodStatusVo> userPeriodStatusVos2 = userPeriodStatusService.selectPeriodStatus(userPeriodQueryBo2);
-                            if (!CollectionUtils.isEmpty(userPeriodStatusVos2)) {
-                                int numIndex2 = userPeriodStatusVos2.size() - 1;
-                                UserPeriodStatusVo userPeriodStatusVo = userPeriodStatusVos2.get(numIndex2);
+                            syncUserChapterItem.setRecList(RecList);
+                            ChapterList.add(syncUserChapterItem);
+                        });
+
+                    }
+                });
+            }
+            studyRec.setChapterList(ChapterList);
+        }
+        //七大员
+        if(Validator.isNotEmpty(business7.getId())&&goodsVo.getBusinessId().longValue()==business7.getId().longValue()){
+            for(CourseVo courseVo : courseVoList){
+                CourseMenuQueryBo menuQueryBo = new CourseMenuQueryBo();
+                menuQueryBo.setCourseId(courseVo.getCourseId());
+                List<CourseMenuVo> courseMenuVoList = iCourseMenuService.selectList(menuQueryBo);
+                courseMenuVoList.forEach(courseMenuVo -> {
+                    if(courseMenuVo.getType()==1){
+                        SyncUserChapterList syncUserChapterItem = new SyncUserChapterList();
+                        syncUserChapterItem.setChapterId(courseMenuVo.getMenuId());
+                        syncUserChapterItem.setChapterName(courseMenuVo.getMenuName());
+                        List<SyncUserChapterList> ChildChapList = new ArrayList<>();
+                        //获取章信息
+                        List<CourseModuleChapterVo> courseModuleChapterVoList = iCourseModuleChapterService.getListById(courseMenuVo.getMenuId());
+                        courseModuleChapterVoList.forEach(courseModuleChapterVo -> {
+                            SyncUserChapterList syncUserChapterChildItem = new SyncUserChapterList();
+                            syncUserChapterChildItem.setChapterId(courseModuleChapterVo.getChapterId());
+                            syncUserChapterChildItem.setChapterName(courseModuleChapterVo.getName());
+
+                            UserPeriodQueryBo userPeriodQueryBo = new UserPeriodQueryBo();
+                            userPeriodQueryBo.setCourseId(courseVo.getCourseId());
+                            userPeriodQueryBo.setGoodsId(bo.getGoodsId());
+                            userPeriodQueryBo.setUserId(bo.getUserId());
+                            userPeriodQueryBo.setChapterId(courseModuleChapterVo.getChapterId());
+                            userPeriodQueryBo.setModuleId(courseMenuVo.getMenuId());
+                            userPeriodQueryBo.setGradeId(bo.getGradeId());
+                            userPeriodQueryBo.setType(2);
+                            List<UserPeriodStatusVo> userPeriodStatusVos = userPeriodStatusService.selectPeriodStatus(userPeriodQueryBo);
+                            if (!CollectionUtils.isEmpty(userPeriodStatusVos)&&userPeriodStatusVos.size()>0) {
+                                int numIndex = userPeriodStatusVos.size() - 1;
+                                UserPeriodStatusVo userPeriodStatusVo = userPeriodStatusVos.get(numIndex);
                                 LambdaQueryWrapper<UserStudyRecordPhoto> lqw = Wrappers.lambdaQuery();
                                 lqw.eq(UserStudyRecordPhoto::getPeriodId, userPeriodStatusVo.getId());
-                                List<UserStudyRecordPhoto> videoPhoto2 = userStudyRecordPhotoService.list(lqw);
-                                syncUserStudyRec.setCreateTime(DateUtils.timestampToDateFormat(userPeriodStatusVo.getRecordStartTime(),DateUtils.YYYY_MM_DD_HH_MM_SS));
-                                syncUserStudyRec.setEndTime(DateUtils.timestampToDateFormat(userPeriodStatusVo.getRecordEndTime(),DateUtils.YYYY_MM_DD_HH_MM_SS));
-                                syncUserStudyRec.setStudyIP(userPeriodStatusVo.getIp());
-                                List<SyncUserImageRc> ImgList = new ArrayList<>();
-                                for (UserStudyRecordPhoto videoPhoto : videoPhoto2) {
-                                    SyncUserImageRc imageRc = new SyncUserImageRc();
-                                    imageRc.setImgSrc(ossHost+"/"+videoPhoto.getPhoto());
-                                    imageRc.setCreateTime(DateUtils.timestampToDateFormat(videoPhoto.getCreateTime(),DateUtils.YYYY_MM_DD_HH_MM_SS));
-                                    imageRc.setMatchData(Validator.isNotEmpty(videoPhoto.getSimilarity())?videoPhoto.getSimilarity().toString():null);
-                                    ImgList.add(imageRc);
+                                List<UserStudyRecordPhoto> examPhoto = userStudyRecordPhotoService.list(lqw);
+                                if(Validator.isNotEmpty(examPhoto)&&examPhoto.size()>0){
+                                    UserStudyRecordPhoto photo = examPhoto.get(0);
+                                    syncUserChapterChildItem.setImageSrc(ossHost+"/"+photo.getPhoto());
+                                    syncUserChapterChildItem.setImageTime(DateUtils.timestampToDateFormat(photo.getCreateTime(),DateUtils.YYYY_MM_DD_HH_MM_SS));
+                                    syncUserChapterChildItem.setMatchData(Validator.isNotEmpty(photo.getSimilarity())?photo.getSimilarity().toString():null);
+                                    syncUserChapterChildItem.setExamTime(DateUtils.timestampToDateFormat(userPeriodStatusVo.getRecordStartTime(),DateUtils.YYYY_MM_DD_HH_MM_SS));
+                                    syncUserChapterChildItem.setExamScore(userPeriodStatusVo.getPerformance().toString());
+                                    syncUserChapterChildItem.setStudyIP(userPeriodStatusVo.getIp());
                                 }
-                                syncUserStudyRec.setImgList(ImgList);
                             }
-                            RecList.add(syncUserStudyRec);
-                        }
-                        syncUserChapterItem.setRecList(RecList);
-                        ChapterList.add(syncUserChapterItem);
-                    });
+                            List<ClassPeriodSectionVo> classPeriodSectionVos = classGradeUserMapper.listPeriodSection(courseModuleChapterVo.getChapterId(), bo.getGoodsId(), courseVo.getCourseId(), bo.getUserId());
+                            Collections.sort(classPeriodSectionVos);
+                            List<SyncUserStudyRec> RecList = new ArrayList<>();
+                            for (ClassPeriodSectionVo classPeriodSectionVo : classPeriodSectionVos) {
+                                SyncUserStudyRec syncUserStudyRec = new SyncUserStudyRec();
+                                syncUserStudyRec.setVideoId(classPeriodSectionVo.getId());
+                                syncUserStudyRec.setVideoKey(classPeriodSectionVo.getRecordingUrl());
 
-                }
-            });
+                                UserPeriodQueryBo userPeriodQueryBo2 = new UserPeriodQueryBo();
+                                userPeriodQueryBo2.setSectionId(classPeriodSectionVo.getId());
+                                userPeriodQueryBo2.setCourseId(courseVo.getCourseId());
+                                userPeriodQueryBo2.setGoodsId(bo.getGoodsId());
+                                userPeriodQueryBo2.setUserId(bo.getUserId());
+                                userPeriodQueryBo2.setChapterId(courseModuleChapterVo.getChapterId());
+                                userPeriodQueryBo2.setModuleId(courseMenuVo.getMenuId());
+                                userPeriodQueryBo2.setGradeId(bo.getGradeId());
+                                List<UserPeriodStatusVo> userPeriodStatusVos2 = userPeriodStatusService.selectPeriodStatus(userPeriodQueryBo2);
+                                if (!CollectionUtils.isEmpty(userPeriodStatusVos2)) {
+                                    int numIndex2 = userPeriodStatusVos2.size() - 1;
+                                    UserPeriodStatusVo userPeriodStatusVo = userPeriodStatusVos2.get(numIndex2);
+                                    LambdaQueryWrapper<UserStudyRecordPhoto> lqw = Wrappers.lambdaQuery();
+                                    lqw.eq(UserStudyRecordPhoto::getPeriodId, userPeriodStatusVo.getId());
+                                    List<UserStudyRecordPhoto> videoPhoto2 = userStudyRecordPhotoService.list(lqw);
+                                    syncUserStudyRec.setCreateTime(DateUtils.timestampToDateFormat(userPeriodStatusVo.getRecordStartTime(),DateUtils.YYYY_MM_DD_HH_MM_SS));
+                                    syncUserStudyRec.setEndTime(DateUtils.timestampToDateFormat(userPeriodStatusVo.getRecordEndTime(),DateUtils.YYYY_MM_DD_HH_MM_SS));
+                                    syncUserStudyRec.setStudyIP(userPeriodStatusVo.getIp());
+                                    List<SyncUserImageRc> ImgList = new ArrayList<>();
+                                    for (UserStudyRecordPhoto videoPhoto : videoPhoto2) {
+                                        SyncUserImageRc imageRc = new SyncUserImageRc();
+                                        imageRc.setImgSrc(ossHost+"/"+videoPhoto.getPhoto());
+                                        imageRc.setCreateTime(DateUtils.timestampToDateFormat(videoPhoto.getCreateTime(),DateUtils.YYYY_MM_DD_HH_MM_SS));
+                                        imageRc.setMatchData(Validator.isNotEmpty(videoPhoto.getSimilarity())?videoPhoto.getSimilarity().toString():null);
+                                        ImgList.add(imageRc);
+                                    }
+                                    syncUserStudyRec.setImgList(ImgList);
+                                }
+                                RecList.add(syncUserStudyRec);
+                            }
+                            syncUserChapterChildItem.setRecList(RecList);
+                            ChildChapList.add(syncUserChapterChildItem);
+                        });
+                        syncUserChapterItem.setChildChapList(ChildChapList);
+                        ChapterList.add(syncUserChapterItem);
+                    }
+                });
+            }
+            studyRec.setChapterList(ChapterList);
         }
-        studyRec.setChapterList(ChapterList);
+        System.out.println(JSONObject.toJSONString(studyRec));
         //学习记录推送到旧系统
         Map<String, String> params = new HashMap<>();
         Long nowTime = DateUtils.getNowTime();

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

@@ -201,4 +201,8 @@ public class ClassPeriodStudentVo {
 
 	private List<String> recenPhotosList;
 
+	@Excel(name = "学时通过时间")
+	@ApiModelProperty("学时通过时间")
+	private Long periodTime;
+
 }

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

@@ -47,7 +47,6 @@ public class ClassPeriodVo implements Comparable<ClassPeriodVo> {
 	@ApiModelProperty("模塊ID")
 	private Long moduleId;
 
-	/** 商品ID */
 	@ApiModelProperty("商品ID")
 	private Long goodsId;
 

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

@@ -25,5 +25,7 @@ public class SyncUserChapterList {
 
     private String StudyIP;
 
+    private List<SyncUserChapterList> ChildChapList;
+
     private List<SyncUserStudyRec> RecList;
 }

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

@@ -32,6 +32,12 @@ public class SyncUserCourseStudyRec {
 
     private Long orderGoodsId;
 
+    private Integer CourseType;
+
+    private String CourseName;
+
+    private String MajorName;
+
     private List<SyncUserChapterList> ChapterList;
 
 }

+ 40 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/bo/OrderShareMoneyAddBo.java

@@ -0,0 +1,40 @@
+package com.zhongzheng.modules.order.bo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import java.util.Date;
+
+
+import java.math.BigDecimal;
+
+/**
+ * 订单分销返利钱添加对象 order_share_money
+ *
+ * @author hjl
+ * @date 2022-11-18
+ */
+@Data
+@ApiModel("订单分销返利钱添加对象")
+public class OrderShareMoneyAddBo {
+
+    /** $column.columnComment */
+    @ApiModelProperty("$column.columnComment")
+    private Long orderId;
+    /** 创建时间 */
+    @ApiModelProperty("创建时间")
+    private Long createTime;
+    /** 更新时间 */
+    @ApiModelProperty("更新时间")
+    private Long updateTime;
+    /** 0关闭返利 1返利 -1关闭 */
+    @ApiModelProperty("0关闭返利 1返利 -1关闭")
+    private Integer status;
+    /** 分销价格 */
+    @ApiModelProperty("分销价格")
+    private BigDecimal price;
+    /** 用户ID */
+    @ApiModelProperty("用户ID")
+    private Long userId;
+}

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