查询修改2

This commit is contained in:
tianfeng 2025-09-09 22:40:17 +08:00
parent 8cdf5f45f0
commit 8327a1973d

View File

@ -27,6 +27,7 @@ import com.red.circle.wallet.inner.model.cmd.UserFreightBalancePageQryCmd;
import com.red.circle.wallet.inner.model.dto.UserFreightBalanceDTO;
import lombok.RequiredArgsConstructor;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
@ -54,23 +55,8 @@ public class RechargeUserServiceImpl implements RechargeUserService {
ResponseAssert.failure(CommonErrorCode.OPERATING_FAILURE);
}
List<BusinessDevelopmentBaseInfo> bdList = businessDevelopmentBaseInfoService.query()
.eq(BusinessDevelopmentBaseInfo::getSysOrigin,cmd.getReqSysOrigin())
.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;
}
List<Long> collect = getBdGoldUserIdList(cmd);
if (collect == null) return null;
Map<Long, BigDecimal> userMonthlyAmountMap = getThisMonthRechargeAmount(collect);
Map<Long, BigDecimal> userLastMonthAmountMap = getLastMonthRechargeAmount(collect);
@ -93,6 +79,27 @@ public class RechargeUserServiceImpl implements RechargeUserService {
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
public List<MonthlyRechargeSummaryVO> getRechargeSummary(AppExtCommand cmd) {
return userMonthlyRechargeClient.getMonthlyRechargeSummary().getBody();