fix:新增网商是否已激活标识

This commit is contained in:
wangff
2025-11-21 10:03:58 +08:00
parent f53b77b657
commit fb6170833c
3 changed files with 19 additions and 3 deletions

View File

@@ -299,4 +299,9 @@ public class RedisConstant {
* 打标接口创建网商账户失败标识 wallet_online_bank_tag_fail:storeId
*/
public static final String WALLET_ONLINE_BANK_TAG_FAIL = "wallet_online_bank_tag_fail:{0}";
/**
* 网商账户是否已激活
*/
public static final String WALLET_ONLINE_BANK_ACTIVATED = "wallet_online_bank_activated:{0}";
}

View File

@@ -22,6 +22,9 @@ public class AccountDataVO {
@ApiModelProperty("网商账户开通失败标识")
private Boolean onlineBankOpenFail;
@ApiModelProperty("是否已激活")
private Boolean activated;
@ApiModelProperty("账户列表")
private List<AccountInfoVO> accountList;
}

View File

@@ -215,8 +215,10 @@ public class WalletServiceImpl implements WalletService {
log.info("打标接口调用成功response:{}", JSONObject.toJSONString(addTagDTO));
// TODO: 如果网商创建失败,缓存标记
if (false) {
String key = MessageFormat.format(RedisConstant.WALLET_ONLINE_BANK_TAG_FAIL, tagRequest.getOutStoreId());
redisUtilPool.setString(key, "1");
redisUtilPool.setString(MessageFormat.format(RedisConstant.WALLET_ONLINE_BANK_TAG_FAIL, tagRequest.getOutStoreId()), "1");
} else {
// 网商创建成功,记录已激活状态
redisUtilPool.setString(MessageFormat.format(RedisConstant.WALLET_ONLINE_BANK_ACTIVATED, tagRequest.getOutStoreId()), "1");
}
}
@@ -291,6 +293,7 @@ public class WalletServiceImpl implements WalletService {
// 如果创建成功,删除网商开通失败标识
if (Integer.valueOf(4).equals(request.getAccountStatus())) {
redisUtilPool.delKey(MessageFormat.format(RedisConstant.WALLET_ONLINE_BANK_TAG_FAIL, request.getOutStoreId()));
redisUtilPool.delKey(MessageFormat.format(RedisConstant.WALLET_ONLINE_BANK_ACTIVATED, request.getOutStoreId()));
}
} catch (Exception e) {
log.info("平安打标回调失败", e);
@@ -316,10 +319,13 @@ public class WalletServiceImpl implements WalletService {
return vo;
}).collect(Collectors.toList());
boolean onlineBankOpenFail = false;
boolean activated = false;
if (WalletTypeEnum.ONLINE_BANK.getType().equals(request.getWalletType())) {
onlineBankOpenFail = getOnlineBankFailTag(storeId);
String key = MessageFormat.format(RedisConstant.WALLET_ONLINE_BANK_ACTIVATED, storeId);
activated = StringUtils.isNotBlank(redisUtilPool.getString(key));
}
return new AccountDataVO(onlineBankOpenFail, accountList);
return new AccountDataVO(onlineBankOpenFail, activated, accountList);
}
@Override
@@ -560,6 +566,8 @@ public class WalletServiceImpl implements WalletService {
oldStoreAccountCreateRequest.setSignatoryPhotoA(request.getSignerIdCardFront());
oldStoreAccountCreateRequest.setSignatoryPhotoB(request.getSignerIdCardBack());
walletApiService.oldStoreOpenAccount(oldStoreAccountCreateRequest);
// 网商创建成功,记录已激活状态
redisUtilPool.setString(MessageFormat.format(RedisConstant.WALLET_ONLINE_BANK_ACTIVATED, store.getStoreId()), "1");
return Boolean.TRUE;
}