Commit a704dfc6 authored by 吴春's avatar 吴春

提交新增营销中心-充值管理

parent 54c01a3c
using Mall.Common.Plugin;
using System;
using System.Collections.Generic;
using System.Text;
namespace Mall.Common.Enum.MallBase
{
public enum StoreTypeEnum
{
/// <summary>
/// 腾讯云COS
/// </summary>
[EnumField("腾讯云COS")]
Tencent = 1,
/// <summary>
/// 七牛云存储
/// </summary>
[EnumField("七牛云存储")]
QiNiu = 2,
/// <summary>
/// 自定义存储
/// </summary>
[EnumField("自定义存储")]
Other = 3
}
}
using Mall.Common.AOP;
using Mall.Common.Enum.MallBase;
using System;
using System.Collections.Generic;
using System.Text;
namespace Mall.Model.Entity.BaseSetUp
{
/// <summary>
/// 文件上传位置
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_File_Store
{
public int ID { get; set; }
/// <summary>
/// 商户id
/// </summary>
public int TenantId { get; set; }
/// <summary>
/// 小程序id
/// </summary>
public int MallBaseId { get; set; }
/// <summary>
/// 0-否1-是
/// </summary>
public int IsDefault { get; set; }
public int Status { get; set; }
public DateTime CreateDate { get; set; }
public DateTime UpdateDate { get; set; }
/// <summary>
/// 空间名称
/// </summary>
public string Bucket { get; set; }
/// <summary>
/// 存储位置,1-腾讯云,2-七牛,3-其他
/// </summary>
public StoreTypeEnum StoreType { get; set; }
/// <summary>
/// 所属区域
/// </summary>
public string Region { get; set; }
/// <summary>
/// 自定义域名
/// </summary>
public string CustomDomain { get; set; }
/// <summary>
/// 自定义域名
/// </summary>
public string SecretKey { get; set; }
/// <summary>
/// 自定义域名
/// </summary>
public string SecretId { get; set; }
/// <summary>
/// 图片样式接口(七牛)
/// </summary>
public string ImgStyle { get; set; }
}
}
using Mall.Common.AOP;
using System;
using System.Collections.Generic;
using System.Text;
namespace Mall.Model.Entity.MarketingCenter
{
/// <summary>
/// 充值实体
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_Recharge_Rules
{
public int ID { get; set; }
/// <summary>
/// 商户id
/// </summary>
public int TenantId { get; set; }
/// <summary>
/// 小程序id
/// </summary>
public int MallBaseId { get; set; }
public int Status { get; set; }
public DateTime CreateDate { get; set; }
public DateTime UpdateDate { get; set; }
/// <summary>
/// 充值名称
/// </summary>
public string Name { get; set; }
/// <summary>
/// 充值金额
/// </summary>
public int Money { get; set; }
/// <summary>
/// 赠送金额
/// </summary>
public int GiveMoney { get; set; }
/// <summary>
/// 赠送积分
/// </summary>
public int GiveIntegral { get; set; }
}
}
......@@ -19,5 +19,11 @@ namespace Mall.Model.Extend.BaseSetUp
public string RegionName { get; set; }
public string PriceIds { get; set; }
/// <summary>
/// 地区父级id
/// </summary>
public int ParentID { get; set; }
}
}
using Mall.Common.AOP;
using Mall.Model.Entity.MarketingCenter;
using System;
using System.Collections.Generic;
using System.Text;
namespace Mall.Model.Extend.MarketingCenter
{
/// <summary>
/// 充值扩展实体
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_Recharge_Rules_Extend : RB_Recharge_Rules
{
}
}
......@@ -23,6 +23,8 @@ namespace Mall.Module.BaseSetUp
private RB_Logistics_DeliveryRepository deliveryRepository = new RB_Logistics_DeliveryRepository();
private RB_Logistics_ExpressRepository expressRepository = new RB_Logistics_ExpressRepository();
private RB_ElectronicSheetRepository electronicSheetRepository = new RB_ElectronicSheetRepository();
private RB_File_StoreRepository storeRepository = new RB_File_StoreRepository();
#region 基础设置
/// <summary>
/// 获取小程序列表
......@@ -877,5 +879,35 @@ namespace Mall.Module.BaseSetUp
}
#endregion
#region 上传设置
/// <summary>
/// 获取上传存储信息
/// </summary>
/// <param name="query">查询条件</param>
/// <returns></returns>
public List<RB_File_Store> GetFileStoreList(RB_File_Store query)
{
return storeRepository.GetListRepository(query);
}
/// <summary>
/// 新增/修改存储位置
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public bool AddOrUpdateFileStore(RB_File_Store model)
{
if (model.ID == 0)
{
return storeRepository.Insert(model) > 0;
}
else
{
return storeRepository.Update(model);
}
}
#endregion
}
}
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Mall.Common\Mall.Common.csproj" />
<ProjectReference Include="..\Mall.Model\Mall.Model.csproj" />
<ProjectReference Include="..\Mall.Repository\Mall.Repository.csproj" />
</ItemGroup>
</Project>
using Mall.Model.Extend.MarketingCenter;
using Mall.Repository.MarketingCenter;
using System;
using System.Collections.Generic;
using System.Text;
namespace Mall.Module.MarketingCenter
{
public class RechargeModule
{
private RB_Recharge_RulesRepository rulesRepository = new RB_Recharge_RulesRepository();
#region 充值信息
/// <summary>
/// 充值信息列表
/// </summary>
/// <param name="pageIndex">页码</param>
/// <param name="pageSize">每页显示条数</param>
/// <param name="rowCount">总条数</param>
/// <param name="query">查询条件</param>
/// <returns></returns>
public List<RB_Recharge_Rules_Extend> GetRechargeRulesPageList(int pageIndex, int pageSize, out long rowCount, RB_Recharge_Rules_Extend query)
{
return rulesRepository.GetRechargeRulesPageList(pageIndex, pageSize, out rowCount, query);
}
/// <summary>
/// 充值信息列表
/// </summary>
/// <param name="query">查询条件</param>
/// <returns></returns>
public List<RB_Recharge_Rules_Extend> GetRechargeRulesList(RB_Recharge_Rules_Extend query)
{
return rulesRepository.GetRechargeRulesList(query);
}
public bool AddOrUpdateRechargeRules(RB_Recharge_Rules_Extend model)
{
if (model.ID == 0)
{
return rulesRepository.Insert(model) > 0;
}
else
{
return rulesRepository.Update(model);
}
}
#endregion
}
}
using Mall.Model.Entity.BaseSetUp;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Mall.Repository.BaseSetUp
{
/// <summary>
/// 上传设置仓储层
/// </summary>
public class RB_File_StoreRepository : RepositoryBase<RB_File_Store>
{
/// <summary>
/// 表名称
/// </summary>
public string TableName { get { return nameof(RB_File_Store); } }
/// <summary>
/// 获取上传存储信息
/// </summary>
/// <param name="query">查询条件</param>
/// <returns></returns>
public List<RB_File_Store> GetListRepository(RB_File_Store query)
{
StringBuilder builder = new StringBuilder();
builder.Append($" SELECT * FROM {TableName} WHERE {nameof(RB_File_Store.Status)}=0");
if (query != null)
{
if (query.TenantId > 0)
{
builder.Append($" AND {nameof(RB_File_Store.TenantId)}={query.TenantId}");
}
if (query.TenantId > 0)
{
builder.Append($" AND {nameof(RB_File_Store.MallBaseId)}={query.MallBaseId}");
}
if (query.StoreType > 0)
{
builder.Append($" AND {nameof(RB_File_Store.StoreType)}={(int)query.StoreType}");
}
}
return Get<RB_File_Store>(builder.ToString()).ToList();
}
}
}
......@@ -27,7 +27,7 @@ namespace Mall.Repository.BaseSetUp
public List<RB_Logistics_RulesRegion_Extend> GetListRepository(RB_Logistics_RulesRegion_Extend query)
{
StringBuilder builder = new StringBuilder();
builder.Append($" SELECT a.*,b.`Name` as RegionName FROM {TableName} as a LEFT JOIN {DestinationTableName} as b on a.RegionId=b.ID WHERE a.{nameof(RB_Logistics_RulesRegion_Extend.Status)}=0");
builder.Append($" SELECT a.*,b.`Name` as RegionName,b.ParentID FROM {TableName} as a LEFT JOIN {DestinationTableName} as b on a.RegionId=b.ID WHERE a.{nameof(RB_Logistics_RulesRegion_Extend.Status)}=0");
if (query != null)
{
if (query.TenantId > 0)
......
using Mall.Model.Entity.MarketingCenter;
using Mall.Model.Extend.MarketingCenter;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Mall.Repository.MarketingCenter
{
/// <summary>
/// 充值仓储层
/// </summary>
public class RB_Recharge_RulesRepository : RepositoryBase<RB_Recharge_Rules>
{
/// <summary>
/// 表名称
/// </summary>
public string TableName { get { return nameof(RB_Recharge_Rules); } }
/// <summary>
/// 充值信息列表
/// </summary>
/// <param name="pageIndex">页码</param>
/// <param name="pageSize">每页显示条数</param>
/// <param name="rowCount">总条数</param>
/// <param name="query">查询条件</param>
/// <returns></returns>
public List<RB_Recharge_Rules_Extend> GetRechargeRulesPageList(int pageIndex, int pageSize, out long rowCount, RB_Recharge_Rules_Extend query)
{
StringBuilder builder = new StringBuilder();
builder.Append($" SELECT * FROM {TableName} WHERE {nameof(RB_Recharge_Rules_Extend.Status)}=0");
if (query != null)
{
if (query.TenantId > 0)
{
builder.Append($" AND {nameof(RB_Recharge_Rules_Extend.TenantId)}={query.TenantId}");
}
if (query.TenantId > 0)
{
builder.Append($" AND {nameof(RB_Recharge_Rules_Extend.MallBaseId)}={query.MallBaseId}");
}
if (!string.IsNullOrWhiteSpace(query.Name))
{
builder.Append($" AND {nameof(RB_Recharge_Rules_Extend.Name)} like '%{query.Name}%'");
}
}
return GetPage<RB_Recharge_Rules_Extend>(pageIndex, pageSize, out rowCount, builder.ToString()).ToList();
}
/// <summary>
/// 充值信息列表
/// </summary>
/// <param name="query">查询条件</param>
/// <returns></returns>
public List<RB_Recharge_Rules_Extend> GetRechargeRulesList(RB_Recharge_Rules_Extend query)
{
StringBuilder builder = new StringBuilder();
builder.Append($" SELECT * FROM {TableName} WHERE {nameof(RB_Recharge_Rules_Extend.Status)}=0 ");
if (query != null)
{
if (query.ID > 0)
{
builder.Append($" AND {nameof(RB_Recharge_Rules_Extend.ID)}={query.ID}");
}
if (query.TenantId > 0)
{
builder.Append($" AND {nameof(RB_Recharge_Rules_Extend.TenantId)}={query.TenantId}");
}
if (query.TenantId > 0)
{
builder.Append($" AND {nameof(RB_Recharge_Rules_Extend.MallBaseId)}={query.MallBaseId}");
}
if (!string.IsNullOrWhiteSpace(query.Name))
{
builder.Append($" AND {nameof(RB_Recharge_Rules_Extend.Name)} like '%{query.Name}%'");
}
}
return Get<RB_Recharge_Rules_Extend>(builder.ToString()).ToList();
}
}
}
......@@ -29,9 +29,9 @@ namespace Mall.WebApi.Controllers.MallBase
/// </summary>
/// <param name="ParentID">父节点编号</param>
/// <returns></returns>
public virtual ApiResult GetChildList(RequestParm request)
public ApiResult GetChildList()
{
JObject parm = JObject.Parse(request.msg.ToString());
JObject parm = JObject.Parse(RequestParm.msg.ToString());
int ID = parm.GetInt("Id");
if (ID > 0)
{
......
......@@ -148,6 +148,22 @@ namespace Mall.WebApi.Controllers.MallBase
}
}
/// <summary>
/// 获取用户下载枚举列表
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetLogisticsEnumList()
{
var list = EnumHelper.GetEnumList(typeof(Mall.Common.Enum.MallBase.LogisticsTypeEnum));
return ApiResult.Success("", list.Select(x => new
{
Name = x.Key,
Id = Convert.ToInt32(x.Value)
}));
}
#endregion
#region 运费规则
......@@ -885,5 +901,79 @@ namespace Mall.WebApi.Controllers.MallBase
}
}
#endregion
#region 上传设置
public ApiResult GetFileStoreList()
{
var parms = RequestParm;
var query = new RB_File_Store();
query.TenantId = UserInfo.TenantId;
query.MallBaseId = parms.MallBaseId;
var list = mallBaseModule.GetFileStoreList(query);
return ApiResult.Success("获取成功", list);
}
/// <summary>
/// 新增/修改上传设置
/// </summary>
/// <returns></returns>
public ApiResult AddOrUpdateFileStore()
{
var parms = RequestParm;
var query = JsonConvert.DeserializeObject<RB_File_Store>(RequestParm.msg.ToString());
query.TenantId = UserInfo.TenantId;
query.MallBaseId = parms.MallBaseId;
if (query == null)
{
return ApiResult.Failed("请传入上传设置信息");
}
else
{
if ((int)query.StoreType == 0)
{
return ApiResult.Failed("请选择存储位置");
}
if (query.ID == 0)
{
query.CreateDate = System.DateTime.Now;
}
query.UpdateDate = System.DateTime.Now;
bool result = mallBaseModule.AddOrUpdateFileStore(query);
if (result)
{
return ApiResult.Success("上传设置保存成功");
}
else
{
return ApiResult.Failed("上传设置保存失败");
}
}
}
/// <summary>
/// 获取上传信息的详情
/// </summary>
/// <returns></returns>
public ApiResult GetFileStoreDetail()
{
var parms = RequestParm;
var query = new RB_File_Store();
query.TenantId = UserInfo.TenantId;
query.MallBaseId = parms.MallBaseId;
var model = mallBaseModule.GetFileStoreList(query).FirstOrDefault();
if (model == null)
{
model = new RB_File_Store();
}
return ApiResult.Success("获取成功", model);
}
#endregion
}
}
\ No newline at end of file
......@@ -33,7 +33,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Mall.Module.User", "Mall.Mo
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Mall.Module.BaseSetUp", "Mall.Module.BaseSetUp\Mall.Module.BaseSetUp.csproj", "{9C400D7F-2BE2-40E7-B179-498097AA00AB}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mall.Module.Product", "Mall.Module.Product\Mall.Module.Product.csproj", "{D0386A52-CAFD-40B3-A515-9A9241189FBA}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Mall.Module.Product", "Mall.Module.Product\Mall.Module.Product.csproj", "{D0386A52-CAFD-40B3-A515-9A9241189FBA}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mall.Module.MarketingCenter", "Mall.Module.MarketingCenter\Mall.Module.MarketingCenter.csproj", "{339DE5B1-FA62-4B3D-80D4-0C50398D2848}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
......@@ -89,6 +91,10 @@ Global
{D0386A52-CAFD-40B3-A515-9A9241189FBA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D0386A52-CAFD-40B3-A515-9A9241189FBA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D0386A52-CAFD-40B3-A515-9A9241189FBA}.Release|Any CPU.Build.0 = Release|Any CPU
{339DE5B1-FA62-4B3D-80D4-0C50398D2848}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{339DE5B1-FA62-4B3D-80D4-0C50398D2848}.Debug|Any CPU.Build.0 = Debug|Any CPU
{339DE5B1-FA62-4B3D-80D4-0C50398D2848}.Release|Any CPU.ActiveCfg = Release|Any CPU
{339DE5B1-FA62-4B3D-80D4-0C50398D2848}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
......@@ -105,6 +111,7 @@ Global
{E56423C0-5AC2-48D8-88BE-5435EF6ADB3F} = {034DEA5B-083C-46EC-9D3F-C8273C59C218}
{9C400D7F-2BE2-40E7-B179-498097AA00AB} = {034DEA5B-083C-46EC-9D3F-C8273C59C218}
{D0386A52-CAFD-40B3-A515-9A9241189FBA} = {034DEA5B-083C-46EC-9D3F-C8273C59C218}
{339DE5B1-FA62-4B3D-80D4-0C50398D2848} = {034DEA5B-083C-46EC-9D3F-C8273C59C218}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {450F460D-A6AE-4FE3-948A-34E5FB8DBD7C}
......
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