## 提现走绑定银行卡逻辑;银行卡添加4要素认证;

This commit is contained in:
cabbage 2025-09-04 14:54:42 +08:00
parent 5ae87bebb0
commit e864c21872
50 changed files with 487 additions and 1489 deletions

View File

@ -1,25 +0,0 @@
package com.hzs.system.config;
import com.hzs.common.core.domain.R;
import com.hzs.common.domain.system.config.BdWithdrawalAuto;
import java.util.List;
/**
* @description: 根据国家查询自动提现明细api
* @author: zhang jing
* @date: 2022/9/27 15:15
* @param:
* @return:
**/
public interface IWithdrawalAutoServiceApi {
/**
* @description:根据国家查询自动提现明细列表
* @author: zhang jing
* @date: 2022/9/27 15:20
* @param: [pkCountry]
* @return: com.hzs.common.core.domain.R<java.util.List<com.hzs.common.domain.system.config.BdWithdrawalAuto>>
**/
R<List<BdWithdrawalAuto>> queryWithdrawalAuto(Integer pkCountry);
}

View File

@ -1,34 +0,0 @@
package com.hzs.system.config;
import com.hzs.common.core.domain.R;
import com.hzs.common.domain.system.config.BdWithdrawalSpecial;
import java.util.List;
/**
* @description: 提现设置特殊配置api
* @author: zhang jing
* @date: 2022/9/27 15:14
* @param:
* @return:
**/
public interface IWithdrawalSpecialServiceApi {
/**
* @description: 根据国家查询提现设置特殊配置列表
* @author: zhang jing
* @date: 2022/9/27 16:24
* @param: [pkCountry]
* @return: com.hzs.common.core.domain.R<java.util.List<com.hzs.common.domain.system.config.BdWithdrawalSpecial>>
**/
R<List<BdWithdrawalSpecial>> queryWithdrawalSpecial(Integer pkCountry);
/**
* @description: 根据国家会员编号查询提现设置特殊配置
* @author: zhang jing
* @date: 2022/9/27 16:27
* @param: [pkCountry, memberCode]
* @return: com.hzs.common.core.domain.R<com.hzs.common.domain.system.config.BdWithdrawalSpecial>
**/
R<BdWithdrawalSpecial> getWithdrawalSpecial(Integer pkCountry,String memberCode);
}

View File

@ -5,12 +5,6 @@ import com.hzs.third.bankcard.dto.BankCardParam;
/**
* 银行卡四要素认证
*
* @Description:
* @Author: ljc
* @Time: 2023/2/9 14:04
* @Classname: BankCardService
* @Package_name: com.hzs.third.bankCard
*/
public interface IBankCardServiceApi {

View File

@ -9,12 +9,6 @@ import java.io.Serializable;
/**
* 银行卡校验参数
*
* @Description:
* @Author: ljc
* @Time: 2022/11/24 18:19
* @Classname: BankCardVO
* @Package_name: com.hz.bankCard.vo
*/
@Data
@Builder
@ -33,7 +27,6 @@ public class BankCardParam implements Serializable {
* 身份证号
*/
private String idCard;
/**
* 手机号
*/

View File

@ -2,21 +2,14 @@ package com.hzs.member.account.controller.api;
import cn.hutool.core.collection.CollUtil;
import com.hzs.common.core.annotation.RepeatSubmitSimple;
import com.hzs.common.core.constant.CountryConstants;
import com.hzs.common.core.constant.msg.FinanceMsgConstants;
import com.hzs.common.core.domain.R;
import com.hzs.common.core.enums.EBusinessModule;
import com.hzs.common.core.enums.EYesNo;
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.member.account.CuMemberBank;
import com.hzs.common.domain.system.config.BdTradeWhiteConfig;
import com.hzs.common.security.utils.SecurityUtils;
import com.hzs.common.util.TransactionUtils;
import com.hzs.member.account.dto.CuMemberBankParam;
import com.hzs.member.account.service.ICuMemberBankService;
import com.hzs.member.account.service.ICuMemberBaseService;
import com.hzs.member.account.service.ICuMemberWithdrawService;
import com.hzs.member.account.vo.CuMemberBankVO;
import com.hzs.member.sms.service.IApiAliSmsService;
@ -41,117 +34,14 @@ public class ApiCuMemberBankController extends BaseController {
@Autowired
private IApiAliSmsService iApiAliSmsService;
@Autowired
private ICuMemberBaseService iCuMemberBaseService;
@Autowired
private ICuMemberWithdrawService iCuMemberWithdrawService;
@DubboReference
IBankCardServiceApi iBankCardServiceApi;
/**
* 是否绑定银行卡
*
* @return AjaxResult
* 银行卡列表
*/
@GetMapping("/is-bind")
public AjaxResult isBindBank() {
Long pkMember = SecurityUtils.getUserId();
Integer pkCountry = SecurityUtils.getPkCountry();
CuMemberBankVO cuMemberBank = iCuMemberBankService.isBindBank(pkMember, pkCountry);
String flag = null == cuMemberBank.getDefaultCard() ? EYesNo.NO.getValue() : EYesNo.YES.getValue();
return AjaxResult.success().put("flag", flag);
}
/**
* 解绑银行卡
*
* @return AjaxResult
*/
@GetMapping("/unbind-bank")
public AjaxResult unbindBank(Long pkId) {
Assert.notNull(pkId, TransactionUtils.getContent(FinanceMsgConstants.BANK_CARD_CANNOT_EMPTY));
Integer pkCountry = SecurityUtils.getPkCountry();
Long pkMember = SecurityUtils.getUserId();
//查询默认银行卡
CuMemberBankVO cuMemberBankVO = iCuMemberBankService.selectCuMemberBankById(pkId);
//解绑默认银行卡需校验是否有进行的提现
if (null != cuMemberBankVO) {
List<Long> pkIds = iCuMemberWithdrawService.selectWithdrawMember(pkCountry, pkMember);
if (CollUtil.isNotEmpty(pkIds)) {
return AjaxResult.error(TransactionUtils.getContent(FinanceMsgConstants.WITHDRAWAL_APPROVAL));
}
}
return AjaxResult.success(iCuMemberBankService.unbindBank(pkId, pkMember));
}
/**
* 校验开户名
*
* @param accountName 开户名
* @return AjaxResult
*/
@GetMapping("/check-account-name")
public AjaxResult checkAccountName(String accountName) {
Assert.notNull(accountName, TransactionUtils.getContent(FinanceMsgConstants.ACCOUNT_NAME_CANNOT_EMPTY));
String memberCode = SecurityUtils.getMemberCode();
String flag = memberCode.equals(accountName) ? EYesNo.YES.getValue() : EYesNo.NO.getValue();
return AjaxResult.success().put("flag", flag);
}
/**
* 银行卡四要素验证
*
* @param memberBankParam 银行卡信息
* @return AjaxResult
*/
@PostMapping("/verify-bank-card")
public AjaxResult verifyBankCard(@RequestBody CuMemberBankParam memberBankParam) {
BankCardParam bankCard = BankCardParam.builder().name(memberBankParam.getAccountName())
.idCard(memberBankParam.getIdCard()).mobile(memberBankParam.getPhone())
.bankCard(StringUtils.deleteWhitespace(memberBankParam.getCardNumber())).build();
R<?> result = iBankCardServiceApi.verifyBankCard(bankCard);
return result.isSuccess() ? AjaxResult.success() : AjaxResult.error(result.getMsg());
}
/**
* 绑定银行卡
*
* @param cuMemberBankParam 银行卡入参
* @return AjaxResult
*/
@PostMapping("/add")
@RepeatSubmitSimple
public AjaxResult addBankInfo(@RequestBody CuMemberBankParam cuMemberBankParam) {
Integer pkCountry = SecurityUtils.getPkCountry();
Long pkMember = SecurityUtils.getUserId();
//是否配置提现白名单
String configWhite = getConfigWhite(pkCountry, pkMember);
// 海外不校验验证码四要素 国内配置了提现白名单不校验
if (pkCountry.equals(CountryConstants.CHINA_COUNTRY) && configWhite.equals(EYesNo.NO.getValue())) {
String verificationCode = cuMemberBankParam.getVerificationCode();
if (StringUtils.isEmpty(verificationCode)) {
return AjaxResult.error(TransactionUtils.getContent(FinanceMsgConstants.VERIFICATION_CODE_CANNOT_EMPTY));
}
//支行名称
String subBankName = cuMemberBankParam.getSubBankName();
if (StringUtils.isEmpty(subBankName)) {
return AjaxResult.error(TransactionUtils.getContent(FinanceMsgConstants.OPENING_BRANCH_CANNOT_EMPTY));
}
// 校验短信验证码
String message = iApiAliSmsService.checkCode(null, verificationCode, null, pkMember);
if (null != message) {
return AjaxResult.error(message);
}
//银行卡号去空格
String cardNumber = cuMemberBankParam.getCardNumber();
cuMemberBankParam.setCardNumber(StringUtils.deleteWhitespace(cardNumber));
}
cuMemberBankParam.setPkCountry(pkCountry);
cuMemberBankParam.setPkMember(pkMember);
return toAjax(iCuMemberBankService.saveMemberBank(cuMemberBankParam));
}
@GetMapping("/list")
public AjaxResult getBankCardList() {
Long pkMember = SecurityUtils.getUserId();
@ -159,6 +49,120 @@ public class ApiCuMemberBankController extends BaseController {
return AjaxResult.success(iCuMemberBankService.selectBankCardByPkMember(pkMember, pkCountry));
}
/**
* 银行卡四要素验证
*/
@PostMapping("/verify-bank-card")
public AjaxResult verifyBankCard(@RequestBody CuMemberBankParam memberBankParam) {
if (StringUtils.isEmpty(memberBankParam.getCardNumber())) {
return AjaxResult.error("银行卡号不能为空!");
}
if (StringUtils.isEmpty(memberBankParam.getIdCard())) {
return AjaxResult.error("身份证号码不能为空!");
}
if (StringUtils.isEmpty(memberBankParam.getAccountName())) {
return AjaxResult.error("开户姓名不能为空!");
}
if (StringUtils.isEmpty(memberBankParam.getPhone())) {
return AjaxResult.error("手机号不能为空!");
}
BankCardParam bankCard = BankCardParam.builder()
.name(memberBankParam.getAccountName())
.idCard(memberBankParam.getIdCard())
.mobile(memberBankParam.getPhone())
.bankCard(StringUtils.deleteWhitespace(memberBankParam.getCardNumber()))
.build();
R<?> result = iBankCardServiceApi.verifyBankCard(bankCard);
return result.isSuccess() ? AjaxResult.success() : AjaxResult.error(result.getMsg());
}
/**
* 绑定银行卡
*/
@RepeatSubmitSimple
@PostMapping("/add")
public AjaxResult addBankInfo(@RequestBody CuMemberBankParam cuMemberBankParam) {
Integer pkCountry = SecurityUtils.getPkCountry();
Long pkMember = SecurityUtils.getUserId();
if (null == cuMemberBankParam.getPkBank()) {
return AjaxResult.error("银行名称不能为空");
}
if (StringUtils.isEmpty(cuMemberBankParam.getSubBankName())) {
return AjaxResult.error("开户支行不能为空");
}
if (StringUtils.isEmpty(cuMemberBankParam.getCardNumber())) {
return AjaxResult.error("银行卡号不能为空!");
}
if (StringUtils.isEmpty(cuMemberBankParam.getAccountName())) {
return AjaxResult.error("开户姓名不能为空!");
}
if (StringUtils.isEmpty(cuMemberBankParam.getIdCard())) {
return AjaxResult.error("证件号码不能为空!");
}
if (StringUtils.isEmpty(cuMemberBankParam.getPhone())) {
return AjaxResult.error("联系方式不能为空!");
}
String verificationCode = cuMemberBankParam.getVerificationCode();
if (StringUtils.isEmpty(verificationCode)) {
return AjaxResult.error("验证码不能为空!");
}
String message = iApiAliSmsService.checkCode(cuMemberBankParam.getPhone(), verificationCode, null, pkMember);
if (null != message) {
return AjaxResult.error(message);
}
// 银行卡号去空格
String cardNumber = cuMemberBankParam.getCardNumber();
cuMemberBankParam.setCardNumber(StringUtils.deleteWhitespace(cardNumber));
cuMemberBankParam.setPkCountry(pkCountry);
cuMemberBankParam.setPkMember(pkMember);
return toAjax(iCuMemberBankService.saveMemberBank(cuMemberBankParam));
}
/**
* 解绑银行卡
*/
@GetMapping("/unbind-bank")
public AjaxResult unbindBank(Long pkId) {
Assert.notNull(pkId, "银行卡号不能为空!");
Integer pkCountry = SecurityUtils.getPkCountry();
Long pkMember = SecurityUtils.getUserId();
// 查询默认银行卡
CuMemberBankVO cuMemberBankVO = iCuMemberBankService.selectCuMemberBankById(pkId);
// 解绑默认银行卡需校验是否有进行的提现
if (null != cuMemberBankVO) {
List<Long> pkIds = iCuMemberWithdrawService.selectWithdrawMember(pkCountry, pkMember);
if (CollUtil.isNotEmpty(pkIds)) {
return AjaxResult.error("提现正在审批中,请稍后再试");
}
}
return AjaxResult.success(iCuMemberBankService.unbindBank(pkId, pkMember));
}
/**
* 修改默认银行卡
*/
@GetMapping("/update-default")
public AjaxResult updateDefault(Long pkId) {
Long pkMember = SecurityUtils.getUserId();
Integer pkCountry = SecurityUtils.getPkCountry();
// 查询银行卡
CuMemberBank cuMemberBank = iCuMemberBankService.getById(pkId);
// 解绑默认银行卡需校验是否有进行的提现
if (null != cuMemberBank) {
List<Long> pkIds = iCuMemberWithdrawService.selectWithdrawMember(pkCountry, pkMember);
if (CollUtil.isNotEmpty(pkIds)) {
return AjaxResult.error("提现正在审批中,请稍后再试");
}
}
return toAjax(iCuMemberBankService.updateDefault(pkId, pkMember, pkCountry));
}
/**
* 默认银行卡
*/
@GetMapping("/default-bank")
public AjaxResult getDefaultBankCard() {
Long pkMember = SecurityUtils.getUserId();
@ -166,49 +170,4 @@ public class ApiCuMemberBankController extends BaseController {
return AjaxResult.success(iCuMemberBankService.isBindBank(pkMember, pkCountry));
}
/**
* 修改默认银行卡
*
* @param pkId ID
* @return AjaxResult
*/
@GetMapping("/update-default")
public AjaxResult updateDefault(Long pkId) {
Long pkMember = SecurityUtils.getUserId();
Integer pkCountry = SecurityUtils.getPkCountry();
//查询银行卡
CuMemberBank cuMemberBank = iCuMemberBankService.getById(pkId);
//解绑默认银行卡需校验是否有进行的提现
if (null != cuMemberBank) {
List<Long> pkIds = iCuMemberWithdrawService.selectWithdrawMember(pkCountry, pkMember);
if (CollUtil.isNotEmpty(pkIds)) {
return AjaxResult.error(TransactionUtils.getContent(FinanceMsgConstants.WITHDRAWAL_APPROVAL));
}
}
return toAjax(iCuMemberBankService.updateDefault(pkId, pkMember, pkCountry));
}
/**
* 查询是否设置提现白名单
*
* @return AjaxResult
*/
@GetMapping("/is-white-list")
public AjaxResult isWhiteList() {
String flag = getConfigWhite(SecurityUtils.getPkCountry(), SecurityUtils.getUserId());
return AjaxResult.success().put("flag", flag);
}
/**
* 查询提现白名单配置
*
* @param pkCountry 国家ID
* @param pkMember 会员ID
* @return String
*/
private String getConfigWhite(Integer pkCountry, Long pkMember) {
BdTradeWhiteConfig bdTradeWhiteConfig = iCuMemberBaseService.selectConfigWhite(pkMember, pkCountry, EBusinessModule.WITHDRAWAL.getValue());
return null == bdTradeWhiteConfig ? EYesNo.NO.getValue() : EYesNo.YES.getValue();
}
}

View File

@ -2,7 +2,6 @@ package com.hzs.member.account.controller.api;
import cn.hutool.core.collection.CollUtil;
import com.hzs.common.core.annotation.RepeatSubmitSimple;
import com.hzs.common.core.constant.CountryConstants;
import com.hzs.common.core.constant.MagicNumberConstants;
import com.hzs.common.core.constant.MemberFieldConstants;
import com.hzs.common.core.constant.msg.FinanceMsgConstants;
@ -25,6 +24,7 @@ import com.hzs.member.account.service.ICuMemberAccountService;
import com.hzs.member.account.service.ICuMemberBankService;
import com.hzs.member.account.service.ICuMemberBaseService;
import com.hzs.member.account.service.ICuMemberWithdrawService;
import com.hzs.member.account.vo.CuMemberBankVO;
import com.hzs.member.account.vo.CuMemberWithdrawVO;
import com.hzs.member.account.vo.CuMemberWithdrawalAddVO;
import com.hzs.member.base.service.ICuMemberService;
@ -64,23 +64,21 @@ public class ApiCuMemberWithdrawController extends BaseController {
/**
* 提现时展示信息
*
* @return AjaxResult
*/
@GetMapping("/show/add")
public AjaxResult showAddWithdrawInfo(Integer pkAccount, BigDecimal cashAmount) {
Integer pkCountry = SecurityUtils.getPkCountry();
Long pkMember = SecurityUtils.getUserId();
if (null == pkAccount) {
return AjaxResult.error(TransactionUtils.getContent(FinanceMsgConstants.SELECT_WITHDRAWAL_ACCOUNT));
return AjaxResult.error("请选择提现账户");
}
if (null == cashAmount) {
return AjaxResult.error(TransactionUtils.getContent(FinanceMsgConstants.ENTER_WITHDRAWAL_AMOUNT));
return AjaxResult.error("请输入提现金额");
}
//提现配置信息
BdWithdrawal bdWithdrawal = iWithdrawalServiceApi.queryWithdrawal(pkCountry, pkAccount).getData();
if (null == bdWithdrawal) {
return AjaxResult.error(TransactionUtils.getContent(FinanceMsgConstants.CONFIGURE_WITHDRAWAL_INFO));
return AjaxResult.error("请配置提现信息");
}
CuMemberAccount cuMemberAccount = iCuMemberAccountService.queryCuMemberAccountByPkMember(pkMember);
Integer accountValue = iCuMemberBaseService.getAccountValueById(pkAccount);
@ -92,83 +90,87 @@ public class ApiCuMemberWithdrawController extends BaseController {
BigDecimal serviceChargeAmount = accountValue.equals(EAccount.BONUS.getValue()) ? iCuMemberWithdrawService.computeServiceCharge(pkCountry, cashAmount) : BigDecimal.ZERO;
CuMemberWithdrawalAddVO cuMemberWithdrawalAddVO = CuMemberWithdrawalAddVO.builder()
.minAmount(bdWithdrawal.getMinAmount()).maxAmount(bdWithdrawal.getMaxAmount())
.amount(availableBalance).balance(balance).srviceCharge(serviceChargeAmount).build();
.minAmount(bdWithdrawal.getMinAmount())
.maxAmount(bdWithdrawal.getMaxAmount())
.amount(availableBalance)
.balance(balance)
.srviceCharge(serviceChargeAmount)
.build();
return AjaxResult.success(cuMemberWithdrawalAddVO);
}
/**
* 用户提现
* 提现时先扣账户的钱撤销时返回账户的钱
*
* @param cuMemberWithdrawParam 提现入参
* @return AjaxResult
*/
@PostMapping("/add")
@RepeatSubmitSimple
@PostMapping("/add")
public AjaxResult addWithdrawInfo(@RequestBody CuMemberWithdrawParam cuMemberWithdrawParam) {
Integer pkCountry = SecurityUtils.getPkCountry();
Long pkMember = SecurityUtils.getUserId();
String memberCode = SecurityUtils.getMemberCode();
CuMemberExt cuMemberLoginExt = iCuMemberService.getMemberByCode(memberCode);
if (null == cuMemberLoginExt) {
return AjaxResult.error(TransactionUtils.getContent(FinanceMsgConstants.RECHAGER_USER_NOT_EXIST));
// 提现金额
BigDecimal cashAmount = cuMemberWithdrawParam.getCashAmount();
if (null == cashAmount) {
return AjaxResult.error("请输入提现金额");
}
//获取银行卡信息
// Long pkBank = cuMemberWithdrawParam.getPkBank();
// CuMemberBankVO memberBank = iCuMemberBankService.selectCuMemberBankById(pkBank);
// if (null == memberBank) {
// return AjaxResult.error(TransactionUtils.getContent(FinanceMsgConstants.BIND_BANK_CARD));
// }
//校验支付密码
String payPwd = cuMemberLoginExt.getPayPwd();
if (StringUtils.isEmpty(payPwd) || !SecurityUtils.matchesPassword(cuMemberWithdrawParam.getPayPwd(), payPwd)) {
return AjaxResult.error(TransactionUtils.getContent(FinanceMsgConstants.PAYMENT_PASSWORD_ERROR));
}
//查询提现账户
Integer pkAccount = cuMemberWithdrawParam.getPkAccount();
if (null == pkAccount) {
return AjaxResult.error(TransactionUtils.getContent(FinanceMsgConstants.SELECT_WITHDRAWAL_ACCOUNT));
return AjaxResult.error("请选择提现账户");
}
CuMemberExt cuMemberLoginExt = iCuMemberService.getMemberById(pkMember);
if (null == cuMemberLoginExt) {
return AjaxResult.error("会员不存在,请核对后再操作!");
}
//获取银行卡信息
Long pkBank = cuMemberWithdrawParam.getPkBank();
CuMemberBankVO memberBank = iCuMemberBankService.selectCuMemberBankById(pkBank);
if (null == memberBank) {
return AjaxResult.error("请绑定银行卡");
}
//校验支付密码
String payPwd = cuMemberLoginExt.getPayPwd();
if (StringUtils.isEmpty(payPwd) || !SecurityUtils.matchesPassword(cuMemberWithdrawParam.getPayPwd(), payPwd)) {
return AjaxResult.error("支付密码错误!");
}
Integer accountsType = iCuMemberBaseService.getAccountValueById(pkAccount);
if (pkCountry.equals(CountryConstants.CHINA_COUNTRY)) {
Integer expireStatus = cuMemberLoginExt.getExpireStatus();
//休止期的会员奖金账户不允许提现
Boolean restPeriodStatus = iCuMemberBaseService.restPeriodMemberUserWallet(pkMember, expireStatus, accountsType);
if (restPeriodStatus) {
return AjaxResult.error(FinanceMsgConstants.REST_PERIOD_NOT_WITHDRAWAL);
}
//已终止会员不允许提现
if (expireStatus.equals(EExpireStatus.TERMINATED.getValue())) {
return AjaxResult.error(FinanceMsgConstants.TERMINATED_NOT_WITHDRAWAL);
}
//结算等级为1 (目前是会员)不允许提现
GradeDTO gradeDTO = iGradeServiceApi.getGradeByGradeValue(EGrade.START_UP.getValue(), pkCountry).getData();
if (cuMemberLoginExt.getPkSettleGrade().equals(gradeDTO.getPkId())) {
return AjaxResult.error(TransactionUtils.getContent(FinanceMsgConstants.NOT_WITHDRAWAL_UPGRADE));
}
//校验是否实名
Boolean existRealName = iCuMemberBaseService.isExistRealName(pkMember, pkCountry, EBusinessModule.WITHDRAWAL.getValue());
if (!existRealName) {
return AjaxResult.error(TransactionUtils.getContent(FinanceMsgConstants.REAL_NAME_NOT_EXIST));
}
//校验实名认证的真实姓名与营业执照的法人姓名是否一致
/* Boolean result = iCuMemberBaseService.verificationRealNameAndLicense(pkMember, pkCountry);
if (!result) {
return AjaxResult.error(TransactionUtils.getContent(FinanceMsgConstants.REAL_NAME_LICENSE_NOT_SAME));
}*/
Integer expireStatus = cuMemberLoginExt.getExpireStatus();
//休止期的会员奖金账户不允许提现
Boolean restPeriodStatus = iCuMemberBaseService.restPeriodMemberUserWallet(pkMember, expireStatus, accountsType);
if (restPeriodStatus) {
return AjaxResult.error("休止期的会员奖金账户不允许提现");
}
//已终止会员不允许提现
if (expireStatus.equals(EExpireStatus.TERMINATED.getValue())) {
return AjaxResult.error("已终止会员不允许提现");
}
// 结算等级为1 (目前是会员)不允许提现
GradeDTO gradeDTO = iGradeServiceApi.getGradeByGradeValue(EGrade.START_UP.getValue(), pkCountry).getData();
if (cuMemberLoginExt.getPkSettleGrade().equals(gradeDTO.getPkId())) {
return AjaxResult.error("暂时不请允许提现,请先升级");
}
// 校验是否实名
Boolean existRealName = iCuMemberBaseService.isExistRealName(pkMember, pkCountry, EBusinessModule.WITHDRAWAL.getValue());
if (!existRealName) {
return AjaxResult.error("请先实名认证");
}
// //校验实名认证的真实姓名与营业执照的法人姓名是否一致
// Boolean result = iCuMemberBaseService.verificationRealNameAndLicense(pkMember, pkCountry);
// if (!result) {
// return AjaxResult.error(TransactionUtils.getContent(FinanceMsgConstants.REAL_NAME_LICENSE_NOT_SAME));
// }
//查询账户信息
CuMemberAccount cuMemberAccount = iCuMemberAccountService.queryCuMemberAccountByPkMember(pkMember);
//是否可提现
Integer isWithdraw = cuMemberAccount.getIsWithdraw();
//不允许提现
if (isWithdraw.equals(EYesNo.NO.getIntValue())) {
return AjaxResult.error(TransactionUtils.getContent(FinanceMsgConstants.NOT_ALLOWED_WITHDRAWAL));
return AjaxResult.error("不允许提现");
}
//提现配置信息
BdWithdrawal bdWithdrawal = iWithdrawalServiceApi.queryWithdrawal(pkCountry, pkAccount).getData();
@ -177,34 +179,30 @@ public class ApiCuMemberWithdrawController extends BaseController {
// 只能发起配置项次数待审核提现 必须通过或者驳回之后才能发起下一笔
List<CuMemberWithdraw> memberWithdraws = iCuMemberWithdrawService.getWithdrawTimes(pkMember);
if (CollUtil.isNotEmpty(memberWithdraws) && memberWithdraws.size() >= withdrawalNumber) {
return AjaxResult.error(TransactionUtils.getContent(FinanceMsgConstants.EXCEEDING_WITHDRAWALS_NUMBER));
return AjaxResult.error("超过提现次数");
}
//提现金额校验
BigDecimal minAmount = bdWithdrawal.getMinAmount();
BigDecimal maxAmount = bdWithdrawal.getMaxAmount();
if (null == minAmount || null == maxAmount) {
return AjaxResult.error(TransactionUtils.getContent(FinanceMsgConstants.CONFIGURE_WITHDRAWAL_AMOUNT_LIMIT));
}
// 提现金额
BigDecimal cashAmount = cuMemberWithdrawParam.getCashAmount();
if (null == cashAmount) {
return AjaxResult.error(TransactionUtils.getContent(FinanceMsgConstants.ENTER_WITHDRAWAL_AMOUNT));
return AjaxResult.error("请配置提现金额限制");
}
//提现金额是否输入整数值
Integer isRounding = bdWithdrawal.getIsRounding();
if (isRounding.equals(EYesNo.YES.getIntValue()) && Boolean.TRUE.equals(!isIntegerValue(cashAmount))) {
return AjaxResult.error(TransactionUtils.getContent(FinanceMsgConstants.ENTER_INTEGER_VALUE));
return AjaxResult.error("请输入整数值");
}
if (cashAmount.compareTo(minAmount) < 0) {
return AjaxResult.error(TransactionUtils.getContent(FinanceMsgConstants.WITHDRAWAL_AMOUNT_GREATER_MINIMUM_AMOUNT));
return AjaxResult.error("提现金额必须大于最低提现金额");
}
if (cashAmount.compareTo(maxAmount) > 0) {
return AjaxResult.error(TransactionUtils.getContent(FinanceMsgConstants.WITHDRAWAL_AMOUNT_LESS_MAXIMUM_AMOUNT));
return AjaxResult.error("提现金额必须小于最高提现金额");
}
//校验倍数
if (pkCountry.equals(CountryConstants.CHINA_COUNTRY) && !remainder(cashAmount)) {
return AjaxResult.error(FinanceMsgConstants.WITHDRAW_AMOUNT_MULTIPLE);
if (!remainder(cashAmount)) {
return AjaxResult.error("提现金额必须为100的整数倍");
}
//本次应缴个税
BigDecimal payIncomeTax = BigDecimal.ZERO;
@ -221,7 +219,7 @@ public class ApiCuMemberWithdrawController extends BaseController {
BigDecimal balance = getAvailableBalance(accountsType, cuMemberAccount);
//余额不足
if (balance.compareTo(cashAmount) < 0 || accountBalance.compareTo(cashAmount) < 0) {
return AjaxResult.error(TransactionUtils.getContent(FinanceMsgConstants.BALANCE_NOT_ENOUGH));
return AjaxResult.error("余额不足");
}
//奖金账户个税手续费根据配置其它用户暂不收取
//本次应缴个税
@ -229,30 +227,34 @@ public class ApiCuMemberWithdrawController extends BaseController {
//手续费金额
serviceChargeAmount = iCuMemberWithdrawService.computeServiceCharge(pkCountry, cashAmount);
issuedAmount = cashAmount.subtract(payIncomeTax).subtract(serviceChargeAmount);
} else { //其它用户的余额
} else {
//其它用户的余额
BigDecimal balance = getAvailableBalance(accountsType, cuMemberAccount);
//余额不足
if (balance.compareTo(cashAmount) < 0) {
return AjaxResult.error(TransactionUtils.getContent(FinanceMsgConstants.BALANCE_NOT_ENOUGH));
return AjaxResult.error("余额不足");
}
}
String code = CommonUtil.createSerialNumber(EOrderPrefix.WITHDRAWAL_CODE.getValue());
//汇率
CurrencyDTO currencyDTO = iCuMemberBaseService.getCurrency(pkCountry);
CuMemberWithdraw cuMemberWithdraw = CuMemberWithdraw.builder().pkMember(pkMember)
// .pkAccount(pkAccount).pkBank(pkBank).remarks(cuMemberWithdrawParam.getRemarks())
.pkAccount(pkAccount).pkBank(0L).remarks(cuMemberWithdrawParam.getRemarks())
.pkRate(currencyDTO.getPkId()).cashAmount(cashAmount)
.serviceCharge(serviceChargeAmount).incomeTax(payIncomeTax)
.issuedAmount(issuedAmount).withdrawCode(code).build();
.pkAccount(pkAccount)
.pkBank(pkBank)
.remarks(cuMemberWithdrawParam.getRemarks())
.pkRate(currencyDTO.getPkId())
.cashAmount(cashAmount)
.serviceCharge(serviceChargeAmount)
.incomeTax(payIncomeTax)
.issuedAmount(issuedAmount)
.withdrawCode(code)
.build();
cuMemberWithdraw.setApproveState(EApproveStatus.WAIT_SUBMIT.getValue());
cuMemberWithdraw.setDelFlag(EDelFlag.UN_DELETE.getValue());
cuMemberWithdraw.setPkCountry(pkCountry);
cuMemberWithdraw.setPkCreator(pkMember);
return toAjax(iCuMemberWithdrawService.saveMemberWithdrawInfo(cuMemberWithdraw));
}
/**

View File

@ -116,7 +116,7 @@ public class CuMemberWithdrawController extends BaseController {
}
/**
* 充值明细列表导出
* 明细列表导出
*
* @param response 入参
* @param cuMemberWithdrawVO 查询入参

View File

@ -8,13 +8,8 @@ import java.io.Serializable;
import java.math.BigDecimal;
/**
* @Description: 提现参数类
* @Author: ljc
* @Time: 2022/9/27 15:32
* @Classname: CuMemberWithdrawParam
* @Package_name: com.hzs.member.account.param
* 提现参数类
*/
@Data
@AllArgsConstructor
@NoArgsConstructor

View File

@ -9,9 +9,6 @@ import java.util.List;
/**
* 会员信息-银行卡信息 Mapper 接口
*
* @author hzs
* @since 2022-08-31
*/
public interface CuMemberBankMapper extends BaseMapper<CuMemberBank> {

View File

@ -72,29 +72,20 @@ public class CuMemberBankServiceImpl extends ServiceImpl<CuMemberBankMapper, CuM
return BeanUtil.copyToList(baseMapper.selectBankCardByPkMember(pkMember, pkCountry), CuMemberBankVO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
@Override
public Boolean updateDefault(Long pkId, Long pkMember, Integer pkCountry) {
updateMemberBankCardToDefault(pkMember, pkCountry);
LambdaUpdateWrapper<CuMemberBank> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.set(CuMemberBank::getDefaultCard, EBankCardStatus.YES.getValue()).eq(CuMemberBank::getPkId, pkId);
return update(updateWrapper);
}
/**
* 绑定的银行卡更新为非默认
*
* @param pkMember 会员ID
* @param pkCountry 国家ID
* @return Boolean
*/
public Boolean updateMemberBankCardToDefault(Long pkMember, Integer pkCountry) {
LambdaUpdateWrapper<CuMemberBank> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.set(CuMemberBank::getDefaultCard, EBankCardStatus.NO.getValue())
.eq(CuMemberBank::getDefaultCard, EBankCardStatus.YES.getValue())
.eq(CuMemberBank::getPkMember, pkMember)
.eq(CuMemberBank::getPkCountry, pkCountry);
return update(updateWrapper);
update(updateWrapper);
LambdaUpdateWrapper<CuMemberBank> newUpdateWrapper = new LambdaUpdateWrapper<>();
newUpdateWrapper.set(CuMemberBank::getDefaultCard, EBankCardStatus.YES.getValue())
.eq(CuMemberBank::getPkId, pkId);
return update(newUpdateWrapper);
}
@Override

View File

@ -30,7 +30,6 @@ import com.hzs.member.account.vo.CuMemberPetitionVO;
import com.hzs.member.account.vo.CuMemberTradeVO;
import com.hzs.member.account.vo.CuMemberWithdrawVO;
import com.hzs.system.base.dto.CurrencyDTO;
import com.hzs.system.config.IWithdrawalAutoServiceApi;
import com.hzs.system.config.IWithdrawalProcessServiceApi;
import com.hzs.system.config.IWithdrawalTaxServiceApi;
import com.hzs.system.sys.IApprovalServiceApi;
@ -45,8 +44,6 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.time.DayOfWeek;
import java.time.LocalDate;
import java.util.*;
import java.util.stream.Collectors;
@ -67,8 +64,6 @@ public class CuMemberWithdrawServiceImpl extends ServiceImpl<CuMemberWithdrawMap
@DubboReference
IWithdrawalTaxServiceApi iWithdrawalTaxServiceApi;
@DubboReference
IWithdrawalAutoServiceApi iWithdrawalAutoServiceApi;
@DubboReference
IWithdrawalProcessServiceApi iWithdrawalProcessServiceApi;
@DubboReference
IApprovalServiceApi iApprovalServiceApi;
@ -113,8 +108,10 @@ public class CuMemberWithdrawServiceImpl extends ServiceImpl<CuMemberWithdrawMap
@Transactional(rollbackFor = Exception.class)
@Override
public Integer saveMemberWithdrawInfo(CuMemberWithdraw cuMemberWithdraw) {
Integer row = baseMapper.insert(cuMemberWithdraw);
this.updateTradeAndBalancd(cuMemberWithdraw, EOperationMethod.INSERT);
int row = baseMapper.insert(cuMemberWithdraw);
if (row != 0) {
this.updateTradeAndBalancd(cuMemberWithdraw, EOperationMethod.INSERT);
}
return row;
}
@ -297,27 +294,6 @@ public class CuMemberWithdrawServiceImpl extends ServiceImpl<CuMemberWithdrawMap
return row;
}
/**
* 获取余额
*
* @param accountsType 账户值
* @param cuMemberAccount 账户信息
* @return BigDecimal
*/
private BigDecimal getAvailableBalance(Integer accountsType, CuMemberAccount cuMemberAccount) {
//账户余额
BigDecimal accountBalance = getAccountBalance(accountsType, cuMemberAccount);
//可提现账户余额
BigDecimal withdrawBalance = ReflectUtils.invokeGetter(cuMemberAccount, MemberFieldConstants.WITHDRAW_ACCOUNT + accountsType);
withdrawBalance = withdrawBalance == null ? BigDecimal.ZERO : withdrawBalance;
BigDecimal lockAccount = ReflectUtils.invokeGetter(cuMemberAccount, MemberFieldConstants.LOCK_WITHDRAW_ACCOUNT + accountsType);
if (null != lockAccount && lockAccount.compareTo(BigDecimal.ZERO) > 0) {
withdrawBalance = withdrawBalance.subtract(lockAccount);
}
//取最小余额
return accountBalance.compareTo(withdrawBalance) < 0 ? accountBalance : withdrawBalance;
}
/**
* 获取账户余额
*
@ -339,28 +315,6 @@ public class CuMemberWithdrawServiceImpl extends ServiceImpl<CuMemberWithdrawMap
return account.subtract(lockConsume).subtract(lockTransfer);
}
/**
* 查询自动提现的时间
*
* @param pkCountry 国家
* @return Boolean
*/
public Boolean isWithdrawalCycle(Integer pkCountry) {
//当前时间位于星期的第几天
LocalDate localDate = LocalDate.now();
DayOfWeek dayOfWeek = localDate.getDayOfWeek();
Integer dayOfWeekNum = dayOfWeek.getValue();
//自动提现配置的提现周期
List<BdWithdrawalAuto> listR = iWithdrawalAutoServiceApi.queryWithdrawalAuto(pkCountry).getData();
for (BdWithdrawalAuto withdrawalAuto : listR) {
Integer withdrawalCycle = withdrawalAuto.getWithdrawalCycle();
if (dayOfWeekNum.equals(withdrawalCycle)) {
return true;
}
}
return false;
}
@Override
public BigDecimal getBalance(Long pkMember, Integer pkCountry, Integer accountsType) {
//提现账户

View File

@ -350,9 +350,7 @@
AND cmw.status != 3
AND cmw.pk_country = #{pkCountry}
AND cmw.pk_member = #{pkMember}
AND cmw.approve_state IN (1
, 2
, 3)
AND cmw.approve_state IN (1, 2, 3)
</select>
</mapper>

View File

@ -4,21 +4,16 @@ import com.hzs.common.domain.sale.order.SaOrder;
import com.hzs.system.sys.dto.LoginUser;
/**
* @Description: 撤单的service
* @Author: sui q
* @Time: 2022/10/27 10:49
* @Classname: ISaOrderRevokeService
* @PackageName: com.hzs.sale.order.service
* 撤单的service
*/
public interface ISaOrderRevokeService {
/**
* 撤销订单
* @param saOrder 需要销售的订单信息
*
* @param saOrder 需要销售的订单信息
* @param loginUser 登录用户
* @return: void
* @Author: sui q
* @Date: 2022/10/27 10:51
*/
*/
void revokeSaOrder(SaOrder saOrder, LoginUser loginUser);
}

View File

@ -1,10 +1,8 @@
package com.hzs.sale.order.service.impl;
import cn.hutool.json.JSONUtil;
import com.google.gson.JsonObject;
import com.hzs.common.core.enums.EApprovalBusiness;
import com.hzs.common.domain.sale.order.SaOrder;
import com.hzs.common.security.utils.SecurityUtils;
import com.hzs.sale.order.service.ISaOrderRevokeService;
import com.hzs.system.sys.IApprovalServiceApi;
import com.hzs.system.sys.dto.ApprovalSubmitDTO;
@ -13,17 +11,13 @@ import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Service;
/**
* @Description: 撤单逻辑类
* @Author: sui q
* @Time: 2022/10/27 10:50
* @Classname: SaOrderRevokeServiceImpl
* @PackageName: com.hzs.sale.order.service.impl
* 撤单逻辑类
*/
@Service
public class SaOrderRevokeServiceImpl implements ISaOrderRevokeService {
@DubboReference
private IApprovalServiceApi approvalServiceApi;
IApprovalServiceApi iApprovalServiceApi;
@Override
public void revokeSaOrder(SaOrder saOrder, LoginUser loginUser) {
@ -32,6 +26,6 @@ public class SaOrderRevokeServiceImpl implements ISaOrderRevokeService {
.businessCode(saOrder.getOrderCode())
.businessData(JSONUtil.toJsonStr(saOrder))
.build();
approvalServiceApi.submit(approvalSubmitDTO, loginUser);
iApprovalServiceApi.submit(approvalSubmitDTO, loginUser);
}
}

View File

@ -1,16 +1,10 @@
package com.hzs.system.base.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hzs.common.domain.system.base.BdCurrency;
/**
* <p>
* 币种表 Mapper 接口
* </p>
*
* @author hzs
* @since 2022-08-04
*/
public interface BdCurrencyMapper extends BaseMapper<BdCurrency> {

View File

@ -6,22 +6,12 @@ import com.hzs.common.domain.system.base.BdCurrency;
import java.math.BigDecimal;
import java.util.List;
/**
* @Description:
* @Author: yuhui
* @Time: 2022/8/29 10:59
* @Classname: IBdCurrencyService
* @PackageName: com.hzs.system.base.service
*/
public interface IBdCurrencyService extends IService<BdCurrency> {
/**
* 根据国家获得币种
*
* @param pkCountry 国家
* @return: BdCurrency
* @Author: sui q
* @Date: 2022/9/8 15:05
*/
BdCurrency getCurrency(Integer pkCountry);
@ -50,10 +40,6 @@ public interface IBdCurrencyService extends IService<BdCurrency> {
/**
* 查询所有的币种汇率
*
* @return: List<BdCurrency>
* @Author: sui q
* @Date: 2023/3/4 16:06
*/
List<BdCurrency> queryAllBdCurrency();
@ -61,9 +47,6 @@ public interface IBdCurrencyService extends IService<BdCurrency> {
* 更新汇率根据id
*
* @param pkId 主键
* @return: void
* @Author: sui q
* @Date: 2023/3/10 15:37
*/
void updateCurrencyById(Integer pkId);

View File

@ -18,20 +18,13 @@ import java.math.RoundingMode;
import java.util.List;
/**
* Created with IntelliJ IDEA.
*
* @Author: yuhui
* @Description: 币种服务类
* 币种服务类
*/
@Service
public class BdCurrencyServiceImpl extends ServiceImpl<BdCurrencyMapper, BdCurrency> implements IBdCurrencyService {
private RedisService redisService;
@Autowired
public void setRedisService(RedisService redisService) {
this.redisService = redisService;
}
private RedisService redisService;
@Override
public BdCurrency getCurrency(Integer pkCountry) {
@ -69,11 +62,6 @@ public class BdCurrencyServiceImpl extends ServiceImpl<BdCurrencyMapper, BdCurre
return bdCurrency;
}
/**
* 根据id 查询所属历史币种
*
* @return
*/
@Override
public BdCurrency getByHistoryPkid(Integer pkId) {
BdCurrency bdCurrency = redisService.getCacheObject(CacheConstants.BD_HISTORY_CURRENCY_PK + pkId);
@ -88,13 +76,6 @@ public class BdCurrencyServiceImpl extends ServiceImpl<BdCurrencyMapper, BdCurre
return bdCurrency;
}
/**
* 本地币转换为美金
*
* @param localCurrency 本地币
* @param pkCountry 结算国
* @return
*/
@Override
public BigDecimal getDollar(BigDecimal localCurrency, Integer pkCountry) {
BdCurrency bdCurrency = getCurrency(pkCountry);

View File

@ -1,11 +1,8 @@
package com.hzs.system.config.controller.manage;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.hzs.common.core.constant.CacheConstants;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.hzs.common.core.enums.EDelFlag;
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;
@ -21,12 +18,7 @@ import java.util.Date;
import java.util.List;
/**
* <p>
* 自动提现明细表 前端控制器
* </p>
*
* @author zhangjing
* @since 2022-08-31
*/
@Slf4j
@RestController
@ -34,98 +26,66 @@ import java.util.List;
public class BdWithdrawalAutoController extends BaseController {
@Autowired
private IBdWithdrawalAutoService withdrawalAutoService;
private RedisService redisService;
@Autowired
public void setRedisService(RedisService redisService) {
this.redisService = redisService;
}
private IBdWithdrawalAutoService iBdWithdrawalAutoService;
/**
* @description: 查询自动提现设置列表
* @author: zhang jing
* @date: 2022/8/30 10:20
* @param: [bdWithdrawal]
* @return: com.hzs.common.core.web.page.TableDataInfo
* 查询自动提现设置列表
**/
@GetMapping("/list")
public TableDataInfo list(BdWithdrawalAuto withdrawalAuto) {
startPage();
withdrawalAuto.setPkCountry(SecurityUtils.getPkCountry());
QueryWrapper<BdWithdrawalAuto> queryWrapper = new QueryWrapper();
queryWrapper.eq("PK_COUNTRY",SecurityUtils.getPkCountry());
if(StringUtils.isNotNull(withdrawalAuto.getPkWithdrawal())){
queryWrapper.eq("PK_WITHDRAWAL",withdrawalAuto.getPkWithdrawal());
LambdaQueryWrapper<BdWithdrawalAuto> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(BdWithdrawalAuto::getPkCountry, SecurityUtils.getPkCountry());
if (StringUtils.isNotNull(withdrawalAuto.getPkWithdrawal())) {
queryWrapper.eq(BdWithdrawalAuto::getPkWithdrawal, withdrawalAuto.getPkWithdrawal());
}
queryWrapper.orderByDesc("CREATION_TIME");
List<BdWithdrawalAuto> list = withdrawalAutoService.list(queryWrapper);
queryWrapper.orderByDesc(BdWithdrawalAuto::getCreationTime);
List<BdWithdrawalAuto> list = iBdWithdrawalAutoService.list(queryWrapper);
return getDataTable(list);
}
/**
* @description: 新增自动提现设置
* @author: zhang jing
* @date: 2022/8/30 10:21
* @param: [bdWithdrawal]
* @return: com.hzs.common.core.web.domain.AjaxResult
* 新增自动提现设置
**/
@PostMapping("/save")
public AjaxResult save(@RequestBody BdWithdrawalAuto withdrawalAuto) {
withdrawalAuto.setPkCountry(SecurityUtils.getPkCountry());
withdrawalAuto.setPkCreator(SecurityUtils.getUserId());
withdrawalAuto.setCreationTime(new Date());
redisService.deleteObject(CacheConstants.BD_WITHDRAWAL_AUTO + SecurityUtils.getPkCountry());
return toAjax(withdrawalAutoService.save(withdrawalAuto));
return toAjax(iBdWithdrawalAutoService.save(withdrawalAuto));
}
/**
* @description: 修改自动提现设置
* @author: zhang jing
* @date: 2022/8/30 10:21
* @param: [bdWithdrawal]
* @return: com.hzs.common.core.web.domain.AjaxResult
* 修改自动提现设置
**/
@PostMapping("/update")
public AjaxResult update(@RequestBody BdWithdrawalAuto withdrawalAuto) {
withdrawalAuto.setPkModified(SecurityUtils.getUserId());
withdrawalAuto.setModifiedTime(new Date());
redisService.deleteObject(CacheConstants.BD_WITHDRAWAL_AUTO + SecurityUtils.getPkCountry());
return toAjax(withdrawalAutoService.updateById(withdrawalAuto));
return toAjax(iBdWithdrawalAutoService.updateById(withdrawalAuto));
}
/**
* @description: 查询单条自动提现设置
* @author: zhang jing
* @date: 2022/8/30 10:21
* @param: [pkId]
* @return: com.hzs.common.core.web.domain.AjaxResult
* 查询单条自动提现设置
**/
@GetMapping("/getOne/{pkId}")
public AjaxResult getOne(@PathVariable Long pkId) {
BdWithdrawalAuto withdrawalAuto = withdrawalAutoService.getById(pkId);
BdWithdrawalAuto withdrawalAuto = iBdWithdrawalAutoService.getById(pkId);
return AjaxResult.success(withdrawalAuto);
}
/**
* @description: 删除自动提现设置
* @author: zhang jing
* @date: 2022/8/30 10:21
* @param: [pkId]
* @return: com.hzs.common.core.web.domain.AjaxResult
* 删除自动提现设置
**/
@DeleteMapping("/{pkId}")
public AjaxResult delete(@PathVariable Long pkId) {
UpdateWrapper<BdWithdrawalAuto> updateWrapper = new UpdateWrapper<>();
updateWrapper.eq("PK_ID", pkId);
updateWrapper.set("DEL_FLAG", EDelFlag.DELETE.getValue());
updateWrapper.set("PK_MODIFIED", SecurityUtils.getUserId());
updateWrapper.set("MODIFIED_TIME", new Date());
redisService.deleteObject(CacheConstants.BD_WITHDRAWAL_AUTO + SecurityUtils.getPkCountry());
return toAjax(withdrawalAutoService.update(updateWrapper));
LambdaUpdateWrapper<BdWithdrawalAuto> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(BdWithdrawalAuto::getPkId, pkId);
updateWrapper.set(BdWithdrawalAuto::getDelFlag, EDelFlag.DELETE.getValue());
updateWrapper.set(BdWithdrawalAuto::getPkModified, SecurityUtils.getUserId());
updateWrapper.set(BdWithdrawalAuto::getModifiedTime, new Date());
return toAjax(iBdWithdrawalAutoService.update(updateWrapper));
}
}

View File

@ -1,12 +1,10 @@
package com.hzs.system.config.controller.manage;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil;
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.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;
@ -21,13 +19,10 @@ import com.hzs.common.domain.system.config.ext.BdWithdrawalAutoExt;
import com.hzs.common.domain.system.config.ext.BdWithdrawalExt;
import com.hzs.common.security.utils.SecurityUtils;
import com.hzs.common.util.TransactionUtils;
import com.hzs.system.base.ITransactionServiceApi;
import com.hzs.system.base.service.IBdCurrencyService;
import com.hzs.system.config.IWithdrawalServiceApi;
import com.hzs.system.config.service.IBdWithdrawalAutoService;
import com.hzs.system.config.service.IBdWithdrawalService;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@ -38,12 +33,7 @@ import java.util.Date;
import java.util.List;
/**
* <p>
* 提现设置主表 前端控制器
* </p>
*
* @author zhangjing
* @since 2022-08-29
*/
@Slf4j
@RestController
@ -51,58 +41,42 @@ import java.util.List;
public class BdWithdrawalController extends BaseController {
@Autowired
private IBdWithdrawalService withdrawalService;
@DubboReference
private ITransactionServiceApi iTransactionServiceApi;
private RedisService redisService;
@DubboReference
private IWithdrawalServiceApi withdrawalServiceApi;
private IBdWithdrawalService iBdWithdrawalService;
@Autowired
private IBdWithdrawalAutoService withdrawalAutoService;
private IBdWithdrawalAutoService iBdWithdrawalAutoService;
@Autowired
IBdCurrencyService currencyService;
@Autowired
public void setRedisService(RedisService redisService) {
this.redisService = redisService;
}
private IBdCurrencyService iBdCurrencyService;
/**
* @description: 查询提现设置列表 理论每个国家只有一个提现配置
* @author: zhang jing
* @date: 2022/8/30 10:20
* @param: [withdrawalParam]
* @return: com.hzs.common.core.web.page.TableDataInfo
* 查询提现设置列表 理论每个国家只有一个提现配置
**/
@Log(module = EOperationModule.WALLET_CONFIG,business = EOperationBusiness.WITHDRAWAL_CONFIG,method = EOperationMethod.SELECT)
@Log(module = EOperationModule.WALLET_CONFIG, business = EOperationBusiness.WITHDRAWAL_CONFIG, method = EOperationMethod.SELECT)
@GetMapping("/list")
public TableDataInfo list(BdWithdrawalExt withdrawalExt) {
startPage();
withdrawalExt.setPkCountry(SecurityUtils.getPkCountry());
List<BdWithdrawalExt> listExt = withdrawalService.listExt(withdrawalExt);
for(BdWithdrawalExt bwd: listExt){
//暂时使用中国
if(StringUtils.isNotNull(bwd.getMinAmount())){
bwd.setMinAmountUsa(currencyService.getDollar(bwd.getMinAmount(),SecurityUtils.getPkCountry()));
List<BdWithdrawalExt> listExt = iBdWithdrawalService.listExt(withdrawalExt);
for (BdWithdrawalExt bwd : listExt) {
//暂时使用中国
if (StringUtils.isNotNull(bwd.getMinAmount())) {
bwd.setMinAmountUsa(iBdCurrencyService.getDollar(bwd.getMinAmount(), SecurityUtils.getPkCountry()));
}
if(StringUtils.isNotNull(bwd.getMaxAmount())){
bwd.setMaxAmountUsa(currencyService.getDollar(bwd.getMaxAmount(),SecurityUtils.getPkCountry()));
if (StringUtils.isNotNull(bwd.getMaxAmount())) {
bwd.setMaxAmountUsa(iBdCurrencyService.getDollar(bwd.getMaxAmount(), SecurityUtils.getPkCountry()));
}
if(StringUtils.isNotNull(bwd.getLowerBound())){
bwd.setLowerBoundUsa(currencyService.getDollar(bwd.getLowerBound(),SecurityUtils.getPkCountry()));
if (StringUtils.isNotNull(bwd.getLowerBound())) {
bwd.setLowerBoundUsa(iBdCurrencyService.getDollar(bwd.getLowerBound(), SecurityUtils.getPkCountry()));
}
if(StringUtils.isNotNull(bwd.getUpperBound())){
bwd.setUpperBoundUsa(currencyService.getDollar(bwd.getUpperBound(),SecurityUtils.getPkCountry()));
if (StringUtils.isNotNull(bwd.getUpperBound())) {
bwd.setUpperBoundUsa(iBdCurrencyService.getDollar(bwd.getUpperBound(), SecurityUtils.getPkCountry()));
}
QueryWrapper<BdWithdrawalAuto> queryWrapperAuto = new QueryWrapper();
queryWrapperAuto.eq("PK_COUNTRY",SecurityUtils.getPkCountry());
if(StringUtils.isNotNull(bwd.getPkId())){
queryWrapperAuto.eq("PK_WITHDRAWAL",bwd.getPkId());
LambdaQueryWrapper<BdWithdrawalAuto> queryWrapperAuto = new LambdaQueryWrapper<>();
queryWrapperAuto.eq(BdWithdrawalAuto::getPkCountry, SecurityUtils.getPkCountry());
if (StringUtils.isNotNull(bwd.getPkId())) {
queryWrapperAuto.eq(BdWithdrawalAuto::getPkWithdrawal, bwd.getPkId());
}
List<BdWithdrawalAuto> listAuto = withdrawalAutoService.list(queryWrapperAuto);
List<BdWithdrawalAuto> listAuto = iBdWithdrawalAutoService.list(queryWrapperAuto);
List<BdWithdrawalAutoExt> watExtList = new ArrayList<>();
listAuto.forEach(item -> watExtList.add(BeanUtil.copyProperties(item, BdWithdrawalAutoExt.class)));
bwd.setWithdrawalAutoList(watExtList);
@ -111,42 +85,38 @@ public class BdWithdrawalController extends BaseController {
}
/**
* @description: 导出提现配置
* @author: zhang jing
* @date: 2023/3/3 16:19
* @param: [response, withdrawalExt]
* @return: void
* 导出提现配置
**/
@Log(module = EOperationModule.WALLET_CONFIG,business = EOperationBusiness.WITHDRAWAL_CONFIG,method = EOperationMethod.EXPORT)
@Log(module = EOperationModule.WALLET_CONFIG, business = EOperationBusiness.WITHDRAWAL_CONFIG, method = EOperationMethod.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, BdWithdrawalExt withdrawalExt) {
QueryWrapper<BdWithdrawal> queryWrapper = new QueryWrapper();
queryWrapper.eq("PK_COUNTRY",SecurityUtils.getPkCountry());
queryWrapper.orderByDesc("CREATION_TIME");
List<BdWithdrawal> list = withdrawalService.list(queryWrapper);
List<BdWithdrawalExt> listExt=new ArrayList<>();
for(BdWithdrawal bwd: list){
BdWithdrawalExt withdrawalExtNew= BeanUtil.copyProperties(bwd, BdWithdrawalExt.class);
public void export(HttpServletResponse response) {
LambdaQueryWrapper<BdWithdrawal> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(BdWithdrawal::getPkCountry, SecurityUtils.getPkCountry());
queryWrapper.orderByDesc(BdWithdrawal::getCreationTime);
List<BdWithdrawal> list = iBdWithdrawalService.list(queryWrapper);
List<BdWithdrawalExt> listExt = new ArrayList<>();
for (BdWithdrawal bwd : list) {
BdWithdrawalExt withdrawalExtNew = BeanUtil.copyProperties(bwd, BdWithdrawalExt.class);
//暂时使用中国
if(StringUtils.isNotNull(bwd.getMinAmount())){
withdrawalExtNew.setMinAmountUsa(currencyService.getDollar(bwd.getMinAmount(),SecurityUtils.getPkCountry()));
if (StringUtils.isNotNull(bwd.getMinAmount())) {
withdrawalExtNew.setMinAmountUsa(iBdCurrencyService.getDollar(bwd.getMinAmount(), SecurityUtils.getPkCountry()));
}
if(StringUtils.isNotNull(bwd.getMaxAmount())){
withdrawalExtNew.setMaxAmountUsa(currencyService.getDollar(bwd.getMaxAmount(),SecurityUtils.getPkCountry()));
if (StringUtils.isNotNull(bwd.getMaxAmount())) {
withdrawalExtNew.setMaxAmountUsa(iBdCurrencyService.getDollar(bwd.getMaxAmount(), SecurityUtils.getPkCountry()));
}
if(StringUtils.isNotNull(bwd.getLowerBound())){
withdrawalExtNew.setLowerBoundUsa(currencyService.getDollar(bwd.getLowerBound(),SecurityUtils.getPkCountry()));
if (StringUtils.isNotNull(bwd.getLowerBound())) {
withdrawalExtNew.setLowerBoundUsa(iBdCurrencyService.getDollar(bwd.getLowerBound(), SecurityUtils.getPkCountry()));
}
if(StringUtils.isNotNull(bwd.getUpperBound())){
withdrawalExtNew.setUpperBoundUsa(currencyService.getDollar(bwd.getUpperBound(),SecurityUtils.getPkCountry()));
if (StringUtils.isNotNull(bwd.getUpperBound())) {
withdrawalExtNew.setUpperBoundUsa(iBdCurrencyService.getDollar(bwd.getUpperBound(), SecurityUtils.getPkCountry()));
}
QueryWrapper<BdWithdrawalAuto> queryWrapperAuto = new QueryWrapper();
queryWrapperAuto.eq("PK_COUNTRY",SecurityUtils.getPkCountry());
if(StringUtils.isNotNull(bwd.getPkId())){
queryWrapperAuto.eq("PK_WITHDRAWAL",bwd.getPkId());
LambdaQueryWrapper<BdWithdrawalAuto> queryWrapperAuto = new LambdaQueryWrapper<>();
queryWrapperAuto.eq(BdWithdrawalAuto::getPkCountry, SecurityUtils.getPkCountry());
if (StringUtils.isNotNull(bwd.getPkId())) {
queryWrapperAuto.eq(BdWithdrawalAuto::getPkWithdrawal, bwd.getPkId());
}
List<BdWithdrawalAuto> listAuto = withdrawalAutoService.list(queryWrapperAuto);
List<BdWithdrawalAuto> listAuto = iBdWithdrawalAutoService.list(queryWrapperAuto);
List<BdWithdrawalAutoExt> watExtList = new ArrayList<>();
listAuto.forEach(item -> watExtList.add(BeanUtil.copyProperties(item, BdWithdrawalAutoExt.class)));
withdrawalExtNew.setWithdrawalAutoList(watExtList);
@ -157,43 +127,39 @@ public class BdWithdrawalController extends BaseController {
}
/**
* @description: 提现手续费配置理论每个国家只有一个提现配置
* @author: zhang jing
* @date: 2022/11/2 11:38
* @param: [withdrawalExt]
* @return: com.hzs.common.core.web.page.TableDataInfo
* 提现手续费配置理论每个国家只有一个提现配置
**/
@Log(module = EOperationModule.WALLET_CONFIG,business = EOperationBusiness.WITHDRAWAL_CONFIG,method = EOperationMethod.SELECT)
@Log(module = EOperationModule.WALLET_CONFIG, business = EOperationBusiness.WITHDRAWAL_CONFIG, method = EOperationMethod.SELECT)
@GetMapping("/serviceChargelist")
public TableDataInfo serviceChargelist(BdWithdrawalExt withdrawalExt) {
public TableDataInfo serviceChargelist() {
startPage();
QueryWrapper<BdWithdrawal> queryWrapper = new QueryWrapper();
queryWrapper.eq("PK_COUNTRY",SecurityUtils.getPkCountry());
queryWrapper.orderByDesc("CREATION_TIME");
List<BdWithdrawal> list = withdrawalService.list(queryWrapper);
List<BdWithdrawalExt> listExt=new ArrayList<>();
for(BdWithdrawal bwd: list){
BdWithdrawalExt withdrawalExtNew= BeanUtil.copyProperties(bwd, BdWithdrawalExt.class);
LambdaQueryWrapper<BdWithdrawal> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(BdWithdrawal::getPkCountry, SecurityUtils.getPkCountry());
queryWrapper.orderByDesc(BdWithdrawal::getCreationTime);
List<BdWithdrawal> list = iBdWithdrawalService.list(queryWrapper);
List<BdWithdrawalExt> listExt = new ArrayList<>();
for (BdWithdrawal bwd : list) {
BdWithdrawalExt withdrawalExtNew = BeanUtil.copyProperties(bwd, BdWithdrawalExt.class);
//暂时使用中国
if(StringUtils.isNotNull(bwd.getMinAmount())){
withdrawalExtNew.setMinAmountUsa(currencyService.getDollar(bwd.getMinAmount(),SecurityUtils.getPkCountry()));
if (StringUtils.isNotNull(bwd.getMinAmount())) {
withdrawalExtNew.setMinAmountUsa(iBdCurrencyService.getDollar(bwd.getMinAmount(), SecurityUtils.getPkCountry()));
}
if(StringUtils.isNotNull(bwd.getMaxAmount())){
withdrawalExtNew.setMaxAmountUsa(currencyService.getDollar(bwd.getMaxAmount(),SecurityUtils.getPkCountry()));
if (StringUtils.isNotNull(bwd.getMaxAmount())) {
withdrawalExtNew.setMaxAmountUsa(iBdCurrencyService.getDollar(bwd.getMaxAmount(), SecurityUtils.getPkCountry()));
}
if(StringUtils.isNotNull(bwd.getLowerBound())){
withdrawalExtNew.setLowerBoundUsa(currencyService.getDollar(bwd.getLowerBound(),SecurityUtils.getPkCountry()));
if (StringUtils.isNotNull(bwd.getLowerBound())) {
withdrawalExtNew.setLowerBoundUsa(iBdCurrencyService.getDollar(bwd.getLowerBound(), SecurityUtils.getPkCountry()));
}
if(StringUtils.isNotNull(bwd.getUpperBound())){
withdrawalExtNew.setUpperBoundUsa(currencyService.getDollar(bwd.getUpperBound(),SecurityUtils.getPkCountry()));
if (StringUtils.isNotNull(bwd.getUpperBound())) {
withdrawalExtNew.setUpperBoundUsa(iBdCurrencyService.getDollar(bwd.getUpperBound(), SecurityUtils.getPkCountry()));
}
QueryWrapper<BdWithdrawalAuto> queryWrapperAuto = new QueryWrapper();
queryWrapperAuto.eq("PK_COUNTRY",SecurityUtils.getPkCountry());
if(StringUtils.isNotNull(bwd.getPkId())){
queryWrapperAuto.eq("PK_WITHDRAWAL",bwd.getPkId());
LambdaQueryWrapper<BdWithdrawalAuto> queryWrapperAuto = new LambdaQueryWrapper<>();
queryWrapperAuto.eq(BdWithdrawalAuto::getPkCountry, SecurityUtils.getPkCountry());
if (StringUtils.isNotNull(bwd.getPkId())) {
queryWrapperAuto.eq(BdWithdrawalAuto::getPkWithdrawal, bwd.getPkId());
}
List<BdWithdrawalAuto> listAuto = withdrawalAutoService.list(queryWrapperAuto);
List<BdWithdrawalAuto> listAuto = iBdWithdrawalAutoService.list(queryWrapperAuto);
List<BdWithdrawalAutoExt> watExtList = new ArrayList<>();
listAuto.forEach(item -> watExtList.add(BeanUtil.copyProperties(item, BdWithdrawalAutoExt.class)));
withdrawalExtNew.setWithdrawalAutoList(watExtList);
@ -204,155 +170,133 @@ public class BdWithdrawalController extends BaseController {
/**
* @description: 新增提现设置
* @author: zhang jing
* @date: 2022/8/30 10:21
* @param: [withdrawalParam]
* @return: com.hzs.common.core.web.domain.AjaxResult
* 新增提现设置
**/
@Log(module = EOperationModule.WALLET_CONFIG,business = EOperationBusiness.WITHDRAWAL_CONFIG,method = EOperationMethod.INSERT)
@Log(module = EOperationModule.WALLET_CONFIG, business = EOperationBusiness.WITHDRAWAL_CONFIG, method = EOperationMethod.INSERT)
@PostMapping("/save")
public AjaxResult save(@RequestBody @Valid BdWithdrawalExt withdrawalExt) {
if(StringUtils.isNull(withdrawalExt.getMinAmount())){
if (StringUtils.isNull(withdrawalExt.getMinAmount())) {
return AjaxResult.error(TransactionUtils.getContent(ConfigMsgConstants.MIN_AMOUNT_NOT_NULL));
}
if(StringUtils.isNull(withdrawalExt.getMaxAmount())){
if (StringUtils.isNull(withdrawalExt.getMaxAmount())) {
return AjaxResult.error(TransactionUtils.getContent(ConfigMsgConstants.MAX_AMOUNT_NOT_NULL));
}
if (withdrawalExt.getMaxAmount().compareTo(withdrawalExt.getMinAmount()) <0) {
if (withdrawalExt.getMaxAmount().compareTo(withdrawalExt.getMinAmount()) < 0) {
return AjaxResult.error(TransactionUtils.getContent(ConfigMsgConstants.COMPARISON_OF_SIZE));
}
if(StringUtils.isNull(withdrawalExt.getIsAuto())){
if (StringUtils.isNull(withdrawalExt.getIsAuto())) {
return AjaxResult.error(TransactionUtils.getContent(ConfigMsgConstants.IS_AUTO_NOT_NULL));
}
if(StringUtils.isNull(withdrawalExt.getIsRounding())){
if (StringUtils.isNull(withdrawalExt.getIsRounding())) {
return AjaxResult.error(TransactionUtils.getContent(ConfigMsgConstants.IS_ROUNDING_NOT_NULL));
}
if(StringUtils.isNull(withdrawalExt.getWithdrawalNumber())){
if (StringUtils.isNull(withdrawalExt.getWithdrawalNumber())) {
return AjaxResult.error(TransactionUtils.getContent(ConfigMsgConstants.WITHDRAWAL_NUMBER_NOT_NULL));
}
if(EYesNo.YES.getIntValue()==withdrawalExt.getIsAuto()){
if(StringUtils.isNull(withdrawalExt.getLowerBound())){
if (EYesNo.YES.getIntValue() == withdrawalExt.getIsAuto()) {
if (StringUtils.isNull(withdrawalExt.getLowerBound())) {
return AjaxResult.error(TransactionUtils.getContent(ConfigMsgConstants.LOWER_BOUND_NOT_NULL));
}
if(StringUtils.isNull(withdrawalExt.getUpperBound())){
if (StringUtils.isNull(withdrawalExt.getUpperBound())) {
return AjaxResult.error(TransactionUtils.getContent(ConfigMsgConstants.UPPER_BOUND_NOT_NULL));
}
if(CollectionUtil.isEmpty(withdrawalExt.getWithdrawalAutoList())){
if (CollectionUtil.isEmpty(withdrawalExt.getWithdrawalAutoList())) {
return AjaxResult.error(TransactionUtils.getContent(ConfigMsgConstants.WITHDRAWAL_CYCLE_NOT_NULL));
}
}
if(StringUtils.isNull(withdrawalExt.getEffectiveDate())){
if (StringUtils.isNull(withdrawalExt.getEffectiveDate())) {
return AjaxResult.error(TransactionUtils.getContent(ConfigMsgConstants.EFFECTIVE_DATE_NOT_NULL));
}
withdrawalExt.setPkCountry(SecurityUtils.getPkCountry());
withdrawalExt.setPkCreator(SecurityUtils.getUserId());
withdrawalExt.setCreationTime(new Date());
return toAjax(withdrawalService.saveWithdrawal(withdrawalExt));
return toAjax(iBdWithdrawalService.saveWithdrawal(withdrawalExt));
}
/**
* @description: 修改提现设置
* @author: zhang jing
* @date: 2022/8/30 10:21
* @param: [withdrawalParam]
* @return: com.hzs.common.core.web.domain.AjaxResult
* 修改提现设置
**/
@Log(module = EOperationModule.WALLET_CONFIG,business = EOperationBusiness.WITHDRAWAL_CONFIG,method = EOperationMethod.UPDATE)
@Log(module = EOperationModule.WALLET_CONFIG, business = EOperationBusiness.WITHDRAWAL_CONFIG, method = EOperationMethod.UPDATE)
@PostMapping("/update")
public AjaxResult update(@RequestBody BdWithdrawalExt withdrawalExt) {
if(StringUtils.isNull(withdrawalExt.getMinAmount())){
if (StringUtils.isNull(withdrawalExt.getMinAmount())) {
return AjaxResult.error(TransactionUtils.getContent(ConfigMsgConstants.MIN_AMOUNT_NOT_NULL));
}
if(StringUtils.isNull(withdrawalExt.getMaxAmount())){
if (StringUtils.isNull(withdrawalExt.getMaxAmount())) {
return AjaxResult.error(TransactionUtils.getContent(ConfigMsgConstants.MAX_AMOUNT_NOT_NULL));
}
if (withdrawalExt.getMaxAmount().compareTo(withdrawalExt.getMinAmount()) <0) {
if (withdrawalExt.getMaxAmount().compareTo(withdrawalExt.getMinAmount()) < 0) {
return AjaxResult.error(TransactionUtils.getContent(ConfigMsgConstants.COMPARISON_OF_SIZE));
}
if(StringUtils.isNull(withdrawalExt.getIsAuto())){
if (StringUtils.isNull(withdrawalExt.getIsAuto())) {
return AjaxResult.error(TransactionUtils.getContent(ConfigMsgConstants.IS_AUTO_NOT_NULL));
}
if(StringUtils.isNull(withdrawalExt.getIsRounding())){
if (StringUtils.isNull(withdrawalExt.getIsRounding())) {
return AjaxResult.error(TransactionUtils.getContent(ConfigMsgConstants.IS_ROUNDING_NOT_NULL));
}
if(StringUtils.isNull(withdrawalExt.getWithdrawalNumber())){
if (StringUtils.isNull(withdrawalExt.getWithdrawalNumber())) {
return AjaxResult.error(TransactionUtils.getContent(ConfigMsgConstants.WITHDRAWAL_NUMBER_NOT_NULL));
}
if(StringUtils.isNull(withdrawalExt.getEffectiveDate())){
if (StringUtils.isNull(withdrawalExt.getEffectiveDate())) {
return AjaxResult.error(TransactionUtils.getContent(ConfigMsgConstants.EFFECTIVE_DATE_NOT_NULL));
}
if(EYesNo.YES.getIntValue()==withdrawalExt.getIsAuto()){
if(StringUtils.isNull(withdrawalExt.getLowerBound())){
if (EYesNo.YES.getIntValue() == withdrawalExt.getIsAuto()) {
if (StringUtils.isNull(withdrawalExt.getLowerBound())) {
return AjaxResult.error(TransactionUtils.getContent(ConfigMsgConstants.LOWER_BOUND_NOT_NULL));
}
if(StringUtils.isNull(withdrawalExt.getUpperBound())){
if (StringUtils.isNull(withdrawalExt.getUpperBound())) {
return AjaxResult.error(TransactionUtils.getContent(ConfigMsgConstants.UPPER_BOUND_NOT_NULL));
}
if(CollectionUtil.isEmpty(withdrawalExt.getWithdrawalAutoList())){
if (CollectionUtil.isEmpty(withdrawalExt.getWithdrawalAutoList())) {
return AjaxResult.error(TransactionUtils.getContent(ConfigMsgConstants.WITHDRAWAL_CYCLE_NOT_NULL));
}
}
if(StringUtils.isNull(withdrawalExt.getEffectiveDate())){
if (StringUtils.isNull(withdrawalExt.getEffectiveDate())) {
return AjaxResult.error(TransactionUtils.getContent(ConfigMsgConstants.EFFECTIVE_DATE_NOT_NULL));
}
withdrawalExt.setPkModified(SecurityUtils.getUserId());
withdrawalExt.setModifiedTime(new Date());
return toAjax(withdrawalService.updateWithdrawal(withdrawalExt));
return toAjax(iBdWithdrawalService.updateWithdrawal(withdrawalExt));
}
/**
* @description: 查询单条提现设置
* @author: zhang jing
* @date: 2022/8/30 10:21
* @param: [pkId]
* @return: com.hzs.common.core.web.domain.AjaxResult
* 查询单条提现设置
**/
@Log(module = EOperationModule.WALLET_CONFIG,business = EOperationBusiness.WITHDRAWAL_CONFIG,method = EOperationMethod.SELECT)
@Log(module = EOperationModule.WALLET_CONFIG, business = EOperationBusiness.WITHDRAWAL_CONFIG, method = EOperationMethod.SELECT)
@GetMapping("/getOne/{pkId}")
public AjaxResult getOne(@PathVariable Integer pkId) {
BdWithdrawal withdrawalParam = withdrawalService.getById(pkId);
BdWithdrawal withdrawalParam = iBdWithdrawalService.getById(pkId);
BdWithdrawalExt withdrawalExt = BeanUtil.copyProperties(withdrawalParam, BdWithdrawalExt.class);
BdWithdrawalAutoExt withdrawalAutoExt=new BdWithdrawalAutoExt();
BdWithdrawalAutoExt withdrawalAutoExt = new BdWithdrawalAutoExt();
withdrawalAutoExt.setPkWithdrawal(pkId);
List<BdWithdrawalAutoExt> withdrawalAutoList =withdrawalService.getWithdrawalAutoList(withdrawalAutoExt);
if(CollectionUtil.isNotEmpty(withdrawalAutoList)){
List<BdWithdrawalAutoExt> withdrawalAutoList = iBdWithdrawalService.getWithdrawalAutoList(withdrawalAutoExt);
if (CollectionUtil.isNotEmpty(withdrawalAutoList)) {
withdrawalExt.setWithdrawalAutoList(withdrawalAutoList);
}else{
List<BdWithdrawalAutoExt> withdrawalAutoListNew=new ArrayList<>();
} else {
List<BdWithdrawalAutoExt> withdrawalAutoListNew = new ArrayList<>();
withdrawalExt.setWithdrawalAutoList(withdrawalAutoListNew);
}
return AjaxResult.success(withdrawalExt);
}
/**
* @description: 删除提现设置
* @author: zhang jing
* @date: 2022/8/30 10:21
* @param: [pkId]
* @return: com.hzs.common.core.web.domain.AjaxResult
* 删除提现设置
**/
@Log(module = EOperationModule.WALLET_CONFIG,business = EOperationBusiness.WITHDRAWAL_CONFIG,method = EOperationMethod.DELETE)
@Log(module = EOperationModule.WALLET_CONFIG, business = EOperationBusiness.WITHDRAWAL_CONFIG, method = EOperationMethod.DELETE)
@DeleteMapping("/{pkId}")
public AjaxResult delete(@PathVariable Long pkId) {
BdWithdrawalAutoExt withdrawalAutoExt =new BdWithdrawalAutoExt();
BdWithdrawalAutoExt withdrawalAutoExt = new BdWithdrawalAutoExt();
withdrawalAutoExt.setPkCountry(SecurityUtils.getPkCountry());
Integer count= withdrawalService.checkWithdraw(withdrawalAutoExt);
if(count>0){
Integer count = iBdWithdrawalService.checkWithdraw(withdrawalAutoExt);
if (count > 0) {
return AjaxResult.error(TransactionUtils.getContent(ConfigMsgConstants.ENABLE_STATE_NOT_DELETE));
}
UpdateWrapper<BdWithdrawal> updateWrapper = new UpdateWrapper<>();
updateWrapper.eq("PK_ID", pkId);
updateWrapper.set("DEL_FLAG", EDelFlag.DELETE.getValue());
updateWrapper.set("PK_MODIFIED", SecurityUtils.getUserId());
updateWrapper.set("MODIFIED_TIME", new Date());
redisService.deleteObjectByKey(CacheConstants.BD_WITHDRAWAL + SecurityUtils.getPkCountry());
redisService.deleteObjectByKey(CacheConstants.BD_WITHDRAWAL_IS_AUTO + SecurityUtils.getPkCountry());
redisService.deleteObjectByKey(CacheConstants.BD_WITHDRAWAL_AUTO + SecurityUtils.getPkCountry());
return toAjax(withdrawalService.update(updateWrapper));
LambdaUpdateWrapper<BdWithdrawal> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(BdWithdrawal::getPkId, pkId);
updateWrapper.set(BdWithdrawal::getDelFlag, EDelFlag.DELETE.getValue());
updateWrapper.set(BdWithdrawal::getPkModified, SecurityUtils.getUserId());
updateWrapper.set(BdWithdrawal::getModifiedTime, new Date());
return toAjax(iBdWithdrawalService.update(updateWrapper));
}
}

View File

@ -1,17 +1,14 @@
package com.hzs.system.config.controller.manage;
import cn.hutool.core.bean.BeanUtil;
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.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.EDelFlag;
import com.hzs.common.core.enums.EOperationBusiness;
import com.hzs.common.core.enums.EOperationMethod;
import com.hzs.common.core.enums.EOperationModule;
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;
@ -21,12 +18,8 @@ import com.hzs.common.domain.system.config.BdWithdrawalProcess;
import com.hzs.common.domain.system.config.ext.BdWithdrawalAutoExt;
import com.hzs.common.domain.system.config.ext.BdWithdrawalProcessExt;
import com.hzs.common.security.utils.SecurityUtils;
import com.hzs.system.base.ITransactionServiceApi;
import com.hzs.system.base.service.IBdCurrencyService;
import com.hzs.system.config.IWithdrawalServiceApi;
import com.hzs.system.config.service.IBdWithdrawalProcessService;
import com.hzs.system.config.service.IBdWithdrawalService;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@ -37,175 +30,126 @@ import java.util.Date;
import java.util.List;
/**
* <p>
* 提现手续费手续费配置 前端控制器
* </p>
*
* @author zhangjing
* @since 2022-11-02
*/
@RestController
@RequestMapping("/manage/bd-withdrawal-process")
public class BdWithdrawalProcessController extends BaseController {
@Autowired
private IBdWithdrawalProcessService withdrawalProcessService;
@DubboReference
private ITransactionServiceApi iTransactionServiceApi;
private RedisService redisService;
@DubboReference
private IWithdrawalServiceApi withdrawalProcessServiceApi;
private IBdWithdrawalProcessService iBdWithdrawalProcessService;
@Autowired
private IBdWithdrawalService withdrawalService;
@Autowired
IBdCurrencyService currencyService;
@Autowired
public void setRedisService(RedisService redisService) {
this.redisService = redisService;
}
private IBdWithdrawalService iBdWithdrawalService;
/**
* @description: 查询提现手续费设置列表 理论每个国家只有一个提现手续费配置
* @author: zhang jing
* @date: 2022/8/30 10:20
* @param: [withdrawalParam]
* @return: com.hzs.common.core.web.page.TableDataInfo
* 查询提现手续费设置列表 理论每个国家只有一个提现手续费配置
**/
@Log(module = EOperationModule.WALLET_CONFIG,business = EOperationBusiness.WITHDRAWAL_SERVICE_CHARGE,method = EOperationMethod.SELECT)
@Log(module = EOperationModule.WALLET_CONFIG, business = EOperationBusiness.WITHDRAWAL_SERVICE_CHARGE, method = EOperationMethod.SELECT)
@GetMapping("/list")
public TableDataInfo list(BdWithdrawalProcess withdrawalProcess) {
public TableDataInfo list() {
startPage();
QueryWrapper<BdWithdrawalProcess> queryWrapper = new QueryWrapper();
queryWrapper.eq("PK_COUNTRY", SecurityUtils.getPkCountry());
queryWrapper.orderByDesc("CREATION_TIME");
List<BdWithdrawalProcess> list = withdrawalProcessService.list(queryWrapper);
List<BdWithdrawalProcessExt> listExt=new ArrayList<>();
LambdaQueryWrapper<BdWithdrawalProcess> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(BdWithdrawalProcess::getPkCountry, SecurityUtils.getPkCountry());
queryWrapper.orderByDesc(BdWithdrawalProcess::getCreationTime);
List<BdWithdrawalProcess> list = iBdWithdrawalProcessService.list(queryWrapper);
List<BdWithdrawalProcessExt> listExt = new ArrayList<>();
list.forEach(item -> listExt.add(BeanUtil.copyProperties(item, BdWithdrawalProcessExt.class)));
return getDataTable(listExt);
}
/**
* @description: 导出提现手续费配置
* @author: zhang jing
* @date: 2023/3/3 17:07
* @param: [response, withdrawalProcess]
* @return: void
* 导出提现手续费配置
**/
@Log(module = EOperationModule.WALLET_CONFIG,business = EOperationBusiness.WITHDRAWAL_SERVICE_CHARGE,method = EOperationMethod.EXPORT)
@Log(module = EOperationModule.WALLET_CONFIG, business = EOperationBusiness.WITHDRAWAL_SERVICE_CHARGE, method = EOperationMethod.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, BdWithdrawalProcess withdrawalProcess) {
QueryWrapper<BdWithdrawalProcess> queryWrapper = new QueryWrapper();
queryWrapper.eq("PK_COUNTRY", SecurityUtils.getPkCountry());
queryWrapper.orderByDesc("CREATION_TIME");
List<BdWithdrawalProcess> list = withdrawalProcessService.list(queryWrapper);
List<BdWithdrawalProcessExt> listExt=new ArrayList<>();
public void export(HttpServletResponse response) {
LambdaQueryWrapper<BdWithdrawalProcess> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(BdWithdrawalProcess::getPkCountry, SecurityUtils.getPkCountry());
queryWrapper.orderByDesc(BdWithdrawalProcess::getCreationTime);
List<BdWithdrawalProcess> list = iBdWithdrawalProcessService.list(queryWrapper);
List<BdWithdrawalProcessExt> listExt = new ArrayList<>();
list.forEach(item -> listExt.add(BeanUtil.copyProperties(item, BdWithdrawalProcessExt.class)));
ExcelUtil<BdWithdrawalProcessExt> util = new ExcelUtil<>(BdWithdrawalProcessExt.class);
util.exportExcel(response, listExt, "提现手续费配置");
}
/**
* @description: 新增提现手续费设置
* @author: zhang jing
* @date: 2022/8/30 10:21
* @param: [withdrawalParam]
* @return: com.hzs.common.core.web.domain.AjaxResult
* 新增提现手续费设置
**/
@Log(module = EOperationModule.WALLET_CONFIG,business = EOperationBusiness.WITHDRAWAL_SERVICE_CHARGE,method = EOperationMethod.INSERT)
@Log(module = EOperationModule.WALLET_CONFIG, business = EOperationBusiness.WITHDRAWAL_SERVICE_CHARGE, method = EOperationMethod.INSERT)
@PostMapping("/save")
public AjaxResult save(@RequestBody @Valid BdWithdrawalProcess withdrawalProcess) {
if(StringUtils.isNull(withdrawalProcess.getServiceType())){
if (StringUtils.isNull(withdrawalProcess.getServiceType())) {
return AjaxResult.error(ConfigMsgConstants.SERVICE_TYPE_NOT_NULL);
}
if(StringUtils.isNull(withdrawalProcess.getServiceRatio())){
if (StringUtils.isNull(withdrawalProcess.getServiceRatio())) {
return AjaxResult.error(ConfigMsgConstants.SERVICE_RATIO_NOT_NULL);
}
if(StringUtils.isNull(withdrawalProcess.getEffectiveDate())){
if (StringUtils.isNull(withdrawalProcess.getEffectiveDate())) {
return AjaxResult.error(ConfigMsgConstants.EFFECTIVE_DATE_NOT_NULL);
}
QueryWrapper<BdWithdrawalProcess> queryWrapper=new QueryWrapper();
queryWrapper.eq("PK_COUNTRY",SecurityUtils.getPkCountry());
BdWithdrawalProcess withdrawalProcessCheck=withdrawalProcessService.getOne(queryWrapper);
if(StringUtils.isNotNull(withdrawalProcessCheck)){
LambdaQueryWrapper<BdWithdrawalProcess> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(BdWithdrawalProcess::getPkCountry, SecurityUtils.getPkCountry());
BdWithdrawalProcess withdrawalProcessCheck = iBdWithdrawalProcessService.getOne(queryWrapper);
if (StringUtils.isNotNull(withdrawalProcessCheck)) {
return AjaxResult.error(ConfigMsgConstants.SERVICE_TYPE_REPEAT);
}
withdrawalProcess.setPkCountry(SecurityUtils.getPkCountry());
withdrawalProcess.setPkCreator(SecurityUtils.getUserId());
withdrawalProcess.setCreationTime(new Date());
redisService.deleteObject(CacheConstants.BD_WITHDRAWAL_PROCESS + SecurityUtils.getPkCountry());
return toAjax(withdrawalProcessService.save(withdrawalProcess));
return toAjax(iBdWithdrawalProcessService.save(withdrawalProcess));
}
/**
* @description: 修改提现手续费设置
* @author: zhang jing
* @date: 2022/8/30 10:21
* @param: [withdrawalParam]
* @return: com.hzs.common.core.web.domain.AjaxResult
* 修改提现手续费设置
**/
@Log(module = EOperationModule.WALLET_CONFIG,business = EOperationBusiness.WITHDRAWAL_SERVICE_CHARGE,method = EOperationMethod.UPDATE)
@Log(module = EOperationModule.WALLET_CONFIG, business = EOperationBusiness.WITHDRAWAL_SERVICE_CHARGE, method = EOperationMethod.UPDATE)
@PostMapping("/update")
public AjaxResult update(@RequestBody BdWithdrawalProcess withdrawalProcess) {
if(StringUtils.isNull(withdrawalProcess.getServiceType())){
if (StringUtils.isNull(withdrawalProcess.getServiceType())) {
return AjaxResult.error(ConfigMsgConstants.SERVICE_TYPE_NOT_NULL);
}
if(StringUtils.isNull(withdrawalProcess.getServiceRatio())){
if (StringUtils.isNull(withdrawalProcess.getServiceRatio())) {
return AjaxResult.error(ConfigMsgConstants.SERVICE_RATIO_NOT_NULL);
}
if(StringUtils.isNull(withdrawalProcess.getEffectiveDate())){
if (StringUtils.isNull(withdrawalProcess.getEffectiveDate())) {
return AjaxResult.error(ConfigMsgConstants.EFFECTIVE_DATE_NOT_NULL);
}
withdrawalProcess.setPkCountry(SecurityUtils.getPkCountry());
withdrawalProcess.setPkModified(SecurityUtils.getUserId());
withdrawalProcess.setModifiedTime(new Date());
redisService.deleteObject(CacheConstants.BD_WITHDRAWAL_PROCESS + SecurityUtils.getPkCountry());
return toAjax(withdrawalProcessService.updateById(withdrawalProcess));
return toAjax(iBdWithdrawalProcessService.updateById(withdrawalProcess));
}
/**
* @description: 查询单条提现手续费设置
* @author: zhang jing
* @date: 2022/8/30 10:21
* @param: [pkId]
* @return: com.hzs.common.core.web.domain.AjaxResult
* 查询单条提现手续费设置
**/
@Log(module = EOperationModule.WALLET_CONFIG,business = EOperationBusiness.WITHDRAWAL_SERVICE_CHARGE,method = EOperationMethod.SELECT)
@Log(module = EOperationModule.WALLET_CONFIG, business = EOperationBusiness.WITHDRAWAL_SERVICE_CHARGE, method = EOperationMethod.SELECT)
@GetMapping("/getOne/{pkId}")
public AjaxResult getOne(@PathVariable Integer pkId) {
BdWithdrawalProcess withdrawalProcess = withdrawalProcessService.getById(pkId);
BdWithdrawalProcess withdrawalProcess = iBdWithdrawalProcessService.getById(pkId);
BdWithdrawalProcessExt withdrawalProcessExt = BeanUtil.copyProperties(withdrawalProcess, BdWithdrawalProcessExt.class);
return AjaxResult.success(withdrawalProcessExt);
}
/**
* @description: 删除提现手续费设置
* @author: zhang jing
* @date: 2022/8/30 10:21
* @param: [pkId]
* @return: com.hzs.common.core.web.domain.AjaxResult
* 删除提现手续费设置
**/
@Log(module = EOperationModule.WALLET_CONFIG,business = EOperationBusiness.WITHDRAWAL_SERVICE_CHARGE,method = EOperationMethod.DELETE)
@Log(module = EOperationModule.WALLET_CONFIG, business = EOperationBusiness.WITHDRAWAL_SERVICE_CHARGE, method = EOperationMethod.DELETE)
@DeleteMapping("/{pkId}")
public AjaxResult delete(@PathVariable Long pkId) {
BdWithdrawalAutoExt withdrawalAutoExt =new BdWithdrawalAutoExt();
BdWithdrawalAutoExt withdrawalAutoExt = new BdWithdrawalAutoExt();
withdrawalAutoExt.setPkCountry(SecurityUtils.getPkCountry());
Integer count= withdrawalService.checkWithdraw(withdrawalAutoExt);
if(count>0){
Integer count = iBdWithdrawalService.checkWithdraw(withdrawalAutoExt);
if (count > 0) {
return AjaxResult.error(ConfigMsgConstants.ENABLE_STATE_NOT_DELETE);
}
UpdateWrapper<BdWithdrawalProcess> updateWrapper = new UpdateWrapper<>();
updateWrapper.eq("PK_ID", pkId);
updateWrapper.set("DEL_FLAG", EDelFlag.DELETE.getValue());
updateWrapper.set("PK_MODIFIED", SecurityUtils.getUserId());
updateWrapper.set("MODIFIED_TIME", new Date());
redisService.deleteObject(CacheConstants.BD_WITHDRAWAL + SecurityUtils.getPkCountry());
return toAjax(withdrawalProcessService.update(updateWrapper));
LambdaUpdateWrapper<BdWithdrawalProcess> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(BdWithdrawalProcess::getPkId, pkId);
updateWrapper.set(BdWithdrawalProcess::getDelFlag, EDelFlag.DELETE.getValue());
updateWrapper.set(BdWithdrawalProcess::getPkModified, SecurityUtils.getUserId());
updateWrapper.set(BdWithdrawalProcess::getModifiedTime, new Date());
return toAjax(iBdWithdrawalProcessService.update(updateWrapper));
}
}

View File

@ -1,13 +1,10 @@
package com.hzs.system.config.controller.manage;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.hzs.common.core.constant.CacheConstants;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.hzs.common.core.constant.msg.ConfigMsgConstants;
import com.hzs.common.core.domain.R;
import com.hzs.common.core.enums.EDelFlag;
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;
@ -27,12 +24,7 @@ import java.util.Date;
import java.util.List;
/**
* <p>
* 提现设置特殊配置 前端控制器
* </p>
*
* @author zhangjing
* @since 2022-09-06
*/
@Slf4j
@RestController
@ -40,44 +32,29 @@ import java.util.List;
public class BdWithdrawalSpecialController extends BaseController {
@Autowired
private IBdWithdrawalSpecialService withdrawalSpecialService;
private IBdWithdrawalSpecialService iBdWithdrawalSpecialService;
@DubboReference
IMemberServiceApi iMemberServiceApi;
private RedisService redisService;
@Autowired
public void setRedisService(RedisService redisService) {
this.redisService = redisService;
}
/**
* @description: 查询提现设置特殊配置列表
* @author: zhang jing
* @date: 2022/8/30 10:20
* @param: [bdWithdrawal]
* @return: com.hzs.common.core.web.page.TableDataInfo
* 查询提现设置特殊配置列表
**/
@GetMapping("/list")
public TableDataInfo list(BdWithdrawalSpecial withdrawalSpecial) {
startPage();
QueryWrapper<BdWithdrawalSpecial> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("PK_COUNTRY", SecurityUtils.getPkCountry());
LambdaQueryWrapper<BdWithdrawalSpecial> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(BdWithdrawalSpecial::getPkCountry, SecurityUtils.getPkCountry());
if (StringUtils.isNotNull(withdrawalSpecial.getPkWithdrawal())) {
queryWrapper.eq("PK_WITHDRAWAL", withdrawalSpecial.getPkWithdrawal());
queryWrapper.eq(BdWithdrawalSpecial::getPkWithdrawal, withdrawalSpecial.getPkWithdrawal());
}
queryWrapper.orderByDesc("CREATION_TIME");
List<BdWithdrawalSpecial> list = withdrawalSpecialService.list(queryWrapper);
queryWrapper.orderByDesc(BdWithdrawalSpecial::getCreationTime);
List<BdWithdrawalSpecial> list = iBdWithdrawalSpecialService.list(queryWrapper);
return getDataTable(list);
}
/**
* @description: 新增提现设置特殊配置
* @author: zhang jing
* @date: 2022/8/30 10:21
* @param: [bdWithdrawal]
* @return: com.hzs.common.core.web.domain.AjaxResult
* 新增提现设置特殊配置
**/
@PostMapping("/save")
public AjaxResult save(@RequestBody BdWithdrawalSpecial withdrawalSpecial) {
@ -92,17 +69,12 @@ public class BdWithdrawalSpecialController extends BaseController {
withdrawalSpecial.setPkCountry(SecurityUtils.getPkCountry());
withdrawalSpecial.setPkCreator(SecurityUtils.getUserId());
withdrawalSpecial.setCreationTime(new Date());
redisService.deleteObject(CacheConstants.BD_WITHDRAWAL_SPECIAL + SecurityUtils.getPkCountry());
return toAjax(withdrawalSpecialService.save(withdrawalSpecial));
return toAjax(iBdWithdrawalSpecialService.save(withdrawalSpecial));
}
/**
* @description: 修改提现设置特殊配置
* @author: zhang jing
* @date: 2022/8/30 10:21
* @param: [bdWithdrawal]
* @return: com.hzs.common.core.web.domain.AjaxResult
* 修改提现设置特殊配置
**/
@PostMapping("/update")
public AjaxResult update(@RequestBody BdWithdrawalSpecial withdrawalSpecial) {
@ -116,40 +88,30 @@ public class BdWithdrawalSpecialController extends BaseController {
}
withdrawalSpecial.setPkModified(SecurityUtils.getUserId());
withdrawalSpecial.setModifiedTime(new Date());
redisService.deleteObject(CacheConstants.BD_WITHDRAWAL_SPECIAL + SecurityUtils.getPkCountry());
return toAjax(withdrawalSpecialService.updateById(withdrawalSpecial));
return toAjax(iBdWithdrawalSpecialService.updateById(withdrawalSpecial));
}
/**
* @description: 查询单条提现设置特殊配置
* @author: zhang jing
* @date: 2022/8/30 10:21
* @param: [pkId]
* @return: com.hzs.common.core.web.domain.AjaxResult
* 查询单条提现设置特殊配置
**/
@GetMapping("/getOne/{pkId}")
public AjaxResult getOne(@PathVariable Long pkId) {
BdWithdrawalSpecial withdrawalSpecial = withdrawalSpecialService.getById(pkId);
BdWithdrawalSpecial withdrawalSpecial = iBdWithdrawalSpecialService.getById(pkId);
return AjaxResult.success(withdrawalSpecial);
}
/**
* @description: 删除提现设置特殊配置
* @author: zhang jing
* @date: 2022/8/30 10:21
* @param: [pkId]
* @return: com.hzs.common.core.web.domain.AjaxResult
* 删除提现设置特殊配置
**/
@DeleteMapping("/{pkId}")
public AjaxResult delete(@PathVariable Long pkId) {
UpdateWrapper<BdWithdrawalSpecial> updateWrapper = new UpdateWrapper<>();
updateWrapper.eq("PK_ID", pkId);
updateWrapper.set("DEL_FLAG", EDelFlag.DELETE.getValue());
updateWrapper.set("PK_MODIFIED", SecurityUtils.getUserId());
updateWrapper.set("MODIFIED_TIME", new Date());
redisService.deleteObject(CacheConstants.BD_WITHDRAWAL_SPECIAL + SecurityUtils.getPkCountry());
return toAjax(withdrawalSpecialService.update(updateWrapper));
LambdaUpdateWrapper<BdWithdrawalSpecial> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(BdWithdrawalSpecial::getPkId, pkId);
updateWrapper.set(BdWithdrawalSpecial::getDelFlag, EDelFlag.DELETE.getValue());
updateWrapper.set(BdWithdrawalSpecial::getPkModified, SecurityUtils.getUserId());
updateWrapper.set(BdWithdrawalSpecial::getModifiedTime, new Date());
return toAjax(iBdWithdrawalSpecialService.update(updateWrapper));
}
}

View File

@ -1,16 +1,10 @@
package com.hzs.system.config.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hzs.common.domain.system.config.BdWithdrawalAuto;
/**
* <p>
* 自动提现明细表 Mapper 接口
* </p>
*
* @author zhangjing
* @since 2022-08-31
*/
public interface BdWithdrawalAutoMapper extends BaseMapper<BdWithdrawalAuto> {

View File

@ -1,16 +1,10 @@
package com.hzs.system.config.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hzs.common.domain.system.config.BdWithdrawalProcess;
/**
* <p>
* 提现手续费配置 Mapper 接口
* </p>
*
* @author zhangjing
* @since 2022-11-02
*/
public interface BdWithdrawalProcessMapper extends BaseMapper<BdWithdrawalProcess> {

View File

@ -1,16 +1,10 @@
package com.hzs.system.config.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hzs.common.domain.system.config.BdWithdrawalSpecial;
/**
* <p>
* 提现设置特殊配置 Mapper 接口
* </p>
*
* @author zhangjing
* @since 2022-09-06
*/
public interface BdWithdrawalSpecialMapper extends BaseMapper<BdWithdrawalSpecial> {

View File

@ -1,36 +0,0 @@
package com.hzs.system.config.provider;
import com.hzs.common.core.domain.R;
import com.hzs.common.domain.system.config.BdWithdrawalAuto;
import com.hzs.system.config.IWithdrawalAutoServiceApi;
import com.hzs.system.config.service.IBdWithdrawalAutoService;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
/**
* @Description: 提现配置的dubbo服务类
* @Author: zhang jing
* @Time: 2022/9/9 14:11
* @Classname: GradeServiceProvider
* @PackageName: com.hzs.system.config.provider
*/
@DubboService
public class WithdrawalAutoServiceProvider implements IWithdrawalAutoServiceApi {
@Autowired
private IBdWithdrawalAutoService withdrawalAutoService;
/**
* @description: 根据国家查询自动提现明细列表
* @author: zhang jing
* @date: 2022/9/27 15:20
* @param: [pkCountry]
* @return: com.hzs.common.core.domain.R<java.util.List<com.hzs.common.domain.system.config.BdWithdrawalAuto>>
**/
@Override
public R<List<BdWithdrawalAuto>> queryWithdrawalAuto(Integer pkCountry) {
return R.ok(withdrawalAutoService.queryWithdrawalAuto(pkCountry));
}
}

View File

@ -1,44 +0,0 @@
package com.hzs.system.config.provider;
import com.hzs.common.core.domain.R;
import com.hzs.common.domain.system.config.BdWithdrawalSpecial;
import com.hzs.system.config.IWithdrawalSpecialServiceApi;
import com.hzs.system.config.service.IBdWithdrawalSpecialService;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
@DubboService
public class WithdrawalSpecialServiceProvider implements IWithdrawalSpecialServiceApi {
@Autowired
private IBdWithdrawalSpecialService withdrawalSpecialService;
/**
* @description: 根据国家查询提现设置特殊配置
* @author: zhang jing
* @date: 2022/9/27 16:24
* @param: [pkCountry]
* @return: com.hzs.common.core.domain.R<java.util.List<com.hzs.common.domain.system.config.BdWithdrawalSpecial>>
**/
@Override
public R<List<BdWithdrawalSpecial>> queryWithdrawalSpecial(Integer pkCountry) {
return R.ok(withdrawalSpecialService.queryWithdrawalSpecial(pkCountry));
}
/**
* @description: 根据会员编号查询提现特殊配置
* @author: zhang jing
* @date: 2022/9/27 16:34
* @param: [pkCountry, memberCode]
* @return: com.hzs.common.core.domain.R<com.hzs.common.domain.system.config.BdWithdrawalSpecial>
**/
@Override
public R<BdWithdrawalSpecial> getWithdrawalSpecial(Integer pkCountry, String memberCode) {
return R.ok(withdrawalSpecialService.getWithdrawalSpecial(pkCountry,memberCode));
}
}

View File

@ -1,20 +1,11 @@
package com.hzs.system.config.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hzs.common.domain.system.config.BdWithdrawalAuto;
import java.util.List;
/**
* <p>
* 自动提现明细表 服务类
* </p>
*
* @author zhangjing
* @since 2022-08-31
*/
public interface IBdWithdrawalAutoService extends IService<BdWithdrawalAuto> {
List<BdWithdrawalAuto> queryWithdrawalAuto(Integer pkCountry);
}

View File

@ -1,27 +1,16 @@
package com.hzs.system.config.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hzs.common.domain.system.config.BdWithdrawalProcess;
import java.util.List;
/**
* <p>
* 提现手续费配置 服务类
* </p>
*
* @author zhangjing
* @since 2022-11-02
*/
public interface IBdWithdrawalProcessService extends IService<BdWithdrawalProcess> {
/**
* @description: 根据国家查询提现手续费配置
* @author: zhang jing
* @date: 2022/11/2 17:14
* @param: [pkCountry]
* @return: java.util.List<com.hzs.common.domain.system.config.BdWithdrawalProcess>
* 根据国家查询提现手续费配置
**/
BdWithdrawalProcess queryBdWithdrawalProcess(Integer pkCountry);
}

View File

@ -1,35 +1,11 @@
package com.hzs.system.config.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hzs.common.domain.system.config.BdWithdrawalSpecial;
import java.util.List;
/**
* <p>
* 提现设置特殊配置 服务类
* </p>
*
* @author zhangjing
* @since 2022-09-06
*/
public interface IBdWithdrawalSpecialService extends IService<BdWithdrawalSpecial> {
/**
* @description: 根据国家查询提现设置特殊配置
* @author: zhang jing
* @date: 2022/9/27 16:24
* @param: [pkCountry]
* @return: java.util.List<com.hzs.common.domain.system.config.BdWithdrawalSpecial>
**/
List<BdWithdrawalSpecial> queryWithdrawalSpecial(Integer pkCountry);
/**
* @description: 根据会员编号查询提现特殊配置
* @author: zhang jing
* @date: 2022/9/27 16:34
* @param: [pkCountry, memberCode]
* @return: com.hzs.common.domain.system.config.BdWithdrawalSpecial
**/
BdWithdrawalSpecial getWithdrawalSpecial(Integer pkCountry, String memberCode);
}

View File

@ -1,56 +1,15 @@
package com.hzs.system.config.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hzs.common.core.constant.CacheConstants;
import com.hzs.common.core.service.RedisService;
import com.hzs.common.core.utils.DateUtils;
import com.hzs.common.domain.system.config.BdWithdrawalAuto;
import com.hzs.system.config.mapper.BdWithdrawalAutoMapper;
import com.hzs.system.config.service.IBdWithdrawalAutoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* <p>
* 自动提现明细表 服务实现类
* </p>
*
* @author zhangjing
* @since 2022-08-31
*/
@Service
public class BdWithdrawalAutoServiceImpl extends ServiceImpl<BdWithdrawalAutoMapper, BdWithdrawalAuto> implements IBdWithdrawalAutoService {
private RedisService redisService;
@Autowired
public void setRedisService(RedisService redisService) {
this.redisService = redisService;
}
/**
* @description: 根据国家查询自动提现明细列表
* @author: zhang jing
* @date: 2022/9/27 14:59
* @param: [pkCountry]
* @return: java.util.List<com.hzs.common.domain.system.config.BdWithdrawalAuto>
**/
@Override
public List<BdWithdrawalAuto> queryWithdrawalAuto(Integer pkCountry) {
List<BdWithdrawalAuto> withdrawalAuto = redisService.getCacheObject(CacheConstants.BD_WITHDRAWAL_AUTO + pkCountry);
if(CollectionUtil.isEmpty(withdrawalAuto)){
QueryWrapper<BdWithdrawalAuto> queryWrapper = new QueryWrapper();
queryWrapper.eq("PK_COUNTRY",pkCountry);
withdrawalAuto = baseMapper.selectList(queryWrapper);
if(CollectionUtil.isNotEmpty(withdrawalAuto)){
redisService.setCacheObject(CacheConstants.BD_WITHDRAWAL_AUTO + pkCountry, withdrawalAuto);
}
}
return withdrawalAuto;
}
}

View File

@ -1,6 +1,6 @@
package com.hzs.system.config.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hzs.common.core.utils.DateUtils;
import com.hzs.common.domain.system.config.BdWithdrawalProcess;
@ -8,31 +8,17 @@ import com.hzs.system.config.mapper.BdWithdrawalProcessMapper;
import com.hzs.system.config.service.IBdWithdrawalProcessService;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* <p>
* 提现手续费配置 服务实现类
* </p>
*
* @author zhangjing
* @since 2022-11-02
*/
@Service
public class BdWithdrawalProcessServiceImpl extends ServiceImpl<BdWithdrawalProcessMapper, BdWithdrawalProcess> implements IBdWithdrawalProcessService {
/**
* @description: 根据国家查询提现手续费配置
* @author: zhang jing
* @date: 2022/11/2 17:16
* @param: [pkCountry]
* @return: java.util.List<com.hzs.common.domain.system.config.BdWithdrawalProcess>
**/
@Override
public BdWithdrawalProcess queryBdWithdrawalProcess(Integer pkCountry) {
QueryWrapper<BdWithdrawalProcess> queryWrapper=new QueryWrapper();
queryWrapper.eq("PK_COUNTRY",pkCountry);
queryWrapper.le("EFFECTIVE_DATE", DateUtils.currentDateTime());
LambdaQueryWrapper<BdWithdrawalProcess> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(BdWithdrawalProcess::getPkCountry, pkCountry);
queryWrapper.le(BdWithdrawalProcess::getEffectiveDate, DateUtils.currentDateTime());
return baseMapper.selectOne(queryWrapper);
}
}

View File

@ -3,9 +3,7 @@ package com.hzs.system.config.service.impl;
import cn.hutool.core.collection.CollectionUtil;
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.enums.EDelFlag;
import com.hzs.common.core.service.RedisService;
import com.hzs.common.domain.system.config.BdWithdrawal;
import com.hzs.common.domain.system.config.BdWithdrawalAuto;
import com.hzs.common.domain.system.config.ext.BdWithdrawalAutoExt;
@ -27,8 +25,6 @@ import java.util.List;
@Service
public class BdWithdrawalServiceImpl extends ServiceImpl<BdWithdrawalMapper, BdWithdrawal> implements IBdWithdrawalService {
@Autowired
private RedisService redisService;
@Autowired
private IBdWithdrawalAutoService iBdWithdrawalAutoService;
@ -64,9 +60,6 @@ public class BdWithdrawalServiceImpl extends ServiceImpl<BdWithdrawalMapper, BdW
wao.setCreationTime(new Date());
iBdWithdrawalAutoService.save(wao);
}
redisService.deleteObjectByKey(CacheConstants.BD_WITHDRAWAL + SecurityUtils.getPkCountry());
redisService.deleteObjectByKey(CacheConstants.BD_WITHDRAWAL_IS_AUTO + SecurityUtils.getPkCountry());
redisService.deleteObjectByKey(CacheConstants.BD_WITHDRAWAL_AUTO + SecurityUtils.getPkCountry());
return true;
}
@ -86,9 +79,6 @@ public class BdWithdrawalServiceImpl extends ServiceImpl<BdWithdrawalMapper, BdW
wao.setCreationTime(new Date());
iBdWithdrawalAutoService.save(wao);
}
redisService.deleteObjectByKey(CacheConstants.BD_WITHDRAWAL + SecurityUtils.getPkCountry());
redisService.deleteObjectByKey(CacheConstants.BD_WITHDRAWAL_IS_AUTO + SecurityUtils.getPkCountry());
redisService.deleteObjectByKey(CacheConstants.BD_WITHDRAWAL_AUTO + SecurityUtils.getPkCountry());
return true;
}

View File

@ -1,78 +1,15 @@
package com.hzs.system.config.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hzs.common.core.constant.CacheConstants;
import com.hzs.common.core.service.RedisService;
import com.hzs.common.domain.system.config.BdWithdrawalSpecial;
import com.hzs.system.config.mapper.BdWithdrawalSpecialMapper;
import com.hzs.system.config.service.IBdWithdrawalSpecialService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* <p>
* 提现设置特殊配置 服务实现类
* </p>
*
* @author zhangjing
* @since 2022-09-06
*/
@Service
public class BdWithdrawalSpecialServiceImpl extends ServiceImpl<BdWithdrawalSpecialMapper, BdWithdrawalSpecial> implements IBdWithdrawalSpecialService {
private RedisService redisService;
@Autowired
public void setRedisService(RedisService redisService) {
this.redisService = redisService;
}
/**
* @description: 根据国家查询提现设置特殊配置
* @author: zhang jing
* @date: 2022/9/27 16:23
* @param: [pkCountry]
* @return: java.util.List<com.hzs.common.domain.system.config.BdWithdrawalSpecial>
**/
@Override
public List<BdWithdrawalSpecial> queryWithdrawalSpecial(Integer pkCountry) {
List<BdWithdrawalSpecial> withdrawalSpecial = redisService.getCacheObject(CacheConstants.BD_WITHDRAWAL_SPECIAL + pkCountry);
if(null == withdrawalSpecial){
QueryWrapper<BdWithdrawalSpecial> queryWrapper = new QueryWrapper();
queryWrapper.eq("PK_COUNTRY",pkCountry);
withdrawalSpecial = baseMapper.selectList(queryWrapper);
if(null != withdrawalSpecial){
redisService.setCacheObject(CacheConstants.BD_WITHDRAWAL_SPECIAL + pkCountry, withdrawalSpecial);
}
}
return withdrawalSpecial;
}
/**
* @description: 根据会员编号查询提现特殊配置
* @author: zhang jing
* @date: 2022/9/27 16:34
* @param: [pkCountry, memberCode]
* @return: com.hzs.common.domain.system.config.BdWithdrawalSpecial
**/
@Override
public BdWithdrawalSpecial getWithdrawalSpecial(Integer pkCountry, String memberCode) {
BdWithdrawalSpecial withdrawalSpecial = redisService.getCacheObject(CacheConstants.BD_WITHDRAWAL_SPECIAL_MEMBER_CODE + memberCode);
if(null == withdrawalSpecial){
QueryWrapper<BdWithdrawalSpecial> queryWrapper = new QueryWrapper();
queryWrapper.eq("PK_COUNTRY",pkCountry);
queryWrapper.eq("MEMBER_CODE",memberCode);
withdrawalSpecial = baseMapper.selectOne(queryWrapper);
if(null != withdrawalSpecial){
redisService.setCacheObject(CacheConstants.BD_WITHDRAWAL_SPECIAL_MEMBER_CODE + memberCode, withdrawalSpecial);
}
}
return withdrawalSpecial;
}
}

View File

@ -36,7 +36,6 @@ public class BdTradeConfigVO implements Serializable {
/**
* 1:提现 2:转账 (来源枚举EBusinessModule)
*/
@Transaction(transactionKey = EnumsPrefixConstants.BUSINESS_MODULE)
private Integer businessModule;
private String businessModuleVal;

View File

@ -2,23 +2,4 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hzs.system.base.mapper.BdCurrencyMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.hzs.common.domain.system.base.BdCurrency">
<id column="PK_ID" property="pkId"/>
<result column="NAME" property="name"/>
<result column="ENABLE_STATE" property="enableState"/>
<result column="IN_EXCHANGE_RATE" property="inExchangeRate"/>
<result column="OUT_EXCHANGE_RATE" property="outExchangeRate"/>
<result column="SYMBOL" property="symbol"/>
<result column="IS_CURRENCY" property="isCurrency"/>
<result column="PK_COUNTRY" property="pkCountry"/>
<result column="PK_CREATOR" property="pkCreator"/>
<result column="CREATION_TIME" property="creationTime"/>
<result column="PK_MODIFIED" property="pkModified"/>
<result column="MODIFIED_TIME" property="modifiedTime"/>
<result column="DEL_FLAG" property="delFlag"/>
<result column="EFFECTIVE_DATE" property="effectiveDate"/>
<result column="CURRENCY_CODE" property="currencyCode"/>
</resultMap>
</mapper>

View File

@ -2,27 +2,4 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hzs.system.config.mapper.BdWithdrawalAutoMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.hzs.common.domain.system.config.BdWithdrawalAuto">
<id column="PK_ID" property="pkId" />
<result column="DEL_FLAG" property="delFlag" />
<result column="PK_COUNTRY" property="pkCountry" />
<result column="PK_CREATOR" property="pkCreator" />
<result column="CREATION_TIME" property="creationTime" />
<result column="PK_MODIFIED" property="pkModified" />
<result column="MODIFIED_TIME" property="modifiedTime" />
<result column="PK_WITHDRAWAL" property="pkWithdrawal" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
DEL_FLAG,
PK_COUNTRY,
PK_CREATOR,
CREATION_TIME,
PK_MODIFIED,
MODIFIED_TIME,
PK_ID, PK_WITHDRAWAL, LOWER_BOUND, UPPER_BOUND
</sql>
</mapper>

View File

@ -2,29 +2,4 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hzs.system.config.mapper.BdWithdrawalProcessMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.hzs.common.domain.system.config.BdWithdrawalProcess">
<id column="PK_ID" property="pkId" />
<result column="DEL_FLAG" property="delFlag" />
<result column="PK_COUNTRY" property="pkCountry" />
<result column="CREATION_TIME" property="creationTime" />
<result column="MODIFIED_TIME" property="modifiedTime" />
<result column="PK_CREATOR" property="pkCreator" />
<result column="PK_MODIFIED" property="pkModified" />
<result column="SERVICE_RATIO" property="serviceRatio" />
<result column="SERVICE_TYPE" property="serviceType" />
<result column="EFFECTIVE_DATE" property="effectiveDate" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
DEL_FLAG,
PK_COUNTRY,
CREATION_TIME,
MODIFIED_TIME,
PK_CREATOR,
PK_MODIFIED,
PK_ID, SERVICE_RATIO, SERVICE_TYPE, EFFECTIVE_DATE
</sql>
</mapper>

View File

@ -2,28 +2,4 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hzs.system.config.mapper.BdWithdrawalSpecialMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.hzs.common.domain.system.config.BdWithdrawalSpecial">
<id column="PK_ID" property="pkId" />
<result column="DEL_FLAG" property="delFlag" />
<result column="PK_COUNTRY" property="pkCountry" />
<result column="PK_CREATOR" property="pkCreator" />
<result column="CREATION_TIME" property="creationTime" />
<result column="PK_MODIFIED" property="pkModified" />
<result column="MODIFIED_TIME" property="modifiedTime" />
<result column="PK_WITHDRAWAL" property="pkWithdrawal" />
<result column="MEMBER_CODE" property="memberCode" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
DEL_FLAG,
PK_COUNTRY,
PK_CREATOR,
CREATION_TIME,
PK_MODIFIED,
MODIFIED_TIME,
PK_ID, PK_WITHDRAWAL, MEMBER_CODE
</sql>
</mapper>

View File

@ -164,41 +164,11 @@ public class CacheConstants {
*/
public static final String BD_SHARE = CACHE_PREFIX + "share:";
/**
* 提现配置
*/
public static final String BD_WITHDRAWAL = CACHE_PREFIX + "withdrawal:";
/**
* 提现手续费配置
*/
public static final String BD_WITHDRAWAL_PROCESS = CACHE_PREFIX + "withdrawalProcess:";
/**
* 自动提现明细配置
*/
public static final String BD_WITHDRAWAL_AUTO = CACHE_PREFIX + "withdrawalAuto:";
/**
* 查询所有配置了自动提现的提现配置列表
*/
public static final String BD_WITHDRAWAL_IS_AUTO = CACHE_PREFIX + "withdrawal:is:auto:";
/**
* 个税明细配置
*/
public static final String BD_WITHDRAWAL_TAX = CACHE_PREFIX + "withdrawalTax:";
/**
* 提现特殊配置列表
*/
public static final String BD_WITHDRAWAL_SPECIAL = CACHE_PREFIX + "withdrawalSpecial:";
/**
* 根据会员编号查询提现特殊配置
*/
public static final String BD_WITHDRAWAL_SPECIAL_MEMBER_CODE = CACHE_PREFIX + "withdrawalSpecial:memberCode:";
/**
* 转账配置配置列表
*/

View File

@ -812,11 +812,6 @@ public class EnumsPrefixConstants {
*/
public static final String RECOMMEND_DADA_TYPE = "ENU_R_D_T_";
/**
* 交易配置 业务类型
*/
public static final String BUSINESS_MODULE = "ENU_B_M_";
/**
* 点位状态
*/

View File

@ -195,61 +195,6 @@ public class FinanceMsgConstants {
*/
public static final String SELECT_CHARGED_RECORD = "请选择要打款充正的记录";
/**
* 请配置提现信息 -- 请配置提现信息
*/
public static final String CONFIGURE_WITHDRAWAL_INFO = "请配置提现信息";
/**
* 请绑定银行卡 -- 请绑定银行卡
*/
public static final String BIND_BANK_CARD = "请绑定银行卡";
/**
* 暂时不请允许提现请先升级 -- 暂时不请允许提现请先升级
*/
public static final String NOT_WITHDRAWAL_UPGRADE = "暂时不请允许提现,请先升级";
/**
* 请选择提现账户 -- 请选择提现账户
*/
public static final String SELECT_WITHDRAWAL_ACCOUNT = "请选择提现账户";
/**
* 不允许提现 -- 不允许提现
*/
public static final String NOT_ALLOWED_WITHDRAWAL = "不允许提现";
/**
* 超过提现次数 -- 超过提现次数
*/
public static final String EXCEEDING_WITHDRAWALS_NUMBER = "超过提现次数";
/**
* 请配置提现金额限制 -- 请配置提现金额限制
*/
public static final String CONFIGURE_WITHDRAWAL_AMOUNT_LIMIT = "请配置提现金额限制";
/**
* 请输入提现金额 -- 请输入提现金额
*/
public static final String ENTER_WITHDRAWAL_AMOUNT = "请输入提现金额";
/**
* 请输入整数值 -- 请输入整数值
*/
public static final String ENTER_INTEGER_VALUE = "请输入整数值";
/**
* 提现金额必须大于最低提现金额 -- 提现金额必须大于最低提现金额
*/
public static final String WITHDRAWAL_AMOUNT_GREATER_MINIMUM_AMOUNT = "提现金额必须大于最低提现金额";
/**
* 提现金额必须小于最高提现金额 -- 提现金额必须小于最高提现金额
*/
public static final String WITHDRAWAL_AMOUNT_LESS_MAXIMUM_AMOUNT = "提现金额必须小于最高提现金额";
/**
* 余额不足 -- 余额不足
*/
@ -339,26 +284,11 @@ public class FinanceMsgConstants {
*/
public static final String RECHARGE_DETAILS_EXPORT = "充值明细导出";
/**
* 银行卡号不能为空 -- 银行卡号不能为空
*/
public static final String BANK_CARD_CANNOT_EMPTY = "银行卡号不能为空!";
/**
* 开户名不能为空 -- 开户名不能为空
*/
public static final String ACCOUNT_NAME_CANNOT_EMPTY = "开户名不能为空!";
/**
* 验证码不能为空 -- 验证码不能为空
*/
public static final String VERIFICATION_CODE_CANNOT_EMPTY = "验证码不能为空!";
/**
* 开户支行不能为空 -- 开户支行不能为空
*/
public static final String OPENING_BRANCH_CANNOT_EMPTY = "开户支行不能为空!";
/**
* 开户支行不能为空 -- 真实姓名不能为空
*/
@ -369,16 +299,6 @@ public class FinanceMsgConstants {
*/
public static final String REAL_NAME_MEMBER_NOT_DIFFERENT = "真实姓名与会员姓名不一致";
/**
* 所在省不能为空 -- 所在省不能为空
*/
public static final String PROVINCE_CANNOT_EMPTY = "所在省不能为空!";
/**
* 所在市不能为空 -- 所在市不能为空
*/
public static final String CITY_CANNOT_EMPTY = "所在市不能为空!";
/**
* 详细地址不能为空 -- 详细地址不能为空
*/
@ -472,17 +392,6 @@ public class FinanceMsgConstants {
*/
public static final String BUSINESS_LICENSE_REFUSE_RESET = "营业执照审核未通过,请勿操作重置";
/**
* 提现正在审批中请稍后再试 -- 提现正在审批中请稍后再试
*/
public static final String WITHDRAWAL_APPROVAL = "提现正在审批中,请稍后再试";
/**
* 提现金额必须为100的整数倍
*/
public static final String WITHDRAW_AMOUNT_MULTIPLE = "提现金额必须为100的整数倍";
/**
* 身份证的图片地址不能为空
*/
@ -532,12 +441,6 @@ public class FinanceMsgConstants {
public static final String REST_PERIOD_NOT_TRANSFER = "休止期的会员奖金账户不允许转账";
/**
* 会员续约 -- 休止期不允许提现
*/
public static final String REST_PERIOD_NOT_WITHDRAWAL = "休止期的会员奖金账户不允许提现";
/**
* 会员续约 -- 已终止会员不允许转账
*/

View File

@ -9,12 +9,7 @@ import lombok.*;
import lombok.experimental.Accessors;
/**
* <p>
* 会员信息-银行卡信息
* </p>
*
* @author hzs
* @since 2022-08-31
*/
@Data
@EqualsAndHashCode(callSuper = true)

View File

@ -13,11 +13,6 @@ import lombok.experimental.Accessors;
import java.math.BigDecimal;
import java.util.Date;
/**
* Created with IntelliJ IDEA.
* @author: yuhui
* Description:
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)

View File

@ -12,12 +12,7 @@ import lombok.experimental.Accessors;
import java.math.BigDecimal;
/**
* <p>
* 自动提现明细表
* </p>
*
* @author zhangjing
* @since 2022-08-31
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ -47,5 +42,4 @@ public class BdWithdrawalAuto extends BaseEntity {
private Integer withdrawalCycle;
}

View File

@ -17,12 +17,7 @@ import java.math.BigDecimal;
import java.util.Date;
/**
* <p>
* 提现手续费配置
* </p>
*
* @author zhangjing
* @since 2022-11-02
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ -41,7 +36,7 @@ public class BdWithdrawalProcess extends BaseEntity {
/**
* 手续费值
*/
@Excel(name = "手续费值",sort = 2)
@Excel(name = "手续费值", sort = 2)
@TableField("SERVICE_RATIO")
private BigDecimal serviceRatio;
/**
@ -54,7 +49,7 @@ public class BdWithdrawalProcess extends BaseEntity {
/**
* 生效日期
*/
@Excel(name = "生效日期",sort = 3)
@Excel(name = "生效日期", sort = 3)
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@TableField("EFFECTIVE_DATE")
private Date effectiveDate;

View File

@ -10,12 +10,7 @@ import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* <p>
* 提现设置特殊配置
* </p>
*
* @author zhangjing
* @since 2022-09-06
*/
@Data
@EqualsAndHashCode(callSuper = true)

View File

@ -1,42 +0,0 @@
package com.hzs.third.bankcard.common;
import lombok.Data;
/**
* 银行卡验证返回状态
*
* @Description:
* @Author: ljc
* @Time: 2022/11/25 10:42
* @Classname: HttpConstant
* @Package_name: com.hz.bankCard.common
*/
@Data
public class HttpConstant {
/**
* 一致
*/
public static final String BANK_CARD_SAME = "1200";
/**
* 不一致
*/
public static final String BANK_CARD_DIFFERENT = "1201";
/**
* 银行卡状态错误
*/
public static final String BANK_CARD_STATUS_EEOR = "1203";
/**
* 验证失败
*/
public static final String BANK_CARD_FAIL = "1206";
/**
* 验证错误
*/
public static final String BANK_CARD_EEOR = "1206";
}

View File

@ -4,25 +4,18 @@ import com.hzs.common.core.domain.R;
import com.hzs.common.core.utils.StringUtils;
import com.hzs.third.bankcard.IBankCardServiceApi;
import com.hzs.third.bankcard.dto.BankCardParam;
import com.hzs.third.bankcard.service.BankCardService;
import com.hzs.third.bankcard.service.IBankCardService;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;
/**
* 银行卡四要素验证服务
*
* @Description:
* @Author: ljc
* @Time: 2023/2/9 9:05
* @Classname: BankCardValidateProvider
* @Package_name: com.hzs.third.bankCard.provider
*/
@DubboService
public class BankCardValidateProvider implements IBankCardServiceApi {
@Autowired
BankCardService bankCardService;
private IBankCardService iBankCardService;
@Override
public R<?> verifyBankCard(BankCardParam bankCardParam) {
@ -38,8 +31,7 @@ public class BankCardValidateProvider implements IBankCardServiceApi {
if (StringUtils.isEmpty(bankCardParam.getBankCard())) {
return R.fail("银行卡号不能为空!");
}
return bankCardService.verifyBankCard(bankCardParam);
return iBankCardService.verifyBankCard(bankCardParam);
}
}

View File

@ -6,7 +6,7 @@ import com.hzs.third.bankcard.dto.BankCardParam;
/**
* 银行卡验证接口
*/
public interface BankCardService {
public interface IBankCardService {
/**
* 银行卡四要素校验

View File

@ -3,13 +3,12 @@ package com.hzs.third.bankcard.service.impl;
import cn.hutool.http.Header;
import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpResponse;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.hzs.common.core.constant.HttpStatus;
import com.hzs.common.core.domain.R;
import com.hzs.third.bankcard.common.HttpConstant;
import com.hzs.third.bankcard.dto.BankCardParam;
import com.hzs.third.bankcard.service.BankCardService;
import com.hzs.third.bankcard.service.IBankCardService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
@ -22,7 +21,7 @@ import java.util.Map;
*/
@Slf4j
@Service
public class BankCardServiceImpl implements BankCardService {
public class BankCardServiceImpl implements IBankCardService {
@Value("${bankCard.url}")
private String url;
@ -33,64 +32,52 @@ public class BankCardServiceImpl implements BankCardService {
@Override
public R<?> verifyBankCard(BankCardParam bankCardParam) {
String authorization = "APPCODE " + appCode;
HttpResponse response = HttpRequest.post(url)
.header(Header.AUTHORIZATION, authorization)
.header(Header.CONTENT_TYPE, "application/x-www-form-urlencoded; charset=UTF-8")
.form(getInParam(bankCardParam))
.timeout(20000)
.execute();
return parseResult(response, bankCardParam);
}
Map<String, Object> param = new HashMap<>();
param.put("bankcard", bankCardParam.getBankCard());
param.put("idcard", bankCardParam.getIdCard());
param.put("name", bankCardParam.getName());
param.put("mobile", bankCardParam.getMobile());
HttpResponse response = HttpRequest.post(url)
.header(Header.AUTHORIZATION, "APPCODE " + appCode)
.header(Header.CONTENT_TYPE, "application/x-www-form-urlencoded; charset=UTF-8")
.form(param)
.timeout(10000)
.execute();
return parseResult(response);
}
/**
* 解析返回的结果集
* <p>
* 1200 银行卡验证一致 收费
* 1201 银行卡验证不一致 收费
* 1203 银行卡状态错误 收费
* 1206 验证失败 免费
*
* @param response 响应信息
* @return bankCardVO
*/
private R<?> parseResult(HttpResponse response, BankCardParam bankCardParam) {
private R<?> parseResult(HttpResponse response) {
String result = response.body();
log.info("调用接口返回信息: " + result);
if (response.getStatus() == HttpStatus.SUCCESS) {
JsonObject resultJson = JsonParser.parseString(result).getAsJsonObject();
//状态码
String code = resultJson.get("code").getAsString();
//返回信息
String message = resultJson.get("message").getAsString();
if (code.equals(HttpConstant.BANK_CARD_SAME)) {
return R.ok();
log.info("调用银行卡认证接口返回信息: " + result);
if (HttpStatus.SUCCESS == response.getStatus()) {
JSONObject resultObj = JSONUtil.parseObj(result);
if ("200".equals(resultObj.getStr("code"))) {
// 返回成功
JSONObject dataObj = resultObj.getJSONObject("data");
int resultInt = dataObj.getInt("result");
if (resultInt == 0) {
// 一致
return R.ok();
} else if (resultInt == 1) {
// 不一致
return R.fail("银行卡预留信息不一致,请确认后重试");
} else {
// 查不到卡信息
return R.fail("银行卡信息不存在,请确认银行卡是否有效");
}
} else {
log.info("银行卡四要素校验接口正常返回状态值: {},信息为: {}", code, message);
return R.fail(message);
// 返回失败
return R.fail(resultObj.getStr("msg"));
}
} else {
String message = "认证失败";
log.info("银行卡四要素校验接口异常返回状态值: {},信息为: {}", response.getStatus(), message);
return R.fail(message);
log.error("调用银行卡认证接口失败");
return R.fail("银行卡认证失败,请重试");
}
}
/**
* 获取入参
*
* @param bankCardParam 银行卡入参
* @return String
*/
private Map getInParam(BankCardParam bankCardParam) {
JsonObject jsonObject = new JsonObject();
jsonObject.addProperty("name", bankCardParam.getName());
jsonObject.addProperty("mobile", bankCardParam.getMobile());
jsonObject.addProperty("bankcard", bankCardParam.getBankCard());
jsonObject.addProperty("idcard", bankCardParam.getIdCard());
Map<String, String> param = new HashMap<>();
param.put("biz_content", jsonObject.toString());
return param;
}
}