52 lines
1.9 KiB
C#
52 lines
1.9 KiB
C#
|
|
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列表
|
|||
|
|
/// <summary>
|
|||
|
|
/// 获取符合店铺标签条件的店铺Id列表
|
|||
|
|
/// </summary>
|
|||
|
|
/// <param name="req"></param>
|
|||
|
|
/// <returns></returns>
|
|||
|
|
public List<string> GetShopIdByLabel(ShopLabelSearch req)
|
|||
|
|
{
|
|||
|
|
List<string> result = new List<string>();
|
|||
|
|
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年样板店标签的店铺列表
|
|||
|
|
/// <summary>
|
|||
|
|
/// 获取2024年样板店标签的店铺列表
|
|||
|
|
/// </summary>
|
|||
|
|
/// <param name="LabelIds"></param>
|
|||
|
|
/// <returns></returns>
|
|||
|
|
public List<string> GetYangBanDianLabelShopIds()
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
return _lxmReportRepository.GetYangBanDianLabelShopIds();
|
|||
|
|
}
|
|||
|
|
#endregion
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
}
|