he2802 2 yıl önce
ebeveyn
işleme
9da2acbe3c

+ 10 - 8
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/impl/UserStudyRecordServiceImpl.java

@@ -341,27 +341,29 @@ public class UserStudyRecordServiceImpl extends ServiceImpl<UserStudyRecordMappe
     @Transactional(rollbackFor = Exception.class)
     @Transactional(rollbackFor = Exception.class)
     public Integer insertByAddBo(UserStudyRecordAddBo bo) {
     public Integer insertByAddBo(UserStudyRecordAddBo bo) {
         //temp start
         //temp start
-        GoodsVo goodsVoTemp = iGoodsService.queryById(bo.getGoodsId());
+        GoodsVo goodsVo = iGoodsService.queryById(bo.getGoodsId());
         CourseBusinessQueryBo businessQueryBo = new CourseBusinessQueryBo();
         CourseBusinessQueryBo businessQueryBo = new CourseBusinessQueryBo();
-        businessQueryBo.setId(goodsVoTemp.getBusinessId());
-        String fullNameTemp = iCourseBusinessService.queryFullName(businessQueryBo);
-        if(Validator.isNotEmpty(fullNameTemp)){
-            if(fullNameTemp.equals("继续教育二级建造师")||fullNameTemp.equals("继续教育二级造价师")){
+        businessQueryBo.setId(goodsVo.getBusinessId());
+        String fullName = iCourseBusinessService.queryFullName(businessQueryBo);
+        if(Validator.isNotEmpty(fullName)){
+            if(fullName.equals("继续教育二级建造师")||fullName.equals("继续教育二级造价师")){
                 bo.setErJianErZao(true);
                 bo.setErJianErZao(true);
             }
             }
         }
         }
         //temp end
         //temp end
-
+        if(Validator.isNotEmpty(goodsVo.getFirstChoiceStatus())&&goodsVo.getFirstChoiceStatus()==1){
+            throw new CustomException("优选根商品无法学习");
+        }
 
 
         CourseSectionVo courseSectionVo =iCourseSectionService.queryById(bo.getSectionId());
         CourseSectionVo courseSectionVo =iCourseSectionService.queryById(bo.getSectionId());
         if(Validator.isEmpty(courseSectionVo)||Validator.isEmpty(bo.getSectionId())){
         if(Validator.isEmpty(courseSectionVo)||Validator.isEmpty(bo.getSectionId())){
             throw new CustomException("节数据错误");
             throw new CustomException("节数据错误");
         }
         }
-        GoodsVo goodsVo = iGoodsService.queryById(bo.getGoodsId());
+        /*GoodsVo goodsVo = iGoodsService.queryById(bo.getGoodsId());
         String fullName;
         String fullName;
         CourseBusinessQueryBo queryBusinessBo = new CourseBusinessQueryBo();
         CourseBusinessQueryBo queryBusinessBo = new CourseBusinessQueryBo();
         queryBusinessBo.setId(goodsVo.getBusinessId());
         queryBusinessBo.setId(goodsVo.getBusinessId());
-        fullName = iCourseBusinessService.queryFullName(queryBusinessBo);
+        fullName = iCourseBusinessService.queryFullName(queryBusinessBo);*/
         //判断录播拍照是否达标
         //判断录播拍照是否达标
         if(courseSectionVo.getSectionType()==1&&Validator.isNotEmpty(bo.getStatus())&&bo.getStatus()==1){
         if(courseSectionVo.getSectionType()==1&&Validator.isNotEmpty(bo.getStatus())&&bo.getStatus()==1){
             if(Validator.isNotEmpty(goodsVo)){
             if(Validator.isNotEmpty(goodsVo)){