Commit 9a7280ab authored by 吴春's avatar 吴春

1

parent f7121fa7
...@@ -20,7 +20,7 @@ namespace Mall.Model.Entity.TradePavilion ...@@ -20,7 +20,7 @@ namespace Mall.Model.Entity.TradePavilion
public int Id { get; set; } public int Id { get; set; }
/// <summary> /// <summary>
/// 类型 1载体 2品牌 /// 类型 1载体 2品牌,3-企业,4-楼宇
/// </summary> /// </summary>
public int Type { get; set; } public int Type { get; set; }
......
...@@ -30,5 +30,10 @@ namespace Mall.Model.Extend.TradePavilion ...@@ -30,5 +30,10 @@ namespace Mall.Model.Extend.TradePavilion
/// 根据ids查询 /// 根据ids查询
/// </summary> /// </summary>
public string SelectIds { get; set; } public string SelectIds { get; set; }
/// <summary>
/// 收藏id
/// </summary>
public int CollectId { get; set; }
} }
} }
using Mall.Model.Entity.TradePavilion; using Mall.Model.Entity.TradePavilion;
using System.Collections.Generic;
namespace Mall.Model.Extend.TradePavilion namespace Mall.Model.Extend.TradePavilion
{ {
...@@ -11,5 +12,15 @@ namespace Mall.Model.Extend.TradePavilion ...@@ -11,5 +12,15 @@ namespace Mall.Model.Extend.TradePavilion
/// 分类名称 /// 分类名称
/// </summary> /// </summary>
public string CategoryName { get; set; } public string CategoryName { get; set; }
/// <summary>
/// 轮播图
/// </summary>
public List<string> BannerList { get; set; }
/// <summary>
/// 根据ids获取
/// </summary>
public string QIds { get; set; }
} }
} }
...@@ -27,8 +27,16 @@ namespace Mall.Model.Extend.TradePavilion ...@@ -27,8 +27,16 @@ namespace Mall.Model.Extend.TradePavilion
/// </summary> /// </summary>
public string Address { get; set; } public string Address { get; set; }
/// <summary>
/// 品牌名称
/// </summary>
public string ProjectName { get; set; }
/// <summary>
/// 品牌ID
/// </summary>
public int ProjectId { get; set; }
/// <summary> /// <summary>
/// 项目类型 /// 项目类型
/// </summary> /// </summary>
......
using Mall.Model.Entity.TradePavilion; using Mall.Model.Entity.TradePavilion;
using System.Collections.Generic;
namespace Mall.Model.Extend.TradePavilion namespace Mall.Model.Extend.TradePavilion
{ {
/// <summary> /// <summary>
/// 企业服务扩展实体类 /// 企业服务扩展实体类
/// </summary> /// </summary>
public class RB_EnterpriseServices_Extend: RB_EnterpriseServices public class RB_EnterpriseServices_Extend : RB_EnterpriseServices
{ {
/// <summary> /// <summary>
/// 分类名称 /// 分类名称
/// </summary> /// </summary>
public string CategoryName { get; set; } public string CategoryName { get; set; }
/// <summary>
/// 轮播图
/// </summary>
public List<string> BannerList { get; set; }
/// <summary>
/// ids
/// </summary>
public string SelectIds { get; set; }
} }
} }
...@@ -243,7 +243,7 @@ namespace Mall.Module.TradePavilion ...@@ -243,7 +243,7 @@ namespace Mall.Module.TradePavilion
} }
if ((extModel?.ID ?? 0) > 0 && isVisit) if ((extModel?.ID ?? 0) > 0 && isVisit)
{ {
System.Threading.Tasks.Task.Run(() => visit_LogRepository.AddVisitLog(extModel.TenantId, extModel.MallBaseId, extModel.ID, extModel.BuildingCarrierType)); System.Threading.Tasks.Task.Run(() => visit_LogRepository.AddVisitLog(extModel.TenantId, extModel.MallBaseId, extModel.ID, 1));
} }
return extModel; return extModel;
} }
...@@ -338,15 +338,16 @@ namespace Mall.Module.TradePavilion ...@@ -338,15 +338,16 @@ namespace Mall.Module.TradePavilion
if (extModel != null && extModel.CategoryId > 0) if (extModel != null && extModel.CategoryId > 0)
{ {
extModel.CategoryName = brandClassRepository.GetEntity(extModel.CategoryId)?.ClassName ?? ""; extModel.CategoryName = brandClassRepository.GetEntity(extModel.CategoryId)?.ClassName ?? "";
extModel.BannerList = new List<string>();
if (!string.IsNullOrWhiteSpace(extModel.Banner)) }
{ extModel.BannerList = new List<string>();
extModel.BannerList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<string>>(extModel.Banner); if (!string.IsNullOrWhiteSpace(extModel.Banner))
} {
extModel.BannerList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<string>>(extModel.Banner);
} }
if ((extModel?.ID ?? 0) > 0 && isVisit) if ((extModel?.ID ?? 0) > 0 && isVisit)
{ {
System.Threading.Tasks.Task.Run(() => visit_LogRepository.AddVisitLog(extModel.TenantId, extModel.MallBaseId, extModel.ID, extModel.BrandEnterpriseType == 1 ? 3 : 4)); System.Threading.Tasks.Task.Run(() => visit_LogRepository.AddVisitLog(extModel.TenantId, extModel.MallBaseId, extModel.ID, 3));
} }
return extModel; return extModel;
} }
...@@ -380,7 +381,20 @@ namespace Mall.Module.TradePavilion ...@@ -380,7 +381,20 @@ namespace Mall.Module.TradePavilion
/// <returns></returns> /// <returns></returns>
public List<RB_Building_Extend> GetBuildingPageModule(int pageIndex, int pageSize, out long rowsCount, RB_Building_Extend query) public List<RB_Building_Extend> GetBuildingPageModule(int pageIndex, int pageSize, out long rowsCount, RB_Building_Extend query)
{ {
return buildingRepository.GetBuildingPageRepository(pageIndex, pageSize, out rowsCount, query); var list = buildingRepository.GetBuildingPageRepository(pageIndex, pageSize, out rowsCount, query);
if (list != null && list.Any())
{
foreach (var item in list)
{
item.BannerList = new List<string>();
if (!string.IsNullOrWhiteSpace(item.Banner))
{
item.BannerList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<string>>(item.Banner);
}
}
}
return list;
} }
/// <summary> /// <summary>
...@@ -437,16 +451,27 @@ namespace Mall.Module.TradePavilion ...@@ -437,16 +451,27 @@ namespace Mall.Module.TradePavilion
/// </summary> /// </summary>
/// <param name="BuildId"></param> /// <param name="BuildId"></param>
/// <returns></returns> /// <returns></returns>
public RB_Building_Extend GetBuildingInfoModule(int BuildId) public RB_Building_Extend GetBuildingInfoModule(int BuildId, bool isVisit = false)
{ {
var extModel = buildingRepository.GetEntity<RB_Building_Extend>(BuildId); var extModel = buildingRepository.GetEntity<RB_Building_Extend>(BuildId);
if (extModel != null && extModel.CategoryId > 0) if (extModel != null && extModel.CategoryId > 0)
{ {
extModel.CategoryName = brandClassRepository.GetEntity(extModel.CategoryId)?.ClassName ?? ""; extModel.CategoryName = brandClassRepository.GetEntity(extModel.CategoryId)?.ClassName ?? "";
} }
if (!string.IsNullOrWhiteSpace(extModel?.Banner ?? ""))
{
extModel.BannerList = new List<string>();
extModel.BannerList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<string>>(extModel.Banner);
}
if ((extModel?.BuildId ?? 0) > 0 && isVisit)
{
System.Threading.Tasks.Task.Run(() => visit_LogRepository.AddVisitLog(extModel.TenantId, extModel.MallBaseId, extModel.BuildId, 2));
}
return extModel; return extModel;
} }
/// <summary> /// <summary>
/// 根据编号删除获取楼宇 /// 根据编号删除获取楼宇
/// </summary> /// </summary>
...@@ -477,7 +502,20 @@ namespace Mall.Module.TradePavilion ...@@ -477,7 +502,20 @@ namespace Mall.Module.TradePavilion
/// <returns></returns> /// <returns></returns>
public List<RB_EnterpriseServices_Extend> GetEnterpriseServicesPageModule(int pageIndex, int pageSize, out long rowsCount, RB_EnterpriseServices_Extend query) public List<RB_EnterpriseServices_Extend> GetEnterpriseServicesPageModule(int pageIndex, int pageSize, out long rowsCount, RB_EnterpriseServices_Extend query)
{ {
return enterpriseServicesRepository.GetEnterpriseServicesPageRepository(pageIndex, pageSize, out rowsCount, query); var list = enterpriseServicesRepository.GetEnterpriseServicesPageRepository(pageIndex, pageSize, out rowsCount, query);
if (list!=null&&list.Any())
{
foreach (var item in list)
{
item.BannerList = new List<string>();
if (!string.IsNullOrWhiteSpace(item?.Banner ?? ""))
{
item.BannerList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<string>>(item.Banner);
}
}
}
return list;
} }
/// <summary> /// <summary>
...@@ -528,13 +566,22 @@ namespace Mall.Module.TradePavilion ...@@ -528,13 +566,22 @@ namespace Mall.Module.TradePavilion
/// </summary> /// </summary>
/// <param name="ServiceId"></param> /// <param name="ServiceId"></param>
/// <returns></returns> /// <returns></returns>
public RB_EnterpriseServices_Extend GetEnterpriseServicesInfoModule(int ServiceId) public RB_EnterpriseServices_Extend GetEnterpriseServicesInfoModule(int ServiceId, bool isVisit = false)
{ {
var extModel = enterpriseServicesRepository.GetEntity<RB_EnterpriseServices_Extend>(ServiceId); var extModel = enterpriseServicesRepository.GetEntity<RB_EnterpriseServices_Extend>(ServiceId);
if (extModel != null && extModel.CategoryId > 0) if (extModel != null && extModel.CategoryId > 0)
{ {
extModel.CategoryName = brandClassRepository.GetEntity(extModel.CategoryId)?.ClassName ?? ""; extModel.CategoryName = brandClassRepository.GetEntity(extModel.CategoryId)?.ClassName ?? "";
} }
extModel.BannerList = new List<string>();
if (!string.IsNullOrWhiteSpace(extModel.Banner))
{
extModel.BannerList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<string>>(extModel.Banner);
}
if ((extModel?.ServiceId ?? 0) > 0 && isVisit)
{
System.Threading.Tasks.Task.Run(() => visit_LogRepository.AddVisitLog(extModel.TenantId, extModel.MallBaseId, extModel.ServiceId, 4));
}
return extModel; return extModel;
} }
......
...@@ -58,6 +58,10 @@ namespace Mall.Module.TradePavilion ...@@ -58,6 +58,10 @@ namespace Mall.Module.TradePavilion
private readonly RB_BuildingApplyForRepository buildingApplyForRepository = new RB_BuildingApplyForRepository(); private readonly RB_BuildingApplyForRepository buildingApplyForRepository = new RB_BuildingApplyForRepository();
/// <summary>
/// 收藏仓储层对象
/// </summary>
private readonly RB_CollectRepository collectRepository = new RB_CollectRepository();
#region 品牌/企业 #region 品牌/企业
/// <summary> /// <summary>
/// 品牌/企业申请信息列表 /// 品牌/企业申请信息列表
...@@ -1591,5 +1595,137 @@ namespace Mall.Module.TradePavilion ...@@ -1591,5 +1595,137 @@ namespace Mall.Module.TradePavilion
return list; return list;
} }
#endregion #endregion
#region 收藏
/// <summary>
/// 分页列表
/// </summary>
/// <param name="pageIndex">页码</param>
/// <param name="pageSize">每页显示条数</param>
/// <param name="rowCount">总条数</param>
/// <param name="query">查询条件</param>
/// <returns></returns>
public List<RB_Collect_Extend> GetMyCollectEnterprisePage(int pageIndex, int pageSize, out long rowCount, RB_Collect_Extend query)
{
var list = collectRepository.GetPageList(pageIndex, pageSize, out rowCount, query);
string sourceIds = "";
if (list != null && list.Any())
{
sourceIds = string.Join(",", list.Select(x => x.SourceId));
}
if (query.Type == 1)//1-载体
{
if (!string.IsNullOrEmpty(sourceIds))
{
var sourceList = GetBuildingCarrierListModule(new RB_Building_Carrier_Extend { TenantId = query.TenantId, MallBaseId = query.MallBaseId, SelectIds = sourceIds });
foreach (var item in list)
{
RB_Building_Carrier_Extend carrierModel = sourceList.Where(x => x.ID == item.SourceId).FirstOrDefault();
if (carrierModel != null && carrierModel.ID > 0)
{
item.SourceName = carrierModel.CarrierName;
item.Address = carrierModel.Address;
item.ProjectName = carrierModel.CategoryName;
item.ProjectId = carrierModel.CategoryId;
item.BannerList = carrierModel.BannerList;
}
}
}
}
else if (query.Type == 2)//2-品牌
{
if (!string.IsNullOrEmpty(sourceIds))
{
var sourceList = GetBrandEnterpriseListModule(new RB_Brand_Enterprise_Extend
{
TenantId = query.TenantId,
MallBaseId = query.MallBaseId,
SelectIds = sourceIds,
RanQi = -1,
KongTiao = -1,
XinFeng = -1,
Plumbing = -1,
Caliber = -1,
Sewage = -1,
PaiYan = -1,
});
foreach (var item in list)
{
RB_Brand_Enterprise_Extend carrierModel = sourceList.Where(x => x.ID == item.SourceId).FirstOrDefault();
if (carrierModel != null && carrierModel.ID > 0)
{
if (!string.IsNullOrWhiteSpace(carrierModel.Banner))
{
carrierModel.BannerList = JsonConvert.DeserializeObject<List<string>>(carrierModel.Banner);
}
item.SourceName = carrierModel.BrandName;
item.SourceFullName = carrierModel.FullBrandName;
item.ProjectName = carrierModel.CategoryName;
item.ProjectId = carrierModel.CategoryId;
item.BannerList = carrierModel.BannerList;
}
}
}
}
else if (query.Type == 3)//企业
{
if (!string.IsNullOrEmpty(sourceIds))
{
var sourceList = enterpriseServicesRepository.GetEnterpriseServicesListRepository(new RB_EnterpriseServices_Extend
{
TenantId = query.TenantId,
MallBaseId = query.MallBaseId,
SelectIds = sourceIds,
});
foreach (var item in list)
{
RB_EnterpriseServices_Extend carrierModel = sourceList.Where(x => x.ServiceId == item.SourceId).FirstOrDefault();
if (carrierModel != null && carrierModel.ServiceId > 0)
{
if (!string.IsNullOrWhiteSpace(carrierModel.Banner))
{
carrierModel.BannerList = JsonConvert.DeserializeObject<List<string>>(carrierModel.Banner);
}
item.SourceName = carrierModel.Name;
item.SourceFullName = carrierModel.Name;
item.ProjectName = carrierModel.CategoryName;
item.ProjectId = carrierModel.CategoryId;
item.BannerList = carrierModel.BannerList;
}
}
}
}
else if (query.Type == 4)//楼宇
{
if (!string.IsNullOrEmpty(sourceIds))
{
var sourceList = buildingRepository.GetBuildingRepository(new RB_Building_Extend
{
TenantId = query.TenantId,
MallBaseId = query.MallBaseId,
QIds = sourceIds,
});
foreach (var item in list)
{
RB_Building_Extend carrierModel = sourceList.Where(x => x.BuildId == item.SourceId).FirstOrDefault();
if (carrierModel != null && carrierModel.BuildId > 0)
{
if (!string.IsNullOrWhiteSpace(carrierModel.Banner))
{
carrierModel.BannerList = JsonConvert.DeserializeObject<List<string>>(carrierModel.Banner);
}
item.SourceName = carrierModel.Name;
item.SourceFullName = carrierModel.Name;
item.ProjectName = carrierModel.CategoryName;
item.ProjectId = carrierModel.CategoryId;
item.BannerList = carrierModel.BannerList;
}
}
}
}
return list;
}
#endregion
} }
} }
...@@ -1288,6 +1288,11 @@ namespace Mall.Module.TradePavilion ...@@ -1288,6 +1288,11 @@ namespace Mall.Module.TradePavilion
} }
return flag; return flag;
} }
#endregion #endregion
......
...@@ -89,6 +89,10 @@ WHERE 1=1 ...@@ -89,6 +89,10 @@ WHERE 1=1
{ {
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Building_Extend.MallBaseId), query.MallBaseId); builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Building_Extend.MallBaseId), query.MallBaseId);
} }
if (!string.IsNullOrWhiteSpace(query.QIds))
{
builder.AppendFormat(" AND A.{0} in ({1}) ", nameof(RB_Building_Extend.BuildId), query.QIds);
}
if (query.CategoryId > 0) if (query.CategoryId > 0)
{ {
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Building_Extend.CategoryId), query.CategoryId); builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Building_Extend.CategoryId), query.CategoryId);
......
...@@ -46,6 +46,8 @@ WHERE 1=1 ...@@ -46,6 +46,8 @@ WHERE 1=1
{ {
builder.AppendFormat(@" AND A.{0}={1} ", nameof(RB_EnterpriseServices_Extend.CategoryId), query.CategoryId); builder.AppendFormat(@" AND A.{0}={1} ", nameof(RB_EnterpriseServices_Extend.CategoryId), query.CategoryId);
} }
if (!string.IsNullOrEmpty(query.Name)) if (!string.IsNullOrEmpty(query.Name))
{ {
builder.AppendFormat(@" AND A.{0} LIKE @Name ", nameof(RB_EnterpriseServices_Extend.Name)); builder.AppendFormat(@" AND A.{0} LIKE @Name ", nameof(RB_EnterpriseServices_Extend.Name));
...@@ -82,6 +84,10 @@ WHERE 1=1 ...@@ -82,6 +84,10 @@ WHERE 1=1
{ {
builder.AppendFormat(@" AND A.{0}={1} ", nameof(RB_EnterpriseServices_Extend.MallBaseId), query.MallBaseId); builder.AppendFormat(@" AND A.{0}={1} ", nameof(RB_EnterpriseServices_Extend.MallBaseId), query.MallBaseId);
} }
if (!string.IsNullOrWhiteSpace(query.SelectIds))
{
builder.AppendFormat(@" AND A.{0} in ({1}) ", nameof(RB_EnterpriseServices_Extend.ServiceId), query.SelectIds);
}
if (query.CategoryId > 0) if (query.CategoryId > 0)
{ {
builder.AppendFormat(@" AND A.{0}={1} ", nameof(RB_EnterpriseServices_Extend.CategoryId), query.CategoryId); builder.AppendFormat(@" AND A.{0}={1} ", nameof(RB_EnterpriseServices_Extend.CategoryId), query.CategoryId);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment