| | |
| | | import cc.mrbird.febs.common.entity.FebsResponse; |
| | | import cc.mrbird.febs.common.entity.QueryRequest; |
| | | import cc.mrbird.febs.dapp.dto.AddMallGoodsDto; |
| | | import cc.mrbird.febs.dapp.dto.HlmBasicPerkDto; |
| | | import cc.mrbird.febs.dapp.dto.MallGoodsUpdateDto; |
| | | import cc.mrbird.febs.dapp.dto.MallOrderInfoDto; |
| | | import cc.mrbird.febs.dapp.entity.DataDictionaryCustom; |
| | | import cc.mrbird.febs.dapp.entity.MallGoods; |
| | | import cc.mrbird.febs.dapp.entity.MallOrderInfo; |
| | | import cc.mrbird.febs.dapp.enumerate.DataDictionaryEnum; |
| | | import cc.mrbird.febs.dapp.mapper.DappFundFlowDao; |
| | | import cc.mrbird.febs.dapp.mapper.DataDictionaryCustomMapper; |
| | | import cc.mrbird.febs.dapp.mapper.MallGoodsMapper; |
| | | import cc.mrbird.febs.dapp.mapper.MallOrderInfoMapper; |
| | | import cc.mrbird.febs.dapp.service.IAdminMallGoodsService; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.LinkedHashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Slf4j |
| | | @Service |
| | | @RequiredArgsConstructor |
| | |
| | | private final MallGoodsMapper mallGoodsMapper; |
| | | private final MallOrderInfoMapper mallOrderInfoMapper; |
| | | private final DappFundFlowDao dappFundFlowDao; |
| | | private final DataDictionaryCustomMapper dataDictionaryCustomMapper; |
| | | |
| | | @Override |
| | | public IPage<MallGoods> getCategoryListInPage(MallGoods mallGoods, QueryRequest request) { |
| | |
| | | IPage<AdminMallMoneyFlowVo> adminMallMoneyFlowVos = dappFundFlowDao.selectOrderMoneyFlowInPage(page, mallOrder); |
| | | return adminMallMoneyFlowVos; |
| | | } |
| | | |
| | | @Override |
| | | public List<DataDictionaryCustom> findDataDicByType(String type) { |
| | | return dataDictionaryCustomMapper.selectDicByType(type); |
| | | } |
| | | |
| | | @Override |
| | | public void bonusSystemSetting(Map<String, Object> map) { |
| | | for (Map.Entry<String, Object> entry : map.entrySet()) { |
| | | if (entry.getValue() instanceof String) { |
| | | dataDictionaryCustomMapper.updateDicValueByTypeAndCode(null, entry.getKey(), (String) entry.getValue()); |
| | | } else { |
| | | List<LinkedHashMap<String, Object>> value = (List<LinkedHashMap<String, Object>>) entry.getValue(); |
| | | |
| | | for (LinkedHashMap<String, Object> dic : value) { |
| | | String type = (String) dic.get("type"); |
| | | String code = (String) dic.get("code"); |
| | | String dataValue = (String) dic.get("value"); |
| | | dataDictionaryCustomMapper.updateDicValueByTypeAndCode(type, code, dataValue); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void hlmBasicPerk(HlmBasicPerkDto hlmBasicPerkDto) { |
| | | updateDataDic(DataDictionaryEnum.DONATE_SCORE_PERCENT.getType(), |
| | | DataDictionaryEnum.DONATE_SCORE_PERCENT.getCode(), |
| | | hlmBasicPerkDto.getDonateScorePercent()); |
| | | updateDataDic(DataDictionaryEnum.STATIC_RELEASE.getType(), |
| | | DataDictionaryEnum.STATIC_RELEASE.getCode(), |
| | | hlmBasicPerkDto.getStaticRelease()); |
| | | updateDataDic(DataDictionaryEnum.DIRECT_RELEASE.getType(), |
| | | DataDictionaryEnum.DIRECT_RELEASE.getCode(), |
| | | hlmBasicPerkDto.getDirectRelease()); |
| | | updateDataDic(DataDictionaryEnum.MAX_RELEASE.getType(), |
| | | DataDictionaryEnum.MAX_RELEASE.getCode(), |
| | | hlmBasicPerkDto.getMaxRelease()); |
| | | updateDataDic(DataDictionaryEnum.USDT_ORDER_PERCENT.getType(), |
| | | DataDictionaryEnum.USDT_ORDER_PERCENT.getCode(), |
| | | hlmBasicPerkDto.getUsdtOrderRelease()); |
| | | updateDataDic(DataDictionaryEnum.TEAM_PERK_LEVEL_EQUALS.getType(), |
| | | DataDictionaryEnum.TEAM_PERK_LEVEL_EQUALS.getCode(), |
| | | hlmBasicPerkDto.getTeamPerkLevelEquals()); |
| | | updateDataDic(DataDictionaryEnum.MEMBER_BUY_MAX_AMOUNT.getType(), |
| | | DataDictionaryEnum.MEMBER_BUY_MAX_AMOUNT.getCode(), |
| | | hlmBasicPerkDto.getMemberBuyMaxAmount()); |
| | | updateDataDic(DataDictionaryEnum.PACKAGE_TOTAL_SCORE.getType(), |
| | | DataDictionaryEnum.PACKAGE_TOTAL_SCORE.getCode(), |
| | | hlmBasicPerkDto.getPackageTotalScore()); |
| | | updateDataDic(DataDictionaryEnum.PACKAGE_SCORE_PRICE.getType(), |
| | | DataDictionaryEnum.PACKAGE_SCORE_PRICE.getCode(), |
| | | hlmBasicPerkDto.getPackageScorePrice()); |
| | | updateDataDic(DataDictionaryEnum.PACKAGE_SALE_TO_POOR_PERCENT.getType(), |
| | | DataDictionaryEnum.PACKAGE_SALE_TO_POOR_PERCENT.getCode(), |
| | | hlmBasicPerkDto.getPackageSaleToPoorPercent()); |
| | | updateDataDic(DataDictionaryEnum.PACKAGE_POOR.getType(), |
| | | DataDictionaryEnum.PACKAGE_POOR.getCode(), |
| | | hlmBasicPerkDto.getPackagePoor()); |
| | | updateDataDic(DataDictionaryEnum.WITHDRAW_FEE.getType(), |
| | | DataDictionaryEnum.WITHDRAW_FEE.getCode(), |
| | | hlmBasicPerkDto.getWithDrawFee()); |
| | | } |
| | | |
| | | public void updateDataDic(String type, String code, String value) { |
| | | DataDictionaryCustom dic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(type, code); |
| | | if (dic != null) { |
| | | dic.setValue(value); |
| | | dataDictionaryCustomMapper.updateById(dic); |
| | | } |
| | | } |
| | | |
| | | } |