| | |
| | | import cc.mrbird.febs.common.controller.BaseController; |
| | | import cc.mrbird.febs.common.entity.FebsConstant; |
| | | import cc.mrbird.febs.common.utils.FebsUtil; |
| | | import cc.mrbird.febs.dapp.dto.HlmBasicPerkDto; |
| | | import cc.mrbird.febs.dapp.entity.DataDictionaryCustom; |
| | | import cc.mrbird.febs.dapp.entity.MallGoods; |
| | | import cc.mrbird.febs.dapp.enumerate.DataDictionaryEnum; |
| | | import cc.mrbird.febs.dapp.mapper.DataDictionaryCustomMapper; |
| | | import cc.mrbird.febs.dapp.service.IAdminMallGoodsService; |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.apache.shiro.authz.annotation.RequiresPermissions; |
| | | import org.springframework.stereotype.Controller; |
| | |
| | | public class ViewAdminMallGoodsController extends BaseController { |
| | | |
| | | private final IAdminMallGoodsService mallGoodsService; |
| | | private final DataDictionaryCustomMapper dataDictionaryCustomMapper; |
| | | |
| | | /** |
| | | * 商品列表 |
| | |
| | | idOrderMoneyFlow = id; |
| | | return FebsUtil.view("goods/orderMoneyFlow"); |
| | | } |
| | | |
| | | @GetMapping("profitSetting") |
| | | @RequiresPermissions("profitSetting:view") |
| | | public String profitSetting() { |
| | | return FebsUtil.view("goods/profitSetting"); |
| | | } |
| | | |
| | | @GetMapping("basicPerk") |
| | | @RequiresPermissions("basicPerk:view") |
| | | public String basicPerkSetting(Model model) { |
| | | HlmBasicPerkDto hlmBasicPerkDto = new HlmBasicPerkDto(); |
| | | DataDictionaryCustom donateScorePercentDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode( |
| | | DataDictionaryEnum.DONATE_SCORE_PERCENT.getType(), |
| | | DataDictionaryEnum.DONATE_SCORE_PERCENT.getCode()); |
| | | if (donateScorePercentDic != null) { |
| | | String donateScorePercent = ObjectUtil.isEmpty(donateScorePercentDic.getValue()) ? "0" : donateScorePercentDic.getValue(); |
| | | hlmBasicPerkDto.setDonateScorePercent(donateScorePercent); |
| | | } |
| | | DataDictionaryCustom staticReleaseDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode( |
| | | DataDictionaryEnum.STATIC_RELEASE.getType(), |
| | | DataDictionaryEnum.STATIC_RELEASE.getCode()); |
| | | if (staticReleaseDic != null) { |
| | | String staticRelease = ObjectUtil.isEmpty(staticReleaseDic.getValue()) ? "0" : staticReleaseDic.getValue(); |
| | | hlmBasicPerkDto.setStaticRelease(staticRelease); |
| | | } |
| | | DataDictionaryCustom directReleaseDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode( |
| | | DataDictionaryEnum.DIRECT_RELEASE.getType(), |
| | | DataDictionaryEnum.DIRECT_RELEASE.getCode()); |
| | | if (directReleaseDic != null) { |
| | | String directRelease = ObjectUtil.isEmpty(directReleaseDic.getValue()) ? "0" : directReleaseDic.getValue(); |
| | | hlmBasicPerkDto.setDirectRelease(directRelease); |
| | | } |
| | | DataDictionaryCustom maxReleaseDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode( |
| | | DataDictionaryEnum.MAX_RELEASE.getType(), |
| | | DataDictionaryEnum.MAX_RELEASE.getCode()); |
| | | if (maxReleaseDic != null) { |
| | | String maxRelease = ObjectUtil.isEmpty(maxReleaseDic.getValue()) ? "0" : maxReleaseDic.getValue(); |
| | | hlmBasicPerkDto.setMaxRelease(maxRelease); |
| | | } |
| | | DataDictionaryCustom usdtOrderReleaseDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode( |
| | | DataDictionaryEnum.USDT_ORDER_PERCENT.getType(), |
| | | DataDictionaryEnum.USDT_ORDER_PERCENT.getCode()); |
| | | if (usdtOrderReleaseDic != null) { |
| | | String usdtOrderRelease = ObjectUtil.isEmpty(usdtOrderReleaseDic.getValue()) ? "0" : usdtOrderReleaseDic.getValue(); |
| | | hlmBasicPerkDto.setUsdtOrderRelease(usdtOrderRelease); |
| | | } |
| | | DataDictionaryCustom teamPerkLevelEqualsDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode( |
| | | DataDictionaryEnum.TEAM_PERK_LEVEL_EQUALS.getType(), |
| | | DataDictionaryEnum.TEAM_PERK_LEVEL_EQUALS.getCode()); |
| | | if (teamPerkLevelEqualsDic != null) { |
| | | String teamPerkLevelEquals = ObjectUtil.isEmpty(teamPerkLevelEqualsDic.getValue()) ? "0" : teamPerkLevelEqualsDic.getValue(); |
| | | hlmBasicPerkDto.setTeamPerkLevelEquals(teamPerkLevelEquals); |
| | | } |
| | | DataDictionaryCustom memberBuyMaxAmountDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode( |
| | | DataDictionaryEnum.MEMBER_BUY_MAX_AMOUNT.getType(), |
| | | DataDictionaryEnum.MEMBER_BUY_MAX_AMOUNT.getCode()); |
| | | if (memberBuyMaxAmountDic != null) { |
| | | String memberBuyMaxAmount = ObjectUtil.isEmpty(memberBuyMaxAmountDic.getValue()) ? "0" : memberBuyMaxAmountDic.getValue(); |
| | | hlmBasicPerkDto.setMemberBuyMaxAmount(memberBuyMaxAmount); |
| | | } |
| | | DataDictionaryCustom packagePoorDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode( |
| | | DataDictionaryEnum.PACKAGE_POOR.getType(), |
| | | DataDictionaryEnum.PACKAGE_POOR.getCode()); |
| | | if (packagePoorDic != null) { |
| | | String packagePoor = ObjectUtil.isEmpty(packagePoorDic.getValue()) ? "0" : packagePoorDic.getValue(); |
| | | hlmBasicPerkDto.setPackagePoor(packagePoor); |
| | | } |
| | | DataDictionaryCustom packageTotalScoreDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode( |
| | | DataDictionaryEnum.PACKAGE_TOTAL_SCORE.getType(), |
| | | DataDictionaryEnum.PACKAGE_TOTAL_SCORE.getCode()); |
| | | if (packageTotalScoreDic != null) { |
| | | String packageTotalScore = ObjectUtil.isEmpty(packageTotalScoreDic.getValue()) ? "0" : packageTotalScoreDic.getValue(); |
| | | hlmBasicPerkDto.setPackageTotalScore(packageTotalScore); |
| | | } |
| | | DataDictionaryCustom packageScorePriceDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode( |
| | | DataDictionaryEnum.PACKAGE_SCORE_PRICE.getType(), |
| | | DataDictionaryEnum.PACKAGE_SCORE_PRICE.getCode()); |
| | | if (packageScorePriceDic != null) { |
| | | String packageScorePrice = ObjectUtil.isEmpty(packageScorePriceDic.getValue()) ? "0" : packageScorePriceDic.getValue(); |
| | | hlmBasicPerkDto.setPackageScorePrice(packageScorePrice); |
| | | } |
| | | DataDictionaryCustom packageSaleToPoorPercentDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode( |
| | | DataDictionaryEnum.PACKAGE_SALE_TO_POOR_PERCENT.getType(), |
| | | DataDictionaryEnum.PACKAGE_SALE_TO_POOR_PERCENT.getCode()); |
| | | if (packageSaleToPoorPercentDic != null) { |
| | | String packageSaleToPoorPercent = ObjectUtil.isEmpty(packageSaleToPoorPercentDic.getValue()) ? "0" : packageSaleToPoorPercentDic.getValue(); |
| | | hlmBasicPerkDto.setPackageSaleToPoorPercent(packageSaleToPoorPercent); |
| | | } |
| | | DataDictionaryCustom withDrawFeeDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode( |
| | | DataDictionaryEnum.WITHDRAW_FEE.getType(), |
| | | DataDictionaryEnum.WITHDRAW_FEE.getCode()); |
| | | if (withDrawFeeDic != null) { |
| | | String withDrawFee = ObjectUtil.isEmpty(withDrawFeeDic.getValue()) ? "0" : withDrawFeeDic.getValue(); |
| | | hlmBasicPerkDto.setWithDrawFee(withDrawFee); |
| | | } |
| | | model.addAttribute("hlmBasicPerk", hlmBasicPerkDto); |
| | | return FebsUtil.view("goods/basicPerkSetting"); |
| | | } |
| | | } |