| | |
| | | MallMember loginUser = LoginUserUtil.getLoginUser(); |
| | | Long memberId = loginUser.getId(); |
| | | MallMember mallMember = mallMemberMapper.selectById(memberId); |
| | | |
| | | if(ObjectUtil.isEmpty(mallMember)){ |
| | | return new FebsResponse().success(); |
| | | } |
| | | log.info(mallMember.getInviteId()); |
| | | MallTeamLeader mallTeamLeader = this.baseMapper.selectLeaderByUniqueCode(mallMember.getInviteId()); |
| | | if(ObjectUtil.isEmpty(mallTeamLeader)){ |
| | |
| | | mallOrderInfoMapper.updateById(mallOrderRefund); |
| | | } |
| | | }else{ |
| | | |
| | | //更新订单详情 |
| | | mallOrderItem.setState(1); |
| | | mallOrderItemMapper.updateById(mallOrderItem); |
| | | |
| | | mallRefundEntity.setState(2); |
| | | mallRefundMapper.updateById(mallRefundEntity); |
| | | return new FebsResponse().fail().message("退款失败,请联系客服人员"); |
| | |
| | | public FebsResponse leaderProfit() { |
| | | MallMember loginUser = LoginUserUtil.getLoginUser(); |
| | | ApiLeaderProfitVo apiLeaderProfitVo = new ApiLeaderProfitVo(); |
| | | // BigDecimal TotalProfit = mallLeaderAchieveMapper.selectProfitByStateAndDateTimeAndUniqueCode(null,null,loginUser.getInviteId()).setScale(2,BigDecimal.ROUND_DOWN); |
| | | // apiLeaderProfitVo.setTotalProfit(TotalProfit); |
| | | BigDecimal todayProfit = mallLeaderAchieveMapper.selectProfitByStateAndDateTimeAndUniqueCode(2,DateUtil.date(),loginUser.getInviteId()).setScale(2,BigDecimal.ROUND_DOWN); |
| | | |
| | | BigDecimal totalProfit = mallMoneyFlowMapper.selectAmountByFlowtypeAndType(loginUser.getId(),FlowTypeEnum.BALANCE.getValue(),MoneyFlowTypeEnum.LEADERACHIEVE.getValue(),null,null,null); |
| | | apiLeaderProfitVo.setTotalProfit(totalProfit); |
| | | BigDecimal todayProfit = mallMoneyFlowMapper.selectAmountByFlowtypeAndType(loginUser.getId(),FlowTypeEnum.BALANCE.getValue(), |
| | | MoneyFlowTypeEnum.LEADERACHIEVE.getValue(), |
| | | null,DateUtil.date(), |
| | | null); |
| | | apiLeaderProfitVo.setTodayProfit(todayProfit); |
| | | |
| | | BigDecimal monthProfit = mallMoneyFlowMapper.selectAmountByFlowtypeAndType(loginUser.getId(),FlowTypeEnum.BALANCE.getValue(), |
| | | MoneyFlowTypeEnum.LEADERACHIEVE.getValue(), |
| | | null,null, |
| | | DateUtil.date()); |
| | | apiLeaderProfitVo.setMonthProfit(monthProfit); |
| | | BigDecimal waitProfit = mallLeaderAchieveMapper.selectProfitByStateAndDateTimeAndUniqueCode(1,null,loginUser.getInviteId()).setScale(2,BigDecimal.ROUND_DOWN); |
| | | apiLeaderProfitVo.setWaitProfit(waitProfit); |
| | | BigDecimal totalProfit = mallMoneyFlowMapper.selectAmountByFlowtypeAndType(loginUser.getId(),FlowTypeEnum.BALANCE.getValue(),MoneyFlowTypeEnum.LEADERACHIEVE.getValue(),null); |
| | | apiLeaderProfitVo.setTotalProfit(totalProfit); |
| | | |
| | | return new FebsResponse().success().data(apiLeaderProfitVo); |
| | | } |
| | | |