25 files modified
1 files added
| | |
| | | /** |
| | | * 董事 |
| | | */ |
| | | V_DIRECTOR("V_DIRECTOR",8), |
| | | V_DIRECTOR("V_DIRECTOR",8,"董事"), |
| | | /** |
| | | * v1-v6 |
| | | * V1 个体户,V2 经销商,V3 区代理,V4 市代理,V5 省代理,V6 运营中心 |
| | | */ |
| | | V6("V6",7), |
| | | V5("V5",6), |
| | | V4("V4",5), |
| | | V3("V3",4), |
| | | V2("V2",3), |
| | | V1("V1",2), |
| | | V6("V6",7,"运营中心"), |
| | | V5("V5",6,"省代理"), |
| | | V4("V4",5,"市代理"), |
| | | V3("V3",4,"区代理"), |
| | | V2("V2",3,"经销商"), |
| | | V1("V1",2,"个体户"), |
| | | //普通用户 |
| | | NORMAL("NORMAL",1), |
| | | NORMAL("NORMAL",1,"普通会员"), |
| | | //粉丝非会员 |
| | | FANS("FANS",0); |
| | | FANS("FANS",0,"粉丝"); |
| | | |
| | | |
| | | private String type; |
| | | |
| | | private Integer code; |
| | | private String description; |
| | | |
| | | MemberLevelEnum(String type, Integer code) { |
| | | MemberLevelEnum(String type, Integer code,String description) { |
| | | this.type = type; |
| | | this.code = code; |
| | | this.description = description; |
| | | } |
| | | |
| | | public List<String> getLevelType(){ |
| | |
| | | return strs; |
| | | } |
| | | |
| | | public String getLevelDescription(String Level){ |
| | | String description = "粉丝"; |
| | | for (MemberLevelEnum value : MemberLevelEnum.values()) { |
| | | if(value.type.equals(Level)){ |
| | | description = value.description; |
| | | } |
| | | } |
| | | return description; |
| | | } |
| | | |
| | | public int getLevelCode(String Level){ |
| | | int codeOne = 0; |
| | | for (MemberLevelEnum value : MemberLevelEnum.values()) { |
| | |
| | | /** |
| | | * 代理积分补贴 |
| | | */ |
| | | AGENT_SCORE_PERK(25); |
| | | AGENT_SCORE_PERK(25), |
| | | |
| | | /** |
| | | * 积分转余额 |
| | | */ |
| | | SCORE_TO_CASH(26); |
| | | |
| | | private final int value; |
| | | |
| | |
| | | @Getter |
| | | public enum PerkEnum { |
| | | /** |
| | | * 转换的30%金额回流到积分池现金 |
| | | */ |
| | | WITHDRAW_SCORE_CASH_PERCENT("PERK_SET","WITHDRAW_SCORE_CASH_PERCENT"), |
| | | /** |
| | | * 积分池积分价格 = 积分池现金 / 积分池积分 |
| | | */ |
| | | POOL_SCORE_PRICE("PERK_SET", "POOL_SCORE_PRICE"), |
| | |
| | | PerkEnum.POOL_SCORE_PRICE.getType(), |
| | | PerkEnum.POOL_SCORE_PRICE.getCode(), |
| | | adminPoolSetVo.getPoolScorePrice()); |
| | | commonService.updateDataDic( |
| | | PerkEnum.WITHDRAW_SCORE_CASH_PERCENT.getType(), |
| | | PerkEnum.WITHDRAW_SCORE_CASH_PERCENT.getCode(), |
| | | adminPoolSetVo.getWithdrawScoreCashPercent()); |
| | | return new FebsResponse().success(); |
| | | } |
| | | } |
| | |
| | | return new FebsResponse().success().message("提交成功"); |
| | | } |
| | | |
| | | @ApiOperation(value = "积分转余额") |
| | | @PostMapping(value = "/withdrawalScore") |
| | | public FebsResponse withdrawalScore(@RequestBody @Validated WithdrawalScoreDto withdrawalScoreDto) { |
| | | mallMemberWithdrawService.withdrawalScore(withdrawalScoreDto); |
| | | return new FebsResponse().success().message("提交成功"); |
| | | } |
| | | |
| | | @ApiOperation(value = "设置收款方式") |
| | | @PostMapping(value = "/setPayment") |
| | | public FebsResponse setPayment(@RequestBody MallMemberPayment mallMemberPayment) { |
| | |
| | | return new FebsResponse().success().message("绑定成功"); |
| | | } |
| | | |
| | | @ApiOperation(value = "可提现金额") |
| | | @GetMapping(value = "/canWithdrawal") |
| | | public FebsResponse canWithdrawal() { |
| | | return new FebsResponse().success().data(memberService.canMoney()); |
| | | @ApiOperation(value = "可提现金额 1:余额 2:积分") |
| | | @GetMapping(value = "/canWithdrawal/{type}") |
| | | public FebsResponse canWithdrawal(@PathVariable("type") int type) { |
| | | return new FebsResponse().success().data(memberService.canMoney(type)); |
| | | } |
| | | |
| | | @ApiOperation(value = "用户消费排名") |
| | |
| | | if (poolScorePercentDic != null) { |
| | | adminPoolSetVo.setPoolScorePercent(poolScorePercentDic.getValue()); |
| | | } |
| | | DataDictionaryCustom withdrawScoreCashPercentDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode( |
| | | PerkEnum.WITHDRAW_SCORE_CASH_PERCENT.getType(), |
| | | PerkEnum.WITHDRAW_SCORE_CASH_PERCENT.getCode()); |
| | | if (withdrawScoreCashPercentDic != null) { |
| | | adminPoolSetVo.setWithdrawScoreCashPercent(withdrawScoreCashPercentDic.getValue()); |
| | | } |
| | | |
| | | model.addAttribute("adminPoolSet", adminPoolSetVo); |
| | | return FebsUtil.view("modules/system/poolSet"); |
| | |
| | | private String phone; |
| | | |
| | | private Integer status; |
| | | |
| | | private Integer type; |
| | | } |
New file |
| | |
| | | package cc.mrbird.febs.mall.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.Min; |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | import java.math.BigDecimal; |
| | | |
| | | @Data |
| | | @ApiModel(value = "WithdrawalScoreDto", description = "接收参数类") |
| | | public class WithdrawalScoreDto { |
| | | |
| | | @Min(0) |
| | | @NotNull(message = "参数不能为空") |
| | | @ApiModelProperty(value = "数量") |
| | | private BigDecimal amount; |
| | | |
| | | @NotBlank(message = "参数不能为空") |
| | | @ApiModelProperty(value = "交易密码") |
| | | private String tradePwd; |
| | | |
| | | } |
| | |
| | | private String withdrawNo; |
| | | |
| | | private String remark; |
| | | //提现类型 1:余额提现 2:积分提现 |
| | | private int type; |
| | | |
| | | private BigDecimal scoreCnt; |
| | | |
| | | private BigDecimal scorePrice; |
| | | } |
| | |
| | | |
| | | BigDecimal selectProfitByDateAndMemberId(Long memberId); |
| | | |
| | | BigDecimal selectCommissionIncome(@Param("type") Integer type, @Param("date") Date date, @Param("memberId") Long memebrid); |
| | | BigDecimal selectCommissionIncome(@Param("flowType") Integer flowType, @Param("type") Integer type, @Param("date") Date date, @Param("memberId") Long memebrid); |
| | | |
| | | BigDecimal selectThankfulCommission(@Param("date") Date date, @Param("memberId") Long memberId); |
| | | } |
| | |
| | | |
| | | void bindPhone(AccountAndCodeDto accountAndCodeDto); |
| | | |
| | | BigDecimal canMoney(); |
| | | BigDecimal canMoney(int type); |
| | | |
| | | List<MallMember> findRankList(RankListDto rankListDto); |
| | | |
| | |
| | | package cc.mrbird.febs.mall.service; |
| | | |
| | | import cc.mrbird.febs.mall.dto.WithdrawalDto; |
| | | import cc.mrbird.febs.mall.dto.WithdrawalScoreDto; |
| | | import cc.mrbird.febs.mall.entity.MallMemberWithdraw; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | public interface IMallMemberWithdrawService extends IService<MallMemberWithdraw> { |
| | | |
| | | void withdrawal(WithdrawalDto withdrawalDto); |
| | | |
| | | void withdrawalScore(WithdrawalScoreDto withdrawalScoreDto); |
| | | } |
| | |
| | | |
| | | 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.FlowTypeEnum; |
| | | import cc.mrbird.febs.common.enumerates.MemberLevelEnum; |
| | | import cc.mrbird.febs.common.enumerates.MoneyFlowTypeEnum; |
| | | import cc.mrbird.febs.common.enumerates.*; |
| | | import cc.mrbird.febs.common.exception.FebsException; |
| | | import cc.mrbird.febs.common.utils.LoginUserUtil; |
| | | import cc.mrbird.febs.common.utils.MallUtils; |
| | |
| | | mallMoneyFlow.setStatus(2); |
| | | mallMoneyFlowMapper.updateById(mallMoneyFlow); |
| | | } |
| | | |
| | | /** |
| | | * 调用汇聚代付 |
| | | */ |
| | |
| | | poolCash.toString() |
| | | ); |
| | | |
| | | |
| | | DataDictionaryCustom poolScorePriceDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode( |
| | | PerkEnum.POOL_SCORE_PRICE.getType(), |
| | | PerkEnum.POOL_SCORE_PRICE.getCode()); |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.lang.reflect.Member; |
| | | import java.math.BigDecimal; |
| | | import java.util.*; |
| | | |
| | |
| | | if (payment != null) { |
| | | mallMemberVo.setHasPayment(1); |
| | | } |
| | | mallMemberVo.setLevelName(mallMember.getLevel()); |
| | | mallMemberVo.setLevelName(MemberLevelEnum.NORMAL.getLevelDescription(mallMember.getLevel())); |
| | | mallMemberVo.setPartner(mallMember.getPartner()); |
| | | MallMemberWallet wallet = mallMemberWalletMapper.selectWalletByMemberId(mallMemberVo.getId()); |
| | | mallMemberVo.setBalance(wallet.getBalance()); |
| | |
| | | MallMember mallMember = this.baseMapper.selectById(memberId); |
| | | |
| | | List<TeamListVo> list = this.baseMapper.selectTeamListByInviteId(mallMember.getInviteId()); |
| | | if(CollUtil.isNotEmpty(list)){ |
| | | for(TeamListVo teamListVo : list){ |
| | | String levelDescription = MemberLevelEnum.NORMAL.getLevelDescription(teamListVo.getLevel()); |
| | | teamListVo.setLevelName(levelDescription); |
| | | } |
| | | } |
| | | |
| | | MyTeamVo myTeamVo = new MyTeamVo(); |
| | | myTeamVo.setTeam(list); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public BigDecimal canMoney() { |
| | | public BigDecimal canMoney(int type) { |
| | | Long memberId = LoginUserUtil.getLoginUser().getId(); |
| | | MallMemberWallet wallet = mallMemberWalletMapper.selectWalletByMemberId(memberId); |
| | | BigDecimal profit = mallMoneyFlowMapper.selectProfitByDateAndMemberId(memberId); |
| | | |
| | | BigDecimal canMoney = wallet.getCommission(); |
| | | if (profit != null) { |
| | | if(canMoney.compareTo(BigDecimal.ZERO) > 0) { |
| | | canMoney = canMoney.subtract(profit); |
| | | } |
| | | BigDecimal canMoney = BigDecimal.ZERO; |
| | | if(1 == type){ |
| | | canMoney = wallet.getBalance(); |
| | | } |
| | | if(2 == type){ |
| | | canMoney = wallet.getScore(); |
| | | } |
| | | return canMoney; |
| | | } |
| | |
| | | } |
| | | |
| | | MallMemberWallet wallet = mallMemberWalletMapper.selectWalletByMemberId(id); |
| | | commissionVo.setCommission(wallet.getCommission()); |
| | | commissionVo.setToday(mallMoneyFlowMapper.selectCommissionIncome(1, new Date(), id)); |
| | | commissionVo.setMonth(mallMoneyFlowMapper.selectCommissionIncome(2, new Date(), id)); |
| | | commissionVo.setTotal(mallMoneyFlowMapper.selectCommissionIncome(null, null, id)); |
| | | commissionVo.setWaitCommission(BigDecimal.ZERO); |
| | | commissionVo.setCommissionBalance(wallet.getBalance()); |
| | | commissionVo.setCommissionScore(wallet.getScore()); |
| | | commissionVo.setTodayBalance(mallMoneyFlowMapper.selectCommissionIncome(1,1, new Date(), id)); |
| | | commissionVo.setMonthBalance(mallMoneyFlowMapper.selectCommissionIncome(1,2, new Date(), id)); |
| | | commissionVo.setTotalBalance(mallMoneyFlowMapper.selectCommissionIncome(1, null,null, id)); |
| | | commissionVo.setTodayScore(mallMoneyFlowMapper.selectCommissionIncome(2, 1,new Date(), id)); |
| | | commissionVo.setMonthScore(mallMoneyFlowMapper.selectCommissionIncome(2, 2,new Date(), id)); |
| | | commissionVo.setTotalScore(mallMoneyFlowMapper.selectCommissionIncome(2, null,null, id)); |
| | | return commissionVo; |
| | | } |
| | | |
| | |
| | | if (orderInfo.getOrderType() != 2) { |
| | | throw new FebsException("非积分订单,无法使用积分支付"); |
| | | } |
| | | payResultStr = balancePay(orderInfo, payOrderDto.getTradePwd(), "prizeScore"); |
| | | payResultStr = balancePay(orderInfo, payOrderDto.getTradePwd(), "score"); |
| | | |
| | | orderInfo.setPayOrderNo(orderInfo.getOrderNo()); |
| | | orderInfo.setPayMethod("积分支付"); |
| | |
| | | orderInfo.setPayTime(new Date()); |
| | | orderInfo.setPayResult("1"); |
| | | |
| | | mallMoneyFlowService.addMoneyFlow(member.getId(), orderInfo.getAmount().negate(), MoneyFlowTypeEnum.PAY.getValue(), orderInfo.getOrderNo(), FlowTypeEnum.PRIZE_SCORE.getValue()); |
| | | mallMoneyFlowService.addMoneyFlow(member.getId(), orderInfo.getAmount().negate(), MoneyFlowTypeEnum.PAY.getValue(), orderInfo.getOrderNo(), FlowTypeEnum.SCORE.getValue()); |
| | | break; |
| | | case "5": |
| | | // AgreementSignDto agreementSignDto = new AgreementSignDto(); |
| | |
| | | import cc.mrbird.febs.common.enumerates.DataDictionaryEnum; |
| | | import cc.mrbird.febs.common.enumerates.FlowTypeEnum; |
| | | import cc.mrbird.febs.common.enumerates.MoneyFlowTypeEnum; |
| | | import cc.mrbird.febs.common.enumerates.PerkEnum; |
| | | import cc.mrbird.febs.common.exception.FebsException; |
| | | import cc.mrbird.febs.common.utils.AppContants; |
| | | import cc.mrbird.febs.common.utils.LoginUserUtil; |
| | | import cc.mrbird.febs.common.utils.MallUtils; |
| | | import cc.mrbird.febs.mall.dto.WithdrawalDto; |
| | | import cc.mrbird.febs.mall.dto.WithdrawalScoreDto; |
| | | import cc.mrbird.febs.mall.entity.*; |
| | | import cc.mrbird.febs.mall.mapper.*; |
| | | import cc.mrbird.febs.mall.service.IApiMallMemberService; |
| | |
| | | withdraw.setStatus(1); |
| | | withdraw.setAmountFee(serviceFee.multiply(withdrawalDto.getAmount())); |
| | | withdraw.setWtihdrawTypeId(mallMemberBank.getId()); |
| | | withdraw.setType(1); |
| | | this.baseMapper.insert(withdraw); |
| | | |
| | | mallMemberService.addMoneyFlow(memberId, |
| | |
| | | 1, |
| | | FlowTypeEnum.BALANCE.getValue()); |
| | | } |
| | | |
| | | @Override |
| | | public void withdrawalScore(WithdrawalScoreDto withdrawalScoreDto) { |
| | | Long memberId = LoginUserUtil.getLoginUser().getId(); |
| | | MallMember mallMember = mallMemberService.getById(memberId); |
| | | if (StrUtil.isBlank(mallMember.getTradePassword())) { |
| | | throw new FebsException("未设置支付密码"); |
| | | } |
| | | |
| | | if (!mallMember.getTradePassword().equals(SecureUtil.md5(withdrawalScoreDto.getTradePwd()))) { |
| | | throw new FebsException("支付密码错误"); |
| | | } |
| | | |
| | | DataDictionaryCustom poolScorePriceDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(PerkEnum.POOL_SCORE_PRICE.getType(), |
| | | PerkEnum.POOL_SCORE_PRICE.getCode()); |
| | | //积分价格 |
| | | BigDecimal poolScorePrice = new BigDecimal(poolScorePriceDic.getValue()); |
| | | |
| | | DataDictionaryCustom withDrawScoreCashPercentDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(PerkEnum.WITHDRAW_SCORE_CASH_PERCENT.getType(), |
| | | PerkEnum.WITHDRAW_SCORE_CASH_PERCENT.getCode()); |
| | | //提现的30%金额回流到积分池现金 |
| | | BigDecimal withDrawScoreCashPercent = new BigDecimal(withDrawScoreCashPercentDic.getValue()).multiply(AppContants.PERCENTAGE); |
| | | |
| | | MallMemberWallet wallet = mallMemberWalletMapper.selectWalletByMemberId(memberId); |
| | | if(wallet.getScore().compareTo(BigDecimal.ZERO) <= 0){ |
| | | throw new FebsException("积分不足"); |
| | | } |
| | | if(withdrawalScoreDto.getAmount().compareTo(wallet.getScore()) > 0) { |
| | | throw new FebsException("积分不足"); |
| | | } |
| | | //积分减少 |
| | | walletService.reduce(withdrawalScoreDto.getAmount(), memberId, "score"); |
| | | String orderNo = MallUtils.getOrderNum("W"); |
| | | |
| | | BigDecimal scoreAmount = withdrawalScoreDto.getAmount().multiply(poolScorePrice).setScale(2, BigDecimal.ROUND_DOWN); |
| | | BigDecimal amountFee = scoreAmount.multiply(withDrawScoreCashPercent).setScale(2,BigDecimal.ROUND_DOWN); |
| | | //余额增加 |
| | | walletService.add(scoreAmount.subtract(amountFee), memberId, "balance"); |
| | | |
| | | MallMemberWithdraw withdraw = new MallMemberWithdraw(); |
| | | withdraw.setWithdrawNo(orderNo); |
| | | withdraw.setMemberId(memberId); |
| | | withdraw.setAmount(scoreAmount); |
| | | withdraw.setStatus(2); |
| | | withdraw.setAmountFee(amountFee); |
| | | withdraw.setType(2); |
| | | withdraw.setScoreCnt(withdrawalScoreDto.getAmount()); |
| | | withdraw.setScorePrice(poolScorePrice); |
| | | this.baseMapper.insert(withdraw); |
| | | |
| | | mallMemberService.addMoneyFlow(memberId, |
| | | withdrawalScoreDto.getAmount().negate(), |
| | | MoneyFlowTypeEnum.SCORE_TO_CASH.getValue(), |
| | | orderNo, |
| | | null, |
| | | null, |
| | | null, |
| | | 1, |
| | | FlowTypeEnum.SCORE.getValue()); |
| | | |
| | | //卖出规则:卖出即销毁减少,70%现金到帐.30%回流底池,意味卖出后全网积分变少了,回流的30%到池子后.积分的价格变高了 |
| | | DataDictionaryCustom poolCashDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode( |
| | | PerkEnum.POOL_CASH.getType(), |
| | | PerkEnum.POOL_CASH.getCode() |
| | | ); |
| | | BigDecimal poolCash = new BigDecimal(poolCashDic.getValue()); |
| | | poolCash = poolCash.add(amountFee); |
| | | dataDictionaryCustomMapper.updateDicValueByTypeAndCode( |
| | | PerkEnum.POOL_CASH.getType(), |
| | | PerkEnum.POOL_CASH.getCode(), |
| | | poolCash.toString() |
| | | ); |
| | | |
| | | DataDictionaryCustom poolScoreDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode( |
| | | PerkEnum.POOL_SCORE.getType(), |
| | | PerkEnum.POOL_SCORE.getCode() |
| | | ); |
| | | BigDecimal poolScore = new BigDecimal(poolScoreDic.getValue()); |
| | | poolScore = poolScore.subtract(withdraw.getScoreCnt()); |
| | | dataDictionaryCustomMapper.updateDicValueByTypeAndCode( |
| | | PerkEnum.POOL_SCORE.getType(), |
| | | PerkEnum.POOL_SCORE.getCode(), |
| | | poolScore.toString() |
| | | ); |
| | | |
| | | if(poolScore.compareTo(BigDecimal.ZERO) > 0 && poolCash.compareTo(BigDecimal.ZERO) > 0){ |
| | | BigDecimal divide = poolCash.divide(poolScore, 2, BigDecimal.ROUND_DOWN); |
| | | dataDictionaryCustomMapper.updateDicValueByTypeAndCode( |
| | | PerkEnum.POOL_SCORE_PRICE.getType(), |
| | | PerkEnum.POOL_SCORE_PRICE.getCode(), |
| | | divide.toString() |
| | | ); |
| | | } |
| | | } |
| | | } |
| | |
| | | private String phone; |
| | | |
| | | private String bindPhone; |
| | | |
| | | private String remark; |
| | | |
| | | private Integer type; |
| | | |
| | | private BigDecimal scoreCnt; |
| | | |
| | | private BigDecimal scorePrice; |
| | | } |
| | |
| | | * 套餐进去积分池积分比例 |
| | | */ |
| | | private String poolScorePercent; |
| | | |
| | | /** |
| | | * 转换的30%金额回流到积分池现金 |
| | | */ |
| | | private String withdrawScoreCashPercent; |
| | | } |
| | |
| | | @ApiModelProperty(value = "累计消费") |
| | | private BigDecimal totalCost; |
| | | |
| | | @ApiModelProperty(value = "赠送积分") |
| | | @ApiModelProperty(value = "积分") |
| | | private BigDecimal score; |
| | | |
| | | @ApiModelProperty(value = "抽奖积分") |
| | |
| | | @ApiModelProperty(value = "推荐人头像") |
| | | private String referrerAvatar; |
| | | |
| | | @ApiModelProperty(value = "可提现") |
| | | private BigDecimal commission; |
| | | @ApiModelProperty(value = "可提现余额") |
| | | private BigDecimal commissionBalance; |
| | | |
| | | @ApiModelProperty(value = "待结算") |
| | | private BigDecimal waitCommission; |
| | | @ApiModelProperty(value = "可提现积分") |
| | | private BigDecimal commissionScore; |
| | | |
| | | @ApiModelProperty(value = "本日收入") |
| | | private BigDecimal today; |
| | | @ApiModelProperty(value = "本日收入余额") |
| | | private BigDecimal todayBalance; |
| | | |
| | | @ApiModelProperty(value = "本月收入") |
| | | private BigDecimal month; |
| | | @ApiModelProperty(value = "本月收入余额") |
| | | private BigDecimal monthBalance; |
| | | |
| | | @ApiModelProperty(value = "累计收入") |
| | | private BigDecimal total; |
| | | @ApiModelProperty(value = "累计收入余额") |
| | | private BigDecimal totalBalance; |
| | | |
| | | @ApiModelProperty(value = "本日收入积分") |
| | | private BigDecimal todayScore; |
| | | |
| | | @ApiModelProperty(value = "本月收入积分") |
| | | private BigDecimal monthScore; |
| | | |
| | | @ApiModelProperty(value = "累计收入积分") |
| | | private BigDecimal totalScore; |
| | | |
| | | |
| | | } |
| | |
| | | private BigDecimal prizeScore; |
| | | |
| | | @ApiModelProperty(value = "用户等级") |
| | | private String level; |
| | | |
| | | @ApiModelProperty(value = "用户等级") |
| | | private String levelName; |
| | | |
| | | } |
| | |
| | | a.name, |
| | | a.phone, |
| | | a.invite_id, |
| | | a.level, |
| | | 2 isCurrent, |
| | | a.created_time, |
| | | p.prize_score, |
| | | u.description levelName, |
| | | (select sum(e.amount) |
| | | from mall_order_info e |
| | | from mall_achieve_record e |
| | | inner join mall_member b on e.member_id=b.ID |
| | | inner join mall_order_item c on e.id = c.order_id -- and c.is_normal=2 |
| | | where e.status in (2, 3, 4) and e.order_type=1 and (b.invite_id=a.invite_id or b.referrer_id=a.invite_id)) amount, |
| | | where (b.invite_id=a.invite_id or b.referrer_id=a.invite_id)) amount, |
| | | (select count(1) from mall_member e |
| | | inner join mall_order_info b on e.id=b.member_id and b.status in (2, 3, 4) |
| | | where find_in_set(a.invite_id, e.referrer_ids)) orderCnt, |
| | | (select count(1) from mall_member x where find_in_set(a.invite_id, x.referrer_ids)) cnt |
| | | from mall_member a |
| | | inner join mall_member_wallet p on a.id=p.member_id |
| | | left join data_dictionary_custom u on a.level=u.code and u.type='AGENT_LEVEL' |
| | | where a.referrer_id=#{inviteId} |
| | | inner join mall_member_wallet p on a.id = p.member_id |
| | | where a.referrer_id = #{inviteId} |
| | | </select> |
| | | |
| | | <select id="selectOwnOrderAmountByInviteId" resultType="java.math.BigDecimal"> |
| | |
| | | a.withdraw_no withdrawNo, |
| | | a.remark remark, |
| | | a.status status, |
| | | a.type type, |
| | | a.score_cnt scoreCnt, |
| | | a.score_price scorePrice, |
| | | b.name, |
| | | b.bind_phone bindPhone, |
| | | b.phone |
| | |
| | | </if> |
| | | <if test="record.status!=null and record.status!=''"> |
| | | and a.status = #{record.status} |
| | | </if> |
| | | <if test="record.type!=null and record.type!=''"> |
| | | and a.type = #{record.type} |
| | | </if> |
| | | </if> |
| | | </where> |
| | |
| | | |
| | | <select id="selectCommissionIncome" resultType="java.math.BigDecimal"> |
| | | select ifnull(sum(amount),0) from mall_money_flow |
| | | where flow_type =4 and type in (1,2,3,4,5,6,7,15,16,17) and member_id=#{memberId} |
| | | where flow_type = #{flowType} and member_id = #{memberId} |
| | | <if test="type == 1"> |
| | | and date_format(created_time, '%Y-%m-%d') = date_format(#{date}, '%Y-%m-%d') |
| | | </if> |
| | |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">类型:</label> |
| | | <div class="layui-input-inline"> |
| | | <select name="type"> |
| | | <option value="">请选择</option> |
| | | <option value="1">余额提现</option> |
| | | <option value="2">积分兑换</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-col-md2 layui-col-sm12 layui-col-xs12 table-action-area"> |
| | |
| | | {field: 'withdrawNo', title: '编号', minWidth: 100,align:'left', totalRowText: '合计:'}, |
| | | {field: 'name', title: '名称', minWidth: 100,align:'left'}, |
| | | {field: 'phone', title: '账号', minWidth: 150,align:'left'}, |
| | | // {field: 'bindPhone', title: '手机号', minWidth: 150,align:'left'}, |
| | | {field: 'type', title: '类型', |
| | | templet: function (d) { |
| | | if (d.type === 1) { |
| | | return '<span style="color:green;">余额提现</span>' |
| | | } else if (d.type === 2) { |
| | | return '<span style="color:blue;">积分兑换</span>' |
| | | } else{ |
| | | return '' |
| | | } |
| | | }, minWidth: 80,align:'center'}, |
| | | {field: 'amount', title: '金额', minWidth: 150,align:'left',totalRow: '{{= parseInt(d.amount) }}'}, |
| | | {field: 'amountFee', title: '手续费', minWidth: 150,align:'left',totalRow: '{{= parseInt(d.amountFee) }}'}, |
| | | // {field: 'remark', title: '错误信息', minWidth: 150,align:'left'}, |
| | | {field: 'scoreCnt', title: '数量', minWidth: 80,align:'left',totalRow: '{{= parseInt(d.scoreCnt) }}'}, |
| | | {field: 'scorePrice', title: '价格', minWidth: 80,align:'left',totalRow: '{{= parseInt(d.scorePrice) }}'}, |
| | | {field: 'status', title: '状态', |
| | | templet: function (d) { |
| | | if (d.status === 1) { |
| | |
| | | +'<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="chargeDisagree" shiro:hasPermission="user:update">拒绝</button>' |
| | | +'<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="paymentInfo" shiro:hasPermission="user:update">查看收款方式</button>' |
| | | }else{ |
| | | return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="paymentInfo" shiro:hasPermission="user:update">查看收款方式</button>' |
| | | return '' |
| | | } |
| | | },minWidth: 300,align:'center'} |
| | | ]] |
| | |
| | | name: $searchForm.find('input[name="name"]').val().trim(), |
| | | phone: $searchForm.find('input[name="phone"]').val().trim(), |
| | | status: $searchForm.find("select[name='status']").val(), |
| | | type: $searchForm.find("select[name='type']").val(), |
| | | }; |
| | | } |
| | | |
| | |
| | | <div class="layui-form-mid layui-word-aux">%,进入积分池。</div> |
| | | </div> |
| | | </div> |
| | | <blockquote class="layui-elem-quote blue-border">积分转换比例设置(转换后,积分池【积分】减少,积分池【现金】增加)</blockquote> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label febs-form-item-require">积分:</label> |
| | | <div class="layui-form-mid layui-word-aux">每次转换积分数量乘积分当前价格后的:</div> |
| | | <div class="layui-input-inline"> |
| | | <input type="text" name="withdrawScoreCashPercent" lay-verify="required" placeholder="请输入数字" autocomplete="off" class="layui-input"> |
| | | </div> |
| | | <div class="layui-form-mid layui-word-aux">%,进入积分现金池。</div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-card-footer"> |
| | |
| | | "poolScore": adminPoolSet.poolScore, |
| | | "poolScorePrice": adminPoolSet.poolScorePrice, |
| | | "poolCashPercent": adminPoolSet.poolCashPercent, |
| | | "withdrawScoreCashPercent": adminPoolSet.withdrawScoreCashPercent, |
| | | "poolScorePercent": adminPoolSet.poolScorePercent |
| | | }); |
| | | } |