Commit 1a67e77c authored by liudong1993's avatar liudong1993

Merge branch 'master' of http://gitlab.oytour.com/Kui2/education

parents 5ac3a17b c7377e2e
using System;
using System.Collections.Generic;
using System.Text;
using Edu.Common.Plugin;
namespace Edu.Common.Enum.User
{
public enum RemarkTypeEnum
{
/// <summary>
/// 备注
/// </summary>
[EnumField("备注")]
Remark = 1,
/// <summary>
/// 奖励
/// </summary>
[EnumField("奖励")]
Reward = 2,
/// <summary>
/// 处罚
/// </summary>
[EnumField("处罚")]
Punish = 3,
}
}
using System;
using Edu.Common.Enum.User;
using VT.FW.DB;
namespace Edu.Model.Entity.Log
......@@ -47,9 +48,15 @@ namespace Edu.Model.Entity.Log
/// </summary>
public int Type { get => type; set => type = value; }
/// <summary>
/// 来源id
/// </summary>
public int SourceId { get; set; }
/// <summary>
/// 账号类型(1-管理端,2,-教师端,3-助教,4-学生)
/// </summary>
public AccountTypeEnum AccountType { get; set; }
/// <summary>
/// 来源id
/// </summary>
public int SourceId { get; set; }
}
}
using Edu.Common.Enum;
using Edu.Common.Enum.User;
using System;
using VT.FW.DB;
namespace Edu.Model.Entity.User
{
/// <summary>
/// 行政备注实体类
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_AccountRemark
{
/// <summary>
/// 主键
/// </summary>
public int Id { get; set; }
/// <summary>
/// 关联Id【1-关联rb_manager(MId),2-关联rb_teacher(TId),3-关联rb_assist(AId),4-关联rb_student(StuId)】
/// </summary>
public int AccountId { get; set; }
/// <summary>
/// 账号类型(1-管理端,2,-教师端,3-助教,4-学生)
/// </summary>
public AccountTypeEnum AccountType { get; set; }
/// <summary>
/// 备注类型
/// </summary>
public RemarkTypeEnum RemarkType { get; set; }
/// <summary>
/// 富文本内容
/// </summary>
public string Content { get; set; }
/// <summary>
/// 集团编号
/// </summary>
public int Group_Id { get; set; }
/// <summary>
/// 学校编号
/// </summary>
public int School_Id { 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; }
}
}
using System;
using System.Collections.Generic;
using System.Text;
using Edu.Common.Enum.User;
using Edu.Model.Entity.User;
using VT.FW.DB;
namespace Edu.Model.ViewModel.User
{
/// <summary>
/// 行政备注实体类
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_AccountRemark_ViewList
{
public List<RB_AccountRemark_ViewModel> AccountRemarkList { get; set; }
/// <summary>
/// 备注类型
/// </summary>
public RemarkTypeEnum? RemarkType { get; set; }
/// <summary>
/// 关键字
/// </summary>
public string KeyWord { get; set; }
/// <summary>
/// 开始时间
/// </summary>
public string StartDate { get; set; }
/// <summary>
/// 结束时间
/// </summary>
public string EndDate { get; set; }
/// <summary>
/// 关联Id【1-关联rb_manager(MId),2-关联rb_teacher(TId),3-关联rb_assist(AId),4-关联rb_student(StuId)】
/// </summary>
public int AccountId { get; set; }
/// <summary>
/// 账号类型(1-管理端,2,-教师端,3-助教,4-学生)
/// </summary>
public AccountTypeEnum AccountType { get; set; }
/// <summary>
/// 集团编号
/// </summary>
public int Group_Id { get; set; }
/// <summary>
/// 学校编号
/// </summary>
public int School_Id { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public string CreateStr { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Text;
using Edu.Model.Entity.User;
using VT.FW.DB;
namespace Edu.Model.ViewModel.User
{
/// <summary>
/// 行政备注实体类
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_AccountRemark_ViewModel : RB_AccountRemark
{
public int IsAddNotice { get; set; }
public string CreateByName { get; set; }
public string CreateTimeStr { get; set; }
public string RemarkTypeStr { get; set; }
}
}
......@@ -43,6 +43,11 @@ namespace Edu.Module.Course
/// </summary>
private readonly RB_CourseRepository courseRepository = new RB_CourseRepository();
/// <summary>
/// 订单仓储层对象
/// </summary>
private readonly RB_OrderRepository orderRepository = new RB_OrderRepository();
/// <summary>
/// 获取班级列表
/// </summary>
......@@ -67,14 +72,17 @@ namespace Edu.Module.Course
if (list != null && list.Count > 0)
{
var classTimeList = new List<RB_Class_Time_ViewModel>();
var classOrderList = new List<RB_Order_ViewModel>();
string ids = string.Join(",", list.Select(qitem => qitem.ClassId));
if (!string.IsNullOrEmpty(ids))
{
classTimeList = class_TimeRepository.GetClassTimeListRepository(ids);
classTimeList = class_TimeRepository.GetClassTimeListRepository(ids);
classOrderList = orderRepository.GetClassOrderPeopleNum(ids);
}
foreach (var item in list)
{
item.NewPlanDateTime = classTimeList?.Where(qitem => qitem.ClassId == item.ClassId)?.FirstOrDefault()?.NewPlanDateTime;
item.OrderStudentCount = classOrderList?.Where(qitem => qitem.ClassId == item.ClassId)?.FirstOrDefault()?.GuestNum ?? 0;
}
}
return list;
......@@ -131,7 +139,7 @@ namespace Edu.Module.Course
{ nameof(RB_Class_ViewModel.ClassStatus),model.ClassStatus},
{ nameof(RB_Class_ViewModel.InnerRemark),model.InnerRemark},
{ nameof(RB_Class_ViewModel.OutRemark),model.OutRemark},
{ nameof(RB_Class_ViewModel.CompleteProgress),model.CompleteProgress},
//{ nameof(RB_Class_ViewModel.CompleteProgress),model.CompleteProgress},
};
flag = classRepository.Update(fileds, new WhereHelper(nameof(RB_Class_ViewModel.ClassId), model.ClassId));
}
......
using Edu.Model.ViewModel.Log;
using Edu.Common.Enum.User;
using Edu.Model.ViewModel.Log;
using Edu.Repository.Log;
using System;
using System.Collections.Generic;
......@@ -41,7 +42,7 @@ namespace Edu.Module.Log
/// <param name="SchoolId">校区编号</param>
/// <param name="content">日志内容</param>
/// <returns></returns>
public bool SetUserChangeLogModule(int CreateBy, int GroupId,int SchoolId,string content)
public bool SetUserChangeLogModule(int CreateBy, int GroupId,int SchoolId,string content, int Id, AccountTypeEnum accountType)
{
RB_User_ChangeLog_ViewModel model = new RB_User_ChangeLog_ViewModel()
{
......@@ -50,7 +51,9 @@ namespace Edu.Module.Log
CreateTime = DateTime.Now,
Group_Id = GroupId,
School_Id = SchoolId,
LogContent = content.TrimStart(',')
LogContent = content.TrimStart(','),
AccountType= accountType,
SourceId= Id
};
return changeLogRepository.Insert(model) > 0;
}
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Edu.AOP.CustomerAttribute;
using Edu.Model.ViewModel.User;
using Edu.Repository.User;
namespace Edu.Module.User
{
public class AccountRemarkModule
{
/// <summary>
/// 行政备注管理处理类对象
/// </summary>
private readonly RB_AccountRemarkRepository accountRemarkRepository = new RB_AccountRemarkRepository();
/// <summary>
/// 获取行政备注列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_AccountRemark_ViewModel> GetAccountRemarkListModule(RB_AccountRemark_ViewModel query)
{
return accountRemarkRepository.GetList(query);
}
/// <summary>
/// 获取行政备注分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_AccountRemark_ViewModel> GetAccountRemarkPageListModule(int pageIndex, int pageSize, out long rowsCount, RB_AccountRemark_ViewModel query)
{
return accountRemarkRepository.GetPageList(pageIndex, pageSize, out rowsCount, query);
}
/// <summary>
/// 获取分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="demodel"></param>
/// <returns></returns>
public List<RB_AccountRemark_ViewList> GetPageList(int pageIndex, int pageSize, out long rowsCount, RB_AccountRemark_ViewList demodel)
{
var list = accountRemarkRepository.GetAccountRemarkPageList(pageIndex, pageSize, out rowsCount, demodel);
if (list!=null&& list.Any())
{
var childList = accountRemarkRepository.GetListByWhere(demodel);
foreach (var item in list)
{
item.AccountRemarkList = new List<RB_AccountRemark_ViewModel>();
item.AccountRemarkList = childList.Where(x => x.CreateTime.Value.ToString("yyyy-MM-dd") == item.CreateStr).ToList();
}
}
return list;
}
/// <summary>
/// 添加修改行政备注
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public bool SetAccountRemarkModule(RB_AccountRemark_ViewModel model)
{
bool flag;
var newId = accountRemarkRepository.Insert(model);
model.Id = newId;
flag = newId > 0;
return flag;
}
}
}
......@@ -173,7 +173,7 @@ namespace Edu.Module.User
if (!string.IsNullOrEmpty(logContent))
{
//新增日志
userChangeLogModule.SetUserChangeLogModule(model.CreateBy, model.Group_Id, model.School_Id, logContent);
userChangeLogModule.SetUserChangeLogModule(model.CreateBy, model.Group_Id, model.School_Id, logContent, model.AId, AccountTypeEnum.Assist);
}
flag = assistRepository.Update(fileds, new WhereHelper(nameof(RB_Assist.AId), model.AId));
}
......@@ -181,6 +181,7 @@ namespace Edu.Module.User
{
var newId = assistRepository.Insert(model);
model.AId = newId;
userChangeLogModule.SetUserChangeLogModule(model.CreateBy, model.Group_Id, model.School_Id, "新建用户", newId, AccountTypeEnum.Assist);
flag = newId > 0;
}
return flag;
......@@ -221,7 +222,7 @@ namespace Edu.Module.User
if (!string.IsNullOrEmpty(logContent))
{
//新增日志
userChangeLogModule.SetUserChangeLogModule(model.CreateBy, model.Group_Id, model.School_Id, logContent);
userChangeLogModule.SetUserChangeLogModule(model.CreateBy, model.Group_Id, model.School_Id, logContent, model.AId, AccountTypeEnum.Assist);
}
flag = assistRepository.Update(fileds, new WhereHelper(nameof(RB_Assist.AId), model.AId));
}
......@@ -265,7 +266,7 @@ namespace Edu.Module.User
if (!string.IsNullOrEmpty(logContent))
{
//新增日志
userChangeLogModule.SetUserChangeLogModule(model.CreateBy, model.Group_Id, model.School_Id, logContent);
userChangeLogModule.SetUserChangeLogModule(model.CreateBy, model.Group_Id, model.School_Id, logContent, model.AId, AccountTypeEnum.Assist);
}
flag = assistRepository.Update(fileds, new WhereHelper(nameof(RB_Assist.AId), model.AId));
}
......@@ -314,7 +315,7 @@ namespace Edu.Module.User
if (!string.IsNullOrEmpty(logContent))
{
//新增日志
userChangeLogModule.SetUserChangeLogModule(model.CreateBy, model.Group_Id, model.School_Id, logContent);
userChangeLogModule.SetUserChangeLogModule(model.CreateBy, model.Group_Id, model.School_Id, logContent, model.AId, AccountTypeEnum.Assist);
}
flag = assistRepository.Update(fileds, new WhereHelper(nameof(RB_Assist.AId), model.AId));
}
......
......@@ -145,7 +145,7 @@ namespace Edu.Module.User
if (!string.IsNullOrEmpty(logContent))
{
//新增日志
userChangeLogModule.SetUserChangeLogModule(model.CreateBy, model.Group_Id, model.School_Id, logContent);
userChangeLogModule.SetUserChangeLogModule(model.CreateBy, model.Group_Id, model.School_Id, logContent, model.MId, AccountTypeEnum.Admin);
}
flag = managerRepository.Update(fileds, new WhereHelper(nameof(RB_Manager_ViewModel.MId), model.MId));
}
......@@ -174,7 +174,7 @@ namespace Edu.Module.User
model.MId = newId;
}
flag = newId > 0;
userChangeLogModule.SetUserChangeLogModule(model.CreateBy, model.Group_Id, model.School_Id, "新建用户");
userChangeLogModule.SetUserChangeLogModule(model.CreateBy, model.Group_Id, model.School_Id, "新建用户", newId, AccountTypeEnum.Admin);
}
return flag;
}
......@@ -210,7 +210,7 @@ namespace Edu.Module.User
if (!string.IsNullOrEmpty(logContent))
{
//新增日志
userChangeLogModule.SetUserChangeLogModule(model.CreateBy, model.Group_Id, model.School_Id, logContent);
userChangeLogModule.SetUserChangeLogModule(model.CreateBy, model.Group_Id, model.School_Id, logContent, model.MId, AccountTypeEnum.Admin);
}
flag = managerRepository.Update(fileds, new WhereHelper(nameof(RB_Manager_ViewModel.MId), model.MId));
}
......@@ -249,7 +249,7 @@ namespace Edu.Module.User
if (!string.IsNullOrEmpty(logContent))
{
//新增日志
userChangeLogModule.SetUserChangeLogModule(model.CreateBy, model.Group_Id, model.School_Id, logContent);
userChangeLogModule.SetUserChangeLogModule(model.CreateBy, model.Group_Id, model.School_Id, logContent, model.MId, AccountTypeEnum.Admin);
}
flag = managerRepository.Update(fileds, new WhereHelper(nameof(RB_Manager_ViewModel.MId), model.MId));
}
......@@ -291,7 +291,7 @@ namespace Edu.Module.User
if (!string.IsNullOrEmpty(logContent))
{
//新增日志
userChangeLogModule.SetUserChangeLogModule(model.CreateBy, model.Group_Id, model.School_Id, logContent);
userChangeLogModule.SetUserChangeLogModule(model.CreateBy, model.Group_Id, model.School_Id, logContent, model.MId, AccountTypeEnum.Admin);
}
flag = managerRepository.Update(fileds, new WhereHelper(nameof(RB_Manager_ViewModel.MId), model.MId));
}
......
......@@ -178,7 +178,7 @@ namespace Edu.Module.User
if (!string.IsNullOrEmpty(logContent))
{
//新增日志
userChangeLogModule.SetUserChangeLogModule(model.CreateBy, model.Group_Id, model.School_Id, logContent);
userChangeLogModule.SetUserChangeLogModule(model.CreateBy, model.Group_Id, model.School_Id, logContent, model.TId, AccountTypeEnum.Teacher);
}
flag = teacherRepository.Update(fileds, new WhereHelper(nameof(RB_Teacher_ViewModel.TId), model.TId));
}
......@@ -186,6 +186,7 @@ namespace Edu.Module.User
{
var newId = teacherRepository.Insert(model);
model.TId = newId;
userChangeLogModule.SetUserChangeLogModule(model.CreateBy, model.Group_Id, model.School_Id, "新建用户", newId, AccountTypeEnum.Teacher);
flag = newId > 0;
}
return flag;
......@@ -222,7 +223,7 @@ namespace Edu.Module.User
if (!string.IsNullOrEmpty(logContent))
{
//新增日志
userChangeLogModule.SetUserChangeLogModule(model.CreateBy, model.Group_Id, model.School_Id, logContent);
userChangeLogModule.SetUserChangeLogModule(model.CreateBy, model.Group_Id, model.School_Id, logContent, model.TId, AccountTypeEnum.Teacher);
}
flag = teacherRepository.Update(fileds, new WhereHelper(nameof(RB_Teacher_ViewModel.TId), model.TId));
}
......@@ -267,7 +268,7 @@ namespace Edu.Module.User
if (!string.IsNullOrEmpty(logContent))
{
//新增日志
userChangeLogModule.SetUserChangeLogModule(model.CreateBy, model.Group_Id, model.School_Id, logContent);
userChangeLogModule.SetUserChangeLogModule(model.CreateBy, model.Group_Id, model.School_Id, logContent, model.TId, AccountTypeEnum.Teacher);
}
flag = teacherRepository.Update(fileds, new WhereHelper(nameof(RB_Teacher_ViewModel.TId), model.TId));
}
......@@ -314,7 +315,7 @@ namespace Edu.Module.User
if (!string.IsNullOrEmpty(logContent))
{
//新增日志
userChangeLogModule.SetUserChangeLogModule(model.CreateBy, model.Group_Id, model.School_Id, logContent);
userChangeLogModule.SetUserChangeLogModule(model.CreateBy, model.Group_Id, model.School_Id, logContent, model.TId, AccountTypeEnum.Teacher);
}
flag = teacherRepository.Update(fileds, new WhereHelper(nameof(RB_Teacher_ViewModel.TId), model.TId));
}
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Edu.Model.Entity.User;
using Edu.Model.ViewModel.User;
namespace Edu.Repository.User
{
/// <summary>
/// 行政备注仓储层
/// </summary>
public class RB_AccountRemarkRepository : BaseRepository<RB_AccountRemark>
{
/// <summary>
/// 获取列表
/// </summary>
/// <param name="demodel"></param>
/// <param name="orderIds"></param>
/// <returns></returns>
public List<RB_AccountRemark_ViewModel> GetList(RB_AccountRemark_ViewModel demodel)
{
string where = $@" 1=1";
if (demodel.Group_Id > 0)
{
where += $@" and {nameof(RB_AccountRemark_ViewModel.Group_Id)} ={demodel.Group_Id}";
}
if (demodel.RemarkType > 0)
{
where += $@" and {nameof(RB_AccountRemark_ViewModel.RemarkType)} ={(int)demodel.RemarkType}";
}
if (demodel.AccountType > 0)
{
where += $@" and {nameof(RB_AccountRemark_ViewModel.AccountType)} ={(int)demodel.AccountType}";
}
if (demodel.AccountId > 0)
{
where += $@" and {nameof(RB_AccountRemark_ViewModel.AccountId)} ={(int)demodel.AccountId}";
}
string sql = $@" select * from RB_AccountRemark where {where}";
return Get<RB_AccountRemark_ViewModel>(sql).ToList();
}
/// <summary>
/// 获取分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="demodel"></param>
/// <returns></returns>
public List<RB_AccountRemark_ViewModel> GetPageList(int pageIndex, int pageSize, out long rowsCount, RB_AccountRemark_ViewModel demodel)
{
string where = $@" 1=1";
if (demodel.Group_Id > 0)
{
where += $@" and {nameof(RB_AccountRemark_ViewModel.Group_Id)} ={demodel.Group_Id}";
}
if (demodel.RemarkType > 0)
{
where += $@" and {nameof(RB_AccountRemark_ViewModel.RemarkType)} ={(int)demodel.RemarkType}";
}
if (demodel.AccountType > 0)
{
where += $@" and {nameof(RB_AccountRemark_ViewModel.AccountType)} ={(int)demodel.AccountType}";
}
if (demodel.AccountId > 0)
{
where += $@" and {nameof(RB_AccountRemark_ViewModel.AccountId)} ={(int)demodel.AccountId}";
}
string sql = $@" select * from RB_AccountRemark where {where}";
return GetPage<RB_AccountRemark_ViewModel>(pageIndex, pageSize, out rowsCount, sql).ToList();
}
/// <summary>
/// 获取分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="demodel"></param>
/// <returns></returns>
public List<RB_AccountRemark_ViewList> GetAccountRemarkPageList(int pageIndex, int pageSize, out long rowsCount, RB_AccountRemark_ViewList demodel)
{
string where = $@" ";
if (demodel.Group_Id > 0)
{
where += $@" and {nameof(RB_AccountRemark_ViewModel.Group_Id)} ={demodel.Group_Id}";
}
if (demodel.RemarkType > 0)
{
where += $@" and {nameof(RB_AccountRemark_ViewModel.RemarkType)} ={(int)demodel.RemarkType}";
}
if (demodel.AccountType > 0)
{
where += $@" and {nameof(RB_AccountRemark_ViewModel.AccountType)} ={(int)demodel.AccountType}";
}
if (demodel.AccountId > 0)
{
where += $@" and {nameof(RB_AccountRemark_ViewModel.AccountId)} ={(int)demodel.AccountId}";
}
if (!string.IsNullOrWhiteSpace(demodel.KeyWord))
{
where += $@" and {nameof(RB_AccountRemark_ViewModel.AccountId)} ={(int)demodel.AccountId}";
}
if (!string.IsNullOrWhiteSpace(demodel.StartDate))
{
where += $@" and DATE_FORMAT({nameof(RB_AccountRemark_ViewModel.CreateTime)},'%Y-%m-%d' )>=DATE_FORMAT('{demodel.StartDate}','%Y-%m-%d' ) ";
}
if (!string.IsNullOrWhiteSpace(demodel.EndDate))
{
where += $@" and DATE_FORMAT({nameof(RB_AccountRemark_ViewModel.CreateTime)},'%Y-%m-%d' )<= DATE_FORMAT('{demodel.EndDate}','%Y-%m-%d' ) ";
}
string sql = $@" SELECT DATE_FORMAT(CreateTime,'%Y-%m-%d') as CreateStr from rb_accountremark where `Status`=0 {where} GROUP BY DATE_FORMAT(CreateTime,'%Y-%m-%d') ";
return GetPage<RB_AccountRemark_ViewList>(pageIndex, pageSize, out rowsCount, sql).ToList();
}
/// <summary>
/// 获取列表
/// </summary>
/// <param name="demodel"></param>
/// <param name="orderIds"></param>
/// <returns></returns>
public List<RB_AccountRemark_ViewModel> GetListByWhere(RB_AccountRemark_ViewList demodel)
{
string where = $@" ";
if (demodel.Group_Id > 0)
{
where += $@" and {nameof(RB_AccountRemark_ViewModel.Group_Id)} ={demodel.Group_Id}";
}
if (demodel.RemarkType > 0)
{
where += $@" and {nameof(RB_AccountRemark_ViewModel.RemarkType)} ={(int)demodel.RemarkType}";
}
if (demodel.AccountType > 0)
{
where += $@" and {nameof(RB_AccountRemark_ViewModel.AccountType)} ={(int)demodel.AccountType}";
}
if (demodel.AccountId > 0)
{
where += $@" and {nameof(RB_AccountRemark_ViewModel.AccountId)} ={(int)demodel.AccountId}";
}
if (!string.IsNullOrWhiteSpace(demodel.KeyWord))
{
where += $@" and {nameof(RB_AccountRemark_ViewModel.AccountId)} ={(int)demodel.AccountId}";
}
if (!string.IsNullOrWhiteSpace(demodel.StartDate))
{
where += $@" and DATE_FORMAT({nameof(RB_AccountRemark_ViewModel.CreateTime)},'%Y-%m-%d' )>=DATE_FORMAT('{demodel.StartDate}','%Y-%m-%d' ) ";
}
if (!string.IsNullOrWhiteSpace(demodel.EndDate))
{
where += $@" and DATE_FORMAT({nameof(RB_AccountRemark_ViewModel.CreateTime)},'%Y-%m-%d' )<= DATE_FORMAT('{demodel.EndDate}','%Y-%m-%d' ) ";
}
string sql = $@" select * from RB_AccountRemark where `Status`=0 {where}";
return Get<RB_AccountRemark_ViewModel>(sql).ToList();
}
}
}
......@@ -70,8 +70,14 @@ namespace Edu.WebApi.Controllers.User
/// 员工处理类对象
/// </summary>
private readonly EmployeeModule employeeModule = new EmployeeModule();
/// <summary>
/// 行政备注处理类对象
/// </summary>
private readonly AccountRemarkModule accountRemarkModule = new AccountRemarkModule();
/// <summary>
/// 助教处理类对象
/// </summary>
private readonly NoticeModule noticeModule = new NoticeModule();
#region 用户账户管理
/// <summary>
......@@ -630,7 +636,7 @@ namespace Edu.WebApi.Controllers.User
pageModel.Count = rowsCount;
pageModel.PageData = list.Select((qitem, i) => new
{
Id = (pageModel.PageSize* (pageModel.PageIndex-1)) +i + 1,
Id = (pageModel.PageSize * (pageModel.PageIndex - 1)) + i + 1,
// qitem.Id,
qitem.UserIcon,
qitem.EmployeeName,
......@@ -836,6 +842,76 @@ namespace Edu.WebApi.Controllers.User
var flag = managerModule.CreateManagerAccountModule(MId, base.UserInfo);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
/// <summary>
/// 行政备注
/// </summary>
/// <returns></returns>
public ApiResult SetAccountRemark()
{
var extModel = Common.Plugin.JsonHelper.DeserializeObject<RB_AccountRemark_ViewModel>(RequestParm.Msg.ToString());
extModel.CreateBy = base.UserInfo.Id;
extModel.CreateTime = DateTime.Now;
extModel.UpdateBy = base.UserInfo.Id;
extModel.UpdateTime = DateTime.Now;
extModel.Group_Id = base.UserInfo.Group_Id;
extModel.Status = Common.Enum.DateStateEnum.Normal;
bool flag = accountRemarkModule.SetAccountRemarkModule(extModel);
if (flag && extModel.IsAddNotice == 1)
{
var extAccountModel = employeeModule.GetEmployeeModule(0, extModel.AccountId, (int)extModel.AccountType);
RB_Notice_ViewModel demodel = new RB_Notice_ViewModel();
demodel.FileList ??= new List<Model.Public.FileModel>();
demodel.Is_Top = demodel.Is_Top == 0 ? 2 : demodel.Is_Top;
demodel.Status = Common.Enum.DateStateEnum.Normal;
demodel.Group_Id = base.UserInfo.Group_Id;
demodel.School_Id = base.UserInfo.School_Id;
demodel.CreateBy = base.UserInfo.Id;
demodel.CreateTime = DateTime.Now;
demodel.UpdateBy = base.UserInfo.Id;
demodel.UpdateTime = DateTime.Now;
demodel.Id = 0;
demodel.From = "行政";
demodel.To = extAccountModel.Dept_Id.ToString();
demodel.CopyPeople = "-1";
demodel.Title = extAccountModel.EmployeeName + "的" + EnumHelper.ToName(extModel.RemarkType) + "公告";
demodel.Content = extModel.Content;
demodel.NoticeState = NoticeStateEnum.Publish;
demodel.Is_Top = 2;
noticeModule.SetNoticeInfo(demodel);
}
return flag ? ApiResult.Success() : ApiResult.Failed();
}
/// <summary>
/// 获取行政备注分页列表
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetAccountRemarkPageList()
{
var pageModel = Common.Plugin.JsonHelper.DeserializeObject<ResultPageModel>(RequestParm.Msg.ToString());
var query = Common.Plugin.JsonHelper.DeserializeObject<RB_AccountRemark_ViewList>(RequestParm.Msg.ToString());
query.Group_Id = base.UserInfo.Group_Id;
var list = accountRemarkModule.GetPageList(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, query);
foreach (var item in list)
{
foreach (var itemRemark in item.AccountRemarkList)
{
if (itemRemark.CreateBy > 0)
{
itemRemark.CreateByName = UserReidsCache.GetUserLoginInfo(itemRemark.CreateBy)?.AccountName ?? "";
}
itemRemark.CreateTimeStr = itemRemark.CreateTime.HasValue ? itemRemark.CreateTime.Value.ToString("HH:mm:ss") : "";
itemRemark.RemarkTypeStr = EnumHelper.ToName(itemRemark.RemarkType);
}
}
pageModel.Count = rowsCount;
pageModel.PageData = list;
return ApiResult.Success(data: pageModel);
}
#endregion
#region 部门管理
......@@ -984,6 +1060,10 @@ namespace Edu.WebApi.Controllers.User
var flag = departmentModule.RemoveDepartmentModule(DeptId, Status);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
#endregion
#region 岗位管理
......@@ -1128,7 +1208,7 @@ namespace Edu.WebApi.Controllers.User
var query = new RB_Department_ViewModel()
{
Group_Id = base.UserInfo.Group_Id,
School_Id=base.ParmJObj.GetInt("School_Id")
School_Id = base.ParmJObj.GetInt("School_Id")
};
var list = departmentModule.GetDepartmentTreeModule(query, isQueryEmployee: true);
return ApiResult.Success(data: list);
......
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