From 28c42b48519e0ecb123b6945ad2f1c46af49af04 Mon Sep 17 00:00:00 2001 From: cabbage <281119120@qq.com> Date: Thu, 10 Jul 2025 14:29:19 +0800 Subject: [PATCH] =?UTF-8?q?##=20=E5=95=86=E5=93=81=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=9D=83=E9=99=90=E6=8E=A7=E5=88=B6=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/config/AdvertBannerServiceApi.java | 25 --- .../service/impl/BdWaresBonusServiceImpl.java | 31 ++- .../api/ApiRetailWaresController.java | 31 ++- .../controller/api/ApiBdWaresController.java | 179 ++++++------------ .../sale/wares/mapper/BdWaresLabelMapper.java | 3 - .../wares/service/IBdWaresLabelService.java | 9 +- .../wares/service/IBdWaresRangeService.java | 9 - .../service/impl/BdWaresLabelServiceImpl.java | 9 - .../service/impl/BdWaresRangeServiceImpl.java | 30 +-- .../system/config/mapper/BdRangeMapper.java | 6 - .../provider/AdvertBannerServiceProvider.java | 48 ----- .../config/provider/RangeServiceProvider.java | 22 +-- .../config/service/IBdRangeService.java | 30 +-- .../service/impl/BdRangeServiceImpl.java | 58 +----- .../core/constant/SystemFieldConstants.java | 45 ----- .../domain/sale/wares/BdWaresLabel.java | 5 - .../common/domain/system/config/BdRange.java | 9 +- 17 files changed, 132 insertions(+), 417 deletions(-) delete mode 100644 bd-api/bd-api-system/src/main/java/com/hzs/system/config/AdvertBannerServiceApi.java delete mode 100644 bd-business/bd-business-system/src/main/java/com/hzs/system/config/provider/AdvertBannerServiceProvider.java diff --git a/bd-api/bd-api-system/src/main/java/com/hzs/system/config/AdvertBannerServiceApi.java b/bd-api/bd-api-system/src/main/java/com/hzs/system/config/AdvertBannerServiceApi.java deleted file mode 100644 index 2c4cbec6..00000000 --- a/bd-api/bd-api-system/src/main/java/com/hzs/system/config/AdvertBannerServiceApi.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.hzs.system.config; - -import com.hzs.common.core.domain.R; -import com.hzs.system.config.dto.AdvertBannerDTO; - -import java.util.List; - -/** - * @BelongsProject: hzs_cloud - * @BelongsPackage: com.hzs.system.config - * @Author: yh - * @CreateTime: 2023-05-15 10:15 - * @Description: - * @Version: 1.0 - */ -public interface AdvertBannerServiceApi { - - /** - * 查询全部banner - * - * @return - */ - R> findAll(); - -} diff --git a/bd-business/bd-business-bonus/src/main/java/com/hzs/bonus/bonus/service/impl/BdWaresBonusServiceImpl.java b/bd-business/bd-business-bonus/src/main/java/com/hzs/bonus/bonus/service/impl/BdWaresBonusServiceImpl.java index cbc2708f..d1434865 100644 --- a/bd-business/bd-business-bonus/src/main/java/com/hzs/bonus/bonus/service/impl/BdWaresBonusServiceImpl.java +++ b/bd-business/bd-business-bonus/src/main/java/com/hzs/bonus/bonus/service/impl/BdWaresBonusServiceImpl.java @@ -1,14 +1,13 @@ package com.hzs.bonus.bonus.service.impl; import cn.hutool.core.bean.BeanUtil; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.hzs.bonus.bonus.mapper.BdWaresBonusMapper; import com.hzs.bonus.bonus.param.BdWaresBonusParam; import com.hzs.bonus.bonus.service.IBdWaresBonusItemsService; import com.hzs.bonus.bonus.service.IBdWaresBonusService; -import com.hzs.common.core.constant.SystemFieldConstants; import com.hzs.common.core.enums.EYesNo; import com.hzs.common.core.utils.DateUtils; import com.hzs.common.domain.member.bonus.BdWaresBonus; @@ -29,7 +28,7 @@ import java.util.List; public class BdWaresBonusServiceImpl extends ServiceImpl implements IBdWaresBonusService { @Autowired - private IBdWaresBonusItemsService waresBonusItemsService; + private IBdWaresBonusItemsService iBdWaresBonusItemsService; @Override public List querySpecialWaresBonus(BdWaresBonusParam waresBonusParam) { @@ -40,21 +39,21 @@ public class BdWaresBonusServiceImpl extends ServiceImpl updateWrapper = new UpdateWrapper<>(); - updateWrapper.set(SystemFieldConstants.PK_MODIFIED, userId); - updateWrapper.set(SystemFieldConstants.DEL_FLAG, EYesNo.NO.getIntValue()); - updateWrapper.set(SystemFieldConstants.MODIFIED_TIME, DateUtils.currentDateTime()); - updateWrapper.eq(SystemFieldConstants.PK_ID, pkId); + iBdWaresBonusItemsService.deleteWaresBonusItems(null, pkId, userId); + LambdaUpdateWrapper updateWrapper = new LambdaUpdateWrapper<>(); + updateWrapper.set(BdWaresBonus::getPkModified, userId); + updateWrapper.set(BdWaresBonus::getDelFlag, EYesNo.NO.getIntValue()); + updateWrapper.set(BdWaresBonus::getModifiedTime, DateUtils.currentDateTime()); + updateWrapper.eq(BdWaresBonus::getPkId, pkId); update(updateWrapper); } @Override public BdWaresBonus queryWaresBonusById(BdWaresBonusParam waresBonusParam) { - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq(SystemFieldConstants.PK_WARES, waresBonusParam.getPkWares()); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(BdWaresBonus::getPkWares, waresBonusParam.getPkWares()); if (waresBonusParam.getPkId() != null) { - queryWrapper.ne(SystemFieldConstants.PK_ID, waresBonusParam.getPkId()); + queryWrapper.ne(BdWaresBonus::getPkId, waresBonusParam.getPkId()); } return baseMapper.selectOne(queryWrapper); } @@ -91,12 +90,12 @@ public class BdWaresBonusServiceImpl extends ServiceImpl 0) { // 删除 - waresBonusItemsService.deleteWaresBonusItems(updateWaresBonusItems, updateWaresBonusItems.get(0).getPkWaresBonus(), userId); - waresBonusItemsService.updateWaresBonusItems(updateWaresBonusItems); + iBdWaresBonusItemsService.deleteWaresBonusItems(updateWaresBonusItems, updateWaresBonusItems.get(0).getPkWaresBonus(), userId); + iBdWaresBonusItemsService.updateWaresBonusItems(updateWaresBonusItems); } // 新增 if (insertWaresBonusItems.size() > 0) { - waresBonusItemsService.insetWaresBonusItems(insertWaresBonusItems); + iBdWaresBonusItemsService.insetWaresBonusItems(insertWaresBonusItems); } } diff --git a/bd-business/bd-business-sale/src/main/java/com/hzs/retail/wares/controller/api/ApiRetailWaresController.java b/bd-business/bd-business-sale/src/main/java/com/hzs/retail/wares/controller/api/ApiRetailWaresController.java index 7d49159d..feea16a2 100644 --- a/bd-business/bd-business-sale/src/main/java/com/hzs/retail/wares/controller/api/ApiRetailWaresController.java +++ b/bd-business/bd-business-sale/src/main/java/com/hzs/retail/wares/controller/api/ApiRetailWaresController.java @@ -17,14 +17,12 @@ import com.hzs.common.core.web.domain.AjaxResult; import com.hzs.common.domain.member.ext.CuMemberExt; import com.hzs.common.domain.sale.ext.BdWaresExt; import com.hzs.common.domain.sale.ext.BdWaresSpecsSkuExt; -import com.hzs.common.domain.sale.wares.BdWares; -import com.hzs.common.domain.sale.wares.BdWaresLabel; -import com.hzs.common.domain.sale.wares.BdWaresRange; -import com.hzs.common.domain.sale.wares.BdWaresSpecsSku; +import com.hzs.common.domain.sale.wares.*; import com.hzs.common.domain.system.config.BdLabel; import com.hzs.common.domain.system.ext.BdLabelExt; import com.hzs.common.security.utils.SecurityUtils; import com.hzs.member.base.IMemberServiceApi; +import com.hzs.member.base.dto.ShowWaresDTO; import com.hzs.retail.wares.param.RetailWaresDetailParam; import com.hzs.retail.wares.param.RetailWaresParam; import com.hzs.retail.wares.vo.RetailWaresDetailVO; @@ -68,7 +66,7 @@ public class ApiRetailWaresController extends BaseController { private IBdWaresRangeService iBdWaresRangeService; @DubboReference - ICurrencyServiceApi currencyServiceApi; + ICurrencyServiceApi iCurrencyServiceApi; @DubboReference IAreaCurrencyServiceApi iAreaCurrencyServiceApi; @DubboReference @@ -94,7 +92,6 @@ public class ApiRetailWaresController extends BaseController { param.setSystemType(SecurityUtils.getSystemType()); param.setPkCountry(SecurityUtils.getPkCountry()); // 商品列表 - startPage(); List bdWaresExtList = iBdWaresService.listRetailWaresByCondition(param); if (CollectionUtil.isNotEmpty(bdWaresExtList)) { @@ -177,9 +174,11 @@ public class ApiRetailWaresController extends BaseController { Integer pkGrade, boolean showLabel) { // 返回商品列表 List resultList = new ArrayList<>(); + // 当前会员ID + Long userId = SecurityUtils.getUserId(); // 汇率比例 - R currency = currencyServiceApi.getCurrency(SecurityUtils.getPkCountry()); + R currency = iCurrencyServiceApi.getCurrency(SecurityUtils.getPkCountry()); BigDecimal inExchangeRate = currency.getData().getInExchangeRate(); // 商品主键列表 @@ -208,7 +207,25 @@ public class ApiRetailWaresController extends BaseController { } } + // 检验商品团队信息 + Map> waresAuthorityMap = iBdWaresService.getWaresAuthority(waresIdList); + List showWaresList = bdWaresExtList.stream().map(tmpBdWares -> { + ShowWaresDTO showWaresDTO = new ShowWaresDTO(); + showWaresDTO.setPkWares(tmpBdWares.getPkId()); + showWaresDTO.setLoginMember(userId); + showWaresDTO.setWaresAuthorityList(waresAuthorityMap.get(tmpBdWares.getPkId())); + return showWaresDTO; + }).collect(Collectors.toList()); + R> waresShowMapDto = iMemberServiceApi.checkIsShowWares(showWaresList); + Map waresShowMap = waresShowMapDto.getData(); + for (BdWaresExt bdWaresExt : bdWaresExtList) { + // 校验团队信息 + Boolean isShowWares = waresShowMap.get(bdWaresExt.getPkId()); + if (null == isShowWares || !isShowWares) { + continue; + } + if (null != list) { // 商品标签处理 // 保证标签 diff --git a/bd-business/bd-business-sale/src/main/java/com/hzs/sale/wares/controller/api/ApiBdWaresController.java b/bd-business/bd-business-sale/src/main/java/com/hzs/sale/wares/controller/api/ApiBdWaresController.java index 02bcf28c..f926b94c 100644 --- a/bd-business/bd-business-sale/src/main/java/com/hzs/sale/wares/controller/api/ApiBdWaresController.java +++ b/bd-business/bd-business-sale/src/main/java/com/hzs/sale/wares/controller/api/ApiBdWaresController.java @@ -5,7 +5,7 @@ import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.date.DateUtil; import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson2.JSONArray; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.hzs.common.core.constant.*; import com.hzs.common.core.constant.msg.SaOrderMsgConstants; import com.hzs.common.core.constant.msg.WaresMsgConstants; @@ -35,7 +35,6 @@ import com.hzs.sale.wares.service.*; import com.hzs.sale.wares.vo.*; import com.hzs.system.base.ICurrencyServiceApi; import com.hzs.system.base.dto.CurrencyDTO; -import com.hzs.system.config.AdvertBannerServiceApi; import com.hzs.system.config.IAreaCurrencyServiceApi; import com.hzs.system.config.IGradeServiceApi; import com.hzs.system.config.dto.AreaCurrencyDTO; @@ -60,52 +59,34 @@ import java.util.stream.Collectors; public class ApiBdWaresController extends BaseController { @DubboReference - IGradeServiceApi gradeServiceApi; + IGradeServiceApi iGradeServiceApi; @DubboReference - IMemberServiceApi memberServiceApi; + IMemberServiceApi iMemberServiceApi; @DubboReference - IAreaCurrencyServiceApi areaCurrencyServiceApi; + IAreaCurrencyServiceApi iAreaCurrencyServiceApi; @DubboReference - ICurrencyServiceApi currencyServiceApi; + ICurrencyServiceApi iCurrencyServiceApi; @Autowired - private IBdWaresLabelService waresLabelService; + private IBdWaresService iBdWaresService; @Autowired - private IBdWaresGradeService waresGradeService; + private IBdWaresSpecsSkuService iBdWaresSpecsSkuService; + @Autowired + private IBdWaresLabelService iBdWaresLabelService; + @Autowired + private IBdWaresGradeService iBdWaresGradeService; + @Autowired + private IBdWaresRangeService iBdWaresRangeService; + @Autowired + protected IShoppingCartService iShoppingCartService; + @Autowired + private ISaOrderService iSaOrderService; + @Autowired protected RedisService redisService; @Autowired protected StringRedisTemplate redisTemplate; - @Autowired - protected IShoppingCartService shoppingCartService; - private IBdWaresService bdWaresService; - - private IBdWaresSpecsSkuService bdWaresSpecsSkuService; - - private IBdWaresRangeService bdWaresRangeService; - - private ISaOrderService saOrderService; - - @Autowired - public void setSaOrderService(ISaOrderService saOrderService) { - this.saOrderService = saOrderService; - } - - @Autowired - public void setBdWaresRangeService(IBdWaresRangeService bdWaresRangeService) { - this.bdWaresRangeService = bdWaresRangeService; - } - - @Autowired - public void setBdWaresSpecsSkuService(IBdWaresSpecsSkuService bdWaresSpecsSkuService) { - this.bdWaresSpecsSkuService = bdWaresSpecsSkuService; - } - - @Autowired - public void setBdWaresService(IBdWaresService bdWaresService) { - this.bdWaresService = bdWaresService; - } /** * 根据专区查找专区的商品 @@ -117,48 +98,42 @@ public class ApiBdWaresController extends BaseController { if (cuWaresParams.getSpecialArea() == null) { return AjaxResult.error(TransactionUtils.getContent(SaOrderMsgConstants.SPECIAL_AREA_NOT_EMPTY)); } - - Integer pkCountry; - if (cuWaresParams.getPkCountry() != null) { - pkCountry = cuWaresParams.getPkCountry(); - } else { - pkCountry = SecurityUtils.getPkCountry(); - } + Integer pkCountry = cuWaresParams.getPkCountry() != null ? cuWaresParams.getPkCountry() : SecurityUtils.getPkCountry(); // 返回数据 List waresParamsList = new ArrayList<>(); // 查询商品列表 - List bdWaresExtList = bdWaresService.queryWaresByCondition(cuWaresParams.getSpecialArea(), cuWaresParams.getPkAreaClassify(), cuWaresParams.getWaresName(), null, null, pkCountry); + List bdWaresExtList = iBdWaresService.queryWaresByCondition(cuWaresParams.getSpecialArea(), cuWaresParams.getPkAreaClassify(), cuWaresParams.getWaresName(), null, null, pkCountry); if (CollectionUtil.isNotEmpty(bdWaresExtList)) { // 等级 - R> gradeDTO = gradeServiceApi.queryGradeList(pkCountry); + R> gradeDTO = iGradeServiceApi.queryGradeList(pkCountry); List gradeList = gradeDTO.getData(); Map gradeMap = gradeList.stream().filter(grade -> ESystemType.DEFAULT.getValue() == grade.getSystemType()).collect(Collectors.toMap(GradeDTO::getGradeValue, Function.identity())); // 当前会员ID Long userId = SecurityUtils.getUserId(); - CuMember cuMember = saOrderService.getCuMemberByKey(userId); + CuMember cuMember = iSaOrderService.getCuMemberByKey(userId); // 当前会员编号 String memberCode = cuMember.getMemberCode(); // 汇率比例 - R currency = currencyServiceApi.getCurrency(SecurityUtils.getPkCountry()); + R currency = iCurrencyServiceApi.getCurrency(SecurityUtils.getPkCountry()); BigDecimal inExchangeRate = currency.getData().getInExchangeRate(); // 商品主键列表 List waresIdList = bdWaresExtList.stream().map(BdWares::getPkId).collect(Collectors.toList()); // 检验商品团队信息 - Map> waresAuthorityMap = bdWaresService.getWaresAuthority(waresIdList); + Map> waresAuthorityMap = iBdWaresService.getWaresAuthority(waresIdList); List showWaresList = bdWaresExtList.stream().map(we -> getShowWares(we.getPkId(), userId, memberCode, waresAuthorityMap)).collect(Collectors.toList()); - R> waresShowMapDto = memberServiceApi.checkIsShowWares(showWaresList); + R> waresShowMapDto = iMemberServiceApi.checkIsShowWares(showWaresList); Map waresShowMap = waresShowMapDto.getData(); // 商品标签列表 BdWaresLabel waresLabel = new BdWaresLabel(); waresLabel.setPkIdList(waresIdList); - List list = waresLabelService.selectByList(waresLabel); + List list = iBdWaresLabelService.selectByList(waresLabel); // 标签 for (BdWaresExt bdWaresExt : bdWaresExtList) { @@ -193,14 +168,14 @@ public class ApiBdWaresController extends BaseController { // 查询商品sku 最小值 和数量 Map> waresSpecsSkuMap = new HashMap<>(); if (waresIdList.size() > 0) { - List waresSpecsSkuArray = bdWaresSpecsSkuService.selectByMinWaresSpecsSkuByPkWaresList(waresIdList); + List waresSpecsSkuArray = iBdWaresSpecsSkuService.selectByMinWaresSpecsSkuByPkWaresList(waresIdList); waresSpecsSkuMap = waresSpecsSkuArray.stream().collect(Collectors.groupingBy(BdWaresSpecsSkuExt::getPkWares)); } List waresSpecsSkuList = new ArrayList<>(); if (waresIdList.size() > 0) { // 查询默认规格 - waresSpecsSkuList = bdWaresSpecsSkuService.selectByWaresSpecsSku(waresIdList); + waresSpecsSkuList = iBdWaresSpecsSkuService.selectByWaresSpecsSku(waresIdList); } List bdWaresRangeList = new ArrayList<>(); @@ -209,14 +184,14 @@ public class ApiBdWaresController extends BaseController { || EOrderType.COOPERATE_ORDER.getValue() == cuWaresParams.getSpecialArea()) { // 复购业绩计算 if (waresIdList.size() > 0) { - bdWaresRangeList = bdWaresRangeService.queryWaresRangeByCondition(cuMember, waresIdList); + bdWaresRangeList = iBdWaresRangeService.queryWaresRangeByCondition(cuMember, waresIdList); } } Set waresIdSet = new HashSet<>(); List authWaresList = new ArrayList<>(); if (waresIdList.size() > 0) { // 处理商品权限 - List waresGradeAwardsList = waresGradeService.queryWaresGradeAwards(waresIdList); + List waresGradeAwardsList = iBdWaresGradeService.queryWaresGradeAwards(waresIdList); // 先处理没有配置等级、奖衔的商品 waresGradeAwardsList.forEach(waresGradeAwards -> { waresIdSet.add(waresGradeAwards.getPkWares()); @@ -225,9 +200,6 @@ public class ApiBdWaresController extends BaseController { }); } - // 海粉等级实体 - GradeDTO haiFanGradeDTO = gradeMap.get(EGrade.HAI_FAN.getValue()); - for (BdWaresExt waresExt : bdWaresExtList) { // 校验团队信息 Boolean isShowWares = waresShowMap.get(waresExt.getPkId()); @@ -283,14 +255,6 @@ public class ApiBdWaresController extends BaseController { // 零售价 retailPrice = retailPrice.add(bdWaresSpecsSkuExt.getRetailPrice().multiply(BigDecimal.valueOf(bdWaresSpecsSkuExt.getQuantity()))); } - if (cuWaresParams.getPkCountry() != null && !pkCountry.equals(SecurityUtils.getPkCountry())) { - // 当登陆人的结算国和前端结算国不一致 即为跨国报单 - if (!pkCountry.equals(SecurityUtils.getPkCountry())) { - // 跨国报单 跨国汇率 - R kgCurrency = currencyServiceApi.getCurrency(pkCountry); - waresPrice = waresPrice.multiply(inExchangeRate).divide(kgCurrency.getData().getInExchangeRate(), 2, BigDecimal.ROUND_HALF_UP); - } - } } // 计算商品列表价格和业绩最小值 @@ -344,7 +308,7 @@ public class ApiBdWaresController extends BaseController { } List areaCurrencyDTOList = new ArrayList<>(); if (pkCurrencySet.size() > 0) { - areaCurrencyDTOList = areaCurrencyServiceApi.queryAreaCurrencyBySpecialArea(pkCurrencySet, EAccount.REPEAT.getValue()); + areaCurrencyDTOList = iAreaCurrencyServiceApi.queryAreaCurrencyBySpecialArea(pkCurrencySet, EAccount.REPEAT.getValue()); } for (CuWaresParams waresParams : waresParamsList) { @@ -370,7 +334,7 @@ public class ApiBdWaresController extends BaseController { **/ private BigDecimal getSpecialDeductRatio(CuWaresParams cuWaresParams, Integer pkCountry, Integer accountValue) { // 查询专区所属币种 - List areaCurrencyDTOList = areaCurrencyServiceApi.queryAreaCurrencyByCondition(cuWaresParams.getSpecialArea(), pkCountry).getData(); + List areaCurrencyDTOList = iAreaCurrencyServiceApi.queryAreaCurrencyByCondition(cuWaresParams.getSpecialArea(), pkCountry).getData(); BigDecimal elseRatio = BigDecimal.ZERO; BigDecimal deductRatio = BigDecimal.ZERO; boolean flag = false; @@ -422,13 +386,8 @@ public class ApiBdWaresController extends BaseController { return AjaxResult.error(WaresMsgConstants.WARES_NUMBER_DOES_NOT_EXIST); } Long loginMemberId = SecurityUtils.getUserId(); - Integer pkCountry; - if (cuWaresParams.getPkCountry() == null) { - pkCountry = SecurityUtils.getPkCountry(); - } else { - pkCountry = cuWaresParams.getPkCountry(); - } - cuWaresParams = bdWaresSpecsSkuService.queryWaresSpecsSku(cuWaresParams.getSpecialArea(), cuWaresParams.getWaresCode(), loginMemberId, pkCountry); + Integer pkCountry = cuWaresParams.getPkCountry() == null ? SecurityUtils.getPkCountry() : cuWaresParams.getPkCountry(); + cuWaresParams = iBdWaresSpecsSkuService.queryWaresSpecsSku(cuWaresParams.getSpecialArea(), cuWaresParams.getWaresCode(), loginMemberId, pkCountry); // 预计发货时间(秒) if (cuWaresParams.getArrivalTime() != null && cuWaresParams.getCreationTime() != null) { @@ -455,7 +414,7 @@ public class ApiBdWaresController extends BaseController { List areaCurrencyDTOList = new ArrayList<>(); if (pkCurrencySet.size() > 0) { - areaCurrencyDTOList = areaCurrencyServiceApi.queryAreaCurrencyBySpecialArea(pkCurrencySet, EAccount.REPEAT.getValue()); + areaCurrencyDTOList = iAreaCurrencyServiceApi.queryAreaCurrencyBySpecialArea(pkCurrencySet, EAccount.REPEAT.getValue()); } cuWaresParams.setDeductMoney(ComputeUtil.computeBonusMultiply(cuWaresParams.getWaresPrice(), deductRatio)); if (areaCurrencyDTOList.size() > 0) { @@ -483,19 +442,19 @@ public class ApiBdWaresController extends BaseController { if (cuWaresItemsParams.getWaresCode() == null || cuWaresItemsParams.getPkWaresDetail() == null) { return AjaxResult.error(WaresMsgConstants.WARES_NUMBER_DOES_NOT_EXIST); } - return AjaxResult.success(bdWaresSpecsSkuService.queryWaresDetailSkuBySpecs(cuWaresItemsParams)); + return AjaxResult.success(iBdWaresSpecsSkuService.queryWaresDetailSkuBySpecs(cuWaresItemsParams)); } /** * 查询商品 */ - @PostMapping("get-wares-agreement") + @PostMapping("/get-wares-agreement") public AjaxResult getWaresAgreement(@RequestBody WaresAgrementParam waresAgrementParam) { if (waresAgrementParam.getWaresCodeList().size() == 0) { return AjaxResult.error(TransactionUtils.getContent(WaresMsgConstants.WARES_CODE_NOT_NULL)); } - List waresExtList = bdWaresService.selectByWaresCodeList(waresAgrementParam.getWaresCodeList()); + List waresExtList = iBdWaresService.selectByWaresCodeList(waresAgrementParam.getWaresCodeList()); OrderAlertVo orderAlertVo = new OrderAlertVo(); Integer alertTime = 0; orderAlertVo.setWaresExtList(waresExtList); @@ -518,34 +477,28 @@ public class ApiBdWaresController extends BaseController { if (cuWaresParams.getSpecialArea() == null) { return AjaxResult.error(TransactionUtils.getContent(SaOrderMsgConstants.SPECIAL_AREA_NOT_EMPTY)); } - - Integer pkCountry; - if (cuWaresParams.getPkCountry() != null) { - pkCountry = cuWaresParams.getPkCountry(); - } else { - pkCountry = SecurityUtils.getPkCountry(); - } + Integer pkCountry = cuWaresParams.getPkCountry() != null ? cuWaresParams.getPkCountry() : SecurityUtils.getPkCountry(); // 返回数据列表 List waresParamsList = new ArrayList<>(); // 查询商品列表 - List bdWaresExtList = bdWaresService.queryRecommendWaresByCondition(cuWaresParams.getSpecialArea(), cuWaresParams.getPkAreaClassify(), cuWaresParams.getWaresName(), pkCountry); + List bdWaresExtList = iBdWaresService.queryRecommendWaresByCondition(cuWaresParams.getSpecialArea(), cuWaresParams.getPkAreaClassify(), cuWaresParams.getWaresName(), pkCountry); if (CollectionUtil.isNotEmpty(bdWaresExtList)) { // 商品ID列表 List pkWaresIds = bdWaresExtList.stream().map(BdWares::getPkId).collect(Collectors.toList()); // 当前会员 - CuMember cuMember = saOrderService.getCuMemberByKey(SecurityUtils.getUserId()); + CuMember cuMember = iSaOrderService.getCuMemberByKey(SecurityUtils.getUserId()); // 汇率比例 - R currency = currencyServiceApi.getCurrency(pkCountry); + R currency = iCurrencyServiceApi.getCurrency(pkCountry); BigDecimal inExchangeRate = currency.getData().getInExchangeRate(); // 查询商品标签列表 BdWaresLabel waresLabel = new BdWaresLabel(); waresLabel.setPkIdList(pkWaresIds); - List labelList = waresLabelService.selectByList(waresLabel); + List labelList = iBdWaresLabelService.selectByList(waresLabel); // 标签 for (BdWaresExt bdWaresExt : bdWaresExtList) { @@ -578,7 +531,7 @@ public class ApiBdWaresController extends BaseController { Map> waresSpecsSkuMap = new HashMap<>(); if (pkWaresIds.size() > 0) { - List waresSpecsSkuArray = bdWaresSpecsSkuService.selectByMinWaresSpecsSkuByPkWaresList(pkWaresIds); + List waresSpecsSkuArray = iBdWaresSpecsSkuService.selectByMinWaresSpecsSkuByPkWaresList(pkWaresIds); waresSpecsSkuMap = waresSpecsSkuArray.stream().collect(Collectors.groupingBy(BdWaresSpecsSkuExt::getPkWares)); } @@ -596,7 +549,7 @@ public class ApiBdWaresController extends BaseController { bdWaresExtList.forEach(we -> { waresIdSet.add(we.getPkId()); }); - List bdWaresRangeList = bdWaresRangeService.queryWaresRangeByCondition(cuMember, waresIdSet); + List bdWaresRangeList = iBdWaresRangeService.queryWaresRangeByCondition(cuMember, waresIdSet); for (BdWaresRange bdWaresRange : bdWaresRangeList) { if (waresExt.getPkId().intValue() == bdWaresRange.getPkWares().intValue()) { waresPrice = waresPrice.add(bdWaresRange.getPrice()); @@ -627,29 +580,20 @@ public class ApiBdWaresController extends BaseController { waresParams.setAssAchieve(assAchieve); // 商品业绩计算汇率 if (waresParams.getWaresAchieve() != null) { - if (pkCountry.equals(CountryConstants.CHINA_COUNTRY)) { - waresParams.setWaresAchieve(waresParams.getWaresAchieve().multiply(inExchangeRate)); - - } else { - waresParams.setWaresAchieve(waresParams.getWaresAchieve()); - } + waresParams.setWaresAchieve(waresParams.getWaresAchieve().multiply(inExchangeRate)); } else { waresParams.setWaresAchieve(BigDecimal.ZERO); } // 商品bv 计算 if (waresParams.getAssAchieve() != null) { - if (pkCountry.equals(CountryConstants.CHINA_COUNTRY)) { - waresParams.setAssAchieve(waresParams.getAssAchieve().multiply(inExchangeRate)); - } else { - waresParams.setAssAchieve(waresParams.getAssAchieve()); - } + waresParams.setAssAchieve(waresParams.getAssAchieve().multiply(inExchangeRate)); } else { waresParams.setAssAchieve(BigDecimal.ZERO); } // 查询默认规格 JSONArray jsonArray = new JSONArray(); - List list = bdWaresSpecsSkuService.selectByWaresSpecsSku(Collections.singletonList(waresExt.getPkId())); + List list = iBdWaresSpecsSkuService.selectByWaresSpecsSku(Collections.singletonList(waresExt.getPkId())); List collect = list.stream().filter(DistinctByKeyUtil.distinctByKey(BdWaresSpecsSku::getPkWaresDetail)).collect(Collectors.toList()); for (BdWaresSpecsSkuExt bdWaresSpecsSku : collect) { JSONObject js = new JSONObject(); @@ -660,9 +604,9 @@ public class ApiBdWaresController extends BaseController { } waresParams.setProductGroup(jsonArray); // 查询等级配置 - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("PK_WARES", waresExt.getPkId()); - List waresGradeList = waresGradeService.list(queryWrapper); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(BdWaresGrade::getPkWares, waresExt.getPkId()); + List waresGradeList = iBdWaresGradeService.list(queryWrapper); if (waresGradeList.size() > 0) { // 查询等级和商品是否存在 不存在不返回该数据 for (BdWaresGrade bdWaresGrade : waresGradeList) { @@ -670,7 +614,6 @@ public class ApiBdWaresController extends BaseController { if (pkSettleGrade.equals(bdWaresGrade.getPkRange())) { waresParamsList.add(waresParams); } - } } else { waresParamsList.add(waresParams); @@ -685,18 +628,17 @@ public class ApiBdWaresController extends BaseController { * * @return */ - @PostMapping("get-wares-info") + @PostMapping("/get-wares-info") public AjaxResult getWaresInfo(@RequestBody WaresInfoParam waresInfoParam) { - BdWares wares = bdWaresService.getWares(waresInfoParam.getPkWares()); + BdWares wares = iBdWaresService.getWares(waresInfoParam.getPkWares()); WaresInfoVo waresInfoVo = new WaresInfoVo(); waresInfoVo.setWaresName(wares.getWaresName()); - waresInfoVo.setNumber(waresInfoParam.getNumber()); waresInfoVo.setPkWares(wares.getPkId()); waresInfoVo.setCover(wares.getCover1()); List waresSpecsSkuList = waresInfoParam.getWaresSpecsSku().stream().map(WaresSpecsSkuParam::getPkWaresSpecsSku).collect(Collectors.toList()); - List waresItemWaresInfos = bdWaresSpecsSkuService.selectByPkIds(waresSpecsSkuList); + List waresItemWaresInfos = iBdWaresSpecsSkuService.selectByPkIds(waresSpecsSkuList); BigDecimal waresPrice = BigDecimal.ZERO; BigDecimal pv = BigDecimal.ZERO; BigDecimal waresPriceAmount = BigDecimal.ZERO; @@ -711,14 +653,11 @@ public class ApiBdWaresController extends BaseController { } } } - Integer pkCountry = SecurityUtils.getPkCountry(); - if (CountryConstants.CHINA_COUNTRY.equals(pkCountry)) { - R currency = currencyServiceApi.getCurrency(pkCountry); - // 汇率比例 - BigDecimal inExchangeRate = currency.getData().getInExchangeRate(); - pv = ComputeUtil.computeMultiply(pv, inExchangeRate); - pvAmount = ComputeUtil.computeMultiply(pvAmount, inExchangeRate); - } + R currency = iCurrencyServiceApi.getCurrency(SecurityUtils.getPkCountry()); + // 汇率比例 + BigDecimal inExchangeRate = currency.getData().getInExchangeRate(); + pv = ComputeUtil.computeMultiply(pv, inExchangeRate); + pvAmount = ComputeUtil.computeMultiply(pvAmount, inExchangeRate); waresInfoVo.setWaresPrice(waresPrice); waresInfoVo.setPv(pv); waresInfoVo.setWaresCode(wares.getWaresCode()); diff --git a/bd-business/bd-business-sale/src/main/java/com/hzs/sale/wares/mapper/BdWaresLabelMapper.java b/bd-business/bd-business-sale/src/main/java/com/hzs/sale/wares/mapper/BdWaresLabelMapper.java index e69d017f..52d2d68e 100644 --- a/bd-business/bd-business-sale/src/main/java/com/hzs/sale/wares/mapper/BdWaresLabelMapper.java +++ b/bd-business/bd-business-sale/src/main/java/com/hzs/sale/wares/mapper/BdWaresLabelMapper.java @@ -8,9 +8,6 @@ import java.util.List; /** * 商品标签表 Mapper 接口 - * - * @author hzs - * @since 2022-10-21 */ public interface BdWaresLabelMapper extends BaseMapper { diff --git a/bd-business/bd-business-sale/src/main/java/com/hzs/sale/wares/service/IBdWaresLabelService.java b/bd-business/bd-business-sale/src/main/java/com/hzs/sale/wares/service/IBdWaresLabelService.java index 5cf7fdbb..e4ca53cd 100644 --- a/bd-business/bd-business-sale/src/main/java/com/hzs/sale/wares/service/IBdWaresLabelService.java +++ b/bd-business/bd-business-sale/src/main/java/com/hzs/sale/wares/service/IBdWaresLabelService.java @@ -8,12 +8,15 @@ import java.util.List; /** * 商品标签表 服务类 - * - * @author hzs - * @since 2022-10-21 */ public interface IBdWaresLabelService extends IService { + /** + * 根据商品查询 商品所属标签 + * + * @param waresLabel + * @return + */ List selectByList(BdWaresLabel waresLabel); } diff --git a/bd-business/bd-business-sale/src/main/java/com/hzs/sale/wares/service/IBdWaresRangeService.java b/bd-business/bd-business-sale/src/main/java/com/hzs/sale/wares/service/IBdWaresRangeService.java index a0b2b369..84938b5d 100644 --- a/bd-business/bd-business-sale/src/main/java/com/hzs/sale/wares/service/IBdWaresRangeService.java +++ b/bd-business/bd-business-sale/src/main/java/com/hzs/sale/wares/service/IBdWaresRangeService.java @@ -8,9 +8,6 @@ import java.util.List; /** * 极差明细表 服务类 - * - * @author hzs - * @since 2022-09-09 */ public interface IBdWaresRangeService extends IService { @@ -19,9 +16,6 @@ public interface IBdWaresRangeService extends IService { * * @param cuMember 会员 * @param pkWareList 商品主键 - * @return: List - * @Author: sui q - * @Date: 2022/9/26 16:48 */ List queryWaresRangeByCondition(CuMember cuMember, List pkWareList); @@ -32,9 +26,6 @@ public interface IBdWaresRangeService extends IService { * @param rangeType 类型 * @param level 基本 * @param specsSkuList 最小库存单位 - * @return: List - * @Author: sui q - * @Date: 2022/9/26 15:33 */ List querySkuWaresRangeByCondition(Integer pkCountry, Integer rangeType, Integer level, List specsSkuList); diff --git a/bd-business/bd-business-sale/src/main/java/com/hzs/sale/wares/service/impl/BdWaresLabelServiceImpl.java b/bd-business/bd-business-sale/src/main/java/com/hzs/sale/wares/service/impl/BdWaresLabelServiceImpl.java index ff7276bc..dc4159aa 100644 --- a/bd-business/bd-business-sale/src/main/java/com/hzs/sale/wares/service/impl/BdWaresLabelServiceImpl.java +++ b/bd-business/bd-business-sale/src/main/java/com/hzs/sale/wares/service/impl/BdWaresLabelServiceImpl.java @@ -13,19 +13,10 @@ import java.util.List; /** * 商品标签表 服务实现类 - * - * @author hzs - * @since 2022-10-21 */ @Service public class BdWaresLabelServiceImpl extends ServiceImpl implements IBdWaresLabelService { - /** - * 根据商品查询 商品所属标签 - * - * @param waresLabel - * @return - */ @Override public List selectByList(BdWaresLabel waresLabel) { return baseMapper.selectByList(waresLabel); diff --git a/bd-business/bd-business-sale/src/main/java/com/hzs/sale/wares/service/impl/BdWaresRangeServiceImpl.java b/bd-business/bd-business-sale/src/main/java/com/hzs/sale/wares/service/impl/BdWaresRangeServiceImpl.java index 595dca55..d4c27c99 100644 --- a/bd-business/bd-business-sale/src/main/java/com/hzs/sale/wares/service/impl/BdWaresRangeServiceImpl.java +++ b/bd-business/bd-business-sale/src/main/java/com/hzs/sale/wares/service/impl/BdWaresRangeServiceImpl.java @@ -1,10 +1,9 @@ package com.hzs.sale.wares.service.impl; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.hzs.common.core.constant.CountryConstants; -import com.hzs.common.core.constant.SystemFieldConstants; import com.hzs.common.core.enums.EAwards; import com.hzs.common.core.enums.ERangeType; import com.hzs.common.domain.member.base.CuMember; @@ -23,28 +22,25 @@ import java.util.List; /** * 极差明细表 服务实现类 - * - * @author hzs - * @since 2022-09-09 */ @Service public class BdWaresRangeServiceImpl extends ServiceImpl implements IBdWaresRangeService { @DubboReference - IRangeServiceApi rangeServiceApi; + IRangeServiceApi iRangeServiceApi; @DubboReference - IAwardsServiceApi awardsServiceApi; + IAwardsServiceApi iAwardsServiceApi; @Override public List queryWaresRangeByCondition(CuMember cuMember, List pkWareList) { int level = cuMember.getPkSettleGrade(); int rangeType = ERangeType.GRADE.getValue(); - BdAwards bdAwards = awardsServiceApi.getAwardsOne(cuMember.getPkAwards()).getData(); + BdAwards bdAwards = iAwardsServiceApi.getAwardsOne(cuMember.getPkAwards()).getData(); if (bdAwards.getAwardsValue() > EAwards.MEMBER.getValue()) { level = cuMember.getPkAwards(); rangeType = ERangeType.AWARDS.getValue(); } - RangeDTO rangeDTO = rangeServiceApi.queryRangeDtoByCondition(cuMember.getPkSettleCountry(), rangeType, level).getData(); + RangeDTO rangeDTO = iRangeServiceApi.queryRangeDtoByCondition(cuMember.getPkSettleCountry(), rangeType, level).getData(); if (rangeDTO == null) { return new ArrayList<>(); } @@ -53,19 +49,13 @@ public class BdWaresRangeServiceImpl extends ServiceImpl querySkuWaresRangeByCondition(Integer pkCountry, Integer rangeType, Integer level, List specsSkuList) { - RangeDTO rangeDTO = rangeServiceApi.queryRangeDtoByCondition(pkCountry, rangeType, level).getData(); - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq(SystemFieldConstants.PK_RANGE, rangeDTO.getPkRange()); - queryWrapper.in(SystemFieldConstants.PK_WARES_SPECS_SKU, specsSkuList); + RangeDTO rangeDTO = iRangeServiceApi.queryRangeDtoByCondition(pkCountry, rangeType, level).getData(); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(BdWaresRange::getPkRange, rangeDTO.getPkRange()); + queryWrapper.in(BdWaresRange::getPkWaresSpecsSku, specsSkuList); return baseMapper.selectList(queryWrapper); } - /** - * 以range 为主表查询商品极差信息 - * - * @param pkWares - * @return - */ @Override public List queryWaresList(Long pkWares, Integer pkCountry) { return baseMapper.queryWaresList(pkWares, pkCountry); @@ -74,7 +64,7 @@ public class BdWaresRangeServiceImpl extends ServiceImpl listRetailWaresRange(Integer pkGrade, List pkWareList) { // 新零售只有等级级差,不需要处理奖衔 - RangeDTO rangeDTO = rangeServiceApi.queryRangeDtoByCondition(CountryConstants.CHINA_COUNTRY, ERangeType.GRADE.getValue(), pkGrade).getData(); + RangeDTO rangeDTO = iRangeServiceApi.queryRangeDtoByCondition(CountryConstants.CHINA_COUNTRY, ERangeType.GRADE.getValue(), pkGrade).getData(); if (rangeDTO == null) { return new ArrayList<>(); } diff --git a/bd-business/bd-business-system/src/main/java/com/hzs/system/config/mapper/BdRangeMapper.java b/bd-business/bd-business-system/src/main/java/com/hzs/system/config/mapper/BdRangeMapper.java index dd022fcc..e7699143 100644 --- a/bd-business/bd-business-system/src/main/java/com/hzs/system/config/mapper/BdRangeMapper.java +++ b/bd-business/bd-business-system/src/main/java/com/hzs/system/config/mapper/BdRangeMapper.java @@ -9,9 +9,6 @@ import java.util.List; /** * 极差配置 Mapper 接口 - * - * @author zhangjing - * @since 2022-09-09 */ public interface BdRangeMapper extends BaseMapper { @@ -21,9 +18,6 @@ public interface BdRangeMapper extends BaseMapper { * @param pkCountry 国家 * @param rangeType 极差类型 * @param pkLevel 等级 - * @return: Map - * @Author: sui q - * @Date: 2023/1/3 14:00 */ List queryRangeDto(@Param("pkCountry") Integer pkCountry, @Param("rangeType") Integer rangeType, diff --git a/bd-business/bd-business-system/src/main/java/com/hzs/system/config/provider/AdvertBannerServiceProvider.java b/bd-business/bd-business-system/src/main/java/com/hzs/system/config/provider/AdvertBannerServiceProvider.java deleted file mode 100644 index 254799f1..00000000 --- a/bd-business/bd-business-system/src/main/java/com/hzs/system/config/provider/AdvertBannerServiceProvider.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.hzs.system.config.provider; - -import cn.hutool.core.bean.BeanUtil; -import cn.hutool.core.collection.CollectionUtil; -import com.hzs.common.core.domain.R; -import com.hzs.common.domain.system.config.BdAdvertBanner; -import com.hzs.system.config.AdvertBannerServiceApi; -import com.hzs.system.config.dto.AdvertBannerDTO; -import com.hzs.system.config.service.IBdAdvertBannerService; -import org.apache.dubbo.config.annotation.DubboService; -import org.springframework.beans.factory.annotation.Autowired; - -import java.util.ArrayList; -import java.util.List; -import java.util.stream.Collectors; - -/** - * @BelongsProject: hzs_cloud - * @BelongsPackage: com.hzs.system.config.provider - * @Author: yh - * @CreateTime: 2023-05-15 10:14 - * @Description: - * @Version: 1.0 - */ -@DubboService -public class AdvertBannerServiceProvider implements AdvertBannerServiceApi { - - @Autowired - private IBdAdvertBannerService advertBannerService; - - /** - * 查询全部banner - * - * @return - */ - @Override - public R> findAll() { - List bannerDTOList = new ArrayList<>(); - - List bannerList = advertBannerService.listData(null); - if (CollectionUtil.isNotEmpty(bannerList)) { - bannerDTOList = bannerList.stream().map(advertBanner -> BeanUtil.copyProperties(advertBanner, AdvertBannerDTO.class)).collect(Collectors.toList()); - } - - return R.ok(bannerDTOList); - } - -} diff --git a/bd-business/bd-business-system/src/main/java/com/hzs/system/config/provider/RangeServiceProvider.java b/bd-business/bd-business-system/src/main/java/com/hzs/system/config/provider/RangeServiceProvider.java index 40dcf6bf..7a6f778c 100644 --- a/bd-business/bd-business-system/src/main/java/com/hzs/system/config/provider/RangeServiceProvider.java +++ b/bd-business/bd-business-system/src/main/java/com/hzs/system/config/provider/RangeServiceProvider.java @@ -12,37 +12,27 @@ import java.util.List; import java.util.Map; /** - * @description: 极差配置 - * @author: zhang jing - * @date: 2022/11/10 17:02 - * @param: - * @return: + * 极差配置 **/ @DubboService public class RangeServiceProvider implements IRangeServiceApi { @Autowired - private IBdRangeService rangeService; + private IBdRangeService iBdRangeService; - /** - * @description: 根据国家查询极差配置列表 - * @author: zhang jing - * @date: 2022/9/29 15:17 - * @param: [pkCountry] - * @return: com.hzs.common.core.domain.R> - **/ @Override public R> queryRange(Integer pkCountry) { - return R.ok(rangeService.queryRange(pkCountry)); + return R.ok(iBdRangeService.queryRange(pkCountry)); } @Override public R> queryRangeDto() { - return R.ok(rangeService.queryRangeDto()); + return R.ok(iBdRangeService.queryRangeDto()); } @Override public R queryRangeDtoByCondition(Integer pkCountry, Integer rangeType, Integer pkLevel) { - return R.ok(rangeService.getRangeDTO(pkCountry, rangeType, pkLevel)); + return R.ok(iBdRangeService.getRangeDTO(pkCountry, rangeType, pkLevel)); } + } diff --git a/bd-business/bd-business-system/src/main/java/com/hzs/system/config/service/IBdRangeService.java b/bd-business/bd-business-system/src/main/java/com/hzs/system/config/service/IBdRangeService.java index 47d4ba31..8653eadd 100644 --- a/bd-business/bd-business-system/src/main/java/com/hzs/system/config/service/IBdRangeService.java +++ b/bd-business/bd-business-system/src/main/java/com/hzs/system/config/service/IBdRangeService.java @@ -9,48 +9,27 @@ import java.util.List; import java.util.Map; /** - *

* 极差配置 服务类 - *

- * - * @author zhangjing - * @since 2022-09-09 */ public interface IBdRangeService extends IService { /** - * @description: 新增极差 - * @author: zhang jing - * @date: 2022/10/28 14:23 - * @param: [rangeExt] - * @return: boolean + * 新增极差 **/ boolean saveRange(BdRangeExt rangeExt); /** - * @description: 修改极差 - * @author: zhang jing - * @date: 2022/10/28 14:23 - * @param: [rangeExt] - * @return: boolean + * 修改极差 **/ boolean updateRange(BdRangeExt rangeExt); /** - * @description: 根据国家查询极差配置列表 - * @author: zhang jing - * @date: 2022/11/11 18:02 - * @param: [pkCountry] - * @return: java.util.List + * 根据国家查询极差配置列表 **/ List queryRange(Integer pkCountry); /** * 查询各个国家极差的配置 键为 国家+极差类型+等级主键 - * - * @return: Map - * @Author: sui q - * @Date: 2023/1/3 14:00 */ Map queryRangeDto(); @@ -60,9 +39,6 @@ public interface IBdRangeService extends IService { * @param pkCountry 国家 * @param rangeType 极差类型 * @param pkLevel 等级主键 - * @return: RangeDTO - * @Author: sui q - * @Date: 2023/2/4 15:54 */ RangeDTO getRangeDTO(Integer pkCountry, Integer rangeType, Integer pkLevel); } diff --git a/bd-business/bd-business-system/src/main/java/com/hzs/system/config/service/impl/BdRangeServiceImpl.java b/bd-business/bd-business-system/src/main/java/com/hzs/system/config/service/impl/BdRangeServiceImpl.java index 2092ee79..20798de2 100644 --- a/bd-business/bd-business-system/src/main/java/com/hzs/system/config/service/impl/BdRangeServiceImpl.java +++ b/bd-business/bd-business-system/src/main/java/com/hzs/system/config/service/impl/BdRangeServiceImpl.java @@ -7,20 +7,17 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.hzs.common.core.constant.CacheConstants; import com.hzs.common.core.constant.Constants; -import com.hzs.common.core.domain.R; import com.hzs.common.core.enums.*; import com.hzs.common.core.service.RedisService; import com.hzs.common.domain.system.config.BdRange; import com.hzs.common.domain.system.config.BdRangeDetails; import com.hzs.common.domain.system.config.ext.BdRangeExt; import com.hzs.common.security.utils.SecurityUtils; -import com.hzs.system.base.ITransactionServiceApi; import com.hzs.system.config.dto.RangeDTO; import com.hzs.system.config.mapper.BdRangeMapper; import com.hzs.system.config.service.IBdRangeDetailsService; import com.hzs.system.config.service.IBdRangeService; import lombok.extern.slf4j.Slf4j; -import org.apache.dubbo.config.annotation.DubboReference; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -29,40 +26,18 @@ import java.util.concurrent.TimeUnit; /** * 极差配置 服务实现类 - * - * @author zhangjing - * @since 2022-09-09 */ @Slf4j @Service public class BdRangeServiceImpl extends ServiceImpl implements IBdRangeService { @Autowired - private IBdRangeDetailsService rangeDetailsService; - - @DubboReference - ITransactionServiceApi iTransactionServiceApi; - + private IBdRangeDetailsService iBdRangeDetailsService; + @Autowired private RedisService redisService; - @Autowired - public void setRedisService(RedisService redisService) { - this.redisService = redisService; - } - - /** - * @description: 新增极差 - * @author: zhang jing - * @date: 2022/10/28 14:23 - * @param: [rangeExt] - * @return: boolean - **/ @Override public boolean saveRange(BdRangeExt rangeExt) { - //字段翻译保存到数据库 - R pkTransaction = iTransactionServiceApi.createTransaction(rangeExt.getPkCountry(), ETransactionKey.RANGE, - rangeExt.getRangeName(), EYesNo.YES, EYesNo.NO); - rangeExt.setPkTransaction(pkTransaction.getData()); LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); queryWrapper.eq(BdRange::getPkCountry, rangeExt.getPkCountry()); queryWrapper.eq(BdRange::getRangeValue, rangeExt.getRangeValue()); @@ -80,7 +55,7 @@ public class BdRangeServiceImpl extends ServiceImpl impl rangeDetails.setPkCountry(SecurityUtils.getPkCountry()); rangeDetails.setPkCreator(SecurityUtils.getUserId()); rangeDetails.setCreationTime(new Date()); - rangeDetailsService.save(rangeDetails); + iBdRangeDetailsService.save(rangeDetails); } //奖衔 for (Integer aw : awardsList) { @@ -91,31 +66,20 @@ public class BdRangeServiceImpl extends ServiceImpl impl rangeDetails.setPkCountry(SecurityUtils.getPkCountry()); rangeDetails.setPkCreator(SecurityUtils.getUserId()); rangeDetails.setCreationTime(new Date()); - rangeDetailsService.save(rangeDetails); + iBdRangeDetailsService.save(rangeDetails); } } redisService.deleteObject(CacheConstants.BD_RANGE + rangeExt.getPkCountry()); return true; } - /** - * @description: 修改极差 - * @author: zhang jing - * @date: 2022/10/28 14:23 - * @param: [rangeExt] - * @return: boolean - **/ @Override public boolean updateRange(BdRangeExt rangeExt) { - //字段翻译保存到数据库 - R pkTransaction = iTransactionServiceApi.createTransaction(rangeExt.getPkCountry(), ETransactionKey.RANGE, - rangeExt.getRangeName(), EYesNo.YES, EYesNo.NO); - rangeExt.setPkTransaction(pkTransaction.getData()); baseMapper.updateById(rangeExt); LambdaUpdateWrapper updateWrapper = new LambdaUpdateWrapper<>(); updateWrapper.set(BdRangeDetails::getDelFlag, EYesNo.NO.getIntValue()); updateWrapper.eq(BdRangeDetails::getPkRange, rangeExt.getPkId()); - rangeDetailsService.update(updateWrapper); + iBdRangeDetailsService.update(updateWrapper); List gradeList = rangeExt.getGradeList(); List awardsList = rangeExt.getAwardsList(); //等级 @@ -127,7 +91,7 @@ public class BdRangeServiceImpl extends ServiceImpl impl rangeDetails.setPkCountry(SecurityUtils.getPkCountry()); rangeDetails.setPkCreator(SecurityUtils.getUserId()); rangeDetails.setCreationTime(new Date()); - rangeDetailsService.save(rangeDetails); + iBdRangeDetailsService.save(rangeDetails); } //奖衔 for (Integer aw : awardsList) { @@ -138,20 +102,12 @@ public class BdRangeServiceImpl extends ServiceImpl impl rangeDetails.setPkCountry(SecurityUtils.getPkCountry()); rangeDetails.setPkCreator(SecurityUtils.getUserId()); rangeDetails.setCreationTime(new Date()); - rangeDetailsService.save(rangeDetails); + iBdRangeDetailsService.save(rangeDetails); } redisService.deleteObject(CacheConstants.BD_RANGE + rangeExt.getPkCountry()); return true; } - - /** - * @description: 根据国家查询极差配置列表 - * @author: zhang jing - * @date: 2022/11/11 18:07 - * @param: [pkCountry] - * @return: java.util.List - **/ @Override public List queryRange(Integer pkCountry) { List rangeList = redisService.getCacheList(CacheConstants.BD_RANGE + pkCountry); diff --git a/bd-common/bd-common-core/src/main/java/com/hzs/common/core/constant/SystemFieldConstants.java b/bd-common/bd-common-core/src/main/java/com/hzs/common/core/constant/SystemFieldConstants.java index 3b86b93f..cef33d53 100644 --- a/bd-common/bd-common-core/src/main/java/com/hzs/common/core/constant/SystemFieldConstants.java +++ b/bd-common/bd-common-core/src/main/java/com/hzs/common/core/constant/SystemFieldConstants.java @@ -55,11 +55,6 @@ public class SystemFieldConstants { */ public static final String MODIFIED_TIME = "MODIFIED_TIME"; - /** - * 国家 - */ - public static final String PK_COUNTRY_VALUE = "pkCountry"; - /** * 国家 */ @@ -70,46 +65,6 @@ public class SystemFieldConstants { */ public static final String PK_CORP = "pk_corp"; - /** - * 等级值 - */ - public static final String GRADE_VALUE = "grade_value"; - - /** - * 等级结算值 - */ - public static final String START_VALUE = "start_value"; - - /** - * 极差类型 - */ - public static final String RANGE_TYPE = "range_type"; - - /** - * 级别 - */ - public static final String PK_LEVEL = "pk_level"; - - /** - * 极差 - */ - public static final String PK_RANGE = "pk_range"; - - /** - * 规格sku主键 - */ - public static final String PK_WARES_SPECS_SKU = "pk_wares_specs_sku"; - - /** - * 商品明细主键 - */ - public static final String PK_WARES_DETAIL = "PK_WARES_DETAIL"; - - /** - * 商品主键 - */ - public static final String PK_WARES = "PK_WARES"; - /** * 审核状态 */ diff --git a/bd-common/bd-common-domain/src/main/java/com/hzs/common/domain/sale/wares/BdWaresLabel.java b/bd-common/bd-common-domain/src/main/java/com/hzs/common/domain/sale/wares/BdWaresLabel.java index 0c9030e9..f3b84c82 100644 --- a/bd-common/bd-common-domain/src/main/java/com/hzs/common/domain/sale/wares/BdWaresLabel.java +++ b/bd-common/bd-common-domain/src/main/java/com/hzs/common/domain/sale/wares/BdWaresLabel.java @@ -12,12 +12,7 @@ import lombok.experimental.Accessors; import java.util.List; /** - *

* 商品标签表 - *

- * - * @author hzs - * @since 2022-10-21 */ @Data @EqualsAndHashCode(callSuper = true) diff --git a/bd-common/bd-common-domain/src/main/java/com/hzs/common/domain/system/config/BdRange.java b/bd-common/bd-common-domain/src/main/java/com/hzs/common/domain/system/config/BdRange.java index ffc8df0f..ab328ee9 100644 --- a/bd-common/bd-common-domain/src/main/java/com/hzs/common/domain/system/config/BdRange.java +++ b/bd-common/bd-common-domain/src/main/java/com/hzs/common/domain/system/config/BdRange.java @@ -15,12 +15,7 @@ import lombok.experimental.Accessors; import java.math.BigDecimal; /** - *

* 极差配置 - *

- * - * @author zhangjing - * @since 2022-09-09 */ @Data @EqualsAndHashCode(callSuper = true) @@ -37,7 +32,7 @@ public class BdRange extends BaseEntity { /** * 极差名称 */ - @Excel(name = "极差名称",sort=1) + @Excel(name = "极差名称", sort = 1) @TableField("RANGE_NAME") private String rangeName; /** @@ -46,7 +41,7 @@ public class BdRange extends BaseEntity { @TableField("RANGE_VALUE") @Transaction(transactionKey = EnumsPrefixConstants.AWARDS) private Integer rangeValue; - @Excel(name = "极差值",sort=2) + @Excel(name = "极差值", sort = 2) @TableField(exist = false) private String rangeValueVal;