From ca7809d5fcf86454118d41c88a3b9c238fe6b270 Mon Sep 17 00:00:00 2001 From: xiaoyong931011 <15274802129@163.com> Date: Sat, 28 May 2022 10:58:49 +0800 Subject: [PATCH] Merge branch 'mall-amz' of http://120.27.238.55:7000/r/xc-mall into mall-amz --- src/main/java/cc/mrbird/febs/rabbit/consumer/AgentConsumer.java | 3 src/main/resources/templates/febs/views/modules/mallMember/agentLevelUpdate-bak.html | 119 +++++++++++ src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallOrderInfoServiceImpl.java | 17 + src/main/resources/templates/error/404.html | 2 src/main/resources/templates/febs/views/modules/mallMember/agentList.html | 12 src/main/java/cc/mrbird/febs/mall/service/impl/AdminMallMemberServiceImpl.java | 33 -- src/main/resources/templates/error/403.html | 2 src/main/java/cc/mrbird/febs/common/enumerates/MoneyFlowTypeEnum.java | 7 src/main/resources/templates/febs/views/modules/mallMember/moneyFlowList.html | 90 ++++++-- src/main/java/cc/mrbird/febs/common/configure/RabbitConfigure.java | 2 src/main/resources/mapper/modules/MallScoreSignRecordMapper.xml | 9 src/main/resources/templates/febs/views/modules/goods/goodsUpdateNew.html | 7 src/main/resources/templates/error/500.html | 2 src/main/java/cc/mrbird/febs/mall/vo/AdminAgentLevelUpdateInfoVo.java | 2 src/main/resources/templates/index.html | 2 src/test/java/cc/mrbird/febs/AgentTest.java | 10 + src/main/java/cc/mrbird/febs/common/runner/FebsStartedUpRunner.java | 2 src/main/java/cc/mrbird/febs/mall/service/impl/ScoreServiceImpl.java | 24 ++ src/main/java/cc/mrbird/febs/mall/vo/NewsListVo.java | 2 src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallMemberServiceImpl.java | 2 src/main/java/cc/mrbird/febs/mall/dto/AgentLevelUpdateDto.java | 2 src/main/resources/templates/febs/views/modules/mallMember/agentLevelUpdate.html | 48 ---- src/main/java/cc/mrbird/febs/mall/service/impl/MemberProfitServiceImpl.java | 89 +++++--- src/main/java/cc/mrbird/febs/pay/service/impl/PayServiceImpl.java | 2 src/main/java/cc/mrbird/febs/mall/quartz/ProfitJob.java | 70 ++---- src/main/java/cc/mrbird/febs/mall/service/IScoreService.java | 3 src/main/java/cc/mrbird/febs/common/enumerates/AgentLevelEnum.java | 12 src/main/java/cc/mrbird/febs/mall/vo/AdminMoneyFlowListVo.java | 2 src/main/resources/templates/febs/views/layout.html | 2 src/main/resources/templates/febs/views/login.html | 4 30 files changed, 366 insertions(+), 217 deletions(-) diff --git a/src/main/java/cc/mrbird/febs/common/configure/RabbitConfigure.java b/src/main/java/cc/mrbird/febs/common/configure/RabbitConfigure.java index 9f477f0..50797b6 100644 --- a/src/main/java/cc/mrbird/febs/common/configure/RabbitConfigure.java +++ b/src/main/java/cc/mrbird/febs/common/configure/RabbitConfigure.java @@ -119,7 +119,7 @@ @Bean public Binding orderReturnMoneyBind() { - return BindingBuilder.bind(agentReturnMoneyQueue()).to(agentReturnMoneyExchange()).with(RabbitQueueEnum.ORDER_RETURN_MONEY.getRoute()); + return BindingBuilder.bind(orderReturnMoneyQueue()).to(orderReturnMoneyExchange()).with(RabbitQueueEnum.ORDER_RETURN_MONEY.getRoute()); } } diff --git a/src/main/java/cc/mrbird/febs/common/enumerates/AgentLevelEnum.java b/src/main/java/cc/mrbird/febs/common/enumerates/AgentLevelEnum.java index 6e73596..784c505 100644 --- a/src/main/java/cc/mrbird/febs/common/enumerates/AgentLevelEnum.java +++ b/src/main/java/cc/mrbird/febs/common/enumerates/AgentLevelEnum.java @@ -9,14 +9,12 @@ @Getter public enum AgentLevelEnum { - ZERO_LEVEL("未激活"), + ZERO_LEVEL("非会员"), FIRST_LEVEL("普通会员"), - SECOND_LEVEL("业务经理"), - THIRD_LEVEL("区域代理"), - FOUR_LEVEL("代理"), - FIFTH_LEVEL("总代"), - SIX_LEVEL("董事"), - SEVEN_LEVEL("股东"); + SECOND_LEVEL("区级代理"), + THIRD_LEVEL("市级代理"), + FOUR_LEVEL("省级代理"), + FIFTH_LEVEL("全国总代"); private String name; diff --git a/src/main/java/cc/mrbird/febs/common/enumerates/MoneyFlowTypeEnum.java b/src/main/java/cc/mrbird/febs/common/enumerates/MoneyFlowTypeEnum.java index d5b8329..789244b 100644 --- a/src/main/java/cc/mrbird/febs/common/enumerates/MoneyFlowTypeEnum.java +++ b/src/main/java/cc/mrbird/febs/common/enumerates/MoneyFlowTypeEnum.java @@ -78,7 +78,12 @@ /** * 感恩奖 */ - THANKFUL(15); + THANKFUL(15), + + /** + * 系统 + */ + SYSTEM(16); private final int value; diff --git a/src/main/java/cc/mrbird/febs/common/runner/FebsStartedUpRunner.java b/src/main/java/cc/mrbird/febs/common/runner/FebsStartedUpRunner.java index 432fb94..d2ebb02 100644 --- a/src/main/java/cc/mrbird/febs/common/runner/FebsStartedUpRunner.java +++ b/src/main/java/cc/mrbird/febs/common/runner/FebsStartedUpRunner.java @@ -63,7 +63,7 @@ log.info("/ /` / / \\ | |\\/| | |_) | | | |_ | | | |_ "); log.info("\\_\\_, \\_\\_/ |_| | |_| |_|__ |_|__ |_| |_|__ "); log.info(" "); - log.info("澳美芝 权限系统启动完毕,地址:{}", url); + log.info("澳芝美 权限系统启动完毕,地址:{}", url); boolean auto = febsProperties.isAutoOpenBrowser(); if (auto && StringUtils.equalsIgnoreCase(active, FebsConstant.DEVELOP)) { diff --git a/src/main/java/cc/mrbird/febs/mall/dto/AgentLevelUpdateDto.java b/src/main/java/cc/mrbird/febs/mall/dto/AgentLevelUpdateDto.java index 8029766..9fadc33 100644 --- a/src/main/java/cc/mrbird/febs/mall/dto/AgentLevelUpdateDto.java +++ b/src/main/java/cc/mrbird/febs/mall/dto/AgentLevelUpdateDto.java @@ -41,4 +41,6 @@ * 团队收益 1-指定金额 2-比例 */ private Integer teamIncomeType; + + private BigDecimal profitProp; } diff --git a/src/main/java/cc/mrbird/febs/mall/quartz/ProfitJob.java b/src/main/java/cc/mrbird/febs/mall/quartz/ProfitJob.java index 87984f8..7b18035 100644 --- a/src/main/java/cc/mrbird/febs/mall/quartz/ProfitJob.java +++ b/src/main/java/cc/mrbird/febs/mall/quartz/ProfitJob.java @@ -9,6 +9,7 @@ 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; @@ -34,54 +35,29 @@ public class ProfitJob { @Autowired - private MallMoneyFlowMapper moneyFlowMapper; + private IMemberProfitService memberProfitService; - @Autowired - private MallMemberMapper memberMapper; - - @Autowired - private IApiMallMemberWalletService memberWalletService; - - @Autowired - private IApiMallMemberService memberService; - - @Scheduled(cron = "0 1 0 * * ?") - @Transactional(rollbackFor = Exception.class) + /** + * 代理分红 + */ + @Scheduled(cron = "0 0 1 * * ?") public void profitJob() { - log.info("推荐人返利执行"); -// DateTime yesterday = DateUtil.yesterday(); -// List<MallMoneyFlow> flows = moneyFlowMapper.selectMoneyFlowProfitByDate(yesterday); -// -// if (CollUtil.isEmpty(flows)) { -// return; -// } -// -// for (MallMoneyFlow flow : flows) { -// MallMember member = memberMapper.selectById(flow.getMemberId()); -// -// List<MallMember> child = memberMapper.selectByIdAndNoLevel(member.getInviteId(), AgentLevelEnum.ZERO_LEVEL.name()); -// if (CollUtil.isEmpty(child)) { -// continue; -// } -// int size = child.size(); -// BigDecimal needReturn = flow.getAmount().multiply(BigDecimal.valueOf(0.1)); -// -// String orderNo = MallUtils.getOrderNum("R"); -// String remarkFormat = "{}, 用户:{}, 利润分红: {}"; -// -// BigDecimal returnMoney = needReturn.divide(BigDecimal.valueOf(size), 2, RoundingMode.DOWN); -// for (MallMember mallMember : child) { -// memberWalletService.addBalance(returnMoney, mallMember.getId()); -// -// String remark = StrUtil.format(remarkFormat, DateUtil.format(yesterday, "yyyy-MM-dd"), member.getName(), returnMoney); -// memberService.addMoneyFlow(mallMember.getId(), returnMoney, MoneyFlowTypeEnum.PARENT_BONUS.getValue(), orderNo, null, remark, member.getId(), null); -// } -// -// String remark = StrUtil.format(remarkFormat, DateUtil.format(yesterday, "yyyy-MM-dd"), member.getName(), needReturn); -// memberService.addMoneyFlow(member.getId(), needReturn.negate(), MoneyFlowTypeEnum.PARENT_BONUS.getValue(), orderNo, null, remark, null, null); -// memberWalletService.reduceBalance(needReturn, member.getId()); -// -// moneyFlowMapper.updateIsReturnByMemberId(MallMoneyFlow.IS_RETURN_Y, flow.getMemberId()); -// } + memberProfitService.agentProfit(null); + } + + /** + * 感恩奖 + */ + @Scheduled(cron = "0 0 2 * * ?") + public void thankfulJob() { + memberProfitService.thankfulProfit(); + } + + /** + * 排名奖 每月1号 + */ + @Scheduled(cron = "0 0 3 1 * ?") + public void rankJob() { + memberProfitService.rankProfit(); } } diff --git a/src/main/java/cc/mrbird/febs/mall/service/IScoreService.java b/src/main/java/cc/mrbird/febs/mall/service/IScoreService.java index 7a644e9..13fa00d 100644 --- a/src/main/java/cc/mrbird/febs/mall/service/IScoreService.java +++ b/src/main/java/cc/mrbird/febs/mall/service/IScoreService.java @@ -1,5 +1,6 @@ package cc.mrbird.febs.mall.service; +import cc.mrbird.febs.mall.entity.MallScoreSignRecord; import cc.mrbird.febs.mall.vo.ScoreSignVo; public interface IScoreService { @@ -7,4 +8,6 @@ ScoreSignVo scoreSign(); void sign(); + + MallScoreSignRecord judgeScoreIsContinuity(MallScoreSignRecord mallScoreSignRecord); } diff --git a/src/main/java/cc/mrbird/febs/mall/service/impl/AdminMallMemberServiceImpl.java b/src/main/java/cc/mrbird/febs/mall/service/impl/AdminMallMemberServiceImpl.java index 5399644..91fb9a4 100644 --- a/src/main/java/cc/mrbird/febs/mall/service/impl/AdminMallMemberServiceImpl.java +++ b/src/main/java/cc/mrbird/febs/mall/service/impl/AdminMallMemberServiceImpl.java @@ -3,6 +3,7 @@ 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.MoneyFlowTypeEnum; import cc.mrbird.febs.common.exception.FebsException; import cc.mrbird.febs.common.utils.MallUtils; @@ -12,6 +13,7 @@ import cc.mrbird.febs.mall.mapper.*; import cc.mrbird.febs.mall.service.IAdminMallMemberService; import cc.mrbird.febs.mall.service.IApiMallMemberWalletService; +import cc.mrbird.febs.mall.service.IMallMoneyFlowService; import cc.mrbird.febs.mall.vo.*; import cn.hutool.core.collection.CollUtil; import cn.hutool.core.util.ObjectUtil; @@ -56,6 +58,8 @@ private final MallNewsInfoMapper mallNewsInfoMapper; private final MallShopApplyMapper mallShopApplyMapper; + + private final IMallMoneyFlowService mallMoneyFlowService; @Override public IPage<MallMember> getMallMemberList(MallMember mallMember, QueryRequest request) { @@ -188,17 +192,10 @@ @Override public AdminAgentLevelUpdateInfoVo getAgentLevelUpdateInfoById(long id) { - AdminAgentLevelUpdateInfoVo adminAgentLevelUpdateInfoVo = new AdminAgentLevelUpdateInfoVo(); DataDictionaryCustom dataDictionaryCustom = dataDictionaryCustomMapper.selectById(id); String value = dataDictionaryCustom.getValue(); //{"directIncome":36,"lastCnt":3,"orderCnt":500,"orderType":2,"teamIncome":6,"teamIncomeType":2} - JSONObject jsonObject = JSONObject.parseObject(value); - adminAgentLevelUpdateInfoVo.setDirectIncome(new BigDecimal((jsonObject.get("directIncome")==null?0:jsonObject.get("directIncome")).toString())); - adminAgentLevelUpdateInfoVo.setLastCnt(Integer.parseInt((jsonObject.get("lastCnt")==null?0:jsonObject.get("lastCnt")).toString())); - adminAgentLevelUpdateInfoVo.setOrderCnt(Integer.parseInt((jsonObject.get("orderCnt")==null?0:jsonObject.get("orderCnt")).toString())); - adminAgentLevelUpdateInfoVo.setOrderType(Integer.parseInt(jsonObject.get("orderType").toString())); - adminAgentLevelUpdateInfoVo.setTeamIncome(new BigDecimal((jsonObject.get("teamIncome")==null?0:jsonObject.get("teamIncome")).toString())); - adminAgentLevelUpdateInfoVo.setTeamIncomeType(Integer.parseInt(jsonObject.get("orderType").toString())); + AdminAgentLevelUpdateInfoVo adminAgentLevelUpdateInfoVo = JSONObject.parseObject(value, AdminAgentLevelUpdateInfoVo.class); adminAgentLevelUpdateInfoVo.setId(id); return adminAgentLevelUpdateInfoVo; } @@ -206,15 +203,9 @@ @Override public FebsResponse agentLevelUpdate(AgentLevelUpdateDto agentLevelUpdateDto) { DataDictionaryCustom dataDictionaryCustom = dataDictionaryCustomMapper.selectById(agentLevelUpdateDto.getId()); - AgentLevelUpdateDto agentLevelUpdateDtoJson = new AgentLevelUpdateDto(); - agentLevelUpdateDtoJson.setDirectIncome(agentLevelUpdateDto.getDirectIncome()); - agentLevelUpdateDtoJson.setLastCnt(agentLevelUpdateDto.getLastCnt()); - agentLevelUpdateDtoJson.setOrderCnt(agentLevelUpdateDto.getOrderCnt()); - agentLevelUpdateDtoJson.setTeamIncome(agentLevelUpdateDto.getTeamIncome()); - agentLevelUpdateDtoJson.setOrderType(agentLevelUpdateDto.getOrderType()); - agentLevelUpdateDtoJson.setTeamIncomeType(agentLevelUpdateDto.getTeamIncomeType()); - JSONObject jsonObject = (JSONObject)JSONObject.toJSON(agentLevelUpdateDtoJson); - dataDictionaryCustom.setValue(jsonObject.toString()); + + agentLevelUpdateDto.setId(null); + dataDictionaryCustom.setValue(JSONObject.toJSONString(agentLevelUpdateDto)); dataDictionaryCustomMapper.updateById(dataDictionaryCustom); return new FebsResponse().success(); } @@ -336,13 +327,7 @@ mallMemberWallet.setBalance(mallMemberWallet.getBalance().add(bigDecimal)); mallMemberWalletMapper.updateBalanceWithId(mallMemberWallet); - MallMoneyFlow flow = new MallMoneyFlow(); - flow.setMemberId(memberId); - flow.setAmount(bigDecimal); -// flow.setType(MoneyFlowTypeEnum.SYSTEM_PAY.getValue()); - flow.setOrderNo("SYS"+MallUtils.getOrderNum()); - flow.setStatus(2); - mallMoneyFlowMapper.insert(flow); + mallMoneyFlowService.addMoneyFlow(memberId, bigDecimal, MoneyFlowTypeEnum.SYSTEM.getValue(), null, FlowTypeEnum.BALANCE.getValue()); return new FebsResponse().success(); } diff --git a/src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallMemberServiceImpl.java b/src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallMemberServiceImpl.java index 100b886..01d5eaf 100644 --- a/src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallMemberServiceImpl.java +++ b/src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallMemberServiceImpl.java @@ -110,7 +110,7 @@ mallMember.setName(registerDto.getName()); mallMember.setAccountStatus(MallMember.ACCOUNT_STATUS_ENABLE); mallMember.setAccountType(MallMember.ACCOUNT_TYPE_NORMAL); - mallMember.setLevel(AgentLevelEnum.FIRST_LEVEL.name()); + mallMember.setLevel(AgentLevelEnum.ZERO_LEVEL.name()); mallMember.setSex("男"); mallMember.setBindPhone(registerDto.getAccount()); diff --git a/src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallOrderInfoServiceImpl.java b/src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallOrderInfoServiceImpl.java index 61ded98..a21cfb8 100644 --- a/src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallOrderInfoServiceImpl.java +++ b/src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallOrderInfoServiceImpl.java @@ -225,12 +225,7 @@ orderInfo.setPayTime(new Date()); orderInfo.setPayResult("1"); -// MallMember mallMember = memberMapper.selectById(member.getId()); -// if (AgentLevelEnum.ZERO_LEVEL.name().equals(mallMember.getLevel())) { -// mallMember.setLevel(AgentLevelEnum.FIRST_LEVEL.name()); -// memberMapper.updateById(mallMember); -// } - + boolean hasTc = false; // 静态倍数 List<MallOrderItem> orderItems = this.baseMapper.getMallOrderItemByOrderId(orderInfo.getId()); if (CollUtil.isNotEmpty(orderItems)) { @@ -238,6 +233,7 @@ MallGoods mallGoods = mallGoodsMapper.selectById(orderItem.getGoodsId()); if (mallGoods.getIsNormal() == 2) { + hasTc = true; MallGoodsSku sku = mallGoodsSkuMapper.selectById(orderItem.getSkuId()); BigDecimal score = sku.getOriginalPrice().multiply(mallGoods.getStaticMulti()); @@ -247,6 +243,15 @@ } } + // 购买套餐后,升级为普通会员 + if (hasTc) { + MallMember mallMember = memberMapper.selectById(member.getId()); + if (AgentLevelEnum.ZERO_LEVEL.name().equals(mallMember.getLevel())) { + mallMember.setLevel(AgentLevelEnum.FIRST_LEVEL.name()); + memberMapper.updateById(mallMember); + } + } + mallMoneyFlowService.addMoneyFlow(member.getId(), orderInfo.getAmount().negate(), MoneyFlowTypeEnum.PAY.getValue(), orderInfo.getOrderNo(), FlowTypeEnum.BALANCE.getValue()); // agentProducer.sendAutoLevelUpMsg(member.getId()); agentProducer.sendOrderReturn(orderInfo.getId()); diff --git a/src/main/java/cc/mrbird/febs/mall/service/impl/MemberProfitServiceImpl.java b/src/main/java/cc/mrbird/febs/mall/service/impl/MemberProfitServiceImpl.java index 3780ec4..728fa15 100644 --- a/src/main/java/cc/mrbird/febs/mall/service/impl/MemberProfitServiceImpl.java +++ b/src/main/java/cc/mrbird/febs/mall/service/impl/MemberProfitServiceImpl.java @@ -93,6 +93,7 @@ * @param orderId */ @Override + @Transactional(rollbackFor = Exception.class) public void dynamicProfit(Long orderId) { log.info("######直推奖励, 订单ID:{}######", orderId); MallOrderInfo orderInfo = mallOrderInfoMapper.selectById(orderId); @@ -106,62 +107,80 @@ if (StrUtil.isBlank(member.getReferrerId())) { return; } + // 直推奖励字典 DataDictionaryCustom dic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(DataDictionaryEnum.DYNAMIC_BONUS.getType(), DataDictionaryEnum.DYNAMIC_BONUS.getCode()); + // 隔代字典 DataDictionaryCustom indrectDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(DataDictionaryEnum.INDRECT_BONUS.getType(), DataDictionaryEnum.INDRECT_BONUS.getCode()); + // 直接父级 + MallMember parent = mallMemberMapper.selectInfoByInviteId(member.getReferrerId()); - String parent = member.getReferrerId(); List<MallOrderItem> items = mallOrderInfoMapper.getMallOrderItemByOrderId(orderId); for (MallOrderItem item : items) { // 减去成本后算收益 BigDecimal amount = item.getPrice().subtract(item.getCostPrice()).multiply(BigDecimal.valueOf(item.getCnt())); + // =======直推返利== start ===== + // 直接奖励收益 BigDecimal dynamicProfit = amount.divide(new BigDecimal(dic.getValue()), 2, RoundingMode.HALF_UP); - List<String> parents = StrUtil.split(member.getReferrerIds(), ','); - List<MallMember> members = mallMemberMapper.selectByInviteIds(parents); - if (CollUtil.isEmpty(members)) { - return; + if (dynamicProfit.compareTo(BigDecimal.ZERO) < 1) { + continue; } - // 隔代比例 - BigDecimal indrectDicProp = new BigDecimal(indrectDic.getValue()); - - // 隔代推荐奖 - BigDecimal direct = dynamicProfit.divide(indrectDicProp, 2, RoundingMode.HALF_UP); - for (MallMember parentMember : members) { - if (parent.equals(parentMember.getInviteId())) { - continue; - } - - int reduce = walletService.reduce(direct, parentMember.getId(), "score"); - if (reduce == 2) { - continue; - } - - walletService.add(direct, parentMember.getId(), "commission"); - - moneyFlowService.addMoneyFlow(parentMember.getId(), direct, MoneyFlowTypeEnum.RECOMMEND_BONUS.getValue(), orderInfo.getOrderNo(), FlowTypeEnum.COMMISSION.getValue()); - moneyFlowService.addMoneyFlow(parentMember.getId(), direct.negate(), MoneyFlowTypeEnum.RECOMMEND_BONUS.getValue(), orderInfo.getOrderNo(), FlowTypeEnum.SCORE.getValue()); - - if (direct.compareTo(BigDecimal.ONE) < 1) { - break; - } - direct = direct.divide(indrectDicProp, 2, RoundingMode.HALF_UP); - } - - int reduce = walletService.reduce(dynamicProfit, member.getId(), "score"); + int reduce = walletService.reduce(dynamicProfit, parent.getId(), "score"); if (reduce == 2) { continue; } - walletService.add(dynamicProfit, member.getId(), "commission"); + walletService.add(dynamicProfit, parent.getId(), "commission"); - moneyFlowService.addMoneyFlow(member.getId(), dynamicProfit, MoneyFlowTypeEnum.DYNAMIC_ACHIEVE.getValue(), orderInfo.getOrderNo(), FlowTypeEnum.COMMISSION.getValue()); - moneyFlowService.addMoneyFlow(member.getId(), dynamicProfit.negate(), MoneyFlowTypeEnum.DYNAMIC_ACHIEVE.getValue(), orderInfo.getOrderNo(), FlowTypeEnum.SCORE.getValue()); + moneyFlowService.addMoneyFlow(parent.getId(), dynamicProfit, MoneyFlowTypeEnum.DYNAMIC_ACHIEVE.getValue(), orderInfo.getOrderNo(), FlowTypeEnum.COMMISSION.getValue()); + moneyFlowService.addMoneyFlow(parent.getId(), dynamicProfit.negate(), MoneyFlowTypeEnum.DYNAMIC_ACHIEVE.getValue(), orderInfo.getOrderNo(), FlowTypeEnum.SCORE.getValue()); + // =======直推返利== end ===== + + // =======隔代奖== start ===== + if (StrUtil.isBlank(parent.getReferrerId())) { + continue; + } + + List<String> parents = StrUtil.split(parent.getReferrerIds(), ','); + List<MallMember> members = mallMemberMapper.selectByInviteIds(parents); + if (CollUtil.isEmpty(members)) { + return; + } + // 隔代比例 + BigDecimal indrectDicProp = new BigDecimal(indrectDic.getValue()); + + // 隔代推荐奖 收益 + BigDecimal direct = dynamicProfit.divide(indrectDicProp, 2, RoundingMode.HALF_UP); + + // direct 收益小于1,则跳出 + if (direct.compareTo(BigDecimal.ONE) < 1) { + continue; + } + + for (MallMember parentMember : members) { + if (parent.getInviteId().equals(parentMember.getInviteId())) { + continue; + } + + int reduceResult = walletService.reduce(direct, parentMember.getId(), "score"); + if (reduceResult == 2) { + continue; + } + + walletService.add(direct, parentMember.getId(), "commission"); + moneyFlowService.addMoneyFlow(parentMember.getId(), direct, MoneyFlowTypeEnum.RECOMMEND_BONUS.getValue(), orderInfo.getOrderNo(), FlowTypeEnum.COMMISSION.getValue()); + moneyFlowService.addMoneyFlow(parentMember.getId(), direct.negate(), MoneyFlowTypeEnum.RECOMMEND_BONUS.getValue(), orderInfo.getOrderNo(), FlowTypeEnum.SCORE.getValue()); + + direct = direct.divide(indrectDicProp, 2, RoundingMode.HALF_UP); + } + // =======隔代奖== end ===== } } @Override + @Transactional(rollbackFor = Exception.class) public void agentProfit(Date profitDate) { log.info("#####==代理分红==start==#####"); if (profitDate == null) { diff --git a/src/main/java/cc/mrbird/febs/mall/service/impl/ScoreServiceImpl.java b/src/main/java/cc/mrbird/febs/mall/service/impl/ScoreServiceImpl.java index 9bc7c00..4c404dc 100644 --- a/src/main/java/cc/mrbird/febs/mall/service/impl/ScoreServiceImpl.java +++ b/src/main/java/cc/mrbird/febs/mall/service/impl/ScoreServiceImpl.java @@ -17,6 +17,8 @@ import cc.mrbird.febs.mall.service.IMallMoneyFlowService; import cc.mrbird.febs.mall.service.IScoreService; import cc.mrbird.febs.mall.vo.ScoreSignVo; +import cn.hutool.core.date.DateField; +import cn.hutool.core.date.DateTime; import cn.hutool.core.date.DateUnit; import cn.hutool.core.date.DateUtil; import com.alibaba.fastjson.JSONObject; @@ -53,13 +55,29 @@ ScoreSignVo scoreSign = new ScoreSignVo(); scoreSign.setMineScore(wallet.getPrizeScore().intValue()); - scoreSign.setHasSignDays(mallScoreSignRecord == null ? 0 : mallScoreSignRecord.getTotalCnt()); + + if (mallScoreSignRecord == null) { + scoreSign.setHasSignDays(0); + } else { + mallScoreSignRecord = judgeScoreIsContinuity(mallScoreSignRecord); + scoreSign.setHasSignDays(mallScoreSignRecord.getTotalCnt()); + } DataDictionaryCustom dic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(DataDictionaryEnum.SCORE_SIGN_SETTING.getType(), DataDictionaryEnum.SCORE_SIGN_SETTING.getCode()); if (dic != null) { scoreSign.setSetting(JSONObject.parseObject(dic.getValue(), ScoreSettingDto.class)); } return scoreSign; + } + + @Override + public MallScoreSignRecord judgeScoreIsContinuity(MallScoreSignRecord mallScoreSignRecord) { + // 若最新签到日期,与当天相差大于一天,则更新数据库(避免定时器更新失败) + if (DateUtil.betweenDay(mallScoreSignRecord.getSignTime(), new Date(), true) > 1 || mallScoreSignRecord.getTotalCnt() == 7) { + mallScoreSignRecord.setTotalCnt(0); + mallScoreSignRecordMapper.updateById(mallScoreSignRecord); + } + return mallScoreSignRecord; } @Override @@ -77,10 +95,12 @@ mallScoreSignRecord = new MallScoreSignRecord(); } - if (mallScoreSignRecord.getSignTime() != null && DateUtil.between(mallScoreSignRecord.getSignTime(), new Date(), DateUnit.DAY) == 0) { + if (mallScoreSignRecord.getSignTime() != null && DateUtil.betweenDay(mallScoreSignRecord.getSignTime(), new Date(), true) == 0) { throw new FebsException("今天已签到"); } + mallScoreSignRecord = judgeScoreIsContinuity(mallScoreSignRecord); + ScoreSettingDto scoreSetting = JSONObject.parseObject(dic.getValue(),ScoreSettingDto.class); int days = mallScoreSignRecord.getTotalCnt() == null ? 1 : mallScoreSignRecord.getTotalCnt() + 1; switch (days) { diff --git a/src/main/java/cc/mrbird/febs/mall/vo/AdminAgentLevelUpdateInfoVo.java b/src/main/java/cc/mrbird/febs/mall/vo/AdminAgentLevelUpdateInfoVo.java index 3181d8f..49aab25 100644 --- a/src/main/java/cc/mrbird/febs/mall/vo/AdminAgentLevelUpdateInfoVo.java +++ b/src/main/java/cc/mrbird/febs/mall/vo/AdminAgentLevelUpdateInfoVo.java @@ -41,4 +41,6 @@ * 团队收益 1-指定金额 2-比例 */ private Integer teamIncomeType; + + private BigDecimal profitProp; } diff --git a/src/main/java/cc/mrbird/febs/mall/vo/AdminMoneyFlowListVo.java b/src/main/java/cc/mrbird/febs/mall/vo/AdminMoneyFlowListVo.java index d70b1a9..8d055bd 100644 --- a/src/main/java/cc/mrbird/febs/mall/vo/AdminMoneyFlowListVo.java +++ b/src/main/java/cc/mrbird/febs/mall/vo/AdminMoneyFlowListVo.java @@ -36,4 +36,6 @@ private String bindPhone; + private Integer flowType; + } diff --git a/src/main/java/cc/mrbird/febs/mall/vo/NewsListVo.java b/src/main/java/cc/mrbird/febs/mall/vo/NewsListVo.java index c912e7c..20768cf 100644 --- a/src/main/java/cc/mrbird/febs/mall/vo/NewsListVo.java +++ b/src/main/java/cc/mrbird/febs/mall/vo/NewsListVo.java @@ -15,7 +15,7 @@ private Long id; - private Long title; + private String title; private String thumb; diff --git a/src/main/java/cc/mrbird/febs/pay/service/impl/PayServiceImpl.java b/src/main/java/cc/mrbird/febs/pay/service/impl/PayServiceImpl.java index 418e056..d80dd6c 100644 --- a/src/main/java/cc/mrbird/febs/pay/service/impl/PayServiceImpl.java +++ b/src/main/java/cc/mrbird/febs/pay/service/impl/PayServiceImpl.java @@ -54,7 +54,7 @@ @Override public String aliPay(MallOrderInfo orderInfo) { AlipayTradeAppPayModel model = new AlipayTradeAppPayModel(); - model.setSubject("澳美芝商品支付"); + model.setSubject("澳芝美商品支付"); model.setBody(orderInfo.getName()); model.setOutTradeNo(orderInfo.getOrderNo()); model.setTimeoutExpress("15m"); diff --git a/src/main/java/cc/mrbird/febs/rabbit/consumer/AgentConsumer.java b/src/main/java/cc/mrbird/febs/rabbit/consumer/AgentConsumer.java index cdadcb4..46c50a1 100644 --- a/src/main/java/cc/mrbird/febs/rabbit/consumer/AgentConsumer.java +++ b/src/main/java/cc/mrbird/febs/rabbit/consumer/AgentConsumer.java @@ -66,11 +66,10 @@ @RabbitListener(queues = QueueConstants.ORDER_RETURN_MONEY) public void orderReturnMoney(String orderId) { log.info("收到订单返利消息:{}", orderId); - try { memberProfitService.dynamicProfit(Long.parseLong(orderId)); } catch (Exception e) { - log.error("订单返利异常:{}", e); + log.error("订单返利异常:", e); } } } diff --git a/src/main/resources/mapper/modules/MallScoreSignRecordMapper.xml b/src/main/resources/mapper/modules/MallScoreSignRecordMapper.xml index 7519615..669a566 100644 --- a/src/main/resources/mapper/modules/MallScoreSignRecordMapper.xml +++ b/src/main/resources/mapper/modules/MallScoreSignRecordMapper.xml @@ -2,11 +2,12 @@ <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="cc.mrbird.febs.mall.mapper.MallScoreSignRecordMapper"> - + <!-- select *, max(sign_time) signTime from mall_score_sign_record + where member_id=#{memberId} + group by member_id --> <select id="selectRecentSignRecord" resultType="cc.mrbird.febs.mall.entity.MallScoreSignRecord"> - select *, max(sign_time) signTime from mall_score_sign_record - where member_id=#{memberId} - group by member_id + select * from mall_score_sign_record + where member_id=#{memberId} order by id desc limit 1 </select> </mapper> \ No newline at end of file diff --git a/src/main/resources/templates/error/403.html b/src/main/resources/templates/error/403.html index bcde4b3..41d8491 100644 --- a/src/main/resources/templates/error/403.html +++ b/src/main/resources/templates/error/403.html @@ -2,7 +2,7 @@ <html xmlns:th="http://www.thymeleaf.org"> <head> <meta charset="utf-8"> - <title>澳美芝 权限系统</title> + <title>澳芝美 权限系统</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <meta name="renderer" content="webkit"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> diff --git a/src/main/resources/templates/error/404.html b/src/main/resources/templates/error/404.html index 2ac792c..598e25a 100644 --- a/src/main/resources/templates/error/404.html +++ b/src/main/resources/templates/error/404.html @@ -2,7 +2,7 @@ <html xmlns:th="http://www.thymeleaf.org"> <head> <meta charset="utf-8"> - <title>澳美芝 权限系统</title> + <title>澳芝美 权限系统</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <meta name="renderer" content="webkit"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> diff --git a/src/main/resources/templates/error/500.html b/src/main/resources/templates/error/500.html index 3af08c2..11b1467 100644 --- a/src/main/resources/templates/error/500.html +++ b/src/main/resources/templates/error/500.html @@ -2,7 +2,7 @@ <html xmlns:th="http://www.thymeleaf.org"> <head> <meta charset="utf-8"> - <title>澳美芝 权限系统</title> + <title>澳芝美 权限系统</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <meta name="renderer" content="webkit"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> diff --git a/src/main/resources/templates/febs/views/layout.html b/src/main/resources/templates/febs/views/layout.html index 50cfcf6..c53c8b1 100644 --- a/src/main/resources/templates/febs/views/layout.html +++ b/src/main/resources/templates/febs/views/layout.html @@ -64,7 +64,7 @@ <div class="layui-side-scroll"> <div class="layui-logo" style="cursor: pointer"> <img data-th-src="@{febs/images/logo.png}"> - <span>澳美芝 权限系统</span> + <span>澳芝美 权限系统</span> </div> <script type="text/html" diff --git a/src/main/resources/templates/febs/views/login.html b/src/main/resources/templates/febs/views/login.html index dda151d..2b6340f 100644 --- a/src/main/resources/templates/febs/views/login.html +++ b/src/main/resources/templates/febs/views/login.html @@ -2,7 +2,7 @@ <html xmlns:th="http://www.thymeleaf.org"> <head> <meta charset="utf-8"> - <title>澳美芝 权限系统</title> + <title>澳芝美 权限系统</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <meta name="renderer" content="webkit"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> @@ -19,7 +19,7 @@ <div class="layui-container"> <div class="layui-row"> <div class="layui-col-xs12 layui-col-lg4 layui-col-lg-offset4 febs-tc"> - <div class="layui-logo"><span><b>澳美芝</b> 权限系统</span></div> + <div class="layui-logo"><span><b>澳芝美</b> 权限系统</span></div> </div> <div class="layui-col-xs12 layui-col-lg4 layui-col-lg-offset4" id="login-div"> <div class="layui-form" lay-filter="login-form"> diff --git a/src/main/resources/templates/febs/views/modules/goods/goodsUpdateNew.html b/src/main/resources/templates/febs/views/modules/goods/goodsUpdateNew.html index bfd4d27..d670df0 100644 --- a/src/main/resources/templates/febs/views/modules/goods/goodsUpdateNew.html +++ b/src/main/resources/templates/febs/views/modules/goods/goodsUpdateNew.html @@ -588,8 +588,11 @@ selector: '#toolbar-container', mode: 'default' }); - tableSkuData = skus; - reloadTable(skus); + + if (skus) { + tableSkuData = skus; + reloadTable(skus); + } } form.on('submit(goods-update-form-submit)', function (data) { diff --git a/src/main/resources/templates/febs/views/modules/mallMember/agentLevelUpdate-bak.html b/src/main/resources/templates/febs/views/modules/mallMember/agentLevelUpdate-bak.html new file mode 100644 index 0000000..3f29742 --- /dev/null +++ b/src/main/resources/templates/febs/views/modules/mallMember/agentLevelUpdate-bak.html @@ -0,0 +1,119 @@ +<style> + #agent-level-edit { + padding: 20px 25px 25px 0; + } + + #agent-level-edit .layui-treeSelect .ztree li a, .ztree li span { + margin: 0 0 2px 3px !important; + } + #agent-level-edit #data-permission-tree-block { + border: 1px solid #eee; + border-radius: 2px; + padding: 3px 0; + } + #agent-level-edit .layui-treeSelect .ztree li span.button.switch { + top: 1px; + left: 3px; + } + #agent-level-edit img{ + max-width:200px + } + +</style> +<div class="layui-fluid" id="agent-level-edit"> + <form class="layui-form" action="" lay-filter="agent-level-edit-form"> + <div class="layui-form-item febs-hide"> + <label class="layui-form-label">id:</label> + <div class="layui-input-block"> + <input type="text" name="id"> + </div> + </div> + <div class="layui-form-item"> + <label class="layui-form-label febs-form-item-require">下单数量要求:</label> + <div class="layui-input-block"> + <input type="radio" name="orderType" value="1" title="直推" > + <input type="radio" name="orderType" value="2" title="团队"> + </div> + </div> + <div class="layui-form-item"> + <label class="layui-form-label febs-form-item-require">下单数量:</label> + <div class="layui-input-block"> + <input type="number" name="orderCnt" class="layui-input"> + </div> + </div> + <div class="layui-form-item"> + <label class="layui-form-label febs-form-item-require">需要上一级的数量:</label> + <div class="layui-input-block"> + <input type="number" name="lastCnt" class="layui-input"> + </div> + </div> + <div class="layui-form-item"> + <label class="layui-form-label febs-form-item-require">团队收益类型:</label> + <div class="layui-input-block"> + <input type="radio" name="teamIncomeType" value="1" title="指定金额" > + <input type="radio" name="teamIncomeType" value="2" title="比例"> + </div> + </div> + <div class="layui-form-item"> + <div style="text-align:center;color: red">提示:【团队收益】如果选择【比例】,请输入百分比数字,如:80%,请输入80</div> + </div> + <div class="layui-form-item"> + <label class="layui-form-label febs-form-item-require">团队收益:</label> + <div class="layui-input-block"> + <input type="number" name="teamIncome" class="layui-input"> + </div> + </div> + <div class="layui-form-item"> + <div style="text-align:center;color: red">提示:【直推收益】请输入百分比数字,如:80%,请输入80</div> + </div> + <div class="layui-form-item"> + <label class="layui-form-label febs-form-item-require">直推收益:</label> + <div class="layui-input-block"> + <input type="number" name="directIncome" class="layui-input"> + </div> + </div> + <div class="layui-form-item febs-hide"> + <button class="layui-btn" lay-submit="" lay-filter="agent-level-edit-submit" id="submit"></button> + </div> + </form> +</div> + +<script data-th-inline="javascript"> + layui.use(['febs', 'form', 'formSelects', 'validate', 'treeSelect', 'eleTree'], function () { + var $ = layui.$, + febs = layui.febs, + layer = layui.layer, + formSelects = layui.formSelects, + treeSelect = layui.treeSelect, + form = layui.form, + eleTree = layui.eleTree, + agentLevelUpdateInfo = [[${agentLevelUpdateInfo}]], + $view = $('#agent-level-edit'), + validate = layui.validate, + _deptTree; + form.render(); + + initUserValue(); + + function initUserValue() { + form.val("agent-level-edit-form", { + "id": agentLevelUpdateInfo.id, + "orderType": agentLevelUpdateInfo.orderType, + "orderCnt": agentLevelUpdateInfo.orderCnt, + "directIncome": agentLevelUpdateInfo.directIncome, + "teamIncome": agentLevelUpdateInfo.teamIncome, + "teamIncomeType": agentLevelUpdateInfo.teamIncomeType, + "lastCnt": agentLevelUpdateInfo.lastCnt + }); + } + + form.on('submit(agent-level-edit-submit)', function (data) { + febs.post(ctx + 'admin/mallMember/agentLevelUpdate', data.field, function () { + layer.closeAll(); + febs.alert.success('操作成功'); + $('#febs-user-agent-level').find('#reset').click(); + }); + return false; + }); + }); +</script> \ No newline at end of file diff --git a/src/main/resources/templates/febs/views/modules/mallMember/agentLevelUpdate.html b/src/main/resources/templates/febs/views/modules/mallMember/agentLevelUpdate.html index 3f29742..0735a7c 100644 --- a/src/main/resources/templates/febs/views/modules/mallMember/agentLevelUpdate.html +++ b/src/main/resources/templates/febs/views/modules/mallMember/agentLevelUpdate.html @@ -29,47 +29,17 @@ </div> </div> <div class="layui-form-item"> - <label class="layui-form-label febs-form-item-require">下单数量要求:</label> + <label class="layui-form-label febs-form-item-require">团队业绩:</label> <div class="layui-input-block"> - <input type="radio" name="orderType" value="1" title="直推" > - <input type="radio" name="orderType" value="2" title="团队"> + <input type="number" name="teamIncome" class="layui-input" placeholder="万元"> + <div class="layui-form-mid layui-word-aux">万元</div> </div> </div> <div class="layui-form-item"> - <label class="layui-form-label febs-form-item-require">下单数量:</label> + <label class="layui-form-label febs-form-item-require">返利比例:</label> <div class="layui-input-block"> - <input type="number" name="orderCnt" class="layui-input"> - </div> - </div> - <div class="layui-form-item"> - <label class="layui-form-label febs-form-item-require">需要上一级的数量:</label> - <div class="layui-input-block"> - <input type="number" name="lastCnt" class="layui-input"> - </div> - </div> - <div class="layui-form-item"> - <label class="layui-form-label febs-form-item-require">团队收益类型:</label> - <div class="layui-input-block"> - <input type="radio" name="teamIncomeType" value="1" title="指定金额" > - <input type="radio" name="teamIncomeType" value="2" title="比例"> - </div> - </div> - <div class="layui-form-item"> - <div style="text-align:center;color: red">提示:【团队收益】如果选择【比例】,请输入百分比数字,如:80%,请输入80</div> - </div> - <div class="layui-form-item"> - <label class="layui-form-label febs-form-item-require">团队收益:</label> - <div class="layui-input-block"> - <input type="number" name="teamIncome" class="layui-input"> - </div> - </div> - <div class="layui-form-item"> - <div style="text-align:center;color: red">提示:【直推收益】请输入百分比数字,如:80%,请输入80</div> - </div> - <div class="layui-form-item"> - <label class="layui-form-label febs-form-item-require">直推收益:</label> - <div class="layui-input-block"> - <input type="number" name="directIncome" class="layui-input"> + <input type="number" name="profitProp" class="layui-input" placeholder="%"> + <div class="layui-form-mid layui-word-aux">%</div> </div> </div> <div class="layui-form-item febs-hide"> @@ -98,12 +68,8 @@ function initUserValue() { form.val("agent-level-edit-form", { "id": agentLevelUpdateInfo.id, - "orderType": agentLevelUpdateInfo.orderType, - "orderCnt": agentLevelUpdateInfo.orderCnt, - "directIncome": agentLevelUpdateInfo.directIncome, "teamIncome": agentLevelUpdateInfo.teamIncome, - "teamIncomeType": agentLevelUpdateInfo.teamIncomeType, - "lastCnt": agentLevelUpdateInfo.lastCnt + "profitProp": agentLevelUpdateInfo.profitProp }); } diff --git a/src/main/resources/templates/febs/views/modules/mallMember/agentList.html b/src/main/resources/templates/febs/views/modules/mallMember/agentList.html index dcf2afe..f704b1f 100644 --- a/src/main/resources/templates/febs/views/modules/mallMember/agentList.html +++ b/src/main/resources/templates/febs/views/modules/mallMember/agentList.html @@ -18,17 +18,15 @@ </div> </div> <div class="layui-inline"> - <label class="layui-form-label layui-form-label-sm">账户状态</label> + <label class="layui-form-label layui-form-label-sm">代理层级</label> <div class="layui-input-inline"> <select name="level"> <option value="">请选择</option> - <option value="ZERO_LEVEL">未激活</option> <option value="FIRST_LEVEL">普通会员</option> - <option value="SECOND_LEVEL">业务经理</option> - <option value="THIRD_LEVEL">区域代理</option> - <option value="FOUR_LEVEL">代理</option> - <option value="FIFTH_LEVEL">总代</option> - <option value="SIX_LEVEL">董事</option> + <option value="SECOND_LEVEL">区级代理</option> + <option value="THIRD_LEVEL">市级代理</option> + <option value="FOUR_LEVEL">省级代理</option> + <option value="FIFTH_LEVEL">全国总代</option> </select> </div> </div> diff --git a/src/main/resources/templates/febs/views/modules/mallMember/moneyFlowList.html b/src/main/resources/templates/febs/views/modules/mallMember/moneyFlowList.html index ce8cf2a..f18c7ab 100644 --- a/src/main/resources/templates/febs/views/modules/mallMember/moneyFlowList.html +++ b/src/main/resources/templates/febs/views/modules/mallMember/moneyFlowList.html @@ -18,19 +18,38 @@ </div> </div> <div class="layui-inline"> - <label class="layui-form-label layui-form-label-sm">账户状态</label> + <label class="layui-form-label layui-form-label-sm">流水类型</label> <div class="layui-input-inline"> <select name="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="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> + </select> + </div> + </div> + <div class="layui-inline"> + <label class="layui-form-label layui-form-label-sm">资金类型</label> + <div class="layui-input-inline"> + <select name="flowType"> + <option value="">请选择</option> + <option value="1">余额</option> + <option value="2">赠送积分</option> + <option value="3">竞猜积分</option> + <option value="4">佣金</option> </select> </div> </div> @@ -104,37 +123,53 @@ {field: 'type', title: '流水类型', templet: function (d) { if (d.type === 1) { - return '<span>直推奖励</span>' + return '<span>静态收益</span>' } else if (d.type === 2) { - return '<span>团队奖励</span>' + return '<span>动态收益</span>' } else if (d.type === 3) { - return '<span>订单支付</span>' + return '<span>代理收益</span>' } else if (d.type === 4) { - return '<span>退款</span>' + return '<span>排名收益</span>' }else if (d.type === 5) { - return '<span>转账</span>' + return '<span>董事收益</span>' }else if (d.type === 6) { - return '<span>提现</span>' + return '<span>社区店补</span>' }else if (d.type === 7) { - return '<span>排名奖励</span>' + return '<span>推荐人收益</span>' }else if (d.type === 8) { - return '<span>利润分红</span>' + 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{ return '' } }, minWidth: 80,align:'center'}, - {field: 'type', title: '支付方式', + {field: 'flowType', title: '资金类型', templet: function (d) { - if (d.type === 3) { - if(d.payMethod === null || d.payMethod ===''){ - return '' - }else{ - return '<span>'+d.payMethod+'</span>' - } - } else{ - return '' + if (d.flowType === 1) { + return '余额'; + } else if(d.flowType === 2) { + return '赠送积分' + } else if(d.flowType === 3) { + return '竞猜积分' + } else if(d.flowType === 4) { + return '佣金' + } else { + return '-'; } }, minWidth: 80,align:'center'}, {field: 'orderNo', title: '订单编号', minWidth: 150,align:'left'}, @@ -149,6 +184,7 @@ 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(), }; } diff --git a/src/main/resources/templates/index.html b/src/main/resources/templates/index.html index 9dc75a1..14b99c3 100644 --- a/src/main/resources/templates/index.html +++ b/src/main/resources/templates/index.html @@ -3,7 +3,7 @@ xmlns:shiro="http://www.pollix.at/thymeleaf/shiro"> <head> <meta charset="utf-8"> - <title>澳美芝 权限系统</title> + <title>澳芝美 权限系统</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <meta name="renderer" content="webkit"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> diff --git a/src/test/java/cc/mrbird/febs/AgentTest.java b/src/test/java/cc/mrbird/febs/AgentTest.java index 584839e..12b948b 100644 --- a/src/test/java/cc/mrbird/febs/AgentTest.java +++ b/src/test/java/cc/mrbird/febs/AgentTest.java @@ -12,6 +12,7 @@ import cc.mrbird.febs.mall.service.IAgentService; import cc.mrbird.febs.mall.vo.ApiMallActWinDetailsVo; import cc.mrbird.febs.mall.vo.ApiMallAwardDetailsVo; +import cc.mrbird.febs.rabbit.consumer.AgentConsumer; import cc.mrbird.febs.rabbit.producter.AgentProducer; import cn.hutool.core.collection.CollUtil; import cn.hutool.core.util.ObjectUtil; @@ -615,4 +616,13 @@ public void profitJobTest() { profitJob.profitJob(); } + + + @Autowired + private AgentConsumer agentConsumer; + + @Test + public void orderReturnTest() { + agentConsumer.orderReturnMoney("7"); + } } -- Gitblit v1.9.1