| | |
| | | package cc.mrbird.febs.mall.controller; |
| | | |
| | | import cc.mrbird.febs.common.annotation.ControllerEndpoint; |
| | | import cc.mrbird.febs.common.entity.FebsResponse; |
| | | import cc.mrbird.febs.common.enumerates.DataDictionaryEnum; |
| | | import cc.mrbird.febs.mall.dto.AdminAgentAmountDto; |
| | |
| | | return new FebsResponse().fail().message("请刷新页面重试"); |
| | | } |
| | | |
| | | DataDictionaryCustom chargeAmountDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(DataDictionaryEnum.CHARGE_AMOUNT.getType(), |
| | | DataDictionaryEnum.CHARGE_AMOUNT.getCode()); |
| | | if(ObjectUtil.isEmpty(chargeAmountDic)){ |
| | | return new FebsResponse().fail().message("请刷新页面重试"); |
| | | } |
| | | |
| | | String giveState = adminAgentAmountDto.getGiveState(); |
| | | if(1 == Integer.parseInt(giveState)){ |
| | | if(ObjectUtil.isEmpty(adminAgentAmountDto.getActivityBulletin())){ |
| | | return new FebsResponse().fail().message("活动公告不能为空"); |
| | | } |
| | | if(ObjectUtil.isEmpty(adminAgentAmountDto.getActivityBulletin()) |
| | | || BigDecimal.ZERO.compareTo(new BigDecimal(adminAgentAmountDto.getActivityBulletin())) > 0){ |
| | | if(ObjectUtil.isEmpty(adminAgentAmountDto.getGiveAmount())){ |
| | | return new FebsResponse().fail().message("请输入正确的赠送金额"); |
| | | } |
| | | if(BigDecimal.ZERO.compareTo(new BigDecimal(adminAgentAmountDto.getGiveAmount())) > 0){ |
| | | return new FebsResponse().fail().message("请输入正确的赠送金额"); |
| | | } |
| | | if(ObjectUtil.isEmpty(adminAgentAmountDto.getChargeAmount())){ |
| | | return new FebsResponse().fail().message("请输入正确的充值金额"); |
| | | } |
| | | if(BigDecimal.ZERO.compareTo(new BigDecimal(adminAgentAmountDto.getChargeAmount())) > 0){ |
| | | return new FebsResponse().fail().message("请输入正确的充值金额"); |
| | | } |
| | | } |
| | | |
| | |
| | | giveAmountDic.setValue(adminAgentAmountDto.getGiveAmount()); |
| | | dataDictionaryCustomMapper.updateById(giveAmountDic); |
| | | |
| | | return new FebsResponse().success(); |
| | | chargeAmountDic.setValue(adminAgentAmountDto.getChargeAmount()); |
| | | dataDictionaryCustomMapper.updateById(chargeAmountDic); |
| | | |
| | | return new FebsResponse().success().message("操作成功"); |
| | | } |
| | | |
| | | @PostMapping(value = "/agentDetail") |