diff --git a/ruoyi-admin/src/main/java/com/ruoyi/busi/service/IBusiEvaluateService.java b/ruoyi-admin/src/main/java/com/ruoyi/busi/service/IBusiEvaluateService.java index 373545e..2d4a6a2 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/busi/service/IBusiEvaluateService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/busi/service/IBusiEvaluateService.java @@ -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 -{ +public interface IBusiEvaluateService extends IService { IPage queryListPage(BusiEvaluate pageReqVO, Page page); + + /** + * 通过被评价人用户id查询评价内容 + * + * @param userId 被评价人用户id + * @return java.util.List + * @author PQZ + * @date 14:16 2025/3/21 + **/ + List listByToUserId(Long userId); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/busi/service/IBusiNoticeService.java b/ruoyi-admin/src/main/java/com/ruoyi/busi/service/IBusiNoticeService.java index 55ddf2e..9a5536f 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/busi/service/IBusiNoticeService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/busi/service/IBusiNoticeService.java @@ -15,4 +15,13 @@ import com.ruoyi.busi.domain.BusiNotice; public interface IBusiNoticeService extends IService { IPage queryListPage(BusiNotice pageReqVO, Page page); + + /** + * 通过用户id查询通告发布记录 + * @author PQZ + * @date 14:35 2025/3/21 + * @param userId 用户id + * @return java.util.List + **/ + List listByUserId(Long userId); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/busi/service/impl/BusiEvaluateServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/busi/service/impl/BusiEvaluateServiceImpl.java index d025cd5..3b3196f 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/busi/service/impl/BusiEvaluateServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/busi/service/impl/BusiEvaluateServiceImpl.java @@ -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 queryListPage(BusiEvaluate pageReqVO, Page page) { return busiEvaluateMapper.queryListPage(pageReqVO, page); } + + /** + * 通过被评价人用户id查询评价内容 + * + * @param userId 被评价人用户id + * @return java.util.List + * @author PQZ + * @date 14:16 2025/3/21 + **/ + @Override + public List listByToUserId(Long userId) { + LambdaUpdateWrapper lambdaUpdateWrapper = new LambdaUpdateWrapper<>(); + lambdaUpdateWrapper.eq(BusiEvaluate::getToUserId,userId); + return list(lambdaUpdateWrapper); + } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/busi/service/impl/BusiNoticeServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/busi/service/impl/BusiNoticeServiceImpl.java index 4531f16..7abca67 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/busi/service/impl/BusiNoticeServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/busi/service/impl/BusiNoticeServiceImpl.java @@ -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 queryListPage(BusiNotice pageReqVO, Page page) { return busiNoticeMapper.queryListPage(pageReqVO, page); } + + /** + * 通过用户id查询通告发布记录 + * + * @param userId 用户id + * @return java.util.List + * @author PQZ + * @date 14:35 2025/3/21 + **/ + @Override + public List listByUserId(Long userId) { + LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper(); + lambdaQueryWrapper + .eq(DlBaseEntity::getDelFlag,0) + .eq(BusiNotice::getUserId,userId); + return list(lambdaQueryWrapper); + } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/member/controller/MemberUserController.java b/ruoyi-admin/src/main/java/com/ruoyi/member/controller/MemberUserController.java index 7be8ba3..4401836 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/member/controller/MemberUserController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/member/controller/MemberUserController.java @@ -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)); - } /** * 新增会员 diff --git a/ruoyi-admin/src/main/java/com/ruoyi/member/mapper/MemberUserMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/member/mapper/MemberUserMapper.java index e167219..c6f961e 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/member/mapper/MemberUserMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/member/mapper/MemberUserMapper.java @@ -29,4 +29,15 @@ public interface MemberUserMapper extends BaseMapper { * @date 15:34 2025/3/17 **/ IPage queryListPage(@Param("entity") MemberUserVO entity, Page 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); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/member/service/IMemberCardService.java b/ruoyi-admin/src/main/java/com/ruoyi/member/service/IMemberCardService.java index 9834280..82983db 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/member/service/IMemberCardService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/member/service/IMemberCardService.java @@ -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 -{ +public interface IMemberCardService extends IService { + + /** + * 通过用户id查询会员开卡记录 + * + * @param userId 用户id + * @return java.util.List + * @author PQZ + * @date 14:24 2025/3/21 + **/ + List listByUserId(Long userId); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/member/service/IMemberUserService.java b/ruoyi-admin/src/main/java/com/ruoyi/member/service/IMemberUserService.java index 53351a5..71977cd 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/member/service/IMemberUserService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/member/service/IMemberUserService.java @@ -27,4 +27,14 @@ public interface IMemberUserService extends IService { **/ IPage queryListPage(MemberUserVO pageReqVO, Page page); + /** + * 根据用户表id获取通告主信息 + * + * @param userId 用户表id + * @return com.ruoyi.member.vo.MemberUserVO + * @author PQZ + * @date 11:42 2025/3/21 + **/ + MemberUserVO announcerDetail(Long userId); + } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/member/service/impl/MemberApplyServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/member/service/impl/MemberApplyServiceImpl.java index 10df5a0..bfb85ff 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/member/service/impl/MemberApplyServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/member/service/impl/MemberApplyServiceImpl.java @@ -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 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); } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/member/service/impl/MemberCardServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/member/service/impl/MemberCardServiceImpl.java index f6d772c..9c35f12 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/member/service/impl/MemberCardServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/member/service/impl/MemberCardServiceImpl.java @@ -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 + * @author PQZ + * @date 14:24 2025/3/21 + **/ + @Override + public List listByUserId(Long userId) { + //查询列表 + LambdaUpdateWrapper lambdaUpdateWrapper = new LambdaUpdateWrapper<>(); + lambdaUpdateWrapper + .eq(DlBaseEntity::getDelFlag,0) + .eq(MemberCard::getUserId,userId) + .orderByDesc(DlBaseEntity::getCreateTime); + return list(lambdaUpdateWrapper); + } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/member/service/impl/MemberUserServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/member/service/impl/MemberUserServiceImpl.java index 2b507fb..cc3a50d 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/member/service/impl/MemberUserServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/member/service/impl/MemberUserServiceImpl.java @@ -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 queryListPage(MemberUserVO pageReqVO, Page 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; + } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/member/vo/MemberUserVO.java b/ruoyi-admin/src/main/java/com/ruoyi/member/vo/MemberUserVO.java index 635ada5..6247aa4 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/member/vo/MemberUserVO.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/member/vo/MemberUserVO.java @@ -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 evaluates; + /**开卡记录*/ + List cards; + /**通告列表*/ + List notices; } diff --git a/ruoyi-admin/src/main/resources/mapper/member/MemberUserMapper.xml b/ruoyi-admin/src/main/resources/mapper/member/MemberUserMapper.xml index 2f3bfa1..e35ef46 100644 --- a/ruoyi-admin/src/main/resources/mapper/member/MemberUserMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/member/MemberUserMapper.xml @@ -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 <= CURDATE() AND mc.end_date >= CURDATE() AND mc.del_flag = 0 @@ -77,6 +77,33 @@ GROUP BY main.user_id ORDER BY mc.create_time desc + \ No newline at end of file