Commit 8931b245 authored by 黄奎's avatar 黄奎

代码优化

parent fb6a5bb6
...@@ -8,7 +8,7 @@ namespace Mall.CacheManager.AppletWeChat ...@@ -8,7 +8,7 @@ namespace Mall.CacheManager.AppletWeChat
{ {
public class OrderPayReidsCache public class OrderPayReidsCache
{ {
static RedisHelper redis = new RedisHelper(DataStatistic.DataConstant.REDIS_DB2, DataStatistic.DataConstant.DATA_OrderPayId); static readonly RedisHelper redis = new RedisHelper(DataStatistic.DataConstant.REDIS_DB2, DataStatistic.DataConstant.DATA_OrderPayId);
/// <summary> /// <summary>
/// 设置缓存 /// 设置缓存
/// </summary> /// </summary>
......
...@@ -15,7 +15,7 @@ namespace Mall.CacheManager.User ...@@ -15,7 +15,7 @@ namespace Mall.CacheManager.User
/// </summary> /// </summary>
public class UserReidsCache public class UserReidsCache
{ {
static RedisHelper redis = new RedisHelper(DataConstant.REDIS_DB2); static readonly RedisHelper redis = new RedisHelper(DataConstant.REDIS_DB2);
/// <summary> /// <summary>
/// 设置缓存 /// 设置缓存
...@@ -78,7 +78,7 @@ namespace Mall.CacheManager.User ...@@ -78,7 +78,7 @@ namespace Mall.CacheManager.User
/// <summary> /// <summary>
/// 商户信息仓储层对象 /// 商户信息仓储层对象
/// </summary> /// </summary>
private static Mall.Repository.User.RB_TenantRepository tenantRepository = new Repository.User.RB_TenantRepository(); private static readonly Mall.Repository.User.RB_TenantRepository tenantRepository = new Repository.User.RB_TenantRepository();
/// <summary> /// <summary>
/// 获取用户登录信息 /// 获取用户登录信息
......
...@@ -19,27 +19,27 @@ namespace Mall.Module.User ...@@ -19,27 +19,27 @@ namespace Mall.Module.User
/// <summary> /// <summary>
/// 专题分类表仓储层对象 /// 专题分类表仓储层对象
/// </summary> /// </summary>
private RB_Topic_TypeRepository topic_TypeRepository = new RB_Topic_TypeRepository(); private readonly RB_Topic_TypeRepository topic_TypeRepository = new RB_Topic_TypeRepository();
/// <summary> /// <summary>
/// 门店表仓储层对象 /// 门店表仓储层对象
/// </summary> /// </summary>
private RB_StoresRepository storesRepository = new RB_StoresRepository(); private readonly RB_StoresRepository storesRepository = new RB_StoresRepository();
/// <summary> /// <summary>
/// 视频表仓储层对象 /// 视频表仓储层对象
/// </summary> /// </summary>
private RB_VideoRepository videoRepository = new RB_VideoRepository(); private readonly RB_VideoRepository videoRepository = new RB_VideoRepository();
/// <summary> /// <summary>
/// 文章表仓储层对象 /// 文章表仓储层对象
/// </summary> /// </summary>
private RB_ArticleRepository articleRepository = new RB_ArticleRepository(); private readonly RB_ArticleRepository articleRepository = new RB_ArticleRepository();
/// <summary> /// <summary>
/// 专题仓储层对象 /// 专题仓储层对象
/// </summary> /// </summary>
private RB_TopicRepository topicRepository = new RB_TopicRepository(); private readonly RB_TopicRepository topicRepository = new RB_TopicRepository();
#region 专题分类 #region 专题分类
...@@ -73,7 +73,7 @@ namespace Mall.Module.User ...@@ -73,7 +73,7 @@ namespace Mall.Module.User
/// <returns></returns> /// <returns></returns>
public bool SetTopicTypeModule(RB_Topic_Type_Extend extModel) public bool SetTopicTypeModule(RB_Topic_Type_Extend extModel)
{ {
bool flag = false; bool flag;
if (extModel.Id > 0) if (extModel.Id > 0)
{ {
Dictionary<string, object> fileds = new Dictionary<string, object>() Dictionary<string, object> fileds = new Dictionary<string, object>()
...@@ -110,12 +110,11 @@ namespace Mall.Module.User ...@@ -110,12 +110,11 @@ namespace Mall.Module.User
/// <returns></returns> /// <returns></returns>
public bool RemoveTopicTypeModule(object Id) public bool RemoveTopicTypeModule(object Id)
{ {
bool flag = false;
Dictionary<string, object> fileds = new Dictionary<string, object>() Dictionary<string, object> fileds = new Dictionary<string, object>()
{ {
{ nameof(RB_Topic_Type_Extend.Status),1}, { nameof(RB_Topic_Type_Extend.Status),1},
}; };
flag = topic_TypeRepository.Update(fileds, new WhereHelper(nameof(RB_Topic_Type_Extend.Id), Id)); bool flag = topic_TypeRepository.Update(fileds, new WhereHelper(nameof(RB_Topic_Type_Extend.Id), Id));
return flag; return flag;
} }
...@@ -127,12 +126,11 @@ namespace Mall.Module.User ...@@ -127,12 +126,11 @@ namespace Mall.Module.User
/// <returns></returns> /// <returns></returns>
public bool UpdateTopicTypeStatusModule(object Id,int IsDisable) public bool UpdateTopicTypeStatusModule(object Id,int IsDisable)
{ {
bool flag = false;
Dictionary<string, object> fileds = new Dictionary<string, object>() Dictionary<string, object> fileds = new Dictionary<string, object>()
{ {
{ nameof(RB_Topic_Type_Extend.IsDisable),IsDisable}, { nameof(RB_Topic_Type_Extend.IsDisable),IsDisable},
}; };
flag = topic_TypeRepository.Update(fileds, new WhereHelper(nameof(RB_Topic_Type_Extend.Id), Id)); bool flag = topic_TypeRepository.Update(fileds, new WhereHelper(nameof(RB_Topic_Type_Extend.Id), Id));
return flag; return flag;
} }
#endregion #endregion
...@@ -169,7 +167,7 @@ namespace Mall.Module.User ...@@ -169,7 +167,7 @@ namespace Mall.Module.User
/// <returns></returns> /// <returns></returns>
public bool SetTopicModule(RB_Topic_Extend extModel) public bool SetTopicModule(RB_Topic_Extend extModel)
{ {
bool flag = false; bool flag;
if (extModel.Id > 0) if (extModel.Id > 0)
{ {
Dictionary<string, object> fileds = new Dictionary<string, object>() Dictionary<string, object> fileds = new Dictionary<string, object>()
...@@ -235,12 +233,11 @@ namespace Mall.Module.User ...@@ -235,12 +233,11 @@ namespace Mall.Module.User
/// <returns></returns> /// <returns></returns>
public bool RemoveTopicModule(object Id) public bool RemoveTopicModule(object Id)
{ {
bool flag = false;
Dictionary<string, object> fileds = new Dictionary<string, object>() Dictionary<string, object> fileds = new Dictionary<string, object>()
{ {
{ nameof(RB_Topic_Extend.Status),1}, { nameof(RB_Topic_Extend.Status),1},
}; };
flag = topicRepository.Update(fileds, new WhereHelper(nameof(RB_Topic_Extend.Id), Id)); bool flag = topicRepository.Update(fileds, new WhereHelper(nameof(RB_Topic_Extend.Id), Id));
return flag; return flag;
} }
#endregion #endregion
...@@ -277,7 +274,7 @@ namespace Mall.Module.User ...@@ -277,7 +274,7 @@ namespace Mall.Module.User
/// <returns></returns> /// <returns></returns>
public bool SetStoresModule(RB_Stores_Extend extModel) public bool SetStoresModule(RB_Stores_Extend extModel)
{ {
bool flag = false; bool flag;
if (extModel.Id > 0) if (extModel.Id > 0)
{ {
Dictionary<string, object> fileds = new Dictionary<string, object>() Dictionary<string, object> fileds = new Dictionary<string, object>()
...@@ -322,12 +319,11 @@ namespace Mall.Module.User ...@@ -322,12 +319,11 @@ namespace Mall.Module.User
/// <returns></returns> /// <returns></returns>
public bool RemoveStoresModule(object Id) public bool RemoveStoresModule(object Id)
{ {
bool flag = false;
Dictionary<string, object> fileds = new Dictionary<string, object>() Dictionary<string, object> fileds = new Dictionary<string, object>()
{ {
{ nameof(RB_Stores_Extend.Status),1}, { nameof(RB_Stores_Extend.Status),1},
}; };
flag = storesRepository.Update(fileds, new WhereHelper(nameof(RB_Stores_Extend.Id), Id)); bool flag = storesRepository.Update(fileds, new WhereHelper(nameof(RB_Stores_Extend.Id), Id));
return flag; return flag;
} }
...@@ -364,7 +360,7 @@ namespace Mall.Module.User ...@@ -364,7 +360,7 @@ namespace Mall.Module.User
/// <returns></returns> /// <returns></returns>
public bool SetVideoModule(RB_Video_Extend extModel) public bool SetVideoModule(RB_Video_Extend extModel)
{ {
bool flag = false; bool flag;
if (extModel.Id > 0) if (extModel.Id > 0)
{ {
Dictionary<string, object> fileds = new Dictionary<string, object>() Dictionary<string, object> fileds = new Dictionary<string, object>()
...@@ -404,12 +400,11 @@ namespace Mall.Module.User ...@@ -404,12 +400,11 @@ namespace Mall.Module.User
/// <returns></returns> /// <returns></returns>
public bool RemoveVideoModule(object Id) public bool RemoveVideoModule(object Id)
{ {
bool flag = false;
Dictionary<string, object> fileds = new Dictionary<string, object>() Dictionary<string, object> fileds = new Dictionary<string, object>()
{ {
{ nameof(RB_Video_Extend.Status),1}, { nameof(RB_Video_Extend.Status),1},
}; };
flag = videoRepository.Update(fileds, new WhereHelper(nameof(RB_Video_Extend.Id), Id)); bool flag = videoRepository.Update(fileds, new WhereHelper(nameof(RB_Video_Extend.Id), Id));
return flag; return flag;
} }
#endregion #endregion
...@@ -446,7 +441,7 @@ namespace Mall.Module.User ...@@ -446,7 +441,7 @@ namespace Mall.Module.User
/// <returns></returns> /// <returns></returns>
public bool SetArticleModule(RB_Article_Extend extModel) public bool SetArticleModule(RB_Article_Extend extModel)
{ {
bool flag = false; bool flag;
if (extModel.Id > 0) if (extModel.Id > 0)
{ {
Dictionary<string, object> fileds = new Dictionary<string, object>() Dictionary<string, object> fileds = new Dictionary<string, object>()
...@@ -484,12 +479,11 @@ namespace Mall.Module.User ...@@ -484,12 +479,11 @@ namespace Mall.Module.User
/// <returns></returns> /// <returns></returns>
public bool RemoveArticleModule(object Id) public bool RemoveArticleModule(object Id)
{ {
bool flag = false;
Dictionary<string, object> fileds = new Dictionary<string, object>() Dictionary<string, object> fileds = new Dictionary<string, object>()
{ {
{ nameof(RB_Article_Extend.Status),1}, { nameof(RB_Article_Extend.Status),1},
}; };
flag = articleRepository.Update(fileds, new WhereHelper(nameof(RB_Article_Extend.Id), Id)); bool flag = articleRepository.Update(fileds, new WhereHelper(nameof(RB_Article_Extend.Id), Id));
return flag; return flag;
} }
...@@ -501,12 +495,11 @@ namespace Mall.Module.User ...@@ -501,12 +495,11 @@ namespace Mall.Module.User
/// <returns></returns> /// <returns></returns>
public bool UpdateArticleIsDisableModule(object Id,int IsDisable) public bool UpdateArticleIsDisableModule(object Id,int IsDisable)
{ {
bool flag = false;
Dictionary<string, object> fileds = new Dictionary<string, object>() Dictionary<string, object> fileds = new Dictionary<string, object>()
{ {
{ nameof(RB_Article_Extend.IsDisable),IsDisable}, { nameof(RB_Article_Extend.IsDisable),IsDisable},
}; };
flag = articleRepository.Update(fileds, new WhereHelper(nameof(RB_Article_Extend.Id), Id)); bool flag = articleRepository.Update(fileds, new WhereHelper(nameof(RB_Article_Extend.Id), Id));
return flag; return flag;
} }
#endregion #endregion
......
...@@ -98,7 +98,7 @@ namespace Mall.Module.User ...@@ -98,7 +98,7 @@ namespace Mall.Module.User
/// <returns></returns> /// <returns></returns>
public bool SetRoleModule(RB_Role_Extend extModel) public bool SetRoleModule(RB_Role_Extend extModel)
{ {
bool flag = false; bool flag;
if (extModel.RoleId > 0) if (extModel.RoleId > 0)
{ {
Dictionary<string, object> fileds = new Dictionary<string, object>() Dictionary<string, object> fileds = new Dictionary<string, object>()
...@@ -135,12 +135,11 @@ namespace Mall.Module.User ...@@ -135,12 +135,11 @@ namespace Mall.Module.User
/// <returns></returns> /// <returns></returns>
public bool RemoveRoleModule(object RoleId) public bool RemoveRoleModule(object RoleId)
{ {
bool flag = false;
Dictionary<string, object> fileds = new Dictionary<string, object>() Dictionary<string, object> fileds = new Dictionary<string, object>()
{ {
{ nameof(RB_Role_Extend.Status),1}, { nameof(RB_Role_Extend.Status),1},
}; };
flag = roleRepository.Update(fileds, new WhereHelper(nameof(RB_Role_Extend.RoleId), RoleId)); bool flag = roleRepository.Update(fileds, new WhereHelper(nameof(RB_Role_Extend.RoleId), RoleId));
return flag; return flag;
} }
...@@ -178,7 +177,7 @@ namespace Mall.Module.User ...@@ -178,7 +177,7 @@ namespace Mall.Module.User
/// <returns></returns> /// <returns></returns>
public bool SetEmployeeModule(RB_Employee_Extend extModel) public bool SetEmployeeModule(RB_Employee_Extend extModel)
{ {
bool flag = false; bool flag;
if (extModel.EmpId > 0) if (extModel.EmpId > 0)
{ {
Dictionary<string, object> fileds = new Dictionary<string, object>() Dictionary<string, object> fileds = new Dictionary<string, object>()
...@@ -205,12 +204,11 @@ namespace Mall.Module.User ...@@ -205,12 +204,11 @@ namespace Mall.Module.User
/// <returns></returns> /// <returns></returns>
public bool SetEmployeePwdModule(RB_Employee_Extend extModel) public bool SetEmployeePwdModule(RB_Employee_Extend extModel)
{ {
bool flag = false;
Dictionary<string, object> fileds = new Dictionary<string, object>() Dictionary<string, object> fileds = new Dictionary<string, object>()
{ {
{ nameof(RB_Employee_Extend.EmpPwd),extModel.EmpPwd}, { nameof(RB_Employee_Extend.EmpPwd),extModel.EmpPwd},
}; };
flag = employeeRepository.Update(fileds, new WhereHelper(nameof(RB_Employee_Extend.EmpId), extModel.EmpId)); bool flag = employeeRepository.Update(fileds, new WhereHelper(nameof(RB_Employee_Extend.EmpId), extModel.EmpId));
return flag; return flag;
} }
...@@ -231,12 +229,11 @@ namespace Mall.Module.User ...@@ -231,12 +229,11 @@ namespace Mall.Module.User
/// <returns></returns> /// <returns></returns>
public bool RemoveEmployeeModule(object EmpId) public bool RemoveEmployeeModule(object EmpId)
{ {
bool flag = false;
Dictionary<string, object> fileds = new Dictionary<string, object>() Dictionary<string, object> fileds = new Dictionary<string, object>()
{ {
{ nameof(RB_Employee_Extend.Status),1}, { nameof(RB_Employee_Extend.Status),1},
}; };
flag = roleRepository.Update(fileds, new WhereHelper(nameof(RB_Employee_Extend.EmpId), EmpId)); bool flag = roleRepository.Update(fileds, new WhereHelper(nameof(RB_Employee_Extend.EmpId), EmpId));
return flag; return flag;
} }
...@@ -267,12 +264,12 @@ namespace Mall.Module.User ...@@ -267,12 +264,12 @@ namespace Mall.Module.User
/// <returns></returns> /// <returns></returns>
public bool SetEmpConfigModule(RB_Emp_Config_Extend extModel) public bool SetEmpConfigModule(RB_Emp_Config_Extend extModel)
{ {
bool flag = false;
var defaultModel = GetEmpConfigListModule(new RB_Emp_Config_Extend() { MallBaseId = extModel.MallBaseId, TenantId = extModel.TenantId }); var defaultModel = GetEmpConfigListModule(new RB_Emp_Config_Extend() { MallBaseId = extModel.MallBaseId, TenantId = extModel.TenantId });
if (defaultModel != null && defaultModel.ConfigId>0) if (defaultModel != null && defaultModel.ConfigId>0)
{ {
extModel.ConfigId = defaultModel.ConfigId; extModel.ConfigId = defaultModel.ConfigId;
} }
bool flag;
if (extModel.ConfigId > 0) if (extModel.ConfigId > 0)
{ {
Dictionary<string, object> fileds = new Dictionary<string, object>() Dictionary<string, object> fileds = new Dictionary<string, object>()
......
...@@ -24,9 +24,9 @@ namespace Mall.Module.User ...@@ -24,9 +24,9 @@ namespace Mall.Module.User
/// <returns></returns> /// <returns></returns>
public bool SetGroupBuyConfigModule(RB_GroupBuyConfig_Extend extModel) public bool SetGroupBuyConfigModule(RB_GroupBuyConfig_Extend extModel)
{ {
bool flag = false;
var oldEntity = GetGroupBuyConfigModule(extModel); var oldEntity = GetGroupBuyConfigModule(extModel);
extModel.GroupByConfigId = oldEntity?.GroupByConfigId ?? 0; extModel.GroupByConfigId = oldEntity?.GroupByConfigId ?? 0;
bool flag;
if (extModel.GroupByConfigId > 0) if (extModel.GroupByConfigId > 0)
{ {
Dictionary<string, object> fileds = new Dictionary<string, object>() Dictionary<string, object> fileds = new Dictionary<string, object>()
...@@ -63,9 +63,9 @@ namespace Mall.Module.User ...@@ -63,9 +63,9 @@ namespace Mall.Module.User
/// <returns></returns> /// <returns></returns>
public bool SetGroupBuyConfigMessageModule(RB_GroupBuyConfig_Extend extModel) public bool SetGroupBuyConfigMessageModule(RB_GroupBuyConfig_Extend extModel)
{ {
bool flag = false;
var oldEntity = GetGroupBuyConfigModule(extModel); var oldEntity = GetGroupBuyConfigModule(extModel);
extModel.GroupByConfigId = oldEntity?.GroupByConfigId ?? 0; extModel.GroupByConfigId = oldEntity?.GroupByConfigId ?? 0;
bool flag;
if (extModel.GroupByConfigId > 0) if (extModel.GroupByConfigId > 0)
{ {
Dictionary<string, object> fileds = new Dictionary<string, object>() Dictionary<string, object> fileds = new Dictionary<string, object>()
......
...@@ -48,7 +48,7 @@ namespace Mall.Module.User ...@@ -48,7 +48,7 @@ namespace Mall.Module.User
/// <returns></returns> /// <returns></returns>
public bool SetMenuModule(RB_Menu_Extend extModel) public bool SetMenuModule(RB_Menu_Extend extModel)
{ {
bool flag = false; bool flag;
if (extModel.MenuId > 0) if (extModel.MenuId > 0)
{ {
Dictionary<string, object> fileds = new Dictionary<string, object>() Dictionary<string, object> fileds = new Dictionary<string, object>()
...@@ -80,12 +80,11 @@ namespace Mall.Module.User ...@@ -80,12 +80,11 @@ namespace Mall.Module.User
/// <returns></returns> /// <returns></returns>
public bool RemoveMenuModule(object MenuId, int Status) public bool RemoveMenuModule(object MenuId, int Status)
{ {
bool flag = false;
Dictionary<string, object> fileds = new Dictionary<string, object>() Dictionary<string, object> fileds = new Dictionary<string, object>()
{ {
{ nameof(RB_Menu_Extend.Status),Status}, { nameof(RB_Menu_Extend.Status),Status},
}; };
flag = menuRepository.Update(fileds, new WhereHelper(nameof(RB_Menu_Extend.MenuId), MenuId)); bool flag = menuRepository.Update(fileds, new WhereHelper(nameof(RB_Menu_Extend.MenuId), MenuId));
return flag; return flag;
} }
......
...@@ -25,17 +25,17 @@ namespace Mall.Module.User ...@@ -25,17 +25,17 @@ namespace Mall.Module.User
/// <summary> /// <summary>
/// 商户仓储层对象 /// 商户仓储层对象
/// </summary> /// </summary>
private Mall.Repository.User.RB_MiniProgramRepository programRepository = new Repository.User.RB_MiniProgramRepository(); private readonly RB_MiniProgramRepository programRepository = new RB_MiniProgramRepository();
/// <summary> /// <summary>
/// 会员订阅消息仓储层对象 /// 会员订阅消息仓储层对象
/// </summary> /// </summary>
private Repository.User.RB_Member_SubscriptionRepository subscriptionRepository = new Repository.User.RB_Member_SubscriptionRepository(); private readonly RB_Member_SubscriptionRepository subscriptionRepository = new Repository.User.RB_Member_SubscriptionRepository();
/// <summary> /// <summary>
/// 会员仓储层对象 /// 会员仓储层对象
/// </summary> /// </summary>
private Repository.User.RB_Member_UserRepository userRepository = new Repository.User.RB_Member_UserRepository(); private readonly RB_Member_UserRepository userRepository = new Repository.User.RB_Member_UserRepository();
......
...@@ -15,7 +15,7 @@ namespace Mall.Module.User ...@@ -15,7 +15,7 @@ namespace Mall.Module.User
/// <summary> /// <summary>
/// 导航图标仓储层对象 /// 导航图标仓储层对象
/// </summary> /// </summary>
private Mall.Repository.User.RB_MiniProgram_NaviconRepository naviconRepository = new Repository.User.RB_MiniProgram_NaviconRepository(); private readonly Repository.User.RB_MiniProgram_NaviconRepository naviconRepository = new Repository.User.RB_MiniProgram_NaviconRepository();
/// <summary> /// <summary>
/// 根据查询条件获取小程序导航图标列表 /// 根据查询条件获取小程序导航图标列表
...@@ -48,8 +48,7 @@ namespace Mall.Module.User ...@@ -48,8 +48,7 @@ namespace Mall.Module.User
/// <returns></returns> /// <returns></returns>
public bool SetMiniProgramNaviconModule(RB_MiniProgram_Navicon_Extend extModel) public bool SetMiniProgramNaviconModule(RB_MiniProgram_Navicon_Extend extModel)
{ {
bool flag = false; bool flag;
if (extModel.NavIconId > 0) if (extModel.NavIconId > 0)
{ {
Dictionary<string, object> fileds = new Dictionary<string, object>() Dictionary<string, object> fileds = new Dictionary<string, object>()
...@@ -78,13 +77,11 @@ namespace Mall.Module.User ...@@ -78,13 +77,11 @@ namespace Mall.Module.User
/// <returns></returns> /// <returns></returns>
public bool RemoveMiniProgramNaviconModule(object NavIconId) public bool RemoveMiniProgramNaviconModule(object NavIconId)
{ {
bool flag = false;
Dictionary<string, object> fileds = new Dictionary<string, object>() Dictionary<string, object> fileds = new Dictionary<string, object>()
{ {
{ nameof(RB_MiniProgram_Navicon_Extend.NavIconStatus),1}, { nameof(RB_MiniProgram_Navicon_Extend.NavIconStatus),1},
}; };
flag = naviconRepository.Update(fileds, new WhereHelper(nameof(RB_MiniProgram_Navicon_Extend.NavIconId), NavIconId)); bool flag = naviconRepository.Update(fileds, new WhereHelper(nameof(RB_MiniProgram_Navicon_Extend.NavIconId), NavIconId));
return flag; return flag;
} }
......
...@@ -60,7 +60,7 @@ namespace Mall.Module.User ...@@ -60,7 +60,7 @@ namespace Mall.Module.User
/// <returns></returns> /// <returns></returns>
public bool SetMiniProgram_Page_Module(RB_MiniProgram_Page_Extend extModel) public bool SetMiniProgram_Page_Module(RB_MiniProgram_Page_Extend extModel)
{ {
bool flag = false; bool flag;
if (extModel.Id > 0) if (extModel.Id > 0)
{ {
Dictionary<string, object> fileds = new Dictionary<string, object>() Dictionary<string, object> fileds = new Dictionary<string, object>()
...@@ -248,12 +248,12 @@ namespace Mall.Module.User ...@@ -248,12 +248,12 @@ namespace Mall.Module.User
/// <returns></returns> /// <returns></returns>
public bool SetMiniprogram_PageManage_Module(RB_Miniprogram_PageManage_Extend extModel) public bool SetMiniprogram_PageManage_Module(RB_Miniprogram_PageManage_Extend extModel)
{ {
bool flag = false;
if (extModel.IsParameter == 0) if (extModel.IsParameter == 0)
{ {
extModel.ParameterValue = ""; extModel.ParameterValue = "";
extModel.TipText = ""; extModel.TipText = "";
} }
bool flag;
if (extModel.PageId > 0) if (extModel.PageId > 0)
{ {
Dictionary<string, object> fileds = new Dictionary<string, object>() Dictionary<string, object> fileds = new Dictionary<string, object>()
...@@ -286,12 +286,11 @@ namespace Mall.Module.User ...@@ -286,12 +286,11 @@ namespace Mall.Module.User
/// <returns></returns> /// <returns></returns>
public bool RemoveMiniprogram_PageManage_Module(object PageId, int Status) public bool RemoveMiniprogram_PageManage_Module(object PageId, int Status)
{ {
bool flag = false;
Dictionary<string, object> fileds = new Dictionary<string, object>() Dictionary<string, object> fileds = new Dictionary<string, object>()
{ {
{ nameof(RB_Miniprogram_PageManage_Extend.Status),Status}, { nameof(RB_Miniprogram_PageManage_Extend.Status),Status},
}; };
flag = miniprogram_PageManageRepository.Update(fileds, new WhereHelper(nameof(RB_Miniprogram_PageManage_Extend.PageId), PageId)); bool flag = miniprogram_PageManageRepository.Update(fileds, new WhereHelper(nameof(RB_Miniprogram_PageManage_Extend.PageId), PageId));
return flag; return flag;
} }
......
...@@ -16,13 +16,13 @@ namespace Mall.Module.User ...@@ -16,13 +16,13 @@ namespace Mall.Module.User
/// <summary> /// <summary>
/// 分销海报仓储层对象 /// 分销海报仓储层对象
/// </summary> /// </summary>
private RB_MiniProgram_FenXiaoPosterRepository fenXiaoPosterRepository = new RB_MiniProgram_FenXiaoPosterRepository(); private readonly RB_MiniProgram_FenXiaoPosterRepository fenXiaoPosterRepository = new RB_MiniProgram_FenXiaoPosterRepository();
/// <summary> /// <summary>
/// 商品分销仓储层对象 /// 商品分销仓储层对象
/// </summary> /// </summary>
private RB_MiniProgram_GoodPosterRepository goodPosterRepository = new RB_MiniProgram_GoodPosterRepository(); private readonly RB_MiniProgram_GoodPosterRepository goodPosterRepository = new RB_MiniProgram_GoodPosterRepository();
/// <summary> /// <summary>
/// 根据查询条件获取分销海报实体 /// 根据查询条件获取分销海报实体
...@@ -41,7 +41,7 @@ namespace Mall.Module.User ...@@ -41,7 +41,7 @@ namespace Mall.Module.User
/// <returns></returns> /// <returns></returns>
public bool SetFenXiaoPosterModule(RB_MiniProgram_FenXiaoPoster_Extend extModel) public bool SetFenXiaoPosterModule(RB_MiniProgram_FenXiaoPoster_Extend extModel)
{ {
bool flag = false; bool flag;
if (extModel.Id > 0) if (extModel.Id > 0)
{ {
Dictionary<string, object> fileds = new Dictionary<string, object>() Dictionary<string, object> fileds = new Dictionary<string, object>()
...@@ -90,7 +90,7 @@ namespace Mall.Module.User ...@@ -90,7 +90,7 @@ namespace Mall.Module.User
/// <returns></returns> /// <returns></returns>
public bool SetGoodPosterModule(RB_MiniProgram_GoodPoster_Extend extModel) public bool SetGoodPosterModule(RB_MiniProgram_GoodPoster_Extend extModel)
{ {
bool flag = false; bool flag;
if (extModel.Id > 0) if (extModel.Id > 0)
{ {
Dictionary<string, object> fileds = new Dictionary<string, object>() Dictionary<string, object> fileds = new Dictionary<string, object>()
......
...@@ -90,7 +90,7 @@ namespace Mall.Module.User ...@@ -90,7 +90,7 @@ namespace Mall.Module.User
/// <summary> /// <summary>
/// 财务单据规则 /// 财务单据规则
/// </summary> /// </summary>
private static RB_Finance_ConfigurineRepository financeConfigurineRepository = new RB_Finance_ConfigurineRepository(); private static readonly RB_Finance_ConfigurineRepository financeConfigurineRepository = new RB_Finance_ConfigurineRepository();
/// <summary> /// <summary>
/// 可简化 /// 可简化
...@@ -215,10 +215,9 @@ namespace Mall.Module.User ...@@ -215,10 +215,9 @@ namespace Mall.Module.User
/// </summary> /// </summary>
/// <param name="smallShopsId"></param> /// <param name="smallShopsId"></param>
/// <param name="commission"></param> /// <param name="commission"></param>
/// <param name="tenantId"></param> /// <param name="empId"></param>
/// <param name="mallBaseId"></param>
/// <returns></returns> /// <returns></returns>
public bool SetSmallShopsCommission(int smallShopsId, decimal commission, int tenantId, int mallBaseId, int empId) public bool SetSmallShopsCommission(int smallShopsId, decimal commission,int empId)
{ {
var model = smallShops_InfoRepository.GetEntity(smallShopsId); var model = smallShops_InfoRepository.GetEntity(smallShopsId);
if (model == null) { return false; } if (model == null) { return false; }
......
...@@ -16,9 +16,9 @@ namespace Mall.Module.User ...@@ -16,9 +16,9 @@ namespace Mall.Module.User
{ {
public class SupplierModule public class SupplierModule
{ {
private RB_SupplierRepository supplierRepository = new RB_SupplierRepository(); private readonly RB_SupplierRepository supplierRepository = new RB_SupplierRepository();
private RB_SupplierCommissionRepository supplierCommissionRepository = new RB_SupplierCommissionRepository(); private readonly RB_SupplierCommissionRepository supplierCommissionRepository = new RB_SupplierCommissionRepository();
private RB_ClientBankAccountRepository clientBankAccountRepository = new RB_ClientBankAccountRepository(); private readonly RB_ClientBankAccountRepository clientBankAccountRepository = new RB_ClientBankAccountRepository();
/// <summary> /// <summary>
/// 分页列表 /// 分页列表
...@@ -216,7 +216,7 @@ namespace Mall.Module.User ...@@ -216,7 +216,7 @@ namespace Mall.Module.User
/// <returns></returns> /// <returns></returns>
public bool RemoveSupplier(int ID, int BankAccountId) public bool RemoveSupplier(int ID, int BankAccountId)
{ {
bool flag = false; bool flag;
try try
{ {
IDictionary<string, object> fileds = new Dictionary<string, object>() IDictionary<string, object> fileds = new Dictionary<string, object>()
......
...@@ -15,7 +15,7 @@ namespace Mall.Module.User ...@@ -15,7 +15,7 @@ namespace Mall.Module.User
/// <summary> /// <summary>
/// 商户仓储层对象 /// 商户仓储层对象
/// </summary> /// </summary>
private Mall.Repository.User.RB_TenantRepository tenantRepository = new Repository.User.RB_TenantRepository(); private readonly Mall.Repository.User.RB_TenantRepository tenantRepository = new Repository.User.RB_TenantRepository();
/// <summary> /// <summary>
...@@ -75,10 +75,9 @@ namespace Mall.Module.User ...@@ -75,10 +75,9 @@ namespace Mall.Module.User
{ {
extModel.Account = extModel.Account.Trim(); extModel.Account = extModel.Account.Trim();
extModel.Password= Common.DES.Encrypt(extModel.Password, Common.Config.WebApiKey, Common.Config.WebApiIV); extModel.Password= Common.DES.Encrypt(extModel.Password, Common.Config.WebApiKey, Common.Config.WebApiIV);
bool flag = false;
int NewId = tenantRepository.Insert(extModel); int NewId = tenantRepository.Insert(extModel);
extModel.TenantId = NewId; extModel.TenantId = NewId;
flag = NewId > 0; bool flag = NewId > 0;
return flag; return flag;
} }
...@@ -129,13 +128,12 @@ namespace Mall.Module.User ...@@ -129,13 +128,12 @@ namespace Mall.Module.User
/// <returns></returns> /// <returns></returns>
public bool UpdateTenantPwdModule(RB_Tenant_Extend extModel) public bool UpdateTenantPwdModule(RB_Tenant_Extend extModel)
{ {
bool flag = false;
extModel.Password = Common.DES.Encrypt(extModel.Password, Common.Config.WebApiKey, Common.Config.WebApiIV); extModel.Password = Common.DES.Encrypt(extModel.Password, Common.Config.WebApiKey, Common.Config.WebApiIV);
Dictionary<string, object> fileds = new Dictionary<string, object>() Dictionary<string, object> fileds = new Dictionary<string, object>()
{ {
{ nameof(RB_Tenant_Extend.Password),extModel.Password}, { nameof(RB_Tenant_Extend.Password),extModel.Password},
}; };
flag = tenantRepository.Update(fileds, new WhereHelper(nameof(RB_Tenant_Extend.MobilePhone), extModel.MobilePhone.Trim())); bool flag = tenantRepository.Update(fileds, new WhereHelper(nameof(RB_Tenant_Extend.MobilePhone), extModel.MobilePhone.Trim()));
return flag; return flag;
} }
...@@ -162,12 +160,11 @@ namespace Mall.Module.User ...@@ -162,12 +160,11 @@ namespace Mall.Module.User
/// <returns></returns> /// <returns></returns>
public bool SetTenantStatusModule(object TenantId, int AccountStatus) public bool SetTenantStatusModule(object TenantId, int AccountStatus)
{ {
bool flag = false;
Dictionary<string, object> fileds = new Dictionary<string, object>() Dictionary<string, object> fileds = new Dictionary<string, object>()
{ {
{ nameof(RB_Tenant_Extend.AccountStatus),AccountStatus}, { nameof(RB_Tenant_Extend.AccountStatus),AccountStatus},
}; };
flag = tenantRepository.Update(fileds, new WhereHelper(nameof(RB_Tenant_Extend.TenantId), TenantId)); bool flag = tenantRepository.Update(fileds, new WhereHelper(nameof(RB_Tenant_Extend.TenantId), TenantId));
return flag; return flag;
} }
} }
......
...@@ -131,40 +131,40 @@ namespace Mall.Module.User ...@@ -131,40 +131,40 @@ namespace Mall.Module.User
/// <summary> /// <summary>
/// 财务单据规则 /// 财务单据规则
/// </summary> /// </summary>
private static RB_Finance_ConfigurineRepository financeConfigurineRepository = new RB_Finance_ConfigurineRepository(); private static readonly RB_Finance_ConfigurineRepository financeConfigurineRepository = new RB_Finance_ConfigurineRepository();
/// <summary> /// <summary>
/// 用户优惠券 /// 用户优惠券
/// </summary> /// </summary>
private RB_Member_CouponRepository memberCouponRepository = new RB_Member_CouponRepository(); private readonly RB_Member_CouponRepository memberCouponRepository = new RB_Member_CouponRepository();
/// <summary> /// <summary>
/// 分销海报仓储层对象 /// 分销海报仓储层对象
/// </summary> /// </summary>
private RB_MiniProgram_FenXiaoPosterRepository fenXiaoPosterRepository = new RB_MiniProgram_FenXiaoPosterRepository(); private readonly RB_MiniProgram_FenXiaoPosterRepository fenXiaoPosterRepository = new RB_MiniProgram_FenXiaoPosterRepository();
/// <summary> /// <summary>
/// 会员购买仓储层 /// 会员购买仓储层
/// </summary> /// </summary>
private RB_Member_BuyRepository memberBuyRepository = new RB_Member_BuyRepository(); private readonly RB_Member_BuyRepository memberBuyRepository = new RB_Member_BuyRepository();
/// <summary> /// <summary>
/// 粉象返佣等级 /// 粉象返佣等级
/// </summary> /// </summary>
private RB_Distributor_FXGradeRepository distributor_FXGradeRepository = new RB_Distributor_FXGradeRepository(); private readonly RB_Distributor_FXGradeRepository distributor_FXGradeRepository = new RB_Distributor_FXGradeRepository();
/// <summary> /// <summary>
/// vip购买返佣 /// vip购买返佣
/// </summary> /// </summary>
private RB_VipBuy_CommissionRepository vipBuy_CommissionRepository = new RB_VipBuy_CommissionRepository(); private readonly RB_VipBuy_CommissionRepository vipBuy_CommissionRepository = new RB_VipBuy_CommissionRepository();
/// <summary> /// <summary>
/// vip购买 /// vip购买
/// </summary> /// </summary>
private RB_Vip_BuyRepository vip_BuyRepository = new RB_Vip_BuyRepository(); private readonly RB_Vip_BuyRepository vip_BuyRepository = new RB_Vip_BuyRepository();
/// <summary> /// <summary>
/// 粉象返佣金额 /// 粉象返佣金额
/// </summary> /// </summary>
private RB_Distributor_FXCommissionRepository distributor_FXCommissionRepository = new RB_Distributor_FXCommissionRepository(); private readonly RB_Distributor_FXCommissionRepository distributor_FXCommissionRepository = new RB_Distributor_FXCommissionRepository();
/// <summary> /// <summary>
/// 分销商日志 /// 分销商日志
/// </summary> /// </summary>
private RB_Distributor_LogRepository distributor_LogRepository = new RB_Distributor_LogRepository(); private readonly RB_Distributor_LogRepository distributor_LogRepository = new RB_Distributor_LogRepository();
/// <summary> /// <summary>
/// 推荐供应商返佣账单 /// 推荐供应商返佣账单
/// </summary> /// </summary>
...@@ -262,8 +262,7 @@ namespace Mall.Module.User ...@@ -262,8 +262,7 @@ namespace Mall.Module.User
/// <returns></returns> /// <returns></returns>
public int AddMemberUserInfo(RB_Member_User_Extend demodel) public int AddMemberUserInfo(RB_Member_User_Extend demodel)
{ {
int result = 0; int result = member_UserRepository.Insert(demodel);
result = member_UserRepository.Insert(demodel);
//result = member_UserRepository.SetMemberUserRepository(demodel); //result = member_UserRepository.SetMemberUserRepository(demodel);
return result; return result;
} }
...@@ -1585,8 +1584,10 @@ namespace Mall.Module.User ...@@ -1585,8 +1584,10 @@ namespace Mall.Module.User
/// <returns></returns> /// <returns></returns>
public bool SetDistributorInfoForFX(int FXGradeId, int UserId, int TenantId, int MallBaseId) public bool SetDistributorInfoForFX(int FXGradeId, int UserId, int TenantId, int MallBaseId)
{ {
var demodel = new RB_Distributor_Info_Extend(); var demodel = new RB_Distributor_Info_Extend
demodel.UserId = UserId; {
UserId = UserId
};
demodel.TotalCommission ??= 0; demodel.TotalCommission ??= 0;
demodel.CommissionWithdrawal ??= 0; demodel.CommissionWithdrawal ??= 0;
demodel.Name ??= ""; demodel.Name ??= "";
...@@ -5332,11 +5333,13 @@ namespace Mall.Module.User ...@@ -5332,11 +5333,13 @@ namespace Mall.Module.User
{ {
return ApiResult.Failed("未查询到普通会员等级"); return ApiResult.Failed("未查询到普通会员等级");
} }
List<string> TitleList = new List<string>(); List<string> TitleList = new List<string>
TitleList.Add("等级名称"); {
TitleList.Add("级别标准"); "等级名称",
TitleList.Add(pModel.GradeName); "级别标准",
TitleList.Add("间接普会"); pModel.GradeName,
"间接普会"
};
foreach (var item in list) foreach (var item in list)
{ {
if (item.Id != pModel.Id) if (item.Id != pModel.Id)
...@@ -5347,9 +5350,11 @@ namespace Mall.Module.User ...@@ -5347,9 +5350,11 @@ namespace Mall.Module.User
List<object> ContenList = new List<object>(); List<object> ContenList = new List<object>();
foreach (var item in list) foreach (var item in list)
{ {
List<string> itemList = new List<string>(); List<string> itemList = new List<string>
itemList.Add(item.GradeName); {
itemList.Add((item.CommissionRatio ?? 0).ToString() + "%"); item.GradeName,
(item.CommissionRatio ?? 0).ToString() + "%"
};
foreach (var qitem in list) foreach (var qitem in list)
{ {
if (qitem.Id == pModel.Id) if (qitem.Id == pModel.Id)
...@@ -6192,7 +6197,6 @@ namespace Mall.Module.User ...@@ -6192,7 +6197,6 @@ namespace Mall.Module.User
/// <returns></returns> /// <returns></returns>
public bool UpdateMemberBuy(int UserId, int OrderId, string Out_Trade_No, string Transaction_Id, Common.Enum.Goods.OrderPayTypeEnum PayWay, decimal Money, DateTime Time_End) public bool UpdateMemberBuy(int UserId, int OrderId, string Out_Trade_No, string Transaction_Id, Common.Enum.Goods.OrderPayTypeEnum PayWay, decimal Money, DateTime Time_End)
{ {
bool flag = false;
var umodel = member_UserRepository.GetEntity(UserId); var umodel = member_UserRepository.GetEntity(UserId);
if (umodel == null) if (umodel == null)
{ {
...@@ -6214,6 +6218,7 @@ namespace Mall.Module.User ...@@ -6214,6 +6218,7 @@ namespace Mall.Module.User
} }
var trans = memberBuyRepository.DbTransaction; var trans = memberBuyRepository.DbTransaction;
bool flag;
try try
{ {
......
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