KKSU
2024-07-15 4a347c0ab4b88fd792d24d30bed36b1fa769d3a2
src/main/java/cc/mrbird/febs/dapp/controller/ViewController.java
@@ -7,9 +7,7 @@
import cc.mrbird.febs.dapp.entity.DataDictionaryCustom;
import cc.mrbird.febs.dapp.enumerate.DataDictionaryEnum;
import cc.mrbird.febs.dapp.mapper.DataDictionaryCustomMapper;
import cc.mrbird.febs.dapp.service.DappMemberService;
import cc.mrbird.febs.dapp.vo.AdminSystemFeeVo;
import cn.hutool.core.util.ObjectUtil;
import lombok.RequiredArgsConstructor;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.stereotype.Controller;
@@ -127,27 +125,18 @@
    @RequiresPermissions("fee:setting:view")
    public String systemFeeSet(Model model) {
        AdminSystemFeeVo adminSystemFeeVo = new AdminSystemFeeVo();
        DataDictionaryCustom rebateDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(DataDictionaryEnum.REBATE_PERCENT.getType(), DataDictionaryEnum.REBATE_PERCENT.getCode());
        if (ObjectUtil.isNotEmpty(rebateDic)) {
            String value = rebateDic.getValue() == null ? "0" : rebateDic.getValue();
            adminSystemFeeVo.setRebatePercent(value);
        }
        DataDictionaryCustom memberFeeDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(DataDictionaryEnum.MEMBER_FEE.getType(), DataDictionaryEnum.MEMBER_FEE.getCode());
        if (ObjectUtil.isNotEmpty(memberFeeDic)) {
            String value = memberFeeDic.getValue() == null ? "0" : memberFeeDic.getValue();
            adminSystemFeeVo.setMemberFee(value);
        }
        DataDictionaryCustom serviceFeeDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(DataDictionaryEnum.WITHDRAW_SERVICE_FEE.getType(), DataDictionaryEnum.WITHDRAW_SERVICE_FEE.getCode());
        if (ObjectUtil.isNotEmpty(serviceFeeDic)) {
            String value = serviceFeeDic.getValue() == null ? "0" : serviceFeeDic.getValue();
            adminSystemFeeVo.setServiceFee(value);
        }
        DataDictionaryCustom symbolPrice = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(DataDictionaryEnum.SYMBOL_PRICE.getType(), DataDictionaryEnum.SYMBOL_PRICE.getCode());
        if (ObjectUtil.isNotEmpty(symbolPrice)) {
            String value = symbolPrice.getValue() == null ? "0" : symbolPrice.getValue();
            adminSystemFeeVo.setSymbolPrice(value);
        }
        DataDictionaryCustom dataDictionaryCustom = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
                DataDictionaryEnum.FEE_ADDRESS_KEY.getType(),
                DataDictionaryEnum.FEE_ADDRESS_KEY.getCode());
        adminSystemFeeVo.setAddressKey(dataDictionaryCustom.getValue());
        DataDictionaryCustom addressDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
                DataDictionaryEnum.FEE_ADDRESS.getType(),
                DataDictionaryEnum.FEE_ADDRESS.getCode());
        adminSystemFeeVo.setAddress(addressDic.getValue());
        model.addAttribute("systemFee", adminSystemFeeVo);
        return FebsUtil.view("dapp/system-fee-set");
    }