This commit is contained in:
PQZ 2025-03-21 14:58:06 +08:00
parent 9bca03b78a
commit 793bb52772
13 changed files with 232 additions and 38 deletions

View File

@ -1,6 +1,7 @@
package com.ruoyi.busi.service;
import java.util.List;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
@ -8,11 +9,20 @@ import com.ruoyi.busi.domain.BusiEvaluate;
/**
* 评价Service接口
*
*
* @author 朱春云
* @date 2025-03-17
*/
public interface IBusiEvaluateService extends IService<BusiEvaluate>
{
public interface IBusiEvaluateService extends IService<BusiEvaluate> {
IPage<BusiEvaluate> queryListPage(BusiEvaluate pageReqVO, Page<BusiEvaluate> page);
/**
* 通过被评价人用户id查询评价内容
*
* @param userId 被评价人用户id
* @return java.util.List<com.ruoyi.busi.domain.BusiEvaluate>
* @author PQZ
* @date 14:16 2025/3/21
**/
List<BusiEvaluate> listByToUserId(Long userId);
}

View File

@ -15,4 +15,13 @@ import com.ruoyi.busi.domain.BusiNotice;
public interface IBusiNoticeService extends IService<BusiNotice>
{
IPage<BusiNotice> queryListPage(BusiNotice pageReqVO, Page<BusiNotice> page);
/**
* 通过用户id查询通告发布记录
* @author PQZ
* @date 14:35 2025/3/21
* @param userId 用户id
* @return java.util.List<com.ruoyi.busi.domain.BusiNotice>
**/
List<BusiNotice> listByUserId(Long userId);
}

View File

@ -1,15 +1,16 @@
package com.ruoyi.busi.service.impl;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
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.ruoyi.busi.domain.BusiEvaluate;
import com.ruoyi.busi.mapper.BusiEvaluateMapper;
import com.ruoyi.busi.service.IBusiEvaluateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.busi.mapper.BusiEvaluateMapper;
import com.ruoyi.busi.domain.BusiEvaluate;
import com.ruoyi.busi.service.IBusiEvaluateService;
import java.util.List;
/**
* 评价Service业务层处理
@ -27,4 +28,19 @@ public class BusiEvaluateServiceImpl extends ServiceImpl<BusiEvaluateMapper,Busi
public IPage<BusiEvaluate> queryListPage(BusiEvaluate pageReqVO, Page<BusiEvaluate> page) {
return busiEvaluateMapper.queryListPage(pageReqVO, page);
}
/**
* 通过被评价人用户id查询评价内容
*
* @param userId 被评价人用户id
* @return java.util.List<com.ruoyi.busi.domain.BusiEvaluate>
* @author PQZ
* @date 14:16 2025/3/21
**/
@Override
public List<BusiEvaluate> listByToUserId(Long userId) {
LambdaUpdateWrapper<BusiEvaluate> lambdaUpdateWrapper = new LambdaUpdateWrapper<>();
lambdaUpdateWrapper.eq(BusiEvaluate::getToUserId,userId);
return list(lambdaUpdateWrapper);
}
}

View File

@ -1,6 +1,10 @@
package com.ruoyi.busi.service.impl;
import java.util.List;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.ruoyi.common.core.domain.DlBaseEntity;
import com.ruoyi.common.utils.DateUtils;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@ -27,4 +31,21 @@ public class BusiNoticeServiceImpl extends ServiceImpl<BusiNoticeMapper,BusiNoti
public IPage<BusiNotice> queryListPage(BusiNotice pageReqVO, Page<BusiNotice> page) {
return busiNoticeMapper.queryListPage(pageReqVO, page);
}
/**
* 通过用户id查询通告发布记录
*
* @param userId 用户id
* @return java.util.List<com.ruoyi.busi.domain.BusiNotice>
* @author PQZ
* @date 14:35 2025/3/21
**/
@Override
public List<BusiNotice> listByUserId(Long userId) {
LambdaQueryWrapper<BusiNotice> lambdaQueryWrapper = new LambdaQueryWrapper();
lambdaQueryWrapper
.eq(DlBaseEntity::getDelFlag,0)
.eq(BusiNotice::getUserId,userId);
return list(lambdaQueryWrapper);
}
}

View File

@ -51,6 +51,20 @@ public class MemberUserController extends BaseController {
return success(list);
}
/**
* 获取会员详细信息
*
* @param userId 用户表id
* @return com.ruoyi.common.core.domain.AjaxResult
* @author PQZ
* @date 11:36 2025/3/21
**/
@PreAuthorize("@ss.hasPermi('member:member:query')")
@GetMapping(value = "/announcerDetail/{userId}")
public AjaxResult getInfo(@PathVariable("userId") Long userId) {
return success(memberUserService.announcerDetail(userId));
}
/**
* 导出会员列表
@ -64,14 +78,6 @@ public class MemberUserController extends BaseController {
util.exportExcel(response, list, "会员数据");
}
/**
* 获取会员详细信息
*/
@PreAuthorize("@ss.hasPermi('member:member:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") String id) {
return success(memberUserService.getById(id));
}
/**
* 新增会员

View File

@ -29,4 +29,15 @@ public interface MemberUserMapper extends BaseMapper<MemberUser> {
* @date 15:34 2025/3/17
**/
IPage<MemberUserVO> queryListPage(@Param("entity") MemberUserVO entity, Page<MemberUserVO> page);
/**
* 通过userId和用户类型查询用户信息
*
* @param userId 用户表id
* @param userType 用户类型
* @return com.ruoyi.member.vo.MemberUserVO
* @author PQZ
* @date 11:45 2025/3/21
**/
MemberUserVO queryByUserId(@Param("userId") Long userId, @Param("userType") String userType);
}

View File

@ -1,16 +1,26 @@
package com.ruoyi.member.service;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.member.domain.MemberCard;
import java.util.List;
/**
* 会员开卡记录Service接口
*
*
* @author pqz
* @date 2025-03-17
*/
public interface IMemberCardService extends IService<MemberCard>
{
public interface IMemberCardService extends IService<MemberCard> {
/**
* 通过用户id查询会员开卡记录
*
* @param userId 用户id
* @return java.util.List<com.ruoyi.member.domain.MemberCard>
* @author PQZ
* @date 14:24 2025/3/21
**/
List<MemberCard> listByUserId(Long userId);
}

View File

@ -27,4 +27,14 @@ public interface IMemberUserService extends IService<MemberUser> {
**/
IPage<MemberUserVO> queryListPage(MemberUserVO pageReqVO, Page<MemberUserVO> page);
/**
* 根据用户表id获取通告主信息
*
* @param userId 用户表id
* @return com.ruoyi.member.vo.MemberUserVO
* @author PQZ
* @date 11:42 2025/3/21
**/
MemberUserVO announcerDetail(Long userId);
}

View File

@ -3,10 +3,14 @@ package com.ruoyi.member.service.impl;
import java.util.Date;
import java.util.List;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.common.core.domain.DlBaseEntity;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.member.domain.MemberUser;
import com.ruoyi.member.service.IMemberUserService;
import com.ruoyi.member.vo.MemberApplyVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -14,6 +18,9 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.member.mapper.MemberApplyMapper;
import com.ruoyi.member.domain.MemberApply;
import com.ruoyi.member.service.IMemberApplyService;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
/**
* 通告主认证申请Service业务层处理
@ -26,6 +33,8 @@ public class MemberApplyServiceImpl extends ServiceImpl<MemberApplyMapper,Member
{
@Autowired
private MemberApplyMapper memberApplyMapper;
@Resource
private IMemberUserService memberUserService;
/**
@ -50,6 +59,7 @@ public class MemberApplyServiceImpl extends ServiceImpl<MemberApplyMapper,Member
* @date 11:50 2025/3/18
**/
@Override
@Transactional(rollbackFor = Exception.class)
public void checkMemberApply(MemberApplyVO memberApply) {
//获取当前登录用户id
Long userId = SecurityUtils.getUserId();
@ -58,6 +68,12 @@ public class MemberApplyServiceImpl extends ServiceImpl<MemberApplyMapper,Member
memberApply.setApprovalUserId(userId);
memberApply.setApprovalTime(nowDate);
updateById(memberApply);
//// TODO: 2025/3/18 审核成功之后更新会员表状态
//通过userId更新会员表身份类型
LambdaUpdateWrapper<MemberUser> lambdaUpdateWrapper = new LambdaUpdateWrapper<>();
lambdaUpdateWrapper.eq(MemberUser::getUserId,memberApply.getUserId())
.eq(DlBaseEntity::getDelFlag,0)
.eq(MemberUser::getUserType,"01")
.set(MemberUser::getIdentityType,memberApply.getIdentityType());
memberUserService.update(lambdaUpdateWrapper);
}
}

View File

@ -1,13 +1,15 @@
package com.ruoyi.member.service.impl;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.core.domain.DlBaseEntity;
import com.ruoyi.member.domain.MemberCard;
import com.ruoyi.member.mapper.MemberCardMapper;
import com.ruoyi.member.service.IMemberCardService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.member.mapper.MemberCardMapper;
import com.ruoyi.member.domain.MemberCard;
import com.ruoyi.member.service.IMemberCardService;
import java.util.List;
/**
* 会员开卡记录Service业务层处理
@ -22,4 +24,22 @@ public class MemberCardServiceImpl extends ServiceImpl<MemberCardMapper,MemberCa
private MemberCardMapper memberCardMapper;
/**
* 通过用户id查询会员开卡记录
*
* @param userId 用户id
* @return java.util.List<com.ruoyi.member.domain.MemberCard>
* @author PQZ
* @date 14:24 2025/3/21
**/
@Override
public List<MemberCard> listByUserId(Long userId) {
//查询列表
LambdaUpdateWrapper<MemberCard> lambdaUpdateWrapper = new LambdaUpdateWrapper<>();
lambdaUpdateWrapper
.eq(DlBaseEntity::getDelFlag,0)
.eq(MemberCard::getUserId,userId)
.orderByDesc(DlBaseEntity::getCreateTime);
return list(lambdaUpdateWrapper);
}
}

View File

@ -1,17 +1,19 @@
package com.ruoyi.member.service.impl;
import java.util.List;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.common.utils.DateUtils;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.busi.service.IBusiEvaluateService;
import com.ruoyi.busi.service.IBusiNoticeService;
import com.ruoyi.member.domain.MemberUser;
import com.ruoyi.member.mapper.MemberUserMapper;
import com.ruoyi.member.service.IMemberCardService;
import com.ruoyi.member.service.IMemberUserService;
import com.ruoyi.member.vo.MemberUserVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.member.mapper.MemberUserMapper;
import com.ruoyi.member.domain.MemberUser;
import com.ruoyi.member.service.IMemberUserService;
import javax.annotation.Resource;
/**
* 会员Service业务层处理
@ -24,6 +26,12 @@ public class MemberUserServiceImpl extends ServiceImpl<MemberUserMapper,MemberUs
{
@Autowired
private MemberUserMapper memberUserMapper;
@Resource
private IBusiEvaluateService evaluateService;
@Resource
private IMemberCardService cardService;
@Resource
private IBusiNoticeService noticeService;
/**
@ -39,4 +47,25 @@ public class MemberUserServiceImpl extends ServiceImpl<MemberUserMapper,MemberUs
public IPage<MemberUserVO> queryListPage(MemberUserVO pageReqVO, Page<MemberUserVO> page) {
return memberUserMapper.queryListPage(pageReqVO, page);
}
/**
* 根据用户表id获取通告主信息
*
* @param userId 用户表id
* @return com.ruoyi.member.vo.MemberUserVO
* @author PQZ
* @date 11:42 2025/3/21
**/
@Override
public MemberUserVO announcerDetail(Long userId) {
//查询通告主基本信息
MemberUserVO result = memberUserMapper.queryByUserId(userId,"01");
//评价信息
result.setEvaluates(evaluateService.listByToUserId(userId));
//会员开通记录
result.setCards(cardService.listByUserId(userId));
//会员发布通告
result.setNotices(noticeService.listByUserId(userId));
return result;
}
}

View File

@ -1,8 +1,13 @@
package com.ruoyi.member.vo;
import com.ruoyi.busi.domain.BusiEvaluate;
import com.ruoyi.busi.domain.BusiNotice;
import com.ruoyi.member.domain.MemberCard;
import com.ruoyi.member.domain.MemberUser;
import lombok.Data;
import java.util.List;
@Data
public class MemberUserVO extends MemberUser {
/**用户昵称*/
@ -15,6 +20,10 @@ public class MemberUserVO extends MemberUser {
String memberCardName;
/**头像地址*/
String avatar;
/**会员卡名称*/
String cardName;
/**评价信息*/
List<BusiEvaluate> evaluates;
/**开卡记录*/
List<MemberCard> cards;
/**通告列表*/
List<BusiNotice> notices;
}

View File

@ -62,7 +62,7 @@
su.status AS status,
su.avatar AS avatar,
su.phonenumber AS phonenumber,
GROUP_CONCAT(mc.card_name SEPARATOR ', ') AS cardNames
GROUP_CONCAT(mc.card_name SEPARATOR ', ') AS memberCardName
from dl_member_user main
LEFT JOIN sys_user su ON main.user_id = su.user_id AND su.del_flag = 0
LEFT JOIN dl_member_card mc ON main.user_id = mc.user_id AND mc.start_date &lt;= CURDATE() AND mc.end_date &gt;= CURDATE() AND mc.del_flag = 0
@ -77,6 +77,33 @@
GROUP BY main.user_id
ORDER BY mc.create_time desc
</select>
<select id="queryByUserId" resultType="com.ruoyi.member.vo.MemberUserVO">
select main.id AS id,
main.user_type AS userType,
main.identity_type AS identityType,
main.user_id AS userId,
main.tel AS tel,
main.t_remaining AS tRemaining,
main.t_total_num AS tTotalNum,
main.t_fans_num AS tFansNum,
main.t_open_disturb AS tOpenDisturb,
main.t_recipient_name AS tRecipientName,
main.t_recipient_image AS tRecipientImage,
main.b_points AS bPoints,
su.nick_name AS nickName,
su.status AS status,
su.avatar AS avatar,
su.phonenumber AS phonenumber,
GROUP_CONCAT(mc.card_name SEPARATOR ', ') AS memberCardName
from dl_member_user main
LEFT JOIN sys_user su ON main.user_id = su.user_id AND su.del_flag = 0
LEFT JOIN dl_member_card mc ON main.user_id = mc.user_id AND mc.start_date &lt;= CURDATE() AND mc.end_date &gt;= CURDATE() AND mc.del_flag = 0
where
main.del_flag = 0
and main.user_id = #{userId}
and main.user_type = #{userType}
GROUP BY main.user_id
</select>
</mapper>