1
This commit is contained in:
parent
ea9f11f081
commit
183e12c805
@ -28,9 +28,20 @@ public interface IMemberPointsService extends IService<MemberPoints> {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增积分变动记录
|
* 新增积分变动记录
|
||||||
|
*
|
||||||
|
* @param memberPoints {@link MemberPoints}
|
||||||
* @author PQZ
|
* @author PQZ
|
||||||
* @date 15:29 2025/3/29
|
* @date 15:29 2025/3/29
|
||||||
* @param memberPoints {@link MemberPoints}
|
|
||||||
**/
|
**/
|
||||||
void savePoints(MemberPoints memberPoints);
|
void savePoints(MemberPoints memberPoints);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取积分
|
||||||
|
*
|
||||||
|
* @param userId 用户id
|
||||||
|
* @return java.lang.Integer
|
||||||
|
* @author PQZ
|
||||||
|
* @date 16:11 2025/3/31
|
||||||
|
**/
|
||||||
|
Integer getBloggerBalance(Long userId);
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.ruoyi.common.config.DlRightsConfig;
|
||||||
import com.ruoyi.common.core.domain.DlBaseEntity;
|
import com.ruoyi.common.core.domain.DlBaseEntity;
|
||||||
import com.ruoyi.member.domain.MemberPoints;
|
import com.ruoyi.member.domain.MemberPoints;
|
||||||
import com.ruoyi.member.mapper.MemberPointsMapper;
|
import com.ruoyi.member.mapper.MemberPointsMapper;
|
||||||
@ -71,4 +72,27 @@ public class MemberPointsServiceImpl extends ServiceImpl<MemberPointsMapper, Mem
|
|||||||
}
|
}
|
||||||
save(memberPoints);
|
save(memberPoints);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取积分
|
||||||
|
*
|
||||||
|
* @param userId 用户id
|
||||||
|
* @return java.lang.Integer
|
||||||
|
* @author PQZ
|
||||||
|
* @date 16:11 2025/3/31
|
||||||
|
**/
|
||||||
|
@Override
|
||||||
|
public Integer getBloggerBalance(Long userId) {
|
||||||
|
LambdaQueryWrapper<MemberPoints> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
lambdaQueryWrapper
|
||||||
|
.eq(MemberPoints::getUserId,userId)
|
||||||
|
.eq(DlBaseEntity::getDelFlag,0)
|
||||||
|
.orderByDesc(DlBaseEntity::getCreateTime);
|
||||||
|
List<MemberPoints> list = list(lambdaQueryWrapper);
|
||||||
|
if (list.isEmpty()){
|
||||||
|
return 0;
|
||||||
|
} else {
|
||||||
|
return list.get(0).getBalance();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -16,10 +16,7 @@ import com.ruoyi.constant.DictConstants;
|
|||||||
import com.ruoyi.framework.web.service.TokenService;
|
import com.ruoyi.framework.web.service.TokenService;
|
||||||
import com.ruoyi.member.domain.MemberUser;
|
import com.ruoyi.member.domain.MemberUser;
|
||||||
import com.ruoyi.member.mapper.MemberUserMapper;
|
import com.ruoyi.member.mapper.MemberUserMapper;
|
||||||
import com.ruoyi.member.service.IMemberAddressService;
|
import com.ruoyi.member.service.*;
|
||||||
import com.ruoyi.member.service.IMemberBusiCardService;
|
|
||||||
import com.ruoyi.member.service.IMemberCardService;
|
|
||||||
import com.ruoyi.member.service.IMemberUserService;
|
|
||||||
import com.ruoyi.member.vo.MemberUserVO;
|
import com.ruoyi.member.vo.MemberUserVO;
|
||||||
import com.ruoyi.system.mapper.SysUserMapper;
|
import com.ruoyi.system.mapper.SysUserMapper;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@ -54,6 +51,8 @@ public class MemberUserServiceImpl extends ServiceImpl<MemberUserMapper, MemberU
|
|||||||
private DlRightsConfig dlRightsConfig;
|
private DlRightsConfig dlRightsConfig;
|
||||||
@Resource
|
@Resource
|
||||||
private IMemberAddressService addressService;
|
private IMemberAddressService addressService;
|
||||||
|
@Resource
|
||||||
|
private IMemberPointsService pointsService;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -86,8 +85,6 @@ public class MemberUserServiceImpl extends ServiceImpl<MemberUserMapper, MemberU
|
|||||||
result.setEvaluates(evaluateService.listByToUserId(userId));
|
result.setEvaluates(evaluateService.listByToUserId(userId));
|
||||||
//会员开通记录
|
//会员开通记录
|
||||||
result.setCards(cardService.listByUserId(userId, "01"));
|
result.setCards(cardService.listByUserId(userId, "01"));
|
||||||
// //会员发布通告
|
|
||||||
// result.setNotices(noticeService.listByUserId(userId));
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -105,12 +102,14 @@ public class MemberUserServiceImpl extends ServiceImpl<MemberUserMapper, MemberU
|
|||||||
MemberUserVO result = memberUserMapper.queryByUserId(userId, "02");
|
MemberUserVO result = memberUserMapper.queryByUserId(userId, "02");
|
||||||
//名片信息
|
//名片信息
|
||||||
result.setBusiCards(busiCardService.queryListByUserId(userId));
|
result.setBusiCards(busiCardService.queryListByUserId(userId));
|
||||||
|
//积分
|
||||||
|
result.setReport(pointsService.getBloggerBalance(userId));
|
||||||
|
//报名上限
|
||||||
|
|
||||||
//地址信息
|
//地址信息
|
||||||
result.setAddresses(addressService.listByUserId(userId));
|
result.setAddresses(addressService.listByUserId(userId));
|
||||||
//会员开通记录
|
//会员开通记录
|
||||||
result.setCards(cardService.listByUserId(userId, "02"));
|
result.setCards(cardService.listByUserId(userId, "02"));
|
||||||
//报名的通告
|
|
||||||
// result.setNoticeVos(noticeService.queryListByUserId(userId));
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,10 +30,12 @@ public class MemberUserVO extends MemberUser {
|
|||||||
List<MemberCard> cards;
|
List<MemberCard> cards;
|
||||||
/**通告主发布的通告列表*/
|
/**通告主发布的通告列表*/
|
||||||
List<BusiNotice> notices;
|
List<BusiNotice> notices;
|
||||||
/**博主报名的通告列表*/
|
|
||||||
List<BusiNoticeVo> noticeVos;
|
|
||||||
/**名片信息*/
|
/**名片信息*/
|
||||||
List<MemberBusiCard> busiCards;
|
List<MemberBusiCard> busiCards;
|
||||||
/**地址信息*/
|
/**地址信息*/
|
||||||
List<MemberAddress> addresses;
|
List<MemberAddress> addresses;
|
||||||
|
/**积分*/
|
||||||
|
int pointsBalance;
|
||||||
|
/**报名次数*/
|
||||||
|
int report;
|
||||||
}
|
}
|
||||||
|
@ -154,3 +154,4 @@ wx-app:
|
|||||||
dl-rights:
|
dl-rights:
|
||||||
# 每月发布通告额度
|
# 每月发布通告额度
|
||||||
addNotice: 3
|
addNotice: 3
|
||||||
|
report: 5
|
@ -10,5 +10,7 @@ import org.springframework.stereotype.Component;
|
|||||||
public class DlRightsConfig {
|
public class DlRightsConfig {
|
||||||
/** 每月发布通告额度 */
|
/** 每月发布通告额度 */
|
||||||
private Integer addNotice;
|
private Integer addNotice;
|
||||||
|
/** 每日可报名次数上限*/
|
||||||
|
private Integer report;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user