Merge branch 'mall-amz' of http://120.27.238.55:7000/r/xc-mall into mall-amz
1 files added
29 files modified
| | |
| | | |
| | | @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()); |
| | | } |
| | | |
| | | } |
| | |
| | | @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; |
| | |
| | | /** |
| | | * 感恩奖 |
| | | */ |
| | | THANKFUL(15); |
| | | THANKFUL(15), |
| | | |
| | | /** |
| | | * 系统 |
| | | */ |
| | | SYSTEM(16); |
| | | |
| | | private final int value; |
| | | |
| | |
| | | log.info("/ /` / / \\ | |\\/| | |_) | | | |_ | | | |_ "); |
| | | log.info("\\_\\_, \\_\\_/ |_| | |_| |_|__ |_|__ |_| |_|__ "); |
| | | log.info(" "); |
| | | log.info("澳美芝 权限系统启动完毕,地址:{}", url); |
| | | log.info("澳芝美 权限系统启动完毕,地址:{}", url); |
| | | |
| | | boolean auto = febsProperties.isAutoOpenBrowser(); |
| | | if (auto && StringUtils.equalsIgnoreCase(active, FebsConstant.DEVELOP)) { |
| | |
| | | * 团队收益 1-指定金额 2-比例 |
| | | */ |
| | | private Integer teamIncomeType; |
| | | |
| | | private BigDecimal profitProp; |
| | | } |
| | |
| | | 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; |
| | |
| | | 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(); |
| | | } |
| | | } |
| | |
| | | package cc.mrbird.febs.mall.service; |
| | | |
| | | import cc.mrbird.febs.mall.entity.MallScoreSignRecord; |
| | | import cc.mrbird.febs.mall.vo.ScoreSignVo; |
| | | |
| | | public interface IScoreService { |
| | |
| | | ScoreSignVo scoreSign(); |
| | | |
| | | void sign(); |
| | | |
| | | MallScoreSignRecord judgeScoreIsContinuity(MallScoreSignRecord mallScoreSignRecord); |
| | | } |
| | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | |
| | | private final MallNewsInfoMapper mallNewsInfoMapper; |
| | | private final MallShopApplyMapper mallShopApplyMapper; |
| | | |
| | | private final IMallMoneyFlowService mallMoneyFlowService; |
| | | |
| | | @Override |
| | | public IPage<MallMember> getMallMemberList(MallMember mallMember, QueryRequest request) { |
| | |
| | | |
| | | @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; |
| | | } |
| | |
| | | @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(); |
| | | } |
| | |
| | | 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(); |
| | | } |
| | | |
| | |
| | | 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()); |
| | | |
| | |
| | | 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)) { |
| | |
| | | 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()); |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | // 购买套餐后,升级为普通会员 |
| | | 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()); |
| | |
| | | * @param orderId |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void dynamicProfit(Long orderId) { |
| | | log.info("######直推奖励, 订单ID:{}######", orderId); |
| | | MallOrderInfo orderInfo = mallOrderInfoMapper.selectById(orderId); |
| | |
| | | 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) { |
| | |
| | | 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; |
| | |
| | | |
| | | 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 |
| | |
| | | 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) { |
| | |
| | | * 团队收益 1-指定金额 2-比例 |
| | | */ |
| | | private Integer teamIncomeType; |
| | | |
| | | private BigDecimal profitProp; |
| | | } |
| | |
| | | |
| | | private String bindPhone; |
| | | |
| | | private Integer flowType; |
| | | |
| | | } |
| | |
| | | |
| | | private Long id; |
| | | |
| | | private Long title; |
| | | private String title; |
| | | |
| | | private String thumb; |
| | | |
| | |
| | | @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"); |
| | |
| | | @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); |
| | | } |
| | | } |
| | | } |
| | |
| | | <!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> |
| | |
| | | <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"> |
| | |
| | | <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"> |
| | |
| | | <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"> |
| | |
| | | <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" |
| | |
| | | <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"> |
| | |
| | | <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"> |
| | |
| | | selector: '#toolbar-container', |
| | | mode: 'default' |
| | | }); |
| | | tableSkuData = skus; |
| | | reloadTable(skus); |
| | | |
| | | if (skus) { |
| | | tableSkuData = skus; |
| | | reloadTable(skus); |
| | | } |
| | | } |
| | | |
| | | form.on('submit(goods-update-form-submit)', function (data) { |
New file |
| | |
| | | <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> |
| | |
| | | </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"> |
| | |
| | | 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 |
| | | }); |
| | | } |
| | | |
| | |
| | | </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> |
| | |
| | | </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> |
| | |
| | | {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'}, |
| | |
| | | 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(), |
| | | }; |
| | | } |
| | | |
| | |
| | | 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"> |
| | |
| | | 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; |
| | |
| | | public void profitJobTest() { |
| | | profitJob.profitJob(); |
| | | } |
| | | |
| | | |
| | | @Autowired |
| | | private AgentConsumer agentConsumer; |
| | | |
| | | @Test |
| | | public void orderReturnTest() { |
| | | agentConsumer.orderReturnMoney("7"); |
| | | } |
| | | } |