## 提现明细添加身份证号;调整提现明细导出;去除自动提现;去掉校验区域重复定时任务;

This commit is contained in:
cabbage 2025-08-20 11:49:14 +08:00
parent b0e28a160d
commit 92449a1667
50 changed files with 345 additions and 1985 deletions

View File

@ -1,29 +0,0 @@
package com.hzs.bonus.detail;
import com.hzs.common.core.domain.R;
import java.util.Date;
import java.util.List;
/**
* @description: 新零售会员区域考核dubbo服务
* @author: zhang jing
* @date: 2025/3/7 10:36
* @param:
* @return:
**/
public interface ICuRegionAssessApi {
/**
* @description: 定时处理会员收益区域处理前三天
* @author: zhang jing
* @date: 2025/3/7 10:45
* @param: [startDate]
* @return: com.hzs.common.core.domain.R<?>
**/
R<?> validateHandAreaAssess(Date startDate,Date endDate);
}

View File

@ -7,14 +7,9 @@ import java.util.Date;
/**
* 会员模块定时任务
*
* @Description:
* @Author: ljc
* @Time: 2023/4/12 10:38
* @Classname: IMemberJobServiceApi
* @Package_name: com.hzs.member.account
*/
public interface IMemberJobServiceApi {
/**
* 定时插入账户详情数据
*
@ -22,30 +17,14 @@ public interface IMemberJobServiceApi {
*/
R insertAccountDetail();
/**
* 自动提现
*
* @return
*/
R automaticWithdrawal();
/**
* 查询充值金额总和
*
* @param startDate 开始时暗
* @param endDate 结速时间
* @return R<CuMemberRecharge>
*/
R<CuMemberRecharge> selectRechargeTotalAmount(Date startDate, Date endDate);
/**
* 自动清理垃圾数据
* CU_MEMBER_AWARDS
* CU_MEMBER_LEVEL
* CU_MEMBER_GRADE
* CU_MEMBER_AWARDS
* CU_MEMBER_LEVEL
* CU_MEMBER_GRADE
*
* @return
*/
R autoDeleteGarbageData();
}

View File

@ -9,13 +9,6 @@ import java.util.List;
*/
public interface IMemberRetailApi {
/**
* 定时处理收益区域
*
* @return
*/
R<?> checkRegion();
/**
* 取消收益区域
*

View File

@ -3,32 +3,14 @@ package com.hzs.system.config;
import com.hzs.common.core.domain.R;
import com.hzs.common.domain.system.config.BdWithdrawal;
import java.util.List;
/**
* @description: 根据国家查询提现配置明细列表api
* @author: zhang jing
* @date: 2022/9/27 15:14
* @param:
* @return:
* 根据国家查询提现配置明细列表api
**/
public interface IWithdrawalServiceApi {
/**
* @description: 根据国家查询提现配置明细列表
* @author: zhang jing
* @date: 2022/9/27 15:14
* @param: [pkCountry]
* @return: com.hzs.common.core.domain.R<java.util.List < com.hzs.common.domain.system.config.BdWithdrawal>>
* 根据国家查询提现配置明细列表
**/
R<BdWithdrawal> queryWithdrawal(Integer pkCountry,Integer pkAccount);
R<BdWithdrawal> queryWithdrawal(Integer pkCountry, Integer pkAccount);
/**
* @description: 查询所有自动提现的配置
* @author: zhang jing
* @date: 2022/11/1 19:44
* @param: []
* @return: com.hzs.common.core.domain.R<java.util.List < com.hzs.common.domain.system.config.BdWithdrawal>>
**/
R<List<BdWithdrawal>> queryWithdrawalByIsAuto();
}

View File

@ -52,13 +52,4 @@ public interface CuRegionAssessMapper extends BaseMapper<CuRegionAssess> {
**/
List<CuMemberRetailRegion> queryCuMemberRetailRegion(@Param("startDate") Date startDate, @Param("endDate") Date endDate);
/*
* 查询到期日期是上个月的区域
**/
List<CuMemberRetailRegion> queryDueCuMemberRetailRegion(@Param("startDate") Date startDate, @Param("endDate") Date endDate);
/*
* 查询手动设置考核的近6个月考核记录
**/
List<CuRegionAssessExt> queryRegionAssessByDate(@Param("memberRetailRegionList") List<CuMemberRetailRegion> memberRetailRegionList, @Param("startDate") Date startDate, @Param("endDate") Date endDate);
}

View File

@ -1,46 +0,0 @@
package com.hzs.bonus.detail.provider;
import com.hzs.bonus.detail.ICuRegionAssessApi;
import com.hzs.bonus.detail.service.ICuRegionAssessService;
import com.hzs.common.core.domain.R;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.Date;
/**
* @Description: 新零售会员dubbo服务
* @Author: jiang chao
* @Time: 2024/12/31 13:40
* @Classname: MemberRetailProvider
* @PackageName: com.hzs.retail.member.provider
*/
@Slf4j
@DubboService
public class CuRegionAssessProvider implements ICuRegionAssessApi {
@Autowired
private ICuRegionAssessService iCuRegionAssessService;
/**
* @description: 定时处理会员收益区域处理前三天
* @author: zhang jing
* @date: 2025/3/7 10:45
* @param: [startDate]
* @return: com.hzs.common.core.domain.R<?>
**/
@Override
public R<?> validateHandAreaAssess(Date startDate,Date endDate) {
try {
iCuRegionAssessService.validateHandAreaAssess(startDate,endDate);
return R.ok();
} catch (Exception e) {
log.error("定时任务处理前3天收益区域异常", e);
return R.fail(e.getMessage());
}
}
}

View File

@ -19,13 +19,6 @@ public interface ICuRegionAssessService extends IService<CuRegionAssess> {
**/
void assessRegionByEveryMonth(String settleDate, String rangeTableName);
/**
* 定时处理会员收益区域处理前三天
*
* @return: void
**/
void validateHandAreaAssess(Date startDate, Date endDate);
/*
* 考核开始日期
**/

View File

@ -178,35 +178,6 @@ public class CuRegionAssessServiceImpl extends ServiceImpl<CuRegionAssessMapper,
}
}
@Override
public void validateHandAreaAssess(Date startDate, Date endDate) {
List<Long> cancelRegionList = new ArrayList<>();
List<CuMemberRetailRegion> dueRetailRegionList = baseMapper.queryDueCuMemberRetailRegion(startDate, endDate);
if (dueRetailRegionList.size() > 0) {
Date assessDate = DateUtils.currentMonthFirstDate(startDate);
// 查询期初日期 beforeMonthFirstDate startDate 考核期间结束日期
Date assMonthStartDate = DateUtils.beforeMonthFirstDate(5, assessDate);
// assessDate assessDate 查询考核记录
Map<Long, CuRegionAssessExt> regionAssessExtMap = new HashMap<>();
List<CuRegionAssessExt> cuRegionAssessExtList = baseMapper.queryRegionAssessByDate(dueRetailRegionList, assMonthStartDate, assessDate);
cuRegionAssessExtList.forEach(cuRegionAssessExt -> regionAssessExtMap.put(cuRegionAssessExt.getPkMember(), cuRegionAssessExt));
for (CuMemberRetailRegion cuMemberRetailRegion : dueRetailRegionList) {
if (regionAssessExtMap.containsKey(cuMemberRetailRegion.getPkMember())) {
CuRegionAssessExt cuRegionAssessExt = regionAssessExtMap.get(cuMemberRetailRegion.getPkMember());
if (cuRegionAssessExt.getPkId() >= 3) {
continue;
}
}
cancelRegionList.add(cuMemberRetailRegion.getPkId());
}
}
if (cancelRegionList.size() > 0) {
if (!iMemberRetailApi.cancelRegion(cancelRegionList).isSuccess()) {
throw new RuntimeException("区域更新失败");
}
}
}
private void saveCuRegionAssess(Map<Long, CuRegionAssess> regionAssessMap, List<CuRegionAssessDetail> regionAssessDetailList) {
List<Long> longs = baseMapper.batchQueryCuRegionAssessSeq(regionAssessMap.size());
int i = 0;

View File

@ -161,26 +161,5 @@
and cm.member_name = #{regionAssessParam.memberName}
</if>
</select>
<select id="queryDueCuMemberRetailRegion" resultType="com.hzs.common.domain.retail.member.CuMemberRetailRegion">
select *
from cu_member_retail_region
where effective = 0
and del_flag = 0
and effective_end_date >= #{startDate, jdbcType=DATE}
and effective_end_date &lt; #{endDate, jdbcType=DATE}
</select>
<select id="queryRegionAssessByDate"
resultType="com.hzs.common.domain.member.detail.ext.CuRegionAssessExt">
select cd.pk_member,count(cd.pk_id) pk_id from cu_region_assess ca
inner join cu_region_assess_detail cd
on ca.pk_id=cd.pk_region_assess
where ca.del_flag=0 and cd.del_flag=0
and cd.assess_date>=#{startDate, jdbcType=DATE} and cd.assess_date &lt;=#{endDate, jdbcType=DATE}
and assess_status=0 and ca.pk_member in
<foreach collection="memberRetailRegionList" item="item" open="(" close=")" separator=",">
#{item.pkMember}
</foreach>
group by cd.pk_member
</select>
</mapper>

View File

@ -42,9 +42,6 @@ import java.util.List;
/**
* 会员提现表 前端控制器
*
* @author hzs
* @since 2022-09-06
*/
@RestController
@RequestMapping("/api/withdraw")
@ -286,14 +283,6 @@ public class ApiCuMemberWithdrawController extends BaseController {
return balance;
}
@PostMapping("/auto")
public AjaxResult autoWithdrawInfo() {
cuMemberWithdrawService.autoWithdraw();
return AjaxResult.success();
}
/**
* 是否为整数值
*

View File

@ -35,30 +35,23 @@ import java.util.*;
/**
* 会员提现表 前端控制器
*
* @author hzs
* @since 2022-09-06
*/
@RestController
@RequestMapping("/manager/withdraw")
public class CuMemberWithdrawController extends BaseController {
@Autowired
private UserTokenService userTokenService;
@Autowired
private ICuMemberBaseService iCuMemberBaseService;
@Autowired
private ICuMemberWithdrawService iCuMemberWithdrawService;
@Autowired
private ICuMemberBaseService baseService;
@Autowired
ICuMemberWithdrawService cuMemberWithdrawService;
@Autowired
ITransactionCommonService iTransactionCommonService;
private ITransactionCommonService iTransactionCommonService;
@DubboReference
IMenuColumnServiceApi menuColumnServiceApi;
IMenuColumnServiceApi iMenuColumnServiceApi;
/**
* 发起签呈显示
@ -72,11 +65,11 @@ public class CuMemberWithdrawController extends BaseController {
if (CollUtil.isEmpty(pkIds)) {
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)) {
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,10 +84,9 @@ public class CuMemberWithdrawController extends BaseController {
LoginUser loginUser = userTokenService.getLoginUser();
cuMemberPetitionVO.setLoginUser(loginUser);
cuMemberPetitionVO.setPkCreat(SecurityUtils.getUserId());
return AjaxResult.success(cuMemberWithdrawService.confirmWithdrawPetition(cuMemberPetitionVO));
return AjaxResult.success(iCuMemberWithdrawService.confirmWithdrawPetition(cuMemberPetitionVO));
}
/**
* 查询列表
*
@ -117,14 +109,13 @@ public class CuMemberWithdrawController extends BaseController {
}
}
startPage();
Object[] objects = cuMemberWithdrawService.selectMemberWithdrawList(cuMemberWithdrawVO);
Object[] objects = iCuMemberWithdrawService.selectMemberWithdrawList(cuMemberWithdrawVO);
//处理分页
TableDataInfo tableDataInfo = getDataTable((List<CuMemberWithdrawExt>) objects[0]);
tableDataInfo.setRows((List<CuMemberWithdrawVO>) objects[1]);
return tableDataInfo;
}
/**
* 充值明细列表导出
*
@ -137,18 +128,18 @@ public class CuMemberWithdrawController extends BaseController {
Integer pkCountry = SecurityUtils.getPkCountry();
cuMemberWithdrawVO.setPkCountry(pkCountry);
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)) {
for (CuMemberWithdrawVO memberWithdraw : cuMemberWithdrawList) {
Integer pkAccount = memberWithdraw.getPkAccount();
memberWithdraw.setPkAccountVal(baseService.getAccountTranslateFromDataBase(pkAccount));
memberWithdraw.setPkAccountVal(iCuMemberBaseService.getAccountTranslateFromDataBase(pkAccount));
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));
}
@ -162,11 +153,10 @@ public class CuMemberWithdrawController extends BaseController {
@GetMapping("/details")
public AjaxResult findWithdrawDetails(Long pkId) {
Assert.notNull(pkId, TransactionUtils.getContent(FinanceMsgConstants.SELECT_WITHDRAWAL_RECORD));
CuMemberWithdrawVO cuMemberRechargeDetailVO = cuMemberWithdrawService.queryCuMemberWithdrawDetail(pkId);
CuMemberWithdrawVO cuMemberRechargeDetailVO = iCuMemberWithdrawService.queryCuMemberWithdrawDetail(pkId);
return AjaxResult.success(cuMemberRechargeDetailVO);
}
/**
* 打款
*
@ -178,7 +168,7 @@ public class CuMemberWithdrawController extends BaseController {
public AjaxResult withdrawPayment(@RequestBody CuMemberWithdrawVO memberWithdrawVO) {
List<Long> pkIds = memberWithdrawVO.getPkIds();
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)) {
return AjaxResult.error(TransactionUtils.getContent(FinanceMsgConstants.DATA_UNAPPROVED_DATA));
}
@ -188,10 +178,9 @@ public class CuMemberWithdrawController extends BaseController {
memberWithdrawVO.setPayer(pkMember);
memberWithdrawVO.setPaymentTime(new Date());
memberWithdrawVO.setPkModified(pkMember);
return toAjax(cuMemberWithdrawService.withdrawPaymentByPkId(memberWithdrawVO));
return toAjax(iCuMemberWithdrawService.withdrawPaymentByPkId(memberWithdrawVO));
}
/**
* 打款充正
*
@ -207,13 +196,13 @@ public class CuMemberWithdrawController extends BaseController {
memberWithdrawVO.setPayer(SecurityUtils.getUserId());
memberWithdrawVO.setPayerRemarks(memberWithdrawVO.getPayerRemarks());
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)
@PostMapping("/reject")
public AjaxResult reject(@RequestBody CuMemberWithdrawRejectParam param) {
cuMemberWithdrawService.withdrawReject(param);
iCuMemberWithdrawService.withdrawReject(param);
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
@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.CuMemberAccountRechargeExt;
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.MemberAmountDTO;
import com.hzs.member.account.vo.CuMemberAccountVO;
@ -28,7 +27,6 @@ public interface CuMemberAccountMapper extends BaseMapper<CuMemberAccount> {
*/
List<CuMemberAccountExt> queryMemberAccountByCondition(CuMemberAccount cuMemberAccount);
/**
* 根据会员编码获取余额
*
@ -45,15 +43,6 @@ public interface CuMemberAccountMapper extends BaseMapper<CuMemberAccount> {
*/
Integer updateMemberAccount(CuMemberAccount cuMemberAccount);
/**
* 根据国家查询余额与银行卡信息
*
* @param pkCountry 国家ID
* @return List<CuMemberAccountExt>
*/
List<CuMemberAccountExt> queryMemberAccountByPkCountry(@Param("pkCountry") Integer pkCountry);
/**
* 根据用户编号查询账户余额 行转列
*
@ -75,7 +64,6 @@ public interface CuMemberAccountMapper extends BaseMapper<CuMemberAccount> {
*/
Boolean updateBatchMemberAccountByPkmember(@Param("batch") String batch, @Param("pkModified") Long pkModified, @Param("type") int type);
/**
* 根据用户编号集查询余额余额字段
*
@ -85,7 +73,6 @@ public interface CuMemberAccountMapper extends BaseMapper<CuMemberAccount> {
List<CuMemberAccountExt> queryMemberAccountByMemberCodes(@Param(value = "memberCodes") List<CuMemberRechargeVO> memberCodes,
@Param(value = "memberCodeStrs") List<String> memberCodeStrs);
/**
* 根据用户编号集查询用户账户的全部字段信息
*
@ -102,7 +89,6 @@ public interface CuMemberAccountMapper extends BaseMapper<CuMemberAccount> {
*/
List<CuMemberAccountExt> selectMemberAccountList(CuMemberWalletDetailVO memberWalletDetailVO);
/**
* 查询默认钱包明细不包括血缘代数安置层数
*
@ -111,7 +97,6 @@ public interface CuMemberAccountMapper extends BaseMapper<CuMemberAccount> {
*/
List<CuMemberAccountExt> selectDefaultMemberAccountList(CuMemberWalletDetailVO memberWalletDetailVO);
/**
* 根据用户编号查询用户ID
*
@ -129,7 +114,6 @@ public interface CuMemberAccountMapper extends BaseMapper<CuMemberAccount> {
*/
Integer updateFrozenAmountInfo(CuMemberAccountExt cuMemberAccount);
/**
* 根据用户ID集查询余额
*
@ -138,7 +122,6 @@ public interface CuMemberAccountMapper extends BaseMapper<CuMemberAccount> {
*/
List<CuMemberAccountExt> queryMemberAccountByPkMember(@Param(value = "pkMembers") List<MemberAmountDTO> pkMembers);
/**
* 批量更新账户余额不同账户同一账户
*
@ -157,7 +140,6 @@ public interface CuMemberAccountMapper extends BaseMapper<CuMemberAccount> {
*/
Boolean batchUpdateMemberAccountByPkMemberCountry(@Param("pkMemberList") List<MemberAmountDTO> pkMemberList, @Param("isWithdraw") Integer isWithdraw);
/**
* 批理更新会员的钱包状态
*
@ -176,14 +158,6 @@ public interface CuMemberAccountMapper extends BaseMapper<CuMemberAccount> {
*/
List<CuMemberAccount> selectMemberAccountByPkMember(@Param(value = "pkMembers") List<Long> pkMembers);
/**
* 查询会员账户以及会员信息
*
* @param memberIdList 会员ID列表
* @return
*/
List<CuMemberAccountExt> queryAccountAndMemberInfo(@Param("memberIdList") List<Long> memberIdList);
/**
* 根据用户ID查询钱包余额
*
@ -192,7 +166,6 @@ public interface CuMemberAccountMapper extends BaseMapper<CuMemberAccount> {
*/
List<CuMemberRechargeAccountParam> queryWalletBalanceByPkMember(@Param("pkMember") Long pkMember);
/**
* 根据会员姓名与会员编号查询账户信息
*
@ -201,33 +174,6 @@ public interface CuMemberAccountMapper extends BaseMapper<CuMemberAccount> {
*/
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

@ -1,6 +1,5 @@
package com.hzs.member.account.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hzs.common.domain.member.account.CuMemberWithdraw;
import com.hzs.common.domain.member.account.CuMemberWithdrawExt;
@ -10,12 +9,7 @@ import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* <p>
* 会员提现表 Mapper 接口
* </p>
*
* @author hzs
* @since 2022-09-06
*/
public interface CuMemberWithdrawMapper extends BaseMapper<CuMemberWithdraw> {

View File

@ -1,49 +1,30 @@
package com.hzs.member.account.provider;
import com.hzs.common.core.domain.R;
import com.hzs.common.domain.member.account.CuMemberRecharge;
import com.hzs.member.account.IMemberJobServiceApi;
import com.hzs.member.account.service.ICuMemberAccountDetailService;
import com.hzs.member.account.service.ICuMemberRechargeService;
import com.hzs.member.account.service.ICuMemberWithdrawService;
import com.hzs.member.base.mapper.DeleteGarbageDataMapper;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.Date;
/**
* 会员模块定时任务服务提供
*
* @Description:
* @Author: ljc
* @Time: 2023/4/12 10:40
* @Classname: IMemberJobServiceProvider
* @Package_name: com.hzs.member.account.provider
*/
@Slf4j
@DubboService
public class IMemberJobServiceProvider implements IMemberJobServiceApi {
@Autowired
private ICuMemberAccountDetailService memberAccountDetailService;
@Autowired
private ICuMemberWithdrawService memberWithdrawService;
@Autowired
private ICuMemberRechargeService memberRechargeService;
private ICuMemberAccountDetailService iCuMemberAccountDetailService;
@Autowired
private DeleteGarbageDataMapper deleteGarbageDataMapper;
@Override
public R insertAccountDetail() {
try {
memberAccountDetailService.insertAccountDetail();
iCuMemberAccountDetailService.insertAccountDetail();
} catch (Exception e) {
log.info("定时插入账户详情数据失败:", e);
return R.fail(e.getMessage());
@ -51,24 +32,6 @@ public class IMemberJobServiceProvider implements IMemberJobServiceApi {
return R.ok();
}
@Override
public R automaticWithdrawal() {
try {
memberWithdrawService.autoWithdraw();
} catch (Exception e) {
log.info("自动提现报错:", e);
return R.fail(e.getMessage());
}
return R.ok();
}
@Override
public R<CuMemberRecharge> selectRechargeTotalAmount(Date startDate, Date endDate) {
return R.ok(memberRechargeService.selectRechargeTotalAmount(startDate, endDate));
}
@Override
public R autoDeleteGarbageData() {
deleteGarbageDataMapper.deleteMemberAwards(30);

View File

@ -24,7 +24,6 @@ public interface ICuMemberAccountService extends IService<CuMemberAccount> {
*/
List<CuMemberAccountExt> queryMemberAccountByCondition(CuMemberAccount cuMemberAccount);
/**
* 根据会员编码获取余额
*
@ -34,7 +33,6 @@ public interface ICuMemberAccountService extends IService<CuMemberAccount> {
*/
BigDecimal selectBalanceByMemberCode(Long pkMember, Integer accountType);
/**
* 更新用户余额
*
@ -92,14 +90,6 @@ public interface ICuMemberAccountService extends IService<CuMemberAccount> {
*/
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);
/**
* 根据用户编号集查询余额(所有字段)
*
@ -147,7 +136,6 @@ public interface ICuMemberAccountService extends IService<CuMemberAccount> {
*/
List<CuMemberWalletDetailVO> queryMemberAccountAllByMemberCodes(List<String> memberCodes, Integer pkCountry);
/**
* 查询钱包明细
*
@ -156,7 +144,6 @@ public interface ICuMemberAccountService extends IService<CuMemberAccount> {
*/
Object[] selectMemberAccountList(CuMemberWalletDetailVO memberWalletDetailVO);
/**
* 根据用户编号查询用户ID
*
@ -190,7 +177,6 @@ public interface ICuMemberAccountService extends IService<CuMemberAccount> {
*/
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);
/**
* 更新账户余额不同用户不同账户
*
@ -210,7 +195,6 @@ public interface ICuMemberAccountService extends IService<CuMemberAccount> {
*/
Boolean batchUpdateMemberAccountByPkMemberCountry(List<MemberAmountDTO> pkMemberList, Integer isWithdraw);
/**
* 批理更新会员的钱包状态
*
@ -229,14 +213,6 @@ public interface ICuMemberAccountService extends IService<CuMemberAccount> {
*/
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);
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查询账户余额信息
*
@ -271,18 +232,6 @@ public interface ICuMemberAccountService extends IService<CuMemberAccount> {
*/
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

@ -1,6 +1,5 @@
package com.hzs.member.account.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hzs.common.core.enums.EApproveOperation;
import com.hzs.common.domain.member.account.CuMemberAccountRechargeExt;
@ -14,21 +13,14 @@ import com.hzs.member.account.vo.CuMemberRechargeDetailVO;
import com.hzs.member.account.vo.CuMemberRechargeVO;
import com.hzs.system.sys.dto.ApprovalBusinessResultDTO;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
* <p>
* 会员充值表 服务类
* </p>
*
* @author hzs
* @since 2022-09-08
*/
public interface ICuMemberRechargeService extends IService<CuMemberRecharge> {
/**
* 根据批次查询充值信息
*
@ -37,7 +29,6 @@ public interface ICuMemberRechargeService extends IService<CuMemberRecharge> {
*/
List<CuMemberRecharge> selectRechargeByBatch(String batch);
/**
* 会员批量充值
*
@ -46,7 +37,6 @@ public interface ICuMemberRechargeService extends IService<CuMemberRecharge> {
*/
Integer saveBatchMemberRecharge(CuMemberBatchRechargeParam batchRechargeParam);
/**
* 根据充值单号更新审核状态信息
*
@ -63,7 +53,6 @@ public interface ICuMemberRechargeService extends IService<CuMemberRecharge> {
*/
Integer submitAuditMemberRecharge(MemberAccountAudit memberAccountAudit);
/**
* 审核通过后插入交易明细和用户余额表
*
@ -107,7 +96,6 @@ public interface ICuMemberRechargeService extends IService<CuMemberRecharge> {
*/
Boolean preCharge(String rechargeAmount, Integer pkCountry, Long pkMember, String rechargeCode, Long pkCreator);
/**
* 会员端在线支付更新审批状态
*
@ -126,7 +114,6 @@ public interface ICuMemberRechargeService extends IService<CuMemberRecharge> {
*/
CuMemberRecharge getCuMemberRechargeByRechargeCode(String rechargeCode);
/**
* 根据充值单号与用户ID查询充值信息
*
@ -143,7 +130,6 @@ public interface ICuMemberRechargeService extends IService<CuMemberRecharge> {
*/
void saveMemberTradeDetailAndBonus(List<CuMemberAccountRechargeExt> memberAccountList, Integer rechargeMethod, String businessCode);
/**
* 根据会员编号查询提交审核的用户
*

View File

@ -25,14 +25,6 @@ public interface ICuMemberWithdrawService extends IService<CuMemberWithdraw> {
*/
List<CuMemberWithdraw> getWithdrawTimes(Long pkMember);
/**
* 根据申请单号查询提现信息
*
* @param code 单号
* @return CuMemberWithdraw
*/
CuMemberWithdraw selectWithdrawByCode(String code);
/**
* 根据批次号查询审核记录
*
@ -41,7 +33,6 @@ public interface ICuMemberWithdrawService extends IService<CuMemberWithdraw> {
*/
List<CuMemberWithdraw> selectWithdrawByBatch(String batchNO);
/**
* 保存提现
*
@ -90,15 +81,6 @@ public interface ICuMemberWithdrawService extends IService<CuMemberWithdraw> {
*/
Integer withdrawPaymentPositiveByPkId(CuMemberWithdrawVO memberWithdrawVO);
/**
* 获取余额
*
* @param pkMember 用户ID
* @param pkCountry 国家ID
* @return BigDecimal
*/
BigDecimal getBalance(Long pkMember, Integer pkCountry, Integer accountsType);
/**
* 计算本次提现应该交的个税
*
@ -128,11 +110,6 @@ public interface ICuMemberWithdrawService extends IService<CuMemberWithdraw> {
*/
BigDecimal computeRounding(BdWithdrawal bdWithdrawal, BigDecimal cashAmount);
/**
* 自动提现
*/
void autoWithdraw();
/**
* 获取账户余额
*
@ -142,7 +119,6 @@ public interface ICuMemberWithdrawService extends IService<CuMemberWithdraw> {
*/
BigDecimal getAccountBalance(Integer accountsType, CuMemberAccount cuMemberAccount);
/**
* @param pkIds 主键集合
* @param approveState 审核状态

View File

@ -233,7 +233,6 @@ public class CuMemberAccountServiceImpl extends ServiceImpl<CuMemberAccountMappe
} else {
cuMemberAccount.setAccount4(amount);
}
}
@Override
@ -324,11 +323,6 @@ public class CuMemberAccountServiceImpl extends ServiceImpl<CuMemberAccountMappe
return memberAccountShowVOList;
}
@Override
public List<CuMemberAccountExt> queryMemberAccountByPkcountry(Integer pkCountry) {
return baseMapper.queryMemberAccountByPkCountry(pkCountry);
}
@Override
public List<CuMemberRechargeAccountParam> queryMemberAccountByMemberCode(String memberCode, List<Integer> accountTypes, Integer pkCountry) {
List<Integer> pkAccounts = new ArrayList<>();
@ -382,7 +376,6 @@ public class CuMemberAccountServiceImpl extends ServiceImpl<CuMemberAccountMappe
return memberWalletDetailVOList;
}
@Override
public Object[] selectMemberAccountList(CuMemberWalletDetailVO memberWalletDetailVO) {
List<CuMemberAccountExt> cuMemberAccountExts;
@ -397,7 +390,6 @@ public class CuMemberAccountServiceImpl extends ServiceImpl<CuMemberAccountMappe
}
convertCuMemberAccountVO(memberWalletDetailVOList, cuMemberAccountExts, memberWalletDetailVO.getPkCountry());
return new Object[]{cuMemberAccountExts, memberWalletDetailVOList};
}
/**
@ -452,7 +444,6 @@ public class CuMemberAccountServiceImpl extends ServiceImpl<CuMemberAccountMappe
cuMemberAccountVOList.add(memberWalletDetailVO);
}
}
}
private void noIncludeAccount(CuMemberWalletDetailVO memberWalletDetailVO, Map<Integer, BdAccount> map) {
@ -494,7 +485,6 @@ public class CuMemberAccountServiceImpl extends ServiceImpl<CuMemberAccountMappe
return baseMapper.updateFrozenAmountInfo(memberAccount);
}
/**
* 组装锁定账户信息
*
@ -545,7 +535,6 @@ public class CuMemberAccountServiceImpl extends ServiceImpl<CuMemberAccountMappe
if (StringUtils.isNotEmpty(remarks)) {
ReflectUtils.invokeSetter(cuMemberAccount, MemberFieldConstants.ACCOUNT + accountValue + MemberFieldConstants.ACCOUNT_REMARKS, remarks);
}
}
}
return cuMemberAccount;
@ -573,7 +562,6 @@ public class CuMemberAccountServiceImpl extends ServiceImpl<CuMemberAccountMappe
}
}
/**
* 获取充值用户主键信息
*
@ -589,7 +577,6 @@ public class CuMemberAccountServiceImpl extends ServiceImpl<CuMemberAccountMappe
return baseMapper.queryMemberAccountByPkMember(pkMembers);
}
@Override
public Boolean batchUpdateMemberAccountByPkmember(List<MemberAmountDTO> pkMemberList, int pkAccount, Integer isWithdraw) {
return baseMapper.batchUpdateMemberAccountByPkMember(pkMemberList, pkAccount, isWithdraw);
@ -610,12 +597,6 @@ public class CuMemberAccountServiceImpl extends ServiceImpl<CuMemberAccountMappe
return baseMapper.selectMemberAccountByPkMember(pkMembers);
}
@Override
public List<CuMemberAccountExt> queryAccountAndMemberInfo(List<Long> memberIdList) {
return baseMapper.queryAccountAndMemberInfo(memberIdList);
}
@Override
public Object[] queryMemberAccountByMemberCodeAndName(CuMemberAccountVO cuMemberAccountVO) {
CuMemberAccountExtVO cuMemberAccountExtVO;
@ -662,7 +643,6 @@ public class CuMemberAccountServiceImpl extends ServiceImpl<CuMemberAccountMappe
return memberAccountExportVOList;
}
/**
* 根据前端选择的币种返回显示内容
*
@ -716,7 +696,6 @@ public class CuMemberAccountServiceImpl extends ServiceImpl<CuMemberAccountMappe
ReflectUtils.invokeSetter(memberAccountExportVO, MemberFieldConstants.SETTLE_AVAILABLE_ACCOUNT + pkAccount, settleAvailableAccount);
}
}
return memberAccountExportVO;
}
@ -784,28 +763,12 @@ public class CuMemberAccountServiceImpl extends ServiceImpl<CuMemberAccountMappe
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
public CuMemberRechargeAccountParam findMemberBalanceById(Integer pkAccount, Long pkMember) {
List<CuMemberRechargeAccountParam> cuMemberRechargeAccountParams = baseMapper.queryMemberAccountByMemberCode(null, Collections.singletonList(pkAccount), pkMember);
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
public List<CuMemberAccountRechargeExt> selectMemberBonusAccountBySourceCode(String sourceCode) {
return baseMapper.selectMemberBonusAccountBySourceCode(sourceCode);

View File

@ -59,65 +59,37 @@ import java.util.*;
import java.util.stream.Collectors;
/**
* <p>
* 会员提现表 服务实现类
* </p>
*
* @author hzs
* @since 2022-09-06
*/
@Service
@Slf4j
public class CuMemberWithdrawServiceImpl extends ServiceImpl<CuMemberWithdrawMapper, CuMemberWithdraw> implements ICuMemberWithdrawService {
@Autowired
private ICuMemberTradeService iCuMemberTradeService;
@Autowired
private ICuMemberAccountService iCuMemberAccountService;
@Autowired
private ICuMemberBaseService iCuMemberBaseService;
@Autowired
private ICuMemberBankService iCuMemberBankService;
@Autowired
private ICuMemberService iCuMemberService;
@DubboReference
IWithdrawalTaxServiceApi withdrawalTaxServiceApi;
@Autowired
ICuMemberTradeService cuMemberTradeService;
@Autowired
ICuMemberAccountService cuMemberAccountService;
@Autowired
ICuMemberBaseService cuMemberBaseService;
@Autowired
ICuMemberBankService cuMemberBankService;
@Autowired
ICuMemberService cuMemberService;
IWithdrawalTaxServiceApi iWithdrawalTaxServiceApi;
@DubboReference
IWithdrawalAutoServiceApi withdrawalAutoServiceApi;
IWithdrawalAutoServiceApi iWithdrawalAutoServiceApi;
@DubboReference
IWithdrawalServiceApi withdrawalServiceApi;
IWithdrawalProcessServiceApi iWithdrawalProcessServiceApi;
@DubboReference
IWithdrawalProcessServiceApi withdrawalProcessServiceApi;
@DubboReference
IApprovalServiceApi approvalServiceApi;
IApprovalServiceApi iApprovalServiceApi;
@Override
public List<CuMemberWithdraw> getWithdrawTimes(Long pkMember) {
return baseMapper.getWithdrawTimes(pkMember);
}
@Override
public CuMemberWithdraw selectWithdrawByCode(String code) {
//根据单号查询充值信息
QueryWrapper<CuMemberWithdraw> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("WITHDRAW_CODE", code);
queryWrapper.eq("DEL_FLAG", EDelFlag.UN_DELETE.getValue());
return getOne(queryWrapper);
}
@Override
public List<CuMemberWithdraw> selectWithdrawByBatch(String batchNO) {
//根据单号查询充值信息
@ -126,7 +98,6 @@ public class CuMemberWithdrawServiceImpl extends ServiceImpl<CuMemberWithdrawMap
return baseMapper.selectList(queryWrapper);
}
private BigDecimal[] getIncomeTax(BdWithdrawalTaxExt withdrawalTax, Integer pkCountry, BigDecimal curCashAmount) {
//个税比例
BigDecimal incomeTax = BigDecimal.ZERO;
@ -158,7 +129,6 @@ public class CuMemberWithdrawServiceImpl extends ServiceImpl<CuMemberWithdrawMap
Integer row = baseMapper.insert(cuMemberWithdraw);
this.updateTradeAndBalancd(cuMemberWithdraw, EOperationMethod.INSERT);
return row;
}
/**
@ -169,10 +139,10 @@ public class CuMemberWithdrawServiceImpl extends ServiceImpl<CuMemberWithdrawMap
*/
public Integer updateTradeAndBalancd(CuMemberWithdraw cuMemberWithdraw, EOperationMethod eMethodType) {
CuMemberTrade cuMemberTrade = this.getCuMemberTrade(cuMemberWithdraw, eMethodType);
cuMemberTradeService.save(cuMemberTrade);
iCuMemberTradeService.save(cuMemberTrade);
//更新余额表
Integer pkAccount = cuMemberWithdraw.getPkAccount();
int accountType = cuMemberBaseService.getAccount(pkAccount).getFieldValue();
int accountType = iCuMemberBaseService.getAccount(pkAccount).getFieldValue();
//提现金额
BigDecimal cashAmount = cuMemberWithdraw.getCashAmount();
BigDecimal amount = eMethodType.equals(EOperationMethod.INSERT) ? cashAmount.negate() : cashAmount;
@ -180,7 +150,7 @@ public class CuMemberWithdrawServiceImpl extends ServiceImpl<CuMemberWithdrawMap
.accountType(accountType).amount(amount).pkModified(cuMemberWithdraw.getPkCreator())
.accountClassify(ETradeClassify.WITHDRAWAL.getValue()).pkCountry(cuMemberWithdraw.getPkCountry())
.transferType(ETransferType.TRANSFER_IN.getValue()).build();
return cuMemberAccountService.updateMemberAccountByMemberCode(param);
return iCuMemberAccountService.updateMemberAccountByMemberCode(param);
}
/**
@ -202,9 +172,9 @@ public class CuMemberWithdrawServiceImpl extends ServiceImpl<CuMemberWithdrawMap
Integer tradeType = eMethodType.equals(EOperationMethod.INSERT) ? ETradeType.WITHDRAW.getValue() : ETradeType.WITHDRAWAL_REFUSED.getValue();
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)
.tradeCode(tradeCode)
.pkAccount(pkAccount)
@ -231,7 +201,6 @@ public class CuMemberWithdrawServiceImpl extends ServiceImpl<CuMemberWithdrawMap
return baseMapper.updateWithdrawByCode(cuMemberWithdraw);
}
@Override
public Object[] selectMemberWithdrawList(CuMemberWithdrawVO memberWithdrawVO) {
CuMemberWithdrawVO cuMemberWithdrawVO;
@ -249,18 +218,16 @@ public class CuMemberWithdrawServiceImpl extends ServiceImpl<CuMemberWithdrawMap
cuMemberWithdrawVO.setValidEndDate(DateUtil.format(cuMemberWithdrawExt.getValidEndDate(), DatePattern.NORM_DATE_PATTERN));
}
this.setPublicParam(cuMemberWithdrawVO, cuMemberWithdrawExt);
cuMemberWithdrawVO.setStatusVal(EWithdrawStatus.getLabelByValue(cuMemberWithdrawVO.getStatus()));
cuMemberWithdrawVoS.add(cuMemberWithdrawVO);
}
//总计
CuMemberWithdrawExt cuMemberWithdrawExt = baseMapper.selectMemberWithdrawListTotal(memberWithdrawVO);
cuMemberWithdrawVoS.add(BeanUtil.copyProperties(cuMemberWithdrawExt, CuMemberWithdrawVO.class));
}
Object[] objects = new Object[]{cuMemberWithdrawExts, cuMemberWithdrawVoS};
return objects;
return new Object[]{cuMemberWithdrawExts, cuMemberWithdrawVoS};
}
/**
* 页面显示公用参数
*
@ -272,18 +239,18 @@ public class CuMemberWithdrawServiceImpl extends ServiceImpl<CuMemberWithdrawMap
Integer pkRate = memberWithdraw.getPkRate();
if (null != pkRate) {
//汇率
exchangeRate = cuMemberBaseService.getCurrencyById(memberWithdraw.getPkRate()).getInExchangeRate();
exchangeRate = iCuMemberBaseService.getCurrencyById(memberWithdraw.getPkRate()).getInExchangeRate();
} else {
//取最新的汇率
CurrencyDTO currencyDTO = cuMemberBaseService.getCurrency(cuMemberWithdrawVO.getPkCountry());
CurrencyDTO currencyDTO = iCuMemberBaseService.getCurrency(cuMemberWithdrawVO.getPkCountry());
exchangeRate = currencyDTO.getInExchangeRate();
}
//查询提现账户
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;
if (accountsType.equals(EAccount.BONUS.getValue())) {
BigDecimal balance = ReflectUtils.invokeGetter(cuMemberAccount, MemberFieldConstants.WITHDRAW_ACCOUNT + accountsType);
@ -315,10 +282,9 @@ public class CuMemberWithdrawServiceImpl extends ServiceImpl<CuMemberWithdrawMap
cuMemberWithdrawVO.setSettleServiceCharge(settleServiceCharge);
cuMemberWithdrawVO.setSettleCashAmount(settleCashAmount);
cuMemberWithdrawVO.setSettleIssuedAmount(settleIssuedAmount);
cuMemberWithdrawVO.setPkAccount(cuMemberBaseService.translateAccountValue(pkAccount));
cuMemberWithdrawVO.setPkAccount(iCuMemberBaseService.translateAccountValue(pkAccount));
}
@Override
public CuMemberWithdrawVO queryCuMemberWithdrawDetail(Long pkId) {
CuMemberWithdrawVO memberRechargeDetailVo = new CuMemberWithdrawVO();
@ -335,7 +301,6 @@ public class CuMemberWithdrawServiceImpl extends ServiceImpl<CuMemberWithdrawMap
return baseMapper.withdrawPaymentByPkId(cuMemberWithdraw);
}
@Override
@Transactional(rollbackFor = Exception.class)
public Integer withdrawPaymentPositiveByPkId(CuMemberWithdrawVO memberWithdrawVO) {
@ -352,26 +317,6 @@ public class CuMemberWithdrawServiceImpl extends ServiceImpl<CuMemberWithdrawMap
return row;
}
@Override
@Transactional(rollbackFor = Exception.class)
public void autoWithdraw() {
//查询自动配置的信息
List<BdWithdrawal> withdrawalConfigs = withdrawalServiceApi.queryWithdrawalByIsAuto().getData();
if (CollUtil.isNotEmpty(withdrawalConfigs)) {
for (BdWithdrawal withdrawal : withdrawalConfigs) {
Integer pkCountry = withdrawal.getPkCountry();
if (Boolean.TRUE.equals(isWithdrawalCycle(pkCountry))) {
//查询提现到的币种
List<BdAccount> bdAccounts = cuMemberBaseService.getAccountByCountry(EAccountProperty.IS_WITHDRAWAL.getValue(), pkCountry);
Integer accountsType = bdAccounts.get(0).getFieldValue();
//查询会员币种余额锁定金额
List<CuMemberAccountExt> cuMemberAccountExts = cuMemberAccountService.queryMemberAccountByPkcountry(pkCountry);
memberWithDrawal(withdrawal, cuMemberAccountExts, bdAccounts, accountsType, pkCountry);
}
}
}
}
/**
* 会员提现
*
@ -386,7 +331,7 @@ public class CuMemberWithdrawServiceImpl extends ServiceImpl<CuMemberWithdrawMap
Long pkMember;
Long pkBank;
//余额 锁定金额
BigDecimal balance, lockAccount;
BigDecimal balance;
//最高自动提现金额
BigDecimal upperBound = withdrawal.getUpperBound();
//最低自动提现金额
@ -398,11 +343,11 @@ public class CuMemberWithdrawServiceImpl extends ServiceImpl<CuMemberWithdrawMap
List<CuMemberWithdrawExt> withdrawTimesByPkCountry = baseMapper.getWithdrawTimesByPkCountry(pkCountry);
Map<Long, Integer> withdrawTimes = withdrawTimesByPkCountry.stream().collect(Collectors.toMap(CuMemberWithdrawExt::getPkMember, CuMemberWithdrawExt::getTimes));
//汇率
CurrencyDTO currencyDTO = cuMemberBaseService.getCurrency(pkCountry);
CurrencyDTO currencyDTO = iCuMemberBaseService.getCurrency(pkCountry);
for (CuMemberAccountExt cuMemberAccountExt : cuMemberAccountExts) {
pkBank = cuMemberAccountExt.getPkBank();
//是否绑定银行卡
CuMemberBankVO memberBank = cuMemberBankService.selectCuMemberBankById(pkBank);
CuMemberBankVO memberBank = iCuMemberBankService.selectCuMemberBankById(pkBank);
log.info("----------是否绑定银行卡");
if (null != memberBank) {
log.info("----------绑定银行卡");
@ -414,7 +359,7 @@ public class CuMemberWithdrawServiceImpl extends ServiceImpl<CuMemberWithdrawMap
// 提现金额在配置金额之间
if (balance.compareTo(lowerBound) > 0 && balance.compareTo(upperBound) < 0) {
log.info("----------提现开始");
Integer times = withdrawTimes.get(pkMember) == null ? 0 : withdrawTimes.get(pkMember);
int times = withdrawTimes.get(pkMember) == null ? 0 : withdrawTimes.get(pkMember);
//比较正在提现次数与配置的最大提现次数
if (times <= withdrawalNumber) {
//本次应缴个税
@ -423,7 +368,7 @@ public class CuMemberWithdrawServiceImpl extends ServiceImpl<CuMemberWithdrawMap
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);
CuMember member = iCuMemberService.getMember(pkMember);
String remarks = member.getMemberCode() + "自动申请提现" + balance.toString();
CuMemberWithdraw cuMemberWithdraw = CuMemberWithdraw.builder().pkMember(pkMember)
.pkAccount(bdAccounts.get(0).getPkId()).pkBank(pkBank)
@ -444,7 +389,6 @@ public class CuMemberWithdrawServiceImpl extends ServiceImpl<CuMemberWithdrawMap
}
}
/**
* 获取余额
*
@ -499,32 +443,20 @@ public class CuMemberWithdrawServiceImpl extends ServiceImpl<CuMemberWithdrawMap
DayOfWeek dayOfWeek = localDate.getDayOfWeek();
Integer dayOfWeekNum = dayOfWeek.getValue();
//自动提现配置的提现周期
List<BdWithdrawalAuto> listR = withdrawalAutoServiceApi.queryWithdrawalAuto(pkCountry).getData();
List<BdWithdrawalAuto> listR = iWithdrawalAutoServiceApi.queryWithdrawalAuto(pkCountry).getData();
for (BdWithdrawalAuto withdrawalAuto : listR) {
Integer withdrawalCycle = withdrawalAuto.getWithdrawalCycle();
if (dayOfWeekNum.equals(withdrawalCycle)) {
return true;
}
}
return false;
}
@Override
public BigDecimal getBalance(Long pkMember, Integer pkCountry, Integer accountsType) {
//提现账户
if (null == accountsType) {
List<BdAccount> bdAccounts = cuMemberBaseService.getAccountByCountry(EAccountProperty.IS_WITHDRAWAL.getValue(), pkCountry);
accountsType = bdAccounts.get(0).getFieldValue();
}
//查询账户余额
return cuMemberAccountService.selectBalanceByMemberCode(pkMember, accountsType);
}
@Override
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();
if (null == withdrawalTax) {
return BigDecimal.ZERO;
@ -557,7 +489,7 @@ public class CuMemberWithdrawServiceImpl extends ServiceImpl<CuMemberWithdrawMap
@Override
public BigDecimal computeServiceCharge(Integer pkCountry, BigDecimal cashAmount) {
BdWithdrawalProcess withdrawalProcess = withdrawalProcessServiceApi.queryBdWithdrawalProcess(pkCountry).getData();
BdWithdrawalProcess withdrawalProcess = iWithdrawalProcessServiceApi.queryBdWithdrawalProcess(pkCountry).getData();
//手续费类型
Integer serviceType = withdrawalProcess.getServiceType();
BigDecimal serviceRatio = withdrawalProcess.getServiceRatio();
@ -570,7 +502,6 @@ public class CuMemberWithdrawServiceImpl extends ServiceImpl<CuMemberWithdrawMap
//手续费金额 = 本次提现金额 * 手续费比例
return cashAmount.multiply(serviceChargeeRatio).setScale(4, BigDecimal.ROUND_HALF_UP);
}
}
@Override
@ -584,13 +515,11 @@ public class CuMemberWithdrawServiceImpl extends ServiceImpl<CuMemberWithdrawMap
return roundIngAmount;
}
@Override
public List<CuMemberWithdraw> getWithdrawApproveStateByIds(List<Long> pkIds, Integer approveState) {
return baseMapper.getWithdrawApproveStateByIds(pkIds, approveState);
}
@Override
public CuMemberPetitionVO showMemberWithdrawPetition(List<Long> pkIds, Integer approveState) {
CuMemberPetitionVO memberPetitionVo = new CuMemberPetitionVO();
@ -603,7 +532,6 @@ public class CuMemberWithdrawServiceImpl extends ServiceImpl<CuMemberWithdrawMap
return memberPetitionVo;
}
@Override
public List<CuMemberWithdrawVO> checkWithdrawPetitionByState(List<Long> pkIds, Integer approveState) {
return BeanUtil.copyToList(baseMapper.showMemberWithdrawPetition(pkIds, approveState), CuMemberWithdrawVO.class);
@ -627,7 +555,7 @@ public class CuMemberWithdrawServiceImpl extends ServiceImpl<CuMemberWithdrawMap
List<String> withdrawCodeList = cuMemberWithdrawExts.stream().map(CuMemberWithdrawExt::getWithdrawCode).collect(Collectors.toList());
CuMemberTradeVO memberTradeVO = CuMemberTradeVO.builder().sourceCode(businessNo)
.tradeCodes(withdrawCodeList).pkModified(loginUser.getUserId()).build();
cuMemberTradeService.updateSourceCodeByTradeCode(memberTradeVO);
iCuMemberTradeService.updateSourceCodeByTradeCode(memberTradeVO);
List<CuMemberWithdrawVO> memberWithdrawList = memberPetitionVo.getMemberWithdrawList();
//提交提现用户
@ -640,7 +568,7 @@ public class CuMemberWithdrawServiceImpl extends ServiceImpl<CuMemberWithdrawMap
.remark(memberPetitionVo.getDescription())
.pkMemberList(pkMembers).build();
//调用审批接口
R<String> submit = approvalServiceApi.submit(approvalSubmitDTO, loginUser);
R<String> submit = iApprovalServiceApi.submit(approvalSubmitDTO, loginUser);
if (!submit.isSuccess()) {
throw new RuntimeException(submit.getMsg());
}
@ -676,7 +604,7 @@ public class CuMemberWithdrawServiceImpl extends ServiceImpl<CuMemberWithdrawMap
.freeSignFlag(false).build();
}
businessLogDTOList.add(businessLog);
cuMemberBaseService.operationLogMQ(businessLogDTOList);
iCuMemberBaseService.operationLogMQ(businessLogDTOList);
}
}
@ -687,7 +615,7 @@ public class CuMemberWithdrawServiceImpl extends ServiceImpl<CuMemberWithdrawMap
List<CuMemberWithdrawExt> cuMemberWithdrawList = baseMapper.selectMemberWithdrawListByPkMember(pkMember, pkCountry);
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));
for (CuMemberWithdrawExt ext : cuMemberWithdrawList) {
cuMemberWithdrawVO = BeanUtil.copyProperties(ext, CuMemberWithdrawVO.class);
@ -709,18 +637,18 @@ public class CuMemberWithdrawServiceImpl extends ServiceImpl<CuMemberWithdrawMap
BigDecimal backAmount = cuMemberWithdraw.getCashAmount();
if (backAmount.compareTo(BigDecimal.ZERO) > 0) {
//插入交易明细表
cuMemberTradeService.save(getCuMemberTradeInfo(cuMemberWithdraw));
iCuMemberTradeService.save(getCuMemberTradeInfo(cuMemberWithdraw));
//更新余额表
CuMemberAccount cuMemberAccount = this.getCuMemberAccount(cuMemberWithdraw, backAmount);
cuMemberAccount.setPkCountry(cuMemberWithdraw.getPkCountry());
cuMemberAccountService.updateMemberAccount(cuMemberAccount, pkModified);
iCuMemberAccountService.updateMemberAccount(cuMemberAccount, pkModified);
}
return baseMapper.updateWithdrawStatusByPkId(pkId, pkModified);
}
private CuMemberAccount getCuMemberAccount(CuMemberWithdraw cuMemberWithdraw, BigDecimal backAmount) {
Integer pkAccount = cuMemberWithdraw.getPkAccount();
BdAccount account = cuMemberBaseService.getAccount(pkAccount);
BdAccount account = iCuMemberBaseService.getAccount(pkAccount);
if (account.getFieldValue().equals(EAccount.BONUS.getValue())) {
return CuMemberAccount.builder()
.account4(backAmount)
@ -744,11 +672,11 @@ public class CuMemberWithdrawServiceImpl extends ServiceImpl<CuMemberWithdrawMap
private CuMemberTrade getCuMemberTradeInfo(CuMemberWithdraw cuMemberWithdraw) {
Long pkMember = cuMemberWithdraw.getPkMember();
Integer pkAccount = cuMemberWithdraw.getPkAccount();
BdAccount account = cuMemberBaseService.getAccount(pkAccount);
BdAccount account = iCuMemberBaseService.getAccount(pkAccount);
//交易金额
BigDecimal tradeAmount = cuMemberWithdraw.getCashAmount();
//查询余额
BigDecimal balance = cuMemberAccountService.selectBalanceByMemberCode(pkMember, account.getFieldValue());
BigDecimal balance = iCuMemberAccountService.selectBalanceByMemberCode(pkMember, account.getFieldValue());
CuMemberTrade memberTrade = CuMemberTrade.builder().pkMember(pkMember)
.tradeCode(CommonUtil.createSerialNumber(EOrderPrefix.WITHDRAWAL_CODE.getValue()))
.pkAccount(pkAccount)
@ -774,13 +702,13 @@ public class CuMemberWithdrawServiceImpl extends ServiceImpl<CuMemberWithdrawMap
@Override
public void withdrawReject(CuMemberWithdrawRejectParam param) {
if(ObjectUtil.isEmpty(param)){
if (ObjectUtil.isEmpty(param)) {
throw new ServiceException("参数异常!");
}
if(CollUtil.isEmpty(param.getIdList())){
if (CollUtil.isEmpty(param.getIdList())) {
throw new ServiceException("请选择需要驳回的数据!");
}
if(StrUtil.isEmpty(param.getRejectRemark())){
if (StrUtil.isEmpty(param.getRejectRemark())) {
throw new ServiceException("请录入驳回原因!");
}
LambdaQueryWrapper<CuMemberWithdraw> wrapper = new LambdaQueryWrapper<>();
@ -793,13 +721,13 @@ public class CuMemberWithdrawServiceImpl extends ServiceImpl<CuMemberWithdrawMap
baseMapper.update(withdraw, wrapper);
List<CuMemberWithdraw> cuMemberWithdrawList = baseMapper.selectList(wrapper);
Integer pkCountry = SecurityUtils.getPkCountry();
if(CollUtil.isNotEmpty(cuMemberWithdrawList)){
if (CollUtil.isNotEmpty(cuMemberWithdrawList)) {
for (CuMemberWithdraw cuMemberWithdraw : cuMemberWithdrawList) {
BusinessCommissionDTO businessCommissionDTO = BusinessCommissionDTO.builder()
.tradeCode(cuMemberWithdraw.getWithdrawCode()).pkCountry(pkCountry)
.tradeType(EApprovalBusiness.WITHDRAWAL.getValue())
.pkCreator(SecurityUtils.getUserId()).build();
cuMemberTradeService.businessCommissionReject(businessCommissionDTO);
iCuMemberTradeService.businessCommissionReject(businessCommissionDTO);
}
}
}

View File

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

View File

@ -15,6 +15,7 @@ import java.util.List;
* Mapper 接口
*/
public interface CuMemberRetailRangeMapper extends BaseMapper<CuMemberRetailRange> {
/**
* 查询会员直推会员
*
@ -23,65 +24,6 @@ public interface CuMemberRetailRangeMapper extends BaseMapper<CuMemberRetailRang
*/
List<Long> selectDirectPushByPkMember(@Param("pkMember") Long pkMember, @Param("systemType") Integer systemType);
/**
* 查询大区用户信息
*
* @param cuMemberAchieveVO
* @return
*/
CuMemberRetailAchieveVO selectBigAreaByPkMember(CuMemberRetailAchieveVO cuMemberAchieveVO);
/**
* 查询表名是否存在
*
* @param tableNames 表名
* @return List<String>
*/
List<String> selectTableNameIsExist(@Param("tableNames") List<String> tableNames);
/**
* 查询会员当天是否下订单
*
* @param pkMember 会员
* @return Integer
*/
CuMemberRetailAchieveVO selectMemberOrderByPkMember(@Param("pkMember") Long pkMember);
/**
* 查询会员的极差业绩
*
* @param cuMemberAchieveVO 入参
* @return CuMemberAchieveVO
*/
List<CuMemberRetailAchieveVO> selectMemberParentByPkMember(CuMemberRetailAchieveVO cuMemberAchieveVO);
/**
* 查询会员没有注水的大区盒数
*
* @param cuMemberAchieveVO 入参
* @return CuMemberRetailAchieveVO
*/
BigDecimal selectMemberBoxNoWaterInjection(CuMemberRetailAchieveVO cuMemberAchieveVO);
/**
* 查询会员注水的大区盒数
*
* @param cuMemberAchieveVO 入参
* @return CuMemberRetailAchieveVO
*/
BigDecimal selectMemberBoxWaterInjection(CuMemberRetailAchieveVO cuMemberAchieveVO);
/**
* 查询会员最大盒数
*
* @param cuMemberAchieveVO 入参
* @return CuMemberRetailAchieveVO
*/
BigDecimal selectMemberTotalBox(CuMemberRetailAchieveVO cuMemberAchieveVO);
/**
* 查询会员业绩
*
@ -130,22 +72,6 @@ public interface CuMemberRetailRangeMapper extends BaseMapper<CuMemberRetailRang
*/
CuMemberRetailAchieveVO selectMemberBigSmallAchieveDetail(CuMemberRetailAchieveVO cuMemberAchieveVO);
/**
* 根据会员编号查询注水
*
* @param memberCode 会员编号
* @return Integer
*/
Integer selectWaterInjection(@Param("memberCode") String memberCode);
/**
* 查询会员的激活状态
*
* @param cuMemberAchieveVO 入参
* @return Integer
*/
Integer selectMemberActiveState(CuMemberRetailAchieveVO cuMemberAchieveVO);
/**
* 根据会员ID查询上月业绩
*
@ -154,17 +80,10 @@ public interface CuMemberRetailRangeMapper extends BaseMapper<CuMemberRetailRang
*/
CuMemberRetailAchieveVO selectUpMonthAchieveByPkMember(CuMemberRetailAchieveVO cuMemberAchieveVO);
/**
* 查询会员累计业绩
*
* @param cuMemberAchieveVO 入参
* @return CuMemberRetailAchieveVO
*/
CuMemberRetailAchieveVO selectMemberOrderSumAchieveByPkMember(CuMemberRetailAchieveVO cuMemberAchieveVO);
/**
* 查询会员直推业绩(日结+秒结)
* orderType in (41,42,43,44)
* orderType in (41,42,43,44)
*
* @param cuMemberAchieveVO 入参
* @return List<CuMemberRetailAchieveVO>
*/
@ -172,6 +91,7 @@ public interface CuMemberRetailRangeMapper extends BaseMapper<CuMemberRetailRang
/**
* 获取会员结算明细
*
* @param cuMemberAchieveVO
* @return
*/
@ -195,7 +115,6 @@ public interface CuMemberRetailRangeMapper extends BaseMapper<CuMemberRetailRang
*/
CuMemberRetailAchieveVO selectMemberBigSmallBox(CuMemberRetailAchieveVO param);
/**
* 查询大区盒数列表市场动态
*
@ -212,5 +131,4 @@ public interface CuMemberRetailRangeMapper extends BaseMapper<CuMemberRetailRang
*/
List<CuMemberRetailAchieveVO> selectMemberSmallBoxList(CuMemberRetailAchieveVO param);
List<Long> selectSubMemberIdByRootMember(@Param("pkMember") Long pkMember, @Param("systemType") Integer systemType);
}

View File

@ -48,19 +48,11 @@ public interface CuMemberRetailRegionMapper extends BaseMapper<CuMemberRetailReg
**/
List<UnboundAreaVO> unboundAreaList(@Param("pkCountry") Integer pkCountry, @Param("systemType") Integer systemType);
/**
* 查询会员收益区域
**/
List<CuMemberRetailRegionExt> memberretailRegList(CuMemberRetailRegionExt mrrExt);
/**
* 重新判断收益区域数据
*
* @return
*/
List<CuMemberRetailRegionExt> listCheckRegionMember();
/**
* 会员购买订单数量
*

View File

@ -19,17 +19,6 @@ public class MemberRetailProvider implements IMemberRetailApi {
@Autowired
private ICuMemberRetailRegionService iCuMemberRetailRegionService;
@Override
public R<?> checkRegion() {
try {
iCuMemberRetailRegionService.checkRegion();
return R.ok();
} catch (Exception e) {
log.error("定时任务处理收益区域异常", e);
return R.fail(e.getMessage());
}
}
@Override
public R<?> cancelRegion(List<Long> pkIdList) {
try {

View File

@ -7,18 +7,9 @@ import com.hzs.retail.member.utils.PageResult;
import com.hzs.retail.member.vo.*;
import java.util.List;
import java.util.Map;
public interface ICuMemberRetailAchieveService extends IService<CuMemberRetailRange> {
/**
* 查询会员盒数
*
* @param pkMember 会员ID
* @return CuMemberRetailAchieveVO
*/
CuMemberRetailAchieveVO selectMemberSmallBox(Long pkMember, Integer pkCountry, Integer systemType);
/**
* 查询会员大小区业绩
*
@ -78,15 +69,6 @@ public interface ICuMemberRetailAchieveService extends IService<CuMemberRetailRa
*/
CuMemberRetailAchieveVO selectMemberBigSmallAchieveDetail(Long pkMember, Integer pkCountry, Integer systemType);
/**
* 为区域查询提供接口(大小区接口)
*
* @param pkMember 会员ID
* @param pkCountry 国家ID
* @return CuMemberRetailAchieveVO
*/
CuMemberRetailAchieveVO selectMemberSumAchieve(Long pkMember, Integer pkCountry, Integer systemType);
/**
* 查询大区盒数列表市场动态
*
@ -105,6 +87,7 @@ public interface ICuMemberRetailAchieveService extends IService<CuMemberRetailRa
/**
* 获取会员结算明细
*
* @param pkMember
* @param pkCountry
* @param systemType

View File

@ -50,11 +50,6 @@ public interface ICuMemberRetailRegionService extends IService<CuMemberRetailReg
**/
List<CuMemberRetailRegionExt> memberretailRegList(CuMemberRetailRegionExt mrrExt);
/**
* 定时处理收益区域
*/
void checkRegion();
/**
* 取消收益区域
*

View File

@ -5,7 +5,6 @@ import cn.hutool.core.util.ObjectUtil;
import cn.hutool.json.JSONUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hzs.common.core.constant.TableNameConstants;
import com.hzs.common.core.enums.EGrade;
import com.hzs.common.core.enums.EYesNo;
import com.hzs.common.core.utils.DateUtils;
import com.hzs.common.domain.member.achieve.CuMemberRetailRange;
@ -21,10 +20,7 @@ import com.hzs.retail.member.service.ICuMemberRetailAchieveService;
import com.hzs.retail.member.utils.DataStatisticsUtil;
import com.hzs.retail.member.utils.PageResult;
import com.hzs.retail.member.vo.*;
import com.hzs.system.config.IGradeServiceApi;
import com.hzs.system.config.dto.GradeDTO;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -51,64 +47,6 @@ public class CuMemberRetailAchieveServiceImpl extends ServiceImpl<CuMemberRetail
@Autowired
private ICuMemberSettlePeriodService iCuMemberSettlePeriodService;
@DubboReference
IGradeServiceApi gradeServiceApi;
@Override
public CuMemberRetailAchieveVO selectMemberSmallBox(Long pkMember, Integer pkCountry, Integer systemType) {
CuMember cuMember = iCuMemberService.queryMember(pkMember);
//等级为最高等级时不显示盒数
GradeDTO grade = gradeServiceApi.getGrade(cuMember.getPkSettleGrade()).getData();
if (grade.getGradeValue().equals(EGrade.S_VIP.getValue())) {
return CuMemberRetailAchieveVO.builder().message("当前已是最高等级").build();
}
CuMemberRetailAchieveVO memberRetailAchieveVO;
//查询会员昨日业绩
String memberRetailTable = getTableName();
//查询直推会员
List<Long> pkMemberList = baseMapper.selectDirectPushByPkMember(pkMember, systemType);
CuMemberRetailAchieveVO memberAchieveVO = CuMemberRetailAchieveVO.builder().memberRetailTable(memberRetailTable)
.memberRetailSTable(getTableSName()).memberCode(cuMember.getMemberCode())
.pkMember(pkMember).pkMemberList(pkMemberList).build();
//查询会员是否激活
// Integer enableStatus = baseMapper.selectMemberActiveState(memberAchieveVO);
Integer enableStatus = cuMember.getIsActivate();
if (null != enableStatus && enableStatus.equals(EYesNo.YES.getIntValue())) {
//查询总盒数
BigDecimal totalBox = baseMapper.selectMemberTotalBox(memberAchieveVO);
if (null != totalBox) {
BigDecimal maxBox = BigDecimal.ZERO;
//查询是否配置注水
Integer total = baseMapper.selectWaterInjection(cuMember.getMemberCode());
if (null != total && total > 0) {
//查询注水最大盒数
maxBox = baseMapper.selectMemberBoxWaterInjection(memberAchieveVO);
} else {
//查询无注水最大盒数
maxBox = baseMapper.selectMemberBoxNoWaterInjection(memberAchieveVO);
}
// memberRetailAchieveVO = CuMemberRetailAchieveVO.builder().totalBox(totalBox).smallAreaBox(totalBox - maxBox).build();
memberRetailAchieveVO = CuMemberRetailAchieveVO.builder().totalBox(totalBox).smallAreaBox(totalBox.subtract(maxBox)).build();
//总盒数大于2800的时候显示2800
GradeDTO lastGrate = gradeServiceApi.getGradeByGradeValue(EGrade.S_VIP.getValue(), pkCountry).getData();
//配置中的总盒数
BigDecimal totalBoxConfig = lastGrate.getBoxTotal();
// BigDecimal totalBoxMax = memberRetailAchieveVO.getTotalBox() > totalBoxConfig ? totalBoxConfig : memberRetailAchieveVO.getTotalBox();
BigDecimal totalBoxMax = memberRetailAchieveVO.getTotalBox().compareTo(totalBoxConfig) > 0 ? totalBoxConfig : memberRetailAchieveVO.getTotalBox();
memberRetailAchieveVO.setTotalBox(totalBoxMax);
} else {
memberRetailAchieveVO = CuMemberRetailAchieveVO.builder().totalBox(BigDecimal.ZERO).smallAreaBox(BigDecimal.ZERO).build();
}
} else {
memberRetailAchieveVO = CuMemberRetailAchieveVO.builder().totalBox(BigDecimal.ZERO).smallAreaBox(BigDecimal.ZERO).build();
}
return memberRetailAchieveVO;
}
@Override
public CuMemberRetailAchieveVO selectMemberAchieve(Long pkMember, Integer pkCountry, Integer systemType) {
//查询会员昨日业绩
@ -143,18 +81,6 @@ public class CuMemberRetailAchieveServiceImpl extends ServiceImpl<CuMemberRetail
return getMemberBigAndSmallAchieve(memberSelfAchieveList, rate);
}
/**
* 月初第一天赋值
*
* @param memberAchieveVO 入参
* @return CuMemberRetailAchieveVO
*/
private CuMemberRetailAchieveVO setIsFirst(CuMemberRetailAchieveVO memberAchieveVO) {
memberAchieveVO.setIsFirst(isFirstDayOfMonth() ? EYesNo.NO.getIntValue() : EYesNo.YES.getIntValue());
return memberAchieveVO;
}
@Override
public CuMemberRetailAchieveVO selectExcludeWaterSmallAchieve(Long pkMember, Integer pkCountry, Integer systemType) {
//查询会员昨日业绩表
@ -177,10 +103,8 @@ public class CuMemberRetailAchieveServiceImpl extends ServiceImpl<CuMemberRetail
} else {
return CuMemberRetailAchieveVO.builder().smallAreaPv(BigDecimal.ZERO).build();
}
}
@Override
public CuMemberRetailAchieveVO selectMemberBigAchieve(Long pkMember, Integer pkCountry, Integer systemType) {
//查询会员昨日业绩表
@ -252,12 +176,10 @@ public class CuMemberRetailAchieveServiceImpl extends ServiceImpl<CuMemberRetail
}
}
}
}
return retailAchieveVOList;
}
/**
* 获取直推大区业绩小区业绩
*
@ -266,11 +188,11 @@ public class CuMemberRetailAchieveServiceImpl extends ServiceImpl<CuMemberRetail
*/
private CuMemberRetailAchieveVO getMemberBigAndSmallAchieve(List<CuMemberRetailAchieveVO> memberAchieveList, BigDecimal rate) {
//查询最大业绩
if(ObjectUtil.isEmpty(memberAchieveList)){
if (ObjectUtil.isEmpty(memberAchieveList)) {
return null;
}
for (CuMemberRetailAchieveVO cuMemberRetailAchieveVO : memberAchieveList) {
if(ObjectUtil.isEmpty(cuMemberRetailAchieveVO.getArealPv())){
if (ObjectUtil.isEmpty(cuMemberRetailAchieveVO.getArealPv())) {
cuMemberRetailAchieveVO.setArealPv(BigDecimal.ZERO);
}
}
@ -286,19 +208,6 @@ public class CuMemberRetailAchieveServiceImpl extends ServiceImpl<CuMemberRetail
.build();
}
/**
* 查询会员直推大区信息
*
* @param pkMemberList 直推会员ID
* @return CuMemberAchieveVO
*/
private CuMemberRetailAchieveVO getMemberBigArea(List<Long> pkMemberList, String memberRangeTable) {
CuMemberRetailAchieveVO memberAchieveVO = CuMemberRetailAchieveVO.builder().memberRetailTable(memberRangeTable).pkMemberList(pkMemberList).build();
return baseMapper.selectBigAreaByPkMember(memberAchieveVO);
}
/**
* 查询会员直推业绩
*
@ -317,62 +226,49 @@ public class CuMemberRetailAchieveServiceImpl extends ServiceImpl<CuMemberRetail
*/
private String getTableName() {
String localDate = LocalDate.now().minus(1, ChronoUnit.DAYS).format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
CuMemberSettlePeriod cuMemberSettlePeriod =iCuMemberSettlePeriodService.getCuMemberSettlePeriodByDate(localDate);
if(ObjectUtil.isEmpty(cuMemberSettlePeriod)){
CuMemberSettlePeriod cuMemberSettlePeriod = iCuMemberSettlePeriodService.getCuMemberSettlePeriodByDate(localDate);
if (ObjectUtil.isEmpty(cuMemberSettlePeriod)) {
return null;
}
int period = cuMemberSettlePeriod.getPkId();
return TableNameConstants.CU_MEMBER_RETAIL_RANGE + period;
}
private String getDayTableName() {
String localDate = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
CuMemberSettlePeriod cuMemberSettlePeriod =iCuMemberSettlePeriodService.getCuMemberSettlePeriodByDate(localDate);
if(ObjectUtil.isEmpty(cuMemberSettlePeriod)){
return null;
}
int period = cuMemberSettlePeriod.getPkId();
return TableNameConstants.CU_MEMBER_RETAIL_S + period;
}
private String getTableNameSpecial() {
String localDate = LocalDate.now().minus(1, ChronoUnit.DAYS).format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
if(isBeforeThreeAm()){
if (isBeforeThreeAm()) {
localDate = LocalDate.now().minus(2, ChronoUnit.DAYS).format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
}
CuMemberSettlePeriod cuMemberSettlePeriod =iCuMemberSettlePeriodService.getCuMemberSettlePeriodByDate(localDate);
if(ObjectUtil.isEmpty(cuMemberSettlePeriod)){
CuMemberSettlePeriod cuMemberSettlePeriod = iCuMemberSettlePeriodService.getCuMemberSettlePeriodByDate(localDate);
if (ObjectUtil.isEmpty(cuMemberSettlePeriod)) {
return null;
}
int period = cuMemberSettlePeriod.getPkId();
return TableNameConstants.CU_MEMBER_RETAIL_RANGE + period;
}
private String getDayTableNameSpecial() {
String localDate = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
if(isBeforeThreeAm()){
if (isBeforeThreeAm()) {
localDate = LocalDate.now().minus(1, ChronoUnit.DAYS).format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
}
CuMemberSettlePeriod cuMemberSettlePeriod =iCuMemberSettlePeriodService.getCuMemberSettlePeriodByDate(localDate);
if(ObjectUtil.isEmpty(cuMemberSettlePeriod)){
CuMemberSettlePeriod cuMemberSettlePeriod = iCuMemberSettlePeriodService.getCuMemberSettlePeriodByDate(localDate);
if (ObjectUtil.isEmpty(cuMemberSettlePeriod)) {
return null;
}
int period = cuMemberSettlePeriod.getPkId();
return TableNameConstants.CU_MEMBER_RETAIL_S + period;
}
private String getTableNameSpecial4Date(String localDate) {
CuMemberSettlePeriod cuMemberSettlePeriod =iCuMemberSettlePeriodService.getCuMemberSettlePeriodByDate(localDate);
if(ObjectUtil.isEmpty(cuMemberSettlePeriod)){
CuMemberSettlePeriod cuMemberSettlePeriod = iCuMemberSettlePeriodService.getCuMemberSettlePeriodByDate(localDate);
if (ObjectUtil.isEmpty(cuMemberSettlePeriod)) {
return null;
}
int period = cuMemberSettlePeriod.getPkId();
return TableNameConstants.CU_MEMBER_RETAIL_RANGE + period;
}
private String getDayTableNameSpecial4Date(String localDate) {
CuMemberSettlePeriod cuMemberSettlePeriod =iCuMemberSettlePeriodService.getCuMemberSettlePeriodByDate(localDate);
if(ObjectUtil.isEmpty(cuMemberSettlePeriod)){
return null;
}
int period = cuMemberSettlePeriod.getPkId();
return TableNameConstants.CU_MEMBER_RETAIL_S + period;
}
public static boolean isBeforeThreeAm() {
LocalDateTime now = LocalDateTime.now();
// 获取当天凌晨3点的时间日期与当前日期相同时间为03:00:00
@ -381,7 +277,6 @@ public class CuMemberRetailAchieveServiceImpl extends ServiceImpl<CuMemberRetail
return now.isBefore(threeAm);
}
/**
* 查询上月最后一天业绩表名
*
@ -394,7 +289,6 @@ public class CuMemberRetailAchieveServiceImpl extends ServiceImpl<CuMemberRetail
return TableNameConstants.CU_MEMBER_RETAIL_RANGE + period;
}
/**
* 查询会员当日极差秒表名
*
@ -406,11 +300,6 @@ public class CuMemberRetailAchieveServiceImpl extends ServiceImpl<CuMemberRetail
return TableNameConstants.CU_MEMBER_RETAIL_S + period;
}
public List<String> selectTableNameIsExist(List<String> tableNames) {
return baseMapper.selectTableNameIsExist(tableNames);
}
/**
* 转化万单位汇率换算
*
@ -422,7 +311,6 @@ public class CuMemberRetailAchieveServiceImpl extends ServiceImpl<CuMemberRetail
return oldValue.divide(new BigDecimal("10000")).multiply(rate).setScale(4, BigDecimal.ROUND_FLOOR);
}
@Override
public CuMemberRetailAchieveVO selectMemberBigSmallAchieveDetail(Long pkMember, Integer pkCountry, Integer systemType) {
//查询会员昨日业绩
@ -448,56 +336,13 @@ public class CuMemberRetailAchieveServiceImpl extends ServiceImpl<CuMemberRetail
return cuMemberRetailAchieveVO;
}
/**
* 为区域查询提供接口
*
* @param pkMember 会员ID
* @param pkCountry 国家ID
* @return CuMemberRetailAchieveVO
*/
@Override
public CuMemberRetailAchieveVO selectMemberSumAchieve(Long pkMember, Integer pkCountry, Integer systemType) {
//查询会员昨日业绩
String memberRetailTable = getTableName();
String memberSecondTable = getDayTableName();
//查询直推会员
List<Long> pkMemberList = baseMapper.selectDirectPushByPkMember(pkMember, systemType);
// 2025年6月11日 取伞下 + 自己的ID
// List<Long> pkMemberList = baseMapper.selectSubMemberIdByRootMember(pkMember, systemType);
//根据国家查汇率
BigDecimal rate = iCuMemberBaseService.getCurrency(pkCountry).getInExchangeRate();
//查询自己业绩
List<CuMemberRetailAchieveVO> memberSelfAchieveList = new ArrayList<>();
//会员业绩
CuMemberRetailAchieveVO memberAchieveVO = CuMemberRetailAchieveVO.builder().memberRetailTable(memberRetailTable).pkMember(pkMember).systemType(systemType).build();
CuMemberRetailAchieveVO orderAchieveVO = baseMapper.selectMemberOrderSumAchieveByPkMember(memberAchieveVO);
if (null != orderAchieveVO && orderAchieveVO.getArealPv().compareTo(BigDecimal.ZERO) > 0) {
orderAchieveVO.setPkMember(pkMember);
memberSelfAchieveList.add(orderAchieveVO);
}
//查询伞下业绩
if (CollUtil.isNotEmpty(pkMemberList)) {
List<CuMemberRetailAchieveVO> memberPushAchieveList = getMemberPushSumAchieve(pkMemberList, memberRetailTable, memberSecondTable, systemType);
if (CollUtil.isNotEmpty(memberPushAchieveList)) {
memberSelfAchieveList.addAll(memberPushAchieveList);
}
}
if (CollUtil.isEmpty(memberSelfAchieveList)) {
return CuMemberRetailAchieveVO.builder().smallAreaPv(BigDecimal.ZERO).bigArealPv(BigDecimal.ZERO).build();
}
return getMemberBigAndSmallAchieve(memberSelfAchieveList, rate);
}
/**
* 查询会员直推业绩(累计)
*
* @param pkMemberList 直推会员ID
* @return CuMemberAchieveVO
*/
private List<CuMemberRetailAchieveVO> getMemberPushSumAchieve(List<Long> pkMemberList, String memberRangeTable,String memberSecondTable, Integer systemType) {
private List<CuMemberRetailAchieveVO> getMemberPushSumAchieve(List<Long> pkMemberList, String memberRangeTable, String memberSecondTable, Integer systemType) {
CuMemberRetailAchieveVO memberAchieveVO = CuMemberRetailAchieveVO.builder()
.memberRetailTable(memberRangeTable)
.memberRetailSTable(memberSecondTable)
@ -505,7 +350,6 @@ public class CuMemberRetailAchieveServiceImpl extends ServiceImpl<CuMemberRetail
return baseMapper.selectMemberSumAchieve(memberAchieveVO);
}
/**
* 查询不前时间是否是本月第一天
*
@ -514,11 +358,9 @@ public class CuMemberRetailAchieveServiceImpl extends ServiceImpl<CuMemberRetail
private Boolean isFirstDayOfMonth() {
LocalDate localDate = LocalDate.now();
LocalDate firstMonthDay = localDate.with(TemporalAdjusters.firstDayOfMonth());
// LocalDate firstMonthDay = LocalDate.of(2025, 02, 21);
return localDate.isAfter(firstMonthDay);
}
@Override
public CuMemberRetailAchieveVO selectMemberBigSmallBox(CuMemberRetailAchieveVO param) {
Long pkBigMember = param.getPkBigMember();
@ -542,7 +384,7 @@ public class CuMemberRetailAchieveServiceImpl extends ServiceImpl<CuMemberRetail
cuMemberRetailAchieveVO.setPkBigMember(pkBigMember);
// BigDecimal selfNewBox = null == selfBox ? 0 : selfBox;
BigDecimal selfNewBox = BigDecimal.ZERO;
if(ObjectUtil.isNotEmpty(selfBox)){
if (ObjectUtil.isNotEmpty(selfBox)) {
selfNewBox = selfBox;
}
//判断大小市场增加自己新增的盒数
@ -559,7 +401,6 @@ public class CuMemberRetailAchieveServiceImpl extends ServiceImpl<CuMemberRetail
return CuMemberRetailAchieveVO.builder().bigAreaBox(BigDecimal.ZERO).smallAreaBox(BigDecimal.ZERO).build();
}
/**
* 获取会员金额业绩盒数表
*
@ -567,7 +408,7 @@ public class CuMemberRetailAchieveServiceImpl extends ServiceImpl<CuMemberRetail
*/
private String getAchieveAndBoxTableName(String date) {
CuMemberSettlePeriod cuMemberSettlePeriod = iCuMemberSettlePeriodService.getCuMemberSettlePeriodByDate(date);
if(ObjectUtil.isNotEmpty(cuMemberSettlePeriod)){
if (ObjectUtil.isNotEmpty(cuMemberSettlePeriod)) {
int period = cuMemberSettlePeriod.getPkId();
return TableNameConstants.CU_MEMBER_AMOUNT_BOX + period;
}
@ -592,7 +433,6 @@ public class CuMemberRetailAchieveServiceImpl extends ServiceImpl<CuMemberRetail
return null;
}
private CuMemberRetailAchieveVO getParam(CuMemberRetailAchieveVO param) {
//上月最后一天的表名
String upLastMonth = DateUtils.beforeMonthLastDateStr(new Date());
@ -687,7 +527,7 @@ public class CuMemberRetailAchieveServiceImpl extends ServiceImpl<CuMemberRetail
assert bigAndSmallRangeVO != null;
return vo.getPkId().equals(bigAndSmallRangeVO.getBigRangeId());
}).findFirst().orElse(null);
if(ObjectUtil.isNotEmpty(bigRange)){
if (ObjectUtil.isNotEmpty(bigRange)) {
bigMouthPV = bigRange.getCurrentMonthPv();
}
BigDecimal smallMountPV = totalMouthPV.subtract(bigMouthPV);
@ -705,7 +545,7 @@ public class CuMemberRetailAchieveServiceImpl extends ServiceImpl<CuMemberRetail
param.setLastMonthTableName(getDayTableName(param.getLastMonthDate()));
log.info("MarketDynamicsQueryDateParam : {}", JSONUtil.toJsonStr(param));
List<Long> pkMemberList = baseMapper.selectDirectPushByPkMember(pkMember, systemType);
if(CollUtil.isEmpty(pkMemberList)){
if (CollUtil.isEmpty(pkMemberList)) {
return new PageResult<MarketDynamicsDetailVO>(0, new ArrayList<>());
}
param.setPkIdList(pkMemberList);
@ -716,7 +556,7 @@ public class CuMemberRetailAchieveServiceImpl extends ServiceImpl<CuMemberRetail
private String getDayTableName(String localDate) {
CuMemberSettlePeriod cuMemberSettlePeriod = iCuMemberSettlePeriodService.getCuMemberSettlePeriodByDate(localDate);
if(ObjectUtil.isEmpty(cuMemberSettlePeriod)){
if (ObjectUtil.isEmpty(cuMemberSettlePeriod)) {
return TableNameConstants.CU_MEMBER_RETAIL_RANGE;
}
int period = cuMemberSettlePeriod.getPkId();
@ -732,10 +572,7 @@ public class CuMemberRetailAchieveServiceImpl extends ServiceImpl<CuMemberRetail
private Boolean isActivate(Long pkMember) {
CuMember cuMember = iCuMemberService.queryMember(pkMember);
Integer enableStatus = cuMember.getIsActivate();
if (null != enableStatus && enableStatus.equals(EYesNo.YES.getIntValue())) {
return true;
}
return false;
return null != enableStatus && enableStatus.equals(EYesNo.YES.getIntValue());
}
/**

View File

@ -1,6 +1,5 @@
package com.hzs.retail.member.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hzs.common.core.constant.*;
@ -13,7 +12,6 @@ import com.hzs.common.domain.system.base.BdArea;
import com.hzs.common.security.utils.SecurityUtils;
import com.hzs.retail.member.mapper.CuMemberRetailRegionMapper;
import com.hzs.retail.member.param.RetailMemberRegionParam;
import com.hzs.retail.member.service.ICuMemberRetailAchieveService;
import com.hzs.retail.member.service.ICuMemberRetailRegionService;
import com.hzs.retail.member.vo.UnboundAreaVO;
import lombok.extern.slf4j.Slf4j;
@ -31,9 +29,6 @@ import java.util.List;
@Service
public class CuMemberRetailRegionServiceImpl extends ServiceImpl<CuMemberRetailRegionMapper, CuMemberRetailRegion> implements ICuMemberRetailRegionService {
@Autowired
private ICuMemberRetailAchieveService iCuMemberRetailAchieveService;
@Autowired
private RedisService redisService;
@ -99,80 +94,6 @@ public class CuMemberRetailRegionServiceImpl extends ServiceImpl<CuMemberRetailR
return baseMapper.memberretailRegList(mrrExt);
}
@Override
public void checkRegion() {
// 需要处理的会员列表
List<CuMemberRetailRegionExt> memberList = baseMapper.listCheckRegionMember();
if (CollectionUtil.isNotEmpty(memberList)) {
memberList.parallelStream().forEach(tmpMember -> {
if (ENoticeWebsiteType.ADMIN.getValue() == tmpMember.getSource()) {
log.info("定时任务区域有效, 会员 {} 后台配置,不取消收益区域", tmpMember.getPkId());
return;
}
// 当前时间
Date nowDate = new Date();
if (tmpMember.getGradeValue() < EGrade.S_VIP.getValue()) {
// 会员等级不足V5需要关掉收益区域
log.info("定时任务区域有效, 会员 {} 等级 {} 不足取消收益区域", tmpMember.getPkId(), tmpMember.getGradeValue());
this.update(Wrappers.<CuMemberRetailRegion>lambdaUpdate()
.eq(CuMemberRetailRegion::getPkMember, tmpMember.getPkId())
.eq(CuMemberRetailRegion::getEffective, EYesNo.YES.getIntValue())
.set(CuMemberRetailRegion::getEffective, EYesNo.NO.getIntValue())
.set(CuMemberRetailRegion::getPkModified, tmpMember.getPkId())
.set(CuMemberRetailRegion::getModifiedTime, nowDate)
);
} else {
// // 获取小市场业绩
// CuMemberRetailAchieveVO retailAchieve = iCuMemberRetailAchieveService.selectMemberSumAchieve(tmpMember.getPkId(), CountryConstants.CHINA_COUNTRY, tmpMember.getSystemType());
// if (retailAchieve.getSmallAreaPv().compareTo(BigDecimal.ZERO) <= 0) {
// // 正常有区域业绩肯定达标由2万突然变0基本不可能此处暂时不处理
// log.info("定时任务区域有效, 会员 {} 小市场业绩归0暂时不取消收益区域", tmpMember.getPkId());
// return;
// }
// // 2025.02.07 确认需求如果是历史已经升上去的还是走老逻辑只校验小市场
// String checkDate = "2025-02-10 00:00:00";
// if (EEnv.TEST.getValue().equals(HzsConfig.getEnv())) {
// checkDate = "2025-02-07 00:00:00";
// }
// if (tmpMember.getCreationTime().compareTo(DateUtils.parseDateOne(checkDate, DateUtils.YYYY_MM_DD_HH_MM_SS)) > 0) {
// if (retailAchieve.getSmallAreaPv().multiply(new BigDecimal("10000")).compareTo(SysConstants.SMALL_AREA_PV) < 0
// || retailAchieve.getBigArealPv().multiply(new BigDecimal("10000")).compareTo(SysConstants.SMALL_AREA_PV) < 0
// ) {
// // 大市场小市场业绩小于2万需要取消收益区域
// log.info("2.定时任务区域有效, 会员 {} 小市场业绩 {} 取消收益区域", tmpMember.getPkId(), retailAchieve.getSmallAreaPv());
// if (EEnv.TEST.getValue().equals(HzsConfig.getEnv())) {
// this.update(Wrappers.<CuMemberRetailRegion>lambdaUpdate()
// .eq(CuMemberRetailRegion::getPkMember, tmpMember.getPkId())
// .eq(CuMemberRetailRegion::getEffective, EYesNo.YES.getIntValue())
// .set(CuMemberRetailRegion::getEffective, EYesNo.NO.getIntValue())
// .set(CuMemberRetailRegion::getPkModified, tmpMember.getPkId())
// .set(CuMemberRetailRegion::getModifiedTime, nowDate)
// );
// }
// }
// } else {
// if (retailAchieve.getSmallAreaPv().multiply(new BigDecimal("10000")).compareTo(SysConstants.SMALL_AREA_PV) < 0) {
// // 小市场业绩小于2万需要取消收益区域
// log.info("1.定时任务区域有效, 会员 {} 小市场业绩 {} 取消收益区域", tmpMember.getPkId(), retailAchieve.getSmallAreaPv());
// if (EEnv.TEST.getValue().equals(HzsConfig.getEnv())) {
// this.update(Wrappers.<CuMemberRetailRegion>lambdaUpdate()
// .eq(CuMemberRetailRegion::getPkMember, tmpMember.getPkId())
// .eq(CuMemberRetailRegion::getEffective, EYesNo.YES.getIntValue())
// .set(CuMemberRetailRegion::getEffective, EYesNo.NO.getIntValue())
// .set(CuMemberRetailRegion::getPkModified, tmpMember.getPkId())
// .set(CuMemberRetailRegion::getModifiedTime, nowDate)
// );
// }
// }
// }
}
});
}
}
@Override
public void cancelRegion(List<Long> pkIdList) {
this.update(Wrappers.<CuMemberRetailRegion>lambdaUpdate()

View File

@ -116,7 +116,6 @@
</if>
</select>
<!-- 根据会员编码获取会员账户余额 -->
<select id="selectBalanceByMemberCode" resultType="decimal">
SELECT CASE
@ -145,7 +144,6 @@
WHERE pk_member = #{pkMember}
</select>
<update id="updateMemberAccount">
UPDATE CU_MEMBER_ACCOUNT
SET
@ -235,19 +233,6 @@
</if>
</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 pk_id, pk_member, account_name, decode(account_name, 'ACCOUNT4',
WITHDRAW_ACCOUNT4-lock_withdraw_account4, 0) withdrawBalance,
@ -922,7 +907,6 @@
m.MODIFIED_TIME = sysdate
</update>
<update id="batchUpdateMemberAccountByPkMemberCountry">
MERGE INTO cu_member_account m
USING
@ -989,53 +973,6 @@
#{item.pkMember}
</foreach>
</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 a.pk_member,
@ -1064,25 +1001,6 @@
</if>
</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 pk_id,
decode(account_name, 'ACCOUNT4', WITHDRAW_ACCOUNT4 - lock_withdraw_account4, 0) withdrawBalance,
@ -1217,52 +1135,6 @@
</if>
</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 r.pk_member pkMember,
ma.account4 account4,

View File

@ -34,38 +34,25 @@
<result column="BATCH" property="batch"/>
</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">
SELECT r.*,
m.member_code memberCode,
m.member_name memberName,
bb.bank_name bankName,
b.sub_bank_name subBankName,
b.card_number cardNumber,
b.account_name accountName,
b.id_card idCard,
m.member_code memberCode,
m.member_name memberName,
bb.bank_name bankName,
b.sub_bank_name subBankName,
b.card_number cardNumber,
b.account_name accountName,
nvl(m.id_card, b.id_card) idCard,
b.phone,
b.pk_id pkBdBank,
u.user_name paymentName,
su.user_name approveName,
ver.VERTEX_NAME vertexName,
pa.name accountProvince,
ca.name accountCity,
b.valid_start_date validStartDate,
b.valid_end_date validEndDate,
b.is_long_term isLongTerm
b.pk_id pkBdBank,
u.user_name paymentName,
su.user_name approveName,
ver.VERTEX_NAME vertexName,
pa.name accountProvince,
ca.name accountCity,
b.valid_start_date validStartDate,
b.valid_end_date validEndDate,
b.is_long_term isLongTerm
FROM cu_member_withdraw r
LEFT JOIN cu_member_bank b
ON r.pk_Bank = b.pk_id
@ -158,7 +145,6 @@
<if test="withdrawCode != null and withdrawCode != ''">
and r.WITHDRAW_CODE = #{withdrawCode}
</if>
<if test="status != null">
and r.status = #{status}
</if>

View File

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hzs.retail.member.mapper.CuMemberRetailRangeMapper">
<select id="selectDirectPushByPkMember" resultType="long">
SELECT m.pk_id
from cu_member m
@ -10,14 +11,6 @@
AND m.pk_parent = #{pkMember}
</select>
<select id="selectBigAreaByPkMember" resultType="com.hzs.retail.member.vo.CuMemberRetailAchieveVO">
select * from (
<include refid="selectSmallAreaAchieve"/>
ORDER BY arealPv desc
) t2
where rownum =1
</select>
<sql id="selectSmallAreaAchieve">
<foreach collection="pkMemberList" item="pkMember" separator="union all">
SELECT SUM(t1.arealPv) arealPv ,#{pkMember} pkMember
@ -68,138 +61,10 @@
</foreach>
</sql>
<select id="selectMemberBoxNoWaterInjection" resultType="java.math.BigDecimal">
SELECT nvl(max(smallAreaBox), 0) smallareabox
from
(
<if test="pkMemberList != null and pkMemberList.size > 0">
<include refid="selectMemberDirectPushBox"/>
union all
</if>
SELECT nvl(sum(smallAreaBox), 0) smallAreaBox
FROM (SELECT NVL(mr.consume_box_num, 0) smallAreaBox
FROM ${memberRetailTable} mr
WHERE mr.category = 0
AND mr.pk_member = #{pkMember}
union all
select rs.new_box_num smallAreaBox
from ${memberRetailSTable} rs
where rs.pk_member = #{pkMember})
)
</select>
<select id="selectMemberBoxWaterInjection" resultType="java.math.BigDecimal">
SELECT NVL(mr.big_box_num, 0) smallAreaBox
FROM ${memberRetailTable} mr
WHERE mr.category = 0
AND mr.pk_member = #{pkMember}
</select>
<select id="selectMemberTotalBox" resultType="java.math.BigDecimal">
SELECT nvl(sum(totalAreaBox), 0) totalAreaBox
FROM (SELECT NVL(mr.team_box_num + mr.consume_box_num, 0) totalAreaBox
FROM ${memberRetailTable} mr
WHERE mr.category = 0
AND mr.pk_member = #{pkMember}
union all
select NVL(rs.new_box_num + rs.team_new_box_num, 0) totalAreaBox
from ${memberRetailSTable} rs
where rs.pk_member = #{pkMember})
</select>
<select id="selectMemberOrderByPkMember" resultType="com.hzs.retail.member.vo.CuMemberRetailAchieveVO">
SELECT t0.payTime
FROM (SELECT so.pay_time payTime
FROM sa_order so
WHERE so.del_flag = 0
AND so.order_status = 1
AND so.order_type = 40
AND so.pay_time >= TRUNC(SYSDATE)
AND so.pk_member = #{pkMember}
ORDER BY so.pay_time) t0
WHERE ROWNUM = 1
</select>
<select id="selectMemberParentByPkMember" resultType="com.hzs.retail.member.vo.CuMemberRetailAchieveVO">
<foreach collection="pkMemberList" item="pkMember" separator="union all">
SELECT SUM(t1.arealPv) arealPv , SUM(t1.welfarelPv) welfarelPv,#{pkMember} pkMember
FROM (
SELECT NVL(SUM(so.order_achieve) + SUM(so.order_ass_achieve), 0) arealPv,
NVL(SUM(so.order_achieve) + SUM(so.order_ass_achieve), 0) welfarelPv
FROM sa_order so
WHERE so.del_flag = 0
AND so.order_status = 1
AND so.order_type =40
AND so.pay_time >= #{payTime}
AND so.pk_member IN (
SELECT t0.pk_id
FROM (SELECT m.pk_id,
m.del_flag,
m.category,
m.pay_status,
m.system_type
FROM cu_member m
START WITH m.pk_id = #{pkMember}
CONNECT BY PRIOR m.pk_id = m.pk_parent) t0
WHERE t0.del_flag = 0
AND t0.category = 0)
) t1
</foreach>
</select>
<select id="selectTableNameIsExist" resultType="string">
SELECT table_name FROM user_tables WHERE table_name in
<foreach item="table" collection="tableNames" open="(" separator="," close=")">
#{table}
</foreach>
</select>
<select id="selectMemberAchieve" resultType="com.hzs.retail.member.vo.CuMemberRetailAchieveVO">
<include refid="selectSmallAreaAchieve"/>
</select>
<select id="selectMemberAchieveDetail_bak" resultType="com.hzs.retail.member.vo.CuMemberRetailAchieveVO">
SELECT mr.member_code memberCode,
mr.member_name memberName,
mr.new_consume_pv + mr.team_new_pv yesterdayPv,
mr.consume_pv + mr.team_consume_pv sumPv,
mr.month_consume_pv + mr.team_month_pv monthPv
FROM ${memberRetailTable} mr
WHERE mr.category = 0
AND mr.pay_status = 1
AND mr.pk_member = #{pkMember}
<if test="pkMemberList != null and pkMemberList.size > 0">
union all
SELECT mr.member_code memberCode,
mr.member_name memberName,
mr.new_consume_pv + mr.team_new_pv yesterdayPv,
mr.consume_pv + mr.team_consume_pv sumPv,
mr.month_consume_pv + mr.team_month_pv monthPv
FROM ${memberRetailTable} mr
WHERE mr.category = 0
AND mr.pay_status = 1
<if test="memberName != null and memberName != ''">
and (mr.member_code like #{memberName} || '%' or mr.member_name like #{memberName} || '%')
</if>
AND mr.pk_member in
<foreach collection="pkMemberList" item="item" index="index" open="(" close=")">
<if test="index != 0">
<choose>
<when test="index % 999 == 0">) or mr.pk_member IN (</when>
<otherwise>,</otherwise>
</choose>
</if>
#{item}
</foreach>
ORDER BY sumPv desc
</if>
</select>
<select id="selectMemberAchieveDetail" resultType="com.hzs.retail.member.vo.CuMemberRetailAchieveVO">
SELECT cm.member_code memberCode, cm.member_name memberName,cm.nick_name nickName, t2.yesterdayPv, t2.sumPv,
t2.monthPv,t2.realTimePv, t2.upMonthPv,bg.grade_name grade, ba.awards_name award
@ -417,50 +282,6 @@
)
</select>
<select id="selectWaterInjection" resultType="integer">
SELECT count(1)
FROM (SELECT sr.team_box_num, sr.small_box_num, sr.period_date
FROM cu_member_spe_retail sr
where sr.del_flag = 0
and sr.pk_country = 1
and sr.period_date &lt; TRUNC(SYSDATE)
and sr.member_code = #{memberCode}
ORDER BY sr.period_date desc) t0
where rownum = 1
</select>
<select id="selectMemberActiveState" resultType="integer">
SELECT min(t0.enable_status) enable_status
FROM (SELECT mr.enable_status
FROM ${memberRetailTable} mr
where mr.pk_member = #{pkMember}
union all
SELECT mrs.enable_status
FROM ${memberRetailSTable} mrs
where mrs.pk_member = #{pkMember}) t0
</select>
<!--开始大小区业绩 以累计为准 -->
<select id="selectMemberOrderSumAchieveByPkMember" resultType="com.hzs.retail.member.vo.CuMemberRetailAchieveVO">
SELECT sum(arealPv) arealPv
FROM (SELECT (NVL(mr.CONSUME_PV, 0) + NVL( mr.TEAM_CONSUME_PV, 0 )) arealPv
FROM ${memberRetailTable} mr
WHERE mr.category = 0
AND mr.pk_member = #{pkMember}
union all
SELECT NVL(SUM(so.order_achieve), 0) arealPv
FROM sa_order so
WHERE so.del_flag = 0
AND so.order_status = 1
AND so.order_type in (41, 42, 43, 44)
AND so.system_type = #{systemType}
AND so.pay_time >= TRUNC(SYSDATE)
AND so.pk_member = #{pkMember})
</select>
<sql id="selectSmallAreaSumAchieveBak">
<foreach collection="pkMemberList" item="pkMember" separator="union all">
SELECT SUM(t1.arealPv) arealPv ,#{pkMember} pkMember
@ -492,6 +313,7 @@
AND t0.category = 0)) t1
</foreach>
</sql>
<sql id="selectSmallAreaSumAchieve">
<foreach collection="pkMemberList" item="pkMember" separator="union all">
SELECT SUM(t1.arealPv) arealPv ,#{pkMember} pkMember
@ -510,14 +332,10 @@
</foreach>
</sql>
<select id="selectMemberSumAchieve" resultType="com.hzs.retail.member.vo.CuMemberRetailAchieveVO">
<include refid="selectSmallAreaSumAchieve"/>
</select>
<!--结束 大小区业绩 以累计为准 -->
<!--市场动态盒数 开始-->
<select id="selectMemberBigSmallBox" resultType="com.hzs.retail.member.vo.CuMemberRetailAchieveVO">
SELECT nvl(sum(bigAreaBox), 0) bigAreaBox, nvl(sum(smallAreaBox), 0) smallAreaBox
@ -567,6 +385,7 @@
from ${memberRetailSTable} rs
where rs.pk_member = #{pkBigMember}) t0
</sql>
<!--查询小市场的盒数-->
<sql id="selectSmallAreaBoxByMember">
SELECT 0 bigAreaBox, nvl(sum(box), 0) smallAreaBox
@ -670,6 +489,7 @@
#{item}
</foreach>
</sql>
<!--查询当月业绩-->
<sql id="selectMonthBox">
<if test="isFirst != null and isFirst == 0">
@ -762,6 +582,7 @@
#{item}
</foreach>
</sql>
<select id="selectMemberBigBoxList" resultType="com.hzs.retail.member.vo.CuMemberRetailAchieveVO">
SELECT cm.member_code, cm.member_name,cm.nick_name, t3.yesterdayBox, t3.realTimeBox,
t3.monthBox,t3.upMonthBox,cm.pk_id
@ -793,7 +614,6 @@
on cm.pk_awards = ba.pk_id
</select>
<select id="selectMemberSmallBoxList" resultType="com.hzs.retail.member.vo.CuMemberRetailAchieveVO">
SELECT cm.member_code, cm.member_name,cm.nick_name, t3.yesterdayBox, t3.realTimeBox,
t3.monthBox,t3.upMonthBox,cm.pk_id
@ -827,15 +647,6 @@
</select>
<!--市场动态盒数 结束-->
<select id="selectSubMemberIdByRootMember" resultType="java.lang.Long">
select cm.pk_id, cm.MEMBER_NAME
from cu_member cm
where cm.SYSTEM_TYPE = #{systemType}
start with cm.pk_id = #{pkMember}
connect by prior cm.pk_id = cm.pk_parent
order by level
</select>
<select id="getRetailDataStatisticsDetail"
resultType="com.hzs.retail.member.vo.CuMemberRetailDataStatisticsDetailVO">
SELECT
@ -854,7 +665,6 @@
NVL( mr.BIG_BOX_NUM, 0 ) bigBoxNum,
NVL( mr.SMALL_BOX_NUM, 0 ) smallBoxNum,
NVL( mrs.ALL_NEW_BOX_NUM, 0 ) sNewBoxNum,
NVL( mrs.ALL_TEAM_NEW_BOX_NUM, 0 ) sTeamNewBoxNum,
NVL( mrs.ALL_NEW_CONSUME_PV, 0 ) sNewConsumePv,
@ -872,6 +682,7 @@
</if>
</where>
</select>
<select id="getMarketDynamicsDetail" resultType="com.hzs.retail.member.vo.MarketDynamicsDetailVO">
SELECT
cu.pk_id,
@ -908,4 +719,5 @@
</where>
order by totalBoxNum desc, todayPv desc, cu.CREATION_TIME desc, cu.pk_id asc
</select>
</mapper>

View File

@ -208,18 +208,6 @@
order by CRR.CREATION_TIME desc
</select>
<!-- 重新判断收益区域数据 -->
<select id="listCheckRegionMember" resultType="com.hzs.common.domain.retail.member.ext.CuMemberRetailRegionExt">
select cmrr.pk_member, cmrr.source, bg.grade_value, cmrr.creation_time, cmrr.system_type
from cu_member_retail_region cmrr
inner join cu_member cm
on cm.pk_id = cmrr.pk_member
left join bd_grade bg
on bg.pk_id = cm.pk_settle_grade
where cmrr.del_flag = 0
and cmrr.effective = 0
</select>
<!-- 会员购买订单数量 -->
<select id="getOrderCount" resultType="int">
select count(1)

View File

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

View File

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

View File

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

View File

@ -1,53 +1,24 @@
package com.hzs.system.config.provider;
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.BdWithdrawalAuto;
import com.hzs.system.config.IAccountServiceApi;
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 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
* 提现配置的dubbo服务类
*/
@DubboService
public class WithdrawalServiceProvider implements IWithdrawalServiceApi {
@Autowired
private IBdWithdrawalService withdrawalService;
private IBdWithdrawalService iBdWithdrawalService;
/**
* @description: 根据国家查询提现配置明细列表
* @author: zhang jing
* @date: 2022/9/27 15:08
* @param: [pkCountry]
* @return: com.hzs.common.core.domain.R<java.util.List < com.hzs.common.domain.system.config.BdWithdrawal>>
**/
@Override
public R<BdWithdrawal> queryWithdrawal(Integer pkCountry,Integer pkAccount) {
return R.ok(withdrawalService.queryWithdrawal(pkCountry,pkAccount));
public R<BdWithdrawal> queryWithdrawal(Integer pkCountry, Integer pkAccount) {
return R.ok(iBdWithdrawalService.queryWithdrawal(pkCountry, pkAccount));
}
/**
* @description: 查询所有自动提现的配置
* @author: zhang jing
* @date: 2022/11/1 19:43
* @param: []
* @return: com.hzs.common.core.domain.R<java.util.List < com.hzs.common.domain.system.config.BdWithdrawal>>
**/
@Override
public R<List<BdWithdrawal>> queryWithdrawalByIsAuto() {
return R.ok(withdrawalService.queryWithdrawalByIsAuto());
}
}

View File

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

View File

@ -1,6 +1,5 @@
package com.hzs.system.config.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hzs.common.domain.system.config.BdWithdrawal;
import com.hzs.common.domain.system.config.ext.BdWithdrawalAutoExt;
@ -9,76 +8,37 @@ import com.hzs.common.domain.system.config.ext.BdWithdrawalExt;
import java.util.List;
/**
* <p>
* 提现设置主表 服务类
* </p>
*
* @author zhangjing
* @since 2022-08-29
*/
public interface IBdWithdrawalService extends IService<BdWithdrawal> {
/**
* @description: 根据国家查询提现配置明细列表
* @author: zhang jing
* @date: 2022/9/27 15:08
* @param: [pkCountry]
* @return: java.util.List<com.hzs.common.domain.system.config.BdWithdrawal>
* 根据国家查询提现配置明细列表
**/
BdWithdrawal queryWithdrawal(Integer pkCountry,Integer pkAccount);
BdWithdrawal queryWithdrawal(Integer pkCountry, Integer pkAccount);
/**
* @description: 新增提现
* @author: zhang jing
* @date: 2022/10/31 15:11
* @param: [withdrawalExt]
* @return: boolean
* 新增提现
**/
boolean saveWithdrawal(BdWithdrawalExt withdrawalExt);
/**
* @description: 修改提现
* @author: zhang jing
* @date: 2022/10/31 15:11
* @param: [withdrawalExt]
* @return: boolean
* 修改提现
**/
boolean updateWithdrawal(BdWithdrawalExt withdrawalExt);
/**
* @description: 查询自动提现明细
* @author: zhang jing
* @date: 2022/10/31 15:12
* @param: [withdrawalAutoExt]
* @return: java.util.List<com.hzs.common.domain.system.config.ext.BdWithdrawalAutoExt>
* 查询自动提现明细
**/
List<BdWithdrawalAutoExt> getWithdrawalAutoList(BdWithdrawalAutoExt withdrawalAutoExt);
/**
* @description: 查询配置自动提现的配置
* @author: zhang jing
* @date: 2022/11/1 19:41
* @param:
* @return:
* 查询会员提价表是否有数据
**/
List<BdWithdrawal> queryWithdrawalByIsAuto();
Integer checkWithdraw(BdWithdrawalAutoExt withdrawalAutoExt);
/**
* @description: 查询会员提价表是否有数据
* @author: zhang jing
* @date: 2023/3/16 11:06
* @param: [withdrawalAutoExt]
* @return: java.lang.Integer
**/
Integer checkWithdraw (BdWithdrawalAutoExt withdrawalAutoExt);
/**
* @description: 查询提现配置列表
* @author: zhang jing
* @date: 2024/6/17 16:27
* @param: [withdrawalExt]
* @return: java.util.List<com.hzs.common.domain.system.config.ext.BdWithdrawalExt>
* 查询提现配置列表
**/
List<BdWithdrawalExt> listExt(BdWithdrawalExt withdrawalExt);

View File

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

View File

@ -1,14 +1,9 @@
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.core.conditions.update.UpdateWrapper;
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.EYesNo;
import com.hzs.common.core.service.RedisService;
import com.hzs.common.core.utils.DateUtils;
import com.hzs.common.domain.system.config.BdWithdrawal;
import com.hzs.common.domain.system.config.BdWithdrawalAuto;
import com.hzs.common.domain.system.config.ext.BdWithdrawalAutoExt;
@ -25,150 +20,71 @@ import java.util.Date;
import java.util.List;
/**
* <p>
* 提现设置主表 服务实现类
* </p>
*
* @author zhangjing
* @since 2022-08-29
*/
@Service
public class BdWithdrawalServiceImpl extends ServiceImpl<BdWithdrawalMapper, BdWithdrawal> implements IBdWithdrawalService {
private RedisService redisService;
@Autowired
public void setRedisService(RedisService redisService) {
this.redisService = redisService;
}
@Autowired
IBdWithdrawalAutoService withdrawalAutoService;
private IBdWithdrawalAutoService iBdWithdrawalAutoService;
/**
* @description: 根据国家查询提现配置列表
* @author: zhang jing
* @date: 2022/9/27 15:04
* @param: [pkCountry]
* @return: java.util.List<com.hzs.common.domain.system.config.BdWithdrawal>
**/
@Override
public BdWithdrawal queryWithdrawal(Integer pkCountry,Integer pkAccount) {
public BdWithdrawal queryWithdrawal(Integer pkCountry, Integer pkAccount) {
BdWithdrawal withdrawal = new BdWithdrawal();
List<BdWithdrawal> withdrawallist = baseMapper.queryWithdrawal(pkCountry,pkAccount);
if(CollectionUtil.isNotEmpty(withdrawallist)){
withdrawal= withdrawallist.get(0);
}
List<BdWithdrawal> withdrawallist = baseMapper.queryWithdrawal(pkCountry, pkAccount);
if (CollectionUtil.isNotEmpty(withdrawallist)) {
withdrawal = withdrawallist.get(0);
}
return withdrawal;
}
/**
* @description: 查询自动提现的提现周期
* @author: zhang jing
* @date: 2022/11/1 19:24
* @param: [pkCountry]
* @return: com.hzs.common.domain.system.config.BdWithdrawal
**/
@Override
public List<BdWithdrawal> queryWithdrawalByIsAuto() {
QueryWrapper<BdWithdrawal> queryWrapper = new QueryWrapper();
queryWrapper.eq("IS_AUTO", EYesNo.YES.getIntValue());
queryWrapper.le("EFFECTIVE_DATE", DateUtils.currentDateTime());
return baseMapper.selectList(queryWrapper);
}
/**
* @description: 查询会员提价表是否有数据
* @author: zhang jing
* @date: 2023/3/16 11:06
* @param: [withdrawalAutoExt]
* @return: java.lang.Integer
**/
@Override
public Integer checkWithdraw(BdWithdrawalAutoExt withdrawalAutoExt) {
return baseMapper.checkWithdraw(withdrawalAutoExt);
}
/**
* @description: 查询提现配置列表
* @author: zhang jing
* @date: 2024/6/17 16:27
* @param: [withdrawalExt]
* @return: java.util.List<com.hzs.common.domain.system.config.ext.BdWithdrawalExt>
**/
@Override
public List<BdWithdrawalExt> listExt(BdWithdrawalExt withdrawalExt) {
return baseMapper.listExt(withdrawalExt);
}
/**
* @description: 新增提现配置
* @author: zhang jing
* @date: 2022/10/31 15:05
* @param: [withdrawalExt]
* @return: boolean
**/
@Override
@Transactional(rollbackFor = Exception.class)
public boolean saveWithdrawal(BdWithdrawalExt withdrawalExt) {
baseMapper.insert(withdrawalExt);
List<BdWithdrawalAutoExt> withdrawalAutoList=withdrawalExt.getWithdrawalAutoList();
for(BdWithdrawalAuto wao :withdrawalAutoList){
List<BdWithdrawalAutoExt> withdrawalAutoList = withdrawalExt.getWithdrawalAutoList();
for (BdWithdrawalAuto wao : withdrawalAutoList) {
wao.setPkWithdrawal(withdrawalExt.getPkId());
wao.setPkCountry(SecurityUtils.getPkCountry());
wao.setPkCreator(SecurityUtils.getUserId());
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;
}
/**
* @description: 修改提现配置
* @author: zhang jing
* @date: 2022/10/31 15:10
* @param: [withdrawalExt]
* @return: boolean
**/
@Override
public boolean updateWithdrawal(BdWithdrawalExt withdrawalExt) {
baseMapper.updateById(withdrawalExt);
UpdateWrapper<BdWithdrawalAuto> updateWrapper=new UpdateWrapper();
updateWrapper.eq("PK_WITHDRAWAL",withdrawalExt.getPkId());
updateWrapper.eq("DEL_FLAG",EDelFlag.UN_DELETE.getValue());
UpdateWrapper<BdWithdrawalAuto> updateWrapper = new UpdateWrapper<>();
updateWrapper.eq("PK_WITHDRAWAL", withdrawalExt.getPkId());
updateWrapper.eq("DEL_FLAG", EDelFlag.UN_DELETE.getValue());
updateWrapper.set("DEL_FLAG", EDelFlag.DELETE.getValue());
withdrawalAutoService.update(updateWrapper);
List<BdWithdrawalAutoExt> withdrawalAutoList=withdrawalExt.getWithdrawalAutoList();
for(BdWithdrawalAuto wao :withdrawalAutoList){
iBdWithdrawalAutoService.update(updateWrapper);
List<BdWithdrawalAutoExt> withdrawalAutoList = withdrawalExt.getWithdrawalAutoList();
for (BdWithdrawalAuto wao : withdrawalAutoList) {
wao.setPkWithdrawal(withdrawalExt.getPkId());
wao.setPkCountry(SecurityUtils.getPkCountry());
wao.setPkCreator(SecurityUtils.getUserId());
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;
}
/**
* @description: 查询自动提现明细
* @author: zhang jing
* @date: 2022/10/31 14:56
* @param: [withdrawalAutoExt]
* @return: java.util.List<com.hzs.common.domain.system.config.ext.BdWithdrawalAutoExt>
**/
@Override
public List<BdWithdrawalAutoExt> getWithdrawalAutoList(BdWithdrawalAutoExt withdrawalAutoExt) {
return baseMapper.getWithdrawalAutoList(withdrawalAutoExt);
}
}

View File

@ -2393,7 +2393,7 @@ public class EnumsController extends BaseController {
public AjaxResult getPaymentStatus() {
List<EnumEntity> enumEntityList = new ArrayList<>();
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);
}

View File

@ -529,10 +529,6 @@ public class EnumsInitController {
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_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

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

View File

@ -1,13 +1,10 @@
package com.hzs.common.core.enums;
import com.hzs.common.core.constant.EnumsPrefixConstants;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* 提现状态枚举
*
* @author: hzs
*/
@AllArgsConstructor
@Getter
@ -16,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),
;
/**
@ -44,9 +41,17 @@ public enum EWithdrawStatus {
* 是否启用0=,1= -- 来源EYesNo
*/
private final int enable;
/**
* 国际化翻译key值
*/
private final String key;
public static String getLabelByValue(Integer value) {
if (null == value) {
return "";
}
for (EWithdrawStatus enums : EWithdrawStatus.values()) {
if (enums.getValue() == value) {
return enums.getLabel();
}
}
return "";
}
}

View File

@ -13,12 +13,7 @@ import lombok.*;
import lombok.experimental.Accessors;
/**
* <p>
* 会员充值表
* </p>
*
* @author hzs
* @since 2022-09-08
*/
@Data
@Builder

View File

@ -14,12 +14,7 @@ import lombok.*;
import lombok.experimental.Accessors;
/**
* <p>
* 会员提现表
* </p>
*
* @author hzs
* @since 2022-09-06
*/
@Data
@Builder

View File

@ -15,12 +15,7 @@ import java.math.BigDecimal;
import java.util.Date;
/**
* <p>
* 提现设置主表
* </p>
*
* @author zhangjing
* @since 2022-08-29
*/
@Data
@EqualsAndHashCode(callSuper = false)

View File

@ -26,16 +26,8 @@ public class CuMemberJob {
iMemberJobServiceApi.insertAccountDetail();
}
/**
* 自动提现
*/
@XxlJob("automaticWithdrawal")
public void automaticWithdrawal() {
iMemberJobServiceApi.automaticWithdrawal();
}
@XxlJob("autoDeleteGarbageData")
public void autoDeleteGarbageData(){
public void autoDeleteGarbageData() {
iMemberJobServiceApi.autoDeleteGarbageData();
}

View File

@ -1,14 +1,12 @@
package com.hzs.third.job;
import com.hzs.activity.pick.IAcRetailPickLogServiceApi;
import com.hzs.bonus.detail.ICuRegionAssessApi;
import com.hzs.common.core.domain.R;
import com.hzs.common.core.utils.DateUtils;
import com.hzs.member.base.IMemberServiceApi;
import com.hzs.member.statis.ICuBonusStatisServiceApi;
import com.hzs.member.statis.ICuBonusVertexStatisServiceApi;
import com.hzs.report.stat.IMemberReportServiceApi;
import com.hzs.retail.member.IMemberRetailApi;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboReference;
@ -26,8 +24,6 @@ public class MemberJob {
@DubboReference
IMemberServiceApi iMemberServiceApi;
@DubboReference
IMemberRetailApi iMemberRetailApi;
@DubboReference
ICuBonusStatisServiceApi iCuBonusStatisServiceApi;
@DubboReference
ICuBonusVertexStatisServiceApi iCuBonusVertexStatisServiceApi;
@ -35,8 +31,6 @@ public class MemberJob {
IAcRetailPickLogServiceApi iAcRetailPickLogServiceApi;
@DubboReference
IMemberReportServiceApi iMemberReportServiceApi;
@DubboReference
ICuRegionAssessApi iCuRegionAssessApi;
/**
* 定时统计奖金拨比
@ -122,27 +116,6 @@ public class MemberJob {
log.info("clear-member-empty-code 开始结束! 共处理:{}", dataCount);
}
/**
* 定时修改到期的零售区域
**/
@XxlJob("retail-region")
public void retailRegion() {
Date date = new Date();
Date startDate = DateUtils.beforeDate(2, ChronoUnit.DAYS, date);
Date endDate = DateUtils.afterDate(1, ChronoUnit.DAYS, date);
//批量修改已到期的会员收益区域
iCuRegionAssessApi.validateHandAreaAssess(startDate, endDate);
}
/**
* 定时校验会员收益区域
*/
@XxlJob("checkRegion")
public void checkRegion() {
// 定时校验会员收益区域
iMemberRetailApi.checkRegion();
}
/**
* 每月10号处理上个月提货赠送活动满足活动规则的数据
**/