Commit 3d529c43 authored by 黄奎's avatar 黄奎

页面修改

parent 13ce3158
......@@ -86,7 +86,7 @@ namespace Edu.Common.API
/// <summary>
/// 总条数
/// </summary>
public int Count { get; set; }
public long Count { get; set; }
/// <summary>
/// 分页数
......
using Newtonsoft.Json.Converters;
namespace Edu.Common.Plugin
{
/// <summary>
/// 格式化时间【yyyy-MM-dd HH:mm:ss】
/// </summary>
public class DateConvert : IsoDateTimeConverter
{
/// <summary>
/// 格式化时间
/// </summary>
public DateConvert()
{
base.DateTimeFormat = "yyyy-MM-dd HH:mm:ss";
}
}
/// <summary>
/// 格式化日期【yyyy-MM-dd】
/// </summary>
public class DateConvertTwo : IsoDateTimeConverter
{
/// <summary>
/// 格式化时间
/// </summary>
public DateConvertTwo()
{
base.DateTimeFormat = "yyyy-MM-dd";
}
}
}
......@@ -9,5 +9,44 @@ namespace Edu.Model.CacheModel
/// </summary>
public class UserInfo
{
/// <summary>
/// 集团编号
/// </summary>
public int Group_Id { get; set; }
/// <summary>
/// 学校编号
/// </summary>
public int School_Id { get; set; }
/// <summary>
/// 教师编号
/// </summary>
public int TeacherId { get; set; }
/// <summary>
/// 教师姓名
/// </summary>
public string TeacherName { get; set; }
/// <summary>
/// 助教编号
/// </summary>
public int AssitId { get; set; }
/// <summary>
/// 助教名称
/// </summary>
public string AssitName { get; set; }
/// <summary>
/// 学生Id
/// </summary>
public int StuId { get; set; }
/// <summary>
/// 学生名称
/// </summary>
public string StuName { get; set; }
}
}
using Edu.Common.Enum;
using Edu.Common.Plugin;
using Newtonsoft.Json;
using System;
using VT.FW.DB;
......@@ -69,6 +71,7 @@ namespace Edu.Model.Entity.User
/// <summary>
/// 创建时间
/// </summary>
[JsonConverter(typeof(DateConvert))]
public DateTime CreateTime { get; set; }
/// <summary>
......@@ -79,6 +82,7 @@ namespace Edu.Model.Entity.User
/// <summary>
/// 更新时间
/// </summary>
[JsonConverter(typeof(DateConvert))]
public DateTime UpdateTime { get; set; }
}
}
\ No newline at end of file
......@@ -7,6 +7,7 @@ namespace Edu.Model.ViewModel.User
/// <summary>
/// 助教视图实体类
/// </summary>
[Serializable]
public class RB_Assist_ViewModel : Model.Entity.User.RB_Assist
{
/// <summary>
......
......@@ -7,6 +7,7 @@ namespace Edu.Model.ViewModel.User
/// <summary>
/// 集团视图实体
/// </summary>
[Serializable]
public class RB_Group_ViewModel : Model.Entity.User.RB_Group
{
......
......@@ -7,6 +7,7 @@ namespace Edu.Model.ViewModel.User
/// <summary>
/// 学校校区视图实体类
/// </summary>
[Serializable]
public class RB_School_ViewModel : Model.Entity.User.RB_School
{
/// <summary>
......
......@@ -7,6 +7,7 @@ namespace Edu.Model.ViewModel.User
/// <summary>
/// 学生视图实体类
/// </summary>
[Serializable]
public class RB_Student_ViewModel : Model.Entity.User.RB_Student
{
}
......
......@@ -7,6 +7,7 @@ namespace Edu.Model.ViewModel.User
/// <summary>
/// 教师视图实体类
/// </summary>
[Serializable]
public class RB_Teacher_ViewModel : Model.Entity.User.RB_Teacher
{
/// <summary>
......
......@@ -31,17 +31,17 @@ WHERE 1=1
builder.AppendFormat(" AND a.{0}={1} ", nameof(RB_Assist_ViewModel.Status), (int)DateStateEnum.Normal);
if (query != null)
{
if (!string.IsNullOrWhiteSpace(query.AssistName.Trim()))
if (!string.IsNullOrWhiteSpace(query.AssistName))
{
builder.AppendFormat(" AND a.{0} LIKE @AssistName ", nameof(RB_Assist_ViewModel.AssistName));
parameters.Add("AssistName", "%" + query.AssistName.Trim() + "%");
}
if (!string.IsNullOrWhiteSpace(query.AssistTel.Trim()))
if (!string.IsNullOrWhiteSpace(query.AssistTel))
{
builder.AppendFormat(" AND a.{0} LIKE @AssistTel ", nameof(RB_Assist_ViewModel.AssistTel));
parameters.Add("AssistTel", "%" + query.AssistTel.Trim() + "%");
}
if (!string.IsNullOrWhiteSpace(query.AssistIntro.Trim()))
if (!string.IsNullOrWhiteSpace(query.AssistIntro))
{
builder.AppendFormat(" AND a.{0} LIKE @AssistIntro ", nameof(RB_Assist_ViewModel.AssistIntro));
parameters.Add("AssistIntro", "%" + query.AssistIntro.Trim() + "%");
......@@ -88,17 +88,17 @@ WHERE 1=1
builder.AppendFormat(" AND a.{0}={1} ", nameof(RB_Assist_ViewModel.Status), (int)DateStateEnum.Normal);
if (query != null)
{
if (!string.IsNullOrWhiteSpace(query.AssistName.Trim()))
if (!string.IsNullOrWhiteSpace(query.AssistName))
{
builder.AppendFormat(" AND a.{0} LIKE @AssistName ", nameof(RB_Assist_ViewModel.AssistName));
parameters.Add("AssistName", "%" + query.AssistName.Trim() + "%");
}
if (!string.IsNullOrWhiteSpace(query.AssistTel.Trim()))
if (!string.IsNullOrWhiteSpace(query.AssistTel))
{
builder.AppendFormat(" AND a.{0} LIKE @AssistTel ", nameof(RB_Assist_ViewModel.AssistTel));
parameters.Add("AssistTel", "%" + query.AssistTel.Trim() + "%");
}
if (!string.IsNullOrWhiteSpace(query.AssistIntro.Trim()))
if (!string.IsNullOrWhiteSpace(query.AssistIntro))
{
builder.AppendFormat(" AND a.{0} LIKE @AssistIntro ", nameof(RB_Assist_ViewModel.AssistIntro));
parameters.Add("AssistIntro", "%" + query.AssistIntro.Trim() + "%");
......
......@@ -30,27 +30,27 @@ WHERE 1=1
builder.AppendFormat(" AND {0}={1} ", nameof(RB_Group_ViewModel.Status), (int)DateStateEnum.Normal);
if (query != null)
{
if (!string.IsNullOrWhiteSpace(query.GroupName.Trim()))
if (!string.IsNullOrWhiteSpace(query.GroupName))
{
builder.AppendFormat(" AND {0} LIKE @GroupName ", nameof(RB_Group_ViewModel.GroupName));
parameters.Add("GroupName", "%" + query.GroupName.Trim() + "%");
}
if (!string.IsNullOrWhiteSpace(query.LinkMan.Trim()))
if (!string.IsNullOrWhiteSpace(query.LinkMan))
{
builder.AppendFormat(" AND {0} LIKE @LinkMan ", nameof(RB_Group_ViewModel.LinkMan));
parameters.Add("LinkMan", "%" + query.LinkMan.Trim() + "%");
}
if (!string.IsNullOrWhiteSpace(query.MobilePhone.Trim()))
if (!string.IsNullOrWhiteSpace(query.MobilePhone))
{
builder.AppendFormat(" AND {0} LIKE @MobilePhone ", nameof(RB_Group_ViewModel.MobilePhone));
parameters.Add("MobilePhone", "%" + query.MobilePhone.Trim() + "%");
}
if (!string.IsNullOrWhiteSpace(query.Tel.Trim()))
if (!string.IsNullOrWhiteSpace(query.Tel))
{
builder.AppendFormat(" AND {0} LIKE @Tel ", nameof(RB_Group_ViewModel.Tel));
parameters.Add("Tel", "%" + query.Tel.Trim() + "%");
}
if (!string.IsNullOrWhiteSpace(query.Remarks.Trim()))
if (!string.IsNullOrWhiteSpace(query.Remarks))
{
builder.AppendFormat(" AND {0} LIKE @Remarks ", nameof(RB_Group_ViewModel.Remarks));
parameters.Add("Remarks", "%" + query.Remarks.Trim() + "%");
......@@ -83,27 +83,27 @@ WHERE 1=1
builder.AppendFormat(" AND {0}={1} ", nameof(RB_Group_ViewModel.Status), (int)DateStateEnum.Normal);
if (query != null)
{
if (!string.IsNullOrWhiteSpace(query.GroupName.Trim()))
if (!string.IsNullOrWhiteSpace(query.GroupName))
{
builder.AppendFormat(" AND {0} LIKE @GroupName ", nameof(RB_Group_ViewModel.GroupName));
parameters.Add("GroupName", "%" + query.GroupName.Trim() + "%");
}
if (!string.IsNullOrWhiteSpace(query.LinkMan.Trim()))
if (!string.IsNullOrWhiteSpace(query.LinkMan))
{
builder.AppendFormat(" AND {0} LIKE @LinkMan ", nameof(RB_Group_ViewModel.LinkMan));
parameters.Add("LinkMan", "%" + query.LinkMan.Trim() + "%");
}
if (!string.IsNullOrWhiteSpace(query.MobilePhone.Trim()))
if (!string.IsNullOrWhiteSpace(query.MobilePhone))
{
builder.AppendFormat(" AND {0} LIKE @MobilePhone ", nameof(RB_Group_ViewModel.MobilePhone));
parameters.Add("MobilePhone", "%" + query.MobilePhone.Trim() + "%");
}
if (!string.IsNullOrWhiteSpace(query.Tel.Trim()))
if (!string.IsNullOrWhiteSpace(query.Tel))
{
builder.AppendFormat(" AND {0} LIKE @Tel ", nameof(RB_Group_ViewModel.Tel));
parameters.Add("Tel", "%" + query.Tel.Trim() + "%");
}
if (!string.IsNullOrWhiteSpace(query.Remarks.Trim()))
if (!string.IsNullOrWhiteSpace(query.Remarks))
{
builder.AppendFormat(" AND {0} LIKE @Remarks ", nameof(RB_Group_ViewModel.Remarks));
parameters.Add("Remarks", "%" + query.Remarks.Trim() + "%");
......
......@@ -30,32 +30,32 @@ WHERE 1=1
builder.AppendFormat(" AND s.{0}={1} ", nameof(RB_School_ViewModel.Status), (int)DateStateEnum.Normal);
if (query != null)
{
if (!string.IsNullOrWhiteSpace(query.SName.Trim()))
if (!string.IsNullOrWhiteSpace(query.SName))
{
builder.AppendFormat(" AND s.{0} LIKE @SName ", nameof(RB_School_ViewModel.SName));
parameters.Add("SName", "%" + query.SName.Trim() + "%");
}
if (!string.IsNullOrWhiteSpace(query.SAddress.Trim()))
if (!string.IsNullOrWhiteSpace(query.SAddress))
{
builder.AppendFormat(" AND s.{0} LIKE @SAddress ", nameof(RB_School_ViewModel.SAddress));
parameters.Add("SAddress", "%" + query.SAddress.Trim() + "%");
}
if (!string.IsNullOrWhiteSpace(query.SLinkMan.Trim()))
if (!string.IsNullOrWhiteSpace(query.SLinkMan))
{
builder.AppendFormat(" AND s.{0} LIKE @SLinkMan ", nameof(RB_School_ViewModel.SLinkMan));
parameters.Add("SLinkMan", "%" + query.SLinkMan.Trim() + "%");
}
if (!string.IsNullOrWhiteSpace(query.SLinkTel.Trim()))
if (!string.IsNullOrWhiteSpace(query.SLinkTel))
{
builder.AppendFormat(" AND s.{0} LIKE @SLinkTel ", nameof(RB_School_ViewModel.SLinkTel));
parameters.Add("SLinkTel", "%" + query.SLinkTel.Trim() + "%");
}
if (!string.IsNullOrWhiteSpace(query.SDomain.Trim()))
if (!string.IsNullOrWhiteSpace(query.SDomain))
{
builder.AppendFormat(" AND s.{0} LIKE @SDomain ", nameof(RB_School_ViewModel.SDomain));
parameters.Add("SDomain", "%" + query.SDomain.Trim() + "%");
}
if (!string.IsNullOrWhiteSpace(query.Remark.Trim()))
if (!string.IsNullOrWhiteSpace(query.Remark))
{
builder.AppendFormat(" AND s.{0} LIKE @Remark ", nameof(RB_School_ViewModel.Remark));
parameters.Add("Remark", "%" + query.Remark.Trim() + "%");
......@@ -92,32 +92,32 @@ WHERE 1=1
builder.AppendFormat(" AND s.{0}={1} ", nameof(RB_School_ViewModel.Status), (int)DateStateEnum.Normal);
if (query != null)
{
if (!string.IsNullOrWhiteSpace(query.SName.Trim()))
if (!string.IsNullOrWhiteSpace(query.SName))
{
builder.AppendFormat(" AND s.{0} LIKE @SName ", nameof(RB_School_ViewModel.SName));
parameters.Add("SName", "%" + query.SName.Trim() + "%");
}
if (!string.IsNullOrWhiteSpace(query.SAddress.Trim()))
if (!string.IsNullOrWhiteSpace(query.SAddress))
{
builder.AppendFormat(" AND s.{0} LIKE @SAddress ", nameof(RB_School_ViewModel.SAddress));
parameters.Add("SAddress", "%" + query.SAddress.Trim() + "%");
}
if (!string.IsNullOrWhiteSpace(query.SLinkMan.Trim()))
if (!string.IsNullOrWhiteSpace(query.SLinkMan))
{
builder.AppendFormat(" AND s.{0} LIKE @SLinkMan ", nameof(RB_School_ViewModel.SLinkMan));
parameters.Add("SLinkMan", "%" + query.SLinkMan.Trim() + "%");
}
if (!string.IsNullOrWhiteSpace(query.SLinkTel.Trim()))
if (!string.IsNullOrWhiteSpace(query.SLinkTel))
{
builder.AppendFormat(" AND s.{0} LIKE @SLinkTel ", nameof(RB_School_ViewModel.SLinkTel));
parameters.Add("SLinkTel", "%" + query.SLinkTel.Trim() + "%");
}
if (!string.IsNullOrWhiteSpace(query.SDomain.Trim()))
if (!string.IsNullOrWhiteSpace(query.SDomain))
{
builder.AppendFormat(" AND s.{0} LIKE @SDomain ", nameof(RB_School_ViewModel.SDomain));
parameters.Add("SDomain", "%" + query.SDomain.Trim() + "%");
}
if (!string.IsNullOrWhiteSpace(query.Remark.Trim()))
if (!string.IsNullOrWhiteSpace(query.Remark))
{
builder.AppendFormat(" AND s.{0} LIKE @Remark ", nameof(RB_School_ViewModel.Remark));
parameters.Add("Remark", "%" + query.Remark.Trim() + "%");
......
......@@ -39,12 +39,12 @@ WHERE 1=1
{
builder.AppendFormat(" AND t.{0}={1} ", nameof(RB_Student_ViewModel.School_Id), query.School_Id);
}
if (!string.IsNullOrWhiteSpace(query.StuName.Trim()))
if (!string.IsNullOrWhiteSpace(query.StuName))
{
builder.AppendFormat(" AND t.{0} LIKE @StuName ", nameof(RB_Student_ViewModel.StuName));
parameters.Add("StuName", "%" + query.StuName.Trim() + "%");
}
if (!string.IsNullOrWhiteSpace(query.StuTel.Trim()))
if (!string.IsNullOrWhiteSpace(query.StuTel))
{
builder.AppendFormat(" AND t.{0} LIKE @StuTel ", nameof(RB_Student_ViewModel.StuTel));
parameters.Add("StuTel", "%" + query.StuTel.Trim() + "%");
......@@ -94,12 +94,12 @@ WHERE 1=1
{
builder.AppendFormat(" AND t.{0}={1} ", nameof(RB_Student_ViewModel.School_Id), query.School_Id);
}
if (!string.IsNullOrWhiteSpace(query.StuName.Trim()))
if (!string.IsNullOrWhiteSpace(query.StuName))
{
builder.AppendFormat(" AND t.{0} LIKE @StuName ", nameof(RB_Student_ViewModel.StuName));
parameters.Add("StuName", "%" + query.StuName.Trim() + "%");
}
if (!string.IsNullOrWhiteSpace(query.StuTel.Trim()))
if (!string.IsNullOrWhiteSpace(query.StuTel))
{
builder.AppendFormat(" AND t.{0} LIKE @StuTel ", nameof(RB_Student_ViewModel.StuTel));
parameters.Add("StuTel", "%" + query.StuTel.Trim() + "%");
......
......@@ -39,24 +39,24 @@ WHERE 1=1
{
builder.AppendFormat(" AND t.{0}={1} ", nameof(RB_Teacher_ViewModel.School_Id), query.School_Id);
}
if (!string.IsNullOrWhiteSpace(query.TeacherName.Trim()))
if (!string.IsNullOrWhiteSpace(query.TeacherName))
{
builder.AppendFormat(" AND t.{0} LIKE @TeacherName ", nameof(RB_Teacher_ViewModel.TeacherName));
parameters.Add("TeacherName", "%" + query.TeacherName.Trim() + "%");
}
if (!string.IsNullOrWhiteSpace(query.TeacherTel.Trim()))
if (!string.IsNullOrWhiteSpace(query.TeacherTel))
{
builder.AppendFormat(" AND t.{0} LIKE @TeacherTel ", nameof(RB_Teacher_ViewModel.TeacherTel));
parameters.Add("TeacherTel", "%" + query.TeacherName.Trim() + "%");
parameters.Add("TeacherTel", "%" + query.TeacherTel.Trim() + "%");
}
if (!string.IsNullOrWhiteSpace(query.TeacherSay.Trim()))
if (!string.IsNullOrWhiteSpace(query.TeacherSay))
{
builder.AppendFormat(" AND t.{0} LIKE @TeacherSay ", nameof(RB_Teacher_ViewModel.TeacherSay));
parameters.Add("TeacherSay", "%" + query.TeacherSay.Trim() + "%");
}
if (!string.IsNullOrWhiteSpace(query.TeacherIntro.Trim()))
if (!string.IsNullOrWhiteSpace(query.TeacherIntro))
{
builder.AppendFormat(" AND t.{0} LIKE @TeacherSay ", nameof(RB_Teacher_ViewModel.TeacherIntro));
builder.AppendFormat(" AND t.{0} LIKE @TeacherIntro ", nameof(RB_Teacher_ViewModel.TeacherIntro));
parameters.Add("TeacherIntro", "%" + query.TeacherIntro.Trim() + "%");
}
......@@ -98,24 +98,24 @@ WHERE 1=1
{
builder.AppendFormat(" AND t.{0}={1} ", nameof(RB_Teacher_ViewModel.School_Id), query.School_Id);
}
if (!string.IsNullOrWhiteSpace(query.TeacherName.Trim()))
if (!string.IsNullOrWhiteSpace(query.TeacherName))
{
builder.AppendFormat(" AND t.{0} LIKE @TeacherName ", nameof(RB_Teacher_ViewModel.TeacherName));
parameters.Add("TeacherName", "%" + query.TeacherName.Trim() + "%");
}
if (!string.IsNullOrWhiteSpace(query.TeacherTel.Trim()))
if (!string.IsNullOrWhiteSpace(query.TeacherTel))
{
builder.AppendFormat(" AND t.{0} LIKE @TeacherTel ", nameof(RB_Teacher_ViewModel.TeacherTel));
parameters.Add("TeacherTel", "%" + query.TeacherName.Trim() + "%");
parameters.Add("TeacherTel", "%" + query.TeacherTel.Trim() + "%");
}
if (!string.IsNullOrWhiteSpace(query.TeacherSay.Trim()))
if (!string.IsNullOrWhiteSpace(query.TeacherSay))
{
builder.AppendFormat(" AND t.{0} LIKE @TeacherSay ", nameof(RB_Teacher_ViewModel.TeacherSay));
parameters.Add("TeacherSay", "%" + query.TeacherSay.Trim() + "%");
}
if (!string.IsNullOrWhiteSpace(query.TeacherIntro.Trim()))
if (!string.IsNullOrWhiteSpace(query.TeacherIntro))
{
builder.AppendFormat(" AND t.{0} LIKE @TeacherSay ", nameof(RB_Teacher_ViewModel.TeacherIntro));
builder.AppendFormat(" AND t.{0} LIKE @TeacherIntro ", nameof(RB_Teacher_ViewModel.TeacherIntro));
parameters.Add("TeacherIntro", "%" + query.TeacherIntro.Trim() + "%");
}
......
......@@ -3,7 +3,10 @@ using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Edu.Common.API;
using Edu.Model.ViewModel.User;
using Edu.Module.User;
using Edu.WebApi.Filter;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Cors;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
......@@ -16,9 +19,74 @@ namespace Edu.WebApi.Controllers.User
[EnableCors("AllowCors")]
public class UserController : BaseController
{
public ApiResult Test()
/// <summary>
/// 助教处理类对象
/// </summary>
private readonly AssistModule assistModule = new AssistModule();
/// <summary>
/// 集团处理类对象
/// </summary>
private readonly GroupModule groupModule = new GroupModule();
/// <summary>
/// 学校处理类对象
/// </summary>
private readonly SchoolModule schoolModule = new SchoolModule();
/// <summary>
/// 学生处理类对象
/// </summary>
private readonly StudentModule studentModule = new StudentModule();
/// <summary>
/// 讲师处理类对象
/// </summary>
private readonly TeacherModule teacherModule = new TeacherModule();
[HttpGet]
[HttpPost]
[AllowAnonymous]
public ApiResult AdminLogin()
{
var list = groupModule.GetGroupListModule(new Model.ViewModel.User.RB_Group_ViewModel());
return ApiResult.Success(data: list);
}
/// <summary>
/// 获取集团列表
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetGroupList()
{
var query = Common.Plugin.JsonHelper.DeserializeObject<RB_Group_ViewModel>(RequestParm.Msg.ToString());
var list = groupModule.GetGroupListModule(query);
return ApiResult.Success(data: list);
}
/// <summary>
/// 获取集团分页列表
/// </summary>
/// <returns></returns>
public ApiResult GetGroupPageList()
{
var pageModel = Common.Plugin.JsonHelper.DeserializeObject<ResultPageModel>(RequestParm.Msg.ToString());
var query = Common.Plugin.JsonHelper.DeserializeObject<RB_Group_ViewModel>(RequestParm.Msg.ToString());
var list = groupModule.GetGroupPageListModule(pageModel.PageIndex,pageModel.PageSize,out long rowsCount,query);
pageModel.Count = rowsCount;
pageModel.PageData = list;
return ApiResult.Success(data: list);
}
/// <summary>
/// 新增修改
/// </summary>
/// <returns></returns>
public ApiResult SetGroup()
{
return ApiResult.Success();
return ApiResult.Failed();
}
}
}
\ No newline at end of file
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