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