Parcourir la source

增加商城订单归属

yuhongqi il y a 2 semaines
Parent
commit
f1fa0bbb69

+ 1 - 1
fs-service/src/main/java/com/fs/course/mapper/FsCourseWatchLogMapper.java

@@ -940,7 +940,7 @@ public interface FsCourseWatchLogMapper extends BaseMapper<FsCourseWatchLog> {
             "WHERE user_id = #{userId} " +
             "AND duration > 0 " +
             "AND (send_type = 1 OR send_type = 2) " +
-            "ORDER BY create_time DESC " +
+            "ORDER BY update_time DESC " +
             "LIMIT 1")
     FsCourseWatchLog selectLatestWatchLogByUserId(@Param("userId") Long userId);
 }

+ 3 - 3
fs-service/src/main/java/com/fs/course/mapper/FsUserCourseCommentMapper.java

@@ -88,7 +88,7 @@ public interface FsUserCourseCommentMapper
     @Select("select c.*,u.nick_name,u.phone,u,avatar from fs_user_course_comment c LEFT JOIN fs_user u ON c.user_id=u.user_id where parent_id=#{pid}")
     List<FsUserCourseCommentVO> selectFsUserCourseCommentAllListVO(Long pid);
     @Select({"<script> " +
-            "select c.*,u.nick_name,u.avatar,tu.nick_name to_nick_name, IFNULL(l.id, 0) AS is_like from fs_user_course_comment c " +
+            "select c.*,u.nick_name as nickNameOriginal,u.avatar,tu.nick_name to_nick_name, IFNULL(l.id, 0) AS is_like from fs_user_course_comment c " +
             "LEFT JOIN fs_user u ON c.user_id=u.user_id " +
             "LEFT  JOIN fs_user tu ON tu.user_id =c.to_user_id " +
             "LEFT JOIN fs_user_course_comment_like l ON c.comment_id=l.comment_id and #{userId}=l.user_id "+
@@ -100,7 +100,7 @@ public interface FsUserCourseCommentMapper
             "</script>"})
     List<FsUserCourseCommentListUVO> selectFsUserCourseCommentListUVO(FsUserCourseCommentUParam param);
     @Select({"<script> " +
-            "select c.*,u.nick_name,u.avatar,tu.nick_name to_nick_name from fs_user_course_comment c LEFT JOIN fs_user u ON c.user_id=u.user_id LEFT  JOIN fs_user tu ON tu.user_id =c.to_user_id " +
+            "select c.*,u.nick_name as nickNameOriginal,u.avatar,tu.nick_name to_nick_name from fs_user_course_comment c LEFT JOIN fs_user u ON c.user_id=u.user_id LEFT  JOIN fs_user tu ON tu.user_id =c.to_user_id " +
             "where c.user_id=#{userId} " +
             "<if test='courseId != null'> and c.course_id = #{courseId}</if>" +
             "<if test='videoId != null'> and c.video_id = #{videoId}</if>" +
@@ -143,7 +143,7 @@ public interface FsUserCourseCommentMapper
     List<FsUserCourseCommentReplyListUVO> selectFsUserCourseCommentReplyListUVO(@Param("commentId") Long commentId, @Param("userId") String userId);
 
     @Select({"<script> " +
-            "select c.*,u.nick_name,u.avatar,tu.nick_name to_nick_name from fs_user_course_comment c " +
+            "select c.*,u.nick_name as nickNameOriginal,u.avatar,tu.nick_name to_nick_name from fs_user_course_comment c " +
             "LEFT JOIN fs_user u ON c.user_id=u.user_id " +
             "LEFT  JOIN fs_user tu ON tu.user_id =c.to_user_id " +
             "where c.is_del = 0 and  c.type = 1  \n" +

+ 13 - 1
fs-service/src/main/java/com/fs/course/service/impl/FsUserCourseCommentServiceImpl.java

@@ -3,6 +3,7 @@ package com.fs.course.service.impl;
 import java.util.Collections;
 import java.util.List;
 import com.fs.common.utils.DateUtils;
+import com.fs.common.utils.StringUtils;
 import com.fs.course.param.FsUserCourseCommentParam;
 import com.fs.course.param.FsUserCourseCommentUParam;
 import com.fs.course.vo.FsUserCourseCommentListUVO;
@@ -124,12 +125,23 @@ public class FsUserCourseCommentServiceImpl implements IFsUserCourseCommentServi
         }else {
             list = fsUserCourseCommentMapper.selectFsUserCourseCommentListUVO(param);
         }
+        list.forEach(comment -> {
+            if (StringUtils.isEmpty(comment.getNickName())) {
+                comment.setNickName(comment.getNickNameOriginal());
+            }
+        });
         return list;
     }
 
     @Override
     public List<FsUserCourseCommentListUVO> selectFsUserCourseCommentMyListUVO(FsUserCourseCommentUParam param) {
-        return fsUserCourseCommentMapper.selectFsUserCourseCommentMyListUVO(param);
+        List<FsUserCourseCommentListUVO> list = fsUserCourseCommentMapper.selectFsUserCourseCommentMyListUVO(param);
+        list.forEach(comment -> {
+            if (StringUtils.isEmpty(comment.getNickName())) {
+                comment.setNickName(comment.getNickNameOriginal());
+            }
+        });
+        return list;
     }
 
     @Override

+ 1 - 0
fs-service/src/main/java/com/fs/course/vo/FsUserCourseCommentListUVO.java

@@ -20,6 +20,7 @@ public class FsUserCourseCommentListUVO {
     @Excel(name = "课堂id")
     private Long courseId;
     private String nickName;
+    private String nickNameOriginal;
     private String toNickName;
     private String avatar;
     /** 评论类型 1:评论,2:回复 */

+ 1 - 1
fs-service/src/main/java/com/fs/hisStore/service/impl/FsStoreOrderScrmServiceImpl.java

@@ -1304,7 +1304,7 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
 
             // 商城订单归属绑定
             if (hisStoreConfig != null && Boolean.TRUE.equals(hisStoreConfig.getEnableStoreOrderAttribution())
-                    && storeOrder.getOrderType() == null ) {
+                    && storeOrder.getOrderType() == null && storeOrder.getCompanyUserId() == null) {
                 try {
                     bindStoreOrderAttribution(storeOrder, userId);
                 } catch (Exception e) {