zx 2 هفته پیش
والد
کامیت
0d9adfc956

+ 6 - 2
fs-service-system/src/main/java/com/fs/course/service/impl/FsUserCourseVideoServiceImpl.java

@@ -760,7 +760,11 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
     public R registerCourse(FsUserCourseRegisterParam param) {
 
 
-        FsUser fsUser = fsUserMapper.selectFsUserByUserId(param.getUserId());
+        FsUser fsUser = fsUserMapper.selectFsUserById(param.getUserId());
+        if (fsUser==null){
+            return R.error("未登录成功");
+        }
+        logger.info(""+fsUser);
         if (fsUser.getIsAddQw()==1){
             return R.error("已经注册");
         }
@@ -776,7 +780,7 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
         QwExternalContact qw = new QwExternalContact();
         qw.setFsUserId(fsUser.getUserId());
         qw.setId(qwExternalContact.getId());
-        qwExternalContactMapper.updateQwExternalContactByExternalUserId(qw);
+        qwExternalContactMapper.updateById(qw);
         List<String> list= sopUserLogsInfoMapper.selectSopUserLogsInfoByExtId(qwExternalContact.getId());
         if (list!=null&& !list.isEmpty()){
             sopUserLogsInfoMapper.updateSopUserLogsInfoFsUserIdById(list,param.getUserId());

+ 5 - 0
fs-service-system/src/main/resources/mapper/store/FsUserMapper.xml

@@ -43,6 +43,7 @@
         <result property="userCode" column="user_code"/>
         <result property="isShow" column="is_show"/>
         <result property="qwExtId"    column="qw_ext_id"    />
+        <result property="isAddQw"    column="is_add_qw"    />
     </resultMap>
 
     <sql id="selectFsUserVo">
@@ -80,6 +81,7 @@
                is_del,
                is_weixin_auth,
                company_id,
+               is_add_qw,
                company_user_id,
                register_date,
                register_code,
@@ -261,6 +263,7 @@
             <if test="userCode != null">user_code,</if>
             <if test="isShow != null">is_show,</if>
             <if test="qwExtId != null">qw_ext_id,</if>
+            <if test="isAddQw != null">is_add_qw,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="username != null">#{username},</if>
@@ -301,6 +304,7 @@
             <if test="userCode != null">#{userCode},</if>
             <if test="isShow != null">#{isShow},</if>
             <if test="qwExtId != null">#{qwExtId},</if>
+            <if test="isAddQw != null">#{isAddQw},</if>
         </trim>
     </insert>
 
@@ -345,6 +349,7 @@
             <if test="userCode != null">user_code = #{userCode},</if>
             <if test="isShow != null">is_show = #{isShow},</if>
             <if test="qwExtId != null">qw_ext_id = #{qwExtId},</if>
+            <if test="isAddQw != null">is_add_qw = #{isAddQw},</if>
         </trim>
         where user_id = #{userId}
     </update>

+ 2 - 1
fs-user-app/src/main/java/com/fs/app/controller/CourseController.java

@@ -459,8 +459,9 @@ public class CourseController extends  AppBaseController{
     @PostMapping("/registerCourse")
     public R register(@RequestBody FsUserCourseRegisterParam param) {
         Long userId = Long.parseLong(getUserId());
-        param.setUserId(userId);
 
+        param.setUserId(userId);
+        logger.info("小程序用户Id:"+param.getUserId());
         return courseVideoService.registerCourse(param);
     }
     @Login