查询修改2
This commit is contained in:
parent
8cdf5f45f0
commit
8327a1973d
@ -27,6 +27,7 @@ import com.red.circle.wallet.inner.model.cmd.UserFreightBalancePageQryCmd;
|
|||||||
import com.red.circle.wallet.inner.model.dto.UserFreightBalanceDTO;
|
import com.red.circle.wallet.inner.model.dto.UserFreightBalanceDTO;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
import org.jetbrains.annotations.Nullable;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
@ -54,23 +55,8 @@ public class RechargeUserServiceImpl implements RechargeUserService {
|
|||||||
ResponseAssert.failure(CommonErrorCode.OPERATING_FAILURE);
|
ResponseAssert.failure(CommonErrorCode.OPERATING_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
List<BusinessDevelopmentBaseInfo> bdList = businessDevelopmentBaseInfoService.query()
|
List<Long> collect = getBdGoldUserIdList(cmd);
|
||||||
.eq(BusinessDevelopmentBaseInfo::getSysOrigin,cmd.getReqSysOrigin())
|
if (collect == null) return null;
|
||||||
.eq(BusinessDevelopmentBaseInfo::getBdLeadUserId, cmd.getReqUserId())
|
|
||||||
.orderByDesc(BusinessDevelopmentBaseInfo::getCreateTime)
|
|
||||||
.list();
|
|
||||||
if (bdList.isEmpty()) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
List<Long> collect = bdList.stream().map(e -> {
|
|
||||||
UserFreightBalanceDTO result = freightGoldClient.getByUserId(e.getUserId()).getBody();
|
|
||||||
return result != null ? result.getUserId() : null;
|
|
||||||
}).filter(Objects::nonNull).toList();
|
|
||||||
|
|
||||||
if (CollectionUtils.isEmpty(collect)) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
Map<Long, BigDecimal> userMonthlyAmountMap = getThisMonthRechargeAmount(collect);
|
Map<Long, BigDecimal> userMonthlyAmountMap = getThisMonthRechargeAmount(collect);
|
||||||
Map<Long, BigDecimal> userLastMonthAmountMap = getLastMonthRechargeAmount(collect);
|
Map<Long, BigDecimal> userLastMonthAmountMap = getLastMonthRechargeAmount(collect);
|
||||||
@ -93,6 +79,27 @@ public class RechargeUserServiceImpl implements RechargeUserService {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private List<Long> getBdGoldUserIdList(AppExtCommand cmd) {
|
||||||
|
List<BusinessDevelopmentBaseInfo> bdList = businessDevelopmentBaseInfoService.query()
|
||||||
|
.eq(BusinessDevelopmentBaseInfo::getSysOrigin, cmd.getReqSysOrigin().getOrigin())
|
||||||
|
.eq(BusinessDevelopmentBaseInfo::getBdLeadUserId, cmd.getReqUserId())
|
||||||
|
.orderByDesc(BusinessDevelopmentBaseInfo::getCreateTime)
|
||||||
|
.list();
|
||||||
|
if (bdList.isEmpty()) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
List<Long> collect = bdList.stream().map(e -> {
|
||||||
|
UserFreightBalanceDTO result = freightGoldClient.getByUserId(e.getUserId()).getBody();
|
||||||
|
return result != null ? result.getUserId() : null;
|
||||||
|
}).filter(Objects::nonNull).toList();
|
||||||
|
|
||||||
|
if (CollectionUtils.isEmpty(collect)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return collect;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<MonthlyRechargeSummaryVO> getRechargeSummary(AppExtCommand cmd) {
|
public List<MonthlyRechargeSummaryVO> getRechargeSummary(AppExtCommand cmd) {
|
||||||
return userMonthlyRechargeClient.getMonthlyRechargeSummary().getBody();
|
return userMonthlyRechargeClient.getMonthlyRechargeSummary().getBody();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user