Commit 1b10d783 authored by 黄奎's avatar 黄奎

代码优化

parent f11ab251
......@@ -10,5 +10,10 @@ namespace Mall.Model.Extend.TradePavilion
/// </summary>
public class RB_Commerce_Details_Extend: RB_Commerce_Details
{
/// <summary>
/// 活动编号【查询使用】
/// </summary>
public string QActivityIds { get; set; }
}
}
......@@ -5,8 +5,11 @@
</PropertyGroup>
<ItemGroup>
<Compile Remove="CacheEntity\**" />
<Compile Remove="Query\Applet\**" />
<EmbeddedResource Remove="CacheEntity\**" />
<EmbeddedResource Remove="Query\Applet\**" />
<None Remove="CacheEntity\**" />
<None Remove="Query\Applet\**" />
</ItemGroup>
......@@ -14,10 +17,6 @@
<Compile Remove="Extend\BaseSetUp\RB_Logistics_Pinkage_Extend.cs" />
</ItemGroup>
<ItemGroup>
<Folder Include="CacheEntity\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="VT.FW" Version="1.0.1" />
</ItemGroup>
......
using Mall.Model.Extend.TradePavilion;
using Mall.Repository.TradePavilion;
using System;
using System.Collections.Generic;
using System.Text;
namespace Mall.Module.TradePavilion
{
/// <summary>
/// 商会活动处理类
/// </summary>
public class CommerceActivityModule
{
/// <summary>
/// 商会活动仓储层对象
/// </summary>
private readonly RB_Commerce_ActivityRepository commerce_ActivityRepository = new RB_Commerce_ActivityRepository();
/// <summary>
/// 商会活动类型表仓储层对象
/// </summary>
private readonly RB_Commerce_ActivityTypeRepository activityTypeRepository = new RB_Commerce_ActivityTypeRepository();
/// <summary>
/// 商会活动详情表仓储层对象
/// </summary>
private readonly RB_Commerce_DetailsRepository detailsRepository = new RB_Commerce_DetailsRepository();
/// <summary>
/// 获取商会活动分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Commerce_Activity_Extend> GetCommerceActivityPageListModule(int pageIndex, int pageSize, out long rowsCount, RB_Commerce_Activity_Extend query)
{
return commerce_ActivityRepository.GetCommerceActivityPageListRepository(pageIndex, pageSize, out rowsCount, query);
}
/// <summary>
/// 获取商会活动类型分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Commerce_ActivityType_Extend> GetCommerceActivityTypePageListModule(int pageIndex, int pageSize, out long rowsCount, RB_Commerce_ActivityType_Extend query)
{
return activityTypeRepository.GetCommerceActivityTypePageListRepository(pageIndex, pageSize, out rowsCount, query);
}
/// <summary>
/// 获取商会活动详情列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Commerce_Details_Extend> GetCommerceDetailsListModule(RB_Commerce_Details_Extend query)
{
return detailsRepository.GetCommerceDetailsListRepository(query);
}
}
}
using Mall.Model.Entity.TradePavilion;
using Mall.Common.Enum;
using Mall.Model.Entity.TradePavilion;
using Mall.Model.Extend.TradePavilion;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using VT.FW.DB.Dapper;
namespace Mall.Repository.TradePavilion
{
......@@ -10,6 +14,46 @@ namespace Mall.Repository.TradePavilion
/// </summary>
public class RB_Commerce_ActivityRepository : BaseRepository<RB_Commerce_Activity>
{
/// <summary>
/// 获取商会活动分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Commerce_Activity_Extend> GetCommerceActivityPageListRepository(int pageIndex, int pageSize, out long rowsCount, RB_Commerce_Activity_Extend query)
{
rowsCount = 0;
DynamicParameters parameters = new DynamicParameters();
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT *
FROM RB_Commerce_Activity
WHERE 1=1
");
builder.AppendFormat(" AND {0}={1} ", nameof(RB_Commerce_Activity_Extend.Status), (int)DateStateEnum.Normal);
if (query == null)
{
return new List<RB_Commerce_Activity_Extend>();
}
else
{
if (query.TenantId > 0)
{
builder.AppendFormat(" AND {0}={1} ", nameof(RB_Commerce_Activity_Extend.TenantId), query.TenantId);
}
if (query.MallBaseId > 0)
{
builder.AppendFormat(" AND {0}={1} ", nameof(RB_Commerce_Activity_Extend.MallBaseId), query.MallBaseId);
}
if (!string.IsNullOrEmpty(query.ActivityName))
{
builder.AppendFormat(" AND {0} LIKE @Name ", nameof(RB_Commerce_Activity_Extend.ActivityName));
parameters.Add("Name", "%" + query.ActivityName.Trim() + "%");
}
}
return GetPage<RB_Commerce_Activity_Extend>(pageIndex, pageSize, out rowsCount, builder.ToString(), parameters).ToList();
}
}
}
using Mall.Model.Entity.TradePavilion;
using Mall.Common.Enum;
using Mall.Model.Entity.TradePavilion;
using Mall.Model.Extend.TradePavilion;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using VT.FW.DB.Dapper;
namespace Mall.Repository.TradePavilion
{
......@@ -10,5 +14,46 @@ namespace Mall.Repository.TradePavilion
/// </summary>
public class RB_Commerce_ActivityTypeRepository : BaseRepository<RB_Commerce_ActivityType>
{
/// <summary>
/// 获取商会活动类型分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Commerce_ActivityType_Extend> GetCommerceActivityTypePageListRepository(int pageIndex, int pageSize, out long rowsCount, RB_Commerce_ActivityType_Extend query)
{
rowsCount = 0;
DynamicParameters parameters = new DynamicParameters();
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT *
FROM RB_Commerce_ActivityType
WHERE 1=1
");
builder.AppendFormat(" AND {0}={1} ", nameof(RB_Commerce_ActivityType_Extend.Status), (int)DateStateEnum.Normal);
if (query == null)
{
return new List<RB_Commerce_ActivityType_Extend>();
}
else
{
if (query.TenantId > 0)
{
builder.AppendFormat(" AND {0}={1} ", nameof(RB_Commerce_ActivityType_Extend.TenantId), query.TenantId);
}
if (query.MallBaseId > 0)
{
builder.AppendFormat(" AND {0}={1} ", nameof(RB_Commerce_ActivityType_Extend.MallBaseId), query.MallBaseId);
}
if (!string.IsNullOrEmpty(query.TypeName))
{
builder.AppendFormat(" AND {0} LIKE @Name ", nameof(RB_Commerce_ActivityType_Extend.TypeName));
parameters.Add("Name", "%" + query.TypeName.Trim() + "%");
}
}
return GetPage<RB_Commerce_ActivityType_Extend>(pageIndex, pageSize, out rowsCount, builder.ToString(), parameters).ToList();
}
}
}
using Mall.Model.Entity.TradePavilion;
using Mall.Model.Extend.TradePavilion;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using VT.FW.DB.Dapper;
namespace Mall.Repository.TradePavilion
{
......@@ -10,6 +13,37 @@ namespace Mall.Repository.TradePavilion
/// </summary>
public class RB_Commerce_DetailsRepository : BaseRepository<RB_Commerce_Details>
{
/// <summary>
/// 获取商会活动详情列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Commerce_Details_Extend> GetCommerceDetailsListRepository(RB_Commerce_Details_Extend query)
{
DynamicParameters parameters = new DynamicParameters();
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT *
FROM RB_Commerce_Details
WHERE 1=1
");
if (query == null)
{
return new List<RB_Commerce_Details_Extend>();
}
else
{
if (query.ActivityId > 0)
{
builder.AppendFormat(" AND {0}={1} ", nameof(RB_Commerce_Details_Extend.ActivityId), query.ActivityId);
}
if (!string.IsNullOrEmpty(query.QActivityIds))
{
builder.AppendFormat(" AND {0} IN({1}) ", nameof(RB_Commerce_Details_Extend.ActivityId), query.QActivityIds);
}
}
return Get<RB_Commerce_Details_Extend>(builder.ToString(), parameters).ToList();
}
}
}
\ No newline at end of file
......@@ -33,7 +33,7 @@ SELECT *
FROM RB_InvestmentProcurement
WHERE 1=1
");
builder.AppendFormat(" AND {0}={1} ", nameof(RB_Company_Extend.Status), (int)DateStateEnum.Normal);
builder.AppendFormat(" AND {0}={1} ", nameof(RB_InvestmentProcurement_Extend.Status), (int)DateStateEnum.Normal);
if (query == null)
{
return new List<RB_InvestmentProcurement_Extend>();
......
......@@ -37,34 +37,34 @@ namespace Mall.WebApi.Controllers.User
/// <summary>
/// 商户账号处理类
/// </summary>
private Module.User.TenantModule TenantModule = new Module.User.TenantModule();
private readonly Module.User.TenantModule TenantModule = new Module.User.TenantModule();
/// <summary>
/// 商户小程序处理类
/// </summary>
private Module.User.MiniProgramModule programModule = new Module.User.MiniProgramModule();
private readonly Module.User.MiniProgramModule programModule = new Module.User.MiniProgramModule();
/// <summary>
/// 菜单处理类
/// </summary>
private Module.User.MenuModule menuModule = new Module.User.MenuModule();
private readonly Module.User.MenuModule menuModule = new Module.User.MenuModule();
/// <summary>
/// 小程序图标处理类对象
/// </summary>
private Module.User.MiniProgramNaviconModule naviconModule = new Module.User.MiniProgramNaviconModule();
private readonly Module.User.MiniProgramNaviconModule naviconModule = new Module.User.MiniProgramNaviconModule();
/// <summary>
/// 小程序页面处理类
/// </summary>
private Module.User.MiniProgramPageModule programPageModule = new Module.User.MiniProgramPageModule();
private readonly Module.User.MiniProgramPageModule programPageModule = new Module.User.MiniProgramPageModule();
/// <summary>
/// 海报处理类对象
/// </summary>
private Module.User.PosterModule posterModule = new Module.User.PosterModule();
private readonly Module.User.PosterModule posterModule = new Module.User.PosterModule();
/// <summary>
/// 插件处理类
......@@ -74,15 +74,15 @@ namespace Mall.WebApi.Controllers.User
/// <summary>
/// 员工管理处理类
/// </summary>
private Module.User.EmployeeModule employeeModule = new Module.User.EmployeeModule();
private readonly Module.User.EmployeeModule employeeModule = new Module.User.EmployeeModule();
/// <summary>
/// 产品处理类
/// </summary>
private ProductModule productModule = new ProductModule();
private readonly ProductModule productModule = new ProductModule();
private Module.Property.AuthorizeModule authorizeModule = new Module.Property.AuthorizeModule();
private readonly Module.Property.AuthorizeModule authorizeModule = new Module.Property.AuthorizeModule();
#region 商户信息
[AllowAnonymous]
......@@ -941,79 +941,81 @@ namespace Mall.WebApi.Controllers.User
var data = programModule.GetMiniProgramModule(new RB_MiniProgram_Extend() { MallBaseId = RequestParm.MallBaseId }, isGetHomeData: true);
List<object> resultList = new List<object>();
List<object> normalList = new List<object>();
normalList.Add(new
{
key = "search",
name = "搜索框",
relation_id = 0,
is_edit = 0,
imgBg = Common.Config.GetOssFileUrl + "/Static/search-bg.png"
});
normalList.Add(new
List<object> normalList = new List<object>
{
key = "banner",
name = "轮播图",
relation_id = 0,
is_edit = 0,
imgBg = Common.Config.GetOssFileUrl + "/Static/banner-bg.png"
});
normalList.Add(new
{
key = "home_nav",
name = "导航图标",
relation_id = 0,
is_edit = 1,
row_num = 4,
imgBg = Common.Config.GetOssFileUrl + "/Static/home-nav-bg.png"
});
normalList.Add(new
{
key = "video",
name = "视频",
relation_id = 0,
is_edit = 1,
permission_key = "video",
video_url = "",
video_pic_url = "",
imgBg = Common.Config.GetOssFileUrl + "/Static/video-bg.png"
});
normalList.Add(new
{
key = "notice",
name = "公告",
relation_id = 0,
is_edit = 1,
notice_url = "",
notice_bg_color = "#ED7E78",
notice_text_color = "#FFFFFF",
imgBg = Common.Config.GetOssFileUrl + "/Static/notice-bg.png"
});
normalList.Add(new
{
key = "topic",
name = "专题",
relation_id = 0,
is_edit = 1,
permission_key = "topic",
topic_num = 1,
topic_url = "",
topic_url_2 = "",
label_url = "",
imgBg = Common.Config.GetOssFileUrl + "/Static/topic-bg.png"
});
normalList.Add(new
{
key = "coupon",
name = "领券中心",
relation_id = 0,
is_edit = 1,
permission_key = "coupon",
coupon_url = "",
coupon_not_url = "",
imgBg = Common.Config.GetOssFileUrl + "/Static/coupon-bg.png"
});
new
{
key = "search",
name = "搜索框",
relation_id = 0,
is_edit = 0,
imgBg = Common.Config.GetOssFileUrl + "/Static/search-bg.png"
},
new
{
key = "banner",
name = "轮播图",
relation_id = 0,
is_edit = 0,
imgBg = Common.Config.GetOssFileUrl + "/Static/banner-bg.png"
},
new
{
key = "home_nav",
name = "导航图标",
relation_id = 0,
is_edit = 1,
row_num = 4,
imgBg = Common.Config.GetOssFileUrl + "/Static/home-nav-bg.png"
},
new
{
key = "video",
name = "视频",
relation_id = 0,
is_edit = 1,
permission_key = "video",
video_url = "",
video_pic_url = "",
imgBg = Common.Config.GetOssFileUrl + "/Static/video-bg.png"
},
new
{
key = "notice",
name = "公告",
relation_id = 0,
is_edit = 1,
notice_url = "",
notice_bg_color = "#ED7E78",
notice_text_color = "#FFFFFF",
imgBg = Common.Config.GetOssFileUrl + "/Static/notice-bg.png"
},
new
{
key = "topic",
name = "专题",
relation_id = 0,
is_edit = 1,
permission_key = "topic",
topic_num = 1,
topic_url = "",
topic_url_2 = "",
label_url = "",
imgBg = Common.Config.GetOssFileUrl + "/Static/topic-bg.png"
},
new
{
key = "coupon",
name = "领券中心",
relation_id = 0,
is_edit = 1,
permission_key = "coupon",
coupon_url = "",
coupon_not_url = "",
imgBg = Common.Config.GetOssFileUrl + "/Static/coupon-bg.png"
}
};
resultList.Add(new
{
......@@ -1029,15 +1031,17 @@ namespace Mall.WebApi.Controllers.User
IsShow = 1,
Enabled = 1
});
List<object> catList = new List<object>();
catList.Add(new
List<object> catList = new List<object>
{
key = "cat",
name = "所有分类",
relation_id = 0,
is_edit = 0,
imgBg = Common.Config.GetOssFileUrl + "/Static/cat-bg.png"
});
new
{
key = "cat",
name = "所有分类",
relation_id = 0,
is_edit = 0,
imgBg = Common.Config.GetOssFileUrl + "/Static/cat-bg.png"
}
};
foreach (var item in categoryList)
{
catList.Add(new
......@@ -1076,35 +1080,36 @@ namespace Mall.WebApi.Controllers.User
list = blockList
});
List<object> pluginList = new List<object>();
pluginList.Add(new
List<object> pluginList = new List<object>
{
key = "booking",
name = "预约",
relation_id = 0,
is_edit = 0,
permission_key = "booking",
imgBg = Common.Config.GetOssFileUrl + "/Static/yuyue-bg.png"
});
pluginList.Add(new
{
key = "pintuan",
name = "拼团",
relation_id = 0,
is_edit = 0,
permission_key = "pintuan",
imgBg = Common.Config.GetOssFileUrl + "/Static/yuyue-bg.png"
});
pluginList.Add(new
{
key = "advance",
name = "预售",
relation_id = 0,
is_edit = 0,
permission_key = "advance",
imgBg = Common.Config.GetOssFileUrl + "/Static/yushou-bg.png"
});
new
{
key = "booking",
name = "预约",
relation_id = 0,
is_edit = 0,
permission_key = "booking",
imgBg = Common.Config.GetOssFileUrl + "/Static/yuyue-bg.png"
},
new
{
key = "pintuan",
name = "拼团",
relation_id = 0,
is_edit = 0,
permission_key = "pintuan",
imgBg = Common.Config.GetOssFileUrl + "/Static/yuyue-bg.png"
},
new
{
key = "advance",
name = "预售",
relation_id = 0,
is_edit = 0,
permission_key = "advance",
imgBg = Common.Config.GetOssFileUrl + "/Static/yushou-bg.png"
}
};
resultList.Add(new
{
key = "plugin",
......@@ -1114,7 +1119,7 @@ namespace Mall.WebApi.Controllers.User
var obj = new
{
PlusInData = resultList,
HomeDataList = data.HomeDataList
data.HomeDataList
};
return ApiResult.Success(data: obj);
}
......@@ -1245,7 +1250,6 @@ namespace Mall.WebApi.Controllers.User
public ApiResult SetMenu()
{
var extModel = JsonConvert.DeserializeObject<RB_Menu_Extend>(RequestParm.msg.ToString());
Int32.TryParse(RequestParm.uid.ToString(), out int TenantId);
var flag = menuModule.SetMenuModule(extModel);
return flag ? ApiResult.Success(data: extModel) : ApiResult.Failed();
}
......@@ -1755,7 +1759,6 @@ namespace Mall.WebApi.Controllers.User
/// <returns></returns>
public ApiResult RemoveMiniUserCenterMenuByMallId()
{
JObject parms = JObject.Parse(RequestParm.msg.ToString());
var flag = programModule.DeleteMiniProgramUserCenterMenuModule(DetailIds: "", MallBaseId: RequestParm.MallBaseId);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
......@@ -2014,11 +2017,13 @@ namespace Mall.WebApi.Controllers.User
list.Add(header);
foreach (var item in dataList)
{
var ExcelDataRow = new List<ExcelColumn>();
ExcelDataRow.Add(new ExcelColumn(value: item.Num.ToString()));
ExcelDataRow.Add(new ExcelColumn(value: item.GoodsName));
ExcelDataRow.Add(new ExcelColumn(value: item.Income.ToString()));
ExcelDataRow.Add(new ExcelColumn(value: item.SaleCount.ToString()));
var ExcelDataRow = new List<ExcelColumn>
{
new ExcelColumn(value: item.Num.ToString()),
new ExcelColumn(value: item.GoodsName),
new ExcelColumn(value: item.Income.ToString()),
new ExcelColumn(value: item.SaleCount.ToString())
};
ExcelDataSource dataRow = new ExcelDataSource(30)
{
ExcelRows = ExcelDataRow
......@@ -2080,11 +2085,13 @@ namespace Mall.WebApi.Controllers.User
list.Add(header);
foreach (var item in dataList)
{
var ExcelDataRow = new List<ExcelColumn>();
ExcelDataRow.Add(new ExcelColumn(value: item.Num.ToString()));
ExcelDataRow.Add(new ExcelColumn(value: item.UserName));
ExcelDataRow.Add(new ExcelColumn(value: item.Income.ToString()));
ExcelDataRow.Add(new ExcelColumn(value: item.SaleCount.ToString()));
var ExcelDataRow = new List<ExcelColumn>
{
new ExcelColumn(value: item.Num.ToString()),
new ExcelColumn(value: item.UserName),
new ExcelColumn(value: item.Income.ToString()),
new ExcelColumn(value: item.SaleCount.ToString())
};
ExcelDataSource dataRow = new ExcelDataSource(30)
{
ExcelRows = ExcelDataRow
......@@ -2158,7 +2165,7 @@ namespace Mall.WebApi.Controllers.User
extModel.TenantId = RequestParm.TenantId;
extModel.CreateDate = DateTime.Now;
var flag = programModule.SetLiveConfigModule(extModel);
return ApiResult.Success(data: extModel);
return flag? ApiResult.Success(data: extModel):ApiResult.Failed();
}
#endregion
}
......
......@@ -41,6 +41,7 @@
<ProjectReference Include="..\Mall.Module.Product\Mall.Module.Product.csproj" />
<ProjectReference Include="..\Mall.Module.Property\Mall.Module.Property.csproj" />
<ProjectReference Include="..\Mall.Module.Reserve\Mall.Module.Reserve.csproj" />
<ProjectReference Include="..\Mall.Module.TradePavilion\Mall.Module.TradePavilion.csproj" />
<ProjectReference Include="..\Mall.Module.User\Mall.Module.User.csproj" />
<ProjectReference Include="..\Mall.ThirdCore\Mall.ThirdCore.csproj" />
</ItemGroup>
......
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