## 新会员专区列表;
This commit is contained in:
parent
7c46173b2f
commit
171b768cbc
|
@ -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<List<BdMenuDetail>> showMenuDetail(Integer pkGrade, Integer pkAwards, Integer authority, Integer makerSpace, Integer pkCountry);
|
||||
|
||||
}
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -3541,10 +3541,6 @@ public class CuMemberServiceImpl extends ServiceImpl<CuMemberMapper, CuMember> i
|
|||
|
||||
/**
|
||||
* @description: 查询表是否存在
|
||||
* @author: zhang jing
|
||||
* @date: 2024/4/7 16:11
|
||||
* @param: [tableName]
|
||||
* @return: java.lang.Integer
|
||||
**/
|
||||
@Override
|
||||
public Integer selectExistTable(String tableName) {
|
||||
|
|
|
@ -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<CuWaresParams> waresParamsList = new ArrayList<>();
|
||||
|
||||
// 查询商品列表
|
||||
List<BdWaresExt> bdWaresExtList = bdWaresService.queryWaresByCondition(cuWaresParams.getSpecialArea(), cuWaresParams.getPkAreaClassify(), cuWaresParams.getWaresName(), null, null, pkCountry);
|
||||
List<BdWaresExt> bdWaresExtList = iBdWaresService.queryWaresByCondition(cuWaresParams.getSpecialArea(), cuWaresParams.getPkAreaClassify(), cuWaresParams.getWaresName(), null, null, pkCountry);
|
||||
|
||||
if (CollectionUtil.isNotEmpty(bdWaresExtList)) {
|
||||
// 等级
|
||||
R<List<GradeDTO>> gradeDTO = gradeServiceApi.queryGradeList(pkCountry);
|
||||
R<List<GradeDTO>> gradeDTO = iGradeServiceApi.queryGradeList(pkCountry);
|
||||
List<GradeDTO> gradeList = gradeDTO.getData();
|
||||
Map<Integer, GradeDTO> 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<CurrencyDTO> currency = currencyServiceApi.getCurrency(SecurityUtils.getPkCountry());
|
||||
R<CurrencyDTO> currency = iCurrencyServiceApi.getCurrency(SecurityUtils.getPkCountry());
|
||||
BigDecimal inExchangeRate = currency.getData().getInExchangeRate();
|
||||
|
||||
// 商品主键列表
|
||||
List<Integer> waresIdList = bdWaresExtList.stream().map(BdWares::getPkId).collect(Collectors.toList());
|
||||
// 检验商品团队信息
|
||||
Map<Integer, List<BdWaresAuthority>> waresAuthorityMap = bdWaresService.getWaresAuthority(waresIdList);
|
||||
Map<Integer, List<BdWaresAuthority>> waresAuthorityMap = iBdWaresService.getWaresAuthority(waresIdList);
|
||||
List<ShowWaresDTO> showWaresList = bdWaresExtList.stream().map(we -> getShowWares(we.getPkId(), userId, memberCode, waresAuthorityMap)).collect(Collectors.toList());
|
||||
R<Map<Integer, Boolean>> waresShowMapDto = memberServiceApi.checkIsShowWares(showWaresList);
|
||||
R<Map<Integer, Boolean>> waresShowMapDto = iMemberServiceApi.checkIsShowWares(showWaresList);
|
||||
Map<Integer, Boolean> waresShowMap = waresShowMapDto.getData();
|
||||
|
||||
// 商品标签列表
|
||||
BdWaresLabel waresLabel = new BdWaresLabel();
|
||||
waresLabel.setPkIdList(waresIdList);
|
||||
List<BdLabelExt> list = waresLabelService.selectByList(waresLabel);
|
||||
List<BdLabelExt> list = iBdWaresLabelService.selectByList(waresLabel);
|
||||
|
||||
// 标签
|
||||
for (BdWaresExt bdWaresExt : bdWaresExtList) {
|
||||
|
@ -203,28 +176,28 @@ public class ApiBdWaresController extends BaseController {
|
|||
// 查询商品sku 最小值 和数量
|
||||
Map<Integer, List<BdWaresSpecsSkuExt>> waresSpecsSkuMap = new HashMap<>();
|
||||
if (waresIdList.size() > 0) {
|
||||
List<BdWaresSpecsSkuExt> waresSpecsSkuArray = bdWaresSpecsSkuService.selectByMinWaresSpecsSkuByPkWaresList(waresIdList);
|
||||
List<BdWaresSpecsSkuExt> waresSpecsSkuArray = iBdWaresSpecsSkuService.selectByMinWaresSpecsSkuByPkWaresList(waresIdList);
|
||||
waresSpecsSkuMap = waresSpecsSkuArray.stream().collect(Collectors.groupingBy(BdWaresSpecsSkuExt::getPkWares));
|
||||
}
|
||||
|
||||
List<BdWaresSpecsSkuExt> waresSpecsSkuList = new ArrayList<>();
|
||||
if (waresIdList.size() > 0) {
|
||||
// 查询默认规格
|
||||
waresSpecsSkuList = bdWaresSpecsSkuService.selectByWaresSpecsSku(waresIdList);
|
||||
waresSpecsSkuList = iBdWaresSpecsSkuService.selectByWaresSpecsSku(waresIdList);
|
||||
}
|
||||
|
||||
List<BdWaresRange> 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<Integer> waresIdSet = new HashSet<>();
|
||||
List<String> authWaresList = new ArrayList<>();
|
||||
if (waresIdList.size() > 0) {
|
||||
// 处理商品权限
|
||||
List<WaresGradeAwards> waresGradeAwardsList = waresGradeService.queryWaresGradeAwards(waresIdList);
|
||||
List<WaresGradeAwards> 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<CurrencyDTO> kgCurrency = currencyServiceApi.getCurrency(pkCountry);
|
||||
R<CurrencyDTO> 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<AreaCurrencyDTO> 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<AreaCurrencyDTO> areaCurrencyDTOList = areaCurrencyServiceApi.queryAreaCurrencyByCondition(cuWaresParams.getSpecialArea(), pkCountry).getData();
|
||||
List<AreaCurrencyDTO> 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<AreaCurrencyDTO> 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<BdAgreement> waresExtList = bdWaresService.selectByWaresCodeList(waresAgrementParam.getWaresCodeList());
|
||||
List<BdAgreement> 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<BdWaresExt> bdWaresList = bdWaresService.queryByRecommendList(null, EYesNo.YES.getIntValue(), pkCountry, new HashMap<>());
|
||||
List<BdWaresExt> bdWaresList = iBdWaresService.queryByRecommendList(null, EYesNo.YES.getIntValue(), pkCountry, new HashMap<>());
|
||||
Map<Integer, Boolean> waresShowMap = new HashMap<>();
|
||||
if (bdWaresList.size() > 0) {
|
||||
// 检验商品团队信息
|
||||
List<Integer> waresIdList = bdWaresList.stream().map(BdWares::getPkId).collect(Collectors.toList());
|
||||
Map<Integer, List<BdWaresAuthority>> waresAuthorityMap = bdWaresService.getWaresAuthority(waresIdList);
|
||||
Map<Integer, List<BdWaresAuthority>> waresAuthorityMap = iBdWaresService.getWaresAuthority(waresIdList);
|
||||
List<ShowWaresDTO> showWaresList = bdWaresList.stream().map(we -> getShowWares(we.getPkId(), userId, memberCode, waresAuthorityMap)).collect(Collectors.toList());
|
||||
R<Map<Integer, Boolean>> waresShowMapDto = memberServiceApi.checkIsShowWares(showWaresList);
|
||||
R<Map<Integer, Boolean>> waresShowMapDto = iMemberServiceApi.checkIsShowWares(showWaresList);
|
||||
waresShowMap = waresShowMapDto.getData();
|
||||
}
|
||||
// 查询全部的banner (登录后banner)
|
||||
R<List<AdvertBannerDTO>> 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<WaresVo> 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<BdWaresExt> bdWaresList = iBdWaresService.queryByRecommendList(null, EYesNo.YES.getIntValue(), pkCountry, new HashMap<>());
|
||||
Map<Integer, Boolean> waresShowMap = new HashMap<>();
|
||||
if (bdWaresList.size() > 0) {
|
||||
// 检验商品团队信息
|
||||
List<Integer> waresIdList = bdWaresList.stream().map(BdWares::getPkId).collect(Collectors.toList());
|
||||
Map<Integer, List<BdWaresAuthority>> waresAuthorityMap = iBdWaresService.getWaresAuthority(waresIdList);
|
||||
List<ShowWaresDTO> showWaresList = bdWaresList.stream().map(we -> getShowWares(we.getPkId(), userId, memberCode, waresAuthorityMap)).collect(Collectors.toList());
|
||||
R<Map<Integer, Boolean>> 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<CuWaresParams> waresParamsList = new ArrayList<>();
|
||||
|
||||
// 查询商品列表
|
||||
List<BdWaresExt> bdWaresExtList = bdWaresService.queryRecommendWaresByCondition(cuWaresParams.getSpecialArea(), cuWaresParams.getPkAreaClassify(), cuWaresParams.getWaresName(), pkCountry);
|
||||
List<BdWaresExt> bdWaresExtList = iBdWaresService.queryRecommendWaresByCondition(cuWaresParams.getSpecialArea(), cuWaresParams.getPkAreaClassify(), cuWaresParams.getWaresName(), pkCountry);
|
||||
|
||||
if (CollectionUtil.isNotEmpty(bdWaresExtList)) {
|
||||
// 商品ID列表
|
||||
List<Integer> pkWaresIds = bdWaresExtList.stream().map(BdWares::getPkId).collect(Collectors.toList());
|
||||
|
||||
// 当前会员
|
||||
CuMember cuMember = saOrderService.getCuMemberByKey(SecurityUtils.getUserId());
|
||||
CuMember cuMember = iSaOrderService.getCuMemberByKey(SecurityUtils.getUserId());
|
||||
// 汇率比例
|
||||
R<CurrencyDTO> currency = currencyServiceApi.getCurrency(pkCountry);
|
||||
R<CurrencyDTO> currency = iCurrencyServiceApi.getCurrency(pkCountry);
|
||||
BigDecimal inExchangeRate = currency.getData().getInExchangeRate();
|
||||
|
||||
// 查询商品标签列表
|
||||
BdWaresLabel waresLabel = new BdWaresLabel();
|
||||
waresLabel.setPkIdList(pkWaresIds);
|
||||
List<BdLabelExt> labelList = waresLabelService.selectByList(waresLabel);
|
||||
List<BdLabelExt> 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<Integer, List<BdWaresSpecsSkuExt>> waresSpecsSkuMap = new HashMap<>();
|
||||
if (pkWaresIds.size() > 0) {
|
||||
List<BdWaresSpecsSkuExt> waresSpecsSkuArray = bdWaresSpecsSkuService.selectByMinWaresSpecsSkuByPkWaresList(pkWaresIds);
|
||||
List<BdWaresSpecsSkuExt> 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<Integer> waresIdSet = new ArrayList<>();
|
||||
bdWaresExtList.forEach(we -> {
|
||||
waresIdSet.add(we.getPkId());
|
||||
});
|
||||
List<BdWaresRange> bdWaresRangeList = bdWaresRangeService.queryWaresRangeByCondition(cuMember, waresIdSet);
|
||||
List<BdWaresRange> 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<BdWaresSpecsSkuExt> list = bdWaresSpecsSkuService.selectByWaresSpecsSku(Collections.singletonList(waresExt.getPkId()));
|
||||
List<BdWaresSpecsSkuExt> list = iBdWaresSpecsSkuService.selectByWaresSpecsSku(Collections.singletonList(waresExt.getPkId()));
|
||||
List<BdWaresSpecsSkuExt> 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<BdWaresGrade> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(BdWaresGrade::getPkWares, waresExt.getPkId());
|
||||
List<BdWaresGrade> waresGradeList = waresGradeService.list(queryWrapper);
|
||||
List<BdWaresGrade> 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<Integer> waresSpecsSkuList = waresInfoParam.getWaresSpecsSku().stream().map(WaresSpecsSkuParam::getPkWaresSpecsSku).collect(Collectors.toList());
|
||||
List<WaresItemWaresInfo> waresItemWaresInfos = bdWaresSpecsSkuService.selectByPkIds(waresSpecsSkuList);
|
||||
List<WaresItemWaresInfo> 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<CurrencyDTO> currency = currencyServiceApi.getCurrency(pkCountry);
|
||||
R<CurrencyDTO> currency = iCurrencyServiceApi.getCurrency(pkCountry);
|
||||
// 汇率比例
|
||||
BigDecimal inExchangeRate = currency.getData().getInExchangeRate();
|
||||
pv = ComputeUtil.computeMultiply(pv, inExchangeRate);
|
||||
|
|
|
@ -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<BdWares> {
|
|||
* @param waresCodeNotInList 不包含的商品编号列表 -- 可为null
|
||||
* @param pkCountry 所属国家
|
||||
* @return: List<BdWaresExt>
|
||||
* @Author: sui q
|
||||
* @Date: 2022/9/16 11:13
|
||||
*/
|
||||
List<BdWaresExt> queryWaresByCondition(@Param("specialArea") Integer specialArea,
|
||||
@Param("pkAreaClassify") Integer pkAreaClassify,
|
||||
|
@ -132,8 +129,6 @@ public interface BdWaresMapper extends BaseMapper<BdWares> {
|
|||
* @param waresName 名称
|
||||
* @param pkCountry 所属国家
|
||||
* @return: List<BdWaresExt>
|
||||
* @Author: sui q
|
||||
* @Date: 2022/9/19 9:05
|
||||
*/
|
||||
List<BdWaresExt> 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<BdWares> {
|
|||
* @param pkCountry
|
||||
* @return
|
||||
*/
|
||||
List<BdWaresExt> 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<BdWaresExt> queryByRecommendList(@Param("specialArea") Integer specialArea,
|
||||
@Param("isRecommend") Integer isRecommend,
|
||||
@Param("pkCountry") Integer pkCountry);
|
||||
|
||||
/**
|
||||
* 扣减预售数量库存
|
||||
|
|
|
@ -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;
|
||||
|
||||
}
|
|
@ -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<BdWares> {
|
|||
* @param waresCodeNotInList 不包含的商品编号列表 -- 可为null
|
||||
* @param pkCountry 所属国家
|
||||
* @return: List<BdWaresExt>
|
||||
* @Author: sui q
|
||||
* @Date: 2022/9/19 9:05
|
||||
*/
|
||||
List<BdWaresExt> queryWaresByCondition(Integer specialArea,
|
||||
Integer pkAreaClassify,
|
||||
|
@ -77,8 +74,6 @@ public interface IBdWaresService extends IService<BdWares> {
|
|||
* @param waresName 名称
|
||||
* @param pkCountry 所属国家
|
||||
* @return: List<BdWaresExt>
|
||||
* @Author: sui q
|
||||
* @Date: 2022/9/19 9:05
|
||||
*/
|
||||
List<BdWaresExt> queryRecommendWaresByCondition(Integer specialArea, Integer pkAreaClassify, String waresName, Integer pkCountry);
|
||||
|
||||
|
@ -86,8 +81,6 @@ public interface IBdWaresService extends IService<BdWares> {
|
|||
* 根据条件查询商品,专区商品列表
|
||||
*
|
||||
* @return: List<BdWaresExt>
|
||||
* @Author: sui q
|
||||
* @Date: 2022/9/19 9:05
|
||||
*/
|
||||
List<BdWaresExt> queryWaresByCondition();
|
||||
|
||||
|
@ -153,6 +146,11 @@ public interface IBdWaresService extends IService<BdWares> {
|
|||
*/
|
||||
RecommendWaresInfoVo queryRecommendInfo(Integer pkCountry, String memberCode, Long userId, Map<Integer, Boolean> waresShowMap);
|
||||
|
||||
/**
|
||||
* 查询商品专区列表
|
||||
*/
|
||||
RecommendWaresInfoVo listWares(Integer pkCountry, Long userId, Map<Integer, Boolean> waresShowMap);
|
||||
|
||||
/**
|
||||
* 修改自动上下架状态(自动上架)
|
||||
*
|
||||
|
@ -162,14 +160,9 @@ public interface IBdWaresService extends IService<BdWares> {
|
|||
|
||||
/**
|
||||
* @description: 修改商品预售状态
|
||||
* @author: zhang jing
|
||||
* @date: 2024/10/24 16:10
|
||||
* @param: []
|
||||
* @return: void
|
||||
**/
|
||||
void waresPreSale();
|
||||
|
||||
|
||||
/**
|
||||
* 修改自动上下架状态(自动下架)
|
||||
*
|
||||
|
@ -204,12 +197,6 @@ public interface IBdWaresService extends IService<BdWares> {
|
|||
*/
|
||||
List<BdWaresExt> queryByRecommendList(Integer specialArea, Integer isRecommend, Integer pkCountry, Map<Integer, Boolean> waresShowMap);
|
||||
|
||||
|
||||
/**
|
||||
* 上传商品id 修改预售状态
|
||||
*/
|
||||
Boolean updateWaresPreSale(List<WaresPreSaleParam> waresPreSaleParamList);
|
||||
|
||||
/**
|
||||
* 扣减预售数量库存
|
||||
*
|
||||
|
|
|
@ -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<BdWaresMapper, BdWares> 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<BdWaresMapper, BdWares> impl
|
|||
// 设置 wares 对象的值
|
||||
BdWares wares = BeanUtil.copyProperties(waresParams, BdWares.class);
|
||||
wares.setPkId(waresParams.getWaresId());
|
||||
R<Integer> transaction = transactionServiceApi.createTransaction(user.getDataCountry(), ETransactionKey.SPEC, waresParams.getWaresName(), EYesNo.NO, EYesNo.NO);
|
||||
R<Integer> 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<BdWaresMapper, BdWares> impl
|
|||
waresParams.setMakerIncome(BigDecimal.ZERO);
|
||||
}
|
||||
if (null != waresParams.getMakerIncome()) {
|
||||
R<CurrencyDTO> currencyDto = currencyServiceApi.getCurrency(user.getDataCountry());
|
||||
R<CurrencyDTO> 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<BdWaresMapper, BdWares> 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<BdWaresMapper, BdWares> impl
|
|||
waresGradeList.add(bdWaresGrade);
|
||||
}
|
||||
if (waresGradeList.size() > 0) {
|
||||
waresGradeService.saveBatch(waresGradeList);
|
||||
iBdWaresGradeService.saveBatch(waresGradeList);
|
||||
}
|
||||
}
|
||||
// 奖衔
|
||||
|
@ -213,7 +202,7 @@ public class BdWaresServiceImpl extends ServiceImpl<BdWaresMapper, BdWares> 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<BdWaresMapper, BdWares> 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<BdWaresMapper, BdWares> impl
|
|||
* @return
|
||||
*/
|
||||
private List<WaresRangeParams> computeWaresRange(List<WaresSpecsSkuParams> waresSpecsSkuList) {
|
||||
R<List<BdRangeExt>> rangeDto = rangeServiceApi.queryRange(SecurityUtils.getPkCountry());
|
||||
R<List<BdRangeExt>> rangeDto = iRangeServiceApi.queryRange(SecurityUtils.getPkCountry());
|
||||
List<BdRangeExt> rangeList = rangeDto.getData();
|
||||
List<WaresRangeParams> waresRangeParamsList = new ArrayList<>();
|
||||
for (WaresSpecsSkuParams waresSpecsSkuParams : waresSpecsSkuList) {
|
||||
|
@ -330,7 +319,7 @@ public class BdWaresServiceImpl extends ServiceImpl<BdWaresMapper, BdWares> impl
|
|||
list.add(sellingLabel);
|
||||
}
|
||||
}
|
||||
waresLabelService.saveBatch(list);
|
||||
iBdWaresLabelService.saveBatch(list);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -357,12 +346,12 @@ public class BdWaresServiceImpl extends ServiceImpl<BdWaresMapper, BdWares> impl
|
|||
queryWrapper.eq(BdWaresDetail::getIsGift, waresRangeParams.getIsGift());
|
||||
}
|
||||
// 查询当前商品详情id
|
||||
BdWaresDetail waresDetail = waresDetailService.getOne(queryWrapper);
|
||||
BdWaresDetail waresDetail = iBdWaresDetailService.getOne(queryWrapper);
|
||||
if (waresDetail != null) {
|
||||
// 根据详情外键查询所有规格明细值
|
||||
LambdaQueryWrapper<BdWaresSpecsRelation> specsWrapper = new LambdaQueryWrapper<>();
|
||||
specsWrapper.eq(BdWaresSpecsRelation::getPkWaresDetail, waresDetail.getPkId());
|
||||
List<BdWaresSpecsRelation> relationList = waresSpecsRelationService.list(specsWrapper);
|
||||
List<BdWaresSpecsRelation> relationList = iBdWaresSpecsRelationService.list(specsWrapper);
|
||||
// 根据规格id 分组
|
||||
Map<Integer, List<BdWaresSpecsRelation>> collect = relationList.stream().collect(Collectors.groupingBy(BdWaresSpecsRelation::getPkWaresSpecsSku));
|
||||
for (Map.Entry<Integer, List<BdWaresSpecsRelation>> integer : collect.entrySet()) {
|
||||
|
@ -371,7 +360,7 @@ public class BdWaresServiceImpl extends ServiceImpl<BdWaresMapper, BdWares> impl
|
|||
|
||||
LambdaQueryWrapper<BdWaresSpecs> listWrapper = new LambdaQueryWrapper<>();
|
||||
listWrapper.in(BdWaresSpecs::getPkId, pkWaresSpecsIds);
|
||||
List<BdWaresSpecs> rslist = waresSpecsService.list(listWrapper);
|
||||
List<BdWaresSpecs> rslist = iBdWaresSpecsService.list(listWrapper);
|
||||
for (BdWaresSpecs bdWaresSpecs : rslist) {
|
||||
pkWaresSpecsList.add(bdWaresSpecs.getPkSpecs());
|
||||
}
|
||||
|
@ -403,7 +392,7 @@ public class BdWaresServiceImpl extends ServiceImpl<BdWaresMapper, BdWares> impl
|
|||
}
|
||||
}
|
||||
if (wrList.size() > 0) {
|
||||
waresRangeService.saveBatch(wrList);
|
||||
iBdWaresRangeService.saveBatch(wrList);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -418,7 +407,7 @@ public class BdWaresServiceImpl extends ServiceImpl<BdWaresMapper, BdWares> impl
|
|||
for (WaresAuthorityParam waresAuthorityParam : waresAuthorityList) {
|
||||
Long memberId = null;
|
||||
if (StringUtils.isNotBlank(waresAuthorityParam.getMemberCode())) {
|
||||
R<CuMember> member = memberServiceApi.getMember(waresAuthorityParam.getMemberCode());
|
||||
R<CuMember> member = iMemberServiceApi.getMember(waresAuthorityParam.getMemberCode());
|
||||
if (member.getData() == null) {
|
||||
throw new BaseException("查询会员失败");
|
||||
}
|
||||
|
@ -436,7 +425,7 @@ public class BdWaresServiceImpl extends ServiceImpl<BdWaresMapper, BdWares> impl
|
|||
waList.add(bdWaresAuthority);
|
||||
|
||||
}
|
||||
waresAuthorityService.saveBatch(waList);
|
||||
iBdWaresAuthorityService.saveBatch(waList);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -458,7 +447,7 @@ public class BdWaresServiceImpl extends ServiceImpl<BdWaresMapper, BdWares> 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<BdWaresMapper, BdWares> impl
|
|||
bdWaresSpecsSku.setVipPrice(waresSpecsSkuParams.getVipPrice());
|
||||
bdWaresSpecsSku.setRetailPrice(waresSpecsSkuParams.getRetailPrice());
|
||||
bdWaresSpecsSku.setSkuCode(waresSpecsSkuParams.getSkuCode());
|
||||
waresSpecsSkuService.save(bdWaresSpecsSku);
|
||||
iBdWaresSpecsSkuService.save(bdWaresSpecsSku);
|
||||
// 生成规格明细表
|
||||
List<BdWaresSpecs> waresSpecsList = waresSpecsSkuParams.getWaresSpecsList();
|
||||
for (BdWaresSpecs waresSpecs : waresSpecsList) {
|
||||
|
@ -477,18 +466,18 @@ public class BdWaresServiceImpl extends ServiceImpl<BdWaresMapper, BdWares> 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<BdWaresDetail> queryWrapper = new LambdaQueryWrapper<>();
|
||||
|
@ -497,7 +486,7 @@ public class BdWaresServiceImpl extends ServiceImpl<BdWaresMapper, BdWares> 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<BdWaresSpecs> waresSpecsList = waresSpecsSkuParams.getWaresSpecsList();
|
||||
|
@ -505,14 +494,14 @@ public class BdWaresServiceImpl extends ServiceImpl<BdWaresMapper, BdWares> 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<BdWaresMapper, BdWares> 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<BdWaresMapper, BdWares> impl
|
|||
waresDetailList.add(bdWaresDetail);
|
||||
}
|
||||
if (waresDetailList.size() > 0) {
|
||||
waresDetailService.saveBatch(waresDetailList);
|
||||
iBdWaresDetailService.saveBatch(waresDetailList);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -578,7 +567,7 @@ public class BdWaresServiceImpl extends ServiceImpl<BdWaresMapper, BdWares> impl
|
|||
bdWaresSpecsPack.setPkCountry(SecurityUtils.getPkCountry());
|
||||
list.add(bdWaresSpecsPack);
|
||||
}
|
||||
waresSpecsPackService.saveBatch(list);
|
||||
iBdWaresSpecsPackService.saveBatch(list);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -593,7 +582,7 @@ public class BdWaresServiceImpl extends ServiceImpl<BdWaresMapper, BdWares> impl
|
|||
public void updateWares(WaresParams waresParams, LoginUser user) {
|
||||
BdWares wares = BeanUtil.copyProperties(waresParams, BdWares.class);
|
||||
wares.setPkId(waresParams.getWaresId());
|
||||
R<Integer> transaction = transactionServiceApi.createTransaction(user.getDataCountry(), ETransactionKey.SPEC, waresParams.getWaresName(), EYesNo.NO, EYesNo.NO);
|
||||
R<Integer> 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<BdWaresMapper, BdWares> 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<BdWaresMapper, BdWares> impl
|
|||
waresParams.setMakerIncome(BigDecimal.ZERO);
|
||||
}
|
||||
if (null != waresParams.getMakerIncome()) {
|
||||
R<CurrencyDTO> currencyDto = currencyServiceApi.getCurrency(user.getDataCountry());
|
||||
R<CurrencyDTO> 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<BdWaresMapper, BdWares> impl
|
|||
}
|
||||
}
|
||||
|
||||
waresExtendService.update(waresExtend, queryWrapper);
|
||||
iBdWaresExtendService.update(waresExtend, queryWrapper);
|
||||
|
||||
// 删除关联表
|
||||
deleteWaresInfo(waresParams.getWaresId());
|
||||
|
@ -678,7 +667,7 @@ public class BdWaresServiceImpl extends ServiceImpl<BdWaresMapper, BdWares> impl
|
|||
if (waresParams.getWaresGradeIds() != null) {
|
||||
LambdaQueryWrapper<BdWaresGrade> 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<BdWaresMapper, BdWares> 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<BdWaresMapper, BdWares> impl
|
|||
// IBdWaresAwardsService
|
||||
LambdaQueryWrapper<BdWaresAwards> queryWrapper1 = new LambdaQueryWrapper<>();
|
||||
queryWrapper1.eq(BdWaresAwards::getPkWares, wares.getPkId());
|
||||
waresAwardsService.remove(queryWrapper1);
|
||||
iBdWaresAwardsService.remove(queryWrapper1);
|
||||
// 校验奖衔id 是否存在
|
||||
R<List<BdAwards>> awardsDto = awardsServiceApi.queryAwards(waresParams.getPkCountry());
|
||||
R<List<BdAwards>> awardsDto = iAwardsServiceApi.queryAwards(waresParams.getPkCountry());
|
||||
List<BdAwards> awardsList = awardsDto.getData();
|
||||
List<Integer> waresAwardsIdList = new ArrayList<>();
|
||||
for (BdAwards bdAwards : awardsList) {
|
||||
|
@ -713,14 +702,14 @@ public class BdWaresServiceImpl extends ServiceImpl<BdWaresMapper, BdWares> impl
|
|||
bdWaresAwards.setCreationTime(DateUtils.currentDateTime());
|
||||
bdWaresAwards.setPkCreator(user.getUserId());
|
||||
bdWaresAwards.setPkCountry(user.getDataCountry());
|
||||
waresAwardsService.save(bdWaresAwards);
|
||||
iBdWaresAwardsService.save(bdWaresAwards);
|
||||
}
|
||||
}
|
||||
|
||||
// 用户权限配置
|
||||
if (waresParams.getWaresMemberAuthorizeList() != null) {
|
||||
List<BdWaresAuthorize> 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<BdWaresMapper, BdWares> 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<BdWaresMapper, BdWares> 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<BdWaresSpecsSku> 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<BdWaresDetail> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(BdWaresDetail::getPkWares, waresId);
|
||||
List<BdWaresDetail> waresDetailList = waresDetailService.list(queryWrapper);
|
||||
List<BdWaresDetail> waresDetailList = iBdWaresDetailService.list(queryWrapper);
|
||||
for (BdWaresDetail bdWaresDetail : waresDetailList) {
|
||||
// 删除商品关联规格
|
||||
LambdaUpdateWrapper<BdWaresSpecs> 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<BdWaresSpecsRelation> 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<BdWaresAuthority> 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<BdWaresDetail> 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<BdWaresRange> 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<BdWaresSpecsPack> 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<BdWaresMapper, BdWares> 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<BdWaresAuthority> 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<BdWaresLabel> 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<BdWaresRange> 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<BdWaresDetail> detailWrapper = new LambdaQueryWrapper<>();
|
||||
detailWrapper.eq(BdWaresDetail::getPkWares, pkId);
|
||||
List<BdWaresDetail> list = waresDetailService.list(detailWrapper);
|
||||
List<BdWaresDetail> list = iBdWaresDetailService.list(detailWrapper);
|
||||
for (BdWaresDetail bdWaresDetail : list) {
|
||||
LambdaUpdateWrapper<BdWaresSpecs> 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<BdWaresDetail> waresDetailWrapper = new LambdaUpdateWrapper<>();
|
||||
|
@ -887,25 +874,25 @@ public class BdWaresServiceImpl extends ServiceImpl<BdWaresMapper, BdWares> 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<BdWaresSpecsPack> 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<BdWaresSpecsSku> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(BdWaresSpecsSku::getPkWares, pkId);
|
||||
List<BdWaresSpecsSku> waresSpecsSkuList = waresSpecsSkuService.list(queryWrapper);
|
||||
List<BdWaresSpecsSku> waresSpecsSkuList = iBdWaresSpecsSkuService.list(queryWrapper);
|
||||
for (BdWaresSpecsSku bdWaresSpecsSku : waresSpecsSkuList) {
|
||||
LambdaUpdateWrapper<BdWaresSpecsRelation> 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<BdWaresSpecsSku> waresSpecsSkuWrapper = new LambdaUpdateWrapper<>();
|
||||
|
@ -913,7 +900,7 @@ public class BdWaresServiceImpl extends ServiceImpl<BdWaresMapper, BdWares> 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<BdWaresMapper, BdWares> impl
|
|||
* @param waresName 名称
|
||||
* @param pkCountry 所属国家
|
||||
* @return: List<BdWaresExt>
|
||||
* @Author: sui q
|
||||
* @Date: 2022/9/19 9:05
|
||||
*/
|
||||
@Override
|
||||
public List<BdWaresExt> queryRecommendWaresByCondition(Integer specialArea, Integer pkAreaClassify, String waresName, Integer pkCountry) {
|
||||
|
@ -1121,7 +1106,7 @@ public class BdWaresServiceImpl extends ServiceImpl<BdWaresMapper, BdWares> impl
|
|||
|
||||
private BdLabel getBdLabel(Integer pkId) {
|
||||
BdLabel bdLabel;
|
||||
R<LabelConfigDTO> result = labelService.getByPkId(pkId);
|
||||
R<LabelConfigDTO> result = iLabelServiceApi.getByPkId(pkId);
|
||||
if (result.isSuccess()) {
|
||||
bdLabel = BeanUtil.copyProperties(result.getData(), BdLabel.class);
|
||||
} else {
|
||||
|
@ -1137,7 +1122,7 @@ public class BdWaresServiceImpl extends ServiceImpl<BdWaresMapper, BdWares> impl
|
|||
public RecommendWaresInfoVo queryRecommendInfo(Integer pkCountry, String memberCode, Long userId, Map<Integer, Boolean> waresShowMap) {
|
||||
// 注册专区 只有报单中心 和服务中心 能看国内 海粉可以看到(复购、升级、海粉、合作) pk_settle_grade=1
|
||||
// 登录用户
|
||||
R<CuMemberExt> loginMemberDto = memberServiceApi.getMemberByCode(memberCode);
|
||||
R<CuMemberExt> loginMemberDto = iMemberServiceApi.getMemberByCode(memberCode);
|
||||
CuMemberExt loginMember = loginMemberDto.getData();
|
||||
|
||||
// 续约标记 -- 会员还有3月到期,需要能看到续约专区
|
||||
|
@ -1146,13 +1131,6 @@ public class BdWaresServiceImpl extends ServiceImpl<BdWaresMapper, BdWares> 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<BdWaresMapper, BdWares> impl
|
|||
// 是否创客空间
|
||||
int makerSpace = loginMember.getIsMakerSpace();
|
||||
// 查询权限配置
|
||||
R<List<BdMenuDetail>> menuDetailListDto = iBdMenuDetailService.showMenuDetail(pkGrade, pkAwards, authority, makerSpace, pkCountry);
|
||||
List<BdMenuDetail> menuDetailList = menuDetailListDto.getData();
|
||||
List<BdMenuDetail> menuDetailList = iMenuDetailServiceApi.showMenuDetail(pkGrade, pkAwards, authority, makerSpace, pkCountry).getData();
|
||||
|
||||
// 查询存在推荐的专区
|
||||
List<Integer> saList = baseMapper.queryRecommendWaresSpecial();
|
||||
|
@ -1187,9 +1164,6 @@ public class BdWaresServiceImpl extends ServiceImpl<BdWaresMapper, BdWares> impl
|
|||
specialAreaList = saList;
|
||||
}
|
||||
|
||||
// 获取需要翻译的枚举翻译
|
||||
Map<String, String> transactionMap = iTransactionCommonService.exportEnumTransaction(ESpecialArea.values());
|
||||
|
||||
RecommendWaresInfoVo recommendWaresInfoVo = new RecommendWaresInfoVo();
|
||||
// 推荐专区
|
||||
List<RecommendSpecialAreaVo> resultList = new ArrayList<>();
|
||||
|
@ -1206,12 +1180,6 @@ public class BdWaresServiceImpl extends ServiceImpl<BdWaresMapper, BdWares> 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<BdWaresMapper, BdWares> 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<BdWares> 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<BdWaresExt> waresList = this.queryByRecommendList(specialArea, EYesNo.YES.getIntValue(), pkCountry, waresShowMap);
|
||||
List<BdWaresExt> filterList = new ArrayList<>();
|
||||
|
@ -1268,11 +1226,12 @@ public class BdWaresServiceImpl extends ServiceImpl<BdWaresMapper, BdWares> impl
|
|||
List<BdWaresExt> waresList = this.selectByRecommentList(pkCountry, specialAreaList);
|
||||
// 校验商品奖衔和等级/团队权限
|
||||
List<Integer> waresIdList = waresList.stream().map(BdWares::getPkId).collect(Collectors.toList());
|
||||
|
||||
Set<Integer> waresIdSet = new HashSet<>();
|
||||
List<String> authWaresList = new ArrayList<>();
|
||||
if (waresIdList.size() > 0) {
|
||||
// 处理商品权限
|
||||
List<WaresGradeAwards> waresGradeAwardsList = waresGradeService.queryWaresGradeAwards(waresIdList);
|
||||
List<WaresGradeAwards> waresGradeAwardsList = iBdWaresGradeService.queryWaresGradeAwards(waresIdList);
|
||||
// 先处理没有配置等级、奖衔的商品
|
||||
waresGradeAwardsList.forEach(waresGradeAwards -> {
|
||||
waresIdSet.add(waresGradeAwards.getPkWares());
|
||||
|
@ -1280,21 +1239,15 @@ public class BdWaresServiceImpl extends ServiceImpl<BdWaresMapper, BdWares> impl
|
|||
authWaresList.add(key);
|
||||
});
|
||||
}
|
||||
|
||||
List<BdWaresExt> wsList = new ArrayList<>();
|
||||
// 商品主键列表
|
||||
List<Integer> pkWaresIds = new ArrayList<>();
|
||||
for (BdWaresExt bdWaresExt : waresList) {
|
||||
pkWaresIds.add(bdWaresExt.getPkId());
|
||||
}
|
||||
// 查询商品sku 最小值 和数量
|
||||
// List<BdWaresSpecsSkuExt> waresSpecsSku = bdWaresSpecsSkuService.selectByMinWaresSpecsSku(waresExt.getPkId());
|
||||
Map<Integer, List<BdWaresSpecsSkuExt>> waresSpecsSkuMap = new HashMap<>();
|
||||
if (pkWaresIds.size() > 0) {
|
||||
List<BdWaresSpecsSkuExt> waresSpecsSkuArray = waresSpecsSkuService.selectByMinWaresSpecsSkuByPkWaresList(pkWaresIds);
|
||||
if (waresIdList.size() > 0) {
|
||||
List<BdWaresSpecsSkuExt> 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<BdWaresMapper, BdWares> impl
|
|||
List<WaresVo> waresVoList = new ArrayList<>();
|
||||
List<BdWaresRange> 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<BdWaresMapper, BdWares> 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<BdWaresMapper, BdWares> impl
|
|||
return recommendWaresInfoVo;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询app 首页推荐专区 和推荐商品
|
||||
*/
|
||||
@Override
|
||||
public RecommendWaresInfoVo listWares(Integer pkCountry, Long userId, Map<Integer, Boolean> 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<BdMenuDetail> menuDetailList = iMenuDetailServiceApi.showMenuDetail(pkGrade, pkAwards, authority, makerSpace, pkCountry).getData();
|
||||
|
||||
// 查询存在推荐的专区
|
||||
List<Integer> saList = baseMapper.queryRecommendWaresSpecial();
|
||||
List<Integer> 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<RecommendSpecialAreaVo> 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<BdWaresExt> waresList = this.queryByRecommendList(specialArea, EYesNo.YES.getIntValue(), pkCountry, waresShowMap);
|
||||
List<BdWaresExt> 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<WaresVo> 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<BdWaresMapper, BdWares> impl
|
|||
@Override
|
||||
public List<ComputeWaresPrice> computeWaresPrice(List<ComputeWaresPrice> computeWaresPriceList) {
|
||||
// 极差
|
||||
R<List<BdRangeExt>> rangeDto = rangeServiceApi.queryRange(SecurityUtils.getPkCountry());
|
||||
R<List<BdRangeExt>> rangeDto = iRangeServiceApi.queryRange(SecurityUtils.getPkCountry());
|
||||
List<BdRangeExt> rangeList = rangeDto.getData();
|
||||
return computeWaresPrice(computeWaresPriceList, rangeList);
|
||||
}
|
||||
|
@ -1509,7 +1563,7 @@ public class BdWaresServiceImpl extends ServiceImpl<BdWaresMapper, BdWares> impl
|
|||
if (specsIds.size() > 0) {
|
||||
LambdaQueryWrapper<BdSpecs> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.in(BdSpecs::getPkId, specsIds);
|
||||
List<BdSpecs> specsList = specsService.list(queryWrapper);
|
||||
List<BdSpecs> 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<BdWaresMapper, BdWares> impl
|
|||
|
||||
if (pkWares != null && pkProduct != null && pkWaresSpecsSku != null) {
|
||||
List<Integer> waresSpecsIds = waresSpecsList.stream().map(BdWaresSpecs::getPkSpecs).collect(Collectors.toList());
|
||||
List<BdWaresSpecsRelationExt> waresSpecsRelationList = waresSpecsRelationService.getWaresProduct(pkWares, pkProduct, pkWaresSpecsSku, waresSpecsIds);
|
||||
List<BdWaresSpecsRelationExt> waresSpecsRelationList = iBdWaresSpecsRelationService.getWaresProduct(pkWares, pkProduct, pkWaresSpecsSku, waresSpecsIds);
|
||||
// 数组一致
|
||||
Map<Integer, List<BdWaresSpecsRelationExt>> collect = waresSpecsRelationList.stream().collect(Collectors.groupingBy(BdWaresSpecsRelationExt::getPkRange));
|
||||
|
||||
|
@ -1638,7 +1692,7 @@ public class BdWaresServiceImpl extends ServiceImpl<BdWaresMapper, BdWares> impl
|
|||
if (pkWaresList.size() > 0) {
|
||||
LambdaQueryWrapper<BdWaresAuthority> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.in(BdWaresAuthority::getPkWares, pkWaresList);
|
||||
List<BdWaresAuthority> waresAuthorityList = waresAuthorityService.list(queryWrapper);
|
||||
List<BdWaresAuthority> 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<BdWaresMapper, BdWares> impl
|
|||
return baseMapper.selectByRecommentList(pkCountry, specialAreaList);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 上传商品id 修改预售状态
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean updateWaresPreSale(List<WaresPreSaleParam> waresPreSaleParamList) {
|
||||
try {
|
||||
for (WaresPreSaleParam waresPreSaleParam : waresPreSaleParamList) {
|
||||
// 修改预售数量
|
||||
baseMapper.updateByPkWaresPreSale(waresPreSaleParam);
|
||||
// 修改预售状态
|
||||
baseMapper.updateByPkWaresPreSaleStatus(waresPreSaleParam);
|
||||
}
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 扣减预售数量库存
|
||||
*
|
||||
|
|
|
@ -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 {
|
||||
|
||||
|
|
|
@ -377,9 +377,10 @@
|
|||
order by bw.sort,bw.creation_time desc
|
||||
</select>
|
||||
|
||||
|
||||
<!-- 查询推荐商品 -->
|
||||
<select id="queryByRecommendList" resultMap="BaseResultMap">
|
||||
select bw.*,be.IS_SALE,be.PRE_SALE_STATUS from bd_wares bw
|
||||
select bw.*, be.IS_SALE, be.PRE_SALE_STATUS
|
||||
from bd_wares bw
|
||||
left join bd_wares_extend be on bw.pk_id = be.pk_wares
|
||||
where be.IS_PUT_ON = 0 and bw.del_flag = 0 and be.del_flag = 0
|
||||
<if test="specialArea != null">
|
||||
|
@ -394,22 +395,6 @@
|
|||
order by bw.SORT desc
|
||||
</select>
|
||||
|
||||
<update id="updateByPkWaresPreSale">
|
||||
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>
|
||||
|
||||
<update id="updateByPkWaresPreSaleStatus">
|
||||
update BD_WARES
|
||||
set IS_PRE_SALE = 1
|
||||
where PRE_SALE_QUANTITY = 0
|
||||
and IS_PRE_SALE = 0
|
||||
and PK_ID = #{pkWares}
|
||||
</update>
|
||||
|
||||
<update id="updatePreSaleQuantityByWaresCode">
|
||||
update BD_WARES
|
||||
set PRE_SALE_QUANTITY = PRE_SALE_QUANTITY - #{quantity}
|
||||
|
|
|
@ -8,9 +8,6 @@ import java.util.List;
|
|||
|
||||
/**
|
||||
* 菜单配置权限明细 Mapper 接口
|
||||
*
|
||||
* @author hzs
|
||||
* @since 2022-10-08
|
||||
*/
|
||||
public interface BdMenuDetailMapper extends BaseMapper<BdMenuDetail> {
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -10,9 +10,6 @@ import java.util.List;
|
|||
|
||||
/**
|
||||
* 菜单配置权限明细 服务实现类
|
||||
*
|
||||
* @author hzs
|
||||
* @since 2022-10-08
|
||||
*/
|
||||
@Service
|
||||
public class BdMenuDetailServiceImpl extends ServiceImpl<BdMenuDetailMapper, BdMenuDetail> implements IBdMenuDetailService {
|
||||
|
|
Loading…
Reference in New Issue