## 实名认证接口调整;三方实名接口调整;
This commit is contained in:
parent
32f350a651
commit
773e734cbc
|
@ -7,13 +7,6 @@ import com.hzs.system.config.dto.TradeConfigDTO;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
* @Author: ljc
|
||||
* @Time: 2023/8/21 15:05
|
||||
* @Classname: ITradeConfigApi
|
||||
* @Package_name: com.hzs.system.config
|
||||
*/
|
||||
public interface ITradeConfigServiceApi {
|
||||
|
||||
/**
|
||||
|
@ -26,18 +19,18 @@ public interface ITradeConfigServiceApi {
|
|||
|
||||
/**
|
||||
* 根据条件查询交易白名单配置
|
||||
* @param tradeConfigDTO 入参
|
||||
*
|
||||
* @param tradeConfigDTO 入参
|
||||
* @return BdTradeWhiteConfig
|
||||
*/
|
||||
R<BdTradeWhiteConfig> selectTradeWhiteConfigByCondition(TradeConfigDTO tradeConfigDTO);
|
||||
|
||||
|
||||
/**
|
||||
* 根据会员ID查询账户白名单
|
||||
*
|
||||
* @param pkMember 会员ID
|
||||
* @param pkCountry 国家
|
||||
* @return R<List<Long>>
|
||||
* @return R<List < Long>>
|
||||
*/
|
||||
R<List<Integer>> selectTransferWhiteByPkMember(Long pkMember, Integer pkCountry);
|
||||
|
||||
|
|
|
@ -24,25 +24,21 @@ public class TradeConfigDTO implements Serializable {
|
|||
/**
|
||||
* 真实奖衔
|
||||
*/
|
||||
|
||||
private Integer pkAwards;
|
||||
|
||||
/**
|
||||
* 1:提现 2:转账 (来源枚举EBusinessModule)
|
||||
*/
|
||||
|
||||
private Integer businessModule;
|
||||
|
||||
/**
|
||||
* 实名状态 1:禁止 0:允许 (来源枚举EYesNo)
|
||||
*/
|
||||
|
||||
private Integer realNameState;
|
||||
|
||||
/**
|
||||
* 营业执照状态 1:禁止 0:允许 (来源枚举EYesNo)
|
||||
*/
|
||||
|
||||
private Integer licenseState;
|
||||
|
||||
/**
|
||||
|
|
|
@ -3,13 +3,6 @@ package com.hzs.third.idcard;
|
|||
import com.hzs.common.core.domain.R;
|
||||
import com.hzs.third.idcard.dto.IdCardOcrDTO;
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
* @Author: ljc
|
||||
* @Time: 2023/11/23 18:06
|
||||
* @Classname: IdCardServiceApi
|
||||
* @Package_name: com.hzs.third.idcard
|
||||
*/
|
||||
public interface IdCardServiceApi {
|
||||
|
||||
/**
|
||||
|
@ -20,4 +13,5 @@ public interface IdCardServiceApi {
|
|||
* @return R
|
||||
*/
|
||||
R<IdCardOcrDTO> invokeIdCardOcr(String idCardUrl, int side);
|
||||
|
||||
}
|
||||
|
|
|
@ -9,12 +9,6 @@ import java.io.Serializable;
|
|||
|
||||
/**
|
||||
* 身份证ORCDTO
|
||||
*
|
||||
* @Description:
|
||||
* @Author: ljc
|
||||
* @Time: 2023/11/23 17:11
|
||||
* @Classname: IdCardOcr
|
||||
* @Package_name: com.hzs.third.idcard.dto
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
|
|
|
@ -49,6 +49,31 @@ public class ApiCuMemberAuthenticationController extends BaseController {
|
|||
@DubboReference
|
||||
IdCardServiceApi idCardServiceApi;
|
||||
|
||||
/**
|
||||
* 是否需要实名认证
|
||||
*
|
||||
* @param businessModule 1:提现 2:转账 (来源枚举EBusinessModule)
|
||||
* @return AjaxResult
|
||||
*/
|
||||
@GetMapping("/is-auth")
|
||||
public AjaxResult isAuth(Integer businessModule) {
|
||||
String flag = EYesNo.YES.getValue();
|
||||
Long pkMember = SecurityUtils.getUserId();
|
||||
Integer pkCountry = SecurityUtils.getPkCountry();
|
||||
// 是否配置提现、转账白名单
|
||||
BdTradeWhiteConfig bdTradeWhiteConfig = iCuMemberBaseService.selectConfigWhite(pkMember, pkCountry, businessModule);
|
||||
if (null == bdTradeWhiteConfig) {
|
||||
// 查询提现、转账是否需要校验
|
||||
BdTradeConfig bdTradeConfig = iCuMemberBaseService.selectConfigTrade(pkMember, pkCountry, businessModule, EVerificationModule.REAL_NAME);
|
||||
if (null != bdTradeConfig) {
|
||||
// 校验是否已经实名
|
||||
CuMemberAuthenticationVO authenticationVO = iCuMemberAuthenticationService.selectCuMemberAuthenticationByPkMember(CuMemberAuthenticationVO.builder().pkMember(pkMember).pkCountry(pkCountry).build());
|
||||
flag = null == authenticationVO ? EYesNo.NO.getValue() : EYesNo.YES.getValue();
|
||||
}
|
||||
}
|
||||
return AjaxResult.success().put("flag", flag);
|
||||
}
|
||||
|
||||
/**
|
||||
* 调用身份证OCR接口
|
||||
*
|
||||
|
@ -114,47 +139,35 @@ public class ApiCuMemberAuthenticationController extends BaseController {
|
|||
Long pkMember = SecurityUtils.getUserId();
|
||||
Integer pkCountry = SecurityUtils.getPkCountry();
|
||||
|
||||
//查询是否已实名
|
||||
CuMemberAuthenticationVO queryAuthenticationVO = iCuMemberAuthenticationService.selectCuMemberAuthenticationByPkMember(CuMemberAuthenticationVO.builder().pkMember(pkMember).pkCountry(pkCountry).build());
|
||||
if (null != queryAuthenticationVO) {
|
||||
return AjaxResult.error(FinanceMsgConstants.MEMBER_REAL_NAME);
|
||||
}
|
||||
|
||||
// 验证码是否为空
|
||||
String verificationCode = authenticationVO.getVerificationCode();
|
||||
if (StringUtils.isEmpty(verificationCode)) {
|
||||
return AjaxResult.error(TransactionUtils.getContent(FinanceMsgConstants.VERIFICATION_CODE_CANNOT_EMPTY));
|
||||
}
|
||||
//真实姓名
|
||||
// 真实姓名
|
||||
String accountName = authenticationVO.getAccountName();
|
||||
if (StringUtils.isEmpty(accountName)) {
|
||||
return AjaxResult.error(TransactionUtils.getContent(FinanceMsgConstants.REAL_NAME_CANNOT_EMPTY));
|
||||
}
|
||||
//真实姓名与注册的会员姓名不一致
|
||||
CuMember member = iCuMemberService.getMember(pkMember);
|
||||
if (!member.getMemberName().equals(accountName)) {
|
||||
return AjaxResult.error(TransactionUtils.getContent(FinanceMsgConstants.REAL_NAME_MEMBER_NOT_DIFFERENT));
|
||||
}
|
||||
|
||||
//支行名称
|
||||
String subBankName = authenticationVO.getSubBankName();
|
||||
if (StringUtils.isEmpty(subBankName)) {
|
||||
return AjaxResult.error(TransactionUtils.getContent(FinanceMsgConstants.OPENING_BRANCH_CANNOT_EMPTY));
|
||||
}
|
||||
if (null == authenticationVO.getPkProvince()) {
|
||||
return AjaxResult.error(TransactionUtils.getContent(FinanceMsgConstants.PROVINCE_CANNOT_EMPTY));
|
||||
}
|
||||
if (null == authenticationVO.getPkCity()) {
|
||||
return AjaxResult.error(TransactionUtils.getContent(FinanceMsgConstants.CITY_CANNOT_EMPTY));
|
||||
}
|
||||
if (StringUtils.isEmpty(authenticationVO.getAddress())) {
|
||||
return AjaxResult.error(TransactionUtils.getContent(FinanceMsgConstants.ADDRESS_CANNOT_EMPTY));
|
||||
}
|
||||
if (StringUtils.isEmpty(authenticationVO.getIdFront())) {
|
||||
return AjaxResult.error(TransactionUtils.getContent(FinanceMsgConstants.ID_FRONT_CANNOT_EMPTY));
|
||||
}
|
||||
if (StringUtils.isEmpty(authenticationVO.getIdBack())) {
|
||||
return AjaxResult.error(TransactionUtils.getContent(FinanceMsgConstants.ID_BACK_CANNOT_EMPTY));
|
||||
}
|
||||
if (StringUtils.isEmpty(authenticationVO.getAddress())) {
|
||||
return AjaxResult.error(TransactionUtils.getContent(FinanceMsgConstants.ADDRESS_CANNOT_EMPTY));
|
||||
}
|
||||
// 查询是否已实名
|
||||
CuMemberAuthenticationVO queryAuthenticationVO = iCuMemberAuthenticationService.selectCuMemberAuthenticationByPkMember(CuMemberAuthenticationVO.builder().pkMember(pkMember).pkCountry(pkCountry).build());
|
||||
if (null != queryAuthenticationVO) {
|
||||
return AjaxResult.error(FinanceMsgConstants.MEMBER_REAL_NAME);
|
||||
}
|
||||
// 真实姓名与注册的会员姓名不一致
|
||||
CuMember member = iCuMemberService.getMember(pkMember);
|
||||
if (!member.getMemberName().equals(accountName)) {
|
||||
return AjaxResult.error(TransactionUtils.getContent(FinanceMsgConstants.REAL_NAME_MEMBER_NOT_DIFFERENT));
|
||||
}
|
||||
|
||||
String message = iApiAliSmsService.checkCode(null, verificationCode, null, pkMember);
|
||||
if (null != message) {
|
||||
|
@ -167,33 +180,6 @@ public class ApiCuMemberAuthenticationController extends BaseController {
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* 是否需要实名认证
|
||||
*
|
||||
* @param businessModule 1:提现 2:转账 (来源枚举EBusinessModule)
|
||||
* @return AjaxResult
|
||||
*/
|
||||
@GetMapping("/is-auth")
|
||||
public AjaxResult isAuth(Integer businessModule) {
|
||||
String flag = EYesNo.YES.getValue();
|
||||
Long pkMember = SecurityUtils.getUserId();
|
||||
Integer pkCountry = SecurityUtils.getPkCountry();
|
||||
//查询配置实名认证白名证
|
||||
BdTradeWhiteConfig bdTradeWhiteConfig = iCuMemberBaseService.selectConfigWhite(pkMember, pkCountry, businessModule);
|
||||
if (null == bdTradeWhiteConfig) {
|
||||
//查询配置是否实名认证
|
||||
BdTradeConfig bdTradeConfig = iCuMemberBaseService.selectConfigTrade(pkMember, pkCountry, businessModule, EVerificationModule.REAL_NAME);
|
||||
//配置后才进行验证
|
||||
if (null != bdTradeConfig) {
|
||||
//查询是否已实名认证
|
||||
CuMemberAuthenticationVO authenticationVO = iCuMemberAuthenticationService.selectCuMemberAuthenticationByPkMember(CuMemberAuthenticationVO.builder().pkMember(pkMember).pkCountry(pkCountry).build());
|
||||
flag = null == authenticationVO ? EYesNo.NO.getValue() : EYesNo.YES.getValue();
|
||||
}
|
||||
}
|
||||
return AjaxResult.success().put("flag", flag);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查看详情
|
||||
*
|
||||
|
|
|
@ -36,7 +36,7 @@ public class CuMemberAuthenticationServiceImpl extends ServiceImpl<CuMemberAuthe
|
|||
@Autowired
|
||||
private ICuMemberService iCuMemberService;
|
||||
@Autowired
|
||||
private ICuMemberAuthenticationService authenticationService;
|
||||
private ICuMemberAuthenticationService iCuMemberAuthenticationService;
|
||||
@Autowired
|
||||
private ICuMemberBaseService iCuMemberBaseService;
|
||||
|
||||
|
@ -50,7 +50,7 @@ public class CuMemberAuthenticationServiceImpl extends ServiceImpl<CuMemberAuthe
|
|||
}
|
||||
|
||||
/**
|
||||
* |更新用户表中的实名状态
|
||||
* 更新用户表中的实名状态
|
||||
*
|
||||
* @param authenticationVO 入参
|
||||
* @return Boolean
|
||||
|
@ -60,7 +60,7 @@ public class CuMemberAuthenticationServiceImpl extends ServiceImpl<CuMemberAuthe
|
|||
LambdaUpdateWrapper<CuMember> updateWrapper = new LambdaUpdateWrapper<>();
|
||||
updateWrapper.set(CuMember::getIsRealName, EYesNo.YES.getIntValue());
|
||||
updateWrapper.set(CuMember::getIdCard, authenticationVO.getIdCard());
|
||||
updateWrapper.set(CuMember::getServiceAgreement, EServiceStatus.SIGNED.getValue());
|
||||
updateWrapper.set(CuMember::getServiceAgreement, EServiceStatus.UNSIGNED.getValue());
|
||||
updateWrapper.set(CuMember::getModifiedTime, new Date());
|
||||
updateWrapper.set(CuMember::getPkModified, pkMember);
|
||||
updateWrapper.eq(CuMember::getPkId, pkMember);
|
||||
|
@ -106,7 +106,7 @@ public class CuMemberAuthenticationServiceImpl extends ServiceImpl<CuMemberAuthe
|
|||
//配置后才进行验证
|
||||
if (null != bdTradeConfig) {
|
||||
//查询是否已实名认证
|
||||
CuMemberAuthenticationVO authenticationVO = authenticationService.selectCuMemberAuthenticationByPkMember(CuMemberAuthenticationVO.builder().pkMember(pkMember).pkCountry(pkCountry).build());
|
||||
CuMemberAuthenticationVO authenticationVO = iCuMemberAuthenticationService.selectCuMemberAuthenticationByPkMember(CuMemberAuthenticationVO.builder().pkMember(pkMember).pkCountry(pkCountry).build());
|
||||
flag = null == authenticationVO ? EYesNo.NO.getIntValue() : EYesNo.YES.getIntValue();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -321,7 +321,7 @@ public class CuMemberBaseServiceImpl implements ICuMemberBaseService {
|
|||
} else {
|
||||
whiteDTO.setTransferState(EYesNo.YES.getIntValue());
|
||||
}
|
||||
//查询配置实名认证白名证
|
||||
// 查询配置实名认证白名证
|
||||
return iTradeConfigServiceApi.selectTradeWhiteConfigByCondition(whiteDTO).getData();
|
||||
}
|
||||
|
||||
|
|
|
@ -11,12 +11,6 @@ import java.io.Serializable;
|
|||
|
||||
/**
|
||||
* 实名认证VO
|
||||
*
|
||||
* @Description:
|
||||
* @Author: ljc
|
||||
* @Time: 2023/4/17 13:52
|
||||
* @Classname: CuMemberAuthenticationVO
|
||||
* @Package_name: com.hzs.member.account.vo
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
|
@ -81,7 +75,6 @@ public class CuMemberAuthenticationVO implements Serializable {
|
|||
*/
|
||||
private Long pkBank;
|
||||
|
||||
|
||||
/**
|
||||
* 银行名称
|
||||
*/
|
||||
|
|
|
@ -1,16 +1,11 @@
|
|||
package com.hzs.system.config.controller.manage;
|
||||
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.hzs.common.core.annotation.Log;
|
||||
import com.hzs.common.core.constant.CacheConstants;
|
||||
import com.hzs.common.core.constant.msg.ConfigMsgConstants;
|
||||
import com.hzs.common.core.enums.*;
|
||||
import com.hzs.common.core.service.RedisService;
|
||||
import com.hzs.common.core.utils.StringUtils;
|
||||
import com.hzs.common.core.web.controller.BaseController;
|
||||
import com.hzs.common.core.web.domain.AjaxResult;
|
||||
import com.hzs.common.domain.system.config.BdTradeConfig;
|
||||
import com.hzs.common.security.utils.SecurityUtils;
|
||||
import com.hzs.common.util.TransactionUtils;
|
||||
import com.hzs.system.config.service.IBdTradeConfigService;
|
||||
|
@ -19,14 +14,8 @@ import lombok.extern.slf4j.Slf4j;
|
|||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 交易配置表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author hzs
|
||||
* @since 2023-08-18
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
|
@ -34,11 +23,7 @@ import org.springframework.web.bind.annotation.*;
|
|||
public class BdTradeConfigController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private RedisService redisService;
|
||||
|
||||
@Autowired
|
||||
|
||||
private IBdTradeConfigService bdTradeConfigService;
|
||||
private IBdTradeConfigService iBdTradeConfigService;
|
||||
|
||||
/**
|
||||
* 保存交易配置
|
||||
|
@ -55,10 +40,9 @@ public class BdTradeConfigController extends BaseController {
|
|||
}
|
||||
tradeConfigVO.setPkMember(SecurityUtils.getUserId());
|
||||
tradeConfigVO.setPkCountry(SecurityUtils.getPkCountry());
|
||||
return toAjax(bdTradeConfigService.addTradeConfig(tradeConfigVO));
|
||||
return toAjax(iBdTradeConfigService.addTradeConfig(tradeConfigVO));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 交易配置列表显示
|
||||
*
|
||||
|
@ -69,7 +53,7 @@ public class BdTradeConfigController extends BaseController {
|
|||
@PostMapping("/list")
|
||||
public AjaxResult showTradeConfigList(@RequestBody BdTradeConfigVO tradeConfigVO) {
|
||||
tradeConfigVO.setPkCountry(SecurityUtils.getPkCountry());
|
||||
return AjaxResult.success(bdTradeConfigService.showTradeConfigList(tradeConfigVO));
|
||||
return AjaxResult.success(iBdTradeConfigService.showTradeConfigList(tradeConfigVO));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -87,8 +71,7 @@ public class BdTradeConfigController extends BaseController {
|
|||
}
|
||||
tradeConfigVO.setPkMember(SecurityUtils.getUserId());
|
||||
tradeConfigVO.setPkCountry(SecurityUtils.getPkCountry());
|
||||
getCacheKey(tradeConfigVO.getPkId());
|
||||
return toAjax(bdTradeConfigService.updateTradeConfig(tradeConfigVO));
|
||||
return toAjax(iBdTradeConfigService.updateTradeConfig(tradeConfigVO));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -100,8 +83,7 @@ public class BdTradeConfigController extends BaseController {
|
|||
@Log(module = EOperationModule.TRADE_CONFIG, business = EOperationBusiness.WITHDRAWAL_CONFIG, method = EOperationMethod.DELETE)
|
||||
@GetMapping("/delete")
|
||||
public AjaxResult deleteTradeConfig(Integer pkId) {
|
||||
getCacheKey(pkId);
|
||||
return toAjax(bdTradeConfigService.deleteTradeConfig(pkId, SecurityUtils.getUserId()));
|
||||
return toAjax(iBdTradeConfigService.deleteTradeConfig(pkId, SecurityUtils.getUserId()));
|
||||
}
|
||||
|
||||
|
||||
|
@ -114,10 +96,9 @@ public class BdTradeConfigController extends BaseController {
|
|||
@Log(module = EOperationModule.TRADE_CONFIG, business = EOperationBusiness.WITHDRAWAL_CONFIG, method = EOperationMethod.DELETE)
|
||||
@GetMapping("/detail")
|
||||
public AjaxResult selectTradeConfigDetail(Integer pkId) {
|
||||
return AjaxResult.success(bdTradeConfigService.selectTradeConfigDetail(pkId, SecurityUtils.getPkCountry()));
|
||||
return AjaxResult.success(iBdTradeConfigService.selectTradeConfigDetail(pkId, SecurityUtils.getPkCountry()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 公共参数校验
|
||||
*
|
||||
|
@ -131,71 +112,10 @@ public class BdTradeConfigController extends BaseController {
|
|||
if (null == tradeConfigVO.getLicenseState()) {
|
||||
return AjaxResult.error(TransactionUtils.getContent(ConfigMsgConstants.LICENSE_STATE_NOT_EMPTY));
|
||||
}
|
||||
|
||||
if (null == tradeConfigVO.getBusinessModule()) {
|
||||
return AjaxResult.error(TransactionUtils.getContent(ConfigMsgConstants.BUSINESS_MODULE));
|
||||
}
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
private String[] getCacheKey(Integer pkId) {
|
||||
BdTradeConfig tradeConfig = bdTradeConfigService.getById(pkId);
|
||||
Integer pkCountry = tradeConfig.getPkCountry();
|
||||
Integer businessModule = tradeConfig.getBusinessModule();
|
||||
String pkAwards = tradeConfig.getPkAwards();
|
||||
String pkGrade = tradeConfig.getPkGrade();
|
||||
Integer realNameState = tradeConfig.getRealNameState();
|
||||
Integer licenseState = tradeConfig.getLicenseState();
|
||||
//删除奖衔缓存
|
||||
if (StringUtils.isNotEmpty(pkAwards)) {
|
||||
String[] pkAwardsStrs = pkAwards.split(",");
|
||||
for (String pkAwardsStr : pkAwardsStrs) {
|
||||
deleteCacheKey(pkCountry, businessModule, realNameState, licenseState, pkAwardsStr, null);
|
||||
}
|
||||
}
|
||||
//删除等级缓存
|
||||
if (StringUtils.isNotEmpty(pkGrade)) {
|
||||
String[] pkGradeStrs = pkGrade.split(",");
|
||||
for (String pkGradeStr : pkGradeStrs) {
|
||||
deleteCacheKey(pkCountry, businessModule, realNameState, licenseState, null, pkGradeStr);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取键值
|
||||
*
|
||||
* @param pkCountry 国家
|
||||
* @param businessModule 业务模块
|
||||
* @param realNameState 实名
|
||||
* @param licenseState 营业执照
|
||||
* @param pkAwards 奖衔
|
||||
* @param pkGrade 等级
|
||||
* @return
|
||||
*/
|
||||
|
||||
private String deleteCacheKey(Integer pkCountry, Integer businessModule, Integer realNameState, Integer licenseState, String pkAwards, String pkGrade) {
|
||||
String key = null;
|
||||
//提现、转账、奖衔
|
||||
if (null != businessModule && null != pkAwards && null != realNameState) {
|
||||
key = CacheConstants.TRADE_CONFIG + ":" + pkCountry + ":" + businessModule + pkAwards + EVerificationModule.REAL_NAME.getValue();
|
||||
redisService.deleteObjectByKey(key);
|
||||
}
|
||||
if (null != businessModule && null != pkAwards && null != licenseState) {
|
||||
key = CacheConstants.TRADE_CONFIG + ":" + pkCountry + ":" + businessModule + pkAwards + EVerificationModule.BUSINESS_LICENSE.getValue();
|
||||
redisService.deleteObjectByKey(key);
|
||||
}
|
||||
|
||||
//提现等级
|
||||
if (null != businessModule && null != pkGrade && null != realNameState) {
|
||||
key = CacheConstants.TRADE_CONFIG + ":" + pkCountry + ":" + businessModule + pkGrade + EVerificationModule.REAL_NAME.getValue();
|
||||
redisService.deleteObjectByKey(key);
|
||||
}
|
||||
if (null != businessModule && null != pkGrade && null != licenseState) {
|
||||
key = CacheConstants.TRADE_CONFIG + ":" + pkCountry + ":" + businessModule + pkGrade + EVerificationModule.BUSINESS_LICENSE.getValue();
|
||||
redisService.deleteObjectByKey(key);
|
||||
}
|
||||
return key;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,15 +1,12 @@
|
|||
package com.hzs.system.config.controller.manage;
|
||||
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.hzs.common.core.annotation.Log;
|
||||
import com.hzs.common.core.constant.CacheConstants;
|
||||
import com.hzs.common.core.constant.EnumsPrefixConstants;
|
||||
import com.hzs.common.core.constant.HttpStatus;
|
||||
import com.hzs.common.core.constant.msg.ConfigMsgConstants;
|
||||
import com.hzs.common.core.enums.*;
|
||||
import com.hzs.common.core.service.RedisService;
|
||||
import com.hzs.common.core.utils.StringUtils;
|
||||
import com.hzs.common.core.utils.poi.ExcelUtil;
|
||||
import com.hzs.common.core.web.controller.BaseController;
|
||||
|
@ -34,12 +31,7 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 交易白名单配置表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author hzs
|
||||
* @since 2023-08-18
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
|
@ -47,17 +39,13 @@ import java.util.Map;
|
|||
public class BdTradeWhiteConfigController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
IBdTradeWhiteConfigService bdTradeWhiteConfigService;
|
||||
IBdTradeWhiteConfigService iBdTradeWhiteConfigService;
|
||||
@Autowired
|
||||
ITransactionCommonService iTransactionCommonService;
|
||||
|
||||
@DubboReference
|
||||
IMemberServiceApi iMemberServiceApi;
|
||||
|
||||
@Autowired
|
||||
private RedisService redisService;
|
||||
|
||||
@Autowired
|
||||
ITransactionCommonService iTransactionCommonService;
|
||||
|
||||
/**
|
||||
* 保存交易配置白名单
|
||||
*
|
||||
|
@ -74,18 +62,16 @@ public class BdTradeWhiteConfigController extends BaseController {
|
|||
if ((Integer) ajaxResult.get(AjaxResult.CODE_TAG) == HttpStatus.ERROR) {
|
||||
return ajaxResult;
|
||||
}
|
||||
BdTradeWhiteConfig tradeWhiteConfig = bdTradeWhiteConfigService.selectTradeWhiteConfigByPkMember(cumember.getPkId());
|
||||
BdTradeWhiteConfig tradeWhiteConfig = iBdTradeWhiteConfigService.selectTradeWhiteConfigByPkMember(cumember.getPkId());
|
||||
if (null != tradeWhiteConfig) {
|
||||
return AjaxResult.error(ConfigMsgConstants.MEMBER_EXIST);
|
||||
}
|
||||
|
||||
tradeWhiteConfigVO.setPkCreator(SecurityUtils.getUserId());
|
||||
tradeWhiteConfigVO.setPkMember(cumember.getPkId());
|
||||
tradeWhiteConfigVO.setPkCountry(SecurityUtils.getPkCountry());
|
||||
return toAjax(bdTradeWhiteConfigService.addTradeWhiteConfig(tradeWhiteConfigVO));
|
||||
return toAjax(iBdTradeWhiteConfigService.addTradeWhiteConfig(tradeWhiteConfigVO));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 交易配置白名单列表显示
|
||||
*
|
||||
|
@ -104,13 +90,12 @@ public class BdTradeWhiteConfigController extends BaseController {
|
|||
tradeWhiteConfigVO.setPkMember(pkMember);
|
||||
}
|
||||
startPage();
|
||||
Object[] objects = bdTradeWhiteConfigService.showTradeWhiteConfigList(tradeWhiteConfigVO);
|
||||
Object[] objects = iBdTradeWhiteConfigService.showTradeWhiteConfigList(tradeWhiteConfigVO);
|
||||
TableDataInfo tableDataInfo = getDataTable((List<BdTradeWhiteConfigExt>) objects[0]);
|
||||
tableDataInfo.setRows((List<BdTradeWhiteConfigVO>) objects[1]);
|
||||
return tableDataInfo;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 白名单导出
|
||||
*
|
||||
|
@ -128,16 +113,15 @@ public class BdTradeWhiteConfigController extends BaseController {
|
|||
Long pkMember = null != cumember ? cumember.getPkId() : null;
|
||||
tradeWhiteConfigVO.setPkMember(pkMember);
|
||||
}
|
||||
List<BdTradeWhiteConfigVO> bdTradeWhiteConfigVOList = (List<BdTradeWhiteConfigVO>) bdTradeWhiteConfigService.showTradeWhiteConfigList(tradeWhiteConfigVO)[1];
|
||||
List<BdTradeWhiteConfigVO> bdTradeWhiteConfigVOList = (List<BdTradeWhiteConfigVO>) iBdTradeWhiteConfigService.showTradeWhiteConfigList(tradeWhiteConfigVO)[1];
|
||||
//多语言翻译
|
||||
if (CollUtil.isNotEmpty(bdTradeWhiteConfigVOList)) {
|
||||
//枚举翻译
|
||||
Map<String, String> transactionMap = iTransactionCommonService.exportEnumTransaction(EYesNo.values());
|
||||
Map<Integer, String> transactionMap1 = iTransactionCommonService.exportEnumTransactionByDB(EnumsPrefixConstants.KEY_AWARD);
|
||||
for (BdTradeWhiteConfigVO configVO : bdTradeWhiteConfigVOList) {
|
||||
configVO.setPkAwardsVal(transactionMap1.get(configVO.getPkAwards()));
|
||||
configVO.setWithdrawalStateVal(transactionMap.get(EnumsPrefixConstants.YES_NO + configVO.getWithdrawalState()));
|
||||
configVO.setTransferStateVal(transactionMap.get(EnumsPrefixConstants.YES_NO + configVO.getTransferState()));
|
||||
configVO.setWithdrawalStateVal(EYesNo.getLabelByIntValue(configVO.getWithdrawalState()));
|
||||
configVO.setTransferStateVal(EYesNo.getLabelByIntValue(configVO.getTransferState()));
|
||||
}
|
||||
}
|
||||
ExcelUtil<BdTradeWhiteConfigVO> util = new ExcelUtil<>(BdTradeWhiteConfigVO.class);
|
||||
|
@ -161,8 +145,7 @@ public class BdTradeWhiteConfigController extends BaseController {
|
|||
}
|
||||
tradeWhiteConfigVO.setPkCreator(SecurityUtils.getUserId());
|
||||
tradeWhiteConfigVO.setPkCountry(SecurityUtils.getPkCountry());
|
||||
deleteKet(tradeWhiteConfigVO.getPkId());
|
||||
return toAjax(bdTradeWhiteConfigService.updateTradeWhiteConfig(tradeWhiteConfigVO));
|
||||
return toAjax(iBdTradeWhiteConfigService.updateTradeWhiteConfig(tradeWhiteConfigVO));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -178,11 +161,7 @@ public class BdTradeWhiteConfigController extends BaseController {
|
|||
return AjaxResult.success();
|
||||
} else {
|
||||
//删除缓存
|
||||
String[] pkIds = pkId.split(",");
|
||||
for (String id : pkIds) {
|
||||
deleteKet(Integer.parseInt(id));
|
||||
}
|
||||
return toAjax(bdTradeWhiteConfigService.deleteTradeWhiteConfig(pkId, SecurityUtils.getUserId()));
|
||||
return toAjax(iBdTradeWhiteConfigService.deleteTradeWhiteConfig(pkId, SecurityUtils.getUserId()));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -196,39 +175,12 @@ public class BdTradeWhiteConfigController extends BaseController {
|
|||
@Log(module = EOperationModule.TRADE_CONFIG, business = EOperationBusiness.WITHDRAWAL_CONFIG, method = EOperationMethod.DELETE)
|
||||
@GetMapping("/detail")
|
||||
public AjaxResult selectTradeWhiteConfigDetail(Integer pkId) {
|
||||
BdTradeWhiteConfigVO bdTradeWhiteConfigVO = BeanUtil.copyProperties(bdTradeWhiteConfigService.getById(pkId), BdTradeWhiteConfigVO.class);
|
||||
BdTradeWhiteConfigVO bdTradeWhiteConfigVO = BeanUtil.copyProperties(iBdTradeWhiteConfigService.getById(pkId), BdTradeWhiteConfigVO.class);
|
||||
CuMember cumember = iMemberServiceApi.getMember(bdTradeWhiteConfigVO.getPkMember()).getData();
|
||||
bdTradeWhiteConfigVO.setMemberCode(cumember.getMemberCode());
|
||||
return AjaxResult.success(bdTradeWhiteConfigVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取缓存健值
|
||||
*
|
||||
* @param pkId 主键ID
|
||||
* @return String
|
||||
*/
|
||||
private String deleteKet(Integer pkId) {
|
||||
BdTradeWhiteConfig tradeWhiteConfig = bdTradeWhiteConfigService.getById(pkId);
|
||||
Long pkMember = tradeWhiteConfig.getPkMember();
|
||||
Integer pkCountry = tradeWhiteConfig.getPkCountry();
|
||||
Integer withdrawalState = tradeWhiteConfig.getWithdrawalState();
|
||||
Integer transferState = tradeWhiteConfig.getTransferState();
|
||||
if (null != pkMember && null != withdrawalState) {
|
||||
String key = CacheConstants.TRADE_CONFIG_WHITE + ":" + pkCountry + EBusinessModule.WITHDRAWAL.getValue() + ":" + pkMember + withdrawalState;
|
||||
if (null != key) {
|
||||
redisService.deleteObjectByKey(key);
|
||||
}
|
||||
}
|
||||
if (null != pkMember && null != transferState) {
|
||||
String key = CacheConstants.TRADE_CONFIG_WHITE + ":" + pkCountry + EBusinessModule.TRANSFER_ACCOUNTS.getValue() + ":" + pkMember + transferState;
|
||||
if (null != key) {
|
||||
redisService.deleteObjectByKey(key);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 公共参数校验
|
||||
*
|
||||
|
@ -236,19 +188,15 @@ public class BdTradeWhiteConfigController extends BaseController {
|
|||
* @return AjaxResult
|
||||
*/
|
||||
private AjaxResult parametersVerify(BdTradeWhiteConfigVO tradeWhiteConfigVO, CuMember cumember) {
|
||||
|
||||
if (StringUtils.isEmpty(tradeWhiteConfigVO.getMemberCode())) {
|
||||
return AjaxResult.error(TransactionUtils.getContent(ConfigMsgConstants.MEMBER_CODE_NOT_EMPTY));
|
||||
}
|
||||
|
||||
if (null == cumember) {
|
||||
return AjaxResult.error(TransactionUtils.getContent(ConfigMsgConstants.MEMBER_NOT_EXIST));
|
||||
}
|
||||
|
||||
if (null == tradeWhiteConfigVO.getTransferState() && null == tradeWhiteConfigVO.getWithdrawalState()) {
|
||||
return AjaxResult.error(TransactionUtils.getContent(ConfigMsgConstants.WITHDRAWAL_NOT_EMPTY));
|
||||
}
|
||||
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package com.hzs.system.config.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.hzs.common.domain.system.config.BdTradeConfig;
|
||||
import com.hzs.system.config.vo.BdTradeConfigVO;
|
||||
|
@ -8,16 +7,10 @@ import com.hzs.system.config.vo.BdTradeConfigVO;
|
|||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 交易配置表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author hzs
|
||||
* @since 2023-08-18
|
||||
*/
|
||||
public interface BdTradeConfigMapper extends BaseMapper<BdTradeConfig> {
|
||||
|
||||
|
||||
/**
|
||||
* 查询交易配置列表
|
||||
*
|
||||
|
@ -26,7 +19,6 @@ public interface BdTradeConfigMapper extends BaseMapper<BdTradeConfig> {
|
|||
*/
|
||||
List<BdTradeConfig> selectTradeConfigList(BdTradeConfigVO tradeConfigVO);
|
||||
|
||||
|
||||
/**
|
||||
* 根据条件查询交易配置列表
|
||||
*
|
||||
|
@ -35,5 +27,4 @@ public interface BdTradeConfigMapper extends BaseMapper<BdTradeConfig> {
|
|||
*/
|
||||
BdTradeConfig selectTradeConfigByCondition(BdTradeConfigVO tradeConfigVO);
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package com.hzs.system.config.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.hzs.common.domain.system.config.BdTradeWhiteConfig;
|
||||
import com.hzs.common.domain.system.config.ext.BdTradeWhiteConfigExt;
|
||||
|
@ -9,12 +8,7 @@ import com.hzs.system.config.vo.BdTradeWhiteConfigVO;
|
|||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 交易白名单配置表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author hzs
|
||||
* @since 2023-08-18
|
||||
*/
|
||||
public interface BdTradeWhiteConfigMapper extends BaseMapper<BdTradeWhiteConfig> {
|
||||
|
||||
|
@ -28,7 +22,8 @@ public interface BdTradeWhiteConfigMapper extends BaseMapper<BdTradeWhiteConfig>
|
|||
|
||||
/**
|
||||
* 根据条件查询交易白名单配置
|
||||
* @param tradeWhiteConfigVO 入参
|
||||
*
|
||||
* @param tradeWhiteConfigVO 入参
|
||||
* @return List<Long>
|
||||
*/
|
||||
BdTradeWhiteConfig selectTradeWhiteConfigByCondition(BdTradeWhiteConfigVO tradeWhiteConfigVO);
|
||||
|
|
|
@ -16,40 +16,28 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
* @Author: ljc
|
||||
* @Time: 2023/8/21 15:10
|
||||
* @Classname: ITradeConfigServiceProvider
|
||||
* @Package_name: com.hzs.system.config.provider
|
||||
*/
|
||||
@DubboService
|
||||
public class ITradeConfigServiceProvider implements ITradeConfigServiceApi {
|
||||
@Autowired
|
||||
private IBdTradeConfigService bdTradeConfigService;
|
||||
|
||||
|
||||
@Autowired
|
||||
private IBdTradeWhiteConfigService bdTradeWhiteConfigService;
|
||||
|
||||
|
||||
private IBdTradeConfigService iBdTradeConfigService;
|
||||
@Autowired
|
||||
private ICuMemberTransferWhiteService cuMemberTransferWhiteService;
|
||||
private IBdTradeWhiteConfigService iBdTradeWhiteConfigService;
|
||||
@Autowired
|
||||
private ICuMemberTransferWhiteService iCuMemberTransferWhiteService;
|
||||
|
||||
@Override
|
||||
public R<BdTradeConfig> selectTradeConfigByCondition(TradeConfigDTO tradeConfigDTO) {
|
||||
return R.ok(bdTradeConfigService.selectTradeConfigByCondition(BeanUtil.copyProperties(tradeConfigDTO, BdTradeConfigVO.class)));
|
||||
return R.ok(iBdTradeConfigService.selectTradeConfigByCondition(BeanUtil.copyProperties(tradeConfigDTO, BdTradeConfigVO.class)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<BdTradeWhiteConfig> selectTradeWhiteConfigByCondition(TradeConfigDTO tradeConfigDTO) {
|
||||
return R.ok(bdTradeWhiteConfigService.selectTradeWhiteConfigByCondition(BeanUtil.copyProperties(tradeConfigDTO, BdTradeWhiteConfigVO.class)));
|
||||
return R.ok(iBdTradeWhiteConfigService.selectTradeWhiteConfigByCondition(BeanUtil.copyProperties(tradeConfigDTO, BdTradeWhiteConfigVO.class)));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
|
||||
public R<List<Integer>> selectTransferWhiteByPkMember(Long pkMember, Integer pkCountry) {
|
||||
return R.ok(cuMemberTransferWhiteService.selectTransferWhiteByPkMember(pkMember, pkCountry));
|
||||
return R.ok(iCuMemberTransferWhiteService.selectTransferWhiteByPkMember(pkMember, pkCountry));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,19 +1,11 @@
|
|||
package com.hzs.system.config.service;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.hzs.common.domain.system.config.BdTradeWhiteConfig;
|
||||
import com.hzs.system.config.vo.BdTradeWhiteConfigVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 交易白名单配置表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author hzs
|
||||
* @since 2023-08-18
|
||||
*/
|
||||
public interface IBdTradeWhiteConfigService extends IService<BdTradeWhiteConfig> {
|
||||
|
||||
|
|
|
@ -1,16 +1,10 @@
|
|||
package com.hzs.system.config.service.impl;
|
||||
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.hzs.common.core.constant.CacheConstants;
|
||||
import com.hzs.common.core.constant.SystemFieldConstants;
|
||||
import com.hzs.common.core.enums.EBusinessModule;
|
||||
import com.hzs.common.core.enums.EVerificationModule;
|
||||
import com.hzs.common.core.enums.EYesNo;
|
||||
import com.hzs.common.core.service.RedisService;
|
||||
import com.hzs.common.core.utils.StringUtils;
|
||||
import com.hzs.common.domain.system.config.BdAwards;
|
||||
import com.hzs.common.domain.system.config.BdGrade;
|
||||
|
@ -29,28 +23,18 @@ import java.util.*;
|
|||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 交易配置表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author hzs
|
||||
* @since 2023-08-18
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class BdTradeConfigServiceImpl extends ServiceImpl<BdTradeConfigMapper, BdTradeConfig> implements IBdTradeConfigService {
|
||||
|
||||
|
||||
@Autowired
|
||||
IBdAwardsService iBdAwardsService;
|
||||
|
||||
private IBdAwardsService iBdAwardsService;
|
||||
@Autowired
|
||||
IBdGradeService iBdGradeService;
|
||||
private IBdGradeService iBdGradeService;
|
||||
|
||||
|
||||
@Autowired
|
||||
private RedisService redisService;
|
||||
|
||||
@Override
|
||||
public Integer addTradeConfig(BdTradeConfigVO tradeConfigVO) {
|
||||
BdTradeConfig bdTradeConfig = conversionTradeConfig(tradeConfigVO);
|
||||
|
@ -58,7 +42,6 @@ public class BdTradeConfigServiceImpl extends ServiceImpl<BdTradeConfigMapper, B
|
|||
return baseMapper.insert(bdTradeConfig);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Integer updateTradeConfig(BdTradeConfigVO tradeConfigVO) {
|
||||
BdTradeConfig bdTradeConfig = conversionTradeConfig(tradeConfigVO);
|
||||
|
@ -86,11 +69,11 @@ public class BdTradeConfigServiceImpl extends ServiceImpl<BdTradeConfigMapper, B
|
|||
|
||||
@Override
|
||||
public Boolean deleteTradeConfig(Integer pkId, Long pkMember) {
|
||||
UpdateWrapper<BdTradeConfig> updateWrapper = new UpdateWrapper<>();
|
||||
updateWrapper.set(SystemFieldConstants.DEL_FLAG, EYesNo.NO.getIntValue());
|
||||
updateWrapper.set(SystemFieldConstants.PK_MODIFIED, pkMember);
|
||||
updateWrapper.set(SystemFieldConstants.MODIFIED_TIME, new Date());
|
||||
updateWrapper.eq(SystemFieldConstants.PK_ID, pkId);
|
||||
LambdaUpdateWrapper<BdTradeConfig> updateWrapper = new LambdaUpdateWrapper<>();
|
||||
updateWrapper.set(BdTradeConfig::getDelFlag, EYesNo.NO.getIntValue());
|
||||
updateWrapper.set(BdTradeConfig::getPkModified, pkMember);
|
||||
updateWrapper.set(BdTradeConfig::getModifiedTime, new Date());
|
||||
updateWrapper.eq(BdTradeConfig::getPkId, pkId);
|
||||
return update(updateWrapper);
|
||||
}
|
||||
|
||||
|
@ -117,7 +100,6 @@ public class BdTradeConfigServiceImpl extends ServiceImpl<BdTradeConfigMapper, B
|
|||
configVO.setGradeDetailList(gradeTransaction(pkGradeStr, gradeMap));
|
||||
configVOList.add(configVO);
|
||||
}
|
||||
|
||||
}
|
||||
return configVOList;
|
||||
}
|
||||
|
@ -191,54 +173,14 @@ public class BdTradeConfigServiceImpl extends ServiceImpl<BdTradeConfigMapper, B
|
|||
if (StringUtils.isNotEmpty(pkGradeStr)) {
|
||||
bdTradeConfigVO.setPkGradeList(Arrays.asList(pkGradeStr.split(",")).stream().map(Integer::valueOf).collect(Collectors.toList()));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return bdTradeConfigVO;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public BdTradeConfig selectTradeConfigByCondition(BdTradeConfigVO tradeConfigVO) {
|
||||
BdTradeConfig bdTradeConfig = null;
|
||||
String cacheKey = getCacheKey(tradeConfigVO);
|
||||
if (null != cacheKey) {
|
||||
bdTradeConfig = redisService.getCacheObject(cacheKey);
|
||||
if (null == bdTradeConfig) {
|
||||
bdTradeConfig = baseMapper.selectTradeConfigByCondition(tradeConfigVO);
|
||||
if (null != bdTradeConfig) {
|
||||
redisService.setCacheObject(cacheKey, bdTradeConfig);
|
||||
}
|
||||
}
|
||||
}
|
||||
return bdTradeConfig;
|
||||
|
||||
return baseMapper.selectTradeConfigByCondition(tradeConfigVO);
|
||||
}
|
||||
|
||||
|
||||
private String getCacheKey(BdTradeConfigVO tradeConfigVO) {
|
||||
Integer pkCountry = tradeConfigVO.getPkCountry();
|
||||
Integer businessModule = tradeConfigVO.getBusinessModule();
|
||||
Integer pkAwards = tradeConfigVO.getPkAwards();
|
||||
Integer pkGrade = tradeConfigVO.getPkGrade();
|
||||
Integer realNameState = tradeConfigVO.getRealNameState();
|
||||
Integer licenseState = tradeConfigVO.getLicenseState();
|
||||
//提现、转账、奖衔
|
||||
if (null != businessModule && null != pkAwards && null != realNameState) {
|
||||
return CacheConstants.TRADE_CONFIG + ":" + pkCountry + ":" + businessModule + pkAwards + EVerificationModule.REAL_NAME.getValue();
|
||||
}
|
||||
if (null != businessModule && null != pkAwards && null != licenseState) {
|
||||
return CacheConstants.TRADE_CONFIG + ":" + pkCountry + ":" + businessModule + pkAwards + EVerificationModule.BUSINESS_LICENSE.getValue();
|
||||
}
|
||||
|
||||
//提现等级
|
||||
if (null != businessModule && null != pkGrade && null != realNameState) {
|
||||
return CacheConstants.TRADE_CONFIG + ":" + pkCountry + ":" + businessModule + pkGrade + EVerificationModule.REAL_NAME.getValue();
|
||||
}
|
||||
if (null != businessModule && null != pkGrade && null != licenseState) {
|
||||
return CacheConstants.TRADE_CONFIG + ":" + pkCountry + ":" + businessModule + pkGrade + EVerificationModule.BUSINESS_LICENSE.getValue();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,25 +1,15 @@
|
|||
package com.hzs.system.config.service.impl;
|
||||
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.hzs.common.core.constant.CacheConstants;
|
||||
import com.hzs.common.core.constant.SystemFieldConstants;
|
||||
import com.hzs.common.core.enums.EBusinessModule;
|
||||
import com.hzs.common.core.enums.EYesNo;
|
||||
import com.hzs.common.core.service.RedisService;
|
||||
import com.hzs.common.domain.member.base.CuMember;
|
||||
import com.hzs.common.domain.system.config.BdTradeWhiteConfig;
|
||||
import com.hzs.common.domain.system.config.ext.BdTradeWhiteConfigExt;
|
||||
import com.hzs.member.base.IMemberServiceApi;
|
||||
import com.hzs.system.config.mapper.BdTradeWhiteConfigMapper;
|
||||
import com.hzs.system.config.service.IBdTradeWhiteConfigService;
|
||||
import com.hzs.system.config.vo.BdTradeWhiteConfigVO;
|
||||
import org.apache.dubbo.config.annotation.DubboReference;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
|
@ -29,30 +19,17 @@ import java.util.List;
|
|||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 交易白名单配置表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author hzs
|
||||
* @since 2023-08-18
|
||||
*/
|
||||
@Service
|
||||
public class BdTradeWhiteConfigServiceImpl extends ServiceImpl<BdTradeWhiteConfigMapper, BdTradeWhiteConfig> implements IBdTradeWhiteConfigService {
|
||||
|
||||
@DubboReference
|
||||
IMemberServiceApi iMemberServiceApi;
|
||||
|
||||
|
||||
@Autowired
|
||||
private RedisService redisService;
|
||||
|
||||
@Override
|
||||
public Integer addTradeWhiteConfig(BdTradeWhiteConfigVO tradeWhiteConfigVO) {
|
||||
BdTradeWhiteConfig bdTradeWhiteConfig = BeanUtil.copyProperties(tradeWhiteConfigVO, BdTradeWhiteConfig.class);
|
||||
return baseMapper.insert(bdTradeWhiteConfig);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Integer updateTradeWhiteConfig(BdTradeWhiteConfigVO tradeWhiteConfigVO) {
|
||||
BdTradeWhiteConfig bdTradeWhiteConfig = BeanUtil.copyProperties(tradeWhiteConfigVO, BdTradeWhiteConfig.class);
|
||||
|
@ -61,20 +38,19 @@ public class BdTradeWhiteConfigServiceImpl extends ServiceImpl<BdTradeWhiteConfi
|
|||
return baseMapper.updateById(bdTradeWhiteConfig);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean deleteTradeWhiteConfig(String pkId, Long pkCreator) {
|
||||
List<Integer> pkIdList = Arrays.stream(pkId.split(","))
|
||||
.map(Integer::parseInt)
|
||||
.collect(Collectors.toList());
|
||||
for(Integer id:pkIdList){
|
||||
UpdateWrapper<BdTradeWhiteConfig> updateWrapper = new UpdateWrapper<>();
|
||||
updateWrapper.set(SystemFieldConstants.DEL_FLAG, EYesNo.NO.getIntValue());
|
||||
updateWrapper.set(SystemFieldConstants.PK_MODIFIED, pkCreator);
|
||||
updateWrapper.set(SystemFieldConstants.MODIFIED_TIME, new Date());
|
||||
updateWrapper.eq(SystemFieldConstants.PK_ID, id);
|
||||
baseMapper.update(null,updateWrapper);
|
||||
for (Integer id : pkIdList) {
|
||||
LambdaUpdateWrapper<BdTradeWhiteConfig> updateWrapper = new LambdaUpdateWrapper<>();
|
||||
updateWrapper.set(BdTradeWhiteConfig::getDelFlag, EYesNo.NO.getIntValue());
|
||||
updateWrapper.set(BdTradeWhiteConfig::getPkModified, pkCreator);
|
||||
updateWrapper.set(BdTradeWhiteConfig::getModifiedTime, new Date());
|
||||
updateWrapper.eq(BdTradeWhiteConfig::getPkId, id);
|
||||
baseMapper.update(null, updateWrapper);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -91,40 +67,24 @@ public class BdTradeWhiteConfigServiceImpl extends ServiceImpl<BdTradeWhiteConfi
|
|||
public BdTradeWhiteConfig selectTradeWhiteConfigByCondition(BdTradeWhiteConfigVO tradeWhiteConfigVO) {
|
||||
BdTradeWhiteConfig tradeWhiteConfig = null;
|
||||
Long pkMember = tradeWhiteConfigVO.getPkMember();
|
||||
Integer pkCountry = tradeWhiteConfigVO.getPkCountry();
|
||||
Integer withdrawalState = tradeWhiteConfigVO.getWithdrawalState();
|
||||
Integer transferState = tradeWhiteConfigVO.getTransferState();
|
||||
//提现
|
||||
if (null != pkMember && null != withdrawalState) {
|
||||
String withdrawalKey = CacheConstants.TRADE_CONFIG_WHITE + ":" + pkCountry + EBusinessModule.WITHDRAWAL.getValue() + ":" + pkMember + withdrawalState;
|
||||
tradeWhiteConfig = redisService.getCacheObject(withdrawalKey);
|
||||
if (null == tradeWhiteConfig) {
|
||||
tradeWhiteConfig = baseMapper.selectTradeWhiteConfigByCondition(tradeWhiteConfigVO);
|
||||
if (null != tradeWhiteConfig) {
|
||||
redisService.setCacheObject(withdrawalKey, tradeWhiteConfig);
|
||||
}
|
||||
}
|
||||
tradeWhiteConfig = baseMapper.selectTradeWhiteConfigByCondition(tradeWhiteConfigVO);
|
||||
}
|
||||
//转账
|
||||
if (null != pkMember && null != transferState) {
|
||||
String transferKey = CacheConstants.TRADE_CONFIG_WHITE + ":" + pkCountry + EBusinessModule.TRANSFER_ACCOUNTS.getValue() + ":" + pkMember + transferState;
|
||||
tradeWhiteConfig = redisService.getCacheObject(transferKey);
|
||||
if (null == tradeWhiteConfig) {
|
||||
tradeWhiteConfig = baseMapper.selectTradeWhiteConfigByCondition(tradeWhiteConfigVO);
|
||||
if (null != tradeWhiteConfig) {
|
||||
redisService.setCacheObject(transferKey, tradeWhiteConfig);
|
||||
}
|
||||
}
|
||||
tradeWhiteConfig = baseMapper.selectTradeWhiteConfigByCondition(tradeWhiteConfigVO);
|
||||
}
|
||||
return tradeWhiteConfig;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BdTradeWhiteConfig selectTradeWhiteConfigByPkMember(Long pkMember) {
|
||||
QueryWrapper<BdTradeWhiteConfig> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("PK_MEMBER", pkMember);
|
||||
LambdaQueryWrapper<BdTradeWhiteConfig> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(BdTradeWhiteConfig::getPkMember, pkMember);
|
||||
return this.getOne(queryWrapper);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -13,12 +13,6 @@ import java.util.List;
|
|||
|
||||
/**
|
||||
* 交易配置
|
||||
*
|
||||
* @Description:
|
||||
* @Author: ljc
|
||||
* @Time: 2023/8/18 11:14
|
||||
* @Classname: BdTradeConfigVO
|
||||
* @Package_name: com.hzs.system.config.vo
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
|
|
|
@ -2402,7 +2402,7 @@ public class EnumsController extends BaseController {
|
|||
public AjaxResult businessModule() {
|
||||
List<EnumEntity> enumEntityList = new ArrayList<>();
|
||||
for (EBusinessModule value : EBusinessModule.values()) {
|
||||
enumEntityList.add(new EnumEntity(value.getValue(), value.getLabel(), EnumsPrefixConstants.BUSINESS_MODULE));
|
||||
enumEntityList.add(new EnumEntity(value.getValue(), value.getLabel()));
|
||||
}
|
||||
return AjaxResult.success(enumEntityList);
|
||||
}
|
||||
|
|
|
@ -584,11 +584,6 @@ public class EnumsInitController {
|
|||
initList.add(this.createData(value.getKey(), value.getLabel()));
|
||||
}
|
||||
|
||||
// 交易配置 业务类型
|
||||
for (EBusinessModule value : EBusinessModule.values()) {
|
||||
initList.add(this.createData(value.getKey(), value.getLabel()));
|
||||
}
|
||||
|
||||
// 点位状态
|
||||
for (EPointStatus value : EPointStatus.values()) {
|
||||
initList.add(this.createData(value.getKey(), value.getLabel()));
|
||||
|
|
|
@ -18,18 +18,6 @@
|
|||
<result column="LICENSE_STATE" property="licenseState"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
DEL_FLAG,
|
||||
CREATION_TIME,
|
||||
MODIFIED_TIME,
|
||||
PK_COUNTRY,
|
||||
PK_CREATOR,
|
||||
PK_MODIFIED,
|
||||
PK_ID, PK_GRADE, PK_AWARDS, BUSINESS_MODULE, REAL_NAME_STATE, LICENSE_STATE
|
||||
</sql>
|
||||
|
||||
|
||||
<select id="selectTradeConfigList" resultMap="BaseResultMap">
|
||||
select * from BD_TRADE_CONFIG c where c.del_flag = 0
|
||||
and c.pk_country= #{pkCountry}
|
||||
|
@ -60,23 +48,23 @@
|
|||
from (select *
|
||||
from BD_TRADE_CONFIG c
|
||||
where c.del_flag = 0
|
||||
and c.pk_country= #{pkCountry}
|
||||
<if test="pkGrade != null and pkGrade != ''">
|
||||
and instr(',' || c.PK_GRADE || ',', ',' || #{pkGrade} || ',') > 0
|
||||
</if>
|
||||
<if test="pkAwards != null and pkAwards != ''">
|
||||
and instr(',' || c.PK_AWARDS || ',', ',' || #{pkAwards} || ',') > 0
|
||||
</if>
|
||||
<if test="realNameState != null">
|
||||
and c.REAL_NAME_STATE = #{realNameState}
|
||||
</if>
|
||||
<if test="licenseState != null">
|
||||
and c.LICENSE_STATE = #{licenseState}
|
||||
</if>
|
||||
<if test="businessModule != null">
|
||||
and c.BUSINESS_MODULE = #{businessModule}
|
||||
</if>
|
||||
order by c.creation_time desc) t
|
||||
and c.pk_country= #{pkCountry}
|
||||
<if test="pkGrade != null and pkGrade != ''">
|
||||
and instr(',' || c.PK_GRADE || ',', ',' || #{pkGrade} || ',') > 0
|
||||
</if>
|
||||
<if test="pkAwards != null and pkAwards != ''">
|
||||
and instr(',' || c.PK_AWARDS || ',', ',' || #{pkAwards} || ',') > 0
|
||||
</if>
|
||||
<if test="realNameState != null">
|
||||
and c.REAL_NAME_STATE = #{realNameState}
|
||||
</if>
|
||||
<if test="licenseState != null">
|
||||
and c.LICENSE_STATE = #{licenseState}
|
||||
</if>
|
||||
<if test="businessModule != null">
|
||||
and c.BUSINESS_MODULE = #{businessModule}
|
||||
</if>
|
||||
order by c.creation_time desc) t
|
||||
where rownum = 1
|
||||
</select>
|
||||
|
||||
|
|
|
@ -16,26 +16,15 @@
|
|||
<result column="TRANSFER_STATE" property="transferState"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
DEL_FLAG,
|
||||
CREATION_TIME,
|
||||
MODIFIED_TIME,
|
||||
PK_COUNTRY,
|
||||
PK_CREATOR,
|
||||
PK_MODIFIED,
|
||||
PK_ID, PK_MEMBER, WITHDRAWAL_STATE, TRANSFER_STATE
|
||||
</sql>
|
||||
|
||||
|
||||
<select id="selectTradeWhiteConfigList" resultType="com.hzs.common.domain.system.config.ext.BdTradeWhiteConfigExt">
|
||||
select c.pk_id pkId,
|
||||
c.pk_member pkMember,
|
||||
m.member_code memberCode,
|
||||
select c.pk_id pkId,
|
||||
c.pk_member pkMember,
|
||||
m.member_code memberCode,
|
||||
m.member_name as memberName,
|
||||
c.withdrawal_state withdrawalState,
|
||||
c.transfer_state transferState,
|
||||
c.creation_time creationTime,
|
||||
c.transfer_state transferState,
|
||||
c.creation_time creationTime,
|
||||
awa.PK_TRANSACTION pkAwards,
|
||||
ver.VERTEX_NAME as vertexName,
|
||||
ct.TEAM_NAME as teamName
|
||||
|
@ -64,11 +53,9 @@
|
|||
<if test="memberName != null and memberName != ''">
|
||||
and m.member_name like #{memberName} || '%'
|
||||
</if>
|
||||
|
||||
<if test="vertexId != null">
|
||||
and m.PK_VERTEX=#{vertexId}
|
||||
</if>
|
||||
|
||||
<if test="teamId != null">
|
||||
and m.pk_team_code=#{teamId}
|
||||
</if>
|
||||
|
@ -84,21 +71,21 @@
|
|||
|
||||
<select id="selectTradeWhiteConfigByCondition" resultMap="BaseResultMap">
|
||||
select t.*
|
||||
from (select c.*
|
||||
from bd_trade_white_config c
|
||||
where c.del_flag = 0
|
||||
and c.pk_country = #{pkCountry}
|
||||
<if test="pkMember != null">
|
||||
and c.PK_MEMBER = #{pkMember}
|
||||
</if>
|
||||
<if test="withdrawalState != null">
|
||||
and c.WITHDRAWAL_STATE = #{withdrawalState}
|
||||
</if>
|
||||
<if test="transferState != null">
|
||||
and c.TRANSFER_STATE = #{transferState}
|
||||
</if>
|
||||
order by c.creation_time desc) t
|
||||
where rownum = 1
|
||||
from (select c.*
|
||||
from bd_trade_white_config c
|
||||
where c.del_flag = 0
|
||||
and c.pk_country = #{pkCountry}
|
||||
<if test="pkMember != null">
|
||||
and c.PK_MEMBER = #{pkMember}
|
||||
</if>
|
||||
<if test="withdrawalState != null">
|
||||
and c.WITHDRAWAL_STATE = #{withdrawalState}
|
||||
</if>
|
||||
<if test="transferState != null">
|
||||
and c.TRANSFER_STATE = #{transferState}
|
||||
</if>
|
||||
order by c.creation_time desc) t
|
||||
where rownum = 1
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
|
|
@ -174,7 +174,6 @@ public class CacheConstants {
|
|||
*/
|
||||
public static final String BD_WITHDRAWAL_PROCESS = CACHE_PREFIX + "withdrawalProcess:";
|
||||
|
||||
|
||||
/**
|
||||
* 自动提现明细配置
|
||||
*/
|
||||
|
@ -289,19 +288,6 @@ public class CacheConstants {
|
|||
*/
|
||||
public final static String MEMBER_DEFAULT_DISPLAY = CACHE_PREFIX + "member:display:";
|
||||
|
||||
|
||||
/**
|
||||
* 交易配置
|
||||
*/
|
||||
public final static String TRADE_CONFIG = CACHE_PREFIX + "trade:config";
|
||||
|
||||
|
||||
/**
|
||||
* 交易白名单配置
|
||||
*/
|
||||
public final static String TRADE_CONFIG_WHITE = CACHE_PREFIX + "trade:config:white";
|
||||
|
||||
|
||||
/**
|
||||
* 后台管理员,数据访问权限缓存key
|
||||
*/
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package com.hzs.common.core.enums;
|
||||
|
||||
import com.hzs.common.core.constant.EnumsPrefixConstants;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
|
@ -14,11 +13,11 @@ public enum EBusinessModule {
|
|||
/**
|
||||
* 1=提现
|
||||
*/
|
||||
WITHDRAWAL(1, "提现", 0, EnumsPrefixConstants.BUSINESS_MODULE + "1"),
|
||||
WITHDRAWAL(1, "提现", 0),
|
||||
/**
|
||||
* 2=转账
|
||||
*/
|
||||
TRANSFER_ACCOUNTS(2, "转账", 0, EnumsPrefixConstants.BUSINESS_MODULE + "2"),
|
||||
TRANSFER_ACCOUNTS(2, "转账", 0),
|
||||
|
||||
;
|
||||
|
||||
|
@ -34,9 +33,5 @@ public enum EBusinessModule {
|
|||
* 是否启用(0=是,1=否) -- 来源EYesNo
|
||||
*/
|
||||
private final int enable;
|
||||
/**
|
||||
* 国际化翻译key值
|
||||
*/
|
||||
private final String key;
|
||||
|
||||
}
|
||||
|
|
|
@ -4,11 +4,7 @@ import lombok.AllArgsConstructor;
|
|||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* @Description: 服务协议状态枚举
|
||||
* @Author: jiang chao
|
||||
* @Time: 2023/12/19 16:00
|
||||
* @Classname: EServiceStatus
|
||||
* @PackageName: com.hzs.common.core.enums
|
||||
* 服务协议状态枚举
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
|
|
|
@ -10,12 +10,7 @@ import lombok.EqualsAndHashCode;
|
|||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 交易配置表
|
||||
* </p>
|
||||
*
|
||||
* @author hzs
|
||||
* @since 2023-08-18
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
|
|
|
@ -10,12 +10,7 @@ import lombok.EqualsAndHashCode;
|
|||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 交易白名单配置表
|
||||
* </p>
|
||||
*
|
||||
* @author hzs
|
||||
* @since 2023-08-18
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
|
|
|
@ -9,14 +9,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||
|
||||
/**
|
||||
* 身份证接口
|
||||
*
|
||||
* @Description:
|
||||
* @Author: ljc
|
||||
* @Time: 2023/11/23 18:02
|
||||
* @Classname: IdCardProvider
|
||||
* @Package_name: com.hzs.third.idcard.provider
|
||||
*/
|
||||
|
||||
@DubboService
|
||||
public class IdCardProvider implements IdCardServiceApi {
|
||||
|
||||
|
@ -24,7 +17,7 @@ public class IdCardProvider implements IdCardServiceApi {
|
|||
private IdCardService idCardService;
|
||||
|
||||
@Override
|
||||
public R<IdCardOcrDTO> invokeIdCardOcr(String idCardUrl,int side) {
|
||||
return idCardService.invokeIdCardOcr(idCardUrl,side);
|
||||
public R<IdCardOcrDTO> invokeIdCardOcr(String idCardUrl, int side) {
|
||||
return idCardService.invokeIdCardOcr(idCardUrl, side);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,20 +5,16 @@ import com.hzs.third.idcard.dto.IdCardOcrDTO;
|
|||
|
||||
/**
|
||||
* 身份证接口
|
||||
*
|
||||
* @Description:
|
||||
* @Author: ljc
|
||||
* @Time: 2023/11/23 14:20
|
||||
* @Classname: IdCardService
|
||||
* @Package_name: com.hzs.third.idcard.service
|
||||
*/
|
||||
public interface IdCardService {
|
||||
|
||||
/**
|
||||
* 调用身份证OCR接口
|
||||
*
|
||||
* @param idCardUrl 身份证照片地址
|
||||
* @param side 身份证的正反面,详见枚举EIdCardSide
|
||||
* @param side 身份证的正反面,详见枚举EIdCardSide
|
||||
* @return R
|
||||
*/
|
||||
R<IdCardOcrDTO> invokeIdCardOcr(String idCardUrl,int side);
|
||||
R<IdCardOcrDTO> invokeIdCardOcr(String idCardUrl, int side);
|
||||
|
||||
}
|
||||
|
|
|
@ -23,38 +23,29 @@ import java.util.Map;
|
|||
|
||||
/**
|
||||
* 身份证接口
|
||||
*
|
||||
* @Description:
|
||||
* @Author: ljc
|
||||
* @Time: 2023/11/23 14:20
|
||||
* @Classname: IdCardServiceImpl
|
||||
* @Package_name: com.hzs.third.idcard.service.impl
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class IdCardServiceImpl implements IdCardService {
|
||||
|
||||
|
||||
@Value("${idCardOcr.url}")
|
||||
private String url;
|
||||
|
||||
@Value("${idCardOcr.appCode}")
|
||||
private String appCode;
|
||||
|
||||
|
||||
@Override
|
||||
public R<IdCardOcrDTO> invokeIdCardOcr(String idCardUrl, int side) {
|
||||
String authorization = "APPCODE " + appCode;
|
||||
HttpResponse response = HttpRequest.post(url)
|
||||
.header(Header.AUTHORIZATION, authorization)
|
||||
.header(Header.CONTENT_TYPE, "aapplication/json; charset=UTF-8")
|
||||
.header(Header.CONTENT_TYPE, "application/json; charset=UTF-8")
|
||||
.body(getInParam(idCardUrl, side))
|
||||
.timeout(20000)
|
||||
.timeout(10000)
|
||||
.execute();
|
||||
return parseResult(response, side);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 解析返回的结果集
|
||||
*
|
||||
|
@ -85,7 +76,6 @@ public class IdCardServiceImpl implements IdCardService {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取身份证的正面信息
|
||||
*
|
||||
|
@ -131,17 +121,15 @@ public class IdCardServiceImpl implements IdCardService {
|
|||
JsonObject param = new JsonObject();
|
||||
param.addProperty("image", idCardUrl);
|
||||
param.addProperty("configure", jsonObject.toString());
|
||||
System.out.println(param.toString());
|
||||
return param.toString();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 错误信息
|
||||
*
|
||||
* @return Map
|
||||
*/
|
||||
private Map getErrorMessage() {
|
||||
private Map<Integer, String> getErrorMessage() {
|
||||
Map<Integer, String> message = new HashMap<>();
|
||||
message.put(403, "购买次数用尽,或者URL错误");
|
||||
message.put(408, "超时");
|
||||
|
|
Loading…
Reference in New Issue