|
|
@ -13,7 +13,6 @@ using Newtonsoft.Json;
|
|
|
|
using Newtonsoft.Json.Serialization;
|
|
|
|
using Newtonsoft.Json.Serialization;
|
|
|
|
using NPOI.SS.UserModel;
|
|
|
|
using NPOI.SS.UserModel;
|
|
|
|
using NPOI.XSSF.UserModel;
|
|
|
|
using NPOI.XSSF.UserModel;
|
|
|
|
using Stateless;
|
|
|
|
|
|
|
|
using System;
|
|
|
|
using System;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.ComponentModel.DataAnnotations;
|
|
|
|
using System.ComponentModel.DataAnnotations;
|
|
|
@ -90,6 +89,8 @@ namespace TeacherExt.Controllers
|
|
|
|
.OrderBy(o => o.OrganId)
|
|
|
|
.OrderBy(o => o.OrganId)
|
|
|
|
.ThenBy(o => o.CreateAt);
|
|
|
|
.ThenBy(o => o.CreateAt);
|
|
|
|
var query = from person in personQuery
|
|
|
|
var query = from person in personQuery
|
|
|
|
|
|
|
|
join organ in this._organizationRepo.ReadOnlyTable() on person.BureauId equals organ.OrganId
|
|
|
|
|
|
|
|
join department in this._organizationRepo.ReadOnlyTable() on person.OrganId equals department.OrganId
|
|
|
|
join login in this._loginRepo.ReadOnlyTable() on person.Id equals login.PersonId
|
|
|
|
join login in this._loginRepo.ReadOnlyTable() on person.Id equals login.PersonId
|
|
|
|
orderby person.OrganId ascending, person.CreateAt ascending
|
|
|
|
orderby person.OrganId ascending, person.CreateAt ascending
|
|
|
|
select new TeacherListItem
|
|
|
|
select new TeacherListItem
|
|
|
@ -101,7 +102,9 @@ namespace TeacherExt.Controllers
|
|
|
|
sex = person.Sex,
|
|
|
|
sex = person.Sex,
|
|
|
|
nation = person.Nation,
|
|
|
|
nation = person.Nation,
|
|
|
|
placeofbirth = person.NativePlace,
|
|
|
|
placeofbirth = person.NativePlace,
|
|
|
|
person_id = person.Id
|
|
|
|
person_id = person.Id,
|
|
|
|
|
|
|
|
org_name = organ.Name,
|
|
|
|
|
|
|
|
department_name = department.Name
|
|
|
|
};
|
|
|
|
};
|
|
|
|
var count = query.Count();
|
|
|
|
var count = query.Count();
|
|
|
|
var list = query
|
|
|
|
var list = query
|
|
|
@ -255,6 +258,13 @@ namespace TeacherExt.Controllers
|
|
|
|
this.ModelToEntity(model, entity);
|
|
|
|
this.ModelToEntity(model, entity);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (entity.CheckStatus == "待审核")
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (model.CheckStatus == "未提交")
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
entity.CheckStatus = model.CheckStatus;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
@ -301,6 +311,13 @@ namespace TeacherExt.Controllers
|
|
|
|
ModelState.AddModelError(nameof(model.CheckStatus), $"无法从[{entity.CheckStatus}]状态修改为[{model.CheckStatus}]状态");
|
|
|
|
ModelState.AddModelError(nameof(model.CheckStatus), $"无法从[{entity.CheckStatus}]状态修改为[{model.CheckStatus}]状态");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (model.CheckStatus == "未提交")
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (entity.CheckStatus != "待审核")
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
ModelState.AddModelError(nameof(model.CheckStatus), $"无法从[{entity.CheckStatus}]状态修改为[{model.CheckStatus}]状态");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (entity.RequestEditStatus != model.RequestEditStatus)
|
|
|
|
if (entity.RequestEditStatus != model.RequestEditStatus)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -553,7 +570,7 @@ namespace TeacherExt.Controllers
|
|
|
|
var organQuery = this._organizationRepo.ReadOnlyTable();
|
|
|
|
var organQuery = this._organizationRepo.ReadOnlyTable();
|
|
|
|
var query = from person in personQuery
|
|
|
|
var query = from person in personQuery
|
|
|
|
join organ in organQuery on person.OrganId equals organ.OrganId
|
|
|
|
join organ in organQuery on person.OrganId equals organ.OrganId
|
|
|
|
orderby person.BureauId, person.CreateAt
|
|
|
|
orderby person.AreaId, person.CreateAt
|
|
|
|
select new { organ.Name, person = person };
|
|
|
|
select new { organ.Name, person = person };
|
|
|
|
//
|
|
|
|
//
|
|
|
|
var nations = this.GetNation();
|
|
|
|
var nations = this.GetNation();
|
|
|
@ -670,25 +687,19 @@ namespace TeacherExt.Controllers
|
|
|
|
var name = model.person_name?.Trim();
|
|
|
|
var name = model.person_name?.Trim();
|
|
|
|
var personQuery = this._personRepo.ReadOnlyTable()
|
|
|
|
var personQuery = this._personRepo.ReadOnlyTable()
|
|
|
|
.Where(o => o.IsUsed)
|
|
|
|
.Where(o => o.IsUsed)
|
|
|
|
.Where(o => o.BureauId == bureau_id);
|
|
|
|
.Where(o => o.AreaId == bureau_id);
|
|
|
|
if (User.IsInRole("城中区教育局管理员"))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (model.bureau_id.Value != bureau_id)
|
|
|
|
if (model.bureau_id.Value != bureau_id)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
personQuery = personQuery.Where(o => o.OrganId == model.bureau_id);
|
|
|
|
personQuery = personQuery.Where(o => o.BureauId == model.bureau_id);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (User.IsInRole("学校管理员"))
|
|
|
|
if (!User.IsInRole("城中区教育局管理员") && !User.IsInRole("学校管理员"))
|
|
|
|
{
|
|
|
|
|
|
|
|
personQuery = personQuery.Where(o => o.OrganId == model.bureau_id);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var personId = Convert.ToInt32(User.Claims.Where(o => o.Type == "PersonId").Select(o => o.Value).FirstOrDefault());
|
|
|
|
var personId = Convert.ToInt32(User.Claims.Where(o => o.Type == "PersonId").Select(o => o.Value).FirstOrDefault());
|
|
|
|
personQuery = personQuery.Where(o => o.Id == personId);
|
|
|
|
personQuery = personQuery.Where(o => o.Id == personId);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
personQuery = personQuery
|
|
|
|
personQuery = personQuery
|
|
|
|
.WhereIf(!string.IsNullOrEmpty(model.person_name), o => o.RealName.Contains(name))
|
|
|
|
.WhereIf(!string.IsNullOrEmpty(name), o => o.RealName.Contains(name))
|
|
|
|
.WhereIf(!string.IsNullOrEmpty(model.RequestEditStatus), o => o.RequestEditStatus == model.RequestEditStatus)
|
|
|
|
.WhereIf(!string.IsNullOrEmpty(model.RequestEditStatus), o => o.RequestEditStatus == model.RequestEditStatus)
|
|
|
|
.WhereIf(!string.IsNullOrEmpty(model.CheckStatus), o => o.CheckStatus == model.CheckStatus);
|
|
|
|
.WhereIf(!string.IsNullOrEmpty(model.CheckStatus), o => o.CheckStatus == model.CheckStatus);
|
|
|
|
return personQuery;
|
|
|
|
return personQuery;
|
|
|
|