Commit 5755ddcf authored by 黄奎's avatar 黄奎

新增分销海报实体

parent cbf2dff8
using Mall.Common.AOP;
using System;
using System.Collections.Generic;
using System.Text;
namespace Mall.Model.Entity.User
{
/// <summary>
/// 分销海报实体类
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_MiniProgram_FenXiaoPoster
{
/// <summary>
/// 主键编号
/// </summary>
public int Id { get; set; }
/// <summary>
/// 商户Id
/// </summary>
public int TenantId { get; set; }
/// <summary>
/// 小程序Id
/// </summary>
public int MallBaseId { get; set; }
/// <summary>
/// 海报背景图
/// </summary>
public string PosterBgImg { get; set; }
/// <summary>
/// 是否显示头像(0-显示,1-不显示)
/// </summary>
public int IsShowHead { get; set; }
/// <summary>
/// 头像大小
/// </summary>
public int HeadSize { get; set; }
/// <summary>
/// 头像上间距
/// </summary>
public int HeadPaddingTop { get; set; }
/// <summary>
/// 头像左间距
/// </summary>
public int HeadPaddingLeft { get; set; }
/// <summary>
/// 是否显示昵称(0-显示,1-不显示)
/// </summary>
public int IsShowNick { get; set; }
/// <summary>
/// 昵称大小
/// </summary>
public int NickSize { get; set; }
/// <summary>
/// 昵称上间距
/// </summary>
public int NickPaddingTop { get; set; }
/// <summary>
/// 昵称左间距
/// </summary>
public int NickPaddingLeft { get; set; }
/// <summary>
/// 是否显示二维码(0-显示,1-不显示)
/// </summary>
public int IsShowQrCode { get; set; }
/// <summary>
/// 二维码大小
/// </summary>
public int QrCodeSize { get; set; }
/// <summary>
/// 二维码上间距
/// </summary>
public int QrCodePaddingTop { get; set; }
/// <summary>
/// 二维码上间距
/// </summary>
public int QrCodePaddingLeft { get; set; }
}
}
using Mall.Common.AOP;
using System;
using System.Collections.Generic;
using System.Text;
using Mall.Model.Entity.User;
namespace Mall.Model.Extend.User
{
/// <summary>
/// 分销海报扩展实体类
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_MiniProgram_FenXiaoPoster_Extend : Model.Entity.User.RB_MiniProgram_FenXiaoPoster
{
}
}
using System;
using System.Collections.Generic;
using System.Text;
using Mall.Model.Extend.User;
using Mall.Repository;
using Mall.Repository.User;
namespace Mall.Module.User
{
/// <summary>
/// 海报处理类
/// </summary>
public class PosterModule
{
/// <summary>
/// 分销海报仓储层对象
/// </summary>
private RB_MiniProgram_FenXiaoPosterRepository fenXiaoPosterRepository = new RB_MiniProgram_FenXiaoPosterRepository();
/// <summary>
/// 根据查询条件获取分销海报实体
/// </summary>
/// <param name="query">查询条件</param>
/// <returns></returns>
public RB_MiniProgram_FenXiaoPoster_Extend GetFenXiaoPosterEntityModule(RB_MiniProgram_FenXiaoPoster_Extend query)
{
return fenXiaoPosterRepository.GetEntityExtRepository(query);
}
/// <summary>
/// 添加修改分销海报
/// </summary>
/// <param name="extModel"></param>
/// <returns></returns>
public bool SetFenXiaoPoster(RB_MiniProgram_FenXiaoPoster_Extend extModel)
{
bool flag = false;
if (extModel.Id > 0)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{ nameof(RB_MiniProgram_FenXiaoPoster_Extend.PosterBgImg),extModel.PosterBgImg},
{ nameof(RB_MiniProgram_FenXiaoPoster_Extend.IsShowHead),extModel.IsShowHead},
{ nameof(RB_MiniProgram_FenXiaoPoster_Extend.HeadSize),extModel.HeadSize},
{ nameof(RB_MiniProgram_FenXiaoPoster_Extend.HeadPaddingTop),extModel.HeadPaddingTop},
{ nameof(RB_MiniProgram_FenXiaoPoster_Extend.HeadPaddingLeft),extModel.HeadPaddingLeft},
{ nameof(RB_MiniProgram_FenXiaoPoster_Extend.IsShowNick),extModel.IsShowNick},
{ nameof(RB_MiniProgram_FenXiaoPoster_Extend.NickSize),extModel.NickSize},
{ nameof(RB_MiniProgram_FenXiaoPoster_Extend.NickPaddingTop),extModel.NickPaddingTop},
{ nameof(RB_MiniProgram_FenXiaoPoster_Extend.NickPaddingLeft),extModel.NickPaddingLeft},
{ nameof(RB_MiniProgram_FenXiaoPoster_Extend.IsShowQrCode),extModel.IsShowQrCode},
{ nameof(RB_MiniProgram_FenXiaoPoster_Extend.QrCodeSize),extModel.QrCodeSize},
{ nameof(RB_MiniProgram_FenXiaoPoster_Extend.QrCodePaddingTop),extModel.QrCodePaddingTop},
{ nameof(RB_MiniProgram_FenXiaoPoster_Extend.QrCodePaddingLeft),extModel.QrCodePaddingLeft},
};
flag = fenXiaoPosterRepository.Update(fileds, new WhereHelper(nameof(RB_MiniProgram_FenXiaoPoster_Extend.Id), extModel.Id));
}
else
{
int NewId = fenXiaoPosterRepository.Insert(extModel);
extModel.Id = NewId;
flag = NewId > 0;
}
return flag;
}
}
}
using System;
using System.Collections.Generic;
using System.Text;
using Mall.Model.Entity.User;
using Mall.Model.Extend.User;
using System.Linq;
namespace Mall.Repository.User
{
/// <summary>
/// 分销海报仓储层对象
/// </summary>
public class RB_MiniProgram_FenXiaoPosterRepository : RepositoryBase<RB_MiniProgram_FenXiaoPoster>
{
/// <summary>
/// 根据查询条件获取小程序用户中心配置实体
/// </summary>
/// <param name="query">查询条件</param>
/// <returns></returns>
public RB_MiniProgram_FenXiaoPoster_Extend GetEntityExtRepository(RB_MiniProgram_FenXiaoPoster_Extend query)
{
StringBuilder builder = new StringBuilder();
builder.Append(" SELECT * FROM RB_MiniProgram_FenXiaoPoster WHERE 1=1 ");
if (query != null)
{
if (query.TenantId > 0)
{
builder.AppendFormat(" AND TenantId={0} ", query.TenantId);
}
if (query.MallBaseId > 0)
{
builder.AppendFormat(" AND MallBaseId={0} ", query.MallBaseId);
}
if (query.Id > 0)
{
builder.AppendFormat(" AND Id={0} ", query.Id);
}
}
return Get<RB_MiniProgram_FenXiaoPoster_Extend>(builder.ToString()).FirstOrDefault();
}
}
}
...@@ -31,6 +31,10 @@ namespace Mall.Repository.User ...@@ -31,6 +31,10 @@ namespace Mall.Repository.User
{ {
builder.AppendFormat(" AND MallBaseId={0} ", query.MallBaseId); builder.AppendFormat(" AND MallBaseId={0} ", query.MallBaseId);
} }
if (query.Id > 0)
{
builder.AppendFormat(" AND Id={0} ", query.Id);
}
} }
return Get<RB_MiniProgram_UserCenterConfig_Extend>(builder.ToString()).FirstOrDefault(); return Get<RB_MiniProgram_UserCenterConfig_Extend>(builder.ToString()).FirstOrDefault();
} }
......
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