Commit 1f0b0481 authored by 吴春's avatar 吴春

解决冲突

parents 57642925 833f4cc0
using Mall.Common.Plugin;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Mall.Common.Enum.User
{
/// <summary>
/// 分销商提现方式枚举
/// </summary>
public enum DistrbutorWithdrawWayEnum
{
/// <summary>
/// 自动打款
/// </summary>
[EnumField("自动打款")]
ZDDK = 1,
/// <summary>
/// 微信线下转账
/// </summary>
[EnumField("微信线下转账")]
WXZZ = 2,
/// <summary>
/// 支付宝线下转账
/// </summary>
[EnumField("支付宝线下转账")]
ZFBZZ = 3,
/// <summary>
/// 银行卡线下转账
/// </summary>
[EnumField("银行卡线下转账")]
YYKZZ = 4,
/// <summary>
/// 余额提现
/// </summary>
[EnumField("余额提现")]
YETX = 5,
}
}
using Mall.Common.Plugin;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Mall.Common.Enum.User
{
/// <summary>
/// 用户下线枚举
/// </summary>
public enum DistributorApplyForEnum
{
/// <summary>
/// 申请(填信息)需审核
/// </summary>
[EnumField("申请(填信息)需审核")]
TX = 1,
/// <summary>
/// 申请(填信息)无需审核
/// </summary>
[EnumField("申请(填信息)无需审核")]
TWX = 2,
/// <summary>
/// 申请(不填信息)需审核
/// </summary>
[EnumField("申请(不填信息)需审核")]
BTX = 3,
/// <summary>
/// 申请(不填信息)无需审核
/// </summary>
[EnumField("申请(不填信息)无需审核")]
BTWX = 4
}
}
using Mall.Common.Plugin;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Mall.Common.Enum.User
{
/// <summary>
/// 成为分销商条件枚举
/// </summary>
public enum DistributorConditionEnum
{
/// <summary>
/// 单次消费
/// </summary>
[EnumField("单次消费")]
DCXF = 1,
/// <summary>
/// 购买商品
/// </summary>
[EnumField("购买商品")]
GMSP = 2,
/// <summary>
/// 无条件
/// </summary>
[EnumField("无条件")]
WTJ = 3
}
}
using Mall.Common.Plugin;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Mall.Common.Enum.User
{
/// <summary>
/// 用户下线枚举
/// </summary>
public enum UserReferralsEnum
{
/// <summary>
/// 首次点击链接
/// </summary>
[EnumField("首次点击链接")]
SCDJ = 1,
/// <summary>
/// 首次下单
/// </summary>
[EnumField("首次下单")]
SCXD = 2,
/// <summary>
/// 首次付款
/// </summary>
[EnumField("首次付款")]
SCFK = 3
}
}
using Mall.Common.AOP;
using Mall.Common.Enum.User;
using System;
using System.Collections.Generic;
using System.Text;
namespace Mall.Model.Entity.Product
{
/// <summary>
/// 素材管理表实体
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_Material_Group
{
/// <summary>
/// Id
/// </summary>
public int Id
{
get;
set;
}
/// <summary>
/// 分组名称
/// </summary>
public string Name
{
get;
set;
}
/// <summary>
/// 类型 1图片 2视频
/// </summary>
public int? Type
{
get;
set;
}
/// <summary>
/// 排序
/// </summary>
public int? Sort
{
get;
set;
}
/// <summary>
/// 状态
/// </summary>
public int? Status
{
get;
set;
}
/// <summary>
/// 回收 1正常 2回收
/// </summary>
public int? Recycled { get; set; }
/// <summary>
/// 商户号
/// </summary>
public int TenantId
{
get;
set;
}
/// <summary>
/// 小程序id
/// </summary>
public int MallBaseId
{
get;
set;
}
/// <summary>
/// CreateDate
/// </summary>
public DateTime? CreateDate
{
get;
set;
}
/// <summary>
/// UpdateDate
/// </summary>
public DateTime? UpdateDate
{
get;
set;
}
}
}
using Mall.Common.AOP;
using Mall.Common.Enum.User;
using System;
using System.Collections.Generic;
using System.Text;
namespace Mall.Model.Entity.Product
{
/// <summary>
/// 素材管理表实体
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_Material_Info
{
/// <summary>
/// Id
/// </summary>
public int Id
{
get;
set;
}
/// <summary>
/// 素材名称
/// </summary>
public string Name
{
get;
set;
}
/// <summary>
/// 类型 1图片 2视频
/// </summary>
public int? Type
{
get;
set;
}
/// <summary>
/// 分组ID 0表示全部
/// </summary>
public int? GroupId
{
get;
set;
}
/// <summary>
/// 存放路径
/// </summary>
public string Path
{
get;
set;
}
/// <summary>
/// 视频封面图
/// </summary>
public string Image
{
get;
set;
}
/// <summary>
/// 视频时长 秒
/// </summary>
public int? VideoTime
{
get;
set;
}
/// <summary>
/// 视频的宽高
/// </summary>
public string WithHeight
{
get;
set;
}
/// <summary>
/// 商户号
/// </summary>
public int TenantId
{
get;
set;
}
/// <summary>
/// 小程序id
/// </summary>
public int MallBaseId
{
get;
set;
}
/// <summary>
/// CreateDate
/// </summary>
public DateTime? CreateDate
{
get;
set;
}
/// <summary>
/// UpdateDate
/// </summary>
public DateTime? UpdateDate
{
get;
set;
}
/// <summary>
/// 回收 1正常 2回收
/// </summary>
public int? Recycled { get; set; }
/// <summary>
/// 删除状态
/// </summary>
public int? Status { get; set; }
}
}
......@@ -41,7 +41,7 @@ namespace Mall.Model.Entity.User
/// <summary>
/// 下线条件 枚举
/// </summary>
public int? ReferralsCondition
public UserReferralsEnum? ReferralsCondition
{
get;
set;
......@@ -49,7 +49,7 @@ namespace Mall.Model.Entity.User
/// <summary>
/// 申请成为分销商 枚举
/// </summary>
public int? ApplyFor
public DistributorApplyForEnum? ApplyFor
{
get;
set;
......@@ -57,7 +57,7 @@ namespace Mall.Model.Entity.User
/// <summary>
/// 成为分销商的条件 枚举
/// </summary>
public int? DistributorCondition
public DistributorConditionEnum? DistributorCondition
{
get;
set;
......@@ -103,9 +103,13 @@ namespace Mall.Model.Entity.User
set;
}
/// <summary>
/// 分销商等级入口图片
/// </summary>
public string GradeEntranceimage { get; set; }
/// <summary>
/// 提现方式 枚举
/// </summary>
public int? WithdrawWay
public DistrbutorWithdrawWayEnum? WithdrawWay
{
get;
set;
......@@ -153,7 +157,7 @@ namespace Mall.Model.Entity.User
/// <summary>
/// 待审核页面背景图片
/// </summary>
public string BackgroundImage
public int? BackgroundImage
{
get;
set;
......@@ -161,7 +165,7 @@ namespace Mall.Model.Entity.User
/// <summary>
/// 首页背景图片
/// </summary>
public string IndexImage
public int? IndexImage
{
get;
set;
......@@ -169,12 +173,16 @@ namespace Mall.Model.Entity.User
/// <summary>
/// 商户号
/// </summary>
public int? TenantId
public int TenantId
{
get;
set;
}
/// <summary>
/// 小程序id
/// </summary>
public int MallBaseId { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime? CreateDate
......
......@@ -45,7 +45,7 @@ namespace Mall.Model.Entity.User
/// <summary>
/// Image
/// </summary>
public string Image
public int? Image
{
get;
set;
......
......@@ -41,7 +41,7 @@ namespace Mall.Model.Entity.User
/// <summary>
/// 图片
/// </summary>
public string Image
public int? Image
{
get;
set;
......
......@@ -62,7 +62,7 @@ namespace Mall.Model.Entity.User
/// <summary>
/// 会员图标
/// </summary>
public string Icon
public int? Icon
{
get;
set;
......@@ -70,7 +70,7 @@ namespace Mall.Model.Entity.User
/// <summary>
/// 会员背景图片
/// </summary>
public string BackgroundImage
public int? BackgroundImage
{
get;
set;
......
......@@ -45,7 +45,7 @@ namespace Mall.Model.Entity.User
/// <summary>
/// Image
/// </summary>
public string Image
public int? Image
{
get;
set;
......
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_Menu
{
/// <summary>
/// 菜单编号
/// </summary>
public int MenuId
{
get;
set;
}
/// <summary>
/// 菜单名称
/// </summary>
public string MenuName
{
get;
set;
}
/// <summary>
/// 菜单连接
/// </summary>
public string MenuUrl
{
get;
set;
}
/// <summary>
/// 菜单等级(1)
/// </summary>
public int? MenuLevel
{
get;
set;
}
/// <summary>
/// 父级菜单编号(根节点为0)
/// </summary>
public int? ParentId
{
get;
set;
}
/// <summary>
/// 图标
/// </summary>
public string IconClass
{
get;
set;
}
/// <summary>
/// 状态
/// </summary>
public int? Status
{
get;
set;
}
/// <summary>
/// 创建时间
/// </summary>
public DateTime? CreateDate
{
get;
set;
}
/// <summary>
/// 排序
/// </summary>
public int SortNum { get; set; }
}
}
......@@ -70,5 +70,20 @@ namespace Mall.Model.Entity.User
/// 状态(0-正常,1-禁用)
/// </summary>
public int Status { get; set; }
/// <summary>
/// 版权文字
/// </summary>
public string CopyRightWord { get; set; }
/// <summary>
/// 版权图片
/// </summary>
public string CopyRightImg { get; set; }
/// <summary>
/// 版权链接页面
/// </summary>
public string CopyRightLink { get; set; }
}
}
using Mall.Common.AOP;
using System;
using System.Collections.Generic;
using System.Text;
using Mall.Model.Entity.Product;
namespace Mall.Model.Extend.Product
{
/// <summary>
/// 素材管理表扩展实体
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_Material_Group_Extend : RB_Material_Group
{
/// <summary>
/// 分组ids
/// </summary>
public string GroupIds { get; set; }
}
}
using Mall.Common.AOP;
using System;
using System.Collections.Generic;
using System.Text;
using Mall.Model.Entity.Product;
namespace Mall.Model.Extend.Product
{
/// <summary>
/// 素材管理表扩展实体
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_Material_Info_Extend : RB_Material_Info
{
/// <summary>
/// ids
/// </summary>
public string MaterialIds { get; set; }
}
}
......@@ -13,6 +13,13 @@ namespace Mall.Model.Extend.User
[DB(ConnectionName = "DefaultConnection")]
public class RB_Distributor_Basics_Extend : RB_Distributor_Basics
{
/// <summary>
/// 路径
/// </summary>
public string IndexImagePath { get; set; }
/// <summary>
/// 路径
/// </summary>
public string BackgroundImagePath { get; set; }
}
}
......@@ -17,5 +17,9 @@ namespace Mall.Model.Extend.User
/// 等级ids
/// </summary>
public string GradeIds { get; set; }
/// <summary>
/// 图片地址
/// </summary>
public string ImagePath { get; set; }
}
}
......@@ -21,5 +21,14 @@ namespace Mall.Model.Extend.User
/// 权益列表
/// </summary>
public List<RB_Member_Equity_Extend> EquityList { get; set; }
/// <summary>
/// 图标路径
/// </summary>
public string IconPath { get; set; }
/// <summary>
/// 背景路径
/// </summary>
public string BackgroundImagePath { get; set; }
}
}
......@@ -13,6 +13,6 @@ namespace Mall.Model.Extend.User
[DB(ConnectionName = "DefaultConnection")]
public class RB_Member_Integral_Extend : RB_Member_Integral
{
}
}
using Mall.Common.AOP;
using System;
using System.Collections.Generic;
using System.Text;
namespace Mall.Model.Extend.User
{
/// <summary>
/// 菜单实体表
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_Menu_Extend : Model.Entity.User.RB_Menu
{
/// <summary>
/// 状态字符串
/// </summary>
public string StatusStr
{
get
{
string str = "正常";
if (this.Status > 0 && this.Status == 1)
{
str = "禁用";
}
return str;
}
}
}
}
......@@ -12,6 +12,27 @@ namespace Mall.Model.Extend.User
[DB(ConnectionName = "DefaultConnection")]
public class RB_Tenant_Extend : Model.Entity.User.RB_Tenant
{
/// <summary>
/// 账号有效期
/// </summary>
public string AccountValidateStr
{
get
{
string str = "";
if (this.IsEffective != null && this.IsEffective == 1)
{
str = "永久有效";
}
else
{
if (this.AccountValidate != null)
{
str = Convert.ToDateTime(this.AccountValidate).ToString("yyyy-MM-dd");
}
}
return str;
}
}
}
}
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.0</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>
This diff is collapsed.
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 MenuModule
{
/// <summary>
/// 菜单仓储层对象
/// </summary>
private readonly RB_MenuRepository menuRepository = new RB_MenuRepository();
/// <summary>
/// 根据查询条件获取菜单列表
/// </summary>
/// <param name="query">查询条件</param>
/// <returns></returns>
public List<RB_Menu_Extend> GetMenuListModule(RB_Menu_Extend query)
{
return menuRepository.GetListRepository(query);
}
/// <summary>
/// 获取菜单分页列表
/// </summary>
/// <param name="pageIndex">页码</param>
/// <param name="pageSize">每页显示条数</param>
/// <param name="rowCount">总条数</param>
/// <param name="query">查询条件</param>
/// <returns></returns>
public List<RB_Menu_Extend> GetMenuPageListModule(int pageIndex, int pageSize, out long rowCount, RB_Menu_Extend query)
{
return menuRepository.GetPageListRepository(pageIndex, pageSize, out rowCount, query);
}
/// <summary>
/// 新增修改菜单
/// </summary>
/// <param name="extModel"></param>
/// <returns></returns>
public bool SetMenuModule(RB_Menu_Extend extModel)
{
bool flag = false;
if (extModel.MenuId > 0)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{ nameof(RB_Menu_Extend.MenuName),extModel.MenuName.Trim()},
{ nameof(RB_Menu_Extend.MenuUrl),extModel.MenuUrl.Trim()},
{ nameof(RB_Menu_Extend.MenuLevel),extModel.MenuLevel},
{ nameof(RB_Menu_Extend.ParentId),extModel.ParentId},
{ nameof(RB_Menu_Extend.IconClass),extModel.IconClass},
{ nameof(RB_Menu_Extend.SortNum),extModel.SortNum},
};
flag = menuRepository.Update(fileds, new WhereHelper(nameof(RB_Menu_Extend.MenuId), extModel.MenuId));
}
else
{
extModel.CreateDate = DateTime.Now;
int NewId = menuRepository.Insert(extModel);
extModel.MenuId = NewId;
flag = NewId > 0;
}
return flag;
}
/// <summary>
/// 删除菜单
/// </summary>
/// <param name="MenuId">菜单编号</param>
/// <param name="Status">菜单状态</param>
/// <returns></returns>
public bool RemoveMenuModule(object MenuId, int Status)
{
bool flag = false;
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{ nameof(RB_Menu_Extend.Status),Status},
};
flag = menuRepository.Update(fileds, new WhereHelper(nameof(RB_Menu_Extend.MenuId), MenuId));
return flag;
}
/// <summary>
/// 根据编号获取菜单实体
/// </summary>
/// <param name="MenuId">菜单编号</param>
/// <returns></returns>
public RB_Menu_Extend GetMenuModule(object MenuId)
{
RB_Menu_Extend extModel = menuRepository.GetEntity<RB_Menu_Extend>(MenuId);
if (extModel == null)
{
extModel = new RB_Menu_Extend();
}
return extModel;
}
}
}
......@@ -55,6 +55,16 @@ namespace Mall.Module.User
return programRepository.Exists(wheres);
}
/// <summary>
/// 检查小程序数量
/// </summary>
/// <param name="TenantId">商户Id</param>
/// <returns></returns>
public int CheckMallNumModule(int TenantId)
{
return programRepository.CheckMallNumRepository(TenantId);
}
/// <summary>
/// 添加修改小程序
/// </summary>
......@@ -75,7 +85,7 @@ namespace Mall.Module.User
{ nameof(RB_MiniProgram_Extend.IsEffective),extModel.IsEffective},
{ nameof(RB_MiniProgram_Extend.MallValidate),extModel.MallValidate},
};
flag = programRepository.Update(fileds, new WhereHelper(nameof(RB_Tenant_Extend.TenantId), extModel.TenantId));
flag = programRepository.Update(fileds, new WhereHelper(nameof(RB_MiniProgram_Extend.MallBaseId), extModel.MallBaseId));
}
else
{
......@@ -88,6 +98,27 @@ namespace Mall.Module.User
return flag;
}
/// <summary>
/// 修改小程序版权信息
/// </summary>
/// <param name="extModel"></param>
/// <returns></returns>
public bool SetMiniProgramCopyRightModule(RB_MiniProgram_Extend extModel)
{
bool flag = false;
if (extModel.MallBaseId > 0)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{ nameof(RB_MiniProgram_Extend.CopyRightWord),extModel.CopyRightWord.Trim()},
{ nameof(RB_MiniProgram_Extend.CopyRightImg),extModel.CopyRightImg},
{ nameof(RB_MiniProgram_Extend.CopyRightLink),extModel.CopyRightLink},
};
flag = programRepository.Update(fileds, new WhereHelper(nameof(RB_MiniProgram_Extend.MallBaseId), extModel.MallBaseId));
}
return flag;
}
/// <summary>
......@@ -111,12 +142,12 @@ namespace Mall.Module.User
/// <param name="MallBaseId">小程序Id</param>
/// <param name="Status">小程序状态</param>
/// <returns></returns>
public bool SetTenantStatusModule(object MallBaseId, int AccountStatus)
public bool SetMiniProgramModule(object MallBaseId, int Status)
{
bool flag = false;
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{ nameof(RB_MiniProgram_Extend.Status),AccountStatus},
{ nameof(RB_MiniProgram_Extend.Status),Status},
};
flag = programRepository.Update(fileds, new WhereHelper(nameof(RB_MiniProgram_Extend.MallBaseId), MallBaseId));
return flag;
......
This diff is collapsed.
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
......
using System;
using System.Collections.Generic;
using System.Text;
using Mall.Model.Entity.Product;
using Mall.Model.Extend.Product;
using System.Linq;
namespace Mall.Repository.Product
{
/// <summary>
/// 素材管理仓储层
/// </summary>
public class RB_Material_GroupRepository : RepositoryBase<RB_Material_Group>
{
/// <summary>
/// 分页列表
/// </summary>
/// <param name="pageIndex">页码</param>
/// <param name="pageSize">每页显示条数</param>
/// <param name="rowCount">总条数</param>
/// <param name="dmodel">查询条件</param>
/// <returns></returns>
public List<RB_Material_Group_Extend> GetPageList(int pageIndex, int pageSize, out long rowCount, RB_Material_Group_Extend dmodel)
{
string where = $" 1=1 and {nameof(RB_Material_Group.Status)}=0";
if (dmodel.TenantId > 0) {
where += $@" and {nameof(RB_Material_Group.TenantId)}={dmodel.TenantId}";
}
if (dmodel.MallBaseId > 0) {
where += $@" and {nameof(RB_Material_Group.MallBaseId)}={dmodel.MallBaseId}";
}
if (dmodel.Id > 0) {
where += $@" and {nameof(RB_Material_Group.Id)}={dmodel.Id}";
}
if (!string.IsNullOrEmpty(dmodel.Name)) {
where += $@" and {nameof(RB_Material_Group.Name)} like '%{dmodel.Name}%'";
}
if (dmodel.Type > 0) {
where += $@" and {nameof(RB_Material_Group.Type)}={dmodel.Type}";
}
if (dmodel.Recycled > 0) {
where += $@" and {nameof(RB_Material_Group.Recycled)}={dmodel.Recycled}";
}
string sql = $@"select * from RB_Material_Group where {where} order by Id desc";
return GetPage<RB_Material_Group_Extend>(pageIndex, pageSize, out rowCount, sql).ToList();
}
/// <summary>
/// 获取列表
/// </summary>
/// <param name="dmodel"></param>
/// <returns></returns>
public List<RB_Material_Group_Extend> GetList(RB_Material_Group_Extend dmodel)
{
string where = $" 1=1 and {nameof(RB_Material_Group.Status)}=0";
if (dmodel.TenantId > 0)
{
where += $@" and {nameof(RB_Material_Group.TenantId)}={dmodel.TenantId}";
}
if (dmodel.MallBaseId > 0)
{
where += $@" and {nameof(RB_Material_Group.MallBaseId)}={dmodel.MallBaseId}";
}
if (dmodel.Id > 0)
{
where += $@" and {nameof(RB_Material_Group.Id)}={dmodel.Id}";
}
if (!string.IsNullOrEmpty(dmodel.GroupIds)) {
where += $@" and {nameof(RB_Material_Group.Id)} in({dmodel.GroupIds})";
}
if (!string.IsNullOrEmpty(dmodel.Name))
{
where += $@" and {nameof(RB_Material_Group.Name)} like '%{dmodel.Name}%'";
}
if (dmodel.Type > 0)
{
where += $@" and {nameof(RB_Material_Group.Type)}={dmodel.Type}";
}
if (dmodel.Recycled > 0)
{
where += $@" and {nameof(RB_Material_Group.Recycled)}={dmodel.Recycled}";
}
string sql = $@"select * from RB_Material_Group where {where} order by Sort,Id desc";
return Get<RB_Material_Group_Extend>(sql).ToList();
}
}
}
using System;
using System.Collections.Generic;
using System.Text;
using Mall.Model.Entity.Product;
using Mall.Model.Extend.Product;
using System.Linq;
namespace Mall.Repository.Product
{
/// <summary>
/// 素材管理仓储层
/// </summary>
public class RB_Material_InfoRepository : RepositoryBase<RB_Material_Info>
{
/// <summary>
/// 分页列表
/// </summary>
/// <param name="pageIndex">页码</param>
/// <param name="pageSize">每页显示条数</param>
/// <param name="rowCount">总条数</param>
/// <param name="dmodel">查询条件</param>
/// <returns></returns>
public List<RB_Material_Info_Extend> GetPageList(int pageIndex, int pageSize, out long rowCount, RB_Material_Info_Extend dmodel)
{
string where = $" 1=1 and {nameof(RB_Material_Info.Status)}=0";
if (dmodel.TenantId > 0) {
where += $@" and {nameof(RB_Material_Info.TenantId)}={dmodel.TenantId}";
}
if (dmodel.MallBaseId > 0) {
where += $@" and {nameof(RB_Material_Info.MallBaseId)}={dmodel.MallBaseId}";
}
if (dmodel.Id > 0) {
where += $@" and {nameof(RB_Material_Info.Id)}={dmodel.Id}";
}
if (!string.IsNullOrEmpty(dmodel.Name)) {
where += $@" and {nameof(RB_Material_Info.Name)} like '%{dmodel.Name}%'";
}
if (dmodel.Type > 0) {
where += $@" and {nameof(RB_Material_Info.Type)}={dmodel.Type}";
}
if (dmodel.GroupId > 0) {
where += $@" and {nameof(RB_Material_Info.GroupId)}={dmodel.GroupId}";
}
if (dmodel.Recycled > 0)
{
where += $@" and {nameof(RB_Material_Info.Recycled)}={dmodel.Recycled}";
}
string sql = $@"select * from RB_Material_Info where {where} order by Id desc";
return GetPage<RB_Material_Info_Extend>(pageIndex, pageSize, out rowCount, sql).ToList();
}
/// <summary>
/// 获取列表
/// </summary>
/// <param name="dmodel"></param>
/// <returns></returns>
public List<RB_Material_Info_Extend> GetList(RB_Material_Info_Extend dmodel)
{
string where = $" 1=1 and {nameof(RB_Material_Info.Status)}=0";
if (dmodel.TenantId > 0)
{
where += $@" and {nameof(RB_Material_Info.TenantId)}={dmodel.TenantId}";
}
if (dmodel.MallBaseId > 0)
{
where += $@" and {nameof(RB_Material_Info.MallBaseId)}={dmodel.MallBaseId}";
}
if (dmodel.Id > 0)
{
where += $@" and {nameof(RB_Material_Info.Id)}={dmodel.Id}";
}
if (!string.IsNullOrEmpty(dmodel.MaterialIds))
{
where += $@" and {nameof(RB_Material_Info.Id)} in({dmodel.MaterialIds})";
}
if (!string.IsNullOrEmpty(dmodel.Name))
{
where += $@" and {nameof(RB_Material_Info.Name)} like '%{dmodel.Name}%'";
}
if (dmodel.Type > 0)
{
where += $@" and {nameof(RB_Material_Info.Type)}={dmodel.Type}";
}
if (dmodel.GroupId > 0)
{
where += $@" and {nameof(RB_Material_Info.GroupId)}={dmodel.GroupId}";
}
if (dmodel.Recycled > 0)
{
where += $@" and {nameof(RB_Material_Info.Recycled)}={dmodel.Recycled}";
}
string sql = $@"select * from RB_Material_Info where {where} order by Id desc";
return Get<RB_Material_Info_Extend>(sql).ToList();
}
/// <summary>
/// 分组下所有素材全回收
/// </summary>
/// <param name="groupId"></param>
/// <param name="tenantId"></param>
/// <param name="mallBaseId"></param>
public bool SetMaterialInfoRecycled(int groupId, int tenantId, int mallBaseId)
{
string sql = $@" Update RB_Material_Info Set Recycled=2 where GroupId={groupId} and TenantId={tenantId} and MallBaseId={mallBaseId}";
return Execute(sql) > 0;
}
/// <summary>
/// 设置批量素材回收
/// </summary>
/// <param name="materialIds"></param>
/// <param name="uid"></param>
/// <param name="mallBaseId"></param>
/// <returns></returns>
public bool SetMaterialListRecycled(string materialIds, string uid, int mallBaseId)
{
string sql = $@" Update RB_Material_Info Set Recycled=2 where Id in({materialIds}) and TenantId={uid} and MallBaseId={mallBaseId} and Status=0";
return Execute(sql) > 0;
}
/// <summary>
/// 删除素材
/// </summary>
/// <param name="materialIds"></param>
/// <param name="uid"></param>
/// <param name="mallBaseId"></param>
/// <param name="groupId"></param>
/// <returns></returns>
public bool DelMaterialInfo(string materialIds, string uid, int mallBaseId, int groupId = 0)
{
if (groupId > 0) {
string sql1 = $@" Update RB_Material_Info Set Status=1 where GroupId ={groupId} and TenantId={uid} and MallBaseId={mallBaseId} and Status=0 and Recycled=2";
return Execute(sql1) > 0;
}
string sql = $@" Update RB_Material_Info Set Status=1 where Id in({materialIds}) and TenantId={uid} and MallBaseId={mallBaseId} and Status=0 and Recycled=2";
return Execute(sql) > 0;
}
/// <summary>
/// 素材转移
/// </summary>
/// <param name="materialIds"></param>
/// <param name="groupId"></param>
/// <param name="uid"></param>
/// <param name="mallBaseId"></param>
/// <returns></returns>
public bool SetMaterialInfoTransfer(string materialIds, int groupId, string uid, int mallBaseId)
{
string sql = $@" Update RB_Material_Info Set GroupId={groupId} where Id in({materialIds}) and TenantId={uid} and MallBaseId={mallBaseId} and Status=0 and Recycled=1";
return Execute(sql) > 0;
}
}
}
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_Distributor_BasicsRepository : RepositoryBase<RB_Distributor_Basics>
{
/// <summary>
/// 分页列表
/// </summary>
/// <param name="pageIndex">页码</param>
/// <param name="pageSize">每页显示条数</param>
/// <param name="rowCount">总条数</param>
/// <param name="dmodel">查询条件</param>
/// <returns></returns>
public List<RB_Distributor_Basics_Extend> GetPageList(int pageIndex, int pageSize, out long rowCount, RB_Distributor_Basics_Extend dmodel)
{
string where = " 1=1 ";
if (dmodel.TenantId > 0) {
where += $@" and {nameof(RB_Member_User.TenantId)}={dmodel.TenantId}";
}
if (dmodel.MallBaseId > 0) {
where += $@" and {nameof(RB_Member_User.MallBaseId)}={dmodel.MallBaseId}";
}
if (dmodel.Id > 0) {
where += $@" and {nameof(RB_Member_User.Id)}={dmodel.Id}";
}
string sql = $@"select * from RB_Distributor_Basics where {where} order by Id desc";
return GetPage<RB_Distributor_Basics_Extend>(pageIndex, pageSize, out rowCount, sql).ToList();
}
/// <summary>
/// 获取列表
/// </summary>
/// <param name="dmodel"></param>
/// <returns></returns>
public List<RB_Distributor_Basics_Extend> GetList(RB_Distributor_Basics_Extend dmodel)
{
string where = " 1=1 ";
if (dmodel.TenantId > 0)
{
where += $@" and {nameof(RB_Member_User.TenantId)}={dmodel.TenantId}";
}
if (dmodel.MallBaseId > 0)
{
where += $@" and {nameof(RB_Member_User.MallBaseId)}={dmodel.MallBaseId}";
}
if (dmodel.Id > 0)
{
where += $@" and {nameof(RB_Member_User.Id)}={dmodel.Id}";
}
string sql = $@"select * from RB_Distributor_Basics where {where} order by Id desc";
return Get<RB_Distributor_Basics_Extend>(sql).ToList();
}
}
}
......@@ -48,27 +48,29 @@ namespace Mall.Repository.User
/// <returns></returns>
public List<RB_Member_Equity_Extend> GetList(RB_Member_Equity_Extend dmodel)
{
string where = $" 1=1 and {nameof(RB_Member_Equity.Status)}=0";
string where = $" 1=1 and e.{nameof(RB_Member_Equity.Status)}=0";
if (dmodel.TenantId > 0)
{
where += $@" and {nameof(RB_Member_Equity.TenantId)}={dmodel.TenantId}";
where += $@" and e.{nameof(RB_Member_Equity.TenantId)}={dmodel.TenantId}";
}
if (dmodel.MallBaseId > 0)
{
where += $@" and {nameof(RB_Member_Equity.MallBaseId)}={dmodel.MallBaseId}";
where += $@" and e.{nameof(RB_Member_Equity.MallBaseId)}={dmodel.MallBaseId}";
}
if (!string.IsNullOrEmpty(dmodel.Title))
{
where += $@" and {nameof(RB_Member_Equity.Title)} like '%{dmodel.Title}%'";
where += $@" and e.{nameof(RB_Member_Equity.Title)} like '%{dmodel.Title}%'";
}
if (dmodel.GradeId > 0)
{
where += $@" and {nameof(RB_Member_Equity.GradeId)} ={dmodel.GradeId}";
where += $@" and e.{nameof(RB_Member_Equity.GradeId)} ={dmodel.GradeId}";
}
if (!string.IsNullOrEmpty(dmodel.GradeIds)) {
where += $@" and {nameof(RB_Member_Equity.GradeId)} in({dmodel.GradeIds})";
where += $@" and e.{nameof(RB_Member_Equity.GradeId)} in({dmodel.GradeIds})";
}
string sql = $@"select * from RB_Member_Equity where {where} order by Id desc";
string sql = $@"select e.*,mi.Name as ImagePath from RB_Member_Equity e
left join rb_material_info mi on e.Image=mi.Id
where {where} order by e.Id desc";
return Get<RB_Member_Equity_Extend>(sql).ToList();
}
}
......
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_MenuRepository : RepositoryBase<RB_Menu>
{
/// <summary>
/// 根据查询条件获取菜单列表
/// </summary>
/// <param name="query">查询条件</param>
/// <returns></returns>
public List<RB_Menu_Extend> GetListRepository(RB_Menu_Extend query)
{
StringBuilder builder = new StringBuilder();
builder.Append(" SELECT * FROM RB_Menu WHERE 1=1 AND Status=0 ");
if (query != null)
{
if (query.MenuLevel > 0)
{
builder.AppendFormat(" AND MenuLevel={0} ", query.MenuLevel);
}
if (query.MenuName != null && !string.IsNullOrEmpty(query.MenuName.Trim()))
{
builder.AppendFormat(" AND MenuName LIKE '%{0}%' ", query.MenuName.Trim());
}
}
return Get<RB_Menu_Extend>(builder.ToString()).ToList();
}
/// <summary>
/// 获取菜单分页列表
/// </summary>
/// <param name="pageIndex">页码</param>
/// <param name="pageSize">每页显示条数</param>
/// <param name="rowCount">总条数</param>
/// <param name="query">查询条件</param>
/// <returns></returns>
public List<RB_Menu_Extend> GetPageListRepository(int pageIndex, int pageSize, out long rowCount, RB_Menu_Extend query)
{
StringBuilder builder = new StringBuilder();
builder.Append(" SELECT * FROM RB_Menu WHERE 1=1 ");
if (query != null)
{
if (query.MenuLevel > 0)
{
builder.AppendFormat(" AND MenuLevel={0} ", query.MenuLevel);
}
if (query.MenuName != null && !string.IsNullOrEmpty(query.MenuName.Trim()))
{
builder.AppendFormat(" AND MenuName LIKE '%{0}%' ", query.MenuName.Trim());
}
}
return GetPage<RB_Menu_Extend>(pageIndex, pageSize, out rowCount, builder.ToString()).ToList();
}
}
}
......@@ -32,6 +32,7 @@ namespace Mall.Repository.User
return Get<RB_MiniProgram_Extend>(builder.ToString()).ToList();
}
/// <summary>
/// 获取小程序分页列表
/// </summary>
......@@ -49,6 +50,10 @@ FROM RB_MiniProgram AS A LEFT JOIN RB_Tenant AS B ON A.TenantId=B.TenantId
WHERE 1=1 ");
if (query != null)
{
if (query.Status >= 0)
{
builder.AppendFormat(" AND A.Status={0} ", query.Status);
}
if (query.TenantId != null && query.TenantId > 0)
{
builder.AppendFormat(" AND A.TenantId='{0}' ", query.TenantId);
......@@ -60,5 +65,24 @@ WHERE 1=1 ");
}
return GetPage<RB_MiniProgram_Extend>(pageIndex, pageSize, out rowCount, builder.ToString()).ToList();
}
/// <summary>
/// 检查小程序数量
/// </summary>
/// <param name="TenantId">商户Id</param>
/// <returns></returns>
public int CheckMallNumRepository(int TenantId)
{
int Num = 0;
StringBuilder builder = new StringBuilder();
builder.Append("SELECT COUNT(*) FROM RB_MiniProgram WHERE 1=1 ");
builder.AppendFormat(" AND TenantId='{0}' ", TenantId);
object obj = base.ExecuteScalar(builder.ToString());
if (obj != null)
{
Int32.TryParse(obj.ToString(), out Num);
}
return Num;
}
}
}
This diff is collapsed.
......@@ -39,11 +39,25 @@ namespace Mall.WebApi.Filter
#region api监控日志
parm = DoApiMonitorLog(actionContext, ref token);
#endregion
var notValidat = parm["cmd"].ToString();
//不需要验证TOKEN的CMD
List<string> notValidatList = new List<string>()
{
"/api/Tenant/Login",//用户登录
"/api/Tenant/SetTenantFirst",//用户注册第一步
"/api/Tenant/SetTenantSecond",//用户注册第二步
"/api/Tenant/UpdateTenantPwd",//忘记密码
};
bool isCheckToken = true;
foreach (var item in notValidatList)
{
if (item== parm["cmd"].ToString())
{
isCheckToken = false;
}
}
#region Token校验
if (notValidat != "/api/Tenant/Login")
if (isCheckToken)
{
JWTValidat(actionContext, token);
}
......
......@@ -15,6 +15,7 @@
<ProjectReference Include="..\Mall.DataHelper\Mall.DataHelper.csproj" />
<ProjectReference Include="..\Mall.Model\Mall.Model.csproj" />
<ProjectReference Include="..\Mall.Module.BaseSetUp\Mall.Module.BaseSetUp.csproj" />
<ProjectReference Include="..\Mall.Module.Product\Mall.Module.Product.csproj" />
<ProjectReference Include="..\Mall.Module.User\Mall.Module.User.csproj" />
<ProjectReference Include="..\Mall.ThirdCore\Mall.ThirdCore.csproj" />
</ItemGroup>
......
......@@ -33,6 +33,8 @@ 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}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
......@@ -83,6 +85,10 @@ Global
{9C400D7F-2BE2-40E7-B179-498097AA00AB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9C400D7F-2BE2-40E7-B179-498097AA00AB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9C400D7F-2BE2-40E7-B179-498097AA00AB}.Release|Any CPU.Build.0 = Release|Any CPU
{D0386A52-CAFD-40B3-A515-9A9241189FBA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{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
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
......@@ -98,6 +104,7 @@ Global
{46E2983C-2CAF-4850-A6FC-804A7C425F76} = {E239A6CD-DA5B-4E7A-B997-8D17C8E18EB6}
{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}
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