ソースを参照

会员管理,及@TableId补充

ct 2 週間 前
コミット
81a9695e58

+ 2 - 0
fs-service-system/src/main/java/com/fs/course/domain/FsCourseWatchComment.java

@@ -1,5 +1,6 @@
 package com.fs.course.domain;
 
+import com.baomidou.mybatisplus.annotation.TableId;
 import com.fs.common.annotation.Excel;
 import com.fs.common.core.domain.BaseEntity;
 import io.swagger.annotations.ApiModelProperty;
@@ -17,6 +18,7 @@ import lombok.EqualsAndHashCode;
 public class FsCourseWatchComment extends BaseEntity{
 
     /** 评论id */
+    @TableId
     private Long commentId;
 
     /** 用户id */

+ 2 - 0
fs-service-system/src/main/java/com/fs/course/domain/FsUserCourseComplaintRecord.java

@@ -1,6 +1,7 @@
 package com.fs.course.domain;
 
 import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
 import com.fs.common.annotation.Excel;
 import com.fs.common.core.domain.BaseEntity;
 import io.swagger.annotations.ApiModelProperty;
@@ -30,6 +31,7 @@ public class FsUserCourseComplaintRecord extends BaseEntity{
     private String nickName;
 
     /** 投诉记录id */
+    @TableId
     private Long recordId;
 
     /** 用户id,关联fs_user */

+ 2 - 0
fs-service-system/src/main/java/com/fs/course/domain/FsUserCourseComplaintType.java

@@ -1,5 +1,6 @@
 package com.fs.course.domain;
 
+import com.baomidou.mybatisplus.annotation.TableId;
 import com.fs.common.annotation.Excel;
 import com.fs.common.core.domain.TreeEntity;
 import lombok.Data;
@@ -16,6 +17,7 @@ import lombok.EqualsAndHashCode;
 public class FsUserCourseComplaintType extends TreeEntity{
 
     /** 投诉类型id */
+    @TableId
     private Long complaintTypeId;
 
     /** 投诉类型名称 */

+ 2 - 0
fs-service-system/src/main/java/com/fs/crm/domain/CrmCustomer.java

@@ -1,5 +1,6 @@
 package com.fs.crm.domain;
 
+import com.baomidou.mybatisplus.annotation.TableId;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.fs.common.annotation.Excel;
 import com.fs.common.core.domain.BaseEntity;
@@ -21,6 +22,7 @@ public class CrmCustomer extends BaseEntity
     private static final long serialVersionUID = 1L;
 
     /** $column.columnComment */
+    @TableId
     private Long customerId;
 
     /** 组织机构代码 */

+ 2 - 0
fs-service-system/src/main/java/com/fs/qw/domain/QwMsg.java

@@ -1,5 +1,6 @@
 package com.fs.qw.domain;
 
+import com.baomidou.mybatisplus.annotation.TableId;
 import com.fs.common.annotation.Excel;
 import com.fs.common.core.domain.BaseEntity;
 import lombok.Data;
@@ -18,6 +19,7 @@ public class QwMsg extends BaseEntity implements Serializable
 
     /** $column.columnComment */
 
+    @TableId
     private Long msgId;
 
     /** 会话id */

+ 2 - 1
fs-service-system/src/main/java/com/fs/qw/domain/QwSession.java

@@ -1,5 +1,6 @@
 package com.fs.qw.domain;
 
+import com.baomidou.mybatisplus.annotation.TableId;
 import com.fs.common.annotation.Excel;
 import com.fs.common.core.domain.BaseEntity;
 import lombok.Data;
@@ -17,7 +18,7 @@ public class QwSession extends BaseEntity implements Serializable
 {
 
     /** 会话ID */
-
+    @TableId
     private Long sessionId;
 
     /** 会话标识 */

+ 6 - 3
fs-service-system/src/main/java/com/fs/store/service/impl/FsUserServiceImpl.java

@@ -533,11 +533,11 @@ public class FsUserServiceImpl implements IFsUserService
     public TableDataInfo selectFsUserPageListNew(FsUserPageListParam param) {
         // 找出下级销售
         String companyUserId = param.getCompanyUserId();
-        if(companyUserId != null) {
+        if(StringUtils.isNotBlank(companyUserId)) {
             Long companyUser = Long.parseLong(companyUserId);
             Set<Long> userIds = companyUserCacheService.selectUserAllCompanyUserId(companyUser);
             if (userIds != null || userIds.size() <= 1) {
-                if (param.getIsAdmin()) {
+                if (param.getIsAdmin() != null && param.getIsAdmin()) {
                     List<CompanyUser> companyUsers = companyUserMapper.selectCompanyUserByCompanyId(param.getCompanyId());
                     userIds = companyUsers.stream().map(CompanyUser::getUserId).collect(Collectors.toSet());
                 }
@@ -549,7 +549,10 @@ public class FsUserServiceImpl implements IFsUserService
         Map<Long, CompanyTag> tagMap = companyTagCacheService.queryAllTagMap();
         //获取会员的最新的看课状态和最后看课时间
         Set<Long> userIds = fsUserPageListVOS.stream().map(FsUserPageListVO::getUserId).collect(Collectors.toSet());
-        List<FsUserLastCount> fsUserCourseCounts = fsUserCourseCountMapper.selectUserLastCount(userIds);
+        List<FsUserLastCount> fsUserCourseCounts = new ArrayList<>();
+        if (userIds.size() > 0) {
+            fsUserCourseCounts = fsUserCourseCountMapper.selectUserLastCount(userIds);
+        }
         Map<Long, FsUserLastCount> countMap = fsUserCourseCounts.stream().collect(Collectors.toMap(FsUserLastCount::getUserId, Function.identity()));
 
         for (FsUserPageListVO item : fsUserPageListVOS) {

+ 2 - 0
fs-service-system/src/main/java/com/fs/system/domain/SysKeyword.java

@@ -1,6 +1,7 @@
 package com.fs.system.domain;
 
 import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
 import com.fs.common.annotation.Excel;
 import com.fs.common.core.domain.BaseEntity;
 import lombok.Data;
@@ -23,6 +24,7 @@ public class SysKeyword extends BaseEntity{
     private Integer pageSize;
 
     /** 关键字id */
+    @TableId
     private Long keywordId;
 
     /** 关键字 */

+ 10 - 10
fs-service-system/src/main/java/com/fs/system/mapper/SysDictTypeMapper.java

@@ -6,7 +6,7 @@ import com.fs.common.core.domain.entity.SysDictType;
 
 /**
  * 字典表 数据层
- * 
+ *
 
  */
 @Mapper
@@ -14,7 +14,7 @@ public interface SysDictTypeMapper
 {
     /**
      * 根据条件分页查询字典类型
-     * 
+     *
      * @param dictType 字典类型信息
      * @return 字典类型集合信息
      */
@@ -22,14 +22,14 @@ public interface SysDictTypeMapper
 
     /**
      * 根据所有字典类型
-     * 
+     *
      * @return 字典类型集合信息
      */
     public List<SysDictType> selectDictTypeAll();
 
     /**
      * 根据字典类型ID查询信息
-     * 
+     *
      * @param dictId 字典类型ID
      * @return 字典类型
      */
@@ -37,7 +37,7 @@ public interface SysDictTypeMapper
 
     /**
      * 根据字典类型查询信息
-     * 
+     *
      * @param dictType 字典类型
      * @return 字典类型
      */
@@ -45,7 +45,7 @@ public interface SysDictTypeMapper
 
     /**
      * 通过字典ID删除字典信息
-     * 
+     *
      * @param dictId 字典ID
      * @return 结果
      */
@@ -53,7 +53,7 @@ public interface SysDictTypeMapper
 
     /**
      * 批量删除字典类型信息
-     * 
+     *
      * @param dictIds 需要删除的字典ID
      * @return 结果
      */
@@ -61,7 +61,7 @@ public interface SysDictTypeMapper
 
     /**
      * 新增字典类型信息
-     * 
+     *
      * @param dictType 字典类型信息
      * @return 结果
      */
@@ -69,7 +69,7 @@ public interface SysDictTypeMapper
 
     /**
      * 修改字典类型信息
-     * 
+     *
      * @param dictType 字典类型信息
      * @return 结果
      */
@@ -77,7 +77,7 @@ public interface SysDictTypeMapper
 
     /**
      * 校验字典类型称是否唯一
-     * 
+     *
      * @param dictType 字典类型
      * @return 结果
      */

+ 2 - 1
fs-service-system/src/main/resources/mapper/company/CompanyUserChangeApplyMapper.xml

@@ -30,6 +30,7 @@
                 and cuca.company_id = #{map.companyId}
             </if>
         </where>
+        order by cuca.apply_time desc
     </select>
 
     <!-- 查询申请详情 -->
@@ -37,4 +38,4 @@
         <include refid="applySQL"/>
         where cuca.id = #{id}
     </select>
-</mapper>
+</mapper>

+ 7 - 4
fs-service-system/src/main/resources/mapper/store/FsUserMapper.xml

@@ -269,7 +269,9 @@
         LEFT JOIN company_user ON company_user.user_id = u.company_user_id
         LEFT JOIN company on company.company_id = company_user.company_id
         <where>
-        1 = 1
+        <if test = "maps.userId != null" >
+            AND u.user_id = #{maps.userId}
+        </if >
         <if test = "maps.nickname != null and  maps.nickname !='' " >
             AND u.nickname LIKE CONCAT("%",#{maps.nickname},"%")
         </if >
@@ -483,8 +485,10 @@
         fs_user.company_id
         FROM
         fs_user
-        <where>
-            fs_user.is_del = 0
+        where fs_user.is_del = 0
+            <if test="userId != null">
+                AND fs_user.user_id = #{userId}
+            </if>
             <if test="companyId != null">
                 AND fs_user.company_id = #{companyId}
             </if>
@@ -509,7 +513,6 @@
             <if test="phone != null and phone != ''">
                 AND fs_user.phone like concat('%', #{phone},'%')
             </if>
-        </where>
         limit ${(pageNum-1)*pageSize},${pageSize}
     </select>