he2802 2 years ago
parent
commit
61e2a5b33b

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

@@ -317,6 +317,19 @@ public class UserStudyRecordServiceImpl extends ServiceImpl<UserStudyRecordMappe
     @Override
     @Transactional(rollbackFor = Exception.class)
     public Integer insertByAddBo(UserStudyRecordAddBo bo) {
+        //temp start
+        GoodsVo goodsVoTemp = iGoodsService.queryById(bo.getGoodsId());
+        CourseBusinessQueryBo businessQueryBo = new CourseBusinessQueryBo();
+        businessQueryBo.setId(goodsVoTemp.getBusinessId());
+        String fullNameTemp = iCourseBusinessService.queryFullName(businessQueryBo);
+        if(Validator.isNotEmpty(fullNameTemp)){
+            if(fullNameTemp.equals("继续教育二级建造师")||fullNameTemp.equals("继续教育二级造价师")){
+                bo.setErJianErZao(true);
+            }
+        }
+        //temp end
+
+
         CourseSectionVo courseSectionVo =iCourseSectionService.queryById(bo.getSectionId());
         //判断录播拍照是否达标
         if(courseSectionVo.getSectionType()==1&&Validator.isNotEmpty(bo.getStatus())&&bo.getStatus()==1){
@@ -434,7 +447,7 @@ public class UserStudyRecordServiceImpl extends ServiceImpl<UserStudyRecordMappe
             UserStudyRecordVo lastVo = queryLast(queryBo);
             if(Validator.isEmpty(lastVo)||Validator.isNotEmpty(bo.getPhoto())||Validator.isEmpty(lastVo.getVideoCurrentTime())||lastVo.getVideoCurrentTime().longValue()>add.getVideoCurrentTime().longValue()){
                 //如果没有历史数据或者之前播放时长比现在晚,或者携带照片则新增观看记录
-                if(Validator.isNotEmpty(lastVo)&&Validator.isNotEmpty(bo.getErJianErZao())&&bo.getErJianErZao()&&Validator.isEmpty(bo.getPhoto())&&(lastVo.getVideoCurrentTime().longValue()>add.getVideoCurrentTime().longValue())){
+                if(Validator.isNotEmpty(lastVo)&&Validator.isNotEmpty(lastVo.getSectionId())&&Validator.isNotEmpty(bo.getErJianErZao())&&bo.getErJianErZao()&&Validator.isEmpty(bo.getPhoto())&&(lastVo.getVideoCurrentTime().longValue()>add.getVideoCurrentTime().longValue())){
                     return 0;
                 }else{
                     this.save(add);