公会-提现-账户-国家-提现时判断失效状态
This commit is contained in:
@@ -960,6 +960,12 @@ public enum BusiStatus {
|
||||
DAILY_IP_SIGN_IN_EXIST(20514, "该设备IP今日已经签到"),
|
||||
|
||||
CHARGE_TREASURE_ACT_NOT_ENOUGH_SCORE(500, "你的点数不足,快去完成冒险任务再打开宝藏吧!"),
|
||||
|
||||
SERIES_CONFIG_ERROR(20515, "SERIES CONFIG ERROR"),
|
||||
SERIES_MEDAL_CONFIG_ERROR(20515, "SERIES MEDAL CONFIG ERROR"),
|
||||
SERIES_MEDAL_LIMIT(20515, "超过可设置上限,请升级VIP获取更多位置"),
|
||||
|
||||
GUILD_USD_WITHDRAW_ACCOUNT_TYPE_ERROR(500, "提現方式錯誤,請重新綁定帳戶後重試。"),
|
||||
;
|
||||
|
||||
private final int value;
|
||||
|
@@ -110,6 +110,11 @@ public class GuildUsdWithdrawAccountService extends ServiceImpl<GuildUsdWithdraw
|
||||
|
||||
List<GuildUsdWithdrawAccountConfig> countryConfigList = configService.listAccountConfig(List.of(typeEnum.name()), u.getPartitionId());
|
||||
|
||||
if (null != accountVo.getCountry() && countryConfigList.stream()
|
||||
.noneMatch(config -> config.getCountry().equals(accountVo.getCountry()))){
|
||||
throw new ServiceException(BusiStatus.GUILD_USD_WITHDRAW_ACCOUNT_TYPE_ERROR);
|
||||
}
|
||||
|
||||
accountVo.setCountryOptionalList(countryConfigList.stream().map(config -> {
|
||||
GuildUsdWithdrawAccountVo.Country country = new GuildUsdWithdrawAccountVo.Country();
|
||||
country.setValue(config.getCountry());
|
||||
|
@@ -1,7 +1,7 @@
|
||||
package com.accompany.business.service.guild;
|
||||
|
||||
import com.accompany.business.constant.guild.GuildWithdrawAccountTypeEnum;
|
||||
import com.accompany.business.model.guild.GuildUsdWithdrawAccount;
|
||||
import com.accompany.business.model.guild.GuildUsdWithdrawAccountConfig;
|
||||
import com.accompany.business.model.guild.GuildUsdWithdrawRecord;
|
||||
import com.accompany.business.mybatismapper.guild.GuildUsdWithdrawRecordMapper;
|
||||
import com.accompany.common.status.BusiStatus;
|
||||
@@ -18,20 +18,25 @@ public class GuildUsdWithdrawBizService extends ServiceImpl<GuildUsdWithdrawReco
|
||||
@Autowired
|
||||
private GuildUsdWithdrawRecordService recordService;
|
||||
@Autowired
|
||||
private GuildUsdWithdrawAccountConfigService accountConfigService;
|
||||
@Autowired
|
||||
private GuildUsdWithdrawAccountService accountService;
|
||||
|
||||
public GuildUsdWithdrawRecord insertRecord(Integer partitionId, Integer guildId, Long uid, BigDecimal guildUsdNum, String accountType) {
|
||||
GuildWithdrawAccountTypeEnum typeEnum = GuildWithdrawAccountTypeEnum.valueOf(accountType);
|
||||
|
||||
GuildUsdWithdrawAccount account = accountService.lambdaQuery()
|
||||
.eq(GuildUsdWithdrawAccount::getUid, uid)
|
||||
.eq(GuildUsdWithdrawAccount::getAccountType, typeEnum.name())
|
||||
.eq(GuildUsdWithdrawAccount::getAccountType, accountType)
|
||||
.eq(GuildUsdWithdrawAccount::getEnable, Boolean.TRUE)
|
||||
.one();
|
||||
if (null == account){
|
||||
throw new ServiceException(BusiStatus.PARAMERROR);
|
||||
}
|
||||
|
||||
GuildUsdWithdrawAccountConfig config = accountConfigService.getAccountConfig(accountType, partitionId, account.getAccountCountry());
|
||||
if (null == config || !Boolean.TRUE.equals(config.getEnable())){
|
||||
throw new ServiceException(BusiStatus.GUILD_USD_WITHDRAW_ACCOUNT_TYPE_ERROR);
|
||||
}
|
||||
|
||||
return recordService.insertRecord(partitionId, guildId, uid, guildUsdNum, account);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user