Commit 29fa24bb authored by 吴春's avatar 吴春

提交代码

parent 9d1eed01
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 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; }
}
}
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 部门管理
......@@ -968,6 +1044,10 @@ namespace Edu.WebApi.Controllers.User
var flag = departmentModule.RemoveDepartmentModule(DeptId, Status);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
#endregion
#region 岗位管理
......@@ -1112,7 +1192,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