BUGFIX:将已存在的账号添加到子账号中,积分计算混乱
This commit is contained in:
@@ -18,10 +18,9 @@ public class AffiliateQueryDTO extends TimeQueryBaseDTO{
|
|||||||
@ApiModelProperty("推广者id")
|
@ApiModelProperty("推广者id")
|
||||||
private Long affiliateId;
|
private Long affiliateId;
|
||||||
|
|
||||||
@NotBlank(message = "orderBy cannot be empty")
|
@Pattern(regexp = "id|createTime|totalIncome|", message = "允许排序字段只有id|createTime|totalIncome")
|
||||||
@Pattern(regexp = "id|createTime|totalIncome", message = "允许排序字段只有id|createTime|totalIncome")
|
|
||||||
@ApiModelProperty("目前允许按id, createTime, totalIncome进行排序")
|
@ApiModelProperty("目前允许按id, createTime, totalIncome进行排序")
|
||||||
private String orderBy;
|
private String orderBy = "id";
|
||||||
|
|
||||||
@ApiModelProperty("按时间 DESC 降序 || ASC 升序")
|
@ApiModelProperty("按时间 DESC 降序 || ASC 升序")
|
||||||
private String order = "ASC";
|
private String order = "ASC";
|
||||||
|
|||||||
@@ -2227,12 +2227,12 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
|
|||||||
subAccount.setSystemUser(subUserRole);
|
subAccount.setSystemUser(subUserRole);
|
||||||
subAccount.setOrganizationName(adminAcc.getOrganizationName());
|
subAccount.setOrganizationName(adminAcc.getOrganizationName());
|
||||||
subAccount.setParentId(adminAcc.getId());
|
subAccount.setParentId(adminAcc.getId());
|
||||||
if (Objects.nonNull(subAccount.getCreditsUsageLimit())){
|
if (Objects.nonNull(addSubAccountDTO.getCreditsUsageLimit())){
|
||||||
if (remainingCredits.compareTo(subAccount.getCreditsUsageLimit()) < 0) {
|
if (remainingCredits.compareTo(addSubAccountDTO.getCreditsUsageLimit()) < 0) {
|
||||||
throw new BusinessException("Insufficient credits (Balance: " + remainingCredits + ").", ResultEnum.PROMPT.getCode());
|
throw new BusinessException("Insufficient credits (Balance: " + remainingCredits + ").", ResultEnum.PROMPT.getCode());
|
||||||
}
|
}
|
||||||
subAccount.setCreditsUsageLimit(subAccount.getCreditsUsageLimit());
|
subAccount.setCreditsUsageLimit(addSubAccountDTO.getCreditsUsageLimit());
|
||||||
subAccount.setCreditsUsage(subAccount.getCreditsUsageLimit());
|
subAccount.setCreditsUsage(addSubAccountDTO.getCreditsUsage());
|
||||||
if (Objects.nonNull(subAccount.getCredits())) {
|
if (Objects.nonNull(subAccount.getCredits())) {
|
||||||
subAccount.setCredits(subAccount.getCreditsUsageLimit().add(subAccount.getCredits()));
|
subAccount.setCredits(subAccount.getCreditsUsageLimit().add(subAccount.getCredits()));
|
||||||
}else {
|
}else {
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ public class AffiliateServiceImpl extends ServiceImpl<AffiliateMapper, Affiliate
|
|||||||
log.info("parameter => {}", affiliateQueryDTO.toString());
|
log.info("parameter => {}", affiliateQueryDTO.toString());
|
||||||
|
|
||||||
int offset = (affiliateQueryDTO.getPage() - 1) * affiliateQueryDTO.getSize();
|
int offset = (affiliateQueryDTO.getPage() - 1) * affiliateQueryDTO.getSize();
|
||||||
String orderBy = affiliateQueryDTO.getOrderBy() == null ? "create_time" :
|
String orderBy = affiliateQueryDTO.getOrderBy() == null ? "id" :
|
||||||
affiliateQueryDTO.getOrderBy().equals("id") ? "id" :
|
affiliateQueryDTO.getOrderBy().equals("id") ? "id" :
|
||||||
affiliateQueryDTO.getOrderBy().equals("totalIncome") ? "total_earnings" :
|
affiliateQueryDTO.getOrderBy().equals("totalIncome") ? "total_earnings" :
|
||||||
"create_time";
|
"create_time";
|
||||||
|
|||||||
Reference in New Issue
Block a user