| | |
| | | import cc.mrbird.febs.common.enumerates.DataDictionaryEnum; |
| | | import cc.mrbird.febs.common.enumerates.GreenScoreEnum; |
| | | import cc.mrbird.febs.mall.dto.*; |
| | | import cc.mrbird.febs.mall.entity.DataDictionaryCustom; |
| | | import cc.mrbird.febs.mall.mapper.DataDictionaryCustomMapper; |
| | | import cc.mrbird.febs.mall.service.ICommonService; |
| | | import cc.mrbird.febs.mall.service.IMemberProfitService; |
| | | import cc.mrbird.febs.mall.service.ISystemService; |
| | | import cc.mrbird.febs.rabbit.producter.AgentProducer; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | private ISystemService systemService; |
| | | |
| | | private final ICommonService commonService; |
| | | |
| | | @Autowired |
| | | private IMemberProfitService memberProfitService; |
| | | |
| | | private final AgentProducer agentProducer; |
| | | |
| | | private final DataDictionaryCustomMapper dataDictionaryCustomMapper; |
| | | |
| | | @PostMapping(value = "/bonusSystemSetting") |
| | | public FebsResponse bonusSystemSetting(@RequestBody Map<String, Object> map) { |
| | |
| | | hlmVoucherSetDto.getLevelAchievePercent()); |
| | | return new FebsResponse().success(); |
| | | } |
| | | |
| | | @PostMapping(value = "/hlmVoucherButton") |
| | | public FebsResponse hlmVoucherButton(HlmVoucherButtonDto hlmVoucherButtonDto) { |
| | | BigDecimal scorePrice = new BigDecimal(hlmVoucherButtonDto.getScorePrice()); |
| | | if(scorePrice.compareTo(BigDecimal.ZERO) <= 0){ |
| | | return new FebsResponse().fail().message("请输入合理的价格"); |
| | | } |
| | | |
| | | commonService.updateDataDic( |
| | | GreenScoreEnum.SCORE_PRICE.getType(), |
| | | GreenScoreEnum.SCORE_PRICE.getCode(), |
| | | hlmVoucherButtonDto.getScorePrice()); |
| | | |
| | | commonService.updateDataDic( |
| | | GreenScoreEnum.VOUCHER_ON_OFF.getType(), |
| | | GreenScoreEnum.VOUCHER_ON_OFF.getCode(), |
| | | hlmVoucherButtonDto.getVoucherOnOff()); |
| | | return new FebsResponse().success(); |
| | | } |
| | | |
| | | @PostMapping(value = "/selaHalfVoucher") |
| | | public FebsResponse selaHalfVoucher() { |
| | | DataDictionaryCustom scorePriceDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode( |
| | | GreenScoreEnum.SCORE_PRICE.getType(), |
| | | GreenScoreEnum.SCORE_PRICE.getCode() |
| | | ); |
| | | agentProducer.sendForceVoucherSaleMsg(scorePriceDic.getValue()); |
| | | return new FebsResponse().success(); |
| | | } |
| | | } |