优化人员群组查询人员数据接口

master
xiaochanghai 1 month ago
parent aa943c93d0
commit 1fe803ac9e
  1. 1
      Tiobon.Core.Services/Ghre/Ghre_OpenClassServices.cs
  2. 5
      Tiobon.Core.Services/Ghre/Ghre_StaffGroupServices.cs
  3. 9
      Tiobon.Core.Services/Ghre/Ghre_StudyRecordServices.cs

@ -269,6 +269,7 @@ public class Ghre_OpenClassServices : BaseServices<Ghre_OpenClass, Ghre_OpenClas
public async Task<ServiceResult> InsertStaff(long Id, List<int> staffIds)
{
var entity = await base.QueryById(Id);
var stafffIds = new List<int>();
if (entity.StaffGroupId.IsNotEmptyOrNull())
{

@ -172,7 +172,7 @@ public class Ghre_StaffGroupServices : BaseServices<Ghre_StaffGroup, Ghre_StaffG
x.ZoneId = null;
x.ExclZoneId = null;
x.DeptId = null;
x.ExclDeptId = null;
x.ExclDeptId = null;
x.TitleId = null;
x.ExclTitleId = null;
x.GradeId = null;
@ -384,6 +384,9 @@ public class Ghre_StaffGroupServices : BaseServices<Ghre_StaffGroup, Ghre_StaffG
{
var x = await base.QueryById(id);
if (x is null)
return new ServicePageResult<Ghra_StaffDto>(filter.pageNum, 0, filter.pageSize, new List<Ghra_StaffDto>());
x.StaffType1s = JsonHelper.JsonToObj<List<int?>>(x.StaffType1);
x.StaffType2s = JsonHelper.JsonToObj<List<int?>>(x.StaffType2);
x.ZoneIds = JsonHelper.JsonToObj<List<int>>(x.ZoneId);

@ -1270,7 +1270,6 @@ WHERE A.Status !='Temporary' AND ( EXISTS
entitys.ForEach(x =>
{
x.ShowStudyBtn = false;
x.ShowExamBtn = false;
x.ShowRegisterBtn = false;
@ -1301,6 +1300,13 @@ WHERE A.Status !='Temporary' AND ( EXISTS
if (x.IsRequireStudy == false)
x.ShowStudyBtn = false;
if (dt >= x.CourseBeginDate && dt <= x.CourseEndDate)
x.DisableStudyBtn = false;
else
x.DisableStudyBtn = true;
if (!x.ExamId.IsNull())
{
if (x.ExamBeginDate != null && x.ExamEndDate != null)
@ -1364,7 +1370,6 @@ WHERE A.Status !='Temporary' AND ( EXISTS
#region 处理开班自动绑定学习记录
if (await Db.Queryable<Ghre_OpenClass>().Where(x => x.Id == id).AnyAsync() &&
await Db.Queryable<Ghre_OpenClassStaff>().Where(x => x.OpenClassId == id && x.StaffId == App.User.StaffId).AnyAsync() &&
!await Db.Queryable<Ghre_StudyRecord>().Where(x => x.OpenClassId == id && x.StaffId == App.User.StaffId).AnyAsync())
{
var openClass = await Db.Queryable<Ghre_OpenClass>().Where(x => x.Id == id).FirstAsync();

Loading…
Cancel
Save