## 提现明细添加身份证号;调整提现明细导出;提现等配置去掉缓存;

This commit is contained in:
cabbage 2025-08-20 14:13:57 +08:00
parent b9e3491a76
commit 77ea53b875
31 changed files with 259 additions and 1080 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

@ -35,9 +35,6 @@ import java.util.*;
/** /**
* 会员提现表 前端控制器 * 会员提现表 前端控制器
*
* @author hzs
* @since 2022-09-06
*/ */
@RestController @RestController
@RequestMapping("/manager/withdraw") @RequestMapping("/manager/withdraw")
@ -46,18 +43,15 @@ public class CuMemberWithdrawController extends BaseController {
@Autowired @Autowired
private UserTokenService userTokenService; private UserTokenService userTokenService;
@Autowired @Autowired
private ICuMemberBaseService baseService; private ICuMemberBaseService iCuMemberBaseService;
@Autowired @Autowired
ICuMemberWithdrawService cuMemberWithdrawService; private ICuMemberWithdrawService iCuMemberWithdrawService;
@Autowired @Autowired
ITransactionCommonService iTransactionCommonService; private ITransactionCommonService iTransactionCommonService;
@DubboReference @DubboReference
IMenuColumnServiceApi menuColumnServiceApi; IMenuColumnServiceApi iMenuColumnServiceApi;
/** /**
@ -72,11 +66,11 @@ public class CuMemberWithdrawController extends BaseController {
if (CollUtil.isEmpty(pkIds)) { if (CollUtil.isEmpty(pkIds)) {
return AjaxResult.error(TransactionUtils.getContent(FinanceMsgConstants.SELECT_INITIATING_SIGNATURE_RECORD)); return AjaxResult.error(TransactionUtils.getContent(FinanceMsgConstants.SELECT_INITIATING_SIGNATURE_RECORD));
} }
List<CuMemberWithdrawVO> cuMemberWithdrawList = cuMemberWithdrawService.checkWithdrawPetitionByState(pkIds, EApproveStatus.WAIT_SUBMIT.getValue()); List<CuMemberWithdrawVO> cuMemberWithdrawList = iCuMemberWithdrawService.checkWithdrawPetitionByState(pkIds, EApproveStatus.WAIT_SUBMIT.getValue());
if (CollUtil.isNotEmpty(cuMemberWithdrawList)) { if (CollUtil.isNotEmpty(cuMemberWithdrawList)) {
return AjaxResult.error(TransactionUtils.getContent(FinanceMsgConstants.SELECTED_RECORD_DUPLICATE_SIGNATURE_RECORD)); return AjaxResult.error(TransactionUtils.getContent(FinanceMsgConstants.SELECTED_RECORD_DUPLICATE_SIGNATURE_RECORD));
} }
return AjaxResult.success(cuMemberWithdrawService.showMemberWithdrawPetition(pkIds, null)); return AjaxResult.success(iCuMemberWithdrawService.showMemberWithdrawPetition(pkIds, null));
} }
/** /**
@ -91,7 +85,7 @@ public class CuMemberWithdrawController extends BaseController {
LoginUser loginUser = userTokenService.getLoginUser(); LoginUser loginUser = userTokenService.getLoginUser();
cuMemberPetitionVO.setLoginUser(loginUser); cuMemberPetitionVO.setLoginUser(loginUser);
cuMemberPetitionVO.setPkCreat(SecurityUtils.getUserId()); cuMemberPetitionVO.setPkCreat(SecurityUtils.getUserId());
return AjaxResult.success(cuMemberWithdrawService.confirmWithdrawPetition(cuMemberPetitionVO)); return AjaxResult.success(iCuMemberWithdrawService.confirmWithdrawPetition(cuMemberPetitionVO));
} }
@ -117,7 +111,7 @@ public class CuMemberWithdrawController extends BaseController {
} }
} }
startPage(); startPage();
Object[] objects = cuMemberWithdrawService.selectMemberWithdrawList(cuMemberWithdrawVO); Object[] objects = iCuMemberWithdrawService.selectMemberWithdrawList(cuMemberWithdrawVO);
//处理分页 //处理分页
TableDataInfo tableDataInfo = getDataTable((List<CuMemberWithdrawExt>) objects[0]); TableDataInfo tableDataInfo = getDataTable((List<CuMemberWithdrawExt>) objects[0]);
tableDataInfo.setRows((List<CuMemberWithdrawVO>) objects[1]); tableDataInfo.setRows((List<CuMemberWithdrawVO>) objects[1]);
@ -137,18 +131,18 @@ public class CuMemberWithdrawController extends BaseController {
Integer pkCountry = SecurityUtils.getPkCountry(); Integer pkCountry = SecurityUtils.getPkCountry();
cuMemberWithdrawVO.setPkCountry(pkCountry); cuMemberWithdrawVO.setPkCountry(pkCountry);
cuMemberWithdrawVO.setSystemType(SecurityUtils.getSystemType()); cuMemberWithdrawVO.setSystemType(SecurityUtils.getSystemType());
List<CuMemberWithdrawVO> cuMemberWithdrawList = (List<CuMemberWithdrawVO>) cuMemberWithdrawService.selectMemberWithdrawList(cuMemberWithdrawVO)[1]; List<CuMemberWithdrawVO> cuMemberWithdrawList = (List<CuMemberWithdrawVO>) iCuMemberWithdrawService.selectMemberWithdrawList(cuMemberWithdrawVO)[1];
//枚举翻译 //枚举翻译
Map<String, String> transactionMap = iTransactionCommonService.exportEnumTransaction(EApproveStatus.values(), EWithdrawStatus.values()); Map<String, String> transactionMap = iTransactionCommonService.exportEnumTransaction(EApproveStatus.values());
if (CollUtil.isNotEmpty(cuMemberWithdrawList)) { if (CollUtil.isNotEmpty(cuMemberWithdrawList)) {
for (CuMemberWithdrawVO memberWithdraw : cuMemberWithdrawList) { for (CuMemberWithdrawVO memberWithdraw : cuMemberWithdrawList) {
Integer pkAccount = memberWithdraw.getPkAccount(); Integer pkAccount = memberWithdraw.getPkAccount();
memberWithdraw.setPkAccountVal(baseService.getAccountTranslateFromDataBase(pkAccount)); memberWithdraw.setPkAccountVal(iCuMemberBaseService.getAccountTranslateFromDataBase(pkAccount));
memberWithdraw.setApproveStateVal(transactionMap.get(EnumsPrefixConstants.APPROVE_STATUS + memberWithdraw.getApproveState())); memberWithdraw.setApproveStateVal(transactionMap.get(EnumsPrefixConstants.APPROVE_STATUS + memberWithdraw.getApproveState()));
memberWithdraw.setStatusVal(transactionMap.get(EnumsPrefixConstants.ENU_WITHDRAW_STATUS + memberWithdraw.getStatus())); memberWithdraw.setStatusVal(EWithdrawStatus.getLabelByValue(memberWithdraw.getStatus()));
} }
} }
ExcelUtil<CuMemberWithdrawVO> util = new ExcelUtil<>(CuMemberWithdrawVO.class, menuColumnServiceApi.queryMenuColumn("CashDetails", SecurityUtils.getUserId()).getData()); ExcelUtil<CuMemberWithdrawVO> util = new ExcelUtil<>(CuMemberWithdrawVO.class, iMenuColumnServiceApi.queryMenuColumn("CashDetails", SecurityUtils.getUserId()).getData());
util.exportExcel(response, cuMemberWithdrawList, TransactionUtils.getContent(FinanceMsgConstants.WITHDRAWAL_DETAILS_EXPORT)); util.exportExcel(response, cuMemberWithdrawList, TransactionUtils.getContent(FinanceMsgConstants.WITHDRAWAL_DETAILS_EXPORT));
} }
@ -162,7 +156,7 @@ public class CuMemberWithdrawController extends BaseController {
@GetMapping("/details") @GetMapping("/details")
public AjaxResult findWithdrawDetails(Long pkId) { public AjaxResult findWithdrawDetails(Long pkId) {
Assert.notNull(pkId, TransactionUtils.getContent(FinanceMsgConstants.SELECT_WITHDRAWAL_RECORD)); Assert.notNull(pkId, TransactionUtils.getContent(FinanceMsgConstants.SELECT_WITHDRAWAL_RECORD));
CuMemberWithdrawVO cuMemberRechargeDetailVO = cuMemberWithdrawService.queryCuMemberWithdrawDetail(pkId); CuMemberWithdrawVO cuMemberRechargeDetailVO = iCuMemberWithdrawService.queryCuMemberWithdrawDetail(pkId);
return AjaxResult.success(cuMemberRechargeDetailVO); return AjaxResult.success(cuMemberRechargeDetailVO);
} }
@ -178,7 +172,7 @@ public class CuMemberWithdrawController extends BaseController {
public AjaxResult withdrawPayment(@RequestBody CuMemberWithdrawVO memberWithdrawVO) { public AjaxResult withdrawPayment(@RequestBody CuMemberWithdrawVO memberWithdrawVO) {
List<Long> pkIds = memberWithdrawVO.getPkIds(); List<Long> pkIds = memberWithdrawVO.getPkIds();
Assert.notNull(pkIds, TransactionUtils.getContent(FinanceMsgConstants.SELECT_PAID_RECORD)); Assert.notNull(pkIds, TransactionUtils.getContent(FinanceMsgConstants.SELECT_PAID_RECORD));
List<CuMemberWithdraw> withdrawApproveStateByIds = cuMemberWithdrawService.getWithdrawApproveStateByIds(pkIds, EApproveStatus.FINISH.getValue()); List<CuMemberWithdraw> withdrawApproveStateByIds = iCuMemberWithdrawService.getWithdrawApproveStateByIds(pkIds, EApproveStatus.FINISH.getValue());
if (CollUtil.isNotEmpty(withdrawApproveStateByIds)) { if (CollUtil.isNotEmpty(withdrawApproveStateByIds)) {
return AjaxResult.error(TransactionUtils.getContent(FinanceMsgConstants.DATA_UNAPPROVED_DATA)); return AjaxResult.error(TransactionUtils.getContent(FinanceMsgConstants.DATA_UNAPPROVED_DATA));
} }
@ -188,7 +182,7 @@ public class CuMemberWithdrawController extends BaseController {
memberWithdrawVO.setPayer(pkMember); memberWithdrawVO.setPayer(pkMember);
memberWithdrawVO.setPaymentTime(new Date()); memberWithdrawVO.setPaymentTime(new Date());
memberWithdrawVO.setPkModified(pkMember); memberWithdrawVO.setPkModified(pkMember);
return toAjax(cuMemberWithdrawService.withdrawPaymentByPkId(memberWithdrawVO)); return toAjax(iCuMemberWithdrawService.withdrawPaymentByPkId(memberWithdrawVO));
} }
@ -207,13 +201,13 @@ public class CuMemberWithdrawController extends BaseController {
memberWithdrawVO.setPayer(SecurityUtils.getUserId()); memberWithdrawVO.setPayer(SecurityUtils.getUserId());
memberWithdrawVO.setPayerRemarks(memberWithdrawVO.getPayerRemarks()); memberWithdrawVO.setPayerRemarks(memberWithdrawVO.getPayerRemarks());
memberWithdrawVO.setPaymentTime(new Date()); memberWithdrawVO.setPaymentTime(new Date());
return toAjax(cuMemberWithdrawService.withdrawPaymentPositiveByPkId(memberWithdrawVO)); return toAjax(iCuMemberWithdrawService.withdrawPaymentPositiveByPkId(memberWithdrawVO));
} }
@Log(module = EOperationModule.WITHDRAWAL_DETAIL, business = EOperationBusiness.WITHDRAWAL_DETAIL, method = EOperationMethod.REJECT) @Log(module = EOperationModule.WITHDRAWAL_DETAIL, business = EOperationBusiness.WITHDRAWAL_DETAIL, method = EOperationMethod.REJECT)
@PostMapping("/reject") @PostMapping("/reject")
public AjaxResult reject(@RequestBody CuMemberWithdrawRejectParam param) { public AjaxResult reject(@RequestBody CuMemberWithdrawRejectParam param) {
cuMemberWithdrawService.withdrawReject(param); iCuMemberWithdrawService.withdrawReject(param);
return AjaxResult.success(); return AjaxResult.success();
} }

View File

@ -10,12 +10,6 @@ import java.math.BigDecimal;
/** /**
* 奖金账户操作参数 * 奖金账户操作参数
*
* @Description:
* @Author: ljc
* @Time: 2023/3/25 13:56
* @Classname: CuMemberAccountParam
* @Package_name: com.hzs.member.account.dto
*/ */
@Data @Data
@Builder @Builder

View File

@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hzs.common.domain.member.account.CuMemberAccount; import com.hzs.common.domain.member.account.CuMemberAccount;
import com.hzs.common.domain.member.account.CuMemberAccountRechargeExt; import com.hzs.common.domain.member.account.CuMemberAccountRechargeExt;
import com.hzs.common.domain.member.ext.CuMemberAccountExt; import com.hzs.common.domain.member.ext.CuMemberAccountExt;
import com.hzs.member.account.dto.CuMemberBonusAccountParam;
import com.hzs.member.account.dto.CuMemberRechargeAccountParam; import com.hzs.member.account.dto.CuMemberRechargeAccountParam;
import com.hzs.member.account.dto.MemberAmountDTO; import com.hzs.member.account.dto.MemberAmountDTO;
import com.hzs.member.account.vo.CuMemberAccountVO; import com.hzs.member.account.vo.CuMemberAccountVO;
@ -28,7 +27,6 @@ public interface CuMemberAccountMapper extends BaseMapper<CuMemberAccount> {
*/ */
List<CuMemberAccountExt> queryMemberAccountByCondition(CuMemberAccount cuMemberAccount); List<CuMemberAccountExt> queryMemberAccountByCondition(CuMemberAccount cuMemberAccount);
/** /**
* 根据会员编码获取余额 * 根据会员编码获取余额
* *
@ -45,15 +43,6 @@ public interface CuMemberAccountMapper extends BaseMapper<CuMemberAccount> {
*/ */
Integer updateMemberAccount(CuMemberAccount cuMemberAccount); Integer updateMemberAccount(CuMemberAccount cuMemberAccount);
/**
* 根据国家查询余额与银行卡信息
*
* @param pkCountry 国家ID
* @return List<CuMemberAccountExt>
*/
List<CuMemberAccountExt> queryMemberAccountByPkCountry(@Param("pkCountry") Integer pkCountry);
/** /**
* 根据用户编号查询账户余额 行转列 * 根据用户编号查询账户余额 行转列
* *
@ -176,14 +165,6 @@ public interface CuMemberAccountMapper extends BaseMapper<CuMemberAccount> {
*/ */
List<CuMemberAccount> selectMemberAccountByPkMember(@Param(value = "pkMembers") List<Long> pkMembers); List<CuMemberAccount> selectMemberAccountByPkMember(@Param(value = "pkMembers") List<Long> pkMembers);
/**
* 查询会员账户以及会员信息
*
* @param memberIdList 会员ID列表
* @return
*/
List<CuMemberAccountExt> queryAccountAndMemberInfo(@Param("memberIdList") List<Long> memberIdList);
/** /**
* 根据用户ID查询钱包余额 * 根据用户ID查询钱包余额
* *
@ -201,33 +182,6 @@ public interface CuMemberAccountMapper extends BaseMapper<CuMemberAccount> {
*/ */
List<CuMemberAccountExt> queryMemberAccountByMemberCodeAndName(CuMemberAccountVO cuMemberAccountVO); List<CuMemberAccountExt> queryMemberAccountByMemberCodeAndName(CuMemberAccountVO cuMemberAccountVO);
/**
* 奖金发放根据期间发放奖金更新奖金余额
*
* @param startPeriod 期间
*/
void updateMemberAccountGrantByPeriod(@Param("pkCountry") Integer pkCountry, @Param("startPeriod") Integer startPeriod,
@Param("endPeriod") Integer endPeriod);
/**
* 奖金可提现根据期间更新可提现金额减少可消费金额
*
* @param startPeriod 期间
*/
void updateMemberAccountWithdrawalByPeriod(@Param("startPeriod") Integer startPeriod, @Param("endPeriod") Integer endPeriod, @Param("pkCountry") Integer pkCountry);
/**
* 批量更新奖金账号
*
* @param bonusList 奖金账号参数
* @param operateType 操作类型
* @param operateType 修改人
* @return Boolean
*/
Boolean batchUpdateBonusAccountByPkMember(@Param("bonusList") List<CuMemberBonusAccountParam> bonusList,
@Param("operateType") int operateType,
@Param("pkModified") Long pkModified);
/** /**
* 根据来源单号查询奖金账号信息 * 根据来源单号查询奖金账号信息
* *

View File

@ -24,7 +24,6 @@ public interface ICuMemberAccountService extends IService<CuMemberAccount> {
*/ */
List<CuMemberAccountExt> queryMemberAccountByCondition(CuMemberAccount cuMemberAccount); List<CuMemberAccountExt> queryMemberAccountByCondition(CuMemberAccount cuMemberAccount);
/** /**
* 根据会员编码获取余额 * 根据会员编码获取余额
* *
@ -34,7 +33,6 @@ public interface ICuMemberAccountService extends IService<CuMemberAccount> {
*/ */
BigDecimal selectBalanceByMemberCode(Long pkMember, Integer accountType); BigDecimal selectBalanceByMemberCode(Long pkMember, Integer accountType);
/** /**
* 更新用户余额 * 更新用户余额
* *
@ -92,14 +90,6 @@ public interface ICuMemberAccountService extends IService<CuMemberAccount> {
*/ */
List<CuMemberAccountShowVO> selectAccountDetail(Long pkMember, Integer pkCountry); List<CuMemberAccountShowVO> selectAccountDetail(Long pkMember, Integer pkCountry);
/**
* 根据国家查询余额与银行卡信息
*
* @param pkCountry 国家ID
* @return List<CuMemberAccountExt>
*/
List<CuMemberAccountExt> queryMemberAccountByPkcountry(Integer pkCountry);
/** /**
* 根据用户编号查询账户余额 行转列 * 根据用户编号查询账户余额 行转列
* *
@ -138,7 +128,6 @@ public interface ICuMemberAccountService extends IService<CuMemberAccount> {
*/ */
List<CuMemberAccountExt> queryMemberAccountByMemberCodes(List<CuMemberRechargeVO> memberCodes, List<String> memberCodeStrs); List<CuMemberAccountExt> queryMemberAccountByMemberCodes(List<CuMemberRechargeVO> memberCodes, List<String> memberCodeStrs);
/** /**
* 根据用户编号集查询余额(所有字段) * 根据用户编号集查询余额(所有字段)
* *
@ -147,7 +136,6 @@ public interface ICuMemberAccountService extends IService<CuMemberAccount> {
*/ */
List<CuMemberWalletDetailVO> queryMemberAccountAllByMemberCodes(List<String> memberCodes, Integer pkCountry); List<CuMemberWalletDetailVO> queryMemberAccountAllByMemberCodes(List<String> memberCodes, Integer pkCountry);
/** /**
* 查询钱包明细 * 查询钱包明细
* *
@ -156,7 +144,6 @@ public interface ICuMemberAccountService extends IService<CuMemberAccount> {
*/ */
Object[] selectMemberAccountList(CuMemberWalletDetailVO memberWalletDetailVO); Object[] selectMemberAccountList(CuMemberWalletDetailVO memberWalletDetailVO);
/** /**
* 根据用户编号查询用户ID * 根据用户编号查询用户ID
* *
@ -190,7 +177,6 @@ public interface ICuMemberAccountService extends IService<CuMemberAccount> {
*/ */
List<CuMemberAccountExt> queryMemberAccountByPkMember(List<MemberAmountDTO> pkMembers); List<CuMemberAccountExt> queryMemberAccountByPkMember(List<MemberAmountDTO> pkMembers);
/** /**
* 批量更新账户余额不同用户相同账户 * 批量更新账户余额不同用户相同账户
* *
@ -200,7 +186,6 @@ public interface ICuMemberAccountService extends IService<CuMemberAccount> {
*/ */
Boolean batchUpdateMemberAccountByPkmember(List<MemberAmountDTO> pkMemberList, int pkAccount, Integer isWithdraw); Boolean batchUpdateMemberAccountByPkmember(List<MemberAmountDTO> pkMemberList, int pkAccount, Integer isWithdraw);
/** /**
* 更新账户余额不同用户不同账户 * 更新账户余额不同用户不同账户
* *
@ -210,7 +195,6 @@ public interface ICuMemberAccountService extends IService<CuMemberAccount> {
*/ */
Boolean batchUpdateMemberAccountByPkMemberCountry(List<MemberAmountDTO> pkMemberList, Integer isWithdraw); Boolean batchUpdateMemberAccountByPkMemberCountry(List<MemberAmountDTO> pkMemberList, Integer isWithdraw);
/** /**
* 批理更新会员的钱包状态 * 批理更新会员的钱包状态
* *
@ -229,14 +213,6 @@ public interface ICuMemberAccountService extends IService<CuMemberAccount> {
*/ */
List<CuMemberAccount> selectMemberAccountByPkMember(List<Long> pkMembers); List<CuMemberAccount> selectMemberAccountByPkMember(List<Long> pkMembers);
/**
* 查询会员账户以及会员信息
*
* @param memberIdList 会员ID列表
* @return
*/
List<CuMemberAccountExt> queryAccountAndMemberInfo(List<Long> memberIdList);
/** /**
* 根据会员姓名与会员编号查询账户信息 * 根据会员姓名与会员编号查询账户信息
* *
@ -245,23 +221,8 @@ public interface ICuMemberAccountService extends IService<CuMemberAccount> {
*/ */
Object[] queryMemberAccountByMemberCodeAndName(CuMemberAccountVO cuMemberAccountVO); Object[] queryMemberAccountByMemberCodeAndName(CuMemberAccountVO cuMemberAccountVO);
List<CuMemberAccountExportVO> selectFrozenAmountExport(CuMemberAccountVO cuMemberAccountVO); List<CuMemberAccountExportVO> selectFrozenAmountExport(CuMemberAccountVO cuMemberAccountVO);
/**
* 奖金发放根据期间发放奖金更新奖金余额
*
* @param startPeriod 期间
*/
void updateMemberAccountGrantByPeriod(Integer pkCountry, Integer startPeriod, Integer endPeriod);
/**
* 奖金可提现根据期间更新可提现金额减少可消费金额
*
* @param startPeriod 期间
*/
void updateMemberAccountWithdrawalByPeriod(Integer startPeriod, Integer endPeriod, Integer pkCountry);
/** /**
* 根据用户ID查询账户余额信息 * 根据用户ID查询账户余额信息
* *
@ -271,18 +232,6 @@ public interface ICuMemberAccountService extends IService<CuMemberAccount> {
*/ */
CuMemberRechargeAccountParam findMemberBalanceById(Integer pkAccount, Long pkMember); CuMemberRechargeAccountParam findMemberBalanceById(Integer pkAccount, Long pkMember);
/**
* 批量更新奖金账号
*
* @param bonusList 奖金账号参数
* @param operateType 操作类型
* @param operateType 修改人
* @return Boolean
*/
Boolean batchUpdateBonusAccountByPkMember(List<CuMemberBonusAccountParam> bonusList, int operateType, Long pkModified);
/** /**
* 根据来源单号查询奖金账号信息 * 根据来源单号查询奖金账号信息
* *

View File

@ -12,6 +12,7 @@ import java.util.List;
* 会员信息-银行卡信息 服务类 * 会员信息-银行卡信息 服务类
*/ */
public interface ICuMemberBankService extends IService<CuMemberBank> { public interface ICuMemberBankService extends IService<CuMemberBank> {
/** /**
* 根据主键查询银行卡信息 * 根据主键查询银行卡信息
* *
@ -45,7 +46,6 @@ public interface ICuMemberBankService extends IService<CuMemberBank> {
*/ */
Integer saveMemberBank(CuMemberBankParam cuMemberBankParam); Integer saveMemberBank(CuMemberBankParam cuMemberBankParam);
/** /**
* 查询绑定的银行卡 * 查询绑定的银行卡
* *

View File

@ -3,7 +3,6 @@ package com.hzs.member.account.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.hzs.common.domain.member.account.CuMemberAccount; import com.hzs.common.domain.member.account.CuMemberAccount;
import com.hzs.common.domain.member.account.CuMemberWithdraw; import com.hzs.common.domain.member.account.CuMemberWithdraw;
import com.hzs.common.domain.system.config.BdWithdrawal;
import com.hzs.member.account.dto.MemberAccountAudit; import com.hzs.member.account.dto.MemberAccountAudit;
import com.hzs.member.account.param.CuMemberWithdrawRejectParam; import com.hzs.member.account.param.CuMemberWithdrawRejectParam;
import com.hzs.member.account.vo.CuMemberPetitionVO; import com.hzs.member.account.vo.CuMemberPetitionVO;
@ -16,6 +15,7 @@ import java.util.List;
* 会员提现表 服务类 * 会员提现表 服务类
*/ */
public interface ICuMemberWithdrawService extends IService<CuMemberWithdraw> { public interface ICuMemberWithdrawService extends IService<CuMemberWithdraw> {
/** /**
* 根据用户ID查询用户的提现次数 * 根据用户ID查询用户的提现次数
* *
@ -32,7 +32,6 @@ public interface ICuMemberWithdrawService extends IService<CuMemberWithdraw> {
*/ */
List<CuMemberWithdraw> selectWithdrawByBatch(String batchNO); List<CuMemberWithdraw> selectWithdrawByBatch(String batchNO);
/** /**
* 保存提现 * 保存提现
* *
@ -49,7 +48,6 @@ public interface ICuMemberWithdrawService extends IService<CuMemberWithdraw> {
*/ */
Integer updateWithdrawByCode(MemberAccountAudit memberAccountAudit); Integer updateWithdrawByCode(MemberAccountAudit memberAccountAudit);
/** /**
* 查询列表信息 * 查询列表信息
* *
@ -58,7 +56,6 @@ public interface ICuMemberWithdrawService extends IService<CuMemberWithdraw> {
*/ */
Object[] selectMemberWithdrawList(CuMemberWithdrawVO cuMemberWithdrawVO); Object[] selectMemberWithdrawList(CuMemberWithdrawVO cuMemberWithdrawVO);
/** /**
* 查询提现信息详情 * 查询提现信息详情
* *
@ -83,16 +80,6 @@ public interface ICuMemberWithdrawService extends IService<CuMemberWithdraw> {
*/ */
Integer withdrawPaymentPositiveByPkId(CuMemberWithdrawVO memberWithdrawVO); Integer withdrawPaymentPositiveByPkId(CuMemberWithdrawVO memberWithdrawVO);
/**
* 获取余额
*
* @param pkMember 用户ID
* @param pkCountry 国家ID
* @return BigDecimal
*/
BigDecimal getBalance(Long pkMember, Integer pkCountry, Integer accountsType);
/** /**
* 计算本次提现应该交的个税 * 计算本次提现应该交的个税
* *
@ -113,15 +100,6 @@ public interface ICuMemberWithdrawService extends IService<CuMemberWithdraw> {
*/ */
BigDecimal computeServiceCharge(Integer pkCountry, BigDecimal cashAmount); BigDecimal computeServiceCharge(Integer pkCountry, BigDecimal cashAmount);
/**
* 获取取整后的金额
*
* @param bdWithdrawal 提现配置信息
* @param cashAmount 提现金额
* @return BigDecimal
*/
BigDecimal computeRounding(BdWithdrawal bdWithdrawal, BigDecimal cashAmount);
/** /**
* 获取账户余额 * 获取账户余额
* *
@ -131,7 +109,6 @@ public interface ICuMemberWithdrawService extends IService<CuMemberWithdraw> {
*/ */
BigDecimal getAccountBalance(Integer accountsType, CuMemberAccount cuMemberAccount); BigDecimal getAccountBalance(Integer accountsType, CuMemberAccount cuMemberAccount);
/** /**
* @param pkIds 主键集合 * @param pkIds 主键集合
* @param approveState 审核状态 * @param approveState 审核状态
@ -164,7 +141,6 @@ public interface ICuMemberWithdrawService extends IService<CuMemberWithdraw> {
*/ */
Integer confirmWithdrawPetition(CuMemberPetitionVO cuMemberPetitionVO); Integer confirmWithdrawPetition(CuMemberPetitionVO cuMemberPetitionVO);
/** /**
* 会员端查询提现列表 * 会员端查询提现列表
* *
@ -183,7 +159,6 @@ public interface ICuMemberWithdrawService extends IService<CuMemberWithdraw> {
*/ */
Integer updateWithdrawStatusByPkId(Long pkId, Long pkModified); Integer updateWithdrawStatusByPkId(Long pkId, Long pkModified);
/** /**
* 查询会员是否存在提现记录 * 查询会员是否存在提现记录
* *

View File

@ -324,11 +324,6 @@ public class CuMemberAccountServiceImpl extends ServiceImpl<CuMemberAccountMappe
return memberAccountShowVOList; return memberAccountShowVOList;
} }
@Override
public List<CuMemberAccountExt> queryMemberAccountByPkcountry(Integer pkCountry) {
return baseMapper.queryMemberAccountByPkCountry(pkCountry);
}
@Override @Override
public List<CuMemberRechargeAccountParam> queryMemberAccountByMemberCode(String memberCode, List<Integer> accountTypes, Integer pkCountry) { public List<CuMemberRechargeAccountParam> queryMemberAccountByMemberCode(String memberCode, List<Integer> accountTypes, Integer pkCountry) {
List<Integer> pkAccounts = new ArrayList<>(); List<Integer> pkAccounts = new ArrayList<>();
@ -610,12 +605,6 @@ public class CuMemberAccountServiceImpl extends ServiceImpl<CuMemberAccountMappe
return baseMapper.selectMemberAccountByPkMember(pkMembers); return baseMapper.selectMemberAccountByPkMember(pkMembers);
} }
@Override
public List<CuMemberAccountExt> queryAccountAndMemberInfo(List<Long> memberIdList) {
return baseMapper.queryAccountAndMemberInfo(memberIdList);
}
@Override @Override
public Object[] queryMemberAccountByMemberCodeAndName(CuMemberAccountVO cuMemberAccountVO) { public Object[] queryMemberAccountByMemberCodeAndName(CuMemberAccountVO cuMemberAccountVO) {
CuMemberAccountExtVO cuMemberAccountExtVO; CuMemberAccountExtVO cuMemberAccountExtVO;
@ -784,28 +773,12 @@ public class CuMemberAccountServiceImpl extends ServiceImpl<CuMemberAccountMappe
return cuMemberAccountExtVO; return cuMemberAccountExtVO;
} }
@Override
public void updateMemberAccountGrantByPeriod(Integer pkCountry, Integer startPeriod, Integer endPeriod) {
baseMapper.updateMemberAccountGrantByPeriod(pkCountry, startPeriod, endPeriod);
}
@Override
public void updateMemberAccountWithdrawalByPeriod(Integer startPeriod, Integer endPeriod, Integer pkCountry) {
baseMapper.updateMemberAccountWithdrawalByPeriod(startPeriod, endPeriod, pkCountry);
}
@Override @Override
public CuMemberRechargeAccountParam findMemberBalanceById(Integer pkAccount, Long pkMember) { public CuMemberRechargeAccountParam findMemberBalanceById(Integer pkAccount, Long pkMember) {
List<CuMemberRechargeAccountParam> cuMemberRechargeAccountParams = baseMapper.queryMemberAccountByMemberCode(null, Collections.singletonList(pkAccount), pkMember); List<CuMemberRechargeAccountParam> cuMemberRechargeAccountParams = baseMapper.queryMemberAccountByMemberCode(null, Collections.singletonList(pkAccount), pkMember);
return CollUtil.isNotEmpty(cuMemberRechargeAccountParams) ? cuMemberRechargeAccountParams.get(0) : null; return CollUtil.isNotEmpty(cuMemberRechargeAccountParams) ? cuMemberRechargeAccountParams.get(0) : null;
} }
@Override
public Boolean batchUpdateBonusAccountByPkMember(List<CuMemberBonusAccountParam> bonusList, int operateType, Long pkModified) {
return baseMapper.batchUpdateBonusAccountByPkMember(bonusList, operateType, pkModified);
}
@Override @Override
public List<CuMemberAccountRechargeExt> selectMemberBonusAccountBySourceCode(String sourceCode) { public List<CuMemberAccountRechargeExt> selectMemberBonusAccountBySourceCode(String sourceCode) {
return baseMapper.selectMemberBonusAccountBySourceCode(sourceCode); return baseMapper.selectMemberBonusAccountBySourceCode(sourceCode);

View File

@ -478,8 +478,7 @@ public class CuMemberRechargeServiceImpl extends ServiceImpl<CuMemberRechargeMap
CuMemberRechargeExt cuMemberRechargeExt = baseMapper.selectMemberRechargeListTotal(memberRechargeVO); CuMemberRechargeExt cuMemberRechargeExt = baseMapper.selectMemberRechargeListTotal(memberRechargeVO);
cuMemberRechargeVOS.add(BeanUtil.copyProperties(cuMemberRechargeExt, CuMemberRechargeVO.class)); cuMemberRechargeVOS.add(BeanUtil.copyProperties(cuMemberRechargeExt, CuMemberRechargeVO.class));
} }
Object[] objects = new Object[]{cuMemberRechargeExts, cuMemberRechargeVOS}; return new Object[]{cuMemberRechargeExts, cuMemberRechargeVOS};
return objects;
} }
/** /**

View File

@ -20,8 +20,6 @@ import com.hzs.common.domain.member.account.CuMemberAccount;
import com.hzs.common.domain.member.account.CuMemberTrade; import com.hzs.common.domain.member.account.CuMemberTrade;
import com.hzs.common.domain.member.account.CuMemberWithdraw; import com.hzs.common.domain.member.account.CuMemberWithdraw;
import com.hzs.common.domain.member.account.CuMemberWithdrawExt; import com.hzs.common.domain.member.account.CuMemberWithdrawExt;
import com.hzs.common.domain.member.base.CuMember;
import com.hzs.common.domain.member.ext.CuMemberAccountExt;
import com.hzs.common.domain.system.config.*; import com.hzs.common.domain.system.config.*;
import com.hzs.common.domain.system.config.ext.BdWithdrawalTaxExt; import com.hzs.common.domain.system.config.ext.BdWithdrawalTaxExt;
import com.hzs.common.security.utils.SecurityUtils; import com.hzs.common.security.utils.SecurityUtils;
@ -31,13 +29,10 @@ import com.hzs.member.account.dto.MemberAccountAudit;
import com.hzs.member.account.mapper.CuMemberWithdrawMapper; import com.hzs.member.account.mapper.CuMemberWithdrawMapper;
import com.hzs.member.account.param.CuMemberWithdrawRejectParam; import com.hzs.member.account.param.CuMemberWithdrawRejectParam;
import com.hzs.member.account.service.*; import com.hzs.member.account.service.*;
import com.hzs.member.account.vo.CuMemberBankVO;
import com.hzs.member.account.vo.CuMemberPetitionVO; import com.hzs.member.account.vo.CuMemberPetitionVO;
import com.hzs.member.account.vo.CuMemberTradeVO; import com.hzs.member.account.vo.CuMemberTradeVO;
import com.hzs.member.account.vo.CuMemberWithdrawVO; import com.hzs.member.account.vo.CuMemberWithdrawVO;
import com.hzs.member.base.service.ICuMemberService;
import com.hzs.system.base.dto.CurrencyDTO; import com.hzs.system.base.dto.CurrencyDTO;
import com.hzs.system.config.IWithdrawalAutoServiceApi;
import com.hzs.system.config.IWithdrawalProcessServiceApi; import com.hzs.system.config.IWithdrawalProcessServiceApi;
import com.hzs.system.config.IWithdrawalTaxServiceApi; import com.hzs.system.config.IWithdrawalTaxServiceApi;
import com.hzs.system.sys.IApprovalServiceApi; import com.hzs.system.sys.IApprovalServiceApi;
@ -52,8 +47,6 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.time.DayOfWeek;
import java.time.LocalDate;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -64,34 +57,19 @@ import java.util.stream.Collectors;
@Slf4j @Slf4j
public class CuMemberWithdrawServiceImpl extends ServiceImpl<CuMemberWithdrawMapper, CuMemberWithdraw> implements ICuMemberWithdrawService { public class CuMemberWithdrawServiceImpl extends ServiceImpl<CuMemberWithdrawMapper, CuMemberWithdraw> implements ICuMemberWithdrawService {
@Autowired
private ICuMemberTradeService iCuMemberTradeService;
@Autowired
private ICuMemberAccountService iCuMemberAccountService;
@Autowired
private ICuMemberBaseService iCuMemberBaseService;
@DubboReference @DubboReference
IWithdrawalTaxServiceApi withdrawalTaxServiceApi; IWithdrawalTaxServiceApi iWithdrawalTaxServiceApi;
@Autowired
ICuMemberTradeService cuMemberTradeService;
@Autowired
ICuMemberAccountService cuMemberAccountService;
@Autowired
ICuMemberBaseService cuMemberBaseService;
@Autowired
ICuMemberBankService cuMemberBankService;
@Autowired
ICuMemberService cuMemberService;
@DubboReference @DubboReference
IWithdrawalAutoServiceApi withdrawalAutoServiceApi; IWithdrawalProcessServiceApi iWithdrawalProcessServiceApi;
@DubboReference @DubboReference
IWithdrawalProcessServiceApi withdrawalProcessServiceApi; IApprovalServiceApi iApprovalServiceApi;
@DubboReference
IApprovalServiceApi approvalServiceApi;
@Override @Override
public List<CuMemberWithdraw> getWithdrawTimes(Long pkMember) { public List<CuMemberWithdraw> getWithdrawTimes(Long pkMember) {
@ -106,7 +84,6 @@ public class CuMemberWithdrawServiceImpl extends ServiceImpl<CuMemberWithdrawMap
return baseMapper.selectList(queryWrapper); return baseMapper.selectList(queryWrapper);
} }
private BigDecimal[] getIncomeTax(BdWithdrawalTaxExt withdrawalTax, Integer pkCountry, BigDecimal curCashAmount) { private BigDecimal[] getIncomeTax(BdWithdrawalTaxExt withdrawalTax, Integer pkCountry, BigDecimal curCashAmount) {
//个税比例 //个税比例
BigDecimal incomeTax = BigDecimal.ZERO; BigDecimal incomeTax = BigDecimal.ZERO;
@ -149,10 +126,10 @@ public class CuMemberWithdrawServiceImpl extends ServiceImpl<CuMemberWithdrawMap
*/ */
public Integer updateTradeAndBalancd(CuMemberWithdraw cuMemberWithdraw, EOperationMethod eMethodType) { public Integer updateTradeAndBalancd(CuMemberWithdraw cuMemberWithdraw, EOperationMethod eMethodType) {
CuMemberTrade cuMemberTrade = this.getCuMemberTrade(cuMemberWithdraw, eMethodType); CuMemberTrade cuMemberTrade = this.getCuMemberTrade(cuMemberWithdraw, eMethodType);
cuMemberTradeService.save(cuMemberTrade); iCuMemberTradeService.save(cuMemberTrade);
//更新余额表 //更新余额表
Integer pkAccount = cuMemberWithdraw.getPkAccount(); Integer pkAccount = cuMemberWithdraw.getPkAccount();
int accountType = cuMemberBaseService.getAccount(pkAccount).getFieldValue(); int accountType = iCuMemberBaseService.getAccount(pkAccount).getFieldValue();
//提现金额 //提现金额
BigDecimal cashAmount = cuMemberWithdraw.getCashAmount(); BigDecimal cashAmount = cuMemberWithdraw.getCashAmount();
BigDecimal amount = eMethodType.equals(EOperationMethod.INSERT) ? cashAmount.negate() : cashAmount; BigDecimal amount = eMethodType.equals(EOperationMethod.INSERT) ? cashAmount.negate() : cashAmount;
@ -160,7 +137,7 @@ public class CuMemberWithdrawServiceImpl extends ServiceImpl<CuMemberWithdrawMap
.accountType(accountType).amount(amount).pkModified(cuMemberWithdraw.getPkCreator()) .accountType(accountType).amount(amount).pkModified(cuMemberWithdraw.getPkCreator())
.accountClassify(ETradeClassify.WITHDRAWAL.getValue()).pkCountry(cuMemberWithdraw.getPkCountry()) .accountClassify(ETradeClassify.WITHDRAWAL.getValue()).pkCountry(cuMemberWithdraw.getPkCountry())
.transferType(ETransferType.TRANSFER_IN.getValue()).build(); .transferType(ETransferType.TRANSFER_IN.getValue()).build();
return cuMemberAccountService.updateMemberAccountByMemberCode(param); return iCuMemberAccountService.updateMemberAccountByMemberCode(param);
} }
/** /**
@ -182,9 +159,9 @@ public class CuMemberWithdrawServiceImpl extends ServiceImpl<CuMemberWithdrawMap
Integer tradeType = eMethodType.equals(EOperationMethod.INSERT) ? ETradeType.WITHDRAW.getValue() : ETradeType.WITHDRAWAL_REFUSED.getValue(); Integer tradeType = eMethodType.equals(EOperationMethod.INSERT) ? ETradeType.WITHDRAW.getValue() : ETradeType.WITHDRAWAL_REFUSED.getValue();
Integer pkAccount = cuMemberWithdraw.getPkAccount(); Integer pkAccount = cuMemberWithdraw.getPkAccount();
//账户值 //账户值
Integer accountValue = cuMemberBaseService.getAccountValueById(pkAccount); Integer accountValue = iCuMemberBaseService.getAccountValueById(pkAccount);
//查询余额 //查询余额
BigDecimal balance = cuMemberAccountService.selectBalanceByMemberCode(pkMember, accountValue); BigDecimal balance = iCuMemberAccountService.selectBalanceByMemberCode(pkMember, accountValue);
CuMemberTrade memberTrade = CuMemberTrade.builder().pkMember(pkMember) CuMemberTrade memberTrade = CuMemberTrade.builder().pkMember(pkMember)
.tradeCode(tradeCode) .tradeCode(tradeCode)
.pkAccount(pkAccount) .pkAccount(pkAccount)
@ -235,12 +212,9 @@ public class CuMemberWithdrawServiceImpl extends ServiceImpl<CuMemberWithdrawMap
CuMemberWithdrawExt cuMemberWithdrawExt = baseMapper.selectMemberWithdrawListTotal(memberWithdrawVO); CuMemberWithdrawExt cuMemberWithdrawExt = baseMapper.selectMemberWithdrawListTotal(memberWithdrawVO);
cuMemberWithdrawVoS.add(BeanUtil.copyProperties(cuMemberWithdrawExt, CuMemberWithdrawVO.class)); cuMemberWithdrawVoS.add(BeanUtil.copyProperties(cuMemberWithdrawExt, CuMemberWithdrawVO.class));
} }
Object[] objects = new Object[]{cuMemberWithdrawExts, cuMemberWithdrawVoS}; return new Object[]{cuMemberWithdrawExts, cuMemberWithdrawVoS};
return objects;
} }
/** /**
* 页面显示公用参数 * 页面显示公用参数
* *
@ -252,18 +226,18 @@ public class CuMemberWithdrawServiceImpl extends ServiceImpl<CuMemberWithdrawMap
Integer pkRate = memberWithdraw.getPkRate(); Integer pkRate = memberWithdraw.getPkRate();
if (null != pkRate) { if (null != pkRate) {
//汇率 //汇率
exchangeRate = cuMemberBaseService.getCurrencyById(memberWithdraw.getPkRate()).getInExchangeRate(); exchangeRate = iCuMemberBaseService.getCurrencyById(memberWithdraw.getPkRate()).getInExchangeRate();
} else { } else {
//取最新的汇率 //取最新的汇率
CurrencyDTO currencyDTO = cuMemberBaseService.getCurrency(cuMemberWithdrawVO.getPkCountry()); CurrencyDTO currencyDTO = iCuMemberBaseService.getCurrency(cuMemberWithdrawVO.getPkCountry());
exchangeRate = currencyDTO.getInExchangeRate(); exchangeRate = currencyDTO.getInExchangeRate();
} }
//查询提现账户 //查询提现账户
Integer pkAccount = memberWithdraw.getPkAccount(); Integer pkAccount = memberWithdraw.getPkAccount();
Integer accountsType = cuMemberBaseService.getAccountValueById(pkAccount); Integer accountsType = iCuMemberBaseService.getAccountValueById(pkAccount);
//查询账户余额 //查询账户余额
CuMemberAccount cuMemberAccount = cuMemberAccountService.queryCuMemberAccountByPkMember(memberWithdraw.getPkMember()); CuMemberAccount cuMemberAccount = iCuMemberAccountService.queryCuMemberAccountByPkMember(memberWithdraw.getPkMember());
BigDecimal availableBalance; BigDecimal availableBalance;
if (accountsType.equals(EAccount.BONUS.getValue())) { if (accountsType.equals(EAccount.BONUS.getValue())) {
BigDecimal balance = ReflectUtils.invokeGetter(cuMemberAccount, MemberFieldConstants.WITHDRAW_ACCOUNT + accountsType); BigDecimal balance = ReflectUtils.invokeGetter(cuMemberAccount, MemberFieldConstants.WITHDRAW_ACCOUNT + accountsType);
@ -295,10 +269,9 @@ public class CuMemberWithdrawServiceImpl extends ServiceImpl<CuMemberWithdrawMap
cuMemberWithdrawVO.setSettleServiceCharge(settleServiceCharge); cuMemberWithdrawVO.setSettleServiceCharge(settleServiceCharge);
cuMemberWithdrawVO.setSettleCashAmount(settleCashAmount); cuMemberWithdrawVO.setSettleCashAmount(settleCashAmount);
cuMemberWithdrawVO.setSettleIssuedAmount(settleIssuedAmount); cuMemberWithdrawVO.setSettleIssuedAmount(settleIssuedAmount);
cuMemberWithdrawVO.setPkAccount(cuMemberBaseService.translateAccountValue(pkAccount)); cuMemberWithdrawVO.setPkAccount(iCuMemberBaseService.translateAccountValue(pkAccount));
} }
@Override @Override
public CuMemberWithdrawVO queryCuMemberWithdrawDetail(Long pkId) { public CuMemberWithdrawVO queryCuMemberWithdrawDetail(Long pkId) {
CuMemberWithdrawVO memberRechargeDetailVo = new CuMemberWithdrawVO(); CuMemberWithdrawVO memberRechargeDetailVo = new CuMemberWithdrawVO();
@ -315,7 +288,6 @@ public class CuMemberWithdrawServiceImpl extends ServiceImpl<CuMemberWithdrawMap
return baseMapper.withdrawPaymentByPkId(cuMemberWithdraw); return baseMapper.withdrawPaymentByPkId(cuMemberWithdraw);
} }
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public Integer withdrawPaymentPositiveByPkId(CuMemberWithdrawVO memberWithdrawVO) { public Integer withdrawPaymentPositiveByPkId(CuMemberWithdrawVO memberWithdrawVO) {
@ -332,79 +304,6 @@ public class CuMemberWithdrawServiceImpl extends ServiceImpl<CuMemberWithdrawMap
return row; return row;
} }
/**
* 会员提现
*
* @param withdrawal 提现配置信息
* @param cuMemberAccountExts 会员币种表
* @param bdAccounts 币种信息
* @param accountsType 配置的提现币种
* @param pkCountry 国家ID
*/
public void memberWithDrawal(BdWithdrawal withdrawal, List<CuMemberAccountExt> cuMemberAccountExts, List<BdAccount> bdAccounts, Integer accountsType, Integer pkCountry) {
//会员ID 银行卡ID
Long pkMember;
Long pkBank;
//余额 锁定金额
BigDecimal balance, lockAccount;
//最高自动提现金额
BigDecimal upperBound = withdrawal.getUpperBound();
//最低自动提现金额
BigDecimal lowerBound = withdrawal.getLowerBound();
//配置文件中的提现次数
Integer withdrawalNumber = withdrawal.getWithdrawalNumber();
if (CollUtil.isNotEmpty(cuMemberAccountExts)) {
//查询每个会员正在参与审核的次数
List<CuMemberWithdrawExt> withdrawTimesByPkCountry = baseMapper.getWithdrawTimesByPkCountry(pkCountry);
Map<Long, Integer> withdrawTimes = withdrawTimesByPkCountry.stream().collect(Collectors.toMap(CuMemberWithdrawExt::getPkMember, CuMemberWithdrawExt::getTimes));
//汇率
CurrencyDTO currencyDTO = cuMemberBaseService.getCurrency(pkCountry);
for (CuMemberAccountExt cuMemberAccountExt : cuMemberAccountExts) {
pkBank = cuMemberAccountExt.getPkBank();
//是否绑定银行卡
CuMemberBankVO memberBank = cuMemberBankService.selectCuMemberBankById(pkBank);
log.info("----------是否绑定银行卡");
if (null != memberBank) {
log.info("----------绑定银行卡");
pkMember = cuMemberAccountExt.getPkMember();
//获取余额
balance = getAvailableBalance(accountsType, cuMemberAccountExt);
//是否取整
balance = computeRounding(withdrawal, balance);
// 提现金额在配置金额之间
if (balance.compareTo(lowerBound) > 0 && balance.compareTo(upperBound) < 0) {
log.info("----------提现开始");
Integer times = withdrawTimes.get(pkMember) == null ? 0 : withdrawTimes.get(pkMember);
//比较正在提现次数与配置的最大提现次数
if (times <= withdrawalNumber) {
//本次应缴个税
BigDecimal payIncomeTax = computeIncomeTaxValue(pkMember, balance, pkCountry, lowerBound);
//手续费金额
BigDecimal serviceChargeAmount = computeServiceCharge(pkCountry, balance);
BigDecimal issuedAmount = balance.subtract(payIncomeTax).subtract(serviceChargeAmount);
String code = CommonUtil.createSerialNumber(EOrderPrefix.WITHDRAWAL_CODE.getValue());
CuMember member = cuMemberService.getMember(pkMember);
String remarks = member.getMemberCode() + "自动申请提现" + balance.toString();
CuMemberWithdraw cuMemberWithdraw = CuMemberWithdraw.builder().pkMember(pkMember)
.pkAccount(bdAccounts.get(0).getPkId()).pkBank(pkBank)
.pkRate(currencyDTO.getPkId()).cashAmount(balance)
.serviceCharge(serviceChargeAmount).incomeTax(payIncomeTax)
.issuedAmount(issuedAmount).withdrawCode(code).remarks(remarks).build();
cuMemberWithdraw.setApproveState(EApproveStatus.WAIT_SUBMIT.getValue());
cuMemberWithdraw.setDelFlag(EDelFlag.UN_DELETE.getValue());
cuMemberWithdraw.setPkCountry(pkCountry);
cuMemberWithdraw.setPkCreator(pkMember);
//保存提现交易流水余额信息
baseMapper.insert(cuMemberWithdraw);
this.updateTradeAndBalancd(cuMemberWithdraw, EOperationMethod.INSERT);
}
}
}
}
}
}
/** /**
* 获取余额 * 获取余额
* *
@ -447,44 +346,10 @@ public class CuMemberWithdrawServiceImpl extends ServiceImpl<CuMemberWithdrawMap
return account.subtract(lockConsume).subtract(lockTransfer); 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 = withdrawalAutoServiceApi.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) {
//提现账户
if (null == accountsType) {
List<BdAccount> bdAccounts = cuMemberBaseService.getAccountByCountry(EAccountProperty.IS_WITHDRAWAL.getValue(), pkCountry);
accountsType = bdAccounts.get(0).getFieldValue();
}
//查询账户余额
return cuMemberAccountService.selectBalanceByMemberCode(pkMember, accountsType);
}
@Override @Override
public BigDecimal computeIncomeTaxValue(Long pkMember, BigDecimal cashAmount, Integer pkCountry, BigDecimal minAmount) { public BigDecimal computeIncomeTaxValue(Long pkMember, BigDecimal cashAmount, Integer pkCountry, BigDecimal minAmount) {
//获取个税配置 //获取个税配置
R<BdWithdrawalTaxExt> bdWithdrawalTaxExtR = withdrawalTaxServiceApi.queryWithdrawalTax(pkCountry); R<BdWithdrawalTaxExt> bdWithdrawalTaxExtR = iWithdrawalTaxServiceApi.queryWithdrawalTax(pkCountry);
BdWithdrawalTaxExt withdrawalTax = bdWithdrawalTaxExtR.getData(); BdWithdrawalTaxExt withdrawalTax = bdWithdrawalTaxExtR.getData();
if (null == withdrawalTax) { if (null == withdrawalTax) {
return BigDecimal.ZERO; return BigDecimal.ZERO;
@ -517,7 +382,7 @@ public class CuMemberWithdrawServiceImpl extends ServiceImpl<CuMemberWithdrawMap
@Override @Override
public BigDecimal computeServiceCharge(Integer pkCountry, BigDecimal cashAmount) { public BigDecimal computeServiceCharge(Integer pkCountry, BigDecimal cashAmount) {
BdWithdrawalProcess withdrawalProcess = withdrawalProcessServiceApi.queryBdWithdrawalProcess(pkCountry).getData(); BdWithdrawalProcess withdrawalProcess = iWithdrawalProcessServiceApi.queryBdWithdrawalProcess(pkCountry).getData();
//手续费类型 //手续费类型
Integer serviceType = withdrawalProcess.getServiceType(); Integer serviceType = withdrawalProcess.getServiceType();
BigDecimal serviceRatio = withdrawalProcess.getServiceRatio(); BigDecimal serviceRatio = withdrawalProcess.getServiceRatio();
@ -530,27 +395,13 @@ public class CuMemberWithdrawServiceImpl extends ServiceImpl<CuMemberWithdrawMap
//手续费金额 = 本次提现金额 * 手续费比例 //手续费金额 = 本次提现金额 * 手续费比例
return cashAmount.multiply(serviceChargeeRatio).setScale(4, BigDecimal.ROUND_HALF_UP); return cashAmount.multiply(serviceChargeeRatio).setScale(4, BigDecimal.ROUND_HALF_UP);
} }
} }
@Override
public BigDecimal computeRounding(BdWithdrawal bdWithdrawal, BigDecimal cashAmount) {
BigDecimal roundIngAmount = cashAmount;
Integer isRounding = bdWithdrawal.getIsRounding();
if (isRounding.equals(EYesNo.YES.getIntValue())) {
//向下取整
roundIngAmount = cashAmount.setScale(0, BigDecimal.ROUND_DOWN);
}
return roundIngAmount;
}
@Override @Override
public List<CuMemberWithdraw> getWithdrawApproveStateByIds(List<Long> pkIds, Integer approveState) { public List<CuMemberWithdraw> getWithdrawApproveStateByIds(List<Long> pkIds, Integer approveState) {
return baseMapper.getWithdrawApproveStateByIds(pkIds, approveState); return baseMapper.getWithdrawApproveStateByIds(pkIds, approveState);
} }
@Override @Override
public CuMemberPetitionVO showMemberWithdrawPetition(List<Long> pkIds, Integer approveState) { public CuMemberPetitionVO showMemberWithdrawPetition(List<Long> pkIds, Integer approveState) {
CuMemberPetitionVO memberPetitionVo = new CuMemberPetitionVO(); CuMemberPetitionVO memberPetitionVo = new CuMemberPetitionVO();
@ -563,7 +414,6 @@ public class CuMemberWithdrawServiceImpl extends ServiceImpl<CuMemberWithdrawMap
return memberPetitionVo; return memberPetitionVo;
} }
@Override @Override
public List<CuMemberWithdrawVO> checkWithdrawPetitionByState(List<Long> pkIds, Integer approveState) { public List<CuMemberWithdrawVO> checkWithdrawPetitionByState(List<Long> pkIds, Integer approveState) {
return BeanUtil.copyToList(baseMapper.showMemberWithdrawPetition(pkIds, approveState), CuMemberWithdrawVO.class); return BeanUtil.copyToList(baseMapper.showMemberWithdrawPetition(pkIds, approveState), CuMemberWithdrawVO.class);
@ -587,7 +437,7 @@ public class CuMemberWithdrawServiceImpl extends ServiceImpl<CuMemberWithdrawMap
List<String> withdrawCodeList = cuMemberWithdrawExts.stream().map(CuMemberWithdrawExt::getWithdrawCode).collect(Collectors.toList()); List<String> withdrawCodeList = cuMemberWithdrawExts.stream().map(CuMemberWithdrawExt::getWithdrawCode).collect(Collectors.toList());
CuMemberTradeVO memberTradeVO = CuMemberTradeVO.builder().sourceCode(businessNo) CuMemberTradeVO memberTradeVO = CuMemberTradeVO.builder().sourceCode(businessNo)
.tradeCodes(withdrawCodeList).pkModified(loginUser.getUserId()).build(); .tradeCodes(withdrawCodeList).pkModified(loginUser.getUserId()).build();
cuMemberTradeService.updateSourceCodeByTradeCode(memberTradeVO); iCuMemberTradeService.updateSourceCodeByTradeCode(memberTradeVO);
List<CuMemberWithdrawVO> memberWithdrawList = memberPetitionVo.getMemberWithdrawList(); List<CuMemberWithdrawVO> memberWithdrawList = memberPetitionVo.getMemberWithdrawList();
//提交提现用户 //提交提现用户
@ -600,7 +450,7 @@ public class CuMemberWithdrawServiceImpl extends ServiceImpl<CuMemberWithdrawMap
.remark(memberPetitionVo.getDescription()) .remark(memberPetitionVo.getDescription())
.pkMemberList(pkMembers).build(); .pkMemberList(pkMembers).build();
//调用审批接口 //调用审批接口
R<String> submit = approvalServiceApi.submit(approvalSubmitDTO, loginUser); R<String> submit = iApprovalServiceApi.submit(approvalSubmitDTO, loginUser);
if (!submit.isSuccess()) { if (!submit.isSuccess()) {
throw new RuntimeException(submit.getMsg()); throw new RuntimeException(submit.getMsg());
} }
@ -636,7 +486,7 @@ public class CuMemberWithdrawServiceImpl extends ServiceImpl<CuMemberWithdrawMap
.freeSignFlag(false).build(); .freeSignFlag(false).build();
} }
businessLogDTOList.add(businessLog); businessLogDTOList.add(businessLog);
cuMemberBaseService.operationLogMQ(businessLogDTOList); iCuMemberBaseService.operationLogMQ(businessLogDTOList);
} }
} }
@ -647,7 +497,7 @@ public class CuMemberWithdrawServiceImpl extends ServiceImpl<CuMemberWithdrawMap
List<CuMemberWithdrawExt> cuMemberWithdrawList = baseMapper.selectMemberWithdrawListByPkMember(pkMember, pkCountry); List<CuMemberWithdrawExt> cuMemberWithdrawList = baseMapper.selectMemberWithdrawListByPkMember(pkMember, pkCountry);
if (CollUtil.isNotEmpty(cuMemberWithdrawList)) { if (CollUtil.isNotEmpty(cuMemberWithdrawList)) {
//查询币种值 //查询币种值
List<BdAccount> allAccounts = cuMemberBaseService.getAccountByCountryId(pkCountry); List<BdAccount> allAccounts = iCuMemberBaseService.getAccountByCountryId(pkCountry);
Map<Integer, BdAccount> map = allAccounts.stream().collect(Collectors.toMap(BdAccount::getPkId, o -> o)); Map<Integer, BdAccount> map = allAccounts.stream().collect(Collectors.toMap(BdAccount::getPkId, o -> o));
for (CuMemberWithdrawExt ext : cuMemberWithdrawList) { for (CuMemberWithdrawExt ext : cuMemberWithdrawList) {
cuMemberWithdrawVO = BeanUtil.copyProperties(ext, CuMemberWithdrawVO.class); cuMemberWithdrawVO = BeanUtil.copyProperties(ext, CuMemberWithdrawVO.class);
@ -669,18 +519,18 @@ public class CuMemberWithdrawServiceImpl extends ServiceImpl<CuMemberWithdrawMap
BigDecimal backAmount = cuMemberWithdraw.getCashAmount(); BigDecimal backAmount = cuMemberWithdraw.getCashAmount();
if (backAmount.compareTo(BigDecimal.ZERO) > 0) { if (backAmount.compareTo(BigDecimal.ZERO) > 0) {
//插入交易明细表 //插入交易明细表
cuMemberTradeService.save(getCuMemberTradeInfo(cuMemberWithdraw)); iCuMemberTradeService.save(getCuMemberTradeInfo(cuMemberWithdraw));
//更新余额表 //更新余额表
CuMemberAccount cuMemberAccount = this.getCuMemberAccount(cuMemberWithdraw, backAmount); CuMemberAccount cuMemberAccount = this.getCuMemberAccount(cuMemberWithdraw, backAmount);
cuMemberAccount.setPkCountry(cuMemberWithdraw.getPkCountry()); cuMemberAccount.setPkCountry(cuMemberWithdraw.getPkCountry());
cuMemberAccountService.updateMemberAccount(cuMemberAccount, pkModified); iCuMemberAccountService.updateMemberAccount(cuMemberAccount, pkModified);
} }
return baseMapper.updateWithdrawStatusByPkId(pkId, pkModified); return baseMapper.updateWithdrawStatusByPkId(pkId, pkModified);
} }
private CuMemberAccount getCuMemberAccount(CuMemberWithdraw cuMemberWithdraw, BigDecimal backAmount) { private CuMemberAccount getCuMemberAccount(CuMemberWithdraw cuMemberWithdraw, BigDecimal backAmount) {
Integer pkAccount = cuMemberWithdraw.getPkAccount(); Integer pkAccount = cuMemberWithdraw.getPkAccount();
BdAccount account = cuMemberBaseService.getAccount(pkAccount); BdAccount account = iCuMemberBaseService.getAccount(pkAccount);
if (account.getFieldValue().equals(EAccount.BONUS.getValue())) { if (account.getFieldValue().equals(EAccount.BONUS.getValue())) {
return CuMemberAccount.builder() return CuMemberAccount.builder()
.account4(backAmount) .account4(backAmount)
@ -704,11 +554,11 @@ public class CuMemberWithdrawServiceImpl extends ServiceImpl<CuMemberWithdrawMap
private CuMemberTrade getCuMemberTradeInfo(CuMemberWithdraw cuMemberWithdraw) { private CuMemberTrade getCuMemberTradeInfo(CuMemberWithdraw cuMemberWithdraw) {
Long pkMember = cuMemberWithdraw.getPkMember(); Long pkMember = cuMemberWithdraw.getPkMember();
Integer pkAccount = cuMemberWithdraw.getPkAccount(); Integer pkAccount = cuMemberWithdraw.getPkAccount();
BdAccount account = cuMemberBaseService.getAccount(pkAccount); BdAccount account = iCuMemberBaseService.getAccount(pkAccount);
//交易金额 //交易金额
BigDecimal tradeAmount = cuMemberWithdraw.getCashAmount(); BigDecimal tradeAmount = cuMemberWithdraw.getCashAmount();
//查询余额 //查询余额
BigDecimal balance = cuMemberAccountService.selectBalanceByMemberCode(pkMember, account.getFieldValue()); BigDecimal balance = iCuMemberAccountService.selectBalanceByMemberCode(pkMember, account.getFieldValue());
CuMemberTrade memberTrade = CuMemberTrade.builder().pkMember(pkMember) CuMemberTrade memberTrade = CuMemberTrade.builder().pkMember(pkMember)
.tradeCode(CommonUtil.createSerialNumber(EOrderPrefix.WITHDRAWAL_CODE.getValue())) .tradeCode(CommonUtil.createSerialNumber(EOrderPrefix.WITHDRAWAL_CODE.getValue()))
.pkAccount(pkAccount) .pkAccount(pkAccount)
@ -734,13 +584,13 @@ public class CuMemberWithdrawServiceImpl extends ServiceImpl<CuMemberWithdrawMap
@Override @Override
public void withdrawReject(CuMemberWithdrawRejectParam param) { public void withdrawReject(CuMemberWithdrawRejectParam param) {
if(ObjectUtil.isEmpty(param)){ if (ObjectUtil.isEmpty(param)) {
throw new ServiceException("参数异常!"); throw new ServiceException("参数异常!");
} }
if(CollUtil.isEmpty(param.getIdList())){ if (CollUtil.isEmpty(param.getIdList())) {
throw new ServiceException("请选择需要驳回的数据!"); throw new ServiceException("请选择需要驳回的数据!");
} }
if(StrUtil.isEmpty(param.getRejectRemark())){ if (StrUtil.isEmpty(param.getRejectRemark())) {
throw new ServiceException("请录入驳回原因!"); throw new ServiceException("请录入驳回原因!");
} }
LambdaQueryWrapper<CuMemberWithdraw> wrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<CuMemberWithdraw> wrapper = new LambdaQueryWrapper<>();
@ -753,13 +603,13 @@ public class CuMemberWithdrawServiceImpl extends ServiceImpl<CuMemberWithdrawMap
baseMapper.update(withdraw, wrapper); baseMapper.update(withdraw, wrapper);
List<CuMemberWithdraw> cuMemberWithdrawList = baseMapper.selectList(wrapper); List<CuMemberWithdraw> cuMemberWithdrawList = baseMapper.selectList(wrapper);
Integer pkCountry = SecurityUtils.getPkCountry(); Integer pkCountry = SecurityUtils.getPkCountry();
if(CollUtil.isNotEmpty(cuMemberWithdrawList)){ if (CollUtil.isNotEmpty(cuMemberWithdrawList)) {
for (CuMemberWithdraw cuMemberWithdraw : cuMemberWithdrawList) { for (CuMemberWithdraw cuMemberWithdraw : cuMemberWithdrawList) {
BusinessCommissionDTO businessCommissionDTO = BusinessCommissionDTO.builder() BusinessCommissionDTO businessCommissionDTO = BusinessCommissionDTO.builder()
.tradeCode(cuMemberWithdraw.getWithdrawCode()).pkCountry(pkCountry) .tradeCode(cuMemberWithdraw.getWithdrawCode()).pkCountry(pkCountry)
.tradeType(EApprovalBusiness.WITHDRAWAL.getValue()) .tradeType(EApprovalBusiness.WITHDRAWAL.getValue())
.pkCreator(SecurityUtils.getUserId()).build(); .pkCreator(SecurityUtils.getUserId()).build();
cuMemberTradeService.businessCommissionReject(businessCommissionDTO); iCuMemberTradeService.businessCommissionReject(businessCommissionDTO);
} }
} }
} }

View File

@ -13,15 +13,8 @@ import java.util.Date;
import java.util.List; import java.util.List;
/** /**
* <p>
* 会员提现表 * 会员提现表
* </p>
*
* @author hzs
* @since 2022-09-06
*/ */
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@Data @Data
@Builder @Builder
@ -227,7 +220,6 @@ public class CuMemberWithdrawVO extends CuMemberBaseVO {
/** /**
* 状态0=未打款1=已打款2=已充正3=撤消 * 状态0=未打款1=已打款2=已充正3=撤消
*/ */
@Transaction(transactionKey = EnumsPrefixConstants.ENU_WITHDRAW_STATUS)
private Integer status; private Integer status;
@Excel(name = "打款状态") @Excel(name = "打款状态")

View File

@ -235,19 +235,6 @@
</if> </if>
</update> </update>
<select id="queryMemberAccountByPkCountry" resultType="com.hzs.common.domain.member.ext.CuMemberAccountExt">
select a.*, b.pk_id pkBank
from cu_member_account a,
cu_member_bank b
where a.pk_member = b.pk_member
and a.del_flag = 0
and b.del_flag = 0
and b.default_card = 1
and a.is_withdraw = 0
and a.pk_country = #{pkCountry}
</select>
<select id="queryMemberAccountByMemberCode" resultType="com.hzs.member.account.dto.CuMemberRechargeAccountParam"> <select id="queryMemberAccountByMemberCode" resultType="com.hzs.member.account.dto.CuMemberRechargeAccountParam">
select pk_id, pk_member, account_name, decode(account_name, 'ACCOUNT4', select pk_id, pk_member, account_name, decode(account_name, 'ACCOUNT4',
WITHDRAW_ACCOUNT4-lock_withdraw_account4, 0) withdrawBalance, WITHDRAW_ACCOUNT4-lock_withdraw_account4, 0) withdrawBalance,
@ -989,53 +976,6 @@
#{item.pkMember} #{item.pkMember}
</foreach> </foreach>
</update> </update>
<update id="updateMemberAccountGrantByPeriod">
merge into cu_member_account a
using (select pk_member,
sum(real_income_total * bc.out_exchange_rate) account4,
sum(back_points * bc.out_exchange_rate) account5,
sum(repur_coupon_subtotal * bc.out_exchange_rate) account8,
sum(global_points * bc.out_exchange_rate) account9,
sum(car_award_points * bc.out_exchange_rate) account10
from cu_member_bonus cb
inner join bd_currency bc
on cb.pk_country = bc.pk_country
where cb.del_flag = 0
and cb.pk_country = #{pkCountry}
and period between #{startPeriod} and #{endPeriod}
and cb.grant_status = 2
group by pk_member
) b
on (a.pk_member = b.pk_member)
when matched then
update set a.account4 = a.account4 + b.account4,
a.consume_account4 = a.consume_account4 + b.account4,
a.account5 = a.account5 + b.account5,
a.account8 = a.account8 + b.account8
</update>
<update id="updateMemberAccountWithdrawalByPeriod">
merge into cu_member_account a
using (
select a.pk_member, (case when CONSUME_ACCOUNT4 >= a.consume_money then a.consume_money else CONSUME_ACCOUNT4 end) consume_money
from (select ct.pk_member, sum(cd.consume_money) consume_money
from cu_member_trade ct
inner join cu_member_trade_detail cd
on cd.pk_member_trade = ct.pk_id
where cd.del_flag = 0
and ct.del_flag = 0
and cd.trade_statue = 1
and cd.period between #{startPeriod} and #{endPeriod}
and ct.pk_country = #{pkCountry}
group by ct.pk_member) a
inner join cu_member_account ca
on a.pk_member = ca.pk_member
where ca.CONSUME_ACCOUNT4 > 0
) b
on (a.pk_member = b.pk_member)
when matched then
update set a.withdraw_account4 = a.withdraw_account4 + b.consume_money,
a.consume_account4 = a.consume_account4 - b.consume_money
</update>
<select id="selectMemberAccountByPkMember" resultType="com.hzs.common.domain.member.account.CuMemberAccount"> <select id="selectMemberAccountByPkMember" resultType="com.hzs.common.domain.member.account.CuMemberAccount">
select a.pk_member, select a.pk_member,
@ -1064,25 +1004,6 @@
</if> </if>
</select> </select>
<!-- 查询会员账户以及会员信息 -->
<select id="queryAccountAndMemberInfo" resultType="com.hzs.common.domain.member.ext.CuMemberAccountExt">
select cm.member_code,
cm.member_name,
cm.pk_parent,
cm.pk_place_parent,
cma.*
from cu_member cm
inner join cu_member_account cma
on cm.pk_id = cma.pk_member
where cm.del_flag = 0
<if test="memberIdList != null and memberIdList.size > 0">
and cm.pk_id in
<foreach collection="memberIdList" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
</select>
<select id="queryWalletBalanceByPkMember" resultType="com.hzs.member.account.dto.CuMemberRechargeAccountParam"> <select id="queryWalletBalanceByPkMember" resultType="com.hzs.member.account.dto.CuMemberRechargeAccountParam">
select pk_id, select pk_id,
decode(account_name, 'ACCOUNT4', WITHDRAW_ACCOUNT4 - lock_withdraw_account4, 0) withdrawBalance, decode(account_name, 'ACCOUNT4', WITHDRAW_ACCOUNT4 - lock_withdraw_account4, 0) withdrawBalance,
@ -1217,52 +1138,6 @@
</if> </if>
</select> </select>
<update id="batchUpdateBonusAccountByPkMember">
MERGE INTO cu_member_account m
USING
(
<foreach collection="bonusList" item="item" index="index" separator="union">
select #{item.pkMember} pk_member,
<if test='operateType == "1"'>
#{item.account4} account4,
#{item.consumeAccount4} consumeAccount4,
</if>
<if test='operateType == "2"'>
#{item.account4} account4,
#{item.withdrawAccount4} withdrawAccount4,
</if>
<if test='pkAccount == "3"'>
#{item.account4} account4,
#{item.consumeAccount4} consumeAccount4,
#{item.withdrawAccount4} withdrawAccount4,
</if>
FROM DUAL
</foreach>
) t
ON ( t.pk_member=m.pk_member and m.pk_member in
<foreach collection="bonusList" item="item" open="(" close=")" separator=",">
#{item.pkMember}
</foreach>)
WHEN MATCHED THEN
UPDATE SET
<if test='operateType == "1"'>
m.account4 = NVL(t.account4, 0) + m.account4,
m.consume_account4 = NVL(t.consumeAccount4, 0) + m.consume_account4,
</if>
<if test='operateType == "2"'>
m.account4 = NVL(t.account4, 0) + m.account4,
m.withdraw_account4 = NVL(t.withdrawAccount4, 0) + m.withdraw_account4,
</if>
<if test='operateType == "3"'>
m.account4 = NVL(t.account4, 0) + m.account4,
m.consume_account4 = NVL(t.consumeAccount4, 0) + m.consume_account4,
m.withdraw_account4 = NVL(t.withdrawAccount4, 0) + m.withdraw_account4,
</if>
m.MODIFIED_TIME = sysdate,m.pk_modified = #{pkModified}
</update>
<select id="selectMemberBonusAccountBySourceCode" resultType="com.hzs.common.domain.member.account.CuMemberAccountRechargeExt"> <select id="selectMemberBonusAccountBySourceCode" resultType="com.hzs.common.domain.member.account.CuMemberAccountRechargeExt">
SELECT r.pk_member pkMember, SELECT r.pk_member pkMember,
ma.account4 account4, ma.account4 account4,

View File

@ -34,19 +34,6 @@
<result column="BATCH" property="batch"/> <result column="BATCH" property="batch"/>
</resultMap> </resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
DEL_FLAG
,
PK_COUNTRY,
PK_CREATOR,
CREATION_TIME,
PK_MODIFIED,
MODIFIED_TIME,
PK_ID, PK_MEMBER, WITHDRAW_CODE, PK_ACCOUNT, PK_BANK, PK_RATE, CASH_AMOUNT, SERVICE_CHARGE, INCOME_TAX,
ISSUED_AMOUNT,APPROVE_STATE, PAYMENT_TIME, PAYER, REMARKS, APPROVER, APPROVE_TIME, PK_ROLE, ROLE_NAME,STATUS,PAYER_REMARKS,APPROVE_REMARKS
</sql>
<sql id="select_base"> <sql id="select_base">
SELECT r.*, SELECT r.*,
m.member_code memberCode, m.member_code memberCode,
@ -55,7 +42,7 @@
b.sub_bank_name subBankName, b.sub_bank_name subBankName,
b.card_number cardNumber, b.card_number cardNumber,
b.account_name accountName, b.account_name accountName,
b.id_card idCard, nvl(m.id_card, b.id_card) idCard,
b.phone, b.phone,
b.pk_id pkBdBank, b.pk_id pkBdBank,
u.user_name paymentName, u.user_name paymentName,

View File

@ -1,16 +1,10 @@
package com.hzs.system.base.mapper; package com.hzs.system.base.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hzs.common.domain.system.base.BdCurrency; import com.hzs.common.domain.system.base.BdCurrency;
/** /**
* <p>
* 币种表 Mapper 接口 * 币种表 Mapper 接口
* </p>
*
* @author hzs
* @since 2022-08-04
*/ */
public interface BdCurrencyMapper extends BaseMapper<BdCurrency> { 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.math.BigDecimal;
import java.util.List; 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> { public interface IBdCurrencyService extends IService<BdCurrency> {
/** /**
* 根据国家获得币种 * 根据国家获得币种
* *
* @param pkCountry 国家 * @param pkCountry 国家
* @return: BdCurrency
* @Author: sui q
* @Date: 2022/9/8 15:05
*/ */
BdCurrency getCurrency(Integer pkCountry); 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(); List<BdCurrency> queryAllBdCurrency();
@ -61,9 +47,6 @@ public interface IBdCurrencyService extends IService<BdCurrency> {
* 更新汇率根据id * 更新汇率根据id
* *
* @param pkId 主键 * @param pkId 主键
* @return: void
* @Author: sui q
* @Date: 2023/3/10 15:37
*/ */
void updateCurrencyById(Integer pkId); void updateCurrencyById(Integer pkId);

View File

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

View File

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

View File

@ -1,15 +1,12 @@
package com.hzs.system.config.controller.manage; package com.hzs.system.config.controller.manage;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.hzs.common.core.annotation.Log; import com.hzs.common.core.annotation.Log;
import com.hzs.common.core.constant.CacheConstants;
import com.hzs.common.core.constant.msg.ConfigMsgConstants; import com.hzs.common.core.constant.msg.ConfigMsgConstants;
import com.hzs.common.core.enums.*; import com.hzs.common.core.enums.*;
import com.hzs.common.core.service.RedisService;
import com.hzs.common.core.utils.StringUtils; import com.hzs.common.core.utils.StringUtils;
import com.hzs.common.core.utils.poi.ExcelUtil; import com.hzs.common.core.utils.poi.ExcelUtil;
import com.hzs.common.core.web.controller.BaseController; import com.hzs.common.core.web.controller.BaseController;
@ -21,13 +18,10 @@ import com.hzs.common.domain.system.config.ext.BdWithdrawalAutoExt;
import com.hzs.common.domain.system.config.ext.BdWithdrawalExt; import com.hzs.common.domain.system.config.ext.BdWithdrawalExt;
import com.hzs.common.security.utils.SecurityUtils; import com.hzs.common.security.utils.SecurityUtils;
import com.hzs.common.util.TransactionUtils; import com.hzs.common.util.TransactionUtils;
import com.hzs.system.base.ITransactionServiceApi;
import com.hzs.system.base.service.IBdCurrencyService; 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.IBdWithdrawalAutoService;
import com.hzs.system.config.service.IBdWithdrawalService; import com.hzs.system.config.service.IBdWithdrawalService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -38,12 +32,7 @@ import java.util.Date;
import java.util.List; import java.util.List;
/** /**
* <p>
* 提现设置主表 前端控制器 * 提现设置主表 前端控制器
* </p>
*
* @author zhangjing
* @since 2022-08-29
*/ */
@Slf4j @Slf4j
@RestController @RestController
@ -51,58 +40,42 @@ import java.util.List;
public class BdWithdrawalController extends BaseController { public class BdWithdrawalController extends BaseController {
@Autowired @Autowired
private IBdWithdrawalService withdrawalService; private IBdWithdrawalService iBdWithdrawalService;
@DubboReference
private ITransactionServiceApi iTransactionServiceApi;
private RedisService redisService;
@DubboReference
private IWithdrawalServiceApi withdrawalServiceApi;
@Autowired @Autowired
private IBdWithdrawalAutoService withdrawalAutoService; private IBdWithdrawalAutoService iBdWithdrawalAutoService;
@Autowired @Autowired
IBdCurrencyService currencyService; private IBdCurrencyService iBdCurrencyService;
@Autowired
public void setRedisService(RedisService redisService) {
this.redisService = redisService;
}
/** /**
* @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") @GetMapping("/list")
public TableDataInfo list(BdWithdrawalExt withdrawalExt) { public TableDataInfo list(BdWithdrawalExt withdrawalExt) {
startPage(); startPage();
withdrawalExt.setPkCountry(SecurityUtils.getPkCountry()); withdrawalExt.setPkCountry(SecurityUtils.getPkCountry());
List<BdWithdrawalExt> listExt = withdrawalService.listExt(withdrawalExt); List<BdWithdrawalExt> listExt = iBdWithdrawalService.listExt(withdrawalExt);
for(BdWithdrawalExt bwd: listExt){ for (BdWithdrawalExt bwd : listExt) {
//暂时使用中国 //暂时使用中国
if(StringUtils.isNotNull(bwd.getMinAmount())){ if (StringUtils.isNotNull(bwd.getMinAmount())) {
bwd.setMinAmountUsa(currencyService.getDollar(bwd.getMinAmount(),SecurityUtils.getPkCountry())); bwd.setMinAmountUsa(iBdCurrencyService.getDollar(bwd.getMinAmount(), SecurityUtils.getPkCountry()));
} }
if(StringUtils.isNotNull(bwd.getMaxAmount())){ if (StringUtils.isNotNull(bwd.getMaxAmount())) {
bwd.setMaxAmountUsa(currencyService.getDollar(bwd.getMaxAmount(),SecurityUtils.getPkCountry())); bwd.setMaxAmountUsa(iBdCurrencyService.getDollar(bwd.getMaxAmount(), SecurityUtils.getPkCountry()));
} }
if(StringUtils.isNotNull(bwd.getLowerBound())){ if (StringUtils.isNotNull(bwd.getLowerBound())) {
bwd.setLowerBoundUsa(currencyService.getDollar(bwd.getLowerBound(),SecurityUtils.getPkCountry())); bwd.setLowerBoundUsa(iBdCurrencyService.getDollar(bwd.getLowerBound(), SecurityUtils.getPkCountry()));
} }
if(StringUtils.isNotNull(bwd.getUpperBound())){ if (StringUtils.isNotNull(bwd.getUpperBound())) {
bwd.setUpperBoundUsa(currencyService.getDollar(bwd.getUpperBound(),SecurityUtils.getPkCountry())); bwd.setUpperBoundUsa(iBdCurrencyService.getDollar(bwd.getUpperBound(), SecurityUtils.getPkCountry()));
} }
QueryWrapper<BdWithdrawalAuto> queryWrapperAuto = new QueryWrapper(); QueryWrapper<BdWithdrawalAuto> queryWrapperAuto = new QueryWrapper<>();
queryWrapperAuto.eq("PK_COUNTRY",SecurityUtils.getPkCountry()); queryWrapperAuto.eq("PK_COUNTRY", SecurityUtils.getPkCountry());
if(StringUtils.isNotNull(bwd.getPkId())){ if (StringUtils.isNotNull(bwd.getPkId())) {
queryWrapperAuto.eq("PK_WITHDRAWAL",bwd.getPkId()); queryWrapperAuto.eq("PK_WITHDRAWAL", bwd.getPkId());
} }
List<BdWithdrawalAuto> listAuto = withdrawalAutoService.list(queryWrapperAuto); List<BdWithdrawalAuto> listAuto = iBdWithdrawalAutoService.list(queryWrapperAuto);
List<BdWithdrawalAutoExt> watExtList = new ArrayList<>(); List<BdWithdrawalAutoExt> watExtList = new ArrayList<>();
listAuto.forEach(item -> watExtList.add(BeanUtil.copyProperties(item, BdWithdrawalAutoExt.class))); listAuto.forEach(item -> watExtList.add(BeanUtil.copyProperties(item, BdWithdrawalAutoExt.class)));
bwd.setWithdrawalAutoList(watExtList); bwd.setWithdrawalAutoList(watExtList);
@ -111,42 +84,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") @PostMapping("/export")
public void export(HttpServletResponse response, BdWithdrawalExt withdrawalExt) { public void export(HttpServletResponse response) {
QueryWrapper<BdWithdrawal> queryWrapper = new QueryWrapper(); QueryWrapper<BdWithdrawal> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("PK_COUNTRY",SecurityUtils.getPkCountry()); queryWrapper.eq("PK_COUNTRY", SecurityUtils.getPkCountry());
queryWrapper.orderByDesc("CREATION_TIME"); queryWrapper.orderByDesc("CREATION_TIME");
List<BdWithdrawal> list = withdrawalService.list(queryWrapper); List<BdWithdrawal> list = iBdWithdrawalService.list(queryWrapper);
List<BdWithdrawalExt> listExt=new ArrayList<>(); List<BdWithdrawalExt> listExt = new ArrayList<>();
for(BdWithdrawal bwd: list){ for (BdWithdrawal bwd : list) {
BdWithdrawalExt withdrawalExtNew= BeanUtil.copyProperties(bwd, BdWithdrawalExt.class); BdWithdrawalExt withdrawalExtNew = BeanUtil.copyProperties(bwd, BdWithdrawalExt.class);
//暂时使用中国 //暂时使用中国
if(StringUtils.isNotNull(bwd.getMinAmount())){ if (StringUtils.isNotNull(bwd.getMinAmount())) {
withdrawalExtNew.setMinAmountUsa(currencyService.getDollar(bwd.getMinAmount(),SecurityUtils.getPkCountry())); withdrawalExtNew.setMinAmountUsa(iBdCurrencyService.getDollar(bwd.getMinAmount(), SecurityUtils.getPkCountry()));
} }
if(StringUtils.isNotNull(bwd.getMaxAmount())){ if (StringUtils.isNotNull(bwd.getMaxAmount())) {
withdrawalExtNew.setMaxAmountUsa(currencyService.getDollar(bwd.getMaxAmount(),SecurityUtils.getPkCountry())); withdrawalExtNew.setMaxAmountUsa(iBdCurrencyService.getDollar(bwd.getMaxAmount(), SecurityUtils.getPkCountry()));
} }
if(StringUtils.isNotNull(bwd.getLowerBound())){ if (StringUtils.isNotNull(bwd.getLowerBound())) {
withdrawalExtNew.setLowerBoundUsa(currencyService.getDollar(bwd.getLowerBound(),SecurityUtils.getPkCountry())); withdrawalExtNew.setLowerBoundUsa(iBdCurrencyService.getDollar(bwd.getLowerBound(), SecurityUtils.getPkCountry()));
} }
if(StringUtils.isNotNull(bwd.getUpperBound())){ if (StringUtils.isNotNull(bwd.getUpperBound())) {
withdrawalExtNew.setUpperBoundUsa(currencyService.getDollar(bwd.getUpperBound(),SecurityUtils.getPkCountry())); withdrawalExtNew.setUpperBoundUsa(iBdCurrencyService.getDollar(bwd.getUpperBound(), SecurityUtils.getPkCountry()));
} }
QueryWrapper<BdWithdrawalAuto> queryWrapperAuto = new QueryWrapper(); QueryWrapper<BdWithdrawalAuto> queryWrapperAuto = new QueryWrapper<>();
queryWrapperAuto.eq("PK_COUNTRY",SecurityUtils.getPkCountry()); queryWrapperAuto.eq("PK_COUNTRY", SecurityUtils.getPkCountry());
if(StringUtils.isNotNull(bwd.getPkId())){ if (StringUtils.isNotNull(bwd.getPkId())) {
queryWrapperAuto.eq("PK_WITHDRAWAL",bwd.getPkId()); queryWrapperAuto.eq("PK_WITHDRAWAL", bwd.getPkId());
} }
List<BdWithdrawalAuto> listAuto = withdrawalAutoService.list(queryWrapperAuto); List<BdWithdrawalAuto> listAuto = iBdWithdrawalAutoService.list(queryWrapperAuto);
List<BdWithdrawalAutoExt> watExtList = new ArrayList<>(); List<BdWithdrawalAutoExt> watExtList = new ArrayList<>();
listAuto.forEach(item -> watExtList.add(BeanUtil.copyProperties(item, BdWithdrawalAutoExt.class))); listAuto.forEach(item -> watExtList.add(BeanUtil.copyProperties(item, BdWithdrawalAutoExt.class)));
withdrawalExtNew.setWithdrawalAutoList(watExtList); withdrawalExtNew.setWithdrawalAutoList(watExtList);
@ -157,43 +126,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") @GetMapping("/serviceChargelist")
public TableDataInfo serviceChargelist(BdWithdrawalExt withdrawalExt) { public TableDataInfo serviceChargelist() {
startPage(); startPage();
QueryWrapper<BdWithdrawal> queryWrapper = new QueryWrapper(); QueryWrapper<BdWithdrawal> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("PK_COUNTRY",SecurityUtils.getPkCountry()); queryWrapper.eq("PK_COUNTRY", SecurityUtils.getPkCountry());
queryWrapper.orderByDesc("CREATION_TIME"); queryWrapper.orderByDesc("CREATION_TIME");
List<BdWithdrawal> list = withdrawalService.list(queryWrapper); List<BdWithdrawal> list = iBdWithdrawalService.list(queryWrapper);
List<BdWithdrawalExt> listExt=new ArrayList<>(); List<BdWithdrawalExt> listExt = new ArrayList<>();
for(BdWithdrawal bwd: list){ for (BdWithdrawal bwd : list) {
BdWithdrawalExt withdrawalExtNew= BeanUtil.copyProperties(bwd, BdWithdrawalExt.class); BdWithdrawalExt withdrawalExtNew = BeanUtil.copyProperties(bwd, BdWithdrawalExt.class);
//暂时使用中国 //暂时使用中国
if(StringUtils.isNotNull(bwd.getMinAmount())){ if (StringUtils.isNotNull(bwd.getMinAmount())) {
withdrawalExtNew.setMinAmountUsa(currencyService.getDollar(bwd.getMinAmount(),SecurityUtils.getPkCountry())); withdrawalExtNew.setMinAmountUsa(iBdCurrencyService.getDollar(bwd.getMinAmount(), SecurityUtils.getPkCountry()));
} }
if(StringUtils.isNotNull(bwd.getMaxAmount())){ if (StringUtils.isNotNull(bwd.getMaxAmount())) {
withdrawalExtNew.setMaxAmountUsa(currencyService.getDollar(bwd.getMaxAmount(),SecurityUtils.getPkCountry())); withdrawalExtNew.setMaxAmountUsa(iBdCurrencyService.getDollar(bwd.getMaxAmount(), SecurityUtils.getPkCountry()));
} }
if(StringUtils.isNotNull(bwd.getLowerBound())){ if (StringUtils.isNotNull(bwd.getLowerBound())) {
withdrawalExtNew.setLowerBoundUsa(currencyService.getDollar(bwd.getLowerBound(),SecurityUtils.getPkCountry())); withdrawalExtNew.setLowerBoundUsa(iBdCurrencyService.getDollar(bwd.getLowerBound(), SecurityUtils.getPkCountry()));
} }
if(StringUtils.isNotNull(bwd.getUpperBound())){ if (StringUtils.isNotNull(bwd.getUpperBound())) {
withdrawalExtNew.setUpperBoundUsa(currencyService.getDollar(bwd.getUpperBound(),SecurityUtils.getPkCountry())); withdrawalExtNew.setUpperBoundUsa(iBdCurrencyService.getDollar(bwd.getUpperBound(), SecurityUtils.getPkCountry()));
} }
QueryWrapper<BdWithdrawalAuto> queryWrapperAuto = new QueryWrapper(); QueryWrapper<BdWithdrawalAuto> queryWrapperAuto = new QueryWrapper<>();
queryWrapperAuto.eq("PK_COUNTRY",SecurityUtils.getPkCountry()); queryWrapperAuto.eq("PK_COUNTRY", SecurityUtils.getPkCountry());
if(StringUtils.isNotNull(bwd.getPkId())){ if (StringUtils.isNotNull(bwd.getPkId())) {
queryWrapperAuto.eq("PK_WITHDRAWAL",bwd.getPkId()); queryWrapperAuto.eq("PK_WITHDRAWAL", bwd.getPkId());
} }
List<BdWithdrawalAuto> listAuto = withdrawalAutoService.list(queryWrapperAuto); List<BdWithdrawalAuto> listAuto = iBdWithdrawalAutoService.list(queryWrapperAuto);
List<BdWithdrawalAutoExt> watExtList = new ArrayList<>(); List<BdWithdrawalAutoExt> watExtList = new ArrayList<>();
listAuto.forEach(item -> watExtList.add(BeanUtil.copyProperties(item, BdWithdrawalAutoExt.class))); listAuto.forEach(item -> watExtList.add(BeanUtil.copyProperties(item, BdWithdrawalAutoExt.class)));
withdrawalExtNew.setWithdrawalAutoList(watExtList); withdrawalExtNew.setWithdrawalAutoList(watExtList);
@ -202,147 +167,127 @@ public class BdWithdrawalController extends BaseController {
return getDataTable(listExt); return getDataTable(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_CONFIG,method = EOperationMethod.INSERT) @Log(module = EOperationModule.WALLET_CONFIG, business = EOperationBusiness.WITHDRAWAL_CONFIG, method = EOperationMethod.INSERT)
@PostMapping("/save") @PostMapping("/save")
public AjaxResult save(@RequestBody @Valid BdWithdrawalExt withdrawalExt) { 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)); 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)); 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)); 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)); 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)); 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)); return AjaxResult.error(TransactionUtils.getContent(ConfigMsgConstants.WITHDRAWAL_NUMBER_NOT_NULL));
} }
if(EYesNo.YES.getIntValue()==withdrawalExt.getIsAuto()){ if (EYesNo.YES.getIntValue() == withdrawalExt.getIsAuto()) {
if(StringUtils.isNull(withdrawalExt.getLowerBound())){ if (StringUtils.isNull(withdrawalExt.getLowerBound())) {
return AjaxResult.error(TransactionUtils.getContent(ConfigMsgConstants.LOWER_BOUND_NOT_NULL)); 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)); 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)); 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)); return AjaxResult.error(TransactionUtils.getContent(ConfigMsgConstants.EFFECTIVE_DATE_NOT_NULL));
} }
withdrawalExt.setPkCountry(SecurityUtils.getPkCountry()); withdrawalExt.setPkCountry(SecurityUtils.getPkCountry());
withdrawalExt.setPkCreator(SecurityUtils.getUserId()); withdrawalExt.setPkCreator(SecurityUtils.getUserId());
withdrawalExt.setCreationTime(new Date()); 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") @PostMapping("/update")
public AjaxResult update(@RequestBody BdWithdrawalExt withdrawalExt) { 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)); 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)); 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)); 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)); 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)); 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)); 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)); return AjaxResult.error(TransactionUtils.getContent(ConfigMsgConstants.EFFECTIVE_DATE_NOT_NULL));
} }
if(EYesNo.YES.getIntValue()==withdrawalExt.getIsAuto()){ if (EYesNo.YES.getIntValue() == withdrawalExt.getIsAuto()) {
if(StringUtils.isNull(withdrawalExt.getLowerBound())){ if (StringUtils.isNull(withdrawalExt.getLowerBound())) {
return AjaxResult.error(TransactionUtils.getContent(ConfigMsgConstants.LOWER_BOUND_NOT_NULL)); 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)); 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)); 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)); return AjaxResult.error(TransactionUtils.getContent(ConfigMsgConstants.EFFECTIVE_DATE_NOT_NULL));
} }
withdrawalExt.setPkModified(SecurityUtils.getUserId()); withdrawalExt.setPkModified(SecurityUtils.getUserId());
withdrawalExt.setModifiedTime(new Date()); 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}") @GetMapping("/getOne/{pkId}")
public AjaxResult getOne(@PathVariable Integer pkId) { public AjaxResult getOne(@PathVariable Integer pkId) {
BdWithdrawal withdrawalParam = withdrawalService.getById(pkId); BdWithdrawal withdrawalParam = iBdWithdrawalService.getById(pkId);
BdWithdrawalExt withdrawalExt = BeanUtil.copyProperties(withdrawalParam, BdWithdrawalExt.class); BdWithdrawalExt withdrawalExt = BeanUtil.copyProperties(withdrawalParam, BdWithdrawalExt.class);
BdWithdrawalAutoExt withdrawalAutoExt=new BdWithdrawalAutoExt(); BdWithdrawalAutoExt withdrawalAutoExt = new BdWithdrawalAutoExt();
withdrawalAutoExt.setPkWithdrawal(pkId); withdrawalAutoExt.setPkWithdrawal(pkId);
List<BdWithdrawalAutoExt> withdrawalAutoList =withdrawalService.getWithdrawalAutoList(withdrawalAutoExt); List<BdWithdrawalAutoExt> withdrawalAutoList = iBdWithdrawalService.getWithdrawalAutoList(withdrawalAutoExt);
if(CollectionUtil.isNotEmpty(withdrawalAutoList)){ if (CollectionUtil.isNotEmpty(withdrawalAutoList)) {
withdrawalExt.setWithdrawalAutoList(withdrawalAutoList); withdrawalExt.setWithdrawalAutoList(withdrawalAutoList);
}else{ } else {
List<BdWithdrawalAutoExt> withdrawalAutoListNew=new ArrayList<>(); List<BdWithdrawalAutoExt> withdrawalAutoListNew = new ArrayList<>();
withdrawalExt.setWithdrawalAutoList(withdrawalAutoListNew); withdrawalExt.setWithdrawalAutoList(withdrawalAutoListNew);
} }
return AjaxResult.success(withdrawalExt); 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}") @DeleteMapping("/{pkId}")
public AjaxResult delete(@PathVariable Long pkId) { public AjaxResult delete(@PathVariable Long pkId) {
BdWithdrawalAutoExt withdrawalAutoExt =new BdWithdrawalAutoExt(); BdWithdrawalAutoExt withdrawalAutoExt = new BdWithdrawalAutoExt();
withdrawalAutoExt.setPkCountry(SecurityUtils.getPkCountry()); withdrawalAutoExt.setPkCountry(SecurityUtils.getPkCountry());
Integer count= withdrawalService.checkWithdraw(withdrawalAutoExt); Integer count = iBdWithdrawalService.checkWithdraw(withdrawalAutoExt);
if(count>0){ if (count > 0) {
return AjaxResult.error(TransactionUtils.getContent(ConfigMsgConstants.ENABLE_STATE_NOT_DELETE)); return AjaxResult.error(TransactionUtils.getContent(ConfigMsgConstants.ENABLE_STATE_NOT_DELETE));
} }
UpdateWrapper<BdWithdrawal> updateWrapper = new UpdateWrapper<>(); UpdateWrapper<BdWithdrawal> updateWrapper = new UpdateWrapper<>();
@ -350,9 +295,6 @@ public class BdWithdrawalController extends BaseController {
updateWrapper.set("DEL_FLAG", EDelFlag.DELETE.getValue()); updateWrapper.set("DEL_FLAG", EDelFlag.DELETE.getValue());
updateWrapper.set("PK_MODIFIED", SecurityUtils.getUserId()); updateWrapper.set("PK_MODIFIED", SecurityUtils.getUserId());
updateWrapper.set("MODIFIED_TIME", new Date()); updateWrapper.set("MODIFIED_TIME", new Date());
redisService.deleteObjectByKey(CacheConstants.BD_WITHDRAWAL + SecurityUtils.getPkCountry()); return toAjax(iBdWithdrawalService.update(updateWrapper));
redisService.deleteObjectByKey(CacheConstants.BD_WITHDRAWAL_IS_AUTO + SecurityUtils.getPkCountry());
redisService.deleteObjectByKey(CacheConstants.BD_WITHDRAWAL_AUTO + SecurityUtils.getPkCountry());
return toAjax(withdrawalService.update(updateWrapper));
} }
} }

View File

@ -1,17 +1,14 @@
package com.hzs.system.config.controller.manage; package com.hzs.system.config.controller.manage;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.hzs.common.core.annotation.Log; import com.hzs.common.core.annotation.Log;
import com.hzs.common.core.constant.CacheConstants;
import com.hzs.common.core.constant.msg.ConfigMsgConstants; import com.hzs.common.core.constant.msg.ConfigMsgConstants;
import com.hzs.common.core.enums.EDelFlag; import com.hzs.common.core.enums.EDelFlag;
import com.hzs.common.core.enums.EOperationBusiness; import com.hzs.common.core.enums.EOperationBusiness;
import com.hzs.common.core.enums.EOperationMethod; import com.hzs.common.core.enums.EOperationMethod;
import com.hzs.common.core.enums.EOperationModule; 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.StringUtils;
import com.hzs.common.core.utils.poi.ExcelUtil; import com.hzs.common.core.utils.poi.ExcelUtil;
import com.hzs.common.core.web.controller.BaseController; import com.hzs.common.core.web.controller.BaseController;
@ -21,12 +18,9 @@ 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.BdWithdrawalAutoExt;
import com.hzs.common.domain.system.config.ext.BdWithdrawalProcessExt; import com.hzs.common.domain.system.config.ext.BdWithdrawalProcessExt;
import com.hzs.common.security.utils.SecurityUtils; import com.hzs.common.security.utils.SecurityUtils;
import com.hzs.system.base.ITransactionServiceApi;
import com.hzs.system.base.service.IBdCurrencyService; 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.IBdWithdrawalProcessService;
import com.hzs.system.config.service.IBdWithdrawalService; import com.hzs.system.config.service.IBdWithdrawalService;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -37,166 +31,118 @@ import java.util.Date;
import java.util.List; import java.util.List;
/** /**
* <p>
* 提现手续费手续费配置 前端控制器 * 提现手续费手续费配置 前端控制器
* </p>
*
* @author zhangjing
* @since 2022-11-02
*/ */
@RestController @RestController
@RequestMapping("/manage/bd-withdrawal-process") @RequestMapping("/manage/bd-withdrawal-process")
public class BdWithdrawalProcessController extends BaseController { public class BdWithdrawalProcessController extends BaseController {
@Autowired @Autowired
private IBdWithdrawalProcessService withdrawalProcessService; private IBdWithdrawalProcessService iBdWithdrawalProcessService;
@DubboReference
private ITransactionServiceApi iTransactionServiceApi;
private RedisService redisService;
@DubboReference
private IWithdrawalServiceApi withdrawalProcessServiceApi;
@Autowired @Autowired
private IBdWithdrawalService withdrawalService; private IBdWithdrawalService iBdWithdrawalService;
@Autowired
IBdCurrencyService currencyService;
@Autowired
public void setRedisService(RedisService redisService) {
this.redisService = redisService;
}
/** /**
* @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") @GetMapping("/list")
public TableDataInfo list(BdWithdrawalProcess withdrawalProcess) { public TableDataInfo list() {
startPage(); startPage();
QueryWrapper<BdWithdrawalProcess> queryWrapper = new QueryWrapper(); QueryWrapper<BdWithdrawalProcess> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("PK_COUNTRY", SecurityUtils.getPkCountry()); queryWrapper.eq("PK_COUNTRY", SecurityUtils.getPkCountry());
queryWrapper.orderByDesc("CREATION_TIME"); queryWrapper.orderByDesc("CREATION_TIME");
List<BdWithdrawalProcess> list = withdrawalProcessService.list(queryWrapper); List<BdWithdrawalProcess> list = iBdWithdrawalProcessService.list(queryWrapper);
List<BdWithdrawalProcessExt> listExt=new ArrayList<>(); List<BdWithdrawalProcessExt> listExt = new ArrayList<>();
list.forEach(item -> listExt.add(BeanUtil.copyProperties(item, BdWithdrawalProcessExt.class))); list.forEach(item -> listExt.add(BeanUtil.copyProperties(item, BdWithdrawalProcessExt.class)));
return getDataTable(listExt); 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") @PostMapping("/export")
public void export(HttpServletResponse response, BdWithdrawalProcess withdrawalProcess) { public void export(HttpServletResponse response, BdWithdrawalProcess withdrawalProcess) {
QueryWrapper<BdWithdrawalProcess> queryWrapper = new QueryWrapper(); QueryWrapper<BdWithdrawalProcess> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("PK_COUNTRY", SecurityUtils.getPkCountry()); queryWrapper.eq("PK_COUNTRY", SecurityUtils.getPkCountry());
queryWrapper.orderByDesc("CREATION_TIME"); queryWrapper.orderByDesc("CREATION_TIME");
List<BdWithdrawalProcess> list = withdrawalProcessService.list(queryWrapper); List<BdWithdrawalProcess> list = iBdWithdrawalProcessService.list(queryWrapper);
List<BdWithdrawalProcessExt> listExt=new ArrayList<>(); List<BdWithdrawalProcessExt> listExt = new ArrayList<>();
list.forEach(item -> listExt.add(BeanUtil.copyProperties(item, BdWithdrawalProcessExt.class))); list.forEach(item -> listExt.add(BeanUtil.copyProperties(item, BdWithdrawalProcessExt.class)));
ExcelUtil<BdWithdrawalProcessExt> util = new ExcelUtil<>(BdWithdrawalProcessExt.class); ExcelUtil<BdWithdrawalProcessExt> util = new ExcelUtil<>(BdWithdrawalProcessExt.class);
util.exportExcel(response, listExt, "提现手续费配置"); 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") @PostMapping("/save")
public AjaxResult save(@RequestBody @Valid BdWithdrawalProcess withdrawalProcess) { 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); 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); 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); return AjaxResult.error(ConfigMsgConstants.EFFECTIVE_DATE_NOT_NULL);
} }
QueryWrapper<BdWithdrawalProcess> queryWrapper=new QueryWrapper(); QueryWrapper<BdWithdrawalProcess> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("PK_COUNTRY",SecurityUtils.getPkCountry()); queryWrapper.eq("PK_COUNTRY", SecurityUtils.getPkCountry());
BdWithdrawalProcess withdrawalProcessCheck=withdrawalProcessService.getOne(queryWrapper); BdWithdrawalProcess withdrawalProcessCheck = iBdWithdrawalProcessService.getOne(queryWrapper);
if(StringUtils.isNotNull(withdrawalProcessCheck)){ if (StringUtils.isNotNull(withdrawalProcessCheck)) {
return AjaxResult.error(ConfigMsgConstants.SERVICE_TYPE_REPEAT); return AjaxResult.error(ConfigMsgConstants.SERVICE_TYPE_REPEAT);
} }
withdrawalProcess.setPkCountry(SecurityUtils.getPkCountry()); withdrawalProcess.setPkCountry(SecurityUtils.getPkCountry());
withdrawalProcess.setPkCreator(SecurityUtils.getUserId()); withdrawalProcess.setPkCreator(SecurityUtils.getUserId());
withdrawalProcess.setCreationTime(new Date()); withdrawalProcess.setCreationTime(new Date());
redisService.deleteObject(CacheConstants.BD_WITHDRAWAL_PROCESS + SecurityUtils.getPkCountry()); return toAjax(iBdWithdrawalProcessService.save(withdrawalProcess));
return toAjax(withdrawalProcessService.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") @PostMapping("/update")
public AjaxResult update(@RequestBody BdWithdrawalProcess withdrawalProcess) { public AjaxResult update(@RequestBody BdWithdrawalProcess withdrawalProcess) {
if(StringUtils.isNull(withdrawalProcess.getServiceType())){ if (StringUtils.isNull(withdrawalProcess.getServiceType())) {
return AjaxResult.error(ConfigMsgConstants.SERVICE_TYPE_NOT_NULL); 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); 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); return AjaxResult.error(ConfigMsgConstants.EFFECTIVE_DATE_NOT_NULL);
} }
withdrawalProcess.setPkCountry(SecurityUtils.getPkCountry()); withdrawalProcess.setPkCountry(SecurityUtils.getPkCountry());
withdrawalProcess.setPkModified(SecurityUtils.getUserId()); withdrawalProcess.setPkModified(SecurityUtils.getUserId());
withdrawalProcess.setModifiedTime(new Date()); withdrawalProcess.setModifiedTime(new Date());
redisService.deleteObject(CacheConstants.BD_WITHDRAWAL_PROCESS + SecurityUtils.getPkCountry()); return toAjax(iBdWithdrawalProcessService.updateById(withdrawalProcess));
return toAjax(withdrawalProcessService.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}") @GetMapping("/getOne/{pkId}")
public AjaxResult getOne(@PathVariable Integer pkId) { public AjaxResult getOne(@PathVariable Integer pkId) {
BdWithdrawalProcess withdrawalProcess = withdrawalProcessService.getById(pkId); BdWithdrawalProcess withdrawalProcess = iBdWithdrawalProcessService.getById(pkId);
BdWithdrawalProcessExt withdrawalProcessExt = BeanUtil.copyProperties(withdrawalProcess, BdWithdrawalProcessExt.class); BdWithdrawalProcessExt withdrawalProcessExt = BeanUtil.copyProperties(withdrawalProcess, BdWithdrawalProcessExt.class);
return AjaxResult.success(withdrawalProcessExt); 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}") @DeleteMapping("/{pkId}")
public AjaxResult delete(@PathVariable Long pkId) { public AjaxResult delete(@PathVariable Long pkId) {
BdWithdrawalAutoExt withdrawalAutoExt =new BdWithdrawalAutoExt(); BdWithdrawalAutoExt withdrawalAutoExt = new BdWithdrawalAutoExt();
withdrawalAutoExt.setPkCountry(SecurityUtils.getPkCountry()); withdrawalAutoExt.setPkCountry(SecurityUtils.getPkCountry());
Integer count= withdrawalService.checkWithdraw(withdrawalAutoExt); Integer count = iBdWithdrawalService.checkWithdraw(withdrawalAutoExt);
if(count>0){ if (count > 0) {
return AjaxResult.error(ConfigMsgConstants.ENABLE_STATE_NOT_DELETE); return AjaxResult.error(ConfigMsgConstants.ENABLE_STATE_NOT_DELETE);
} }
UpdateWrapper<BdWithdrawalProcess> updateWrapper = new UpdateWrapper<>(); UpdateWrapper<BdWithdrawalProcess> updateWrapper = new UpdateWrapper<>();
@ -204,8 +150,7 @@ public class BdWithdrawalProcessController extends BaseController {
updateWrapper.set("DEL_FLAG", EDelFlag.DELETE.getValue()); updateWrapper.set("DEL_FLAG", EDelFlag.DELETE.getValue());
updateWrapper.set("PK_MODIFIED", SecurityUtils.getUserId()); updateWrapper.set("PK_MODIFIED", SecurityUtils.getUserId());
updateWrapper.set("MODIFIED_TIME", new Date()); updateWrapper.set("MODIFIED_TIME", new Date());
redisService.deleteObject(CacheConstants.BD_WITHDRAWAL + SecurityUtils.getPkCountry()); return toAjax(iBdWithdrawalProcessService.update(updateWrapper));
return toAjax(withdrawalProcessService.update(updateWrapper));
} }
} }

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,19 +1,12 @@
package com.hzs.system.config.provider; package com.hzs.system.config.provider;
import com.hzs.common.core.domain.R; import com.hzs.common.core.domain.R;
import com.hzs.common.domain.system.config.BdAccount;
import com.hzs.common.domain.system.config.BdWithdrawal; import com.hzs.common.domain.system.config.BdWithdrawal;
import com.hzs.common.domain.system.config.BdWithdrawalAuto;
import com.hzs.system.config.IAccountServiceApi;
import com.hzs.system.config.IWithdrawalServiceApi; import com.hzs.system.config.IWithdrawalServiceApi;
import com.hzs.system.config.service.IBdAccountService;
import com.hzs.system.config.service.IBdWithdrawalAutoService;
import com.hzs.system.config.service.IBdWithdrawalService; import com.hzs.system.config.service.IBdWithdrawalService;
import org.apache.dubbo.config.annotation.DubboService; import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
/** /**
* 提现配置的dubbo服务类 * 提现配置的dubbo服务类
*/ */

View File

@ -1,20 +1,11 @@
package com.hzs.system.config.service; package com.hzs.system.config.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.hzs.common.domain.system.config.BdWithdrawalAuto; 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> { public interface IBdWithdrawalAutoService extends IService<BdWithdrawalAuto> {
List<BdWithdrawalAuto> queryWithdrawalAuto(Integer pkCountry);
} }

View File

@ -1,56 +1,15 @@
package com.hzs.system.config.service.impl; 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.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.common.domain.system.config.BdWithdrawalAuto;
import com.hzs.system.config.mapper.BdWithdrawalAutoMapper; import com.hzs.system.config.mapper.BdWithdrawalAutoMapper;
import com.hzs.system.config.service.IBdWithdrawalAutoService; import com.hzs.system.config.service.IBdWithdrawalAutoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List;
/** /**
* <p>
* 自动提现明细表 服务实现类 * 自动提现明细表 服务实现类
* </p>
*
* @author zhangjing
* @since 2022-08-31
*/ */
@Service @Service
public class BdWithdrawalAutoServiceImpl extends ServiceImpl<BdWithdrawalAutoMapper, BdWithdrawalAuto> implements IBdWithdrawalAutoService { 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

@ -3,9 +3,7 @@ package com.hzs.system.config.service.impl;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hzs.common.core.constant.CacheConstants;
import com.hzs.common.core.enums.EDelFlag; 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.BdWithdrawal;
import com.hzs.common.domain.system.config.BdWithdrawalAuto; import com.hzs.common.domain.system.config.BdWithdrawalAuto;
import com.hzs.common.domain.system.config.ext.BdWithdrawalAutoExt; import com.hzs.common.domain.system.config.ext.BdWithdrawalAutoExt;
@ -27,15 +25,8 @@ import java.util.List;
@Service @Service
public class BdWithdrawalServiceImpl extends ServiceImpl<BdWithdrawalMapper, BdWithdrawal> implements IBdWithdrawalService { public class BdWithdrawalServiceImpl extends ServiceImpl<BdWithdrawalMapper, BdWithdrawal> implements IBdWithdrawalService {
private RedisService redisService;
@Autowired @Autowired
public void setRedisService(RedisService redisService) { private IBdWithdrawalAutoService iBdWithdrawalAutoService;
this.redisService = redisService;
}
@Autowired
IBdWithdrawalAutoService withdrawalAutoService;
@Override @Override
public BdWithdrawal queryWithdrawal(Integer pkCountry, Integer pkAccount) { public BdWithdrawal queryWithdrawal(Integer pkCountry, Integer pkAccount) {
@ -67,11 +58,8 @@ public class BdWithdrawalServiceImpl extends ServiceImpl<BdWithdrawalMapper, BdW
wao.setPkCountry(SecurityUtils.getPkCountry()); wao.setPkCountry(SecurityUtils.getPkCountry());
wao.setPkCreator(SecurityUtils.getUserId()); wao.setPkCreator(SecurityUtils.getUserId());
wao.setCreationTime(new Date()); wao.setCreationTime(new Date());
withdrawalAutoService.save(wao); 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; return true;
} }
@ -82,18 +70,15 @@ public class BdWithdrawalServiceImpl extends ServiceImpl<BdWithdrawalMapper, BdW
updateWrapper.eq("PK_WITHDRAWAL", withdrawalExt.getPkId()); updateWrapper.eq("PK_WITHDRAWAL", withdrawalExt.getPkId());
updateWrapper.eq("DEL_FLAG", EDelFlag.UN_DELETE.getValue()); updateWrapper.eq("DEL_FLAG", EDelFlag.UN_DELETE.getValue());
updateWrapper.set("DEL_FLAG", EDelFlag.DELETE.getValue()); updateWrapper.set("DEL_FLAG", EDelFlag.DELETE.getValue());
withdrawalAutoService.update(updateWrapper); iBdWithdrawalAutoService.update(updateWrapper);
List<BdWithdrawalAutoExt> withdrawalAutoList = withdrawalExt.getWithdrawalAutoList(); List<BdWithdrawalAutoExt> withdrawalAutoList = withdrawalExt.getWithdrawalAutoList();
for (BdWithdrawalAuto wao : withdrawalAutoList) { for (BdWithdrawalAuto wao : withdrawalAutoList) {
wao.setPkWithdrawal(withdrawalExt.getPkId()); wao.setPkWithdrawal(withdrawalExt.getPkId());
wao.setPkCountry(SecurityUtils.getPkCountry()); wao.setPkCountry(SecurityUtils.getPkCountry());
wao.setPkCreator(SecurityUtils.getUserId()); wao.setPkCreator(SecurityUtils.getUserId());
wao.setCreationTime(new Date()); wao.setCreationTime(new Date());
withdrawalAutoService.save(wao); 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; return true;
} }
@ -102,5 +87,4 @@ public class BdWithdrawalServiceImpl extends ServiceImpl<BdWithdrawalMapper, BdW
return baseMapper.getWithdrawalAutoList(withdrawalAutoExt); return baseMapper.getWithdrawalAutoList(withdrawalAutoExt);
} }
} }

View File

@ -2378,7 +2378,7 @@ public class EnumsController extends BaseController {
public AjaxResult getPaymentStatus() { public AjaxResult getPaymentStatus() {
List<EnumEntity> enumEntityList = new ArrayList<>(); List<EnumEntity> enumEntityList = new ArrayList<>();
for (EWithdrawStatus value : EWithdrawStatus.values()) { for (EWithdrawStatus value : EWithdrawStatus.values()) {
enumEntityList.add(new EnumEntity(value.getValue(), value.getLabel(), EnumsPrefixConstants.ENU_WITHDRAW_STATUS)); enumEntityList.add(new EnumEntity(value.getValue(), value.getLabel()));
} }
return AjaxResult.success(enumEntityList); return AjaxResult.success(enumEntityList);
} }

View File

@ -521,10 +521,6 @@ public class EnumsInitController {
initList.add(this.createData(value.getKey(), value.getLabel())); initList.add(this.createData(value.getKey(), value.getLabel()));
} }
for (EWithdrawStatus value : EWithdrawStatus.values()) {
initList.add(this.createData(value.getKey(), value.getLabel()));
}
/** /**
* 站内信类型 * 站内信类型
*/ */

View File

@ -151,27 +151,6 @@ public class CacheConstants {
*/ */
public static final String BD_SHARE = CACHE_PREFIX + "share:"; 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:";
/** /**
* 个税明细配置 * 个税明细配置
*/ */

View File

@ -600,11 +600,6 @@ public class EnumsPrefixConstants {
*/ */
public static final String EXEMPT_TYPE = "ENU_EXE_T_"; public static final String EXEMPT_TYPE = "ENU_EXE_T_";
/**
* 提现状态
*/
public static final String ENU_WITHDRAW_STATUS = "ENU_WITHDRAW_S_";
/** /**
* 店铺枚举配送中心等级 * 店铺枚举配送中心等级
*/ */

View File

@ -1,6 +1,5 @@
package com.hzs.common.core.enums; package com.hzs.common.core.enums;
import com.hzs.common.core.constant.EnumsPrefixConstants;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Getter; import lombok.Getter;
@ -14,20 +13,20 @@ public enum EWithdrawStatus {
/** /**
* 正常 * 正常
*/ */
NORMAL(0, "未打款", 0, EnumsPrefixConstants.ENU_WITHDRAW_STATUS + "0"), NORMAL(0, "未打款", 0),
/** /**
* 打款 * 打款
*/ */
PAYMENT(1, "已打款", 0, EnumsPrefixConstants.ENU_WITHDRAW_STATUS + "1"), PAYMENT(1, "已打款", 0),
/** /**
* 充正 * 充正
*/ */
CHARGING(2, "已充正", 0, EnumsPrefixConstants.ENU_WITHDRAW_STATUS + "2"), CHARGING(2, "已充正", 0),
/** /**
* 取消 * 取消
*/ */
CANCEL(3, "取消", 0, EnumsPrefixConstants.ENU_WITHDRAW_STATUS + "3"), CANCEL(3, "取消", 0),
; ;
/** /**
@ -42,9 +41,17 @@ public enum EWithdrawStatus {
* 是否启用0=,1= -- 来源EYesNo * 是否启用0=,1= -- 来源EYesNo
*/ */
private final int enable; private final int enable;
/**
* 国际化翻译key值 public static String getLabelByValue(Integer value) {
*/ if (null == value) {
private final String key; return "";
}
for (EWithdrawStatus enums : EWithdrawStatus.values()) {
if (enums.getValue() == value) {
return enums.getLabel();
}
}
return "";
}
} }

View File

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

View File

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