This commit is contained in:
PQZ 2025-03-22 00:05:29 +08:00
parent 21ca4ce9bc
commit e6ffb3d733
8 changed files with 221 additions and 92 deletions

View File

@ -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);
}

View File

@ -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<MemberBusiCard> list = memberBusiCardService.list();
public AjaxResult list(MemberBusiCard memberBusiCard,
@RequestParam(name = "pageNum", defaultValue = "1") Integer pageNum,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
Page<MemberBusiCard> page = new Page<>(pageNum, pageSize);
IPage<MemberBusiCard> 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<MemberBusiCard> list = memberBusiCardService.list();
ExcelUtil<MemberBusiCard> util = new ExcelUtil<MemberBusiCard>(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<String> list = new ArrayList<>(Arrays.asList(ids));
return toAjax(memberBusiCardService.removeByIds(list));
}

View File

@ -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<MemberBusiCard>
{
public interface MemberBusiCardMapper extends BaseMapper<MemberBusiCard> {
/**
* 分页查询博主名片列表
*
* @param entity {@link MemberBusiCard}
* @param page 分页参数
* @return com.baomidou.mybatisplus.core.metadata.IPage<com.ruoyi.member.domain.MemberBusiCard>
* @author PQZ
* @date 21:44 2025/3/21
**/
IPage<MemberBusiCard> queryListPage(@Param("entity") MemberBusiCard entity, Page<MemberBusiCard> page);
/**
* 通过id查询博主名片
*
* @param id 主键
* @return com.ruoyi.member.vo.MemberBusiCardVO
* @author PQZ
* @date 22:32 2025/3/21
**/
MemberBusiCardVO queryById(@Param("id") String id);
}

View File

@ -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<MemberBusiCard>
{
public interface IMemberBusiCardService extends IService<MemberBusiCard> {
/**
* 分页查询博主名片信息
*
* @param pageReqVO {@link MemberBusiCard}
* @param page 分页参数
* @return com.baomidou.mybatisplus.core.metadata.IPage<com.ruoyi.member.domain.MemberBusiCard>
* @author PQZ
* @date 21:46 2025/3/21
**/
IPage<MemberBusiCard> queryListPage(MemberBusiCard pageReqVO, Page<MemberBusiCard> 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);
}

View File

@ -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<MemberBusiCardMapper,MemberBusiCard> implements IMemberBusiCardService
{
public class MemberBusiCardServiceImpl extends ServiceImpl<MemberBusiCardMapper, MemberBusiCard> implements IMemberBusiCardService {
@Autowired
private MemberBusiCardMapper memberBusiCardMapper;
/**
* 分页查询博主名片信息
*
* @param pageReqVO {@link MemberBusiCard}
* @param page 分页参数
* @return com.baomidou.mybatisplus.core.metadata.IPage<com.ruoyi.member.domain.MemberBusiCard>
* @author PQZ
* @date 21:46 2025/3/21
**/
@Override
public IPage<MemberBusiCard> queryListPage(MemberBusiCard pageReqVO, Page<MemberBusiCard> 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);
}
}

View File

@ -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;
}

View File

@ -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
</sql>
<select id="queryListPage" parameterType="MemberBusiCard" resultMap="MemberBusiCardResult">
<include refid="selectMemberBusiCardVo"/>
<where>
<if test="entity.nickname != null and entity.nickname != ''"> and nickname like concat('%', #{entity.nickname}, '%')</if>
<if test="entity.platformName != null and entity.platformName != ''"> and platform_name like concat('%', #{entity.platformName}, '%')</if>
<if test="entity.accountName != null and entity.accountName != ''"> and account_name like concat('%', #{entity.accountName}, '%')</if>
<if test="entity.approvalStatus == 10"> and approval_status != 0</if>
<if test="entity.approvalStatus != null and entity.approvalStatus != '' and entity.approvalStatus != 10"> and approval_status = #{entity.approvalStatus}</if>
</where>
</select>
<select id="queryById" resultType="com.ruoyi.member.vo.MemberBusiCardVO">
SELECT
main.*,
CONCAT(dma.city, dma.detail) AS address
FROM
dl_member_busi_card main
LEFT JOIN
dl_member_address dma ON main.addr_id = dma.id AND dma.del_flag = 0
WHERE
main.del_flag = 0 and main.id = #{id}
</select>
</mapper>

View File

@ -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 &lt;= CURDATE() AND mc.end_date &gt;= CURDATE() AND mc.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
AND mc.user_type = #{entity.userType}
<where>
main.del_flag = 0
<if test="entity.userType != null and entity.userType != ''">and main.user_type = #{entity.userType}</if>
<if test="entity.userType != null and entity.userType != ''">
and main.user_type = #{entity.userType}
</if>
<if test="entity.identityType != null and entity.identityType != ''">and main.identity_type =
#{entity.identityType}
</if>
@ -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 &lt;= CURDATE() AND mc.end_date &gt;= CURDATE() AND mc.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
AND mc.user_type = #{userType}
where
main.del_flag = 0
and main.user_id = #{userId}