最新代码

This commit is contained in:
admin
2024-06-05 15:54:18 +08:00
parent aa68b33ca5
commit 80102a56fc
274 changed files with 13634 additions and 1347 deletions

View File

@@ -1,7 +1,7 @@
package com.starry.admin.modules.follow.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.github.yulichang.base.MPJBaseMapper;
import com.starry.admin.modules.follow.module.entity.PlayCustomFollowInfoEntity;
/**
@@ -10,7 +10,7 @@ import com.starry.admin.modules.follow.module.entity.PlayCustomFollowInfoEntity;
* @author admin
* @since 2024-04-30
*/
public interface PlayCustomFollowInfoMapper extends BaseMapper<PlayCustomFollowInfoEntity> {
public interface PlayCustomFollowInfoMapper extends MPJBaseMapper<PlayCustomFollowInfoEntity> {
}

View File

@@ -32,12 +32,12 @@ public class PlayCustomFollowInfoEntity extends BaseEntity<PlayCustomFollowInfoE
/**
* 顾客ID
*/
private String customUserId;
private String customId;
/**
* 陪聊ID
*/
private String clerkUserId;
private String clerkId;
/**
* 关注时间

View File

@@ -3,6 +3,8 @@ package com.starry.admin.modules.follow.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.starry.admin.modules.follow.module.entity.PlayCustomFollowInfoEntity;
import com.starry.admin.modules.weichat.entity.PlayClerkFollowQueryVo;
import com.starry.admin.modules.weichat.entity.PlayClerkFollowReturnVo;
/**
* 顾客关注陪聊信息Service接口
@@ -37,6 +39,17 @@ public interface IPlayCustomFollowInfoService extends IService<PlayCustomFollowI
*/
void updateFollowState(String customUserId, String clerkUserId, String followState);
/**
* 分页查询陪聊关注状态
*
* @param vo 店员关注状态 查询对象
* @return 顾客关注陪聊信息集合
* @author admin
* @since 2024/5/10 10:28
**/
IPage<PlayClerkFollowReturnVo> selectByPage(PlayClerkFollowQueryVo vo);
/**
* 查询顾客关注陪聊信息列表
*

View File

@@ -1,14 +1,18 @@
package com.starry.admin.modules.follow.service.impl;
import cn.hutool.core.util.IdUtil;
import com.starry.common.utils.IdUtils;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import com.starry.admin.modules.clerk.module.entity.PlayClerkUserInfoEntity;
import com.starry.admin.modules.follow.mapper.PlayCustomFollowInfoMapper;
import com.starry.admin.modules.follow.module.entity.PlayCustomFollowInfoEntity;
import com.starry.admin.modules.follow.service.IPlayCustomFollowInfoService;
import com.starry.admin.modules.weichat.entity.PlayClerkFollowQueryVo;
import com.starry.admin.modules.weichat.entity.PlayClerkFollowReturnVo;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@@ -41,8 +45,8 @@ public class PlayCustomFollowInfoServiceImpl extends ServiceImpl<PlayCustomFollo
@Override
public String queryFollowState(String customUserId, String clerkUserId) {
LambdaQueryWrapper<PlayCustomFollowInfoEntity> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(PlayCustomFollowInfoEntity::getClerkUserId, clerkUserId);
lambdaQueryWrapper.eq(PlayCustomFollowInfoEntity::getCustomUserId, customUserId);
lambdaQueryWrapper.eq(PlayCustomFollowInfoEntity::getClerkId, clerkUserId);
lambdaQueryWrapper.eq(PlayCustomFollowInfoEntity::getCustomId, customUserId);
PlayCustomFollowInfoEntity entity = this.baseMapper.selectOne(lambdaQueryWrapper);
return entity == null ? "0" : entity.getFollowState();
}
@@ -50,14 +54,14 @@ public class PlayCustomFollowInfoServiceImpl extends ServiceImpl<PlayCustomFollo
@Override
public void updateFollowState(String customUserId, String clerkUserId, String followState) {
LambdaQueryWrapper<PlayCustomFollowInfoEntity> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(PlayCustomFollowInfoEntity::getClerkUserId, clerkUserId);
lambdaQueryWrapper.eq(PlayCustomFollowInfoEntity::getCustomUserId, customUserId);
lambdaQueryWrapper.eq(PlayCustomFollowInfoEntity::getClerkId, clerkUserId);
lambdaQueryWrapper.eq(PlayCustomFollowInfoEntity::getCustomId, customUserId);
PlayCustomFollowInfoEntity entity = this.baseMapper.selectOne(lambdaQueryWrapper);
if (entity == null) {
entity = new PlayCustomFollowInfoEntity();
entity.setCustomUserId(customUserId);
entity.setCustomId(customUserId);
entity.setFollowState(followState);
entity.setClerkUserId(clerkUserId);
entity.setClerkId(clerkUserId);
entity.setFollowTime(new Date());
this.baseMapper.insert(entity);
} else {
@@ -66,6 +70,30 @@ public class PlayCustomFollowInfoServiceImpl extends ServiceImpl<PlayCustomFollo
}
}
@Override
public IPage<PlayClerkFollowReturnVo> selectByPage(PlayClerkFollowQueryVo vo) {
MPJLambdaWrapper<PlayCustomFollowInfoEntity> lambdaQueryWrapper = new MPJLambdaWrapper<PlayCustomFollowInfoEntity>()
// 查询主表全部字段
.selectAll(PlayCustomFollowInfoEntity.class)
// 陪聊用户表全部字段
.selectAll(PlayClerkUserInfoEntity.class)
// 陪聊用户表
.leftJoin(PlayClerkUserInfoEntity.class, PlayClerkUserInfoEntity::getId, PlayCustomFollowInfoEntity::getClerkId);
if (StrUtil.isNotBlank(vo.getCustomId())) {
lambdaQueryWrapper.eq(PlayCustomFollowInfoEntity::getCustomId, vo.getCustomId());
}
if (StrUtil.isNotBlank(vo.getFollowState())) {
lambdaQueryWrapper.eq(PlayCustomFollowInfoEntity::getFollowState, vo.getFollowState());
}
IPage<PlayClerkFollowReturnVo> iPage = this.baseMapper.selectJoinPage(new Page<>(vo.getPageNum(), vo.getPageSize()), PlayClerkFollowReturnVo.class, lambdaQueryWrapper);
for (PlayClerkFollowReturnVo record : iPage.getRecords()) {
LambdaQueryWrapper<PlayCustomFollowInfoEntity> lambdaQueryWrapper1 = new LambdaQueryWrapper<>();
lambdaQueryWrapper1.eq(PlayCustomFollowInfoEntity::getClerkId,record.getClerkId());
record.setFollowNumber(this.baseMapper.selectList(lambdaQueryWrapper1).size());
}
return iPage;
}
/**
* 查询顾客关注陪聊信息列表
*
@@ -87,7 +115,7 @@ public class PlayCustomFollowInfoServiceImpl extends ServiceImpl<PlayCustomFollo
@Override
public boolean create(PlayCustomFollowInfoEntity playCustomFollowInfo) {
if (StrUtil.isBlankIfStr(playCustomFollowInfo.getId())) {
playCustomFollowInfo.setId(IdUtil.fastSimpleUUID());
playCustomFollowInfo.setId(IdUtils.getUuid());
}
return save(playCustomFollowInfo);
}