Compare commits
4 Commits
a1a6324b8b
...
67363cd50d
| Author | SHA1 | Date |
|---|---|---|
|
|
67363cd50d | |
|
|
abcdad03b0 | |
|
|
d0638bcfd4 | |
|
|
9dbd3e4900 |
|
|
@ -6,9 +6,11 @@ using Learn.Archives.Core.Model.Dto;
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
|
using System.Linq;
|
||||||
using System.Security.Claims;
|
using System.Security.Claims;
|
||||||
using UserCenter.Model;
|
using UserCenter.Model;
|
||||||
using UserCenter.Model.Common;
|
using UserCenter.Model.Common;
|
||||||
|
using UserCenter.Model.Enum;
|
||||||
|
|
||||||
namespace Learn.Archives.API.Controllers
|
namespace Learn.Archives.API.Controllers
|
||||||
{
|
{
|
||||||
|
|
@ -24,7 +26,7 @@ namespace Learn.Archives.API.Controllers
|
||||||
this.baseService = baseService;
|
this.baseService = baseService;
|
||||||
this.userInfo = userInfo;
|
this.userInfo = userInfo;
|
||||||
}
|
}
|
||||||
public override Task<dynamic> PageList([FromBody] QueryRequestBase model)
|
public override async Task<dynamic> PageList([FromBody] QueryRequestBase model)
|
||||||
{
|
{
|
||||||
var c = model.Conditions.FirstOrDefault(s => s.FieldName == "Grade");
|
var c = model.Conditions.FirstOrDefault(s => s.FieldName == "Grade");
|
||||||
if (c != null)
|
if (c != null)
|
||||||
|
|
@ -46,7 +48,17 @@ namespace Learn.Archives.API.Controllers
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return base.PageList(model);
|
var oldSer = model.OrderBy.ToEnum<SubjectEnum>();
|
||||||
|
if (oldSer != null)
|
||||||
|
{
|
||||||
|
model.OrderBy = "id";
|
||||||
|
var res = (PageResult<ExamUserInfo>)await base.PageList(model);
|
||||||
|
if (model.OrderByType == SqlSugar.OrderByType.Asc)
|
||||||
|
res.Data = res.Data.OrderBy(s => s.SubjectDic?[oldSer.Value]).ToList();
|
||||||
|
else
|
||||||
|
res.Data = res.Data.OrderByDescending(s => s.SubjectDic?[oldSer.Value]).ToList();
|
||||||
|
}
|
||||||
|
return await base.PageList(model);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,9 @@ using Mapster;
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using MiniExcelLibs;
|
using MiniExcelLibs;
|
||||||
|
using SqlSugar;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
|
using System.Linq.Expressions;
|
||||||
using System.Security.Claims;
|
using System.Security.Claims;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using UserCenter.Model;
|
using UserCenter.Model;
|
||||||
|
|
@ -20,20 +22,22 @@ using UserCenter.Model.Enum;
|
||||||
namespace Learn.Archives.API.Controllers
|
namespace Learn.Archives.API.Controllers
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 年级控制器
|
/// 学生接口
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class StudentController : BackController<Student>
|
public class StudentController : BackController<Student>
|
||||||
{
|
{
|
||||||
private readonly IHttpContextAccessor _httpContextAccessor;
|
private readonly IHttpContextAccessor _httpContextAccessor;
|
||||||
readonly Repository<Student> baseService;
|
readonly Repository<Student> baseService;
|
||||||
|
readonly Repository<Position> positionService;
|
||||||
readonly UserCenterService _userCenterService;
|
readonly UserCenterService _userCenterService;
|
||||||
readonly LiveUserInfo userInfo;
|
readonly LiveUserInfo userInfo;
|
||||||
public StudentController(Repository<Student> baseService, LiveUserInfo userInfo, IHttpContextAccessor httpContextAccessor, UserCenterService userCenterService) : base(baseService)
|
public StudentController(Repository<Student> baseService, LiveUserInfo userInfo, IHttpContextAccessor httpContextAccessor, UserCenterService userCenterService, Repository<Position> positionService) : base(baseService)
|
||||||
{
|
{
|
||||||
this.baseService = baseService;
|
this.baseService = baseService;
|
||||||
this.userInfo = userInfo;
|
this.userInfo = userInfo;
|
||||||
_httpContextAccessor = httpContextAccessor;
|
_httpContextAccessor = httpContextAccessor;
|
||||||
_userCenterService = userCenterService;
|
_userCenterService = userCenterService;
|
||||||
|
this.positionService = positionService;
|
||||||
}
|
}
|
||||||
|
|
||||||
[NonAction]
|
[NonAction]
|
||||||
|
|
@ -54,6 +58,42 @@ namespace Learn.Archives.API.Controllers
|
||||||
Oh.ModelError("无效数据");
|
Oh.ModelError("无效数据");
|
||||||
return await baseService.AsQueryable().FirstAsync(s => s.UserCenterId == uid);
|
return await baseService.AsQueryable().FirstAsync(s => s.UserCenterId == uid);
|
||||||
}
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// 获取职位id
|
||||||
|
/// <para> 调用流程 用户中心->档案系统</para>
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost]
|
||||||
|
public async Task<long[]> PosititonIds(PositionIdsReq[] data)
|
||||||
|
{
|
||||||
|
if (data == null || data.Count()==0)
|
||||||
|
Oh.ModelError("无效数据");
|
||||||
|
var query = new Expressionable<Position>();
|
||||||
|
foreach (var pos in data)
|
||||||
|
{
|
||||||
|
query = query.Or(q =>
|
||||||
|
q.SchoolId == pos.SchoolId &&
|
||||||
|
q.PositionType == pos.PositionType &&
|
||||||
|
q.GradeLevel == pos.GradeLevel &&
|
||||||
|
q.GraduationYear == pos.GraduationYear &&
|
||||||
|
q.PositionLevel == pos.PositionLevel
|
||||||
|
&&
|
||||||
|
(
|
||||||
|
// PositionLevel == 3:只匹配前三个字段
|
||||||
|
(pos.PositionLevel == 3) ||
|
||||||
|
// PositionLevel == 4:再加上 ClassId
|
||||||
|
(pos.PositionLevel == 4 && q.ClassId == pos.ClassId) ||
|
||||||
|
|
||||||
|
// PositionLevel == 5:再加上 ClassId + SubjectId
|
||||||
|
(pos.PositionLevel == 5 && q.ClassId == pos.ClassId && q.SubjectId == pos.SubjectId)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return await positionService.AsQueryable()
|
||||||
|
.Where(query.ToExpression())
|
||||||
|
.Select(p => p.Id).ToArrayAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 修改用户信息
|
/// 修改用户信息
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
"OtherDBArr": [
|
"OtherDBArr": [
|
||||||
{
|
{
|
||||||
"ConfigId": 1001, //用户中心
|
"ConfigId": 1001, //用户中心
|
||||||
"ConnectionString": "AllowLoadLocalInfile=true;Server=58.17.132.2;User ID=marking;Password=qwe123!@#;Port=3306;Database=usercenter;CharSet=utf8mb4;Port=43306;pooling=true;SslMode=None;",
|
"ConnectionString": "AllowLoadLocalInfile=true;Server=58.17.132.2;User ID=marking;Password=qwe123!@#;Port=3306;Database=usercenter_v1;CharSet=utf8mb4;Port=43306;pooling=true;SslMode=None;",
|
||||||
"SqlType": "MySql"
|
"SqlType": "MySql"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
{
|
{
|
||||||
"ConfigId": 1001, //用户中心
|
"ConfigId": 1001, //用户中心
|
||||||
//"ConnectionString": "AllowLoadLocalInfile=true;Server=192.168.2.9;User ID=root;Password=qwe123!@#;Port=3306;Database=usercenter;CharSet=utf8mb4;pooling=true;SslMode=None;",
|
//"ConnectionString": "AllowLoadLocalInfile=true;Server=192.168.2.9;User ID=root;Password=qwe123!@#;Port=3306;Database=usercenter;CharSet=utf8mb4;pooling=true;SslMode=None;",
|
||||||
"ConnectionString": "AllowLoadLocalInfile=true;Server=58.17.132.2;User ID=marking;Password=qwe123!@#;Port=3306;Database=usercenter;CharSet=utf8mb4;Port=43306;pooling=true;SslMode=None;",
|
"ConnectionString": "AllowLoadLocalInfile=true;Server=58.17.132.2;User ID=marking;Password=qwe123!@#;Port=3306;Database=usercenter_v1;CharSet=utf8mb4;Port=43306;pooling=true;SslMode=None;",
|
||||||
"SqlType": "MySql"
|
"SqlType": "MySql"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,6 @@
|
||||||
<PackageReference Include="SqlSugar.IOC" Version="2.0.0" />
|
<PackageReference Include="SqlSugar.IOC" Version="2.0.0" />
|
||||||
<PackageReference Include="SqlSugarCore" Version="5.1.4.170" />
|
<PackageReference Include="SqlSugarCore" Version="5.1.4.170" />
|
||||||
<PackageReference Include="System.Net.Http" Version="4.3.4" />
|
<PackageReference Include="System.Net.Http" Version="4.3.4" />
|
||||||
<PackageReference Include="UserCenter.Model" Version="1.4.3" />
|
<PackageReference Include="UserCenter.Model" Version="1.4.4" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ namespace Learn.Archives.Core.Model.Dto
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public DateTime? ExecutionTime { get; set; }
|
public DateTime? ExecutionTime { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 操作人 [后台自动赋值提交人名称]
|
/// 操作人
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string? Operator { get; set; }
|
public string? Operator { get; set; }
|
||||||
public string? ExecutionTimeStr => ExecutionTime?.ToString("yyyy-MM-dd");
|
public string? ExecutionTimeStr => ExecutionTime?.ToString("yyyy-MM-dd");
|
||||||
|
|
@ -86,6 +86,10 @@ namespace Learn.Archives.Core.Model.Dto
|
||||||
/// 解决时间
|
/// 解决时间
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public DateTime? EndTime { get; set; }
|
public DateTime? EndTime { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 反馈问题的执行记录
|
||||||
|
/// </summary>
|
||||||
|
public RecordDto[]? RecordArr { get; set; }
|
||||||
public string? EndTimeStr=> EndTime?.ToString("yyyy-MM-dd");
|
public string? EndTimeStr=> EndTime?.ToString("yyyy-MM-dd");
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,38 @@ using UserCenter.Model;
|
||||||
|
|
||||||
namespace Learn.Archives.Core.Model.Dto
|
namespace Learn.Archives.Core.Model.Dto
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
public class PositionIdsReq
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 学校编号
|
||||||
|
/// </summary>
|
||||||
|
public long SchoolId { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 年级
|
||||||
|
/// </summary>
|
||||||
|
public string GradeLevel { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 毕业届
|
||||||
|
/// </summary>
|
||||||
|
public int GraduationYear { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 班级编号
|
||||||
|
/// </summary>
|
||||||
|
public long? ClassId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 职级
|
||||||
|
/// </summary>
|
||||||
|
public int PositionLevel { get; set; }
|
||||||
|
public int? PositionType { get; set; } = 2;
|
||||||
|
/// <summary>
|
||||||
|
/// 科目
|
||||||
|
/// </summary>
|
||||||
|
public int? SubjectId { get; set; }
|
||||||
|
}
|
||||||
public class TeacherInfoImportError : TeacherInfoImport
|
public class TeacherInfoImportError : TeacherInfoImport
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
||||||
|
|
@ -89,6 +89,12 @@ namespace Learn.Archives.Core.Model
|
||||||
[SugarColumn(IsNullable = true, Length = 1000)]
|
[SugarColumn(IsNullable = true, Length = 1000)]
|
||||||
public string? ClassMeeting { get; set; }
|
public string? ClassMeeting { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 预计解决时间
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsNullable = true)]
|
||||||
|
public DateTime? EndTime { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 反馈问题数量
|
/// 反馈问题数量
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue