diff --git a/ruoyi-admin/src/main/java/com/ruoyi/member/controller/MemberApplyController.java b/ruoyi-admin/src/main/java/com/ruoyi/member/controller/MemberApplyController.java index 5666d9f..4652c3d 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/member/controller/MemberApplyController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/member/controller/MemberApplyController.java @@ -39,7 +39,6 @@ public class MemberApplyController extends BaseController { * @author PQZ * @date 9:50 2025/3/18 **/ - @PreAuthorize("@ss.hasPermi('member:apply:list')") @GetMapping("/list") public AjaxResult list(MemberApplyVO memberApply, @RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum, @@ -52,7 +51,6 @@ public class MemberApplyController extends BaseController { /** * 导出通告主认证申请列表 */ - @PreAuthorize("@ss.hasPermi('member:apply:export')") @Log(title = "通告主认证申请", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, MemberApply memberApply) { @@ -69,7 +67,6 @@ public class MemberApplyController extends BaseController { * @author PQZ * @date 9:57 2025/3/18 **/ - @PreAuthorize("@ss.hasPermi('member:apply:query')") @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") String id) { return success(memberApplyService.getById(id)); @@ -84,10 +81,9 @@ public class MemberApplyController extends BaseController { * @author PQZ * @date 11:47 2025/3/18 **/ - @PreAuthorize("@ss.hasPermi('member:apply:edit')") - @Log(title = "通告主认证申请", businessType = BusinessType.UPDATE) + @Log(title = "审核通告主信息", businessType = BusinessType.UPDATE) @PutMapping - public AjaxResult edit(@RequestBody MemberApplyVO memberApply) { + public AjaxResult checkMemberApply(@RequestBody MemberApplyVO memberApply) { memberApplyService.checkMemberApply(memberApply); return toAjax(true); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/member/controller/MemberBusiCardController.java b/ruoyi-admin/src/main/java/com/ruoyi/member/controller/MemberBusiCardController.java index 4b2a100..f3f5bd5 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/member/controller/MemberBusiCardController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/member/controller/MemberBusiCardController.java @@ -1,106 +1,98 @@ package com.ruoyi.member.controller; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import javax.servlet.http.HttpServletResponse; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.ruoyi.common.annotation.Log; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.member.domain.MemberBusiCard; import com.ruoyi.member.service.IMemberBusiCardService; -import com.ruoyi.common.utils.poi.ExcelUtil; -import com.ruoyi.common.core.page.TableDataInfo; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; /** * 博主名片Controller - * + * * @author pqz - * @date 2025-03-17 + * @date 2025-03-21 */ @RestController @RequestMapping("/member/busiCard") -public class MemberBusiCardController extends BaseController -{ +public class MemberBusiCardController extends BaseController { @Autowired private IMemberBusiCardService memberBusiCardService; /** - * 查询博主名片列表 - */ - @PreAuthorize("@ss.hasPermi('member:card:list')") + * 分页查询博主名片信息 + * + * @param memberBusiCard {@link MemberBusiCard} + * @param pageNum 分页参数 + * @param pageSize 分页参数 + * @return com.ruoyi.common.core.domain.AjaxResult + * @author PQZ + * @date 21:47 2025/3/21 + **/ @GetMapping("/list") - public AjaxResult list(MemberBusiCard memberBusiCard) - { - - List list = memberBusiCardService.list(); + public AjaxResult list(MemberBusiCard memberBusiCard, + @RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum, + @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { + Page page = new Page<>(pageNum, pageSize); + IPage list = memberBusiCardService.queryListPage(memberBusiCard, page); return success(list); } /** - * 导出博主名片列表 - */ - @PreAuthorize("@ss.hasPermi('member:card:export')") - @Log(title = "博主名片", businessType = BusinessType.EXPORT) - @PostMapping("/export") - public void export(HttpServletResponse response, MemberBusiCard memberBusiCard) - { - List list = memberBusiCardService.list(); - ExcelUtil util = new ExcelUtil(MemberBusiCard.class); - util.exportExcel(response, list, "博主名片数据"); + * 通过id获取博主名片信息 + * + * @param id 博主名片id + * @return com.ruoyi.common.core.domain.AjaxResult + * @author PQZ + * @date 22:37 2025/3/21 + **/ + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") String id) { + return success(memberBusiCardService.queryById(id)); } /** - * 获取博主名片详细信息 - */ - @PreAuthorize("@ss.hasPermi('member:card:query')") - @GetMapping(value = "/{id}") - public AjaxResult getInfo(@PathVariable("id") String id) - { - return success(memberBusiCardService.getById(id)); + * 审核博主名片 + * + * @param memberBusiCard {@link MemberBusiCard} + * @return com.ruoyi.common.core.domain.AjaxResult + * @author PQZ + * @date 23:19 2025/3/21 + **/ + @Log(title = "博主名片", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult checkBusiCard(@RequestBody MemberBusiCard memberBusiCard) { + memberBusiCardService.checkBusiCard(memberBusiCard); + return toAjax(true); } /** * 新增博主名片 */ - @PreAuthorize("@ss.hasPermi('member:card:add')") @Log(title = "博主名片", businessType = BusinessType.INSERT) @PostMapping - public AjaxResult add(@RequestBody MemberBusiCard memberBusiCard) - { + public AjaxResult add(@RequestBody MemberBusiCard memberBusiCard) { return toAjax(memberBusiCardService.save(memberBusiCard)); } - /** - * 修改博主名片 - */ - @PreAuthorize("@ss.hasPermi('member:card:edit')") - @Log(title = "博主名片", businessType = BusinessType.UPDATE) - @PutMapping - public AjaxResult edit(@RequestBody MemberBusiCard memberBusiCard) - { - return toAjax(memberBusiCardService.updateById(memberBusiCard)); - } + /** * 删除博主名片 */ - @PreAuthorize("@ss.hasPermi('member:card:remove')") @Log(title = "博主名片", businessType = BusinessType.DELETE) - @DeleteMapping("/{ids}") - public AjaxResult remove(@PathVariable String[] ids) - { + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable String[] ids) { List list = new ArrayList<>(Arrays.asList(ids)); return toAjax(memberBusiCardService.removeByIds(list)); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/member/mapper/MemberBusiCardMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/member/mapper/MemberBusiCardMapper.java index f29ff3e..dc9d801 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/member/mapper/MemberBusiCardMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/member/mapper/MemberBusiCardMapper.java @@ -1,18 +1,39 @@ package com.ruoyi.member.mapper; -import java.util.List; -import com.ruoyi.member.domain.MemberBusiCard; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.ruoyi.member.domain.MemberBusiCard; +import com.ruoyi.member.vo.MemberBusiCardVO; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; /** * 博主名片Mapper接口 - * + * * @author pqz - * @date 2025-03-17 + * @date 2025-03-21 */ @Mapper -public interface MemberBusiCardMapper extends BaseMapper -{ +public interface MemberBusiCardMapper extends BaseMapper { + /** + * 分页查询博主名片列表 + * + * @param entity {@link MemberBusiCard} + * @param page 分页参数 + * @return com.baomidou.mybatisplus.core.metadata.IPage + * @author PQZ + * @date 21:44 2025/3/21 + **/ + IPage queryListPage(@Param("entity") MemberBusiCard entity, Page page); + /** + * 通过id查询博主名片 + * + * @param id 主键 + * @return com.ruoyi.member.vo.MemberBusiCardVO + * @author PQZ + * @date 22:32 2025/3/21 + **/ + MemberBusiCardVO queryById(@Param("id") String id); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/member/service/IMemberBusiCardService.java b/ruoyi-admin/src/main/java/com/ruoyi/member/service/IMemberBusiCardService.java index fe3769c..5fd1244 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/member/service/IMemberBusiCardService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/member/service/IMemberBusiCardService.java @@ -1,16 +1,46 @@ package com.ruoyi.member.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; import com.ruoyi.member.domain.MemberBusiCard; +import com.ruoyi.member.vo.MemberBusiCardVO; /** * 博主名片Service接口 - * + * * @author pqz - * @date 2025-03-17 + * @date 2025-03-21 */ -public interface IMemberBusiCardService extends IService -{ +public interface IMemberBusiCardService extends IService { + /** + * 分页查询博主名片信息 + * + * @param pageReqVO {@link MemberBusiCard} + * @param page 分页参数 + * @return com.baomidou.mybatisplus.core.metadata.IPage + * @author PQZ + * @date 21:46 2025/3/21 + **/ + IPage queryListPage(MemberBusiCard pageReqVO, Page page); + + /** + * 通过id查询博主名片信息 + * + * @param id 博主名片id + * @return com.ruoyi.member.vo.MemberBusiCardVO + * @author PQZ + * @date 22:36 2025/3/21 + **/ + MemberBusiCardVO queryById(String id); + + /** + * 审核博主名片信息 + * + * @param card {@link MemberBusiCard} + * @author PQZ + * @date 23:17 2025/3/21 + **/ + void checkBusiCard(MemberBusiCard card); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/member/service/impl/MemberBusiCardServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/member/service/impl/MemberBusiCardServiceImpl.java index 8879602..494d51b 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/member/service/impl/MemberBusiCardServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/member/service/impl/MemberBusiCardServiceImpl.java @@ -1,25 +1,73 @@ package com.ruoyi.member.service.impl; -import java.util.List; -import com.ruoyi.common.utils.DateUtils; +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.common.utils.SecurityUtils; +import com.ruoyi.member.domain.MemberBusiCard; +import com.ruoyi.member.mapper.MemberBusiCardMapper; +import com.ruoyi.member.service.IMemberBusiCardService; +import com.ruoyi.member.vo.MemberBusiCardVO; 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.MemberBusiCardMapper; -import com.ruoyi.member.domain.MemberBusiCard; -import com.ruoyi.member.service.IMemberBusiCardService; + +import java.util.Date; /** * 博主名片Service业务层处理 - * + * * @author pqz - * @date 2025-03-17 + * @date 2025-03-21 */ @Service -public class MemberBusiCardServiceImpl extends ServiceImpl implements IMemberBusiCardService -{ +public class MemberBusiCardServiceImpl extends ServiceImpl implements IMemberBusiCardService { @Autowired private MemberBusiCardMapper memberBusiCardMapper; + /** + * 分页查询博主名片信息 + * + * @param pageReqVO {@link MemberBusiCard} + * @param page 分页参数 + * @return com.baomidou.mybatisplus.core.metadata.IPage + * @author PQZ + * @date 21:46 2025/3/21 + **/ + @Override + public IPage queryListPage(MemberBusiCard pageReqVO, Page page) { + return memberBusiCardMapper.queryListPage(pageReqVO, page); + } + + /** + * 通过id查询博主名片信息 + * + * @param id 博主名片id + * @return com.ruoyi.member.vo.MemberBusiCardVO + * @author PQZ + * @date 22:36 2025/3/21 + **/ + @Override + public MemberBusiCardVO queryById(String id) { + return memberBusiCardMapper.queryById(id); + } + + /** + * 审核博主名片信息 + * + * @param card {@link MemberBusiCard} + * @author PQZ + * @date 23:17 2025/3/21 + **/ + @Override + public void checkBusiCard(MemberBusiCard card) { + //获取当前登录用户id + Long userId = SecurityUtils.getUserId(); + //当前时间 + Date nowDate = new Date(); + card.setApprovalUserId(userId); + card.setApprovalTime(nowDate); + updateById(card); + } + } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/member/vo/MemberBusiCardVO.java b/ruoyi-admin/src/main/java/com/ruoyi/member/vo/MemberBusiCardVO.java new file mode 100644 index 0000000..f82808e --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/member/vo/MemberBusiCardVO.java @@ -0,0 +1,10 @@ +package com.ruoyi.member.vo; + +import com.ruoyi.member.domain.MemberBusiCard; +import lombok.Data; + +@Data +public class MemberBusiCardVO extends MemberBusiCard { + /**地址*/ + String address; +} diff --git a/ruoyi-admin/src/main/resources/mapper/member/MemberBusiCardMapper.xml b/ruoyi-admin/src/main/resources/mapper/member/MemberBusiCardMapper.xml index 782cd5a..f42972a 100644 --- a/ruoyi-admin/src/main/resources/mapper/member/MemberBusiCardMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/member/MemberBusiCardMapper.xml @@ -33,5 +33,25 @@ select id, user_id, nickname, platform_code, platform_name, account_number, account_name, fans_num, image, tel, price, content, addr_id, approval_status, approval_user_id, approval_time, approval_remark, creator, create_time, updater, update_time, del_flag from dl_member_busi_card - + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/mapper/member/MemberUserMapper.xml b/ruoyi-admin/src/main/resources/mapper/member/MemberUserMapper.xml index e35ef46..ad8a101 100644 --- a/ruoyi-admin/src/main/resources/mapper/member/MemberUserMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/member/MemberUserMapper.xml @@ -65,10 +65,17 @@ 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 + 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 + AND mc.user_type = #{entity.userType} main.del_flag = 0 - and main.user_type = #{entity.userType} + + and main.user_type = #{entity.userType} + and main.identity_type = #{entity.identityType} @@ -97,7 +104,12 @@ 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 + 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 + AND mc.user_type = #{userType} where main.del_flag = 0 and main.user_id = #{userId}