Pārlūkot izejas kodu

消息列表中商户应该显示商户的店铺名称,用户显示用户昵称,律师显示律师姓名

lutong 1 nedēļu atpakaļ
vecāks
revīzija
5b790ea17c

+ 1 - 1
alien-entity/src/main/java/shop/alien/entity/store/vo/LifeMessageVo.java

@@ -15,7 +15,7 @@ import shop.alien.entity.store.LifeMessage;
 @ApiModel(value = "LifeMessageVo对象", description = "消息通知")
 public class LifeMessageVo extends LifeMessage {
 
-    @ApiModelProperty(value = "名称")
+    @ApiModelProperty(value = "展示名称:门店为店铺名(store_name),用户为生活昵称,律师为姓名")
     private String userName;
 
     @ApiModelProperty(value = "头像")

+ 1 - 1
alien-entity/src/main/java/shop/alien/entity/store/vo/LifeNoticeVo.java

@@ -13,7 +13,7 @@ import shop.alien.entity.store.LifeNotice;
 @ApiModel(value = "LifeNoticeVo对象", description = "公告通知")
 public class LifeNoticeVo extends LifeNotice {
 
-    @ApiModelProperty(value = "用户名")
+    @ApiModelProperty(value = "发送方展示名:门店通知为店铺名称(store_name),C端用户为生活昵称")
     private String userName;
 
     @ApiModelProperty(value = "用户头像")

+ 3 - 2
alien-entity/src/main/java/shop/alien/mapper/LifeMessageMapper.java

@@ -23,7 +23,7 @@ public interface LifeMessageMapper extends BaseMapper<LifeMessage> {
             "from life_user " +
             "where delete_flag = 0 and user_phone != '' and user_phone in (${userPhones})  " +
             "union " +
-            "select info.id, user.nick_name userName, user.head_img userImage, concat('store_', user.phone) phoneId " +
+            "select info.id, info.store_name userName, user.head_img userImage, concat('store_', user.phone) phoneId " +
             "from store_user user " +
             "join store_info info on info.id = user.store_id " +
             "left join store_img img on img.store_id = info.id and img.img_type = '10' and img.delete_flag = 0 " +
@@ -44,7 +44,7 @@ public interface LifeMessageMapper extends BaseMapper<LifeMessage> {
             "select message.id, message.type, message.phoneId, message.content, message.created_time createdTime, message.is_read, " +
             "case "+
             "when message.flag = 'user' then user.user_name "+
-            "when message.flag = 'store' then suser.nick_name "+
+            "when message.flag = 'store' then sinfo.store_name "+
             "when message.flag = 'lawyer' then luser.name "+
             "else '' "+
             "end as userName, "+
@@ -63,6 +63,7 @@ public interface LifeMessageMapper extends BaseMapper<LifeMessage> {
             "from message_num message " +
             "left join life_user user on message.flag = 'user' and message.phone = user.user_phone and user.delete_flag = 0 " +
             "left join store_user suser on message.flag = 'store' and message.phone = suser.phone and suser.delete_flag = 0 " +
+            "left join store_info sinfo on suser.store_id = sinfo.id and sinfo.delete_flag = 0 " +
             "left join lawyer_user luser on message.flag = 'lawyer' and message.phone = luser.phone and luser.delete_flag = 0 "+
             "left join store_img img on img.store_id = suser.store_id and img.img_type = '10' and img.delete_flag = 0 " +
             "${ew.customSqlSegment}")

+ 2 - 2
alien-store/src/main/java/shop/alien/store/controller/LifeMessageController.java

@@ -31,8 +31,8 @@ public class LifeMessageController {
             {
                     @ApiImplicitParam(name = "receiverId", value = "当前登录人", dataType = "String", paramType = "query"),
                     @ApiImplicitParam(name = "friendType", value = "聊天类型  0-搜索 1-聊过 2-未聊过", dataType = "Integer", paramType = "query"),
-                    @ApiImplicitParam(name = "userName", value = "用户名", dataType = "String", paramType = "query"),
-                    @ApiImplicitParam(name = "search", value = "搜索字段", dataType = "Integer", paramType = "query")
+                    @ApiImplicitParam(name = "userName", value = "按展示名过滤(门店为店铺名、用户为昵称)", dataType = "String", paramType = "query"),
+                    @ApiImplicitParam(name = "search", value = "搜索关键词(昵称/店主姓名/店铺名)", dataType = "String", paramType = "query")
             }
                       )
     @GetMapping("/getMessageList")

+ 1 - 1
alien-store/src/main/java/shop/alien/store/service/impl/LifeMessageServiceImpl.java

@@ -69,7 +69,7 @@ public class LifeMessageServiceImpl extends ServiceImpl<LifeMessageMapper, LifeM
 
             // 通过搜索查询的情况下  不区分是否聊过  搜索所有消息
             if (0 == friendType && StringUtil.isNotEmpty(search)) {
-                wrapper.apply("(user.user_name like '%" + search + "%' or suser.name like '%" + search + "%')");
+                wrapper.apply("(user.user_name like '%" + search + "%' or suser.name like '%" + search + "%' or sinfo.store_name like '%" + search + "%')");
                 // 聊过
             } else if (1 == friendType) {
                 wrapper.apply("message.phoneId in ( " +