|
|
@ -327,20 +327,20 @@ public class GoodsAccreditServiceImpl extends ServiceImpl<GoodsAccreditMapper,Go |
|
|
|
public GoodsAccrIdsDto listIgnoreAcc2(String supplierId, List<String> bizRegionIds, List<String> saleRegionIds) { |
|
|
|
//查询自身所有
|
|
|
|
LambdaQueryWrapper<GoodsAccreditItem> lqw = new LambdaQueryWrapper<>(); |
|
|
|
lqw.select(GoodsAccreditItem::getId,GoodsAccreditItem::getAccType) |
|
|
|
lqw.select(GoodsAccreditItem::getId,GoodsAccreditItem::getAccType,GoodsAccreditItem::getAccId) |
|
|
|
.or(a->a.eq(GoodsAccreditItem::getTargetType,"supplier").eq(GoodsAccreditItem::getTargetId,supplierId)) |
|
|
|
.or(a->a.eq(GoodsAccreditItem::getTargetType,"saleRegion").in(GoodsAccreditItem::getTargetId,saleRegionIds)) |
|
|
|
.or(a->a.eq(GoodsAccreditItem::getTargetType,"bizRegion").in(GoodsAccreditItem::getTargetId,bizRegionIds)); |
|
|
|
|
|
|
|
List<Long> selfNotInIds = goodsAccreditItemService.list(lqw).stream() |
|
|
|
.filter(a->a.getAccType().equals(1)).map(GoodsAccreditItem::getId).collect(Collectors.toList()); |
|
|
|
.filter(a->a.getAccType().equals(1)).map(GoodsAccreditItem::getAccId).collect(Collectors.toList()); |
|
|
|
List<Long> selfInIds = goodsAccreditItemService.list(lqw).stream() |
|
|
|
.filter(a->a.getAccType().equals(0)).map(GoodsAccreditItem::getId).collect(Collectors.toList()); |
|
|
|
.filter(a->a.getAccType().equals(0)).map(GoodsAccreditItem::getAccId).collect(Collectors.toList()); |
|
|
|
|
|
|
|
|
|
|
|
//查询其它维度所有in
|
|
|
|
LambdaQueryWrapper<GoodsAccreditItem> lqw2 = new LambdaQueryWrapper<>(); |
|
|
|
lqw2.select(GoodsAccreditItem::getId) |
|
|
|
lqw2.select(GoodsAccreditItem::getAccId) |
|
|
|
.eq(GoodsAccreditItem::getAccType,0).and( |
|
|
|
qw->{ |
|
|
|
qw.or(a->a.eq(GoodsAccreditItem::getTargetType,"supplier").ne(GoodsAccreditItem::getTargetId,supplierId)) |
|
|
@ -349,7 +349,7 @@ public class GoodsAccreditServiceImpl extends ServiceImpl<GoodsAccreditMapper,Go |
|
|
|
} |
|
|
|
); |
|
|
|
List<Long> otherInIds = goodsAccreditItemService.list(lqw2) |
|
|
|
.stream().map(GoodsAccreditItem::getId).collect(Collectors.toList()); |
|
|
|
.stream().map(GoodsAccreditItem::getAccId).collect(Collectors.toList()); |
|
|
|
selfNotInIds.addAll(otherInIds); |
|
|
|
|
|
|
|
List<Long> skuIds = new ArrayList<>(); |
|
|
@ -380,13 +380,14 @@ public class GoodsAccreditServiceImpl extends ServiceImpl<GoodsAccreditMapper,Go |
|
|
|
|
|
|
|
if(CollUtil.isNotEmpty(selfInIds)){ |
|
|
|
List<GoodsAccredit> inList = this.listByIds(selfInIds); |
|
|
|
Set<Long> spuIds2 = inList.stream().map(GoodsAccredit::getSpuId).filter(Objects::nonNull).collect(Collectors.toSet()); |
|
|
|
Set<Long> skuIds2 = inList.stream().map(GoodsAccredit::getSkuId).filter(Objects::nonNull).collect(Collectors.toSet()); |
|
|
|
Set<String> cateIds2 = inList.stream().map(GoodsAccredit::getCategoryId).filter(Objects::nonNull).collect(Collectors.toSet()); |
|
|
|
skuNotInIds.addAll(skuIds2); |
|
|
|
spuNotInIds.addAll(spuIds2); |
|
|
|
cateNotInIds.addAll(cateIds2); |
|
|
|
Set<Long> spuIds3 = inList.stream().map(GoodsAccredit::getSpuId).filter(Objects::nonNull).collect(Collectors.toSet()); |
|
|
|
Set<Long> skuIds3 = inList.stream().map(GoodsAccredit::getSkuId).filter(Objects::nonNull).collect(Collectors.toSet()); |
|
|
|
Set<String> cateIds3 = inList.stream().map(GoodsAccredit::getCategoryId).filter(Objects::nonNull).collect(Collectors.toSet()); |
|
|
|
skuNotInIds.addAll(skuIds3); |
|
|
|
spuNotInIds.addAll(spuIds3); |
|
|
|
cateNotInIds.addAll(cateIds3); |
|
|
|
} |
|
|
|
|
|
|
|
return new GoodsAccrIdsDto(skuIds,spuIds,cateIds,skuNotInIds,spuNotInIds,cateNotInIds); |
|
|
|
} |
|
|
|
|
|
|
|