修复钱包 GAME_OPEN 重复单幂等

This commit is contained in:
hy001 2026-04-23 18:50:33 +08:00
parent 5951344b1e
commit 5dd445dfee
2 changed files with 27 additions and 27 deletions

View File

@ -23,26 +23,26 @@ public class WalletGoldAssetRecordServiceImpl extends
WalletGoldAssetRecordService { WalletGoldAssetRecordService {
@Override @Override
public boolean existsRecent(Long id) { public boolean existsRecent(Long id) {
return Optional.ofNullable( return Optional.ofNullable(
query().select(WalletGoldAssetRecord::getId) query().select(WalletGoldAssetRecord::getId)
.eq(WalletGoldAssetRecord::getId, id) .eq(WalletGoldAssetRecord::getId, id)
.ge(WalletGoldAssetRecord::getCreateTime, DateUtils.nowPlusDays(3)) .ge(WalletGoldAssetRecord::getCreateTime, DateUtils.nowMinusDays(3))
.last(PageConstant.LIMIT_ONE).getOne()) .last(PageConstant.LIMIT_ONE).getOne())
.map(res -> Objects.nonNull(res.getId())) .map(res -> Objects.nonNull(res.getId()))
.orElse(Boolean.FALSE); .orElse(Boolean.FALSE);
} }
@Override @Override
public boolean existsRecentEventId(String eventId) { public boolean existsRecentEventId(String eventId) {
return Optional.ofNullable( return Optional.ofNullable(
query().select(WalletGoldAssetRecord::getId) query().select(WalletGoldAssetRecord::getId)
.eq(WalletGoldAssetRecord::getEventId, eventId) .eq(WalletGoldAssetRecord::getEventId, eventId)
.ge(WalletGoldAssetRecord::getCreateTime, DateUtils.nowPlusDays(3)) .ge(WalletGoldAssetRecord::getCreateTime, DateUtils.nowMinusDays(3))
.last(PageConstant.LIMIT_ONE).getOne()) .last(PageConstant.LIMIT_ONE).getOne())
.map(res -> Objects.nonNull(res.getId())) .map(res -> Objects.nonNull(res.getId()))
.orElse(Boolean.FALSE); .orElse(Boolean.FALSE);
} }
@Override @Override
public List<WalletGoldAssetRecord> listThisMonth(String sysOrigin, Long userId, Integer type, public List<WalletGoldAssetRecord> listThisMonth(String sysOrigin, Long userId, Integer type,

View File

@ -124,15 +124,15 @@ public class WalletGoldGatewayImpl implements WalletGoldGateway {
return "WG_RQ:" + receipt.getReqTraceId(); return "WG_RQ:" + receipt.getReqTraceId();
} }
private static boolean existsEvent(String eventType) { private static boolean existsEvent(String eventType) {
if (StringUtils.isBlank(eventType)) { if (StringUtils.isBlank(eventType)) {
return false; return false;
} }
List<String> markLabels = List.of("COMPENSATE_ORDER", "GIFT"); List<String> markLabels = List.of("COMPENSATE_ORDER", "GIFT", "GAME_OPEN");
for (String labels : markLabels) { for (String labels : markLabels) {
if (eventType.contains(labels)) { if (eventType.contains(labels)) {
return true; return true;
} }
} }
return false; return false;
} }