Commit dc27e7bb authored by 黄奎's avatar 黄奎

新增页面

parent 74f323a0
using Edu.Common.Enum;
using System;
using System.Collections.Generic;
using System.Text;
using VT.FW.DB;
namespace Edu.Model.Entity.Course
{
/// <summary>
/// 课程分类实体类
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_Course_Category
{
/// <summary>
/// 主键(课程分类编号)
/// </summary>
public int CateId { get; set; }
/// <summary>
/// 父级编号
/// </summary>
public int ParentId { get; set; }
/// <summary>
/// 课程分类名称
/// </summary>
public string CateName { get; set; }
/// <summary>
/// 排序
/// </summary>
public int SortNum { get; set; }
/// <summary>
/// 删除状态
/// </summary>
public DateStateEnum Status { get; set; }
/// <summary>
/// 创建人
/// </summary>
public int CreateBy { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime CreateTime { get; set; }
/// <summary>
/// 修改人
/// </summary>
public int UpdateBy { get; set; }
/// <summary>
/// 更新时间
/// </summary>
public DateTime UpdateTime { get; set; }
/// <summary>
/// 集团编号
/// </summary>
public int Group_Id { get; set; }
/// <summary>
/// 学校Id
/// </summary>
public int School_Id { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Text;
using VT.FW.DB;
namespace Edu.Model.ViewModel.Course
{
/// <summary>
/// 课程分类视图实体类
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_Course_Category_ViewModel : Model.Entity.Course.RB_Course_Category
{
/// <summary>
/// 创建人
/// </summary>
public string CreateByName { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public string CreateTimeStr
{
get
{
return Common.ConvertHelper.FormatTime(this.CreateTime);
}
}
/// <summary>
/// 修改人
/// </summary>
public string UpdateByName { get; set; }
/// <summary>
/// 更新时间
/// </summary>
public string UpdateTimeStr
{
get
{
return Common.ConvertHelper.FormatTime(this.UpdateTime);
}
}
}
}
\ No newline at end of file
using Edu.Common.Enum;
using Edu.Model.ViewModel.Course;
using Edu.Repository.Course;
using System;
using System.Collections.Generic;
using System.Text;
using VT.FW.DB;
namespace Edu.Module.Course
{
/// <summary>
/// 课程分类处理类
/// </summary>
public class CourseCategoryModule
{
/// <summary>
/// 课程分类仓储对象
/// </summary>
private readonly RB_Course_CategoryRepository categoryRepository = new RB_Course_CategoryRepository();
/// <summary>
/// 获取课程分类列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Course_Category_ViewModel> GetCourseCategoryListModule(RB_Course_Category_ViewModel query)
{
return categoryRepository.GetCourseCategoryListRepository(query);
}
/// <summary>
/// 获取课程分类分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Course_Category_ViewModel> GetCourseCategoryPageListModule(int pageIndex, int pageSize, out long rowsCount, RB_Course_Category_ViewModel query)
{
return categoryRepository.GetCourseCategoryPageListRepository(pageIndex, pageSize, out rowsCount, query);
}
/// <summary>
/// 根据分类编号获取课程分类实体
/// </summary>
/// <param name="CateId"></param>
/// <returns></returns>
public RB_Course_Category_ViewModel GetCourseCategoryModule(object CateId)
{
return categoryRepository.GetEntity<RB_Course_Category_ViewModel>(CateId);
}
/// <summary>
/// 新增修改课程分类
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public bool SetCourseCategoryModule(RB_Course_Category_ViewModel model)
{
bool flag;
if (model.CateId > 0)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Course_Category_ViewModel.ParentId),model.ParentId },
{nameof(RB_Course_Category_ViewModel.CateName),model.CateName.Trim() },
{nameof(RB_Course_Category_ViewModel.SortNum),model.SortNum },
};
flag = categoryRepository.Update(fileds, new WhereHelper(nameof(RB_Course_Category_ViewModel.CateId), model.CateId));
}
else
{
var newId = categoryRepository.Insert(model);
model.CateId = newId;
flag = newId > 0;
}
return flag;
}
/// <summary>
/// 根据分类编号删除课程分类
/// </summary>
/// <param name="CateId"></param>
/// <returns></returns>
public bool RemoveCourseCategoryModule(int CateId)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Course_Category_ViewModel.Status),(int)DateStateEnum.Delete },
};
bool flag = categoryRepository.Update(fileds, new WhereHelper(nameof(RB_Course_Category_ViewModel.CateId), CateId));
return flag;
}
}
}
\ No newline at end of file
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
</PropertyGroup>
</Project>
......@@ -58,7 +58,7 @@ namespace Edu.Module.User
/// <returns></returns>
public bool SetAssistModule(RB_Assist model)
{
bool flag = false;
bool flag;
if (model.AId > 0)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
......@@ -101,12 +101,11 @@ namespace Edu.Module.User
/// <returns></returns>
public bool RemoveAssistModule(object AId)
{
bool flag = false;
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Assist.Status),(int)DateStateEnum.Delete },
};
flag = assistRepository.Update(fileds, new WhereHelper(nameof(RB_Assist.AId), AId));
bool flag = assistRepository.Update(fileds, new WhereHelper(nameof(RB_Assist.AId), AId));
return flag;
}
......
using Edu.Common.Enum;
using Edu.Model.ViewModel.Course;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using VT.FW.DB.Dapper;
namespace Edu.Repository.Course
{
/// <summary>
/// 课程分类仓储层
/// </summary>
public class RB_Course_CategoryRepository : BaseRepository<Model.Entity.Course.RB_Course_Category>
{
/// <summary>
/// 获取课程分类列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Course_Category_ViewModel> GetCourseCategoryListRepository(RB_Course_Category_ViewModel query)
{
StringBuilder builder = new StringBuilder();
var parameters = new DynamicParameters();
builder.AppendFormat(@"
SELECT *
FROM RB_Course_Category
WHERE 1=1
");
builder.AppendFormat(" AND {0}={1} ", nameof(RB_Course_Category_ViewModel.Status), (int)DateStateEnum.Normal);
if (query != null)
{
if (query.Group_Id > 0)
{
builder.AppendFormat(" AND {0}={1} ", nameof(RB_Course_Category_ViewModel.Group_Id),query.Group_Id);
}
if (query.School_Id > 0)
{
builder.AppendFormat(" AND {0}={1} ", nameof(RB_Course_Category_ViewModel.School_Id), query.School_Id);
}
if (query.CateId > 0)
{
builder.AppendFormat(" AND {0}={1} ", nameof(RB_Course_Category_ViewModel.CateId), query.CateId);
}
if (!string.IsNullOrWhiteSpace(query.CateName))
{
builder.AppendFormat(" AND {0} LIKE @CateName ", nameof(RB_Course_Category_ViewModel.CateName));
parameters.Add("CateName", "%" + query.CateName.Trim() + "%");
}
if (query.ParentId > 0)
{
builder.AppendFormat(" AND {0}={1} ", nameof(RB_Course_Category_ViewModel.ParentId), query.ParentId);
}
}
return Get<RB_Course_Category_ViewModel>(builder.ToString(), parameters).ToList();
}
/// <summary>
/// 获取课程分类分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Course_Category_ViewModel> GetCourseCategoryPageListRepository(int pageIndex,int pageSize,out long rowsCount,RB_Course_Category_ViewModel query)
{
StringBuilder builder = new StringBuilder();
var parameters = new DynamicParameters();
builder.AppendFormat(@"
SELECT *
FROM RB_Course_Category
WHERE 1=1
");
builder.AppendFormat(" AND {0}={1} ", nameof(RB_Course_Category_ViewModel.Status), (int)DateStateEnum.Normal);
if (query != null)
{
if (query.Group_Id > 0)
{
builder.AppendFormat(" AND {0}={1} ", nameof(RB_Course_Category_ViewModel.Group_Id), query.Group_Id);
}
if (query.School_Id > 0)
{
builder.AppendFormat(" AND {0}={1} ", nameof(RB_Course_Category_ViewModel.School_Id), query.School_Id);
}
if (query.CateId > 0)
{
builder.AppendFormat(" AND {0}={1} ", nameof(RB_Course_Category_ViewModel.CateId), query.CateId);
}
if (!string.IsNullOrWhiteSpace(query.CateName))
{
builder.AppendFormat(" AND {0} LIKE @CateName ", nameof(RB_Course_Category_ViewModel.CateName));
parameters.Add("CateName", "%" + query.CateName.Trim() + "%");
}
if (query.ParentId > 0)
{
builder.AppendFormat(" AND {0}={1} ", nameof(RB_Course_Category_ViewModel.ParentId), query.ParentId);
}
}
return GetPage<RB_Course_Category_ViewModel>(pageIndex,pageSize,out rowsCount,builder.ToString(), parameters).ToList();
}
}
}
\ No newline at end of file
......@@ -4,6 +4,7 @@ using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using VT.FW.DB.Dapper;
namespace Edu.Repository.System
{
......@@ -19,6 +20,7 @@ namespace Edu.Repository.System
public List<RB_Destination_ViewModel> GetDestinationListRepository(RB_Destination_ViewModel query)
{
StringBuilder sb = new StringBuilder();
var parameters = new DynamicParameters();
sb.AppendFormat("SELECT * FROM rb_destination WHERE 1=1 ");
sb.AppendFormat(" AND {0}={1} ", nameof(RB_Destination_ViewModel.Status), (int)Common.Enum.DateStateEnum.Normal);
if (query != null)
......@@ -33,7 +35,8 @@ namespace Edu.Repository.System
}
if (!string.IsNullOrWhiteSpace(query.Name))
{
sb.AppendFormat(" AND {0} LIKE '%{1}%' ", nameof(RB_Destination_ViewModel.Name), query.Name.Trim());
sb.AppendFormat(" AND {0} LIKE @Name ", nameof(RB_Destination_ViewModel.Name));
parameters.Add("Name", "%" + query.Name.Trim() + "%");
}
if (!string.IsNullOrWhiteSpace(query.NameStr))
{
......@@ -48,7 +51,7 @@ namespace Edu.Repository.System
sb.AppendFormat(" AND {0} in({1})", nameof(RB_Destination_ViewModel.ID), query.Ids);
}
}
return Get<RB_Destination_ViewModel>(sb.ToString()).ToList();
return Get<RB_Destination_ViewModel>(sb.ToString(), parameters).ToList();
}
}
}
\ No newline at end of file
......@@ -127,8 +127,6 @@ namespace Edu.WebApi.Controllers.Public
var flag = menuModule.SetMenuStatusModule(MenuId, Status);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
#endregion
#region 角色管理
......
......@@ -111,10 +111,9 @@ namespace Edu.WebApi.Controllers.User
{
Common.Plugin.LogHelper.Write(ex, "GetUserInfo");
}
object obj = new object();
if (Uid > 0)
{
obj = UserReidsCache.GetUserLoginInfo(Uid);
object obj = UserReidsCache.GetUserLoginInfo(Uid);
return ApiResult.Success(data: obj);
}
else
......
......@@ -23,7 +23,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Edu.Module.User", "Edu.Modu
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Edu.WebApi", "Edu.WebApi\Edu.WebApi.csproj", "{878A03A7-2571-4322-A55E-39A5105296A9}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Edu.Module.System", "Edu.Module.System\Edu.Module.System.csproj", "{CBA4F637-BB41-4281-BCE8-4BB9BBA3193F}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Edu.Module.System", "Edu.Module.System\Edu.Module.System.csproj", "{CBA4F637-BB41-4281-BCE8-4BB9BBA3193F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Edu.Module.Course", "Edu.Module.Course\Edu.Module.Course.csproj", "{3B21886D-A9E1-4C74-85B4-7740935AF791}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
......@@ -63,6 +65,10 @@ Global
{CBA4F637-BB41-4281-BCE8-4BB9BBA3193F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CBA4F637-BB41-4281-BCE8-4BB9BBA3193F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CBA4F637-BB41-4281-BCE8-4BB9BBA3193F}.Release|Any CPU.Build.0 = Release|Any CPU
{3B21886D-A9E1-4C74-85B4-7740935AF791}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3B21886D-A9E1-4C74-85B4-7740935AF791}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3B21886D-A9E1-4C74-85B4-7740935AF791}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3B21886D-A9E1-4C74-85B4-7740935AF791}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
......@@ -75,6 +81,7 @@ Global
{539496B1-1377-46AD-A1AB-4473818D6A79} = {94CECEE0-E28C-424A-9C8E-8AAE9E4967BD}
{1B9D7825-26A9-4F81-B04C-2261CB1F954A} = {7AC0A4EC-3215-4FF2-96DC-DE8325ED6915}
{CBA4F637-BB41-4281-BCE8-4BB9BBA3193F} = {7AC0A4EC-3215-4FF2-96DC-DE8325ED6915}
{3B21886D-A9E1-4C74-85B4-7740935AF791} = {7AC0A4EC-3215-4FF2-96DC-DE8325ED6915}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {8763B446-FAB1-46BF-9743-F2628533241B}
......
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