he2802 пре 2 година
родитељ
комит
727b9751fc

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

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

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

@@ -311,6 +311,7 @@ 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){
@@ -321,6 +322,7 @@ 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){
@@ -428,7 +430,11 @@ 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()){
                 //如果没有历史数据或者之前播放时长比现在晚,或者携带照片则新增观看记录
-                this.save(add);
+                if(erJianErZao&&Validator.isEmpty(bo.getPhoto())&&(lastVo.getVideoCurrentTime().longValue()>add.getVideoCurrentTime().longValue())){
+                    return 0;
+                }else{
+                    this.save(add);
+                }
             }else{
                 if(Validator.isNotEmpty(add.getStatus())&&add.getStatus()==1){
                     lastVo.setStatus(1);

+ 2 - 2
zhongzheng-system/src/main/resources/mapper/modules/top/TopSysUserMapper.xml

@@ -116,12 +116,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         ${params.dataScope}
     </select>
 
-    <select id="selectUserByUserName" parameterType="String" resultType="com.zhongzheng.common.core.domain.entity.TopSysUser">
+    <select id="selectUserByUserName" parameterType="String" resultMap="TopSysUserResult">
         <include refid="selectTopUserVo"/>
         where u.user_name = #{userName} and u.`status` != -1
     </select>
 
-    <select id="selectUserById" parameterType="Long" resultType="com.zhongzheng.common.core.domain.entity.TopSysUser">
+    <select id="selectUserById" parameterType="Long" resultMap="TopSysUserResult">
         <include refid="selectTopUserVo"/>
         where u.user_id = #{userId}
     </select>