分销:调整 app 的 price 到 brokeragePrice

This commit is contained in:
YunaiV 2023-09-09 19:34:50 +08:00
parent 5858f57fe9
commit 426594ae00
9 changed files with 18 additions and 17 deletions

View File

@ -19,7 +19,6 @@ public class BrokerageUserRespVO extends BrokerageUserBaseVO {
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
private LocalDateTime createTime;
// ========== 用户信息 ==========
@Schema(description = "用户头像", example = "https://www.iocoder.cn/xxx.png")
@ -27,7 +26,6 @@ public class BrokerageUserRespVO extends BrokerageUserBaseVO {
@Schema(description = "用户昵称", example = "李四")
private String nickname;
// ========== 推广信息 ==========
@Schema(description = "推广用户数量(一级)", example = "20019")
@ -37,7 +35,6 @@ public class BrokerageUserRespVO extends BrokerageUserBaseVO {
@Schema(description = "推广订单金额", example = "20019")
private Integer brokerageOrderPrice;
// ========== 提现信息 ==========
@Schema(description = "已提现金额", example = "20019")

View File

@ -37,6 +37,7 @@ public class AppBrokerageUserController {
@PreAuthenticated
public CommonResult<AppBrokerageUserRespVO> getBrokerageUser() {
AppBrokerageUserRespVO respVO = new AppBrokerageUserRespVO()
.setBrokerageEnabled(true)
.setPrice(2000)
.setFrozenPrice(3000);
return success(respVO);
@ -49,7 +50,7 @@ public class AppBrokerageUserController {
public CommonResult<AppBrokerageUserMySummaryRespVO> getBrokerageUserSummary() {
AppBrokerageUserMySummaryRespVO respVO = new AppBrokerageUserMySummaryRespVO()
.setYesterdayPrice(1)
.setPrice(2)
.setBrokeragePrice(2)
.setFrozenPrice(3)
.setWithdrawPrice(4)
.setFirstBrokerageUserCount(166)
@ -84,16 +85,16 @@ public class AppBrokerageUserController {
public CommonResult<PageResult<AppBrokerageUserRankByPriceRespVO>> getBrokerageUserChildSummaryPageByPrice(AppBrokerageUserRankPageReqVO pageReqVO) {
AppBrokerageUserRankByPriceRespVO vo1 = new AppBrokerageUserRankByPriceRespVO()
.setId(1L).setNickname("芋1**艿").setAvatar("http://www.iocoder.cn/images/common/wechat_mp_2017_07_31_bak.jpg")
.setPrice(10);
.setBrokeragePrice(10);
AppBrokerageUserRankByPriceRespVO vo2 = new AppBrokerageUserRankByPriceRespVO()
.setId(2L).setNickname("芋2**艿").setAvatar("http://www.iocoder.cn/images/common/wechat_mp_2017_07_31_bak.jpg")
.setPrice(6);
.setBrokeragePrice(6);
AppBrokerageUserRankByPriceRespVO vo3 = new AppBrokerageUserRankByPriceRespVO()
.setId(3L).setNickname("芋3**艿").setAvatar("http://www.iocoder.cn/images/common/wechat_mp_2017_07_31_bak.jpg")
.setPrice(4);
.setBrokeragePrice(4);
AppBrokerageUserRankByPriceRespVO vo4 = new AppBrokerageUserRankByPriceRespVO()
.setId(3L).setNickname("芋3**艿").setAvatar("http://www.iocoder.cn/images/common/wechat_mp_2017_07_31_bak.jpg")
.setPrice(4);
.setBrokeragePrice(4);
return success(new PageResult<>(asList(vo1, vo2, vo3, vo4), 10L));
}
@ -105,11 +106,11 @@ public class AppBrokerageUserController {
AppBrokerageUserChildSummaryPageReqVO pageReqVO) {
AppBrokerageUserChildSummaryRespVO vo1 = new AppBrokerageUserChildSummaryRespVO()
.setId(1L).setNickname("芋1**艿").setAvatar("http://www.iocoder.cn/images/common/wechat_mp_2017_07_31_bak.jpg")
.setPrice(10).setPrice(20).setBrokerageOrderCount(30)
.setBrokeragePrice(10).setBrokeragePrice(20).setBrokerageOrderCount(30)
.setBrokerageTime(LocalDateTime.now());
AppBrokerageUserChildSummaryRespVO vo2 = new AppBrokerageUserChildSummaryRespVO()
.setId(1L).setNickname("芋2**艿").setAvatar("http://www.iocoder.cn/images/common/wechat_mp_2017_07_31_bak.jpg")
.setPrice(20).setPrice(30).setBrokerageOrderCount(40)
.setBrokeragePrice(20).setBrokeragePrice(30).setBrokerageOrderCount(40)
.setBrokerageTime(LocalDateTime.now());
return success(new PageResult<>(asList(vo1, vo2), 10L));
}

View File

@ -19,7 +19,7 @@ public class AppBrokerageUserChildSummaryRespVO {
private String avatar;
@Schema(description = "佣金金额,单位:分", requiredMode = Schema.RequiredMode.REQUIRED, example = "10")
private Integer price;
private Integer brokeragePrice;
@Schema(description = "分销订单数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "20")
private Integer brokerageOrderCount;

View File

@ -14,7 +14,7 @@ public class AppBrokerageUserMySummaryRespVO {
private Integer withdrawPrice;
@Schema(description = "可用的佣金,单位:分", requiredMode = Schema.RequiredMode.REQUIRED, example = "2408")
private Integer price;
private Integer brokeragePrice;
@Schema(description = "冻结的佣金,单位:分", requiredMode = Schema.RequiredMode.REQUIRED, example = "234")
private Integer frozenPrice;

View File

@ -17,6 +17,6 @@ public class AppBrokerageUserRankByPriceRespVO {
private String avatar;
@Schema(description = "佣金金额", requiredMode = Schema.RequiredMode.REQUIRED, example = "10")
private Integer price;
private Integer brokeragePrice;
}

View File

@ -7,6 +7,9 @@ import lombok.Data;
@Data
public class AppBrokerageUserRespVO {
@Schema(description = "是否有分销资格", requiredMode = Schema.RequiredMode.REQUIRED, example = "true")
private Boolean brokerageEnabled;
@Schema(description = "可用的佣金,单位:分", requiredMode = Schema.RequiredMode.REQUIRED, example = "2408")
private Integer price;

View File

@ -41,7 +41,7 @@ public interface BrokerageRecordConvert {
: BrokerageRecordStatusEnum.SETTLEMENT.getStatus();
return new BrokerageRecordDO().setUserId(user.getId())
.setBizType(bizType.getType()).setBizId(bizId)
.setPrice(brokeragePrice).setTotalPrice(user.getPrice())
.setPrice(brokeragePrice).setTotalPrice(user.getBrokeragePrice())
.setTitle(title)
.setDescription(StrUtil.format(bizType.getDescription(), String.valueOf(brokeragePrice / 100.0)))
.setStatus(status).setFrozenDays(brokerageFrozenDays).setUnfreezeTime(unfreezeTime);

View File

@ -43,7 +43,7 @@ public class BrokerageUserDO extends BaseDO {
private LocalDateTime bindUserTime;
/**
* 推广资格
* 是否有分销资格
*/
private Boolean brokerageEnabled;
/**
@ -54,7 +54,7 @@ public class BrokerageUserDO extends BaseDO {
/**
* 可用佣金
*/
private Integer price;
private Integer brokeragePrice;
/**
* 冻结佣金
*/

View File

@ -146,7 +146,7 @@ public class BrokerageUserServiceImpl implements BrokerageUserService {
BrokerageUserDO brokerageUser = brokerageUserMapper.selectById(userId);
if (brokerageUser == null) { // 分销用户不存在的情况1. 新注册2. 旧数据3. 分销功能关闭后又打开
isNewBrokerageUser = true;
brokerageUser = new BrokerageUserDO().setId(userId).setBrokerageEnabled(false).setPrice(0).setFrozenPrice(0);
brokerageUser = new BrokerageUserDO().setId(userId).setBrokerageEnabled(false).setBrokeragePrice(0).setFrozenPrice(0);
}
// 2.1 校验能否绑定