Former-commit-id: 626180b45b7822c6074899bfeb0ed513f865a226
Former-commit-id: d1ae691ce89e1326b317815b62c80856cfd54299
1.0
wanggang 5 years ago
parent 9c526f397d
commit 5507d9f51d

@ -590,6 +590,7 @@ namespace TeacherExt.Controllers
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.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));
@ -862,6 +863,16 @@ namespace TeacherExt.Controllers
}.ToSelectList(selected);
}
private SelectList GetNotOnPostReason(string selected)
{
return new string[] {
"长期病假",
"产假",
"挂职",
"支教",
}.ToSelectList(selected);
}
private SelectList GetTeacherCardType(string selected)
{
return new string[] {

@ -22,12 +22,10 @@ namespace TeacherExt.Entities
[Required]
public string CheckStatus { get; set; }
[Required]
public string Organ { get; set; }
public string UserType { get; set; }
[Required]
public string RealName { get; set; }
[Required]
@ -42,10 +40,8 @@ namespace TeacherExt.Entities
[Required]
public string NativePlace { get; set; }
[Required]
public string PhoneNumber { get; set; }
[Required]
public string IdNumber { get; set; }
public DateTime? JobStart { get; set; }
@ -56,17 +52,14 @@ namespace TeacherExt.Entities
public bool CurrentJobStartChecked { get; set; }
[Required]
public string Politics { get; set; }
public DateTime? JoinPartyDate { get; set; }
[Required]
public string MaxTitle { get; set; }
public bool MaxTitleChecked { get; set; }
[Required]
public DateTime? MaxTitleStart { get; set; }
public bool MaxTitleStartChecked { get; set; }
@ -93,15 +86,12 @@ namespace TeacherExt.Entities
public bool JobAsNotMaxTitleDateChecked { get; set; }
//[Required]
public string PostType { get; set; }
[Required]
public string PostGrade { get; set; }
public bool PostGradeChecked { get; set; }
[Required]
public DateTime? CurrentPostGradeStart { get; set; }
public bool CurrentPostGradeStartChecked { get; set; }
@ -114,19 +104,14 @@ namespace TeacherExt.Entities
public bool EducationGradeDateChecked { get; set; }
[Required]
public string FullTimeSchoolType { get; set; }
[Required]
public string FullTimeSchool { get; set; }
[Required]
public string FullTimeSchoolMajor { get; set; }
[Required]
public string FullTimeSchoolEducation { get; set; }
[Required]
public DateTime? FullTimeSchoolEducationDate { get; set; }
public string JobTimeSchoolType { get; set; }

@ -42,24 +42,19 @@ namespace TeacherExt.Models
[Display(Order = 0, Name = "审核状态")]
public string CheckStatus { get; set; } = "未提交";
[Description("是否使用已有字段:所属单位/学校")]
[ReadOnly(true)]
[SkipSearch, SkipList]
[Required(ErrorMessage = "必填项")]
[Display(Order = 10, Name = "工作单位")]
public string Organ { get; set; } = "测试数据";
[Description("1是否使用已有字段教师状态2选型项不一致")]
[SkipSearch, SkipList]
[SelectList]
[Display(Order = 20, Name = "人员类别")]
public string UserType { get; set; }
[Description("使用并修改已有字段[教师姓名][]")]
[ReadOnly(true)]
[Required(ErrorMessage = "必填项")]
[RegularExpression(@"^[\u4e00-\u9fa5\d]+$", ErrorMessage = "")]
[Display(Order = 30, Name = "姓名")]
[Display(Order = 30, Name = "教师姓名")]
public string RealName { get; set; }
[SkipSearch]
@ -68,11 +63,10 @@ namespace TeacherExt.Models
[Display(Order = 40, Name = "性别")]
public string Sex { get; set; }//current
[Description("使用并修改已有字段[出生日期][]")]
[SkipSearch, SkipList]
[DataType(DataType.Date)]
[Required(ErrorMessage = "必填项")]
[Display(Order = 50, Name = "出生年月")]
[Display(Order = 50, Name = "出生日期")]
public DateTime? Birthday { get; set; }
[SkipSearch, SkipList]
@ -82,7 +76,6 @@ namespace TeacherExt.Models
[NotMapped]
public int? Age { get; set; }//current
[Description("是否保留[其他]")]
[SkipSearch]
[SelectList]
[Required(ErrorMessage = "必填项")]
@ -95,24 +88,19 @@ namespace TeacherExt.Models
[Display(Order = 80, Name = "籍贯")]
public string NativePlace { get; set; }
[Description("是否必填")]
[SkipSearch, SkipList]
[DataType(DataType.PhoneNumber)]
[Required(ErrorMessage = "必填项")]
[Display(Order = 90, Name = "联系电话")]
public string PhoneNumber { get; set; }
[Description("是否必填")]
[SkipSearch, SkipList]
[RegularExpression(@"^(\d{15}|\d{17}(X|\d))$", ErrorMessage = "身份证号格式错误")]
[Required(ErrorMessage = "必填项")]
[Display(Order = 100, Name = "身份证号")]
public string IdNumber { get; set; }
[Description("是否必填")]
[SkipSearch, SkipList]
[DataType(DataType.Date)]
[Required(ErrorMessage = "必填项")]
[Display(Order = 110, Name = "参加工作时间")]
public DateTime? JobStart { get; set; }
@ -141,7 +129,6 @@ namespace TeacherExt.Models
[Description("是否必填")]
[SkipSearch, SkipList]
[SelectList]
[Required(ErrorMessage = "必填项")]
[Display(Order = 150, Name = "政治面貌")]
public string Politics { get; set; }
@ -152,7 +139,6 @@ namespace TeacherExt.Models
[SkipSearch, SkipList]
[SelectList]
[Required(ErrorMessage = "必填项")]
[Display(Order = 170, Name = "最高职称")]
public string MaxTitle { get; set; }
@ -162,7 +148,6 @@ namespace TeacherExt.Models
[SkipSearch, SkipList]
[DataType(DataType.Date)]
[Required(ErrorMessage = "必填项")]
[Display(Order = 180, Name = "最高职称取得时间")]
public DateTime? MaxTitleStart { get; set; }
@ -180,7 +165,6 @@ namespace TeacherExt.Models
[SkipSearch, SkipList]
[DataType(DataType.Date)]
[Remote(nameof(JobAsMaxTitleDate), "Ajax",AdditionalFields =nameof(IsJobAsMaxTitle))]
[Header("最高职称聘任时间")]
[Required(ErrorMessage = "必填项")]
[Display(Order = 190, Name = "最高职称聘任时间")]
public DateTime? JobAsMaxTitleDate { get; set; }
@ -193,7 +177,6 @@ namespace TeacherExt.Models
[HtmlData("JobAsMaxTitle2")]
[SkipSearch, SkipList]
[Description("如:乡村教师职评、暂未岗位变更、新考/调入等")]
[Header("最高职称聘任时间-未聘-原由")]
[Required(ErrorMessage = "必填项")]
[Display(Order = 200, Name = "最高职称未聘原由")]
public string JobAsNotMaxTitleReason { get; set; }
@ -205,7 +188,6 @@ namespace TeacherExt.Models
[HtmlData("JobAsMaxTitle2")]
[SkipSearch, SkipList]
[SelectList]
[Header("最高职称聘任时间-未聘-现聘任职称")]
[Required(ErrorMessage = "必填项")]
[Display(Order = 210, Name = "现聘任职称")]
public string NotMaxTitle { get; set; }
@ -217,7 +199,6 @@ namespace TeacherExt.Models
[HtmlData("JobAsMaxTitle2")]
[SkipSearch, SkipList]
[DataType(DataType.Date)]
[Header("最高职称聘任时间-未聘-现聘任职称取得时间")]
[Required(ErrorMessage = "必填项")]
[Display(Order = 220, Name = "现聘任职称取得时间")]
public DateTime? NotMaxTitleStart { get; set; }
@ -230,7 +211,6 @@ namespace TeacherExt.Models
[HtmlData("JobAsMaxTitle2")]
[SkipSearch, SkipList]
[DataType(DataType.Date)]
[Header("最高职称聘任时间-未聘-现聘任职称聘任时间")]
[Required(ErrorMessage = "必填项")]
[Display(Order = 230, Name = "现聘任职称聘任时间")]
public DateTime? JobAsNotMaxTitleDate { get; set; }
@ -242,14 +222,12 @@ namespace TeacherExt.Models
[Description("是否必填")]
[SkipSearch, SkipList]
[SelectList]
[Required(ErrorMessage = "必填项")]
[Display(Order = 240, Name = "岗位类别")]
public string PostType { get; set; }
[Description("excel单元格提供的选项和批注提供的不一致")]
[SkipSearch, SkipList]
[SelectList]
[Required(ErrorMessage = "必填项")]
[Display(Order = 250, Name = "现岗位等级")]
public string PostGrade { get; set; }
@ -257,10 +235,9 @@ namespace TeacherExt.Models
[Display(Order = 251, Name = "已审核")]
public bool PostGradeChecked { get; set; }
[Description("是否提示【以文件为准")]
[Description("以文件为准")]
[SkipSearch, SkipList]
[DataType(DataType.Date)]
[Required(ErrorMessage = "必填项")]
[Display(Order = 260, Name = "变更至现岗位等级时间")]
public DateTime? CurrentPostGradeStart { get; set; }
@ -277,7 +254,7 @@ namespace TeacherExt.Models
[Display(Order = 271, Name = "已审核")]
public bool EducationGradeChecked { get; set; }
[Description("是否提示【以文件为准")]
[Description("以文件为准")]
[SkipSearch, SkipList]
[DataType(DataType.Date)]
[Required(ErrorMessage = "必填项")]
@ -291,60 +268,47 @@ namespace TeacherExt.Models
[SkipSearch, SkipList]
[SelectList]
[Required(ErrorMessage = "必填项")]
[Header("全日制教育-毕业院校分类")]
[Display(Order = 290, Name = "全日制教育毕业院校分类")]
public string FullTimeSchoolType { get; set; }
[Description("是否提示【填写毕业院校全称")]
[Description("填写毕业院校全称")]
[SkipSearch, SkipList]
[Required(ErrorMessage = "必填项")]
[Header("全日制教育-毕业院校")]
[Display(Order = 300, Name = "全日制教育毕业院校")]
public string FullTimeSchool { get; set; }
[Description("是否提示【严格按照毕业证书填写")]
[Description("严格按照毕业证书填写")]
[SkipSearch, SkipList]
[Required(ErrorMessage = "必填项")]
[Header("全日制教育-毕业证书专业")]
[Display(Order = 310, Name = "全日制教育毕业证书专业")]
public string FullTimeSchoolMajor { get; set; }
[SkipSearch, SkipList]
[SelectList]
[Required(ErrorMessage = "必填项")]
[Header("全日制教育-学历")]
[Display(Order = 320, Name = "全日制教育学历")]
public string FullTimeSchoolEducation { get; set; }
[SkipSearch, SkipList]
[Required(ErrorMessage = "必填项")]
[Header("全日制教育-学历取得时间")]
[Display(Order = 330, Name = "全日制教育学历取得时间")]
[DataType(DataType.Date)]
public DateTime? FullTimeSchoolEducationDate { get; set; }
[SkipSearch, SkipList]
[SelectList]
[Header("在职教育-毕业院校分类")]
[Display(Order = 340, Name = "在职教育毕业院校分类")]
public string JobTimeSchoolType { get; set; }
[Description("是否提示【填写毕业院校全称】")]
[SkipSearch, SkipList]
[Header("在职教育-毕业院校")]
[Display(Order = 350, Name = "在职教育毕业院校")]
public string JobTimeSchool { get; set; }
[Description("是否提示【严格按照毕业证书填写】")]
[SkipSearch, SkipList]
[Header("在职教育-毕业证书专业")]
[Display(Order = 360, Name = "在职教育毕业证书专业")]
public string JobTimeSchoolMajor { get; set; }
[SkipSearch, SkipList]
[SelectList]
[Header("在职教育-学历")]
[Display(Order = 370, Name = "在职教育学历")]
public string JobTimeSchoolEducation { get; set; }
@ -355,13 +319,11 @@ namespace TeacherExt.Models
[SkipSearch, SkipList]
[SelectList]
[Required(ErrorMessage = "必填项")]
[Display(Order = 390, Name = "最高学历")]
public string MaxEducation { get; set; }
[SkipSearch, SkipList]
[SelectList]
[Required(ErrorMessage = "必填项")]
[Display(Order = 400, Name = "最高学位")]
public string MaxDegree { get; set; }
@ -429,15 +391,15 @@ namespace TeacherExt.Models
[HtmlData("HasPosition1")]
[SkipSearch, SkipList]
[SelectList]
[Required(ErrorMessage = "必填项")]
[Display(Order = 464, Name = "是否中层")]
public bool? IsMiddleLevel { get; set; }
[Description("是否提示【选择项中没有则手动填写")]
[Description("选择项中没有则手动填写")]
[HtmlData("HasPosition11")]
[SkipSearch, SkipList]
[SelectList(true)]
[Required(ErrorMessage = "必填项")]
[Header("在编人员在岗情况-在编在岗-是-职务")]
[Display(Order = 470, Name = "职务")]
public string Position { get; set; }
@ -449,28 +411,26 @@ namespace TeacherExt.Models
[SkipSearch, SkipList]
[DataType(DataType.Date)]
[Required(ErrorMessage = "必填项")]
[Header("在编人员在岗情况-在编在岗-是-任命时间")]
[Display(Order = 480, Name = "任命时间")]
[Display(Order = 480, Name = "职务任命时间")]
public DateTime? PositionStart { get; set; }
[SkipSearch, SkipList]
[Display(Order = 481, Name = "已审核")]
public bool PositionStartChecked { get; set; }
[Description("是否显示【填写所教学科全称")]
[Description("填写所教学科全称")]
[HtmlData("HasPosition12")]
[SkipSearch, SkipList]
[Header("在编人员在岗情况-在编在岗-否 (一线教师")]
[Required(ErrorMessage = "必填项")]
[Display(Order = 490, Name = "在编在岗一线教师")]
[Display(Order = 490, Name = "一线教师")]
public string FrontTeacher { get; set; }
[HtmlData("HasPosition2")]
[SkipSearch, SkipList]
[Description("是否显示【长期病假 产假 挂职 支教 其他(请写出具体原因)】")]
[Header("在编人员在岗情况-在编不在岗-原由")]
[SelectList(true)]
[Description("选择项中没有则手动填写")]
[Required(ErrorMessage = "必填项")]
[Display(Order = 500, Name = "在编不在岗原由")]
[Display(Order = 500, Name = "不在岗原由")]
public string NotOnPostReason { get; set; }
[SkipSearch, SkipList]
@ -480,9 +440,8 @@ namespace TeacherExt.Models
[HtmlData("HasPosition2")]
[SkipSearch, SkipList]
[DataType(DataType.Date)]
[Header("在编人员在岗情况-在编在不岗-不在岗 起始时间")]
[Required(ErrorMessage = "必填项")]
[Display(Order = 510, Name = "在编在不岗起始时间")]
[Display(Order = 510, Name = "岗起始时间")]
public DateTime? NotOnPostReasonDate { get; set; }
[SkipSearch, SkipList]
@ -491,7 +450,6 @@ namespace TeacherExt.Models
[SkipSearch, SkipList]
[SelectList]
[Header("教师资格证 种类")]
[Display(Order = 520, Name = "教师资格证种类")]
public string TeacherCardType { get; set; }
@ -507,18 +465,16 @@ namespace TeacherExt.Models
[SkipSearch, SkipList]
[SelectList(true)]
[Required(ErrorMessage = "必填项")]
[Display(Order = 550, Name = "现家庭详细地址-区县")]
public string CurrentAddressArea { get; set; }
[SkipSearch, SkipList]
[Required(ErrorMessage = "必填项")]
[Header("现家庭详细地址(街道-门牌号)")]
[Display(Order = 560, Name = "详细地址(街道-门牌号)")]
[Display(Order = 560, Name = "现家庭详细地址")]
public string CurrentAddressStreat { get; set; }
[SkipSearch, SkipList]
[Display(Order = 570, Name = "备注")]
[Display(Order = 570, Name = "审核失败原因")]
public string Comment { get; set; }
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)

@ -51,13 +51,14 @@ namespace TeacherExt
.AllowAnyHeader()
.AllowCredentials();
}));
var connstr = HostEnvironment.IsDevelopment() ? Configuration.GetConnectionString("sqlite") : Configuration.GetConnectionString("mysql");
if (HostEnvironment.IsDevelopment())
var database = Configuration.GetValue<string>("database");
if (database=="sqlite")
{
services.AddDbContext<TeacherDbContext>(o => o.UseSqlite(connstr));
services.AddDbContext<TeacherDbContext>(o => o.UseSqlite(Configuration.GetConnectionString("sqlite")));
}
else
{
var connstr = Configuration.GetConnectionString("mysql");
services.AddDbContext<TeacherDbContext>(o => o.UseMySql(connstr, ServerVersion.AutoDetect(connstr)));
}
services.AddDistributedMemoryCache();

@ -25,22 +25,32 @@
continue;
}
var uihit = prop.DataTypeName ?? prop.TemplateHint;
<div class="col-sm-6">
<div class="col-sm-4">
<div class="form-group row" title="@uihit">
@Html.Label(prop.PropertyName, prop.GetDisplayName() + "", new { @class = "col-sm-4 col-form-label" })
<div class="col-sm-8">
@Html.Label(prop.PropertyName, prop.GetDisplayName() + "", new { @class = "col-sm-5 col-form-label" })
<div class="col-sm-6">
<div class="form-control" style="border-color:transparent;height:auto;padding-left:0;">
@Html.Hidden(prop.PropertyName)
@Html.Display(prop.PropertyName, uihit)
@{
var checkedProp = props.FirstOrDefault(o => o.PropertyName == prop.PropertyName + "Checked");
@if (checkedProp != null)
{
@Html.CheckBox(checkedProp.PropertyName, new { @class = "is-checked", title = "审核" })
}
@if (prop.PropertyName.EndsWith("Comment"))
{
@Html.Editor(prop.PropertyName, uihit)
}
else
{
@Html.Hidden(prop.PropertyName)
@Html.Display(prop.PropertyName, uihit)
}
</div>
</div>
<div class="col-sm-1">
@{
var checkedProp = props.FirstOrDefault(o => o.PropertyName == prop.PropertyName + "Checked");
@if (checkedProp != null)
{
@Html.CheckBox(checkedProp.PropertyName, new { @class = "is-checked", title = "审核" })
}
}
</div>
</div>
</div>
}

@ -29,6 +29,7 @@
var isReadOnly = metadata.Attributes.Attributes.Any(o => o.GetType() == typeof(ReadOnlyAttribute));
var isDisplayOnly = metadata.Attributes.Attributes.Any(o => o.GetType() == typeof(DisplayOnlyAttribute));
var isHidden = metadata.Attributes.Attributes.Any(o => o.GetType() == typeof(HiddenInputAttribute));
var desc = (metadata.Attributes.Attributes.OfType<DescriptionAttribute>().FirstOrDefault() as DescriptionAttribute)?.Description;
if (prop.PropertyName.EndsWith("Checked"))
{
continue;
@ -48,11 +49,11 @@
continue;
}
var uihit = prop.DataTypeName ?? prop.TemplateHint;
<div class="col-sm-6">
<div class="col-sm-4">
<div class="form-group row @prop.ModelType.Name @uihit">
@Html.Label(prop.PropertyName, prop.GetDisplayName() + "", new { @class = "col-sm-4 col-form-label" })
<div class="col-sm-4">
@if (isReadOnly)
@Html.Label(prop.PropertyName, prop.GetDisplayName() + "", new { @class = "col-sm-5 col-form-label" })
<div class="col-sm-6" title="@desc">
@if (isReadOnly|| prop.PropertyName.EndsWith("Comment"))
{
<div class="form-control" style="border-color:transparent;height:auto;padding-left:0;">
@Html.Hidden(prop.PropertyName)
@ -89,18 +90,6 @@
}
}
</div>
<div class="col-sm-3">
@{
if (metadata != null)
{
var attr = metadata.Attributes.Attributes.OfType<DescriptionAttribute>().FirstOrDefault() as DescriptionAttribute;
if (attr != null && attr.Description != null)
{
<span class="form-control form-control-display">@attr.Description</span>
}
}
}
</div>
</div>
</div>
}

@ -91,9 +91,21 @@
<td>@item.Nation</td>
<td>@item.NativePlace</td>
<td>
@if (User.IsInRole("局管理员") || User.IsInRole("校管理员"))
@if (User.IsInRole("局管理员") && Model.CheckStatus == "待局级审核")
{
<a href="@Url.Action("Details",new { userId=item.UserId})">审核</a>
<a href="@Url.Action("Details", new { userId = item.UserId })">审核</a>
}
@if (User.IsInRole("校管理员") && Model.CheckStatus == "待校级审核")
{
<a href="@Url.Action("Details", new { userId = item.UserId })">审核</a>
}
@if (User.IsInRole("局管理员") && Model.CheckStatus == "局级审核成功")
{
<a href="@Url.Action("Details", new { userId = item.UserId })">重置</a>
}
@if (User.IsInRole("校管理员") && Model.CheckStatus == "待校级审核")
{
<a href="@Url.Action("Details", new { userId = item.UserId })">重置</a>
}
</td>
<td>

@ -5,5 +5,16 @@
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"AllowedHosts": "*",
"database": "sqlite",
"jwt": {
"key": "111111111111111111111111",
"issuer": "111111111111111111111111",
"audience": "111111111111111111111111"
},
"ConnectionStrings": {
"sqlite": "Data Source=data.db",
"mysql": "Server=localhost;Port=3306;Database=teacher;Uid=root;Pwd=aA123456!;"
}
}

@ -7,6 +7,7 @@
}
},
"AllowedHosts": "*",
"database": "mysql",
"jwt": {
"key": "111111111111111111111111",
"issuer": "111111111111111111111111",

Loading…
Cancel
Save