refactor(mall): 重构会员充值相关功能
- 移除未使用的枚举类导入
- 添加系统充值地址和类型相关的数据字典枚举
- 修改会员充值逻辑,支持 TRC 和 BSC 两种充值类型
- 新增资金流水记录相关功能
- 优化会员等级更新逻辑
- 调整充值信息接口返回值
| | |
| | | CHARGE_TYPE_BSC("CHARGE_TYPE", "CHARGE_TYPE_BSC"), |
| | | |
| | | //系统充值失效时间 |
| | | CHARGE_SYS_FAIL_TIME("CHARGE_SYS_FAIL_TIME", "CHARGE_SYS_FAIL_TIME"), |
| | | CHARGE_SYS_FAIL_TIME("CHARGE_TYPE", "CHARGE_SYS_FAIL_TIME"), |
| | | |
| | | //系统充值地址 |
| | | CHARGE_SYS_ADDRESS("CHARGE_SYS_ADDRESS", "CHARGE_SYS_ADDRESS"), |
| | | CHARGE_SYS_ADDRESS_TRC("CHARGE_TYPE", "CHARGE_SYS_ADDRESS_TRC"), |
| | | |
| | | //系统充值地址 |
| | | CHARGE_SYS_ADDRESS_BSC("CHARGE_TYPE", "CHARGE_SYS_ADDRESS_BSC"), |
| | | |
| | | //碳币兑换USDT的手续费率 |
| | | RUN_VIP_BALANCE_TO_COIN_PERCENT("RUN_VIP_BALANCE_TO_COIN_PERCENT", "RUN_VIP_BALANCE_TO_COIN_PERCENT"), |
| | | RUN_VIP_BALANCE_TO_COIN_PERCENT("CHARGE_TYPE", "RUN_VIP_BALANCE_TO_COIN_PERCENT"), |
| | | |
| | | //碳币兑换USDT的最小数 |
| | | RUN_VIP_BALANCE_TO_COIN_MIN("RUN_VIP_BALANCE_TO_COIN_MIN", "RUN_VIP_BALANCE_TO_COIN_MIN"), |
| | | RUN_VIP_BALANCE_TO_COIN_MIN("CHARGE_TYPE", "RUN_VIP_BALANCE_TO_COIN_MIN"), |
| | | |
| | | //碳币兑换USDT的比值,如果为0.5,则表示1碳币兑换0.5个USDT |
| | | RUN_VIP_BALANCE_TO_COIN("RUN_VIP_BALANCE_TO_COIN", "RUN_VIP_BALANCE_TO_COIN"), |
| | | RUN_VIP_BALANCE_TO_COIN("CHARGE_TYPE", "RUN_VIP_BALANCE_TO_COIN"), |
| | | |
| | | //用户碳积分兑换碳币的比值 如果为0.5,则表示1积分兑换0.5个碳币 |
| | | RUN_VIP_SCORE_TO_BALANCE("RUN_VIP_SCORE_TO_BALANCE", "RUN_VIP_SCORE_TO_BALANCE"), |
| | | RUN_VIP_SCORE_TO_BALANCE("CHARGE_TYPE", "RUN_VIP_SCORE_TO_BALANCE"), |
| | | |
| | | //用户碳积分兑换碳币的最小兑换数值 |
| | | RUN_VIP_SCORE_MIN("RUN_VIP_SCORE_MIN", "RUN_VIP_SCORE_MIN"); |
| | | RUN_VIP_SCORE_MIN("CHARGE_TYPE", "RUN_VIP_SCORE_MIN"); |
| | | |
| | | private String type; |
| | | |
| | |
| | | public enum RunVipMoneyFlowTypeEnum { |
| | | |
| | | /** |
| | | * 系统拨付碳积分 |
| | | */ |
| | | SYS_SCORE(8,"系统拨付碳积分{}","系统拨付碳积分"), |
| | | |
| | | /** |
| | | * 系统拨付碳币 |
| | | */ |
| | | SYS_BALANCE(7,"系统拨付碳币{}","系统拨付碳币"), |
| | | |
| | | /** |
| | | * 购买VIP返利 |
| | | */ |
| | | BUY_VIP_REBATE(6,"{}购买{},返利{}碳币"), |
| | | BUY_VIP_REBATE(6,"{}购买{},返利{}碳币","用户返利碳币"), |
| | | |
| | | /** |
| | | * 碳币提现 |
| | | */ |
| | | BALANCE_OUT(5,"{}碳币兑换{}USDT,手续费{}USDT"), |
| | | BALANCE_OUT(5,"{}碳币兑换{}USDT,手续费{}USDT","碳币提现"), |
| | | |
| | | /** |
| | | * 碳积分兑换碳币 |
| | | */ |
| | | SCORE_OUT_BALANCE_IN(4,"{}碳积分兑换{}碳币"), |
| | | SCORE_OUT_BALANCE_IN(4,"{}碳积分兑换{}碳币","获得碳币"), |
| | | |
| | | /** |
| | | * 碳积分兑换碳币 |
| | | */ |
| | | SCORE_OUT_BALANCE(3,"{}碳积分兑换{}碳币"), |
| | | SCORE_OUT_BALANCE(3,"{}碳积分兑换{}碳币","碳积分兑换"), |
| | | |
| | | /** |
| | | * 碳币转赠好友-转入 |
| | | */ |
| | | BALANCE_IN_GIVE_FRIEND(2,"获得好友{},{}碳币"), |
| | | BALANCE_IN_GIVE_FRIEND(2,"获得好友{},{}碳币","碳币转赠好友-转入"), |
| | | |
| | | /** |
| | | * 碳币转赠好友-转出 |
| | | */ |
| | | BALANCE_OUT_GIVE_FRIEND(1,"转赠好友{},{}碳币"); |
| | | BALANCE_OUT_GIVE_FRIEND(1,"转赠好友{},{}碳币","碳币转赠好友-转出"); |
| | | |
| | | private final int value; |
| | | private final String description; |
| | | private final String typeDec; |
| | | |
| | | RunVipMoneyFlowTypeEnum(int value,String description) { |
| | | RunVipMoneyFlowTypeEnum(int value,String description,String typeDec) { |
| | | |
| | | this.value = value; |
| | | this.description = description; |
| | | this.typeDec = typeDec; |
| | | } |
| | | } |
| | |
| | | return; |
| | | } |
| | | String sysAddress = dataDictionaryCustomMapper.selectDicDataByTypeAndCode( |
| | | RunVipDataDictionaryEnum.CHARGE_SYS_ADDRESS.getType(), RunVipDataDictionaryEnum.CHARGE_SYS_ADDRESS.getCode() |
| | | RunVipDataDictionaryEnum.CHARGE_SYS_ADDRESS_BSC.getType(), RunVipDataDictionaryEnum.CHARGE_SYS_ADDRESS_BSC.getCode() |
| | | ).getValue(); |
| | | String type = dataDictionaryCustomMapper.selectDicDataByTypeAndCode( |
| | | RunVipDataDictionaryEnum.CHARGE_TYPE_BSC.getType(), RunVipDataDictionaryEnum.CHARGE_TYPE_BSC.getCode() |
| | |
| | | public void chainBlockUpdate() { |
| | | log.info("TRC20同步"); |
| | | String sysAddress = dataDictionaryCustomMapper.selectDicDataByTypeAndCode( |
| | | RunVipDataDictionaryEnum.CHARGE_SYS_ADDRESS.getType(), RunVipDataDictionaryEnum.CHARGE_SYS_ADDRESS.getCode() |
| | | RunVipDataDictionaryEnum.CHARGE_SYS_ADDRESS_TRC.getType(), RunVipDataDictionaryEnum.CHARGE_SYS_ADDRESS_TRC.getCode() |
| | | ).getValue(); |
| | | String type = dataDictionaryCustomMapper.selectDicDataByTypeAndCode( |
| | | RunVipDataDictionaryEnum.CHARGE_TYPE_TRC.getType(), RunVipDataDictionaryEnum.CHARGE_TYPE_TRC.getCode() |
| | |
| | | private final IAdminRunVipService iAdminRunVipService; |
| | | private final MallMemberMapper mallMemberMapper; |
| | | |
| | | @GetMapping(value = "/allMoneyType") |
| | | public FebsResponse allMoneyType() { |
| | | return new FebsResponse().success().data(iAdminRunVipService.allMoneyType()); |
| | | } |
| | | |
| | | @GetMapping(value = "/allVipList") |
| | | public FebsResponse allVipList() { |
| | | return new FebsResponse().success().data(iAdminRunVipService.list()); |
| | |
| | | import cc.mrbird.febs.mall.dto.ApiGoChargeDto; |
| | | import cc.mrbird.febs.mall.dto.ApiGoChargeInfoDto; |
| | | import cc.mrbird.febs.mall.service.IRunVipService; |
| | | import cc.mrbird.febs.mall.vo.ApiChargeInfoVo; |
| | | import cc.mrbird.febs.mall.vo.ApiChargeVo; |
| | | import cc.mrbird.febs.mall.vo.ApiGoChargeVo; |
| | | import cc.mrbird.febs.mall.vo.ApiRunVipVo; |
| | |
| | | return new FebsResponse().success().data(iRunVipService.vipInfo()); |
| | | } |
| | | |
| | | @ApiOperation(value = "【购买VIP】基本数据", notes = "【余额充值】基本数据") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "success", response = ApiChargeInfoVo.class) |
| | | }) |
| | | @GetMapping(value = "/getChargeInfo") |
| | | public FebsResponse getChargeInfo() { |
| | | return iRunVipService.getChargeInfo(); |
| | | } |
| | | |
| | | @ApiOperation(value = "【购买VIP】列表", notes = "【余额充值】列表") |
| | | @ApiOperation(value = "【购买VIP】列表", notes = "【购买VIP】列表") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "success", response = ApiChargeVo.class) |
| | | }) |
| | |
| | | return iRunVipService.goCharge(apiGoChargeDto); |
| | | } |
| | | |
| | | @ApiOperation(value = "【购买VIP】马上支付", notes = "【余额充值】马上支付") |
| | | @ApiOperation(value = "【购买VIP】马上支付", notes = "【购买VIP】马上支付") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "success", response = ApiGoChargeVo.class) |
| | | }) |
| | |
| | | private Long memberId; |
| | | private String orderNo; |
| | | private Integer state;//2-进行中 1-成功 0-失败 |
| | | private String type;//1-trc 2-erc |
| | | private String type;//trc erc |
| | | private String address; |
| | | private BigDecimal amount; |
| | | private Date failTime; |
| | |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * 序号越小,等级越低 |
| | | */ |
| | | @Data |
| | | @TableName("run_vip") |
| | | public class RunVip extends BaseEntity { |
| | |
| | | package cc.mrbird.febs.mall.quartz; |
| | | |
| | | import cc.mrbird.febs.common.enumerates.AgentLevelEnum; |
| | | import cc.mrbird.febs.common.enumerates.MoneyFlowTypeEnum; |
| | | import cc.mrbird.febs.common.utils.MallUtils; |
| | | import cc.mrbird.febs.mall.entity.MallMember; |
| | | import cc.mrbird.febs.mall.entity.MallMoneyFlow; |
| | | import cc.mrbird.febs.mall.mapper.MallMemberMapper; |
| | | import cc.mrbird.febs.mall.mapper.MallMoneyFlowMapper; |
| | | import cc.mrbird.febs.mall.service.IApiMallMemberService; |
| | | import cc.mrbird.febs.mall.service.IApiMallMemberWalletService; |
| | | import cc.mrbird.febs.mall.service.IMemberProfitService; |
| | | import cc.mrbird.febs.mall.service.impl.CommonService; |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import cn.hutool.core.date.DateTime; |
| | | import cn.hutool.core.date.DateUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author wzy |
| | | * @date 2021-09-28 |
| | | **/ |
| | | @Slf4j |
| | | @Component |
| | | @ConditionalOnProperty(prefix = "system", name = "job", havingValue = "true") |
| | |
| | | @Autowired |
| | | private IMemberProfitService memberProfitService; |
| | | |
| | | // /** |
| | | // * 代理分红 |
| | | // */ |
| | | // @Scheduled(cron = "0 30 0 * * ?") |
| | | // public void profitJob() { |
| | | // memberProfitService.agentProfit(null); |
| | | // } |
| | | // |
| | | // @Scheduled(cron = "0 30 1 * * ?") |
| | | // public void storeAndDirectorJob() { |
| | | // memberProfitService.storeAndDirectorProfit(null); |
| | | // } |
| | | // |
| | | // /** |
| | | // * 感恩奖 |
| | | // */ |
| | | // @Scheduled(cron = "0 0 1 * * ?") |
| | | // public void thankfulJob() { |
| | | // memberProfitService.thankfulProfit(null); |
| | | // } |
| | | // |
| | | // |
| | | // /** |
| | | // * 静态分红 |
| | | // */ |
| | | // @Scheduled(cron = "0 0 0 * * ?") |
| | | // public void staticProfitJob() { |
| | | // memberProfitService.staticProfit(null); |
| | | // } |
| | | // |
| | | // /** |
| | | // * 排名奖 每月1号 |
| | | // */ |
| | | // @Scheduled(cron = "0 30 0 1 * ?") |
| | | // public void rankJob() { |
| | | // memberProfitService.rankProfit(); |
| | | // } |
| | | /** |
| | | * 套餐过期后,更新用户为游客等级 |
| | | */ |
| | | @Scheduled(cron = "0 0 0 * * ?") |
| | | public void updateMemberLevel() { |
| | | memberProfitService.updateMemberLevel(); |
| | | } |
| | | } |
| | |
| | | import cc.mrbird.febs.common.entity.QueryRequest; |
| | | import cc.mrbird.febs.mall.entity.MallCharge; |
| | | import cc.mrbird.febs.mall.entity.MallMemberWithdraw; |
| | | import cc.mrbird.febs.mall.entity.MallMoneyFlow; |
| | | import cc.mrbird.febs.mall.entity.RunVip; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface IAdminRunVipService extends IService<RunVip> { |
| | | |
| | |
| | | FebsResponse sellAgree(Integer state, Long id); |
| | | |
| | | IPage<MallMemberWithdraw> sellList(MallMemberWithdraw mallMemberWithdraw, QueryRequest request); |
| | | |
| | | List<MallMoneyFlow> allMoneyType(); |
| | | } |
| | |
| | | |
| | | void addMoneyFlow(Long memberId, BigDecimal amount, Integer type, String orderNo, Long rtMemberId, Integer flowType); |
| | | |
| | | void runVipMoneyFlowAdd( |
| | | Long memberId, Long rtMemberId, String orderNo,Integer flowType, Integer type, BigDecimal amount, String description, Integer status); |
| | | |
| | | } |
| | |
| | | void storeAndDirectorProfit(Date profitDate); |
| | | |
| | | void getOrderCoupon(Long orderId); |
| | | |
| | | void updateMemberLevel(); |
| | | } |
| | |
| | | |
| | | FebsResponse goChargeInfo(ApiGoChargeInfoDto apiGoChargeInfoDto); |
| | | |
| | | FebsResponse getChargeInfo(); |
| | | |
| | | List<ApiChargeVo> getChargeList(ApiChargeListDto apiChargeListDto); |
| | | } |
| | |
| | | |
| | | import cc.mrbird.febs.common.entity.FebsResponse; |
| | | import cc.mrbird.febs.common.entity.QueryRequest; |
| | | import cc.mrbird.febs.common.enumerates.AgentLevelEnum; |
| | | import cc.mrbird.febs.common.enumerates.MoneyFlowTypeEnum; |
| | | import cc.mrbird.febs.common.enumerates.YesOrNoEnum; |
| | | import cc.mrbird.febs.common.enumerates.*; |
| | | import cc.mrbird.febs.common.exception.FebsException; |
| | | import cc.mrbird.febs.common.utils.AppContants; |
| | | import cc.mrbird.febs.common.utils.MallUtils; |
| | |
| | | } |
| | | |
| | | Integer type = mallSystemPayDto.getType(); |
| | | Integer flowType = 0; |
| | | Integer moneyType = 0; |
| | | String moneyTypeDec = ""; |
| | | String filedType = ""; |
| | | if (type == 1) { |
| | | filedType = "balance"; |
| | | flowType = FlowTypeEnum.BALANCE.getValue(); |
| | | moneyType = RunVipMoneyFlowTypeEnum.SYS_BALANCE.getValue(); |
| | | moneyTypeDec = RunVipMoneyFlowTypeEnum.SYS_BALANCE.getDescription(); |
| | | } else if (type == 2) { |
| | | filedType = "score"; |
| | | flowType = FlowTypeEnum.SCORE.getValue(); |
| | | moneyType = RunVipMoneyFlowTypeEnum.SYS_SCORE.getValue(); |
| | | moneyTypeDec = RunVipMoneyFlowTypeEnum.SYS_SCORE.getDescription(); |
| | | } else if (type == 3) { |
| | | filedType = "prizeScore"; |
| | | } else { |
| | |
| | | } else { |
| | | iApiMallMemberWalletService.add(mallSystemPayDto.getAddBalance(), mallSystemPayDto.getId(), filedType); |
| | | } |
| | | mallMoneyFlowService.addMoneyFlow(memberId, bigDecimal, MoneyFlowTypeEnum.SYSTEM.getValue(), MallUtils.getOrderNum(), type, null,2); |
| | | String orderNo = MallUtils.getOrderNum("SYS"); |
| | | mallMoneyFlowService.runVipMoneyFlowAdd( |
| | | mallMember.getId(), |
| | | mallMember.getId(), |
| | | orderNo, |
| | | flowType, |
| | | moneyType, |
| | | bigDecimal, |
| | | StrUtil.format(moneyTypeDec,bigDecimal), |
| | | YesOrNoEnum.YES.getValue() |
| | | ); |
| | | return new FebsResponse().success(); |
| | | } |
| | | |
| | |
| | | |
| | | import cc.mrbird.febs.common.entity.FebsResponse; |
| | | import cc.mrbird.febs.common.entity.QueryRequest; |
| | | import cc.mrbird.febs.common.enumerates.RunVipMoneyFlowTypeEnum; |
| | | import cc.mrbird.febs.common.enumerates.YesOrNoEnum; |
| | | import cc.mrbird.febs.common.exception.FebsException; |
| | | import cc.mrbird.febs.mall.entity.MallCharge; |
| | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | @Slf4j |
| | | @Service |
| | |
| | | IPage<MallMemberWithdraw> adminChargeListVoIPage = mallChargeMapper.selectAdminWithdrawListInPage(page, mallMemberWithdraw); |
| | | return adminChargeListVoIPage; |
| | | } |
| | | |
| | | @Override |
| | | public List<MallMoneyFlow> allMoneyType() { |
| | | List<MallMoneyFlow> mallMoneyFlows = new ArrayList<>(); |
| | | RunVipMoneyFlowTypeEnum[] values = RunVipMoneyFlowTypeEnum.values(); |
| | | for (RunVipMoneyFlowTypeEnum value : values) { |
| | | MallMoneyFlow mallMoneyFlow = new MallMoneyFlow(); |
| | | mallMoneyFlow.setType(value.getValue()); |
| | | mallMoneyFlow.setDescription(value.getDescription()); |
| | | mallMoneyFlow.setRemark(value.getTypeDec()); |
| | | mallMoneyFlows.add(mallMoneyFlow); |
| | | } |
| | | |
| | | return mallMoneyFlows; |
| | | } |
| | | } |
| | |
| | | public void addMoneyFlow(Long memberId, BigDecimal amount, Integer type, String orderNo, Long rtMemberId, Integer flowType) { |
| | | this.addMoneyFlow(memberId, amount, type, orderNo, null, null, rtMemberId, null, flowType, null); |
| | | } |
| | | |
| | | @Override |
| | | public void runVipMoneyFlowAdd(Long memberId, Long rtMemberId, String orderNo,Integer flowType, Integer type, BigDecimal amount, String description, Integer status) { |
| | | // 创建一个新的商城资金流水对象 |
| | | MallMoneyFlow flow = new MallMoneyFlow(); |
| | | |
| | | // 设置资金流水的各项属性 |
| | | flow.setMemberId(memberId); |
| | | flow.setRtMemberId(rtMemberId); |
| | | flow.setOrderNo(orderNo); |
| | | flow.setFlowType(flowType); |
| | | flow.setType(type); |
| | | flow.setAmount(amount); |
| | | flow.setDescription(description); |
| | | flow.setStatus(status); |
| | | |
| | | // 插入资金流水记录到数据库 |
| | | this.baseMapper.insert(flow); |
| | | } |
| | | } |
| | |
| | | import cc.mrbird.febs.mall.entity.*; |
| | | import cc.mrbird.febs.mall.mapper.*; |
| | | import cc.mrbird.febs.mall.service.IApiMallMemberWalletService; |
| | | import cc.mrbird.febs.mall.service.IMallAchieveService; |
| | | import cc.mrbird.febs.mall.service.IMallMoneyFlowService; |
| | | import cc.mrbird.febs.mall.service.IMemberProfitService; |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import cn.hutool.core.date.DateField; |
| | | import cn.hutool.core.date.DateUnit; |
| | | import cn.hutool.core.date.DateUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import lombok.RequiredArgsConstructor; |
| | |
| | | private final MallMoneyFlowMapper mallMoneyFlowMapper; |
| | | private final MallAchieveRecordMapper mallAchieveRecordMapper; |
| | | private final MallMemberCouponMapper mallMemberCouponMapper; |
| | | private final RunVipMapper runVipMapper; |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void updateMemberLevel() { |
| | | List<RunVip> runVips = runVipMapper.selectList(new LambdaQueryWrapper<RunVip>().orderByAsc(RunVip :: getOrderNumber)); |
| | | RunVip runVip = runVips.get(0); |
| | | |
| | | //获取过期时间小于等于当前时间,并且会员等级不是最小等级游客的所有用户 |
| | | LambdaQueryWrapper<MallMember> mallMemberLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | mallMemberLambdaQueryWrapper.le(MallMember :: getVipLevelTime,DateUtil.date()); |
| | | mallMemberLambdaQueryWrapper.ne(MallMember :: getLevel,runVip.getVipCode()); |
| | | List<MallMember> mallMembers = mallMemberMapper.selectList(mallMemberLambdaQueryWrapper); |
| | | if(CollUtil.isNotEmpty(mallMembers)){ |
| | | mallMembers.forEach( |
| | | item -> { |
| | | mallMemberMapper.updateVipLevelTimeAndLevel(item.getId(),item.getVipLevelTime(),item.getLevel()); |
| | | } |
| | | ); |
| | | } |
| | | } |
| | | } |
| | |
| | | import cc.mrbird.febs.mall.dto.ApiGoChargeDto; |
| | | import cc.mrbird.febs.mall.dto.ApiGoChargeInfoDto; |
| | | import cc.mrbird.febs.mall.dto.ApiMemberChargeFailDto; |
| | | import cc.mrbird.febs.mall.entity.*; |
| | | import cc.mrbird.febs.mall.entity.MallCharge; |
| | | import cc.mrbird.febs.mall.entity.MallMember; |
| | | import cc.mrbird.febs.mall.entity.MallMemberPayment; |
| | | import cc.mrbird.febs.mall.entity.RunVip; |
| | | import cc.mrbird.febs.mall.mapper.DataDictionaryCustomMapper; |
| | | import cc.mrbird.febs.mall.mapper.MallChargeMapper; |
| | | import cc.mrbird.febs.mall.mapper.MallMemberPaymentMapper; |
| | | import cc.mrbird.febs.mall.mapper.RunVipMapper; |
| | | import cc.mrbird.febs.mall.service.IRunVipService; |
| | | import cc.mrbird.febs.mall.vo.ApiChargeInfoVo; |
| | | import cc.mrbird.febs.mall.vo.ApiChargeVo; |
| | | import cc.mrbird.febs.mall.vo.ApiGoChargeVo; |
| | | import cc.mrbird.febs.mall.vo.ApiRunVipVo; |
| | |
| | | import java.math.BigDecimal; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Slf4j |
| | | @Service |
| | |
| | | return new FebsResponse().fail().message("请先绑定你的地址"); |
| | | } |
| | | |
| | | String sysAddress = dataDictionaryCustomMapper.selectDicDataByTypeAndCode( |
| | | RunVipDataDictionaryEnum.CHARGE_SYS_ADDRESS.getType(), |
| | | RunVipDataDictionaryEnum.CHARGE_SYS_ADDRESS.getCode() |
| | | //判断系统的充值地址 |
| | | String trcType = dataDictionaryCustomMapper.selectDicDataByTypeAndCode( |
| | | RunVipDataDictionaryEnum.CHARGE_TYPE_TRC.getType(), |
| | | RunVipDataDictionaryEnum.CHARGE_TYPE_TRC.getCode() |
| | | ).getValue(); |
| | | String sysAddress = ""; |
| | | if(trcType.equals(mallMemberPayment.getBankNo())){ |
| | | sysAddress = dataDictionaryCustomMapper.selectDicDataByTypeAndCode( |
| | | RunVipDataDictionaryEnum.CHARGE_SYS_ADDRESS_TRC.getType(), |
| | | RunVipDataDictionaryEnum.CHARGE_SYS_ADDRESS_TRC.getCode() |
| | | ).getValue(); |
| | | }else{ |
| | | sysAddress = dataDictionaryCustomMapper.selectDicDataByTypeAndCode( |
| | | RunVipDataDictionaryEnum.CHARGE_SYS_ADDRESS_BSC.getType(), |
| | | RunVipDataDictionaryEnum.CHARGE_SYS_ADDRESS_BSC.getCode() |
| | | ).getValue(); |
| | | } |
| | | String failMinutes = dataDictionaryCustomMapper.selectDicDataByTypeAndCode( |
| | | RunVipDataDictionaryEnum.CHARGE_SYS_FAIL_TIME.getType(), |
| | | RunVipDataDictionaryEnum.CHARGE_SYS_FAIL_TIME.getCode() |
| | |
| | | apiGoChargeVo.setAddress(mallCharge.getAddress()); |
| | | apiGoChargeVo.setAmount(mallCharge.getAmount()); |
| | | apiGoChargeVo.setSysAddress(mallCharge.getSysAddress()); |
| | | apiGoChargeVo.setSysAddressType(mallCharge.getType()); |
| | | |
| | | /** |
| | | * 充值接口调用后,发送一个延时队列 |
| | |
| | | apiGoChargeVo.setAddress(mallCharge.getAddress()); |
| | | apiGoChargeVo.setAmount(mallCharge.getAmount()); |
| | | apiGoChargeVo.setSysAddress(mallCharge.getSysAddress()); |
| | | apiGoChargeVo.setSysAddressType(mallCharge.getType()); |
| | | return new FebsResponse().success().data(apiGoChargeVo); |
| | | } |
| | | |
| | | @Override |
| | | public FebsResponse getChargeInfo() { |
| | | Long memberId = LoginUserUtil.getLoginUser().getId(); |
| | | ApiChargeInfoVo apiChargeInfoVo = new ApiChargeInfoVo(); |
| | | |
| | | String sysAddress = dataDictionaryCustomMapper.selectDicDataByTypeAndCode( |
| | | RunVipDataDictionaryEnum.CHARGE_SYS_ADDRESS.getType(), |
| | | RunVipDataDictionaryEnum.CHARGE_SYS_ADDRESS.getCode() |
| | | ).getValue(); |
| | | apiChargeInfoVo.setChargeAddress(sysAddress); |
| | | List<DataDictionaryCustom> dataDictionaryCustoms = dataDictionaryCustomMapper.selectDicByType(RunVipDataDictionaryEnum.CHARGE_TYPE_TRC.getType()); |
| | | List<String> coinTypeList = dataDictionaryCustoms.stream().map(DataDictionaryCustom::getValue).collect(Collectors.toList()); |
| | | apiChargeInfoVo.setCoinType(coinTypeList); |
| | | return new FebsResponse().success().data(apiChargeInfoVo); |
| | | } |
| | | |
| | | @Override |
| | |
| | | |
| | | @ApiModelProperty(value = "系统收款地址") |
| | | private String sysAddress; |
| | | |
| | | @ApiModelProperty(value = "系统收款地址类型") |
| | | private String sysAddressType; |
| | | } |
| | |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label layui-form-label-sm">会员类型</label> |
| | | <div class="layui-input-inline"> |
| | | <select name="levelType" class="vip-level-set-level_member"> |
| | | <select name="levelType" class="vip-level-set-level-member"> |
| | | <option value="">请选择</option> |
| | | </select> |
| | | </div> |
| | |
| | | var data = res.data; |
| | | for (var k in data) |
| | | { |
| | | $(".vip-level-set-level_member").append("<option value='" + data[k].vipCode + "'>" + data[k].vipName + "</option>"); |
| | | $(".vip-level-set-level-member").append("<option value='" + data[k].vipCode + "'>" + data[k].vipName + "</option>"); |
| | | } |
| | | layui.use('form', function () { |
| | | var form = layui.form; |
| | |
| | | <div class="layui-col-md10"> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label layui-form-label-sm">用户昵称</label> |
| | | <div class="layui-input-inline"> |
| | | <input type="text" placeholder="用户昵称" name="name" autocomplete="off" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label layui-form-label-sm">手机号码</label> |
| | | <div class="layui-input-inline"> |
| | | <input type="text" placeholder="手机号码" name="phone" autocomplete="off" class="layui-input"> |
| | |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label layui-form-label-sm">流水类型</label> |
| | | <div class="layui-input-inline"> |
| | | <select name="type"> |
| | | <select name="type" class="money-flow-type"> |
| | | <option value="">请选择</option> |
| | | <!-- <option value="1">静态收益</option>--> |
| | | <!-- <option value="2">直推奖</option>--> |
| | | <!-- <option value="3">代理收益</option>--> |
| | | <!-- <option value="4">排名收益</option>--> |
| | | <!-- <option value="5">总监收益</option>--> |
| | | <!-- <option value="6">社区店补</option>--> |
| | | <!-- <option value="7">一代收益</option>--> |
| | | <!-- <option value="8">提现</option>--> |
| | | <!-- <option value="9">转账</option>--> |
| | | <option value="10">余额支付</option> |
| | | <option value="11">余额退款</option> |
| | | <!-- <option value="12">佣金转竞猜积分</option>--> |
| | | <!-- <option value="13">佣金转余额</option>--> |
| | | <!-- <option value="14">竞猜积分签到</option>--> |
| | | <!-- <option value="15">感恩奖</option>--> |
| | | <option value="16">系统拨付</option> |
| | | <!-- <option value="17">抽奖</option>--> |
| | | <option value="18">充值</option> |
| | | <option value="20">赠送金额</option> |
| | | <option value="21">微信支付</option> |
| | | <option value="22">微信退款</option> |
| | | <!-- <option value="19">收益</option>--> |
| | | </select> |
| | | </div> |
| | | </div> |
| | |
| | | <div class="layui-input-inline"> |
| | | <select name="flowType"> |
| | | <option value="">请选择</option> |
| | | <option value="1">余额</option> |
| | | <option value="3">积分</option> |
| | | <option value="1">碳币</option> |
| | | <option value="2">碳积分</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label layui-form-label-sm">开始时间</label> |
| | | <div class="layui-input-inline"> |
| | |
| | | |
| | | form.render(); |
| | | |
| | | //(下拉框) |
| | | $.get(ctx + 'admin/runVip/allMoneyType', function (res) { |
| | | var data = res.data; |
| | | for (var k in data) |
| | | { |
| | | $(".money-flow-type").append("<option value='" + data[k].type + "'>" + data[k].remark + "</option>"); |
| | | } |
| | | layui.use('form', function () { |
| | | var form = layui.form; |
| | | form.render(); |
| | | }); |
| | | }); |
| | | |
| | | // 表格初始化 |
| | | initTable(); |
| | | |
| | |
| | | url: ctx + 'admin/mallMember/getMoneyFlowList', |
| | | totalRow : true, |
| | | cols: [[ |
| | | {field: 'orderNo', title: '订单编号', minWidth: 150,align:'left'}, |
| | | {field: 'name', title: '用户昵称', minWidth: 100,align:'left',totalRowText:"合计"}, |
| | | {field: 'phone', title: '手机号码', minWidth: 150,align:'left'}, |
| | | {field: 'amount', title: '金额', minWidth: 150,align:'left', totalRow:true}, |
| | | {field: 'type', title: '流水类型', |
| | | templet: function (d) { |
| | | if (d.flowType === 3) { |
| | | if (d.type === 1) { |
| | | return '<span>积分支付</span>' |
| | | } else if (d.type === 2) { |
| | | return '<span>购买商品获得积分</span>' |
| | | } else if (d.type === 3) { |
| | | return '<span>推荐下单获得积分</span>' |
| | | } else if (d.type === 16) { |
| | | return '<span>拨付积分</span>' |
| | | }else{ |
| | | return '<span>-</span>' |
| | | } |
| | | } |
| | | if (d.flowType === 5) { |
| | | if (d.type === 21) { |
| | | return '<span>微信支付</span>' |
| | | } else if (d.type === 22) { |
| | | return '<span>微信退款</span>' |
| | | } else{ |
| | | return '<span>-</span>' |
| | | } |
| | | } |
| | | if (d.flowType === 2) { |
| | | if (d.type === 16) { |
| | | return '<span>拨付积分</span>' |
| | | }else{ |
| | | return '<span>-</span>' |
| | | } |
| | | } |
| | | |
| | | if (d.flowType === 1) { |
| | | if (d.type === 1) { |
| | | return '<span>静态收益</span>' |
| | | } else if (d.type === 2) { |
| | | return '<span>直推奖</span>' |
| | | } else if (d.type === 3) { |
| | | return '<span>代理收益</span>' |
| | | } else if (d.type === 4) { |
| | | return '<span>排名收益</span>' |
| | | }else if (d.type === 5) { |
| | | return '<span>总监收益</span>' |
| | | }else if (d.type === 6) { |
| | | return '<span>社区店补</span>' |
| | | }else if (d.type === 7) { |
| | | return '<span>一代收益</span>' |
| | | }else if (d.type === 8) { |
| | | return '<span>提现</span>' |
| | | }else if (d.type === 9) { |
| | | return '<span>转账</span>' |
| | | }else if (d.type === 10) { |
| | | return '<span>余额支付</span>' |
| | | }else if (d.type === 11) { |
| | | return '<span>退款</span>' |
| | | }else if (d.type === 12) { |
| | | return '<span>佣金转竞猜积分</span>' |
| | | }else if (d.type === 13) { |
| | | return '<span>佣金转余额</span>' |
| | | }else if (d.type === 14) { |
| | | return '<span>竞猜积分签到</span>' |
| | | }else if (d.type === 15) { |
| | | return '<span>感恩奖</span>' |
| | | }else if (d.type === 16) { |
| | | return '<span>拨付余额</span>' |
| | | }else if (d.type === 17) { |
| | | return '<span>抽奖</span>' |
| | | }else if (d.type === 18) { |
| | | return '<span>充值</span>' |
| | | }else if (d.type === 19) { |
| | | return '<span>收益</span>' |
| | | }else if (d.type === 20) { |
| | | return '<span>赠送金额</span>' |
| | | }else if (d.type === 21) { |
| | | return '<span>微信支付</span>' |
| | | }else if (d.type === 22) { |
| | | return '<span>微信退款</span>' |
| | | }else{ |
| | | return '<span>-</span>' |
| | | } |
| | | } |
| | | }, minWidth: 80,align:'center'}, |
| | | {field: 'description', title: '流水类型', minWidth: 150,align:'left', totalRow:true}, |
| | | {field: 'flowType', title: '资金类型', |
| | | templet: function (d) { |
| | | if (d.flowType === 1) { |
| | | return '余额'; |
| | | } else if(d.flowType === 3) { |
| | | return '积分' |
| | | return '碳币'; |
| | | } else if(d.flowType === 2) { |
| | | return '系统' |
| | | } else if(d.flowType === 5) { |
| | | return '微信' |
| | | return '碳积分' |
| | | } else { |
| | | return '-'; |
| | | } |
| | | }, minWidth: 80,align:'center'}, |
| | | {field: 'orderNo', title: '订单编号', minWidth: 150,align:'left'}, |
| | | {field: 'createdTime', title: '创建时间', minWidth: 180,align:'center'} |
| | | ]] |
| | | }); |
| | |
| | | return { |
| | | startTime: $searchForm.find('input[name="startTime"]').val().trim(), |
| | | endTime: $searchForm.find('input[name="endTime"]').val().trim(), |
| | | name: $searchForm.find('input[name="name"]').val().trim(), |
| | | phone: $searchForm.find('input[name="phone"]').val().trim(), |
| | | type: $searchForm.find("select[name='type']").val(), |
| | | flowType: $searchForm.find("select[name='flowType']").val(), |