he2802 2 年之前
父节点
当前提交
c9992ba648

+ 1 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/bo/UserStudyRecordAddBo.java

@@ -92,5 +92,5 @@ public class UserStudyRecordAddBo {
     /** 相似度 */
     @ApiModelProperty("相似度")
     private Integer similarity;
-
+    private Boolean erJianErZao;
 }

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

@@ -315,7 +315,6 @@ public class UserStudyRecordServiceImpl extends ServiceImpl<UserStudyRecordMappe
     @Override
     @Transactional(rollbackFor = Exception.class)
     public Integer insertByAddBo(UserStudyRecordAddBo bo) {
-        Boolean erJianErZao = false;
         CourseSectionVo courseSectionVo =iCourseSectionService.queryById(bo.getSectionId());
         //判断录播拍照是否达标
         if(courseSectionVo.getSectionType()==1&&Validator.isNotEmpty(bo.getStatus())&&bo.getStatus()==1){
@@ -326,7 +325,6 @@ public class UserStudyRecordServiceImpl extends ServiceImpl<UserStudyRecordMappe
                 String fullName = iCourseBusinessService.queryFullName(queryBo);
                 if(Validator.isNotEmpty(fullName)){
                     if(fullName.equals("继续教育二级建造师")||fullName.equals("继续教育二级造价师")){
-                        erJianErZao = true;
                         if(Validator.isNotEmpty(courseSectionVo.getDurationTime())||Validator.isNotEmpty(bo.getVideoCurrentTime())){
                             Long videoTime = 0L;
                             if(Validator.isNotEmpty(courseSectionVo.getDurationTime())&&courseSectionVo.getDurationTime().longValue()>0){
@@ -434,7 +432,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(erJianErZao&&Validator.isEmpty(bo.getPhoto())&&(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())){
                     return 0;
                 }else{
                     this.save(add);
@@ -708,6 +706,7 @@ public class UserStudyRecordServiceImpl extends ServiceImpl<UserStudyRecordMappe
                         classSectionVo.setModuleId(classPeriodVo.getId());
                         classSectionVo.setChapterId(classChapterVo.getId());
                         classSectionVo.setSectionId(classSectionVo.getId());
+                        classSectionVo.setType(3L);
                         sectionList.add(classSectionVo);
                     }
                 }
@@ -723,6 +722,7 @@ public class UserStudyRecordServiceImpl extends ServiceImpl<UserStudyRecordMappe
                     classSectionVo.setModuleId(0L);
                     classSectionVo.setChapterId(classPeriodVo.getId());
                     classSectionVo.setSectionId(classSectionVo.getId());
+                    classSectionVo.setType(3L);
                     sectionList.add(classSectionVo);
                 }
             }