Former-commit-id: 6a5da51938458eb19b3d68ccf23d0623802febf5
Former-commit-id: 78a0895b2cd000fda65690915038415e76185f82
1.0
wanggang 5 years ago
parent 944e86db1e
commit 4da5cde0e6

@ -13,7 +13,6 @@ using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
using NPOI.SS.UserModel;
using NPOI.XSSF.UserModel;
using Stateless;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
@ -90,6 +89,8 @@ namespace TeacherExt.Controllers
.OrderBy(o => o.OrganId)
.ThenBy(o => o.CreateAt);
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
orderby person.OrganId ascending, person.CreateAt ascending
select new TeacherListItem
@ -101,7 +102,9 @@ namespace TeacherExt.Controllers
sex = person.Sex,
nation = person.Nation,
placeofbirth = person.NativePlace,
person_id = person.Id
person_id = person.Id,
org_name = organ.Name,
department_name = department.Name
};
var count = query.Count();
var list = query
@ -255,6 +258,13 @@ namespace TeacherExt.Controllers
this.ModelToEntity(model, entity);
}
}
else if (entity.CheckStatus == "待审核")
{
if (model.CheckStatus == "未提交")
{
entity.CheckStatus = model.CheckStatus;
}
}
}
}
else
@ -301,6 +311,13 @@ namespace TeacherExt.Controllers
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)
{
@ -553,7 +570,7 @@ namespace TeacherExt.Controllers
var organQuery = this._organizationRepo.ReadOnlyTable();
var query = from person in personQuery
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 };
//
var nations = this.GetNation();
@ -670,25 +687,19 @@ namespace TeacherExt.Controllers
var name = model.person_name?.Trim();
var personQuery = this._personRepo.ReadOnlyTable()
.Where(o => o.IsUsed)
.Where(o => o.BureauId == bureau_id);
if (User.IsInRole("城中区教育局管理员"))
{
.Where(o => o.AreaId == 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("学校管理员"))
{
personQuery = personQuery.Where(o => o.OrganId == model.bureau_id);
}
else
if (!User.IsInRole("城中区教育局管理员") && !User.IsInRole("学校管理员"))
{
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
.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.CheckStatus), o => o.CheckStatus == model.CheckStatus);
return personQuery;

@ -51,7 +51,7 @@ namespace TeacherExt.Data
modelBuilder.Entity<Person>().Property(o => o.Id).HasColumnName("PERSON_ID").ValueGeneratedOnAdd();
modelBuilder.Entity<Person>().Property(o => o.RealName).HasColumnName("PERSON_NAME").IsRequired();
modelBuilder.Entity<Person>().Property(o => o.IsUsed).HasColumnName("B_USE").HasConversion(o => o ? 1 : 0, o => o == 1);
modelBuilder.Entity<Person>().Property(o => o.BureauId).HasColumnName("DISTRICT_ID");
modelBuilder.Entity<Person>().Property(o => o.BureauId).HasColumnName("BUREAU_ID");
modelBuilder.Entity<Person>().Property(o => o.OrganId).HasColumnName("ORG_ID");
modelBuilder.Entity<Person>().Property(o => o.Sex).HasColumnName("XB_NAME");
modelBuilder.Entity<Person>().Property(o => o.IdentityId).HasColumnName("IDENTITY_ID");

@ -12,6 +12,6 @@
public string placeofbirth { get; set; }
public string org_name { get; set; }
public int person_id { get; set; }
public string bureau_name { get; set; }
public string department_name { get; set; }
}
}

@ -5,13 +5,12 @@
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
<SatelliteResourceLanguages>en</SatelliteResourceLanguages>
<GenerateAssemblyProductAttribute>true</GenerateAssemblyProductAttribute>
<Version>1.0.0.0-beta.1</Version>
<Version>1.0.0.0-beta.4</Version>
<UserSecretsId>13a75881-1072-47ca-88e9-4d78bd678d65</UserSecretsId>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="NPOI" Version="2.5.2" />
<PackageReference Include="Stateless" Version="5.1.8" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.6.3" />
</ItemGroup>
<ItemGroup>

@ -9,7 +9,7 @@
<div class="row">
@if (isSuper)
{
<div class="col-sm-4">
<div class="col-sm-3">
<div class="card">
<div class="card-body">
<ul class="navbar-nav">
@ -19,7 +19,7 @@
</div>
</div>
}
<div class="@(isSuper?"col-sm-8":"col-sm-12")">
<div class="@(isSuper?"col-sm-9":"col-sm-12")">
<form method="post" action="/" target="_self">
<div class="card">
<div class="card-header">
@ -90,6 +90,8 @@
<th>性别</th>
<th>民族</th>
<th>籍贯</th>
<th>学校</th>
<th>部门</th>
<th>操作</th>
<th>审计</th>
</tr>
@ -106,6 +108,8 @@
<td>@item.sex</td>
<td>@item.nation_name</td>
<td>@item.placeofbirth</td>
<td>@item.org_name</td>
<td>@item.department_name</td>
<td>
@if (User.IsInRole("城中区教育局管理员"))
{
@ -186,7 +190,6 @@
checkAll.prop("indeterminate", true);
}
});
</script>
<script>
$(function () {
@ -225,8 +228,6 @@
}
});
});
</script>
<script>
$('[data-action]').click(function () {

@ -139,34 +139,44 @@
<button id="cancelModifyRequest" type="button" class="btn btn-primary">取消申请</button>
}
else
{
@if (Model.CheckStatus == "待审核")
{
<button id="submitCancelRequest" type="button" class="btn btn-primary">取消审核申请</button>
}
else if (Model.CheckStatus == "审核成功")
{
<button id="submitModifyRequest" type="button" class="btn btn-primary">申请修改</button>
}
}
}
}
else
{
@if (User.IsInRole("城中区教育局管理员") && Model.CheckStatus == "审核成功")
{
<span>教育局管理员:</span>
<button id="super" type="button" class="btn btn-primary">退回</button>
}
else if (User.IsInRole("学校管理员"))
{
@if (Model.CheckStatus == "待审核")
@if (Model.RequestEditStatus == "未申请")
{
if (Model.CheckStatus == "待审核")
{
<span>学校管理员:</span>
<button id="admin1" type="button" class="btn btn-primary">审核通过</button>
<button id="admin2" type="button" class="btn btn-primary">审核失败</button>
}
@if (Model.RequestEditStatus == "已申请")
}
else
{
if (Model.CheckStatus == "审核成功")
{
<span>学校管理员:</span>
<button id="admin3" type="button" class="btn btn-primary">批准修改申请</button>
<button id="admin4" type="button" class="btn btn-primary">拒绝修改申请</button>
}
}
}
}
</div>
</div>
</div>

@ -23,6 +23,15 @@ $('#submitCheckRequest').click(function () {
form.submit();
});
});
//待审核时取消提交审核的申请
$('#submitCancelRequest').click(function () {
var form = $(this).parents('form');
var msg = '确认' + $(this).text() + '';
submit(msg, function () {
$('#CheckStatus').val('未提交');
form.submit();
});
});
//申请修改
$('#submitModifyRequest').click(function () {
var form = $(this).parents('form');

Loading…
Cancel
Save