充值可用店铺列表

This commit is contained in:
张松
2025-09-28 18:09:50 +08:00
parent a12b87d47e
commit d586eb0cac
3 changed files with 21 additions and 1 deletions

View File

@@ -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);
}

View File

@@ -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);
}
}

View File

@@ -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();