Commit 47b7dbe5 authored by 吴春's avatar 吴春

11

parent dd1b1d1a
......@@ -104,9 +104,6 @@ namespace Mall.Model.Entity.TradePavilion
/// </summary>
public string CustomerType { get; set; }
/// <summary>
/// 扩店区域
/// </summary>
......@@ -138,8 +135,6 @@ namespace Mall.Model.Entity.TradePavilion
/// </summary>
public string Other { get; set; }
/// <summary>
/// 店铺开口尺寸(0-否1-有)
/// </summary>
......@@ -236,5 +231,14 @@ namespace Mall.Model.Entity.TradePavilion
/// </summary>
public string ContactPhone { get; set; }
/// <summary>
/// 是否推荐(1-是)
/// </summary>
public int IsRecommend { get; set; }
/// <summary>
/// 推荐时间
/// </summary>
public DateTime RecommendDate { get; set; }
}
}
......@@ -29,13 +29,11 @@ namespace Mall.Model.Entity.TradePavilion
/// </summary>
public int MallBaseId { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime CreateDate { get; set; }
/// <summary>
/// 修改时间
/// </summary>
......@@ -62,5 +60,10 @@ namespace Mall.Model.Entity.TradePavilion
/// 品牌大类
/// </summary>
public BrandCategoryEnum BrandCategory { get; set; }
/// <summary>
/// 父级分类Id
/// </summary>
public int ParentId { get; set; }
}
}
......@@ -175,5 +175,15 @@ namespace Mall.Model.Entity.TradePavilion
/// 排序
/// </summary>
public int SortNum { get; set; }
/// <summary>
/// 是否推荐(1-是)
/// </summary>
public int IsRecommend { get; set; }
/// <summary>
/// 推荐时间
/// </summary>
public DateTime RecommendDate { get; set; }
}
}
......@@ -202,8 +202,6 @@ namespace Mall.Model.Entity.TradePavilion
/// </summary>
public decimal? EndAreaRequirement { get; set; }
/// <summary>
/// 经营面积
/// </summary>
......@@ -245,5 +243,15 @@ namespace Mall.Model.Entity.TradePavilion
///// 首展政策
///// </summary>
//public string FirstExhibition { get; set; }
/// <summary>
/// 是否推荐(1-是)
/// </summary>
public int IsRecommend { get; set; }
/// <summary>
/// 推荐时间
/// </summary>
public DateTime RecommendDate { get; set; }
}
}
......@@ -145,5 +145,15 @@ namespace Mall.Model.Entity.TradePavilion
/// 楼宇等级
/// </summary>
public int EType { get; set; }
/// <summary>
/// 是否推荐(1-是)
/// </summary>
public int IsRecommend { get; set; }
/// <summary>
/// 推荐时间
/// </summary>
public DateTime RecommendDate { get; set; }
}
}
......@@ -528,6 +528,23 @@ namespace Mall.Module.TradePavilion
return flag;
}
/// <summary>
/// 设置楼宇推荐
/// </summary>
/// <param name="BuildId"></param>
/// <param name="IsRecommend"></param>
/// <returns></returns>
public bool RecommendBuildingModule(int BuildId,int IsRecommend)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Building_Extend.IsRecommend),IsRecommend },
{nameof(RB_Building_Extend.RecommendDate),DateTime.Now }
};
bool flag = buildingRepository.Update(fileds, new WhereHelper(nameof(RB_Building_Extend.BuildId), BuildId));
return flag;
}
#endregion
#region 企业服务
......@@ -672,6 +689,24 @@ namespace Mall.Module.TradePavilion
bool flag = enterpriseServicesRepository.Update(fileds, new WhereHelper(nameof(RB_EnterpriseServices_Extend.ServiceId), ServiceId));
return flag;
}
/// <summary>
/// 设置企业服务推荐
/// </summary>
/// <param name="ServiceId"></param>
///<param name="IsRecommend"></param>
/// <returns></returns>
public bool RecommendEnterpriseServicesModule(int ServiceId,int IsRecommend)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_EnterpriseServices_Extend.IsRecommend), IsRecommend},
{nameof(RB_EnterpriseServices_Extend.RecommendDate), DateTime.Now}
};
bool flag = enterpriseServicesRepository.Update(fileds, new WhereHelper(nameof(RB_EnterpriseServices_Extend.ServiceId), ServiceId));
return flag;
}
#endregion
......
......@@ -579,6 +579,23 @@ namespace Mall.Module.TradePavilion
return flag;
}
/// <summary>
///设置载体推荐状态
/// </summary>
/// <param name="CarrierId">载体Id</param>
/// <param name="IsRecommend">推荐状态(1-推荐)</param>
/// <returns></returns>
public bool RecommendCarrierModule(int CarrierId, int IsRecommend)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Carrier_Extend.IsRecommend),IsRecommend },
{nameof(RB_Carrier_Extend.RecommendDate),DateTime.Now },
};
bool flag = carrierRepository.Update(fileds, new WhereHelper(nameof(RB_Carrier_Extend.ID), CarrierId));
return flag;
}
#endregion
......@@ -1036,6 +1053,23 @@ namespace Mall.Module.TradePavilion
return flag;
}
/// <summary>
/// 设置品牌推荐状态
/// </summary>
/// <param name="Id"></param>
/// <param name="IsRecommend"></param>
/// <returns></returns>
public bool RecommendBrandModule(int Id,int IsRecommend)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Brand_Extend.IsRecommend),IsRecommend },
{nameof(RB_Brand_Extend.RecommendDate),DateTime.Now },
};
bool flag = brandRepository.Update(fileds, new WhereHelper(nameof(RB_Brand_Extend.ID), Id));
return flag;
}
/// <summary>
/// 获取品牌信息分页列表
/// </summary>
......
......@@ -12,6 +12,7 @@ using System.Threading.Tasks;
using System.Web;
using COSXML.Log;
using Dnc.Api.Throttle;
using Google.Protobuf.WellKnownTypes;
using Mall.CacheManager.Base;
using Mall.CacheManager.User;
using Mall.Common.API;
......@@ -1505,6 +1506,8 @@ namespace Mall.WebApi.Controllers.TradePavilion
x.CarrierMetroList,
x.ContactName,
x.ContactPhone,
x.IsRecommend,
RecommendDate = Common.ConvertHelper.FormatTime(x.RecommendDate)
});
return ApiResult.Success(data: pageModel);
}
......@@ -1515,7 +1518,6 @@ namespace Mall.WebApi.Controllers.TradePavilion
/// </summary>
/// <returns></returns>
[HttpGet]
[HttpPost]
public ApiResult GetCarrierDetails()
{
......@@ -1711,8 +1713,6 @@ namespace Mall.WebApi.Controllers.TradePavilion
return flag ? ApiResult.Success() : ApiResult.Failed();
}
/// <summary>
/// 删除载体信息
/// </summary>
......@@ -1726,6 +1726,21 @@ namespace Mall.WebApi.Controllers.TradePavilion
return flag ? ApiResult.Success() : ApiResult.Failed();
}
/// <summary>
/// 设置载体推荐状态
/// </summary>
/// <returns></returns>
[HttpPost]
[AllowRepeat]
public ApiResult RecommendCarrier()
{
JObject parms = JObject.Parse(RequestParm.msg.ToString());
var CarrierId = parms.GetInt("CarrierId", 0);
var IsRecommend = parms.GetInt("IsRecommend", 0);
var flag = carrierModule.RecommendCarrierModule(CarrierId, IsRecommend);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
/// <summary>
/// 获取载体下载枚举列表
......@@ -1903,7 +1918,6 @@ namespace Mall.WebApi.Controllers.TradePavilion
/// <returns></returns>
[HttpGet]
[HttpPost]
public ApiResult GetBrandPageList()
{
ResultPageModel pageModel = JsonConvert.DeserializeObject<ResultPageModel>(RequestParm.msg.ToString());
......@@ -1934,8 +1948,9 @@ namespace Mall.WebApi.Controllers.TradePavilion
}
query.MallBaseId = RequestParm.MallBaseId;
query.TenantId = RequestParm.TenantId;
var list = carrierModule.GetBrandPageList(pageModel.pageIndex, pageModel.pageSize, out long rowsCount, query, true);
foreach (var item in list)
List<object> list = new List<object>();
var dataList = carrierModule.GetBrandPageList(pageModel.pageIndex, pageModel.pageSize, out long rowsCount, query, true);
foreach (var item in dataList)
{
item.ProjectName = item.ProjectType.GetEnumName();
if (!string.IsNullOrWhiteSpace(item.Banner))
......@@ -1946,6 +1961,26 @@ namespace Mall.WebApi.Controllers.TradePavilion
{
item.BannerList = new List<string>();
}
list.Add(new
{
item.ID,
item.BrandName,
item.ProjectName,
item.ProjectType,
item.ClassName,
item.Logo,
item.ShopNum,
item.BuiltUpArea,
item.EndBuiltUpArea,
item.BrandType,
item.CustomerType,
item.ContactName,
item.ContactPhone,
item.UserName,
item.IsRecommend,
RecommendDate = Common.ConvertHelper.FormatTime(item.RecommendDate)
});
}
pageModel.count = Convert.ToInt32(rowsCount);
pageModel.pageData = list;
......@@ -2046,6 +2081,20 @@ namespace Mall.WebApi.Controllers.TradePavilion
return flag ? ApiResult.Success() : ApiResult.Failed();
}
/// <summary>
/// 设置品牌推荐状态
/// </summary>
/// <returns></returns>
[HttpPost]
[AllowRepeat]
public ApiResult RecommendBrand()
{
JObject parms = JObject.Parse(RequestParm.msg.ToString());
var Id = parms.GetInt("Id", 0);
int IsRecommend = parms.GetInt("IsRecommend", 0);
var flag = carrierModule.RecommendBrandModule(Id, IsRecommend);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
/// <summary>
/// 检查品牌文件是否存在
......@@ -3108,9 +3157,6 @@ namespace Mall.WebApi.Controllers.TradePavilion
}));
}
/// <summary>
/// 报名列表批量导出
/// </summary>
......@@ -3138,6 +3184,7 @@ namespace Mall.WebApi.Controllers.TradePavilion
return ApiResult.Failed(errmsg);
}
}
/// <summary>
/// 报名列表批量导出
/// </summary>
......@@ -3799,7 +3846,7 @@ namespace Mall.WebApi.Controllers.TradePavilion
/// <param name="ExcelEnumIdList">下载列</param>
/// <param name="filePath">Logo文件存放路径</param>
/// <param name="excelFileUrl">Excel文件路径</param>
private async void GetBuildingCarrierListToExcel(RB_Building_Carrier_Extend demodel, List<int> ExcelEnumIdList, string filePath, string excelFileUrl)
private void GetBuildingCarrierListToExcel(RB_Building_Carrier_Extend demodel, List<int> ExcelEnumIdList, string filePath, string excelFileUrl)
{
byte[] bytes = null;
string ExcelName = "载体列表" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".xls";
......
......@@ -96,6 +96,8 @@ namespace Mall.WebApi.Controllers.TradePavilion
item.ContactName,
item.ContactPhone,
CreateDate = Common.ConvertHelper.FormatTime(item.CreateDate),
item.IsRecommend,
RecommendDate = Common.ConvertHelper.FormatTime(item.RecommendDate),
});
}
pageModel.count = Convert.ToInt32(rowsCount);
......@@ -243,6 +245,25 @@ namespace Mall.WebApi.Controllers.TradePavilion
return ApiResult.Success(data: extModel);
}
/// <summary>
/// 设置推荐楼宇
/// </summary>
/// <returns></returns>
[HttpPost]
[AllowRepeat]
public ApiResult RecommendBuildingInfo()
{
JObject parms = JObject.Parse(RequestParm.msg.ToString());
int BuildId = parms.GetInt("BuildId");
int IsRecommend = parms.GetInt("IsRecommend");
if (BuildId <= 0)
{
return ApiResult.ParamIsNull(message: "参数不能为空");
}
var extModel = buildingCarrierModule.RecommendBuildingModule(BuildId, IsRecommend);
return ApiResult.Success(data: extModel);
}
/// <summary>
......@@ -334,7 +355,7 @@ namespace Mall.WebApi.Controllers.TradePavilion
/// <param name="ExcelEnumIdList">下载列</param>
/// <param name="filePath">Logo文件存放路径</param>
/// <param name="excelFileUrl">Excel文件路径</param>
private async void GetBuildingListToExcel(RB_Building_Extend demodel, List<int> ExcelEnumIdList, string filePath, string excelFileUrl)
private void GetBuildingListToExcel(RB_Building_Extend demodel, List<int> ExcelEnumIdList, string filePath, string excelFileUrl)
{
byte[] bytes = null;
string ExcelName = "载体列表" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".xls";
......@@ -465,148 +486,6 @@ namespace Mall.WebApi.Controllers.TradePavilion
}
}
///// <summary>
///// 获取【商载通】载体、楼宇下载枚举列表
///// </summary>
///// <returns></returns>
//[HttpPost]
//public ApiResult GetBuildingCarrierExportEnumList()
//{
// var list = EnumHelper.GetEnumList(typeof(Common.Enum.TradePavilion.BuildCarrierExportEnum));
// return ApiResult.Success("", list.Select(x => new
// {
// Name = x.Key,
// Id = Convert.ToInt32(x.Value)
// }));
//}
///// <summary>
///// 生成【商载通】载体、楼宇文件
///// </summary>
///// <param name="demodel">查询参数</param>
///// <param name="ExcelEnumIdList">下载列</param>
///// <param name="filePath">Logo文件存放路径</param>
///// <param name="excelFileUrl">Excel文件路径</param>
//private async void GetBuildingCarrierListToExcel(RB_Building_Carrier_Extend demodel, List<int> ExcelEnumIdList, string filePath, string excelFileUrl)
//{
// byte[] bytes = null;
// string ExcelName = "载体列表" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".xls";
// List<ExcelDataSource> slist = new List<ExcelDataSource>();
// var Enumlist = EnumHelper.GetEnumList(typeof(Common.Enum.TradePavilion.BuildCarrierExportEnum));
// ExcelDataSource header = new ExcelDataSource()
// {
// ExcelRows = new List<ExcelColumn>(30)
// {
// new ExcelColumn(value: "序号") { CellWidth = 15, HAlignmentEnum = HAlignmentEnum.CENTER, VAlignmentEnum = VAlignmentEnum.CENTER }
// }
// };
// foreach (var item in ExcelEnumIdList)
// {
// var Name = Enumlist.Where(x => x.Value == item.ToString()).FirstOrDefault().Key ?? "";
// header.ExcelRows.Add(new ExcelColumn(value: Name) { CellWidth = 15, HAlignmentEnum = HAlignmentEnum.CENTER, VAlignmentEnum = VAlignmentEnum.CENTER });
// }
// slist.Add(header);
// try
// {
// var list = buildingCarrierModule.GetBuildingCarrierListModule(demodel);
// List<Action> actions = new List<Action>();
// if (list != null && list.Count > 0)
// {
// //判断是否下载图片
// if (ExcelEnumIdList.Contains(2))
// {
// foreach (var item in list)
// {
// actions.Add(new Action(() =>
// {
// DownLoadUrl(item.Logo, filePath);
// }));
// }
// }
// }
// if (actions != null && actions.Count > 0)
// {
// ParallelOptions options = new ParallelOptions { MaxDegreeOfParallelism = 4 }; // 设置最大并行度为 4
// Parallel.Invoke(options, actions.ToArray());
// }
// #region 组装数据
// int Num = 0;
// foreach (var item in list)
// {
// Num++;
// ExcelDataSource datarow = new ExcelDataSource()
// {
// ExcelRows = new List<ExcelColumn>(30) {
// new ExcelColumn(value:Num.ToString()){ },
// }
// };
// foreach (var qitem in ExcelEnumIdList)
// {
// switch (qitem)
// {
// case 1:
// datarow.ExcelRows.Add(new ExcelColumn(value: item.CarrierName) { }); break;
// case 2:
// datarow.ExcelRows.Add(new ExcelColumn(value: item.Logo, isPic: 1) { }); break;
// case 3:
// datarow.ExcelRows.Add(new ExcelColumn(value: item.Developers) { }); break;
// case 4:
// datarow.ExcelRows.Add(new ExcelColumn(value: item.VideoUrl) { }); break;
// case 5:
// datarow.ExcelRows.Add(new ExcelColumn(value: item.Address) { }); break;
// case 6:
// datarow.ExcelRows.Add(new ExcelColumn(value: Common.ConvertHelper.FormatDate(item.OpenTime)) { }); break;
// case 7:
// datarow.ExcelRows.Add(new ExcelColumn(value: item.CategoryName) { }); break;
// case 8:
// datarow.ExcelRows.Add(new ExcelColumn(value: item.Ascription) { }); break;
// case 9:
// datarow.ExcelRows.Add(new ExcelColumn(value: (item.CarrierSize.ToString()) + "万平方米") { }); break;
// case 10:
// datarow.ExcelRows.Add(new ExcelColumn(value: item.PropertyComposition) { }); break;
// case 11:
// datarow.ExcelRows.Add(new ExcelColumn(value: item.Location) { }); break;
// case 12:
// datarow.ExcelRows.Add(new ExcelColumn(value: item.Crowd) { }); break;
// case 13:
// datarow.ExcelRows.Add(new ExcelColumn(value: item.VisitorsFlowrate) { }); break;
// case 14:
// datarow.ExcelRows.Add(new ExcelColumn(value: item.LayersNum) { }); break;
// case 15:
// datarow.ExcelRows.Add(new ExcelColumn(value: item.SupportingFacilities) { }); break;
// case 16:
// datarow.ExcelRows.Add(new ExcelColumn(value: item.ManagementCompany) { }); break;
// case 17:
// datarow.ExcelRows.Add(new ExcelColumn(value: item.BrandDemand) { }); break;
// case 18:
// datarow.ExcelRows.Add(new ExcelColumn(value: (item.BuildingCarriermetroList != null && item.BuildingCarriermetroList.Any()) ? (string.Join(",", item.BuildingCarriermetroList.Select(x => x.MetroNum + "号线" + x.MetroName + x.Distance))) : "") { }); break;
// }
// }
// slist.Add(datarow);
// }
// #endregion
// bytes = ExcelTempLateHelper.ToBrandExcelExtend(slist, filePath);
// using (FileStream fs = new FileStream(excelFileUrl, FileMode.CreateNew))
// {
// fs.Write(bytes, 0, bytes.Length);
// }
// }
// catch (Exception ex)
// {
// bytes = ExcelTempLateHelper.ToBrandExcelExtend(slist, filePath);
// using (FileStream fs = new FileStream(excelFileUrl, FileMode.CreateNew))
// {
// fs.Write(bytes, 0, bytes.Length);
// }
// LogHelper.Write(ex, string.Format("GetBuildingCarrierListToExcel_Requst: {0}", JsonHelper.Serialize(demodel)));
// }
//}
/// <summary>
/// 【商载通】企业服务分页列表
......@@ -670,6 +549,8 @@ namespace Mall.WebApi.Controllers.TradePavilion
item.ETypeName,
item.EType,
CreateDate = Common.ConvertHelper.FormatDate(item.CreateDate),
item.IsRecommend,
RecommendDate = Common.ConvertHelper.FormatTime(item.RecommendDate),
});
}
pageModel.count = Convert.ToInt32(rowsCount);
......@@ -804,6 +685,24 @@ namespace Mall.WebApi.Controllers.TradePavilion
return flag ? ApiResult.Success() : ApiResult.Failed();
}
/// <summary>
/// 设置推荐企业服务
/// </summary>
/// <returns></returns>
[AllowRepeat]
public ApiResult RecommendEnterpriseServicesInfo()
{
JObject parms = JObject.Parse(RequestParm.msg.ToString());
int ServiceId = parms.GetInt("ServiceId");
int IsRecommend = parms.GetInt("IsRecommend");
if (ServiceId <= 0)
{
return ApiResult.ParamIsNull(message: "参数不能为空");
}
bool flag = buildingCarrierModule.RecommendEnterpriseServicesModule(ServiceId, IsRecommend);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
......
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