diff --git a/bd-api/bd-api-system/src/main/java/com/hzs/system/sys/IMenuDetailServiceApi.java b/bd-api/bd-api-system/src/main/java/com/hzs/system/sys/IMenuDetailServiceApi.java index c9868a82..73b25ba6 100644 --- a/bd-api/bd-api-system/src/main/java/com/hzs/system/sys/IMenuDetailServiceApi.java +++ b/bd-api/bd-api-system/src/main/java/com/hzs/system/sys/IMenuDetailServiceApi.java @@ -5,14 +5,6 @@ import com.hzs.common.domain.system.config.BdMenuDetail; import java.util.List; -/** - * @BelongsProject: hzs_cloud - * @BelongsPackage: com.hzs.system.sys - * @Author: yh - * @CreateTime: 2023-08-18 14:24 - * @Description: TODO - * @Version: 1.0 - */ public interface IMenuDetailServiceApi { /** @@ -26,4 +18,5 @@ public interface IMenuDetailServiceApi { * @return */ R> showMenuDetail(Integer pkGrade, Integer pkAwards, Integer authority, Integer makerSpace, Integer pkCountry); + } diff --git a/bd-business/bd-business-member/src/main/java/com/hzs/member/achieve/controller/api/ApiCuMemberAchieveDisController.java b/bd-business/bd-business-member/src/main/java/com/hzs/member/achieve/controller/api/ApiCuMemberAchieveDisController.java index 8b72421a..240b8857 100644 --- a/bd-business/bd-business-member/src/main/java/com/hzs/member/achieve/controller/api/ApiCuMemberAchieveDisController.java +++ b/bd-business/bd-business-member/src/main/java/com/hzs/member/achieve/controller/api/ApiCuMemberAchieveDisController.java @@ -82,10 +82,7 @@ public class ApiCuMemberAchieveDisController extends BaseController { } /** - * @description: 用于查询会员市场动态 - * @return: AjaxResult - * @Author: sui q - * @Date: 2023/2/4 14:48 + * @description: 用于查询会员市场动态 -- 左右最后节点 */ @GetMapping("/query-place-tree") public AjaxResult queryPlaceParentTree() { @@ -174,10 +171,6 @@ public class ApiCuMemberAchieveDisController extends BaseController { /** * @description: 月度业绩-新增业绩统计 - * @author: zhang jing - * @date: 2023/5/19 9:48 - * @param: - * @return: **/ @GetMapping("/place-new-add-achieve-stat") public AjaxResult placeNewAddAchieveStat(PlaceNewAddAchieveVO pna) { @@ -193,10 +186,6 @@ public class ApiCuMemberAchieveDisController extends BaseController { /** * @description: 月度业绩-详情 - * @author: zhang jing - * @date: 2023/9/28 11:00 - * @param: [pna] - * @return: com.hzs.common.core.web.domain.AjaxResult **/ @GetMapping("/place-new-add-achieve-details") public TableDataInfo placeNewAddAchieveDetails(PlaceNewAddAchieveVO pna) { diff --git a/bd-business/bd-business-member/src/main/java/com/hzs/member/base/service/impl/CuMemberServiceImpl.java b/bd-business/bd-business-member/src/main/java/com/hzs/member/base/service/impl/CuMemberServiceImpl.java index fabc293c..2c5229fc 100644 --- a/bd-business/bd-business-member/src/main/java/com/hzs/member/base/service/impl/CuMemberServiceImpl.java +++ b/bd-business/bd-business-member/src/main/java/com/hzs/member/base/service/impl/CuMemberServiceImpl.java @@ -3541,10 +3541,6 @@ public class CuMemberServiceImpl extends ServiceImpl i /** * @description: 查询表是否存在 - * @author: zhang jing - * @date: 2024/4/7 16:11 - * @param: [tableName] - * @return: java.lang.Integer **/ @Override public Integer selectExistTable(String tableName) { 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 8b345237..64624be1 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 @@ -53,11 +53,7 @@ import java.util.function.Function; import java.util.stream.Collectors; /** - * @Description: 为会员端提供商品查询的入口 - * @Author: sui q - * @Time: 2022/9/19 9:10 - * @Classname: ApiWaresController - * @PackageName: com.hzs.sale.wares.controller.api + * 会员端提供商品查询的入口 */ @RestController @RequestMapping("/api/wares") @@ -65,62 +61,39 @@ import java.util.stream.Collectors; public class ApiBdWaresController extends BaseController { @DubboReference - IGradeServiceApi gradeServiceApi; + IGradeServiceApi iGradeServiceApi; @DubboReference AdvertBannerServiceApi advertBannerServiceApi; @DubboReference - IMemberServiceApi memberServiceApi; + IMemberServiceApi iMemberServiceApi; @DubboReference - IAreaCurrencyServiceApi areaCurrencyServiceApi; + IAreaCurrencyServiceApi iAreaCurrencyServiceApi; @DubboReference - ICurrencyServiceApi currencyServiceApi; + ICurrencyServiceApi iCurrencyServiceApi; @Autowired - private IBdWaresLabelService waresLabelService; + private IBdWaresLabelService iBdWaresLabelService; @Autowired - private IBdWaresGradeService waresGradeService; + private IBdWaresGradeService iBdWaresGradeService; + @Autowired + protected IShoppingCartService iShoppingCartService; + @Autowired + private IBdWaresService iBdWaresService; + @Autowired + private IBdWaresSpecsSkuService iBdWaresSpecsSkuService; + @Autowired + private IBdWaresRangeService iBdWaresRangeService; + @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; - } /** * @param cuWaresParams 专区、分类 - * @Description: 根据专区查找专区的商品 - * @Description: 根据专区查找专区的商品 - * @return: AjaxResult - * @Author: sui q - * @Date: 2022/9/19 9:33 */ @RequestMapping("/query-spe-wares") public AjaxResult queryWaresBySpecial(@RequestBody CuWaresParams cuWaresParams) { @@ -139,36 +112,36 @@ public class ApiBdWaresController extends BaseController { 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().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) { @@ -203,28 +176,28 @@ 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<>(); if (EOrderType.REPURCHASE_ORDER.getValue() == cuWaresParams.getSpecialArea() || EOrderType.SPECIAL_REPURCHASE_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()); @@ -302,7 +275,7 @@ public class ApiBdWaresController extends BaseController { // 当登陆人的结算国和前端结算国不一致 即为跨国报单 if (!pkCountry.equals(SecurityUtils.getPkCountry())) { // 跨国报单 跨国汇率 - R kgCurrency = currencyServiceApi.getCurrency(pkCountry); + R kgCurrency = iCurrencyServiceApi.getCurrency(pkCountry); waresPrice = waresPrice.multiply(inExchangeRate).divide(kgCurrency.getData().getInExchangeRate(), 2, BigDecimal.ROUND_HALF_UP); } } @@ -354,7 +327,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) { @@ -376,14 +349,11 @@ public class ApiBdWaresController extends BaseController { } /* - * @description: 获得专区抵扣比例 - * @author: sui q - * @date: 2023/7/1 14:20 - * @param: null null + * 获得专区抵扣比例 **/ 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,11 +392,9 @@ public class ApiBdWaresController extends BaseController { } /** + * 根据编号,查找商品的明细,点击加入购物车 + * * @param cuWaresParams 专区、分类 - * @Description: 根据编号,查找商品的明细,点击加入购物车 - * @return: AjaxResult - * @Author: sui q - * @Date: 2022/9/19 9:34 */ @RequestMapping("/query-spe-wares-detail") public AjaxResult queryWaresDetailByCode(@RequestBody CuWaresParams cuWaresParams) { @@ -443,7 +411,7 @@ public class ApiBdWaresController extends BaseController { } else { pkCountry = cuWaresParams.getPkCountry(); } - cuWaresParams = bdWaresSpecsSkuService.queryWaresSpecsSku(cuWaresParams.getSpecialArea(), cuWaresParams.getWaresCode(), loginMemberId, pkCountry); + cuWaresParams = iBdWaresSpecsSkuService.queryWaresSpecsSku(cuWaresParams.getSpecialArea(), cuWaresParams.getWaresCode(), loginMemberId, pkCountry); // 预计发货时间(秒) if (cuWaresParams.getArrivalTime() != null && cuWaresParams.getCreationTime() != null) { @@ -467,7 +435,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) { @@ -486,18 +454,16 @@ public class ApiBdWaresController extends BaseController { } /** + * 查询商品sku详情, 选择规格后,查询出sku,选择规格 + * * @param cuWaresItemsParams 参数,编码 - * @Description: 查询商品sku详情, 选择规格后,查询出sku,选择规格 - * @return: AjaxResult - * @Author: sui q - * @Date: 2022/9/19 15:59 */ @RequestMapping("/query-wares-detail-sku") public AjaxResult queryWaresSkuByCode(@RequestBody CuWaresItemsParams cuWaresItemsParams) { 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)); } /** @@ -509,7 +475,7 @@ public class ApiBdWaresController extends BaseController { 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); @@ -535,20 +501,20 @@ public class ApiBdWaresController extends BaseController { Long userId = SecurityUtils.getUserId(); String memberCode = SecurityUtils.getMemberCode(); // 校验产品团队信息(查询所有推荐商品) - List bdWaresList = bdWaresService.queryByRecommendList(null, EYesNo.YES.getIntValue(), pkCountry, new HashMap<>()); + List bdWaresList = iBdWaresService.queryByRecommendList(null, EYesNo.YES.getIntValue(), pkCountry, new HashMap<>()); Map waresShowMap = new HashMap<>(); if (bdWaresList.size() > 0) { // 检验商品团队信息 List waresIdList = bdWaresList.stream().map(BdWares::getPkId).collect(Collectors.toList()); - Map> waresAuthorityMap = bdWaresService.getWaresAuthority(waresIdList); + Map> waresAuthorityMap = iBdWaresService.getWaresAuthority(waresIdList); List showWaresList = bdWaresList.stream().map(we -> getShowWares(we.getPkId(), userId, memberCode, waresAuthorityMap)).collect(Collectors.toList()); - R> waresShowMapDto = memberServiceApi.checkIsShowWares(showWaresList); + R> waresShowMapDto = iMemberServiceApi.checkIsShowWares(showWaresList); waresShowMap = waresShowMapDto.getData(); } // 查询全部的banner (登录后banner) R> advertBannerList = advertBannerServiceApi.findAll(); // 查询app端首页商品展示信息 - RecommendWaresInfoVo recommendWaresInfoVo = bdWaresService.queryRecommendInfo(pkCountry, memberCode, userId, waresShowMap); + RecommendWaresInfoVo recommendWaresInfoVo = iBdWaresService.queryRecommendInfo(pkCountry, memberCode, userId, waresShowMap); if (recommendWaresInfoVo.getWaresVoList() != null) { List waresList = new ArrayList<>(recommendWaresInfoVo.getWaresVoList()); recommendWaresInfoVo.setWaresVoList(waresList); @@ -557,6 +523,32 @@ public class ApiBdWaresController extends BaseController { return AjaxResult.success(recommendWaresInfoVo); } + /** + * 新会员专区商品列表 + * + * @return + */ + @GetMapping("/list-wares") + public AjaxResult listWares() { + Integer pkCountry = SecurityUtils.getPkCountry(); + Long userId = SecurityUtils.getUserId(); + String memberCode = SecurityUtils.getMemberCode(); + + // 校验产品团队信息(查询所有推荐商品) + List bdWaresList = iBdWaresService.queryByRecommendList(null, EYesNo.YES.getIntValue(), pkCountry, new HashMap<>()); + Map waresShowMap = new HashMap<>(); + if (bdWaresList.size() > 0) { + // 检验商品团队信息 + List waresIdList = bdWaresList.stream().map(BdWares::getPkId).collect(Collectors.toList()); + Map> waresAuthorityMap = iBdWaresService.getWaresAuthority(waresIdList); + List showWaresList = bdWaresList.stream().map(we -> getShowWares(we.getPkId(), userId, memberCode, waresAuthorityMap)).collect(Collectors.toList()); + R> waresShowMapDto = iMemberServiceApi.checkIsShowWares(showWaresList); + waresShowMap = waresShowMapDto.getData(); + } + + return AjaxResult.success(iBdWaresService.listWares(pkCountry, userId, waresShowMap)); + } + /** * 商品推荐接口 (公司商品) */ @@ -577,22 +569,22 @@ public class ApiBdWaresController extends BaseController { 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) { @@ -622,10 +614,9 @@ public class ApiBdWaresController extends BaseController { bdWaresExt.setSellingLabelList(sellingLabelList.stream().filter(DistinctByKeyUtil.distinctByKey(BdLabel::getPkId)).collect(Collectors.toList())); } - 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)); } @@ -639,11 +630,7 @@ public class ApiBdWaresController extends BaseController { BigDecimal assAchieve = BigDecimal.ZERO; if (EOrderType.REPURCHASE_ORDER.getValue() == cuWaresParams.getSpecialArea()) { // 复购业绩计算 - List waresIdSet = new ArrayList<>(); - bdWaresExtList.forEach(we -> { - waresIdSet.add(we.getPkId()); - }); - List bdWaresRangeList = bdWaresRangeService.queryWaresRangeByCondition(cuMember, waresIdSet); + List bdWaresRangeList = iBdWaresRangeService.queryWaresRangeByCondition(cuMember, pkWaresIds); for (BdWaresRange bdWaresRange : bdWaresRangeList) { if (waresExt.getPkId().intValue() == bdWaresRange.getPkWares().intValue()) { waresPrice = waresPrice.add(bdWaresRange.getPrice()); @@ -685,18 +672,14 @@ public class ApiBdWaresController extends BaseController { } // 商品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(); @@ -709,7 +692,7 @@ public class ApiBdWaresController extends BaseController { // 查询等级配置 LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); queryWrapper.eq(BdWaresGrade::getPkWares, waresExt.getPkId()); - List waresGradeList = waresGradeService.list(queryWrapper); + List waresGradeList = iBdWaresGradeService.list(queryWrapper); if (waresGradeList.size() > 0) { // 查询等级和商品是否存在 不存在不返回该数据 for (BdWaresGrade bdWaresGrade : waresGradeList) { @@ -729,12 +712,10 @@ public class ApiBdWaresController extends BaseController { /** * 下单商品信息展示 - * - * @return */ @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()); @@ -743,7 +724,7 @@ public class ApiBdWaresController extends BaseController { 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; @@ -760,7 +741,7 @@ public class ApiBdWaresController extends BaseController { } Integer pkCountry = SecurityUtils.getPkCountry(); if (CountryConstants.CHINA_COUNTRY.equals(pkCountry)) { - R currency = currencyServiceApi.getCurrency(pkCountry); + R currency = iCurrencyServiceApi.getCurrency(pkCountry); // 汇率比例 BigDecimal inExchangeRate = currency.getData().getInExchangeRate(); pv = ComputeUtil.computeMultiply(pv, inExchangeRate); diff --git a/bd-business/bd-business-sale/src/main/java/com/hzs/sale/wares/mapper/BdWaresMapper.java b/bd-business/bd-business-sale/src/main/java/com/hzs/sale/wares/mapper/BdWaresMapper.java index d0d9547d..23943145 100644 --- a/bd-business/bd-business-sale/src/main/java/com/hzs/sale/wares/mapper/BdWaresMapper.java +++ b/bd-business/bd-business-sale/src/main/java/com/hzs/sale/wares/mapper/BdWaresMapper.java @@ -5,7 +5,6 @@ import com.hzs.common.domain.sale.ext.BdWaresExt; import com.hzs.common.domain.sale.wares.BdWares; import com.hzs.common.domain.system.config.BdAgreement; import com.hzs.sale.wares.param.WaresParams; -import com.hzs.sale.wares.param.WaresPreSaleParam; import com.hzs.sale.wares.vo.WaresAuthorityVo; import com.hzs.sale.wares.vo.WaresVo; import org.apache.ibatis.annotations.Param; @@ -32,8 +31,6 @@ public interface BdWaresMapper extends BaseMapper { * @param waresCodeNotInList 不包含的商品编号列表 -- 可为null * @param pkCountry 所属国家 * @return: List - * @Author: sui q - * @Date: 2022/9/16 11:13 */ List queryWaresByCondition(@Param("specialArea") Integer specialArea, @Param("pkAreaClassify") Integer pkAreaClassify, @@ -132,8 +129,6 @@ public interface BdWaresMapper extends BaseMapper { * @param waresName 名称 * @param pkCountry 所属国家 * @return: List - * @Author: sui q - * @Date: 2022/9/19 9:05 */ List queryRecommendWaresByCondition(@Param("specialArea") Integer specialArea, @Param("pkAreaClassify") Integer pkAreaClassify, @Param("waresCode") String waresCode, @Param("waresName") String waresName, @Param("pkCountry") Integer pkCountry); @@ -146,22 +141,9 @@ public interface BdWaresMapper extends BaseMapper { * @param pkCountry * @return */ - List queryByRecommendList(@Param("specialArea") Integer specialArea, @Param("isRecommend") Integer isRecommend, @Param("pkCountry") Integer pkCountry); - - /** - * 修改商品预售数量 - * - * @param waresPreSaleParam - */ - void updateByPkWaresPreSale(WaresPreSaleParam waresPreSaleParam); - - /** - * 修改商品预售状态 - * - * @param waresPreSaleParam - */ - void updateByPkWaresPreSaleStatus(WaresPreSaleParam waresPreSaleParam); - + List queryByRecommendList(@Param("specialArea") Integer specialArea, + @Param("isRecommend") Integer isRecommend, + @Param("pkCountry") Integer pkCountry); /** * 扣减预售数量库存 diff --git a/bd-business/bd-business-sale/src/main/java/com/hzs/sale/wares/param/WaresPreSaleParam.java b/bd-business/bd-business-sale/src/main/java/com/hzs/sale/wares/param/WaresPreSaleParam.java deleted file mode 100644 index bda9ee28..00000000 --- a/bd-business/bd-business-sale/src/main/java/com/hzs/sale/wares/param/WaresPreSaleParam.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.hzs.sale.wares.param;/** - * @Description: - * @Author: yuhui - * @Time: 2024/4/17 16:25 - * @Classname: WaresPreSaleParam - * @PackageName: com.hzs.ground.product.param - */ - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.io.Serializable; - -/** - *@BelongsProject: hzs_cloud - *@BelongsPackage: com.hzs.ground.product.param - *@Author: yh - *@CreateTime: 2024-04-17 16:25 - *@Description: TODO - *@Version: 1.0 - */ -@Data -@AllArgsConstructor -@NoArgsConstructor -public class WaresPreSaleParam implements Serializable { - - - /** - * 商品主键 - */ - private Integer pkWares; - - /** - * 数量 - */ - private Integer quantity; - -} diff --git a/bd-business/bd-business-sale/src/main/java/com/hzs/sale/wares/service/IBdWaresService.java b/bd-business/bd-business-sale/src/main/java/com/hzs/sale/wares/service/IBdWaresService.java index ad3ba694..0e91fd54 100644 --- a/bd-business/bd-business-sale/src/main/java/com/hzs/sale/wares/service/IBdWaresService.java +++ b/bd-business/bd-business-sale/src/main/java/com/hzs/sale/wares/service/IBdWaresService.java @@ -8,7 +8,6 @@ import com.hzs.common.domain.system.config.BdAgreement; import com.hzs.common.domain.system.config.ext.BdRangeExt; import com.hzs.sale.wares.param.ComputeWaresPrice; import com.hzs.sale.wares.param.WaresParams; -import com.hzs.sale.wares.param.WaresPreSaleParam; import com.hzs.sale.wares.vo.RecommendWaresInfoVo; import com.hzs.sale.wares.vo.WaresAuthorityVo; import com.hzs.sale.wares.vo.WaresVo; @@ -59,8 +58,6 @@ public interface IBdWaresService extends IService { * @param waresCodeNotInList 不包含的商品编号列表 -- 可为null * @param pkCountry 所属国家 * @return: List - * @Author: sui q - * @Date: 2022/9/19 9:05 */ List queryWaresByCondition(Integer specialArea, Integer pkAreaClassify, @@ -77,8 +74,6 @@ public interface IBdWaresService extends IService { * @param waresName 名称 * @param pkCountry 所属国家 * @return: List - * @Author: sui q - * @Date: 2022/9/19 9:05 */ List queryRecommendWaresByCondition(Integer specialArea, Integer pkAreaClassify, String waresName, Integer pkCountry); @@ -86,8 +81,6 @@ public interface IBdWaresService extends IService { * 根据条件查询商品,专区商品列表 * * @return: List - * @Author: sui q - * @Date: 2022/9/19 9:05 */ List queryWaresByCondition(); @@ -153,6 +146,11 @@ public interface IBdWaresService extends IService { */ RecommendWaresInfoVo queryRecommendInfo(Integer pkCountry, String memberCode, Long userId, Map waresShowMap); + /** + * 查询商品专区列表 + */ + RecommendWaresInfoVo listWares(Integer pkCountry, Long userId, Map waresShowMap); + /** * 修改自动上下架状态(自动上架) * @@ -162,14 +160,9 @@ public interface IBdWaresService extends IService { /** * @description: 修改商品预售状态 - * @author: zhang jing - * @date: 2024/10/24 16:10 - * @param: [] - * @return: void **/ void waresPreSale(); - /** * 修改自动上下架状态(自动下架) * @@ -204,12 +197,6 @@ public interface IBdWaresService extends IService { */ List queryByRecommendList(Integer specialArea, Integer isRecommend, Integer pkCountry, Map waresShowMap); - - /** - * 上传商品id 修改预售状态 - */ - Boolean updateWaresPreSale(List waresPreSaleParamList); - /** * 扣减预售数量库存 * diff --git a/bd-business/bd-business-sale/src/main/java/com/hzs/sale/wares/service/impl/BdWaresServiceImpl.java b/bd-business/bd-business-sale/src/main/java/com/hzs/sale/wares/service/impl/BdWaresServiceImpl.java index 5138cf6f..2a8a26f2 100644 --- a/bd-business/bd-business-sale/src/main/java/com/hzs/sale/wares/service/impl/BdWaresServiceImpl.java +++ b/bd-business/bd-business-sale/src/main/java/com/hzs/sale/wares/service/impl/BdWaresServiceImpl.java @@ -24,7 +24,6 @@ import com.hzs.common.domain.system.config.BdAwards; import com.hzs.common.domain.system.config.BdLabel; import com.hzs.common.domain.system.config.BdMenuDetail; import com.hzs.common.domain.system.config.ext.BdRangeExt; -import com.hzs.common.service.ITransactionCommonService; import com.hzs.member.base.IMemberServiceApi; import com.hzs.sale.product.service.IBdSpecsService; @@ -57,66 +56,56 @@ import java.util.stream.Collectors; /** * 商品 服务实现类 - * - * @author hzs - * @since 2022-09-08 */ @Service public class BdWaresServiceImpl extends ServiceImpl implements IBdWaresService { @Autowired - private RabbitTemplate rabbitTemplate; - @Autowired - private IBdSpecsService specsService; - - @Autowired - private ITransactionCommonService iTransactionCommonService; - @Autowired - private IBdWaresAuthorizeService waresAuthorizeService; - @Autowired - private IBdWaresAwardsService waresAwardsService; - @Autowired - private IBdWaresGradeService waresGradeService; - @Autowired - private IBdWaresSpecsRelationService waresSpecsRelationService; - @Autowired - private IBdWaresSpecsPackService waresSpecsPackService; - @Autowired - private IBdWaresSpecsSkuService waresSpecsSkuService; - @Autowired - private IBdWaresSpecsService waresSpecsService; - @Autowired - private IBdWaresExtendService waresExtendService; - @Autowired - private IBdWaresRangeService waresRangeService; - @Autowired - private IBdWaresDetailService waresDetailService; - @Autowired - private IBdWaresLabelService waresLabelService; - @Autowired - private IBdWaresAuthorityService waresAuthorityService; - - @DubboReference - ILabelServiceApi labelService; - @DubboReference - IMemberServiceApi memberServiceApi; - @DubboReference - ICurrencyServiceApi currencyServiceApi; - @DubboReference - IMenuDetailServiceApi iBdMenuDetailService; - @DubboReference - IAwardsServiceApi awardsServiceApi; - @DubboReference - IRangeServiceApi rangeServiceApi; - @DubboReference - ITransactionServiceApi transactionServiceApi; - private RedisService redisService; + @Autowired + private RabbitTemplate rabbitTemplate; @Autowired - public void setRedisService(RedisService redisService) { - this.redisService = redisService; - } + private IBdSpecsService iBdSpecsService; + @Autowired + private IBdWaresAuthorizeService iBdWaresAuthorizeService; + @Autowired + private IBdWaresAwardsService iBdWaresAwardsService; + @Autowired + private IBdWaresGradeService iBdWaresGradeService; + @Autowired + private IBdWaresSpecsRelationService iBdWaresSpecsRelationService; + @Autowired + private IBdWaresSpecsPackService iBdWaresSpecsPackService; + @Autowired + private IBdWaresSpecsSkuService iBdWaresSpecsSkuService; + @Autowired + private IBdWaresSpecsService iBdWaresSpecsService; + @Autowired + private IBdWaresExtendService iBdWaresExtendService; + @Autowired + private IBdWaresRangeService iBdWaresRangeService; + @Autowired + private IBdWaresDetailService iBdWaresDetailService; + @Autowired + private IBdWaresLabelService iBdWaresLabelService; + @Autowired + private IBdWaresAuthorityService iBdWaresAuthorityService; + + @DubboReference + ILabelServiceApi iLabelServiceApi; + @DubboReference + IMemberServiceApi iMemberServiceApi; + @DubboReference + ICurrencyServiceApi iCurrencyServiceApi; + @DubboReference + IMenuDetailServiceApi iMenuDetailServiceApi; + @DubboReference + IAwardsServiceApi iAwardsServiceApi; + @DubboReference + IRangeServiceApi iRangeServiceApi; + @DubboReference + ITransactionServiceApi iTransactionServiceApi; @Override @Transactional(rollbackFor = Exception.class) @@ -124,7 +113,7 @@ public class BdWaresServiceImpl extends ServiceImpl impl // 设置 wares 对象的值 BdWares wares = BeanUtil.copyProperties(waresParams, BdWares.class); wares.setPkId(waresParams.getWaresId()); - R transaction = transactionServiceApi.createTransaction(user.getDataCountry(), ETransactionKey.SPEC, waresParams.getWaresName(), EYesNo.NO, EYesNo.NO); + R transaction = iTransactionServiceApi.createTransaction(user.getDataCountry(), ETransactionKey.SPEC, waresParams.getWaresName(), EYesNo.NO, EYesNo.NO); wares.setWaresCode(waresParams.getWaresCode()); wares.setPkTransaction(transaction.getData()); wares.setPkCreator(user.getUserId()); @@ -144,7 +133,7 @@ public class BdWaresServiceImpl extends ServiceImpl impl waresParams.setMakerIncome(BigDecimal.ZERO); } if (null != waresParams.getMakerIncome()) { - R currencyDto = currencyServiceApi.getCurrency(user.getDataCountry()); + R currencyDto = iCurrencyServiceApi.getCurrency(user.getDataCountry()); waresExtend.setMakerIncome(waresParams.getMakerIncome().divide(currencyDto.getData().getInExchangeRate(), 6, BigDecimal.ROUND_HALF_UP)); } waresExtend.setSystemType(ESystemType.DEFAULT.getValue()); @@ -168,7 +157,7 @@ public class BdWaresServiceImpl extends ServiceImpl impl waresExtend.setCoolLabel(coolLabel.getLabel()); } } - waresExtendService.save(waresExtend); + iBdWaresExtendService.save(waresExtend); // 标签关联记录 saveWaresLabel(wares, prefixLabel, coolLabel, waresParams.getPkGuaranteeLabel(), waresParams.getPkSellingPoint(), user); @@ -198,7 +187,7 @@ public class BdWaresServiceImpl extends ServiceImpl impl waresGradeList.add(bdWaresGrade); } if (waresGradeList.size() > 0) { - waresGradeService.saveBatch(waresGradeList); + iBdWaresGradeService.saveBatch(waresGradeList); } } // 奖衔 @@ -213,7 +202,7 @@ public class BdWaresServiceImpl extends ServiceImpl impl bdWaresAwards.setPkCountry(user.getDataCountry()); waresAwardsList.add(bdWaresAwards); } - waresAwardsService.saveBatch(waresAwardsList); + iBdWaresAwardsService.saveBatch(waresAwardsList); } // 用户权限配置 if (waresParams.getWaresMemberAuthorizeList() != null) { @@ -228,7 +217,7 @@ public class BdWaresServiceImpl extends ServiceImpl impl waList.add(waresAuthorize); } if (waList.size() > 0) { - waresAuthorizeService.saveBatch(waList); + iBdWaresAuthorizeService.saveBatch(waList); } } return wares; @@ -240,7 +229,7 @@ public class BdWaresServiceImpl extends ServiceImpl impl * @return */ private List computeWaresRange(List waresSpecsSkuList) { - R> rangeDto = rangeServiceApi.queryRange(SecurityUtils.getPkCountry()); + R> rangeDto = iRangeServiceApi.queryRange(SecurityUtils.getPkCountry()); List rangeList = rangeDto.getData(); List waresRangeParamsList = new ArrayList<>(); for (WaresSpecsSkuParams waresSpecsSkuParams : waresSpecsSkuList) { @@ -330,7 +319,7 @@ public class BdWaresServiceImpl extends ServiceImpl impl list.add(sellingLabel); } } - waresLabelService.saveBatch(list); + iBdWaresLabelService.saveBatch(list); } /** @@ -357,12 +346,12 @@ public class BdWaresServiceImpl extends ServiceImpl impl queryWrapper.eq(BdWaresDetail::getIsGift, waresRangeParams.getIsGift()); } // 查询当前商品详情id - BdWaresDetail waresDetail = waresDetailService.getOne(queryWrapper); + BdWaresDetail waresDetail = iBdWaresDetailService.getOne(queryWrapper); if (waresDetail != null) { // 根据详情外键查询所有规格明细值 LambdaQueryWrapper specsWrapper = new LambdaQueryWrapper<>(); specsWrapper.eq(BdWaresSpecsRelation::getPkWaresDetail, waresDetail.getPkId()); - List relationList = waresSpecsRelationService.list(specsWrapper); + List relationList = iBdWaresSpecsRelationService.list(specsWrapper); // 根据规格id 分组 Map> collect = relationList.stream().collect(Collectors.groupingBy(BdWaresSpecsRelation::getPkWaresSpecsSku)); for (Map.Entry> integer : collect.entrySet()) { @@ -371,7 +360,7 @@ public class BdWaresServiceImpl extends ServiceImpl impl LambdaQueryWrapper listWrapper = new LambdaQueryWrapper<>(); listWrapper.in(BdWaresSpecs::getPkId, pkWaresSpecsIds); - List rslist = waresSpecsService.list(listWrapper); + List rslist = iBdWaresSpecsService.list(listWrapper); for (BdWaresSpecs bdWaresSpecs : rslist) { pkWaresSpecsList.add(bdWaresSpecs.getPkSpecs()); } @@ -403,7 +392,7 @@ public class BdWaresServiceImpl extends ServiceImpl impl } } if (wrList.size() > 0) { - waresRangeService.saveBatch(wrList); + iBdWaresRangeService.saveBatch(wrList); } } } @@ -418,7 +407,7 @@ public class BdWaresServiceImpl extends ServiceImpl impl for (WaresAuthorityParam waresAuthorityParam : waresAuthorityList) { Long memberId = null; if (StringUtils.isNotBlank(waresAuthorityParam.getMemberCode())) { - R member = memberServiceApi.getMember(waresAuthorityParam.getMemberCode()); + R member = iMemberServiceApi.getMember(waresAuthorityParam.getMemberCode()); if (member.getData() == null) { throw new BaseException("查询会员失败"); } @@ -436,7 +425,7 @@ public class BdWaresServiceImpl extends ServiceImpl impl waList.add(bdWaresAuthority); } - waresAuthorityService.saveBatch(waList); + iBdWaresAuthorityService.saveBatch(waList); } /** @@ -458,7 +447,7 @@ public class BdWaresServiceImpl extends ServiceImpl impl if (waresSpecsSkuParams.getIsGift() != null) { queryWrapper.eq(BdWaresDetail::getIsGift, waresSpecsSkuParams.getIsGift()); } - BdWaresDetail waresDetail = waresDetailService.getOne(queryWrapper); + BdWaresDetail waresDetail = iBdWaresDetailService.getOne(queryWrapper); Integer waresDetailId = waresDetail.getPkId(); bdWaresSpecsSku.setPkWaresDetail(waresDetailId); bdWaresSpecsSku.setPrice(waresSpecsSkuParams.getProductPrice()); @@ -469,7 +458,7 @@ public class BdWaresServiceImpl extends ServiceImpl impl bdWaresSpecsSku.setVipPrice(waresSpecsSkuParams.getVipPrice()); bdWaresSpecsSku.setRetailPrice(waresSpecsSkuParams.getRetailPrice()); bdWaresSpecsSku.setSkuCode(waresSpecsSkuParams.getSkuCode()); - waresSpecsSkuService.save(bdWaresSpecsSku); + iBdWaresSpecsSkuService.save(bdWaresSpecsSku); // 生成规格明细表 List waresSpecsList = waresSpecsSkuParams.getWaresSpecsList(); for (BdWaresSpecs waresSpecs : waresSpecsList) { @@ -477,18 +466,18 @@ public class BdWaresServiceImpl extends ServiceImpl impl waresSpecs.setCreationTime(new Date()); waresSpecs.setPkCountry(user.getDataCountry()); waresSpecs.setPkCreator(user.getUserId()); - waresSpecsService.save(waresSpecs); + iBdWaresSpecsService.save(waresSpecs); // 生成规格明细关系表 BdWaresSpecsRelation waresSpecsRelation = new BdWaresSpecsRelation(); waresSpecsRelation.setCreationTime(new Date()); waresSpecsRelation.setPkWaresDetail(waresDetailId); waresSpecsRelation.setPkWaresSpecs(waresSpecs.getPkId()); waresSpecsRelation.setPkWaresSpecsSku(bdWaresSpecsSku.getPkId()); - waresSpecsRelationService.save(waresSpecsRelation); + iBdWaresSpecsRelationService.save(waresSpecsRelation); } } else { // 如果sku id 非空 表示在当前数据中修改 - BdWaresSpecsSku bdWaresSpecsSku = waresSpecsSkuService.selectByWaresSpecsSkuIdAndDel(waresSpecsSkuParams.getPkWaresSpecsSku()); + BdWaresSpecsSku bdWaresSpecsSku = iBdWaresSpecsSkuService.selectByWaresSpecsSkuIdAndDel(waresSpecsSkuParams.getPkWaresSpecsSku()); // 商品规格关联明细值 id // 商品详情id查询 LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); @@ -497,7 +486,7 @@ public class BdWaresServiceImpl extends ServiceImpl impl if (waresSpecsSkuParams.getIsGift() != null) { queryWrapper.eq(BdWaresDetail::getIsGift, waresSpecsSkuParams.getIsGift()); } - BdWaresDetail waresDetail = waresDetailService.getOne(queryWrapper); + BdWaresDetail waresDetail = iBdWaresDetailService.getOne(queryWrapper); Integer waresDetailId = waresDetail.getPkId(); // 生成规格明细表 List waresSpecsList = waresSpecsSkuParams.getWaresSpecsList(); @@ -505,14 +494,14 @@ public class BdWaresServiceImpl extends ServiceImpl impl waresSpecs.setPkWaresDetail(waresDetailId); waresSpecs.setCreationTime(new Date()); waresSpecs.setPkCreator(user.getUserId()); - waresSpecsService.save(waresSpecs); + iBdWaresSpecsService.save(waresSpecs); // 生成规格明细关系表 BdWaresSpecsRelation waresSpecsRelation = new BdWaresSpecsRelation(); waresSpecsRelation.setCreationTime(new Date()); waresSpecsRelation.setPkWaresDetail(waresDetailId); waresSpecsRelation.setPkWaresSpecs(waresSpecs.getPkId()); waresSpecsRelation.setPkWaresSpecsSku(bdWaresSpecsSku.getPkId()); - waresSpecsRelationService.save(waresSpecsRelation); + iBdWaresSpecsRelationService.save(waresSpecsRelation); } // 修改sku 主表 BdWaresSpecsSku sku = new BdWaresSpecsSku(); @@ -531,7 +520,7 @@ public class BdWaresServiceImpl extends ServiceImpl impl sku.setIsPutOn(EYesNo.YES.getIntValue()); } sku.setSkuCode(waresSpecsSkuParams.getSkuCode()); - waresSpecsSkuService.updateBySkuId(sku); + iBdWaresSpecsSkuService.updateBySkuId(sku); redisService.deleteObject(CacheConstants.BD_WARES_SPECS_RELATION + bdWaresSpecsSku.getPkId()); } } @@ -554,7 +543,7 @@ public class BdWaresServiceImpl extends ServiceImpl impl waresDetailList.add(bdWaresDetail); } if (waresDetailList.size() > 0) { - waresDetailService.saveBatch(waresDetailList); + iBdWaresDetailService.saveBatch(waresDetailList); } } @@ -578,7 +567,7 @@ public class BdWaresServiceImpl extends ServiceImpl impl bdWaresSpecsPack.setPkCountry(SecurityUtils.getPkCountry()); list.add(bdWaresSpecsPack); } - waresSpecsPackService.saveBatch(list); + iBdWaresSpecsPackService.saveBatch(list); } } @@ -593,7 +582,7 @@ public class BdWaresServiceImpl extends ServiceImpl impl public void updateWares(WaresParams waresParams, LoginUser user) { BdWares wares = BeanUtil.copyProperties(waresParams, BdWares.class); wares.setPkId(waresParams.getWaresId()); - R transaction = transactionServiceApi.createTransaction(user.getDataCountry(), ETransactionKey.SPEC, waresParams.getWaresName(), EYesNo.NO, EYesNo.NO); + R transaction = iTransactionServiceApi.createTransaction(user.getDataCountry(), ETransactionKey.SPEC, waresParams.getWaresName(), EYesNo.NO, EYesNo.NO); wares.setPkTransaction(transaction.getData()); if (waresParams.getIsPutOn().equals(EYesNo.YES.getIntValue())) { wares.setListingTime(DateUtils.currentDateTime()); @@ -604,7 +593,7 @@ public class BdWaresServiceImpl extends ServiceImpl impl this.updateById(wares); // 设置 上架时间 和下架时间 putOnTime putOffTime - waresExtendService.updatePutOnTimeAndPutOffTimeByWaresId(waresParams.getWaresId(), waresParams.getPutOnTime(), waresParams.getPutOffTime()); + iBdWaresExtendService.updatePutOnTimeAndPutOffTimeByWaresId(waresParams.getWaresId(), waresParams.getPutOnTime(), waresParams.getPutOffTime()); // 商品拓展表 BdWaresExtend waresExtend = BeanUtil.copyProperties(waresParams, BdWaresExtend.class); @@ -613,7 +602,7 @@ public class BdWaresServiceImpl extends ServiceImpl impl waresParams.setMakerIncome(BigDecimal.ZERO); } if (null != waresParams.getMakerIncome()) { - R currencyDto = currencyServiceApi.getCurrency(user.getDataCountry()); + R currencyDto = iCurrencyServiceApi.getCurrency(user.getDataCountry()); waresExtend.setMakerIncome(waresParams.getMakerIncome().divide(currencyDto.getData().getInExchangeRate(), 6, BigDecimal.ROUND_HALF_UP)); } waresExtend.setSystemType(ESystemType.DEFAULT.getValue()); @@ -642,7 +631,7 @@ public class BdWaresServiceImpl extends ServiceImpl impl } } - waresExtendService.update(waresExtend, queryWrapper); + iBdWaresExtendService.update(waresExtend, queryWrapper); // 删除关联表 deleteWaresInfo(waresParams.getWaresId()); @@ -678,7 +667,7 @@ public class BdWaresServiceImpl extends ServiceImpl impl if (waresParams.getWaresGradeIds() != null) { LambdaQueryWrapper queryWrapper1 = new LambdaQueryWrapper<>(); queryWrapper1.eq(BdWaresGrade::getPkWares, wares.getPkId()); - waresGradeService.remove(queryWrapper1); + iBdWaresGradeService.remove(queryWrapper1); for (Integer waresGradeId : waresParams.getWaresGradeIds()) { BdWaresGrade bdWaresGrade = new BdWaresGrade(); bdWaresGrade.setPkWares(wares.getPkId()); @@ -686,7 +675,7 @@ public class BdWaresServiceImpl extends ServiceImpl impl bdWaresGrade.setCreationTime(DateUtils.currentDateTime()); bdWaresGrade.setPkCreator(user.getUserId()); bdWaresGrade.setPkCountry(user.getDataCountry()); - waresGradeService.save(bdWaresGrade); + iBdWaresGradeService.save(bdWaresGrade); } } // 奖衔 @@ -694,9 +683,9 @@ public class BdWaresServiceImpl extends ServiceImpl impl // IBdWaresAwardsService LambdaQueryWrapper queryWrapper1 = new LambdaQueryWrapper<>(); queryWrapper1.eq(BdWaresAwards::getPkWares, wares.getPkId()); - waresAwardsService.remove(queryWrapper1); + iBdWaresAwardsService.remove(queryWrapper1); // 校验奖衔id 是否存在 - R> awardsDto = awardsServiceApi.queryAwards(waresParams.getPkCountry()); + R> awardsDto = iAwardsServiceApi.queryAwards(waresParams.getPkCountry()); List awardsList = awardsDto.getData(); List waresAwardsIdList = new ArrayList<>(); for (BdAwards bdAwards : awardsList) { @@ -713,14 +702,14 @@ public class BdWaresServiceImpl extends ServiceImpl impl bdWaresAwards.setCreationTime(DateUtils.currentDateTime()); bdWaresAwards.setPkCreator(user.getUserId()); bdWaresAwards.setPkCountry(user.getDataCountry()); - waresAwardsService.save(bdWaresAwards); + iBdWaresAwardsService.save(bdWaresAwards); } } // 用户权限配置 if (waresParams.getWaresMemberAuthorizeList() != null) { List waList = new ArrayList<>(); - waresAuthorizeService.removeByPkWares(wares.getPkId()); + iBdWaresAuthorizeService.removeByPkWares(wares.getPkId()); for (Integer value : waresParams.getWaresMemberAuthorizeList()) { BdWaresAuthorize waresAuthorize = new BdWaresAuthorize(); waresAuthorize.setPkWares(wares.getPkId()); @@ -731,11 +720,9 @@ public class BdWaresServiceImpl extends ServiceImpl impl waList.add(waresAuthorize); } if (waList.size() > 0) { - waresAuthorizeService.saveBatch(waList); + iBdWaresAuthorizeService.saveBatch(waList); } } - // 商品修改 - // this.createSaveWaresLog(waresParams,user,EApprovalBusiness.WARES_UPDATE.getValue()); } /** @@ -749,57 +736,57 @@ public class BdWaresServiceImpl extends ServiceImpl impl deleteWrapper.eq(BdWaresLabel::getPkWares, waresId); deleteWrapper.set(BdWaresLabel::getDelFlag, EDelFlag.DELETE.getValue()); deleteWrapper.set(BdWaresLabel::getModifiedTime, new Date()); - waresLabelService.update(deleteWrapper); + iBdWaresLabelService.update(deleteWrapper); // 删除规格 LambdaUpdateWrapper waresSpecsSkuWrapper = new LambdaUpdateWrapper<>(); waresSpecsSkuWrapper.eq(BdWaresSpecsSku::getPkWares, waresId); waresSpecsSkuWrapper.set(BdWaresSpecsSku::getDelFlag, EDelFlag.DELETE.getValue()); waresSpecsSkuWrapper.set(BdWaresSpecsSku::getModifiedTime, new Date()); - waresSpecsSkuService.update(waresSpecsSkuWrapper); + iBdWaresSpecsSkuService.update(waresSpecsSkuWrapper); // 删除规格关联数据 LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); queryWrapper.eq(BdWaresDetail::getPkWares, waresId); - List waresDetailList = waresDetailService.list(queryWrapper); + List waresDetailList = iBdWaresDetailService.list(queryWrapper); for (BdWaresDetail bdWaresDetail : waresDetailList) { // 删除商品关联规格 LambdaUpdateWrapper waresSpecsWrapper = new LambdaUpdateWrapper<>(); waresSpecsWrapper.eq(BdWaresSpecs::getPkWaresDetail, bdWaresDetail.getPkId()); waresSpecsWrapper.set(BdWaresSpecs::getDelFlag, EDelFlag.DELETE.getValue()); waresSpecsWrapper.set(BdWaresSpecs::getModifiedTime, new Date()); - waresSpecsService.update(waresSpecsWrapper); + iBdWaresSpecsService.update(waresSpecsWrapper); // 删除规格关联数据 LambdaUpdateWrapper waresSpecsRelationWrapper = new LambdaUpdateWrapper<>(); waresSpecsRelationWrapper.eq(BdWaresSpecsRelation::getPkWaresDetail, bdWaresDetail.getPkId()); waresSpecsRelationWrapper.set(BdWaresSpecsRelation::getDelFlag, EDelFlag.DELETE.getValue()); waresSpecsRelationWrapper.set(BdWaresSpecsRelation::getModifiedTime, new Date()); - waresSpecsRelationService.update(waresSpecsRelationWrapper); + iBdWaresSpecsRelationService.update(waresSpecsRelationWrapper); } // 删除产品关联团队配置 LambdaUpdateWrapper waresAuthorityWrapper = new LambdaUpdateWrapper<>(); waresAuthorityWrapper.eq(BdWaresAuthority::getPkWares, waresId); waresAuthorityWrapper.set(BdWaresAuthority::getDelFlag, EDelFlag.DELETE.getValue()); waresAuthorityWrapper.set(BdWaresAuthority::getModifiedTime, new Date()); - waresAuthorityService.update(waresAuthorityWrapper); + iBdWaresAuthorityService.update(waresAuthorityWrapper); //删除产品明细 LambdaUpdateWrapper waresDetailWrapper = new LambdaUpdateWrapper<>(); waresDetailWrapper.eq(BdWaresDetail::getPkWares, waresId); waresDetailWrapper.set(BdWaresDetail::getDelFlag, EDelFlag.DELETE.getValue()); waresDetailWrapper.set(BdWaresDetail::getModifiedTime, new Date()); - waresDetailService.update(waresDetailWrapper); + iBdWaresDetailService.update(waresDetailWrapper); // 删除极差明细 LambdaUpdateWrapper waresRangeWrapper = new LambdaUpdateWrapper<>(); waresRangeWrapper.eq(BdWaresRange::getPkWares, waresId); waresRangeWrapper.set(BdWaresRange::getDelFlag, EDelFlag.DELETE.getValue()); waresRangeWrapper.set(BdWaresRange::getModifiedTime, new Date()); - waresRangeService.update(waresRangeWrapper); + iBdWaresRangeService.update(waresRangeWrapper); // 删除包装和规格 LambdaUpdateWrapper waresSpecsPackWrapper = new LambdaUpdateWrapper<>(); waresSpecsPackWrapper.eq(BdWaresSpecsPack::getPkWares, waresId); waresSpecsPackWrapper.set(BdWaresSpecsPack::getDelFlag, EDelFlag.DELETE.getValue()); waresSpecsPackWrapper.set(BdWaresSpecsPack::getModifiedTime, new Date()); - waresSpecsPackService.update(waresSpecsPackWrapper); + iBdWaresSpecsPackService.update(waresSpecsPackWrapper); } @@ -847,39 +834,39 @@ public class BdWaresServiceImpl extends ServiceImpl impl waresExpendWrapper.set(BdWaresExtend::getPkModified, userId); waresExpendWrapper.set(BdWaresExtend::getModifiedTime, new Date()); waresExpendWrapper.set(BdWaresExtend::getDelFlag, EDelFlag.DELETE.getValue()); - waresExtendService.update(waresExpendWrapper); + iBdWaresExtendService.update(waresExpendWrapper); // 删除 LambdaUpdateWrapper waresAuthorityWrapper = new LambdaUpdateWrapper<>(); waresAuthorityWrapper.eq(BdWaresAuthority::getPkWares, pkId); waresAuthorityWrapper.set(BdWaresAuthority::getPkModified, userId); waresAuthorityWrapper.set(BdWaresAuthority::getModifiedTime, new Date()); waresAuthorityWrapper.set(BdWaresAuthority::getDelFlag, EDelFlag.DELETE.getValue()); - waresAuthorityService.update(waresAuthorityWrapper); + iBdWaresAuthorityService.update(waresAuthorityWrapper); //删除标签管理 LambdaUpdateWrapper waresLabelWrapper = new LambdaUpdateWrapper<>(); waresLabelWrapper.eq(BdWaresLabel::getPkWares, pkId); waresLabelWrapper.set(BdWaresLabel::getPkModified, userId); waresLabelWrapper.set(BdWaresLabel::getModifiedTime, new Date()); waresLabelWrapper.set(BdWaresLabel::getDelFlag, EDelFlag.DELETE.getValue()); - waresLabelService.update(waresLabelWrapper); + iBdWaresLabelService.update(waresLabelWrapper); // 删除极差 LambdaUpdateWrapper waresRangeWrapper = new LambdaUpdateWrapper<>(); waresRangeWrapper.eq(BdWaresRange::getPkWares, pkId); waresRangeWrapper.set(BdWaresRange::getPkModified, userId); waresRangeWrapper.set(BdWaresRange::getModifiedTime, new Date()); waresRangeWrapper.set(BdWaresRange::getDelFlag, EDelFlag.DELETE.getValue()); - waresRangeService.update(waresRangeWrapper); + iBdWaresRangeService.update(waresRangeWrapper); // 删除规格明细 LambdaQueryWrapper detailWrapper = new LambdaQueryWrapper<>(); detailWrapper.eq(BdWaresDetail::getPkWares, pkId); - List list = waresDetailService.list(detailWrapper); + List list = iBdWaresDetailService.list(detailWrapper); for (BdWaresDetail bdWaresDetail : list) { LambdaUpdateWrapper waresSpecsWrapper = new LambdaUpdateWrapper<>(); waresSpecsWrapper.eq(BdWaresSpecs::getPkWaresDetail, bdWaresDetail.getPkId()); waresSpecsWrapper.set(BdWaresSpecs::getPkModified, userId); waresSpecsWrapper.set(BdWaresSpecs::getModifiedTime, new Date()); waresSpecsWrapper.set(BdWaresSpecs::getDelFlag, EDelFlag.DELETE.getValue()); - waresSpecsService.update(waresSpecsWrapper); + iBdWaresSpecsService.update(waresSpecsWrapper); } // 删除商品明细表 LambdaUpdateWrapper waresDetailWrapper = new LambdaUpdateWrapper<>(); @@ -887,25 +874,25 @@ public class BdWaresServiceImpl extends ServiceImpl impl waresDetailWrapper.set(BdWaresDetail::getPkModified, userId); waresDetailWrapper.set(BdWaresDetail::getModifiedTime, new Date()); waresDetailWrapper.set(BdWaresDetail::getDelFlag, EDelFlag.DELETE.getValue()); - waresDetailService.update(waresDetailWrapper); + iBdWaresDetailService.update(waresDetailWrapper); // 删除规格和包装 LambdaUpdateWrapper waresSpecsPackWrapper = new LambdaUpdateWrapper<>(); waresSpecsPackWrapper.eq(BdWaresSpecsPack::getPkWares, pkId); waresSpecsPackWrapper.set(BdWaresSpecsPack::getPkModified, userId); waresSpecsPackWrapper.set(BdWaresSpecsPack::getModifiedTime, new Date()); waresSpecsPackWrapper.set(BdWaresSpecsPack::getDelFlag, EDelFlag.DELETE.getValue()); - waresSpecsPackService.update(waresSpecsPackWrapper); + iBdWaresSpecsPackService.update(waresSpecsPackWrapper); // 删除sku LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); queryWrapper.eq(BdWaresSpecsSku::getPkWares, pkId); - List waresSpecsSkuList = waresSpecsSkuService.list(queryWrapper); + List waresSpecsSkuList = iBdWaresSpecsSkuService.list(queryWrapper); for (BdWaresSpecsSku bdWaresSpecsSku : waresSpecsSkuList) { LambdaUpdateWrapper waresSpecsRelationWrapper = new LambdaUpdateWrapper<>(); waresSpecsRelationWrapper.eq(BdWaresSpecsRelation::getPkWaresSpecsSku, bdWaresSpecsSku.getPkId()); waresSpecsRelationWrapper.set(BdWaresSpecsRelation::getPkModified, userId); waresSpecsRelationWrapper.set(BdWaresSpecsRelation::getModifiedTime, new Date()); waresSpecsRelationWrapper.set(BdWaresSpecsRelation::getDelFlag, EDelFlag.DELETE.getValue()); - waresSpecsRelationService.update(waresSpecsRelationWrapper); + iBdWaresSpecsRelationService.update(waresSpecsRelationWrapper); } LambdaUpdateWrapper waresSpecsSkuWrapper = new LambdaUpdateWrapper<>(); @@ -913,7 +900,7 @@ public class BdWaresServiceImpl extends ServiceImpl impl waresSpecsSkuWrapper.set(BdWaresSpecsSku::getPkModified, userId); waresSpecsSkuWrapper.set(BdWaresSpecsSku::getModifiedTime, new Date()); waresSpecsSkuWrapper.set(BdWaresSpecsSku::getDelFlag, EDelFlag.DELETE.getValue()); - waresSpecsSkuService.update(waresSpecsSkuWrapper); + iBdWaresSpecsSkuService.update(waresSpecsSkuWrapper); if (wares != null) { createDeleteWaresLog(wares, EApprovalBusiness.WARES_REMOVE.getValue(), loginUser); } @@ -1111,8 +1098,6 @@ public class BdWaresServiceImpl extends ServiceImpl impl * @param waresName 名称 * @param pkCountry 所属国家 * @return: List - * @Author: sui q - * @Date: 2022/9/19 9:05 */ @Override public List queryRecommendWaresByCondition(Integer specialArea, Integer pkAreaClassify, String waresName, Integer pkCountry) { @@ -1121,7 +1106,7 @@ public class BdWaresServiceImpl extends ServiceImpl impl private BdLabel getBdLabel(Integer pkId) { BdLabel bdLabel; - R result = labelService.getByPkId(pkId); + R result = iLabelServiceApi.getByPkId(pkId); if (result.isSuccess()) { bdLabel = BeanUtil.copyProperties(result.getData(), BdLabel.class); } else { @@ -1137,7 +1122,7 @@ public class BdWaresServiceImpl extends ServiceImpl impl public RecommendWaresInfoVo queryRecommendInfo(Integer pkCountry, String memberCode, Long userId, Map waresShowMap) { // 注册专区 只有报单中心 和服务中心 能看国内 海粉可以看到(复购、升级、海粉、合作) pk_settle_grade=1 // 登录用户 - R loginMemberDto = memberServiceApi.getMemberByCode(memberCode); + R loginMemberDto = iMemberServiceApi.getMemberByCode(memberCode); CuMemberExt loginMember = loginMemberDto.getData(); // 续约标记 -- 会员还有3月到期,需要能看到续约专区 @@ -1146,13 +1131,6 @@ public class BdWaresServiceImpl extends ServiceImpl impl expireFlag = DateUtils.addMonths(new Date(), 3).compareTo(loginMember.getExpireDate()) > 0; } -// // 2024.03.28 添加需求,只有指定4个账号可以看乐学注册、乐学升级 -// // 2024.12.01 CN75575376 编号安置伞下,可以乐学注册、升级 -// boolean isLexRegister = SysConstants.CHINA_LEX_REGISTER_LIST.contains(memberCode); -// -// // 可见乐学复购(标记是否乐学易考、金茗国际伞下) -// boolean isLex = null != memberServiceApi.checkMemberByParentList(SysConstants.CHINA_LEX_REPURCHASE_LIST, userId).getData(); - // 注册专区权限 boolean isLexRegister = ERegistrationAuthority.DECLARATION.getValue() == loginMember.getRegisterAuthority() || ERegistrationAuthority.SERVICE.getValue() == loginMember.getRegisterAuthority(); @@ -1167,8 +1145,7 @@ public class BdWaresServiceImpl extends ServiceImpl impl // 是否创客空间 int makerSpace = loginMember.getIsMakerSpace(); // 查询权限配置 - R> menuDetailListDto = iBdMenuDetailService.showMenuDetail(pkGrade, pkAwards, authority, makerSpace, pkCountry); - List menuDetailList = menuDetailListDto.getData(); + List menuDetailList = iMenuDetailServiceApi.showMenuDetail(pkGrade, pkAwards, authority, makerSpace, pkCountry).getData(); // 查询存在推荐的专区 List saList = baseMapper.queryRecommendWaresSpecial(); @@ -1187,9 +1164,6 @@ public class BdWaresServiceImpl extends ServiceImpl impl specialAreaList = saList; } - // 获取需要翻译的枚举翻译 - Map transactionMap = iTransactionCommonService.exportEnumTransaction(ESpecialArea.values()); - RecommendWaresInfoVo recommendWaresInfoVo = new RecommendWaresInfoVo(); // 推荐专区 List resultList = new ArrayList<>(); @@ -1206,12 +1180,6 @@ public class BdWaresServiceImpl extends ServiceImpl impl continue; } } -// else if (specialArea.equals(ESpecialArea.SPECIAL_REPURCHASE_AREA.getValue())) { -// // 乐学复购专区处理 -// if (!isLex) { -// continue; -// } -// } else if (specialArea.equals(ESpecialArea.RENEWAL_AREA.getValue())) { // 续约专区,只有有效期小于3个月的能看到 if (!expireFlag) { @@ -1222,18 +1190,8 @@ public class BdWaresServiceImpl extends ServiceImpl impl recommendSpecialAreaVo.setSpecialArea(specialArea); recommendSpecialAreaVo.setSort(sArea.getSort()); - String label = transactionMap.get(sArea.getKey()); - if (StringUtils.isNotBlank(label)) { - recommendSpecialAreaVo.setSpecialAreaName(label); - } else { - recommendSpecialAreaVo.setSpecialAreaName(sArea.getLabel()); - } + recommendSpecialAreaVo.setSpecialAreaName(sArea.getLabel()); - LambdaQueryWrapper qe = new LambdaQueryWrapper<>(); - qe.eq(BdWares::getSpecialArea, specialArea); - qe.eq(BdWares::getIsRecommend, EYesNo.YES.getIntValue()); - qe.eq(BdWares::getPkCountry, pkCountry); - qe.eq(BdWares::getWaresStatus, EApproveStatus.FINISH.getValue()); // 推荐商品 取值前两个 List waresList = this.queryByRecommendList(specialArea, EYesNo.YES.getIntValue(), pkCountry, waresShowMap); List filterList = new ArrayList<>(); @@ -1268,11 +1226,12 @@ public class BdWaresServiceImpl extends ServiceImpl impl List waresList = this.selectByRecommentList(pkCountry, specialAreaList); // 校验商品奖衔和等级/团队权限 List waresIdList = waresList.stream().map(BdWares::getPkId).collect(Collectors.toList()); + 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()); @@ -1280,21 +1239,15 @@ public class BdWaresServiceImpl extends ServiceImpl impl authWaresList.add(key); }); } + List wsList = new ArrayList<>(); - // 商品主键列表 - List pkWaresIds = new ArrayList<>(); - for (BdWaresExt bdWaresExt : waresList) { - pkWaresIds.add(bdWaresExt.getPkId()); - } // 查询商品sku 最小值 和数量 - // List waresSpecsSku = bdWaresSpecsSkuService.selectByMinWaresSpecsSku(waresExt.getPkId()); Map> waresSpecsSkuMap = new HashMap<>(); - if (pkWaresIds.size() > 0) { - List waresSpecsSkuArray = waresSpecsSkuService.selectByMinWaresSpecsSkuByPkWaresList(pkWaresIds); + if (waresIdList.size() > 0) { + List waresSpecsSkuArray = iBdWaresSpecsSkuService.selectByMinWaresSpecsSkuByPkWaresList(waresIdList); waresSpecsSkuMap = waresSpecsSkuArray.stream().collect(Collectors.groupingBy(BdWaresSpecsSkuExt::getPkWares)); } - for (BdWaresExt waresExt : waresList) { if (waresIdSet.contains(waresExt.getPkId())) { String gradeKey = waresExt.getPkId() + "_" + ERangeType.GRADE.getValue() + "_" + loginMember.getPkSettleGrade(); @@ -1342,7 +1295,7 @@ public class BdWaresServiceImpl extends ServiceImpl impl List waresVoList = new ArrayList<>(); List bdWaresRangeList = new ArrayList<>(); if (waresIdList.size() > 0) { - bdWaresRangeList = waresRangeService.queryWaresRangeByCondition(loginMember, waresIdList); + bdWaresRangeList = iBdWaresRangeService.queryWaresRangeByCondition(loginMember, waresIdList); } for (BdWaresExt bdWares : wsList) { @@ -1381,12 +1334,6 @@ public class BdWaresServiceImpl extends ServiceImpl impl continue; } } -// else if (bdWares.getSpecialArea().equals(ESpecialArea.SPECIAL_REPURCHASE_AREA.getValue())) { -// // 乐学复购专区处理 -// if (!isLex) { -// continue; -// } -// } else if (bdWares.getSpecialArea().equals(ESpecialArea.RENEWAL_AREA.getValue())) { // 续约专区,只有有效期小于3个月的能看到 if (!expireFlag) { @@ -1423,6 +1370,113 @@ public class BdWaresServiceImpl extends ServiceImpl impl return recommendWaresInfoVo; } + + /** + * 查询app 首页推荐专区 和推荐商品 + */ + @Override + public RecommendWaresInfoVo listWares(Integer pkCountry, Long userId, Map waresShowMap) { + // 登录用户 + CuMemberExt loginMember = iMemberServiceApi.getMemberById(userId).getData(); + + // 续约标记 -- 会员还有3月到期,需要能看到续约专区 + boolean expireFlag = false; + if (null != loginMember.getExpireDate()) { + expireFlag = DateUtils.addMonths(new Date(), 3).compareTo(loginMember.getExpireDate()) > 0; + } + + // 注册专区权限 + boolean isLexRegister = ERegistrationAuthority.DECLARATION.getValue() == loginMember.getRegisterAuthority() + || ERegistrationAuthority.SERVICE.getValue() == loginMember.getRegisterAuthority(); + + // 结算等级 + int pkGrade = loginMember.getPkSettleGrade(); + // 真实奖衔 + int pkAwards = loginMember.getPkAwards(); + // 注册权限 + int authority = loginMember.getRegisterAuthority(); + // 是否创客空间 + int makerSpace = loginMember.getIsMakerSpace(); + // 查询权限配置 + List menuDetailList = iMenuDetailServiceApi.showMenuDetail(pkGrade, pkAwards, authority, makerSpace, pkCountry).getData(); + + // 查询存在推荐的专区 + List saList = baseMapper.queryRecommendWaresSpecial(); + List specialAreaList = new ArrayList<>(); + //校验菜单权限 如果没有配置则全部显示 + if (menuDetailList.size() > 0) { + for (BdMenuDetail bdMenuDetail : menuDetailList) { + for (Integer specialArea : saList) { + ESpecialArea sarea = ESpecialArea.getESpecialAreaEnum(specialArea); + if (bdMenuDetail.getDetailValue().equals(sarea.getMenuDetailValue())) { + specialAreaList.add(specialArea); + } + } + } + } else { + specialAreaList = saList; + } + + RecommendWaresInfoVo recommendWaresInfoVo = new RecommendWaresInfoVo(); + // 推荐专区 + List resultList = new ArrayList<>(); + for (Integer specialArea : specialAreaList) { + ESpecialArea sArea = ESpecialArea.getESpecialAreaEnum(specialArea); + if (sArea != null) { + if (StringUtils.isNotBlank(sArea.getLabel())) { + RecommendSpecialAreaVo recommendSpecialAreaVo = new RecommendSpecialAreaVo(); + + if (specialArea.equals(ESpecialArea.SPECIAL_REGISTER_AREA.getValue()) + || specialArea.equals(ESpecialArea.SPECIAL_UPGRADE_AREA.getValue())) { + // 乐学注册权限判断 + if (!isLexRegister) { + continue; + } + } + if (specialArea.equals(ESpecialArea.RENEWAL_AREA.getValue())) { + // 续约专区,只有有效期小于3个月的能看到 + if (!expireFlag) { + continue; + } + } + recommendSpecialAreaVo.setSpecialArea(specialArea); + recommendSpecialAreaVo.setSort(sArea.getSort()); + recommendSpecialAreaVo.setSpecialAreaName(sArea.getLabel()); + resultList.add(recommendSpecialAreaVo); + + // 推荐商品 取值前两个 + List waresList = this.queryByRecommendList(specialArea, EYesNo.YES.getIntValue(), pkCountry, waresShowMap); + List filterList = new ArrayList<>(); + if (waresList.size() > 3) { + filterList.add(waresList.get(0)); + filterList.add(waresList.get(1)); + filterList.add(waresList.get(2)); + } else { + filterList.addAll(waresList); + } + List waresVoList = filterList.stream().map(wl -> { + WaresVo waresVo = new WaresVo(); + waresVo.setPkWares(wl.getPkId()); + waresVo.setWaresCode(wl.getWaresCode()); + waresVo.setWaresName(wl.getWaresName()); + waresVo.setWaresPrice(wl.getWaresPrice()); + waresVo.setCover1(wl.getCover1()); + waresVo.setIsSale(wl.getIsSale()); + waresVo.setPreSaleStatus(wl.getPreSaleStatus()); + waresVo.setSpecialArea(wl.getSpecialArea()); + return waresVo; + }).collect(Collectors.toList()); + recommendSpecialAreaVo.setWaresList(waresVoList); + } + } + } + + // 根据专区排序(按照指定排序排序: 注冊 升级 复购 自营 海粉 嗨粉) + resultList.sort(Comparator.comparingInt(RecommendSpecialAreaVo::getSort)); + recommendWaresInfoVo.setRecommendSpecialAreaList(resultList); + return recommendWaresInfoVo; + } + /** * 查询推荐商品 * @@ -1483,7 +1537,7 @@ public class BdWaresServiceImpl extends ServiceImpl impl @Override public List computeWaresPrice(List computeWaresPriceList) { // 极差 - R> rangeDto = rangeServiceApi.queryRange(SecurityUtils.getPkCountry()); + R> rangeDto = iRangeServiceApi.queryRange(SecurityUtils.getPkCountry()); List rangeList = rangeDto.getData(); return computeWaresPrice(computeWaresPriceList, rangeList); } @@ -1509,7 +1563,7 @@ public class BdWaresServiceImpl extends ServiceImpl impl if (specsIds.size() > 0) { LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); queryWrapper.in(BdSpecs::getPkId, specsIds); - List specsList = specsService.list(queryWrapper); + List specsList = iBdSpecsService.list(queryWrapper); specsMap = specsList.stream().collect(Collectors.toMap(BdSpecs::getPkId, a -> a, (v1, v2) -> v1)); } @@ -1539,7 +1593,7 @@ public class BdWaresServiceImpl extends ServiceImpl impl if (pkWares != null && pkProduct != null && pkWaresSpecsSku != null) { List waresSpecsIds = waresSpecsList.stream().map(BdWaresSpecs::getPkSpecs).collect(Collectors.toList()); - List waresSpecsRelationList = waresSpecsRelationService.getWaresProduct(pkWares, pkProduct, pkWaresSpecsSku, waresSpecsIds); + List waresSpecsRelationList = iBdWaresSpecsRelationService.getWaresProduct(pkWares, pkProduct, pkWaresSpecsSku, waresSpecsIds); // 数组一致 Map> collect = waresSpecsRelationList.stream().collect(Collectors.groupingBy(BdWaresSpecsRelationExt::getPkRange)); @@ -1638,7 +1692,7 @@ public class BdWaresServiceImpl extends ServiceImpl impl if (pkWaresList.size() > 0) { LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); queryWrapper.in(BdWaresAuthority::getPkWares, pkWaresList); - List waresAuthorityList = waresAuthorityService.list(queryWrapper); + List waresAuthorityList = iBdWaresAuthorityService.list(queryWrapper); map = waresAuthorityList.stream().collect(Collectors.groupingBy(BdWaresAuthority::getPkWares, Collectors.toList())); } return map; @@ -1655,27 +1709,6 @@ public class BdWaresServiceImpl extends ServiceImpl impl return baseMapper.selectByRecommentList(pkCountry, specialAreaList); } - - /** - * 上传商品id 修改预售状态 - */ - @Override - @Transactional(rollbackFor = Exception.class) - public Boolean updateWaresPreSale(List waresPreSaleParamList) { - try { - for (WaresPreSaleParam waresPreSaleParam : waresPreSaleParamList) { - // 修改预售数量 - baseMapper.updateByPkWaresPreSale(waresPreSaleParam); - // 修改预售状态 - baseMapper.updateByPkWaresPreSaleStatus(waresPreSaleParam); - } - return true; - } catch (Exception e) { - e.printStackTrace(); - return false; - } - } - /** * 扣减预售数量库存 * diff --git a/bd-business/bd-business-sale/src/main/java/com/hzs/sale/wares/vo/RecommendWaresInfoVo.java b/bd-business/bd-business-sale/src/main/java/com/hzs/sale/wares/vo/RecommendWaresInfoVo.java index cb5d78a9..fb4f3c4f 100644 --- a/bd-business/bd-business-sale/src/main/java/com/hzs/sale/wares/vo/RecommendWaresInfoVo.java +++ b/bd-business/bd-business-sale/src/main/java/com/hzs/sale/wares/vo/RecommendWaresInfoVo.java @@ -5,14 +5,6 @@ import lombok.Data; import java.util.List; -/** - * @BelongsProject: hzs_cloud - * @BelongsPackage: com.hzs.sale.wares.vo - * @Author: yh - * @CreateTime: 2023-05-15 14:02 - * @Description: - * @Version: 1.0 - */ @Data public class RecommendWaresInfoVo { diff --git a/bd-business/bd-business-sale/src/main/resources/mapper/sale/wares/BdWaresMapper.xml b/bd-business/bd-business-sale/src/main/resources/mapper/sale/wares/BdWaresMapper.xml index b292e214..c1dc4d12 100644 --- a/bd-business/bd-business-sale/src/main/resources/mapper/sale/wares/BdWaresMapper.xml +++ b/bd-business/bd-business-sale/src/main/resources/mapper/sale/wares/BdWaresMapper.xml @@ -377,9 +377,10 @@ order by bw.sort,bw.creation_time desc - + - - update BD_WARES - set PRE_SALE_QUANTITY = PRE_SALE_QUANTITY - #{quantity} - where PRE_SALE_QUANTITY > 0 - and IS_PRE_SALE = 0 - and PK_ID = #{pkWares} - - - - update BD_WARES - set IS_PRE_SALE = 1 - where PRE_SALE_QUANTITY = 0 - and IS_PRE_SALE = 0 - and PK_ID = #{pkWares} - - update BD_WARES set PRE_SALE_QUANTITY = PRE_SALE_QUANTITY - #{quantity} diff --git a/bd-business/bd-business-system/src/main/java/com/hzs/system/config/mapper/BdMenuDetailMapper.java b/bd-business/bd-business-system/src/main/java/com/hzs/system/config/mapper/BdMenuDetailMapper.java index 903329bc..2fae0558 100644 --- a/bd-business/bd-business-system/src/main/java/com/hzs/system/config/mapper/BdMenuDetailMapper.java +++ b/bd-business/bd-business-system/src/main/java/com/hzs/system/config/mapper/BdMenuDetailMapper.java @@ -8,9 +8,6 @@ import java.util.List; /** * 菜单配置权限明细 Mapper 接口 - * - * @author hzs - * @since 2022-10-08 */ public interface BdMenuDetailMapper extends BaseMapper { diff --git a/bd-business/bd-business-system/src/main/java/com/hzs/system/config/provider/IMenuDetailServiceProvider.java b/bd-business/bd-business-system/src/main/java/com/hzs/system/config/provider/IMenuDetailServiceProvider.java index c9c701ac..bb5c8432 100644 --- a/bd-business/bd-business-system/src/main/java/com/hzs/system/config/provider/IMenuDetailServiceProvider.java +++ b/bd-business/bd-business-system/src/main/java/com/hzs/system/config/provider/IMenuDetailServiceProvider.java @@ -9,14 +9,6 @@ import org.springframework.beans.factory.annotation.Autowired; import java.util.List; -/** - *@BelongsProject: hzs_cloud - *@BelongsPackage: com.hzs.system.config.provider - *@Author: yh - *@CreateTime: 2023-08-18 14:25 - *@Description: TODO - *@Version: 1.0 - */ @DubboService public class IMenuDetailServiceProvider implements IMenuDetailServiceApi { @@ -25,11 +17,12 @@ public class IMenuDetailServiceProvider implements IMenuDetailServiceApi { /** * 查询会员显示菜单 - * @param pkGrade 等级ID - * @param pkAwards 奖衔ID - * @param authority 注册权限 + * + * @param pkGrade 等级ID + * @param pkAwards 奖衔ID + * @param authority 注册权限 * @param makerSpace 是否创客空间 - * @param pkCountry 国家ID + * @param pkCountry 国家ID * @return */ @Override diff --git a/bd-business/bd-business-system/src/main/java/com/hzs/system/config/service/impl/BdMenuDetailServiceImpl.java b/bd-business/bd-business-system/src/main/java/com/hzs/system/config/service/impl/BdMenuDetailServiceImpl.java index fea3a880..f6438abf 100644 --- a/bd-business/bd-business-system/src/main/java/com/hzs/system/config/service/impl/BdMenuDetailServiceImpl.java +++ b/bd-business/bd-business-system/src/main/java/com/hzs/system/config/service/impl/BdMenuDetailServiceImpl.java @@ -10,9 +10,6 @@ import java.util.List; /** * 菜单配置权限明细 服务实现类 - * - * @author hzs - * @since 2022-10-08 */ @Service public class BdMenuDetailServiceImpl extends ServiceImpl implements IBdMenuDetailService {