You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
923 lines
42 KiB
923 lines
42 KiB
using Infrastructure.Data;
|
|
using Infrastructure.Extensions;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using Microsoft.Extensions.Hosting;
|
|
using Microsoft.Extensions.Logging;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using TeacherExt.Entities;
|
|
using TeacherExt.Models;
|
|
|
|
namespace TeacherExt.Controllers
|
|
{
|
|
//[Authorize]
|
|
[ApiController]
|
|
[Route("[controller]/[action]")]
|
|
public class HomeController : Controller
|
|
{
|
|
private readonly IHostEnvironment _env;
|
|
|
|
private readonly ILogger<HomeController> _logger;
|
|
private readonly AesHelper _helper;
|
|
private readonly IRepository<DictionaryItem> _directoryRepo;
|
|
private readonly IRepository<Person> _personRepo;
|
|
private readonly IRepository<Organization> _organizationRepo;
|
|
|
|
//private readonly IRepository<User> _userRepo;
|
|
|
|
//private readonly IRepository<Teacher> _teacherRepo;
|
|
|
|
//private readonly IRepository<CheckLog> _checkLogRepo;
|
|
|
|
public HomeController(IHostEnvironment env,
|
|
ILogger<HomeController> logger,
|
|
AesHelper helper,
|
|
IRepository<DictionaryItem> directoryRepo,
|
|
IRepository<Person> personRepo,
|
|
IRepository<Organization> organizationRepo
|
|
//IRepository<Organ> organRepo,
|
|
//IRepository<User> userRepo,
|
|
//IRepository<Teacher> teacherRepo,
|
|
//IRepository<CheckLog> checkLogRepo
|
|
)
|
|
{
|
|
this._env = env;
|
|
_logger = logger;
|
|
this._helper = helper;
|
|
this._directoryRepo = directoryRepo;
|
|
this._personRepo = personRepo;
|
|
this._organizationRepo = organizationRepo;
|
|
//this._organRepo = organRepo;
|
|
//this._userRepo = userRepo;
|
|
//this._teacherRepo = teacherRepo;
|
|
//this._checkLogRepo = checkLogRepo;
|
|
}
|
|
|
|
[HttpGet]
|
|
[Route("/")]
|
|
public IActionResult Index(int bureau_id, string person_name, int pageNumber = 1, int pageSize = 20)
|
|
{
|
|
var personQuery = this._personRepo.ReadOnlyTable();
|
|
var organQuery = this._organizationRepo.ReadOnlyTable();
|
|
if (!string.IsNullOrEmpty(person_name))
|
|
{
|
|
personQuery = personQuery.Where(o => o.RealName.Contains(person_name));
|
|
}
|
|
var query = from person in personQuery
|
|
join organ in organQuery on person.BureauId equals organ.Id
|
|
join organ2 in organQuery on person.OrganId equals organ2.Id
|
|
where (person.IsUsed && person.BureauId == bureau_id)
|
|
orderby person.BureauId,person.CreateAt
|
|
select new ListItem
|
|
{
|
|
person_name = person.RealName,
|
|
sex = person.Sex,
|
|
nation = person.Nation,
|
|
placeofbirth= person.NativePlace,
|
|
bureau_name = organ.Name,
|
|
org_name = organ2.Name,
|
|
person_id =person.Id,
|
|
};
|
|
if (!string.IsNullOrEmpty(person_name))
|
|
{
|
|
query.Where(o => o.person_name.Contains(person_name));
|
|
}
|
|
var count = query.Count();
|
|
var list = query
|
|
.Skip(pageSize * (pageNumber - 1))
|
|
.Take(pageSize)
|
|
.ToList();
|
|
var nations = this.GetItems("ETHNIC_GROUP");
|
|
foreach (var item in list)
|
|
{
|
|
item.nation_name = nations.FirstOrDefault(o => o.Code == item.nation)?.Remark;
|
|
}
|
|
var model = new
|
|
{
|
|
List = list,
|
|
PageNumber = pageNumber,
|
|
PageSize = pageSize,
|
|
TotalRow = count
|
|
};
|
|
return Json(model);
|
|
////return Json(this._directoryRepo.ReadOnlyTable().Where(o=>o.IsUsed&&o.Category== "Nationality").OrderBy(o=>o.Order));
|
|
//var model = this._personRepo.ReadOnlyTable().Where(o => o.IdentityNumber != null).FirstOrDefault();
|
|
////var bytes = HexStringToByteArray(model);
|
|
////var output = AesDecrypt(bytes);
|
|
//var value = _helper.Decrypt(model.IdentityNumber);
|
|
//var en = _helper.Encrypt(value);
|
|
//return Content(value);
|
|
}
|
|
|
|
//[HttpGet]
|
|
//[Route("/")]
|
|
//public IActionResult Index(QueryTeacherModel model)
|
|
//{
|
|
// var query = Query(model);
|
|
// model.TotalCount = query.Count();
|
|
// var list = query
|
|
// .Skip(model.PageSize * (model.PageIndex - 1))
|
|
// .Take(model.PageSize)
|
|
// .ToList()
|
|
// .Select(o =>
|
|
// {
|
|
// var m = o.Teacher != null ? o.Teacher.To<EditTeacherModel>() : new EditTeacherModel();
|
|
// if (o.Teacher != null)
|
|
// {
|
|
// this.EntityToModel(o.Teacher, m);
|
|
// }
|
|
// m.UserName = o.UserName;
|
|
// m.UserId = o.Id;
|
|
// m.Organ = o.Organ.Name;
|
|
// m.RealName = o.RealName;
|
|
// return m;
|
|
// }).ToList();
|
|
// model.List.AddRange(list);
|
|
// ViewData.SelectList(o => model.RequestEditStatus, () => this.GetRequestEditStatus(model.RequestEditStatus));
|
|
// ViewData.SelectList(o => model.CheckStatus, () => this.GetCheckStatus(model.CheckStatus));
|
|
// return Result<EditTeacherModel>(model);
|
|
//}
|
|
|
|
//[HttpPost]
|
|
//[Route("/")]
|
|
//public IActionResult Index(QueryTeacherModel model, bool isPost)
|
|
//{
|
|
// return this.Index(model);
|
|
//}
|
|
|
|
//[HttpGet]
|
|
//public IActionResult Details(Guid userId)
|
|
//{
|
|
// var entity = this._userRepo.ReadOnlyTable()
|
|
// .Include(o => o.Organ)
|
|
// .Include(o => o.Teacher)
|
|
// .FirstOrDefault(o => o.Id == userId);
|
|
// var model = entity.To<EditTeacherModel>();
|
|
// if (entity.Teacher != null)
|
|
// {
|
|
// model.From(entity.Teacher);
|
|
// }
|
|
// model.UserName = entity.UserName;
|
|
// model.UserId = entity.Id;
|
|
// model.Organ = entity.Organ.Name;
|
|
// model.RealName = entity.RealName;
|
|
// this.EntityToModel(entity.Teacher, model);
|
|
// this.ToEditModel(entity.Teacher, model);
|
|
// return Result<EditTeacherModel>(model);
|
|
//}
|
|
|
|
//[HttpPost]
|
|
//public IActionResult Details([FromForm] EditTeacherModel model)
|
|
//{
|
|
// ValidEditModel(model);
|
|
// var entity = this._userRepo.Table().Include(o => o.Organ).Include(o => o.Teacher).FirstOrDefault(o => o.Id == model.UserId);
|
|
// if (ModelState.IsValid)
|
|
// {
|
|
// if (entity.Teacher.CheckStatus != model.CheckStatus)
|
|
// {
|
|
// this._checkLogRepo.Add(new CheckLog
|
|
// {
|
|
// UpdateBy = User.Identity.Name,
|
|
// UpdateAt = DateTime.Now,
|
|
// UserName = entity.UserName,
|
|
// FromStatus = entity.Teacher.CheckStatus,
|
|
// ToStatus = model.CheckStatus
|
|
// });
|
|
// }
|
|
// entity.Teacher.From(model);
|
|
// this._userRepo.SaveChanges();
|
|
// return RedirectToAction("Index");
|
|
// }
|
|
// this.EntityToModel(entity?.Teacher, model);
|
|
// this.ToEditModel(entity?.Teacher, model);
|
|
// return Result<EditTeacherModel>(model);
|
|
//}
|
|
|
|
//[HttpGet]
|
|
//public IActionResult Add()
|
|
//{
|
|
// var model = new EditTeacherModel();
|
|
// this.ToEditModel(null, model);
|
|
// return View(model);
|
|
//}
|
|
|
|
//[HttpGet]
|
|
//public IActionResult Edit(string userName)
|
|
//{
|
|
// var entity = this._userRepo.ReadOnlyTable()
|
|
// .Include(o => o.Organ)
|
|
// .Include(o => o.Teacher)
|
|
// .FirstOrDefault(o => o.UserName == userName);
|
|
// var model = entity.To<EditTeacherModel>();
|
|
// if (entity.Teacher != null)
|
|
// {
|
|
// model.From(entity.Teacher);
|
|
// }
|
|
// model.UserName = entity.UserName;
|
|
// model.UserId = entity.Id;
|
|
// model.Organ = entity.Organ.Name;
|
|
// model.RealName = entity.RealName;
|
|
// this.EntityToModel(entity.Teacher, model);
|
|
// this.ToEditModel(entity.Teacher, model);
|
|
// return Result<EditTeacherModel>(model);
|
|
//}
|
|
|
|
//[HttpPost]
|
|
//public IActionResult Add([FromForm] EditTeacherModel model)
|
|
//{
|
|
// if (ModelState.IsValid)
|
|
// {
|
|
// var entity = new Teacher();
|
|
// entity.From(model);
|
|
// this._teacherRepo.Add(entity);
|
|
// this._teacherRepo.SaveChanges();
|
|
// return RedirectToAction("Index");
|
|
// }
|
|
// this.ToEditModel(null, model);
|
|
// return View(model);
|
|
//}
|
|
|
|
//[HttpPost]
|
|
//public IActionResult Edit([FromForm] EditTeacherModel model)
|
|
//{
|
|
// ValidEditModel(model);
|
|
// var entity = this._userRepo.Table().Include(o => o.Organ).Include(o => o.Teacher).FirstOrDefault(o => o.Id == model.UserId);
|
|
// if (ModelState.IsValid)
|
|
// {
|
|
// if (entity.Teacher == null)
|
|
// {
|
|
// entity.Teacher = new Teacher();
|
|
// }
|
|
// entity.Teacher.From(model);
|
|
// this._userRepo.SaveChanges();
|
|
// return RedirectToAction("Index");
|
|
// }
|
|
// this.EntityToModel(entity?.Teacher, model);
|
|
// this.ToEditModel(entity?.Teacher, model);
|
|
// return View(model);
|
|
//}
|
|
|
|
//[HttpGet]
|
|
//public IActionResult History([FromQuery] QueryHistoryModel model)
|
|
//{
|
|
// var query = this._checkLogRepo.ReadOnlyTable()
|
|
// .Where(o => o.UserName == model.UserName)
|
|
// .OrderByDescending(o => o.UpdateAt);
|
|
// model.TotalCount = query.Count();
|
|
// var list = query.Skip(model.PageSize * (model.PageIndex - 1))
|
|
// .OrderByDescending(o => o.UpdateAt)
|
|
// .Take(model.PageSize)
|
|
// .ToList()
|
|
// .Select(o =>
|
|
// {
|
|
// var m = o.To<QueryHistoryModel>();
|
|
// return m;
|
|
// })
|
|
// .ToList();
|
|
// model.List.AddRange(list);
|
|
// return Result<EditTeacherModel>(model);
|
|
//}
|
|
|
|
///// <summary>
|
|
///// https://github.com/nissl-lab/npoi/wiki/How-to-use-NPOI-on-Linux
|
|
///// apt-get install libgdiplus libc6-dev
|
|
///// cd /usr/lib
|
|
///// ln -s libgdiplus.so gdiplus.dll
|
|
///// </summary>
|
|
///// <returns></returns>
|
|
//[HttpPost]
|
|
//public FileResult Export([FromForm] QueryTeacherModel model)
|
|
//{
|
|
// var template = Path.Combine(this._env.ContentRootPath, "wwwroot", "teacher.xlsx");
|
|
// using var fs = System.IO.File.OpenRead(template);
|
|
// var wk = new XSSFWorkbook(fs);
|
|
// var sheet = wk.GetSheetAt(0);
|
|
// this.ExportInternal(sheet, model);
|
|
// using var ms = new MemoryStream();
|
|
// wk.Write(ms);
|
|
// return File(ms.ToArray(), "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", $"在编汇总_{DateTime.Now.ToString("yyyy_MM-dd_HH_mm_ss")}.xlsx");
|
|
//}
|
|
|
|
//private IQueryable<User> Query(QueryTeacherModel model)
|
|
//{
|
|
// var userName = User.Identity.Name;
|
|
// var organId = this._userRepo.ReadOnlyTable().Where(o => o.UserName == userName).Select(o => o.OrganId).FirstOrDefault();
|
|
// if (User.IsInRole("局管理员"))
|
|
// {
|
|
// model.Organs = this._organRepo.Table().ToList().Where(o => o.ParentId == null).ToList();
|
|
// }
|
|
// else
|
|
// {
|
|
// model.Organs = this._organRepo.ReadOnlyTable().ToList().Where(o => o.Id == organId).ToList();
|
|
// }
|
|
// var query = this._userRepo.ReadOnlyTable().Include(o => o.Organ).Include(o => o.Teacher).AsQueryable();
|
|
|
|
// if (User.IsInRole("局管理员"))
|
|
// {
|
|
// if (model.OrganId.HasValue)
|
|
// {
|
|
// query = query.Where(o => o.OrganId == model.OrganId.Value);
|
|
// }
|
|
// }
|
|
// else if (User.IsInRole("校管理员"))
|
|
// {
|
|
// query = query.Where(o => o.OrganId == organId);
|
|
// }
|
|
// else
|
|
// {
|
|
// query = query.Where(o => o.UserName == userName);
|
|
// }
|
|
// if (!model.OrganId.HasValue)
|
|
// {
|
|
// model.OrganId = organId;
|
|
// }
|
|
// query = query
|
|
// .WhereIf(!string.IsNullOrEmpty(model.RequestEditStatus), o => o.Teacher.RequestEditStatus == model.RequestEditStatus)
|
|
// .WhereIf(!string.IsNullOrEmpty(model.CheckStatus), o => o.Teacher.CheckStatus == model.CheckStatus)
|
|
// .WhereIf(!string.IsNullOrEmpty(model.RealName), o => o.RealName.Contains(model.RealName));
|
|
// return query;
|
|
//}
|
|
|
|
//private void ValidEditModel(EditTeacherModel model)
|
|
//{
|
|
// if (!ModelState.IsValid)
|
|
// {
|
|
// if (model.IsJobAsMaxTitle.HasValue)
|
|
// {
|
|
// if (model.IsJobAsMaxTitle.Value)
|
|
// {//最高职称聘任
|
|
// if (ModelState.ContainsKey(nameof(model.JobAsNotMaxTitleReason)))
|
|
// {
|
|
// ModelState.Remove(nameof(model.JobAsNotMaxTitleReason));
|
|
// }
|
|
// if (ModelState.ContainsKey(nameof(model.NotMaxTitle)))
|
|
// {
|
|
// ModelState.Remove(nameof(model.NotMaxTitle));
|
|
// }
|
|
// if (ModelState.ContainsKey(nameof(model.NotMaxTitleStart)))
|
|
// {
|
|
// ModelState.Remove(nameof(model.NotMaxTitleStart));
|
|
// }
|
|
// if (ModelState.ContainsKey(nameof(model.JobAsNotMaxTitleDate)))
|
|
// {
|
|
// ModelState.Remove(nameof(model.JobAsNotMaxTitleDate));
|
|
// }
|
|
// }
|
|
// else
|
|
// {
|
|
// if (ModelState.ContainsKey(nameof(model.JobAsMaxTitleDate)))
|
|
// {
|
|
// ModelState.Remove(nameof(model.JobAsMaxTitleDate));
|
|
// }
|
|
// }
|
|
// }
|
|
|
|
// if (string.IsNullOrEmpty(model.EducationGrade) && ModelState.ContainsKey(nameof(model.EducationGradeDate)))
|
|
// {//不享受待遇
|
|
// ModelState.Remove(nameof(model.EducationGradeDate));
|
|
// }
|
|
// if (model.HasPosition.HasValue)
|
|
// {
|
|
// if (model.HasPosition.Value)
|
|
// {//在编在岗
|
|
// if (ModelState.ContainsKey(nameof(model.NotOnPostReason)))
|
|
// {
|
|
// ModelState.Remove(nameof(model.NotOnPostReason));
|
|
// }
|
|
// if (ModelState.ContainsKey(nameof(model.NotOnPostReasonDate)))
|
|
// {
|
|
// ModelState.Remove(nameof(model.NotOnPostReasonDate));
|
|
// }
|
|
// if (model.IsMiddleLevel.HasValue)
|
|
// {
|
|
// if (model.IsMiddleLevel.Value)
|
|
// {//中层
|
|
// if (ModelState.ContainsKey(nameof(model.FrontTeacher)))
|
|
// {
|
|
// ModelState.Remove(nameof(model.FrontTeacher));
|
|
// }
|
|
// }
|
|
// else
|
|
// {//一线教师
|
|
// if (ModelState.ContainsKey(nameof(model.Position)))
|
|
// {
|
|
// ModelState.Remove(nameof(model.Position));
|
|
// }
|
|
// if (ModelState.ContainsKey(nameof(model.PositionStart)))
|
|
// {
|
|
// ModelState.Remove(nameof(model.PositionStart));
|
|
// }
|
|
// }
|
|
// }
|
|
// }
|
|
// else
|
|
// {//在编不在岗
|
|
// if (ModelState.ContainsKey(nameof(model.Position)))
|
|
// {
|
|
// ModelState.Remove(nameof(model.Position));
|
|
// }
|
|
// if (ModelState.ContainsKey(nameof(model.PositionStart)))
|
|
// {
|
|
// ModelState.Remove(nameof(model.PositionStart));
|
|
// }
|
|
// if (ModelState.ContainsKey(nameof(model.FrontTeacher)))
|
|
// {
|
|
// ModelState.Remove(nameof(model.FrontTeacher));
|
|
// }
|
|
// }
|
|
// }
|
|
// }
|
|
//}
|
|
|
|
//private void ExportInternal(ISheet sheet, QueryTeacherModel model)
|
|
//{
|
|
// var style = NPOIHelper.CreateStyle(sheet, fontName: "宋体", fontSize: 11);
|
|
|
|
// var headers = NPOIHelper.CreateHader(sheet, typeof(EditTeacherModel), model.Headers);
|
|
// var list = this.Query(model)
|
|
// .ToList()
|
|
// .Select(o =>
|
|
// {
|
|
// var m = o.Teacher != null ? o.Teacher.To<EditTeacherModel>() : new EditTeacherModel { Id = Guid.Empty };
|
|
// if (o.Teacher != null)
|
|
// {
|
|
// this.EntityToModel(o.Teacher, m);
|
|
// }
|
|
// m.UserId = o.Id;
|
|
// m.Organ = o.Organ.Name;
|
|
// m.RealName = o.RealName;
|
|
// return m;
|
|
// })
|
|
// .ToList();
|
|
// var rowIndex = 0;
|
|
// var colIndex = -1;
|
|
// for (int i = 0; i < list.Count; i++)
|
|
// {
|
|
// var teacher = list[i];
|
|
// var rowNumber = i + 1;
|
|
// rowIndex = i + 4;
|
|
// colIndex = -1;
|
|
// var row = sheet.CreateRow(rowIndex);
|
|
// teacher.DisplayOrder = rowNumber;
|
|
|
|
// row.Export("A", headers, () => teacher.DisplayOrder)?.SetCell(++colIndex, style, teacher.DisplayOrder);
|
|
// row.Export("B", headers, () => teacher.Organ)?.SetCell(++colIndex, style, teacher.Organ);
|
|
// row.Export("C", headers, () => teacher.RealName)?.SetCell(++colIndex, style, teacher.RealName);
|
|
// row.Export("D", headers, () => teacher.Sex)?.SetCell(++colIndex, style, teacher.Sex);
|
|
// row.Export("E", headers, () => teacher.Birthday)?.SetCell(++colIndex, style, teacher.Birthday);
|
|
// row.Export("F", headers, () => teacher.Age)?.SetCell(++colIndex, style, teacher.Age);
|
|
// row.Export("G", headers, () => teacher.Nation)?.SetCell(++colIndex, style, teacher.Nation);
|
|
// row.Export("H", headers, () => teacher.NativePlace)?.SetCell(++colIndex, style, teacher.NativePlace);
|
|
// row.Export("I", headers, () => teacher.PhoneNumber)?.SetCell(++colIndex, style, teacher.PhoneNumber);
|
|
// row.Export("J", headers, () => teacher.IdNumber)?.SetCell(++colIndex, style, teacher.IdNumber);
|
|
// row.Export("K", headers, () => teacher.JobStart)?.SetCell(++colIndex, style, teacher.JobStart);
|
|
// row.Export("L", headers, () => teacher.TeachDate)?.SetCell(++colIndex, style, teacher.TeachDate.HasValue);
|
|
// row.Export("M", headers, () => teacher.CurrentJobStart)?.SetCell(++colIndex, style, teacher.CurrentJobStart);
|
|
// row.Export("N", headers, () => teacher.JobAgeYear)?.SetCell(++colIndex, style, teacher.JobAgeYear, teacher.JobStart.HasValue);
|
|
// row.Export("O", headers, () => teacher.JobAgeMonth)?.SetCell(++colIndex, style, teacher.JobAgeMonth, teacher.JobStart.HasValue);
|
|
// row.Export("P", headers, () => teacher.Politics)?.SetCell(++colIndex, style, teacher.Politics);
|
|
// row.Export("Q", headers, () => teacher.JoinPartyDate)?.SetCell(++colIndex, style, teacher.JoinPartyDate);
|
|
// row.Export("R", headers, () => teacher.MaxTitle)?.SetCell(++colIndex, style, teacher.MaxTitle);
|
|
// row.Export("S", headers, () => teacher.MaxTitleStart)?.SetCell(++colIndex, style, teacher.MaxTitleStart);
|
|
// row.Export("T", headers, () => teacher.JobAsMaxTitleDate)?.SetCell(++colIndex, style, teacher.JobAsMaxTitleDate, teacher.IsJobAsMaxTitle.HasValue && teacher.IsJobAsMaxTitle.Value);
|
|
// row.Export("U", headers, () => teacher.JobAsNotMaxTitleReason)?.SetCell(++colIndex, style, teacher.JobAsNotMaxTitleReason, teacher.IsJobAsMaxTitle.HasValue && !teacher.IsJobAsMaxTitle.Value);
|
|
// row.Export("V", headers, () => teacher.NotMaxTitle)?.SetCell(++colIndex, style, teacher.NotMaxTitle, teacher.IsJobAsMaxTitle.HasValue && !teacher.IsJobAsMaxTitle.Value);
|
|
// row.Export("W", headers, () => teacher.NotMaxTitleStart)?.SetCell(++colIndex, style, teacher.NotMaxTitleStart, teacher.IsJobAsMaxTitle.HasValue && !teacher.IsJobAsMaxTitle.Value);
|
|
// row.Export("X", headers, () => teacher.JobAsNotMaxTitleDate)?.SetCell(++colIndex, style, teacher.JobAsNotMaxTitleDate, teacher.IsJobAsMaxTitle.HasValue && !teacher.IsJobAsMaxTitle.Value);
|
|
// row.Export("Y", headers, () => teacher.PostType)?.SetCell(++colIndex, style, teacher.PostType);
|
|
// row.Export("Z", headers, () => teacher.PostGrade)?.SetCell(++colIndex, style, teacher.PostGrade);
|
|
|
|
// row.Export("AA", headers, () => teacher.CurrentPostGradeStart)?.SetCell(++colIndex, style, teacher.CurrentPostGradeStart);
|
|
// row.Export("AB", headers, () => teacher.EducationGrade)?.SetCell(++colIndex, style, teacher.EducationGrade);
|
|
// row.Export("AC", headers, () => teacher.EducationGradeDate)?.SetCell(++colIndex, style, teacher.EducationGradeDate, !string.IsNullOrEmpty(teacher.EducationGrade));
|
|
// row.Export("AD", headers, () => teacher.FullTimeSchool)?.SetCell(++colIndex, style, teacher.FullTimeSchool);
|
|
// row.Export("AE", headers, () => teacher.FullTimeSchoolType)?.SetCell(++colIndex, style, teacher.FullTimeSchoolType);
|
|
// row.Export("AF", headers, () => teacher.FullTimeSchoolMajor)?.SetCell(++colIndex, style, teacher.FullTimeSchoolMajor);
|
|
// row.Export("AG", headers, () => teacher.FullTimeSchoolEducation)?.SetCell(++colIndex, style, teacher.FullTimeSchoolEducation);
|
|
// row.Export("AH", headers, () => teacher.FullTimeSchoolEducationDate)?.SetCell(++colIndex, style, teacher.FullTimeSchoolEducationDate);
|
|
// row.Export("AI", headers, () => teacher.JobTimeSchool)?.SetCell(++colIndex, style, teacher.JobTimeSchool);
|
|
// row.Export("AJ", headers, () => teacher.JobTimeSchoolType)?.SetCell(++colIndex, style, teacher.JobTimeSchoolType);
|
|
// row.Export("AK", headers, () => teacher.JobTimeSchoolMajor)?.SetCell(++colIndex, style, teacher.JobTimeSchoolMajor);
|
|
// row.Export("AL", headers, () => teacher.JobTimeSchoolEducation)?.SetCell(++colIndex, style, teacher.JobTimeSchoolEducation);
|
|
// row.Export("AM", headers, () => teacher.JobTimeSchoolEducationDate)?.SetCell(++colIndex, style, teacher.JobTimeSchoolEducationDate);
|
|
// row.Export("AN", headers, () => teacher.MaxEducation)?.SetCell(++colIndex, style, teacher.MaxEducation);
|
|
// row.Export("AO", headers, () => teacher.MaxDegree)?.SetCell(++colIndex, style, teacher.MaxDegree);
|
|
// row.Export("AP", headers, () => teacher.IsClassTeacher)?.SetCell(++colIndex, style, teacher.IsClassTeacher ? "是" : "否");
|
|
// row.Export("AQ", headers, () => teacher.MainTeachPeriod)?.SetCell(++colIndex, style, teacher.MainTeachPeriod);
|
|
// row.Export("AR", headers, () => teacher.MainTeachSubject)?.SetCell(++colIndex, style, teacher.MainTeachSubject);
|
|
// row.Export("AS", headers, () => teacher.MainTeachGrade)?.SetCell(++colIndex, style, teacher.MainTeachGrade);
|
|
// row.Export("AT", headers, () => teacher.OtherTeachPeriod)?.SetCell(++colIndex, style, teacher.OtherTeachPeriod);
|
|
// row.Export("AU", headers, () => teacher.OtherTeachSubject)?.SetCell(++colIndex, style, teacher.OtherTeachSubject);
|
|
// row.Export("AV", headers, () => teacher.Position)?.SetCell(++colIndex, style, teacher.Position, teacher.HasPosition.HasValue && teacher.HasPosition.Value && teacher.IsMiddleLevel.HasValue && teacher.IsMiddleLevel.Value);
|
|
// row.Export("AW", headers, () => teacher.PositionStart)?.SetCell(++colIndex, style, teacher.PositionStart, teacher.HasPosition.HasValue && teacher.HasPosition.Value && teacher.IsMiddleLevel.HasValue && teacher.IsMiddleLevel.Value);
|
|
// row.Export("AX", headers, () => teacher.FrontTeacher)?.SetCell(++colIndex, style, teacher.FrontTeacher, teacher.HasPosition.HasValue && teacher.HasPosition.Value && teacher.IsMiddleLevel.HasValue && !teacher.IsMiddleLevel.Value);
|
|
// row.Export("AY", headers, () => teacher.NotOnPostReason)?.SetCell(++colIndex, style, teacher.NotOnPostReason, teacher.HasPosition.HasValue && !teacher.HasPosition.Value);
|
|
// row.Export("AZ", headers, () => teacher.NotOnPostReasonDate)?.SetCell(++colIndex, style, teacher.NotOnPostReasonDate, teacher.HasPosition.HasValue && !teacher.HasPosition.Value);
|
|
|
|
// row.Export("BA", headers, () => teacher.TeacherCardType)?.SetCell(++colIndex, style, teacher.TeacherCardType);
|
|
// row.Export("BB", headers, () => teacher.TeacherCardSubject)?.SetCell(++colIndex, style, teacher.TeacherCardSubject);
|
|
// row.Export("BC", headers, () => teacher.TeacherCardLangLevel)?.SetCell(++colIndex, style, teacher.TeacherCardLangLevel);
|
|
// row.Export("BD", headers, () => teacher.CurrentAddressArea)?.SetCell(++colIndex, style, teacher.CurrentAddressArea);
|
|
// row.Export("BE", headers, () => teacher.CurrentAddressStreat)?.SetCell(++colIndex, style, teacher.CurrentAddressStreat);
|
|
// row.Export("BF", headers, () => teacher.Comment)?.SetCell(++colIndex, style, "");
|
|
// }
|
|
// NPOIHelper.SetColWidth(3, sheet);
|
|
//}
|
|
|
|
//private void EntityToModel(Teacher entity, EditTeacherModel model)
|
|
//{
|
|
// if (entity != null)
|
|
// {
|
|
// if (!string.IsNullOrEmpty(entity.IdNumber))
|
|
// {
|
|
// var value = entity.IdNumber.Length == 15 ? $"19{entity.IdNumber.Substring(6, 6)}" : entity.IdNumber.Substring(6, 8);
|
|
// var birthday = DateTime.ParseExact(value, "yyyyMMdd", CultureInfo.InvariantCulture);
|
|
// model.Age = DateTime.Now.Year - birthday.Year;
|
|
// }
|
|
// if (entity.JobStart.HasValue)
|
|
// {
|
|
// model.JobAgeYear = DateTime.Now.Year - entity.JobStart.Value.Year;
|
|
// model.JobAgeMonth = model.JobAgeYear * 12 + Math.Abs((entity.JobStart.Value.Month - DateTime.Now.Month));
|
|
// }
|
|
// }
|
|
//}
|
|
|
|
//private void ToEditModel(Teacher entity, EditTeacherModel model)
|
|
//{
|
|
// ViewData.SelectList(o => model.RequestEditStatus, () => this.GetRequestEditStatus(model.RequestEditStatus));
|
|
// ViewData.SelectList(o => model.CheckStatus, () => this.GetCheckStatus(model.CheckStatus));
|
|
// ViewData.SelectList(o => model.UserType, () => this.GetUserType(model.UserType));
|
|
// ViewData.SelectList(o => model.Sex, () => this.GetSex(model.Sex));
|
|
// ViewData.SelectList(o => model.Nation, () => this.GetNation(model.Nation));
|
|
// ViewData.SelectList(o => model.Politics, () => this.GetPolitics(model.Politics));
|
|
// ViewData.SelectList(o => model.MaxTitle, () => this.GetTitle(model.MaxTitle));
|
|
// ViewData.SelectList(o => model.NotMaxTitle, () => this.GetTitle(model.NotMaxTitle));
|
|
// ViewData.SelectList(o => model.PostType, () => this.GetPost(model.PostType));
|
|
// ViewData.SelectList(o => model.PostGrade, () => this.GetPostGrade(model.PostGrade));
|
|
// ViewData.SelectList(o => model.EducationGrade, () => this.GetEducationGrade(model.EducationGrade));
|
|
// ViewData.SelectList(o => model.FullTimeSchoolType, () => this.GetFullTimeSchoolType(model.FullTimeSchoolType));
|
|
// ViewData.SelectList(o => model.FullTimeSchoolEducation, () => this.GetEducation(model.FullTimeSchoolEducation));
|
|
// ViewData.SelectList(o => model.JobTimeSchoolType, () => this.GetFullTimeSchoolType(model.JobTimeSchoolType));
|
|
// ViewData.SelectList(o => model.JobTimeSchoolEducation, () => this.GetEducation(model.JobTimeSchoolEducation));
|
|
// ViewData.SelectList(o => model.MaxEducation, () => this.GetEducation(model.MaxEducation));
|
|
// ViewData.SelectList(o => model.MaxDegree, () => this.GetDegree(model.MaxDegree));
|
|
// ViewData.SelectList(o => model.MainTeachPeriod, () => this.GetTeachPeriod(model.MainTeachPeriod));
|
|
// ViewData.SelectList(o => model.MainTeachSubject, () => this.GetTeachSubject(model.MainTeachSubject));
|
|
// ViewData.SelectList(o => model.MainTeachGrade, () => this.GetTeachGrade(model.MainTeachGrade));
|
|
// ViewData.SelectList(o => model.OtherTeachPeriod, () => this.GetTeachPeriod(model.OtherTeachPeriod));
|
|
// ViewData.SelectList(o => model.OtherTeachSubject, () => this.GetTeachSubject(model.OtherTeachSubject));
|
|
// ViewData.SelectList(o => model.Position, () => this.GetPosition(model.Position));
|
|
// ViewData.SelectList(o => model.FrontTeacher, () => this.GetFrontTeacher(model.FrontTeacher));
|
|
// ViewData.SelectList(o => model.NotOnPostReason, () => this.GetNotOnPostReason(model.NotOnPostReason));
|
|
// ViewData.SelectList(o => model.TeacherCardType, () => this.GetTeacherCardType(model.TeacherCardType));
|
|
// ViewData.SelectList(o => model.TeacherCardLangLevel, () => this.GetLangLevel(model.TeacherCardLangLevel));
|
|
// ViewData.SelectList(o => model.CurrentAddressArea, () => this.GetAddressArea(model.CurrentAddressArea));
|
|
//}
|
|
|
|
//private SelectList GetRequestEditStatus(string selected)
|
|
//{
|
|
// return new string[] {
|
|
// "未申请",
|
|
// "已申请",
|
|
// }.ToSelectList(selected);
|
|
//}
|
|
|
|
//private SelectList GetCheckStatus(string selected)
|
|
//{
|
|
// return new string[] {
|
|
// "未提交",
|
|
// "待审核",
|
|
// "审核失败",
|
|
// "审核成功",
|
|
// }.ToSelectList(selected);
|
|
//}
|
|
|
|
//private SelectList GetUserType(string selected)
|
|
//{
|
|
// return new string[] {
|
|
// "在编教师",
|
|
// "区聘教师",
|
|
// "校聘教师",
|
|
// }.ToSelectList(selected);
|
|
//}
|
|
|
|
//private SelectList GetSex(string selected)
|
|
//{
|
|
// return new string[] {
|
|
// "男",
|
|
// "女",
|
|
// }.ToSelectList(selected);
|
|
//}
|
|
|
|
//private SelectList GetNation(string selected)
|
|
//{
|
|
// return new string[] {
|
|
// "汉族",
|
|
// "蒙古族",
|
|
// "回族",
|
|
// "藏族",
|
|
// "维吾尔族",
|
|
// "苗族",
|
|
// "彝族",
|
|
// "壮族",
|
|
// "布依族",
|
|
// "朝鲜族",
|
|
// "满族",
|
|
// "侗族",
|
|
// "瑶族",
|
|
// "白族",
|
|
// "土家族",
|
|
// "哈尼族",
|
|
// "哈萨克族",
|
|
// "傣族",
|
|
// "黎族",
|
|
// "傈僳族",
|
|
// "佤族",
|
|
// "畲族",
|
|
// "高山族",
|
|
// "拉祜族",
|
|
// "水族",
|
|
// "东乡族",
|
|
// "纳西族",
|
|
// "景颇族",
|
|
// "柯尔克孜族",
|
|
// "土族",
|
|
// "达斡尔族",
|
|
// "仫佬族",
|
|
// "羌族",
|
|
// "布朗族",
|
|
// "撒拉族",
|
|
// "毛难族",
|
|
// "仡佬族",
|
|
// "锡伯族",
|
|
// "阿昌族",
|
|
// "普米族",
|
|
// "塔吉克族",
|
|
// "怒族",
|
|
// "乌孜别克族",
|
|
// "俄罗斯族",
|
|
// "鄂温克族",
|
|
// "崩龙族",
|
|
// "保安族",
|
|
// "裕固族",
|
|
// "京族",
|
|
// "塔塔尔族",
|
|
// "独龙族",
|
|
// "鄂伦春族",
|
|
// "赫哲族",
|
|
// "门巴族",
|
|
// "珞巴族",
|
|
// "基诺族",
|
|
// "无"
|
|
// }.ToSelectList(selected);
|
|
//}
|
|
|
|
//private SelectList GetPolitics(string selected)
|
|
//{
|
|
// return new string[] {
|
|
// "中共党员",
|
|
// "中共预备党员",
|
|
// "共青团员",
|
|
// "群众",
|
|
// "民革会员",
|
|
// "民盟盟员",
|
|
// "民建会员",
|
|
// "民进会员",
|
|
// "农工党党员",
|
|
// "致公党党员",
|
|
// "九三学社社员",
|
|
// "台盟盟员",
|
|
// "其他民主党派",
|
|
// }.ToSelectList(selected);
|
|
//}
|
|
|
|
//private SelectList GetTitle(string selected)
|
|
//{
|
|
// return new string[] {
|
|
// "正高级教师",
|
|
// "高级教师",
|
|
// "一级教师",
|
|
// "二级教师",
|
|
// "未评",
|
|
// "工勤",
|
|
// }.ToSelectList(selected);
|
|
//}
|
|
|
|
//private SelectList GetPost(string selected)
|
|
//{
|
|
// return new string[] {
|
|
// "专技岗位",
|
|
// "管理岗位",
|
|
// "工勤岗位",
|
|
// }.ToSelectList(selected);
|
|
//}
|
|
|
|
//private SelectList GetPostGrade(string selected)
|
|
//{
|
|
// return new string[] {
|
|
// "四级",
|
|
// "五级",
|
|
// "六级",
|
|
// "七级",
|
|
// "八级",
|
|
// "九级",
|
|
// "十级",
|
|
// "十一级",
|
|
// "十二级",
|
|
// }.ToSelectList(selected);
|
|
//}
|
|
|
|
//private SelectList GetEducationGrade(string selected)
|
|
//{
|
|
// return new string[] {
|
|
// "专技十一级",
|
|
// "专技十二级",
|
|
// }.ToSelectList(selected);
|
|
//}
|
|
|
|
//private SelectList GetFullTimeSchoolType(string selected)
|
|
//{
|
|
// return new string[] {
|
|
// "师范院校师范专业",
|
|
// "师范院校非师范专业",
|
|
// "非师范院校师范专业",
|
|
// "非师范院校非师范专业",
|
|
// }.ToSelectList(selected);
|
|
//}
|
|
|
|
//private SelectList GetEducation(string selected)
|
|
//{
|
|
// return new string[] {
|
|
// "研究生博士教育",
|
|
// "研究生硕士教育",
|
|
// "大学本科教育",
|
|
// "大学专科教育",
|
|
// "中等专业教育",
|
|
// "普通高级中学教育",
|
|
// "初级中学教育",
|
|
// "小学教育",
|
|
// "其他",
|
|
// }.ToSelectList(selected);
|
|
//}
|
|
|
|
//private SelectList GetDegree(string selected)
|
|
//{
|
|
// return new string[] {
|
|
// "学士学位",
|
|
// "硕士学位",
|
|
// "博士学位",
|
|
// }.ToSelectList(selected);
|
|
//}
|
|
|
|
//private SelectList GetTeachPeriod(string selected)
|
|
//{
|
|
// return new string[] {
|
|
// "学前教育",
|
|
// "小学",
|
|
// "普通初中",
|
|
// "无",
|
|
// }.ToSelectList(selected);
|
|
//}
|
|
|
|
//private SelectList GetTeachSubject(string selected)
|
|
//{
|
|
// return new string[] {
|
|
// "语文",
|
|
// "数学",
|
|
// "英语",
|
|
// "音乐",
|
|
// "体育",
|
|
// "美术",
|
|
// "科学",
|
|
// "书法",
|
|
// "信息技术",
|
|
// "政治",
|
|
// "历史",
|
|
// "地理",
|
|
// "物理",
|
|
// "化学",
|
|
// "生物",
|
|
// "幼教全科",
|
|
// "心理健康",
|
|
// "综合实践课",
|
|
// "无",
|
|
// }.ToSelectList(selected);
|
|
//}
|
|
|
|
//private SelectList GetTeachGrade(string selected)
|
|
//{
|
|
// return new string[] {
|
|
// "九年级",
|
|
// "八年级",
|
|
// "七年级",
|
|
// "六年级",
|
|
// "五年级",
|
|
// "四年级",
|
|
// "三年级",
|
|
// "二年级",
|
|
// "一年级",
|
|
// "幼儿园大班",
|
|
// "幼儿园中班",
|
|
// "幼儿园小班",
|
|
// "无",
|
|
// }.ToSelectList(selected);
|
|
//}
|
|
|
|
//private SelectList GetPosition(string selected)
|
|
//{
|
|
// return new string[] {
|
|
// "校长",
|
|
// "副校长",
|
|
// "党支部副书记",
|
|
// "办公室主任",
|
|
// "办公室副主任",
|
|
// "教导处主任",
|
|
// "教导处副主任",
|
|
// "德育主任",
|
|
// "团支部书记",
|
|
// "大队辅导员",
|
|
// "工会主席",
|
|
// "总务主任",
|
|
// "总务副主任",
|
|
// "无",
|
|
// }.ToSelectList(selected);
|
|
//}
|
|
|
|
//private SelectList GetFrontTeacher(string selected)
|
|
//{
|
|
// return new string[] {
|
|
// "一线教师",
|
|
// "无",
|
|
// }.ToSelectList(selected);
|
|
//}
|
|
|
|
//private SelectList GetNotOnPostReason(string selected)
|
|
//{
|
|
// return new string[] {
|
|
// "长期病假",
|
|
// "产假",
|
|
// "挂职",
|
|
// "支教",
|
|
// }.ToSelectList(selected);
|
|
//}
|
|
|
|
//private SelectList GetTeacherCardType(string selected)
|
|
//{
|
|
// return new string[] {
|
|
// "幼儿园教师资格",
|
|
// "小学教师资格",
|
|
// "初级中学教师资格",
|
|
// "高级中学教师资格",
|
|
// "中等职业学校教师资格",
|
|
// "中等职业学校实习指导教师资格",
|
|
// "高等学校教师资格",
|
|
// "无",
|
|
// }.ToSelectList(selected);
|
|
//}
|
|
|
|
//private SelectList GetLangLevel(string selected)
|
|
//{
|
|
// return new string[] {
|
|
// "一级甲等",
|
|
// "一级乙等",
|
|
// "二级甲等",
|
|
// "二级乙等",
|
|
// "三级甲等",
|
|
// "无",
|
|
// }.ToSelectList(selected);
|
|
//}
|
|
|
|
//private SelectList GetAddressArea(string selected)
|
|
//{
|
|
// return new string[] {
|
|
// "城中区",
|
|
// "城北区",
|
|
// "城西区",
|
|
// "城东区",
|
|
// }.ToSelectList(selected);
|
|
//}
|
|
|
|
//private IActionResult Result<TEditModel>(object model)
|
|
//{
|
|
// if (this.IsJsonRequest())
|
|
// {
|
|
// return Json(new
|
|
// {
|
|
// schema = this.GetJsonSchema<TEditModel>(),
|
|
// model,
|
|
// errors = ModelState.Where(o => o.Value.ValidationState == ModelValidationState.Invalid),
|
|
// data = ViewData
|
|
// }, new JsonSerializerSettings { ContractResolver = new CamelCasePropertyNamesContractResolver(), ReferenceLoopHandling = ReferenceLoopHandling.Ignore });
|
|
// }
|
|
// return View(model);
|
|
//}
|
|
private List<DictionaryItem> GetItems(string category)
|
|
{
|
|
return this._directoryRepo.ReadOnlyTable()
|
|
.Where(o => o.Code == "1")
|
|
.Where(o => o.Category == category)
|
|
.OrderBy(o => o.Order)
|
|
.ToList();
|
|
}
|
|
}
|
|
} |