using MyCode.Project.Domain.Message.Request.Label; using MyCode.Project.Repositories; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace MyCode.Project.Services.BLL { public class LabelBLL { private readonly LxmReportRepository _lxmReportRepository; public LabelBLL(LxmReportRepository lxmReportRepository) { _lxmReportRepository = lxmReportRepository; } #region GetShopIdByLabel 获取符合店铺标签条件的店铺Id列表 /// /// 获取符合店铺标签条件的店铺Id列表 /// /// /// public List GetShopIdByLabel(ShopLabelSearch req) { List result = new List(); var shopIdByLabelList = _lxmReportRepository.GetShopIdByLabel(req.LabelIds); //没有店铺标签对应的店铺数据 if (shopIdByLabelList == null || shopIdByLabelList.Count == 0) { return result; } if (req.SearchType == 1) { return shopIdByLabelList.Select(p => p.ShopId).ToList(); } if (req.SearchType == 2&& shopIdByLabelList.Exists(p => p.LabelTotal >= req.LabelIds.Count)) { return shopIdByLabelList.Where(p => p.LabelTotal >= req.LabelIds.Count).Select(p => p.ShopId).ToList(); } return result; } #endregion #region GetYangBanDianLabelShopIds 获取2024年样板店标签的店铺列表 /// /// 获取2024年样板店标签的店铺列表 /// /// /// public List GetYangBanDianLabelShopIds() { return _lxmReportRepository.GetYangBanDianLabelShopIds(); } #endregion } }