充值可用店铺列表
This commit is contained in:
@@ -31,4 +31,6 @@ public interface ShopInfoService extends IService<ShopInfo> {
|
||||
List<ShopBranchSelectDTO> findShopBranch(Long shopId);
|
||||
|
||||
Long getMainIdByShopId(Long shopId);
|
||||
|
||||
List<ShopInfo> getByMainIdOrList(Long mainShopId, List<Long> shopIdList, String shopName);
|
||||
}
|
||||
|
||||
@@ -428,4 +428,21 @@ public class ShopInfoServiceImpl extends ServiceImpl<ShopInfoMapper, ShopInfo> i
|
||||
return shopInfo.getMainId() == null ? shopId : shopInfo.getMainId();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ShopInfo> getByMainIdOrList(Long mainShopId, List<Long> shopIdList, String shopName) {
|
||||
QueryWrapper queryWrapper = new QueryWrapper().like(ShopInfo::getShopName, shopName);
|
||||
if (shopIdList == null) {
|
||||
queryWrapper.and(q -> {
|
||||
q.eq(ShopInfo::getMainId, mainShopId).or(q1 -> {
|
||||
q1.eq(ShopInfo::getId, mainShopId);
|
||||
});
|
||||
});
|
||||
}else {
|
||||
shopIdList.add(mainShopId);
|
||||
queryWrapper.in(ShopInfo::getId, shopIdList);
|
||||
}
|
||||
|
||||
return list(queryWrapper);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -225,13 +225,14 @@ public class MkShopRechargeServiceImpl extends ServiceImpl<MkShopRechargeMapper,
|
||||
q1.eq(ShopInfo::getId, mainShopId);
|
||||
});
|
||||
});
|
||||
shopIdList = null;
|
||||
}else {
|
||||
shopIdList.add(shopId);
|
||||
queryWrapper.in(ShopInfo::getId, shopIdList);
|
||||
}
|
||||
|
||||
|
||||
return shopInfoService.list(queryWrapper)
|
||||
return shopInfoService.getByMainIdOrList(mainShopId, shopIdList, shopName)
|
||||
.stream()
|
||||
.map(shop -> BeanUtil.copyProperties(shop, MkShopRechargeShopListVO.class))
|
||||
.toList();
|
||||
|
||||
Reference in New Issue
Block a user