修复金币收支问题

This commit is contained in:
hy001 2026-04-27 19:28:11 +08:00
parent e5594dd692
commit 40dfc9e002

View File

@ -135,12 +135,12 @@ public class UserWalletServiceImpl implements UserWalletService {
query.setEndTime(TimestampUtils.now().getTime()); query.setEndTime(TimestampUtils.now().getTime());
} }
UserGoldRunningWaterClsHistoryDTO clsWater = walletGoldClient.getClsSearchWater(query) UserGoldRunningWaterClsHistoryDTO clsWater = walletGoldClient.getClsSearchWater(query)
.getBody(); .getBody();
if (Objects.isNull(clsWater) || CollectionUtils.isEmpty(clsWater.getWaters())) { if (Objects.isNull(clsWater) || CollectionUtils.isEmpty(clsWater.getWaters())) {
return null; return getGoldRunningWaterDbFallback(query);
} }
List<UserGoldRunningWaterHistoryDTO> clsWaterWaters = clsWater.getWaters(); List<UserGoldRunningWaterHistoryDTO> clsWaterWaters = clsWater.getWaters();
@ -179,11 +179,29 @@ public class UserWalletServiceImpl implements UserWalletService {
}) })
.filter(Objects::nonNull) .filter(Objects::nonNull)
.toList() .toList()
); );
} }
@Override private UserGoldRunningWaterClsTmpCO getGoldRunningWaterDbFallback(
public void sendGold(SendGoldCmd param) { UserGoldRunningWaterBackQryCmd query) {
if (StringUtils.isNotBlank(query.getContext())) {
return new UserGoldRunningWaterClsTmpCO()
.setListOver(true)
.setWaters(Lists.newArrayList());
}
List<UserGoldRunningWaterCO> waters = listGoldRunningWater(query);
if (CollectionUtils.isEmpty(waters)) {
return null;
}
return new UserGoldRunningWaterClsTmpCO()
.setListOver(true)
.setWaters(waters);
}
@Override
public void sendGold(SendGoldCmd param) {
ResponseAssert.isTrue(WalletErrorCode.REQUIRED_GT_ZERO, ResponseAssert.isTrue(WalletErrorCode.REQUIRED_GT_ZERO,
ArithmeticUtils.gtZero(param.getQuantity())); ArithmeticUtils.gtZero(param.getQuantity()));
UserProfileDTO userProfile = ResponseAssert.requiredSuccess( UserProfileDTO userProfile = ResponseAssert.requiredSuccess(