fix:新增网商是否已激活标识
This commit is contained in:
@@ -299,4 +299,9 @@ public class RedisConstant {
|
|||||||
* 打标接口创建网商账户失败标识 wallet_online_bank_tag_fail:storeId
|
* 打标接口创建网商账户失败标识 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_TAG_FAIL = "wallet_online_bank_tag_fail:{0}";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 网商账户是否已激活
|
||||||
|
*/
|
||||||
|
public static final String WALLET_ONLINE_BANK_ACTIVATED = "wallet_online_bank_activated:{0}";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,6 +22,9 @@ public class AccountDataVO {
|
|||||||
@ApiModelProperty("网商账户开通失败标识")
|
@ApiModelProperty("网商账户开通失败标识")
|
||||||
private Boolean onlineBankOpenFail;
|
private Boolean onlineBankOpenFail;
|
||||||
|
|
||||||
|
@ApiModelProperty("是否已激活")
|
||||||
|
private Boolean activated;
|
||||||
|
|
||||||
@ApiModelProperty("账户列表")
|
@ApiModelProperty("账户列表")
|
||||||
private List<AccountInfoVO> accountList;
|
private List<AccountInfoVO> accountList;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -215,8 +215,10 @@ public class WalletServiceImpl implements WalletService {
|
|||||||
log.info("打标接口调用成功,response:{}", JSONObject.toJSONString(addTagDTO));
|
log.info("打标接口调用成功,response:{}", JSONObject.toJSONString(addTagDTO));
|
||||||
// TODO: 如果网商创建失败,缓存标记
|
// TODO: 如果网商创建失败,缓存标记
|
||||||
if (false) {
|
if (false) {
|
||||||
String key = MessageFormat.format(RedisConstant.WALLET_ONLINE_BANK_TAG_FAIL, tagRequest.getOutStoreId());
|
redisUtilPool.setString(MessageFormat.format(RedisConstant.WALLET_ONLINE_BANK_TAG_FAIL, tagRequest.getOutStoreId()), "1");
|
||||||
redisUtilPool.setString(key, "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())) {
|
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_TAG_FAIL, request.getOutStoreId()));
|
||||||
|
redisUtilPool.delKey(MessageFormat.format(RedisConstant.WALLET_ONLINE_BANK_ACTIVATED, request.getOutStoreId()));
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.info("平安打标回调失败", e);
|
log.info("平安打标回调失败", e);
|
||||||
@@ -316,10 +319,13 @@ public class WalletServiceImpl implements WalletService {
|
|||||||
return vo;
|
return vo;
|
||||||
}).collect(Collectors.toList());
|
}).collect(Collectors.toList());
|
||||||
boolean onlineBankOpenFail = false;
|
boolean onlineBankOpenFail = false;
|
||||||
|
boolean activated = false;
|
||||||
if (WalletTypeEnum.ONLINE_BANK.getType().equals(request.getWalletType())) {
|
if (WalletTypeEnum.ONLINE_BANK.getType().equals(request.getWalletType())) {
|
||||||
onlineBankOpenFail = getOnlineBankFailTag(storeId);
|
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
|
@Override
|
||||||
@@ -560,6 +566,8 @@ public class WalletServiceImpl implements WalletService {
|
|||||||
oldStoreAccountCreateRequest.setSignatoryPhotoA(request.getSignerIdCardFront());
|
oldStoreAccountCreateRequest.setSignatoryPhotoA(request.getSignerIdCardFront());
|
||||||
oldStoreAccountCreateRequest.setSignatoryPhotoB(request.getSignerIdCardBack());
|
oldStoreAccountCreateRequest.setSignatoryPhotoB(request.getSignerIdCardBack());
|
||||||
walletApiService.oldStoreOpenAccount(oldStoreAccountCreateRequest);
|
walletApiService.oldStoreOpenAccount(oldStoreAccountCreateRequest);
|
||||||
|
// 网商创建成功,记录已激活状态
|
||||||
|
redisUtilPool.setString(MessageFormat.format(RedisConstant.WALLET_ONLINE_BANK_ACTIVATED, store.getStoreId()), "1");
|
||||||
return Boolean.TRUE;
|
return Boolean.TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user