| | |
| | | import cc.mrbird.febs.common.enumerates.AgentLevelEnum; |
| | | import cc.mrbird.febs.common.enumerates.DataDictionaryEnum; |
| | | import cc.mrbird.febs.common.enumerates.OrderPayMethodEnum; |
| | | import cc.mrbird.febs.common.enumerates.PerkEnum; |
| | | import cc.mrbird.febs.common.service.ValidateCodeService; |
| | | import cc.mrbird.febs.common.utils.FebsUtil; |
| | | import cc.mrbird.febs.common.utils.RedisUtils; |
| | |
| | | import cc.mrbird.febs.mall.dto.ScoreSettingDto; |
| | | import cc.mrbird.febs.mall.entity.DataDictionaryCustom; |
| | | import cc.mrbird.febs.mall.entity.MallMember; |
| | | import cc.mrbird.febs.mall.mapper.DataDictionaryCustomMapper; |
| | | import cc.mrbird.febs.mall.mapper.MallAchieveRecordMapper; |
| | | import cc.mrbird.febs.mall.mapper.MallMemberMapper; |
| | | import cc.mrbird.febs.mall.mapper.MallOrderInfoMapper; |
| | | import cc.mrbird.febs.mall.mapper.*; |
| | | import cc.mrbird.febs.mall.vo.AdminPerkSetVo; |
| | | import cc.mrbird.febs.mall.vo.AdminPoolSetVo; |
| | | import cc.mrbird.febs.monitor.service.ILoginLogService; |
| | | import cc.mrbird.febs.system.service.IUserService; |
| | | import cn.hutool.core.date.DateUtil; |
| | |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.*; |
| | | |
| | | |
| | |
| | | private final MallMemberMapper mallMemberMapper; |
| | | private final MallOrderInfoMapper mallOrderInfoMapper; |
| | | private final MallAchieveRecordMapper mallAchieveRecordMapper; |
| | | private final MallMemberWalletMapper mallMemberWalletMapper; |
| | | private final RedisUtils redisUtils; |
| | | |
| | | @GetMapping("profitSetting") |
| | |
| | | data.put("lastMonth", mallAchieveRecordMapper.selectAchieveTotal("M", DateUtil.offsetMonth(new Date(), -1))); |
| | | data.put("thisMonth", mallAchieveRecordMapper.selectAchieveTotal("M", new Date())); |
| | | |
| | | data.put("totalBalance",mallMemberWalletMapper.selectSumBalance().setScale(2, BigDecimal.ROUND_DOWN)); |
| | | data.put("totalScore",mallMemberWalletMapper.selectSumScore().setScale(2, BigDecimal.ROUND_DOWN)); |
| | | data.put("totalPrizeScore",mallMemberWalletMapper.selectSumPrizeScore().setScale(2, BigDecimal.ROUND_DOWN)); |
| | | data.put("totalCommission",mallMemberWalletMapper.selectSumCommission().setScale(2, BigDecimal.ROUND_DOWN)); |
| | | |
| | | //会员数据 |
| | | data.put("totalMember",mallMemberMapper.selectCount(new QueryWrapper<>()) ); |
| | | QueryWrapper<MallMember> formalMember = new QueryWrapper<>(); |
| | |
| | | model.addAttribute("indexData", data); |
| | | return FebsUtil.view("modules/system/indexData"); |
| | | } |
| | | |
| | | @GetMapping("perkSet") |
| | | @RequiresPermissions("perkSet:view") |
| | | public String perkSet(Model model) { |
| | | AdminPerkSetVo adminPerkSetVo = new AdminPerkSetVo(); |
| | | DataDictionaryCustom buySetMealPerkPercentDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode( |
| | | PerkEnum.BUY_SET_MEAL_PERK_PERCENT.getType(), |
| | | PerkEnum.BUY_SET_MEAL_PERK_PERCENT.getCode()); |
| | | if (buySetMealPerkPercentDic != null) { |
| | | adminPerkSetVo.setBuySetMealPerkPercent(buySetMealPerkPercentDic.getValue()); |
| | | } |
| | | DataDictionaryCustom directCashPerkPercentDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode( |
| | | PerkEnum.DIRECT_CASH_PERK_PERCENT.getType(), |
| | | PerkEnum.DIRECT_CASH_PERK_PERCENT.getCode()); |
| | | if (directCashPerkPercentDic != null) { |
| | | adminPerkSetVo.setDirectCashPerkPercent(directCashPerkPercentDic.getValue()); |
| | | } |
| | | DataDictionaryCustom directScorePerkPercentDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode( |
| | | PerkEnum.DIRECT_SCORE_PERK_PERCENT.getType(), |
| | | PerkEnum.DIRECT_SCORE_PERK_PERCENT.getCode()); |
| | | if (directScorePerkPercentDic != null) { |
| | | adminPerkSetVo.setDirectScorePerkPercent(directScorePerkPercentDic.getValue()); |
| | | } |
| | | DataDictionaryCustom directorCashPerkPercentDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode( |
| | | PerkEnum.DIRECTOR_CASH_PERK_PERCENT.getType(), |
| | | PerkEnum.DIRECTOR_CASH_PERK_PERCENT.getCode()); |
| | | if (directorCashPerkPercentDic != null) { |
| | | adminPerkSetVo.setDirectorCashPerkPercent(directorCashPerkPercentDic.getValue()); |
| | | } |
| | | DataDictionaryCustom partnerCashPerkPercentDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode( |
| | | PerkEnum.PARTNER_CASH_PERK_PERCENT.getType(), |
| | | PerkEnum.PARTNER_CASH_PERK_PERCENT.getCode()); |
| | | if (partnerCashPerkPercentDic != null) { |
| | | adminPerkSetVo.setPartnerCashPerkPercent(partnerCashPerkPercentDic.getValue()); |
| | | } |
| | | |
| | | model.addAttribute("adminPerkSet", adminPerkSetVo); |
| | | return FebsUtil.view("modules/system/perkSet"); |
| | | } |
| | | |
| | | @GetMapping("poolSet") |
| | | @RequiresPermissions("poolSet:view") |
| | | public String poolSet(Model model) { |
| | | AdminPoolSetVo adminPoolSetVo = new AdminPoolSetVo(); |
| | | DataDictionaryCustom poolCashDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode( |
| | | PerkEnum.POOL_CASH.getType(), |
| | | PerkEnum.POOL_CASH.getCode()); |
| | | if (poolCashDic != null) { |
| | | adminPoolSetVo.setPoolCash(poolCashDic.getValue()); |
| | | } |
| | | DataDictionaryCustom poolScoreDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode( |
| | | PerkEnum.POOL_SCORE.getType(), |
| | | PerkEnum.POOL_SCORE.getCode()); |
| | | if (poolScoreDic != null) { |
| | | adminPoolSetVo.setPoolScore(poolScoreDic.getValue()); |
| | | } |
| | | DataDictionaryCustom poolScorePriceDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode( |
| | | PerkEnum.POOL_SCORE_PRICE.getType(), |
| | | PerkEnum.POOL_SCORE_PRICE.getCode()); |
| | | if (poolScorePriceDic != null) { |
| | | adminPoolSetVo.setPoolScorePrice(poolScorePriceDic.getValue()); |
| | | } |
| | | DataDictionaryCustom poolCashPercentDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode( |
| | | PerkEnum.POOL_CASH_PERCENT.getType(), |
| | | PerkEnum.POOL_CASH_PERCENT.getCode()); |
| | | if (poolCashPercentDic != null) { |
| | | adminPoolSetVo.setPoolCashPercent(poolCashPercentDic.getValue()); |
| | | } |
| | | DataDictionaryCustom poolScorePercentDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode( |
| | | PerkEnum.POOL_SCORE_PERCENT.getType(), |
| | | PerkEnum.POOL_SCORE_PERCENT.getCode()); |
| | | 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"); |
| | | } |
| | | } |