From c104b7d5e9ee526ac0ede46d53c050b35830197f Mon Sep 17 00:00:00 2001 From: xiaochanghai Date: Wed, 16 Apr 2025 16:17:34 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E6=B5=81=E7=A8=8B=20?= =?UTF-8?q?=E5=B9=B4=E5=BA=A6=E4=BA=BA=E5=8A=9B=E9=85=8D=E7=BD=AE=E7=94=B3?= =?UTF-8?q?=E8=AF=B7=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Ghrh/Ghrh_YearHumanApplyOrder.Dto.View.cs | 2 +- .../Ghrh/Ghrh_YearHumanApplyOrderServices.cs | 55 ++++++++++++++++++- .../Ghrh/Ghrh_YearHumanSettingsServices.cs | 14 ++++- 3 files changed, 67 insertions(+), 4 deletions(-) diff --git a/Tiobon.Core.Model/View/Ghrh/Ghrh_YearHumanApplyOrder.Dto.View.cs b/Tiobon.Core.Model/View/Ghrh/Ghrh_YearHumanApplyOrder.Dto.View.cs index 87ad1823..2a560e3d 100644 --- a/Tiobon.Core.Model/View/Ghrh/Ghrh_YearHumanApplyOrder.Dto.View.cs +++ b/Tiobon.Core.Model/View/Ghrh/Ghrh_YearHumanApplyOrder.Dto.View.cs @@ -32,5 +32,5 @@ public class Ghrh_YearHumanApplyOrderDto : Ghrh_YearHumanApplyOrder /// public string UpdateDataInfo { get; set; } - public List Items { get; set; } + public List Items { get; set; } } diff --git a/Tiobon.Core.Services/Ghrh/Ghrh_YearHumanApplyOrderServices.cs b/Tiobon.Core.Services/Ghrh/Ghrh_YearHumanApplyOrderServices.cs index e7cffb7a..162f39cd 100644 --- a/Tiobon.Core.Services/Ghrh/Ghrh_YearHumanApplyOrderServices.cs +++ b/Tiobon.Core.Services/Ghrh/Ghrh_YearHumanApplyOrderServices.cs @@ -1,4 +1,6 @@ -namespace Tiobon.Core.Services; +using System.Data; + +namespace Tiobon.Core.Services; /// /// 年度人力申请 (服务) @@ -19,7 +21,56 @@ public class Ghrh_YearHumanApplyOrderServices : BaseServices x.WorkID == objId); if (entity != null) - entity.Items = await Db.Queryable().Where(x => x.OrderId == entity.Id).ToListAsync(); + { + var items = await Db.Queryable().Where(x => x.OrderId == entity.Id).ToListAsync(); + + entity.Items = Mapper.Map(items).ToANew>(); + if (entity.Items.Any()) + { + + var deptIds = entity.Items.Select(x => x.DeptId).Distinct().ToList(); + var titleIds = entity.Items.Select(x => x.TitleId).Distinct().ToList(); + var jobIds = entity.Items.Select(x => x.JobId).Distinct().ToList(); + var gradeIds = entity.Items.Select(x => x.GradeId).Distinct().ToList(); + + if (deptIds.Any()) + { + var depts = await Db.Queryable().Where(x => deptIds.Contains(x.DeptID)).Select(x => new { x.DeptID, x.DeptName }).ToListAsync(); + entity.Items.ForEach(x => x.DeptName = depts.FirstOrDefault(o => x.DeptId == o.DeptID)?.DeptName); + } + + if (titleIds.Any()) + { + var titles = await Db.Queryable().Where(x => titleIds.Contains(x.TitleID)).ToListAsync(); + + entity.Items.ForEach(rule => + { + rule.TitleName = titles.FirstOrDefault(o => rule.TitleId == o.TitleID)?.TitleName; + }); + } + + if (gradeIds.Any()) + { + var grades = await Db.Queryable().Where(x => gradeIds.Contains(x.GradeID)).ToListAsync(); + + entity.Items.ForEach(rule => + { + rule.GradeName = grades.FirstOrDefault(o => rule.GradeId == o.GradeID)?.GradeName; + }); + } + + if (jobIds.Any()) + { + var jobs = await Db.Queryable().Where(x => jobIds.Contains(x.JobID)).ToListAsync(); + + entity.Items.ForEach(rule => + { + rule.JobName = jobs.FirstOrDefault(o => rule.JobId == o.JobID)?.JobName; + }); + } + } + } + return ServiceResult.OprateSuccess("查询成功!", entity); } diff --git a/Tiobon.Core.Services/Ghrh/Ghrh_YearHumanSettingsServices.cs b/Tiobon.Core.Services/Ghrh/Ghrh_YearHumanSettingsServices.cs index 03d3a1e0..fe2140b8 100644 --- a/Tiobon.Core.Services/Ghrh/Ghrh_YearHumanSettingsServices.cs +++ b/Tiobon.Core.Services/Ghrh/Ghrh_YearHumanSettingsServices.cs @@ -242,7 +242,19 @@ public class Ghrh_YearHumanSettingsServices : BaseServices x.rowNum).ToList(); #endregion - return ServiceResult>.OprateSuccess("查询成功!", flowReturn.result.JM_TableColumnT1.TableColumn); ; + flowReturn.result.JM_TableColumnT1.TableColumn.ForEach(x => + { + if (x.field == "DeptId") + x.field = "DeptName"; + else if (x.field == "TitleId") + x.field = "TitleName"; + else if (x.field == "JobId") + x.field = "JobName"; + else if (x.field == "GradeId") + x.field = "GradeName"; + }); + + return ServiceResult>.OprateSuccess("查询成功!", flowReturn.result.JM_TableColumnT1.TableColumn); } From c36c2abb71ade101600be23b58b71e1e99ad8458 Mon Sep 17 00:00:00 2001 From: xiaochanghai Date: Wed, 16 Apr 2025 16:36:34 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E5=9F=B9=E8=AE=AD=E9=9C=80=E6=B1=82?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E9=A1=B5=E9=9D=A2=E5=A2=9E=E5=8A=A0=E2=80=9C?= =?UTF-8?q?=E5=9F=B9=E8=AE=AD=E7=B1=BB=E5=88=AB=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Ghre/Ghre_RequestServices.cs | 11 +- Tiobon.Core/Tiobon.Core.Model.xml | 610 ++++++++++++++++++ Tiobon.Core/Tiobon.Core.xml | 10 + 3 files changed, 629 insertions(+), 2 deletions(-) diff --git a/Tiobon.Core.Services/Ghre/Ghre_RequestServices.cs b/Tiobon.Core.Services/Ghre/Ghre_RequestServices.cs index b2dfa774..24447225 100644 --- a/Tiobon.Core.Services/Ghre/Ghre_RequestServices.cs +++ b/Tiobon.Core.Services/Ghre/Ghre_RequestServices.cs @@ -282,6 +282,7 @@ FROM Ghre_Request A YearMonth1 YearMonthLabel, DeptName, TrainClass, + TrainCategory, TrainLevel, InOrOut FROM (SELECT A.Id, @@ -293,6 +294,7 @@ FROM Ghre_Request A ISNULL (B.DeptId, D.DeptId) DeptId, ISNULL (A.RequestNum, 1) RequestNum, A.TrainClass, + A.TrainCategory, A.CourseSource, A.RequestSource, TrainLevel, @@ -307,6 +309,7 @@ FROM Ghre_Request A YearMonth1, DeptName, TrainClass, + TrainCategory, TrainLevel, InOrOut) A ORDER BY {filter.orderBy}"; @@ -319,6 +322,7 @@ FROM Ghre_Request A YearMonth1 YearMonthLabel, DeptName, TrainClass, + TrainCategory, TrainLevel, InOrOut FROM (SELECT A.Id, @@ -331,8 +335,9 @@ FROM Ghre_Request A ISNULL (B.DeptName, D.DeptName) DeptName, ISNULL (B.DeptId, D.DeptId) DeptId, ISNULL (A.RequestNum, 1) RequestNum, - A.TrainClass, A.CourseSource, - + A.TrainClass, + A.TrainCategory, + A.CourseSource, TrainLevel, A.RequestSource, A.InOrOut, @@ -346,6 +351,7 @@ FROM Ghre_Request A YearMonth1, DeptName, TrainClass, + TrainCategory, TrainLevel, InOrOut) A ORDER BY {filter.orderBy}"; @@ -354,6 +360,7 @@ FROM Ghre_Request A result.ForEach(async x => { x.TrainClassLabel = await GetParaLabel("TrainingRequestTrainClass", x.TrainClass); + x.TrainCategory = await GetParaLabel("TrainingCategory", x.TrainCategory); x.TrainLevelLabel = await GetParaLabel("TrainingRequestTrainLevel", x.TrainLevel); x.InOrOutLabel = await GetParaLabel("CourseInOrOut", x.InOrOut); x.TeacherClassLabel = await GetParaLabel("TrainingTeacherType", x.InOrOut); diff --git a/Tiobon.Core/Tiobon.Core.Model.xml b/Tiobon.Core/Tiobon.Core.Model.xml index 2c356a5e..87724ead 100644 --- a/Tiobon.Core/Tiobon.Core.Model.xml +++ b/Tiobon.Core/Tiobon.Core.Model.xml @@ -14465,6 +14465,286 @@ DeptDataType + + + 考核期间 (Dto.Base) + + + + + 期间编号 + + + + + 期间名称 + + + + + 考核周期类别ID + + + + + 考核周期类别 + + + + + 考核阶段数 + + + + + 阶段名称 + + + + + 当期类别 + + + + + 当期是否启用 + + + + + 期间开始日 + + + + + 期间结束日 + + + + + 员工填写开始日 + + + + + 员工填写结束日 + + + + + 主管填写开始日 + + + + + 主管填写结束日 + + + + + 人员状态基准日 + + + + + 前置期间 + + + + + 备注 + + + + + 排序 + + + + + 默认标志 + + + + + 预留字段1 + + + + + 预留字段2 + + + + + 预留字段3 + + + + + 预留字段4 + + + + + 预留字段5 + + + + + 预留字段6 + + + + + 预留字段7 + + + + + 预留字段8 + + + + + 预留字段9 + + + + + 预留字段10 + + + + + 预留字段11 + + + + + 预留字段12 + + + + + 内置 + + + + + 考核周期类别 (Dto.Base) + + + + + 类别编号 + + + + + 类别名称 + + + + + 多语编号 + + + + + 考核阶段数 + + + + + 考核阶段名称 + + + + + 集团数据归属ID + + + + + 备注 + + + + + 排序 + + + + + 默认标志 + + + + + 预留字段1 + + + + + 预留字段2 + + + + + 预留字段3 + + + + + 预留字段4 + + + + + 预留字段5 + + + + + 预留字段6 + + + + + 预留字段7 + + + + + 预留字段8 + + + + + 预留字段9 + + + + + 预留字段10 + + + + + 预留字段11 + + + + + 预留字段12 + + + + + 内置 + + Ghrs_Attachment (Dto.Base) @@ -16552,6 +16832,16 @@ Ghro_Dept (Dto.EditInput) + + + 考核期间 (Dto.EditInput) + + + + + 考核周期类别 (Dto.EditInput) + + Ghrs_Attachment (Dto.EditInput) @@ -17148,6 +17438,16 @@ Ghro_Dept (Dto.InsertInput) + + + 考核期间 (Dto.InsertInput) + + + + + 考核周期类别 (Dto.InsertInput) + + Ghrs_Attachment (Dto.InsertInput) @@ -31847,6 +32147,286 @@ DeptDataType + + + 考核期间 (Model) + + + + + 期间编号 + + + + + 期间名称 + + + + + 考核周期类别ID + + + + + 考核周期类别 + + + + + 考核阶段数 + + + + + 阶段名称 + + + + + 当期类别 + + + + + 当期是否启用 + + + + + 期间开始日 + + + + + 期间结束日 + + + + + 员工填写开始日 + + + + + 员工填写结束日 + + + + + 主管填写开始日 + + + + + 主管填写结束日 + + + + + 人员状态基准日 + + + + + 前置期间 + + + + + 备注 + + + + + 排序 + + + + + 默认标志 + + + + + 预留字段1 + + + + + 预留字段2 + + + + + 预留字段3 + + + + + 预留字段4 + + + + + 预留字段5 + + + + + 预留字段6 + + + + + 预留字段7 + + + + + 预留字段8 + + + + + 预留字段9 + + + + + 预留字段10 + + + + + 预留字段11 + + + + + 预留字段12 + + + + + 内置 + + + + + 考核周期类别 (Model) + + + + + 类别编号 + + + + + 类别名称 + + + + + 多语编号 + + + + + 考核阶段数 + + + + + 考核阶段名称 + + + + + 集团数据归属ID + + + + + 备注 + + + + + 排序 + + + + + 默认标志 + + + + + 预留字段1 + + + + + 预留字段2 + + + + + 预留字段3 + + + + + 预留字段4 + + + + + 预留字段5 + + + + + 预留字段6 + + + + + 预留字段7 + + + + + 预留字段8 + + + + + 预留字段9 + + + + + 预留字段10 + + + + + 预留字段11 + + + + + 预留字段12 + + + + + 内置 + + Ghrs_Attachment (Model) @@ -36633,6 +37213,36 @@ 修改信息 + + + 考核期间(Dto.View1) + + + + + 创建信息 + + + + + 修改信息 + + + + + 考核周期类别(Dto.View1) + + + + + 创建信息 + + + + + 修改信息 + + Ghrs_Attachment(Dto.View) diff --git a/Tiobon.Core/Tiobon.Core.xml b/Tiobon.Core/Tiobon.Core.xml index 3eab8aa5..1e290c27 100644 --- a/Tiobon.Core/Tiobon.Core.xml +++ b/Tiobon.Core/Tiobon.Core.xml @@ -2175,6 +2175,16 @@ Ghro_Dept(Controller) + + + 考核期间(Controller) + + + + + 考核周期类别(Controller) + + Ghrs_Attachment(Controller) From 76e60223cb593ffdab1db01eeee0ed34eb06ee6e Mon Sep 17 00:00:00 2001 From: xiaochanghai Date: Wed, 16 Apr 2025 17:29:38 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=80=9A=E7=94=A8excel?= =?UTF-8?q?=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Tiobon.Core.Services/BASE/BaseServices.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tiobon.Core.Services/BASE/BaseServices.cs b/Tiobon.Core.Services/BASE/BaseServices.cs index c156a5fa..e8f22b10 100644 --- a/Tiobon.Core.Services/BASE/BaseServices.cs +++ b/Tiobon.Core.Services/BASE/BaseServices.cs @@ -800,7 +800,7 @@ public class BaseServices : IBaseServ FROM Ghrs_PageSettingQuery WHERE IsEnable = 1 AND PageNo = '{body.menuName}' - AND (defaultHidden = 'false' OR defaultHidden is null) + AND (defaultHidden = 'false' OR defaultHidden is null OR defaultHidden ='') ORDER BY SortNo ASC"; var columns = DbAccess.QueryList(sql); From e8e77b8a989369594d352b0b24a190cfed2fe4ce Mon Sep 17 00:00:00 2001 From: xiaochanghai Date: Thu, 17 Apr 2025 10:32:37 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E8=AE=A1=E5=88=92=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E5=AE=9A=E5=88=B6Excel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Tiobon.Core.Services/Ghre/Ghre_PlanServices.cs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Tiobon.Core.Services/Ghre/Ghre_PlanServices.cs b/Tiobon.Core.Services/Ghre/Ghre_PlanServices.cs index 8ffeef14..0250c1ab 100644 --- a/Tiobon.Core.Services/Ghre/Ghre_PlanServices.cs +++ b/Tiobon.Core.Services/Ghre/Ghre_PlanServices.cs @@ -483,7 +483,7 @@ public class Ghre_PlanServices : BaseServices.OprateSuccess("计划暂存_" + DateTimeHelper.ConvertToSecondString1(DateTime.Now) + ".xlsx", physicsPath1); else return ServiceResult.OprateSuccess("计划维护_" + DateTimeHelper.ConvertToSecondString1(DateTime.Now) + ".xlsx", physicsPath1); @@ -587,8 +587,7 @@ public class Ghre_PlanServices : BaseServices().Where(o => value1.Contains(o.StaffName) || value1.Contains(o.StaffNo) || value1.Contains(o.StaffEname)).Select(x => x.StaffID).ToListAsync(); - dict.Add("Month", JsonHelper.ObjToJson(ids)); + dict.Add("Month", JsonHelper.ObjToJson(value2)); } else { @@ -689,9 +688,9 @@ public class Ghre_PlanServices : BaseServices { - if (menuName == "F_TrainPlan_Wait") + if (menuName == "F_TrainPlan_Wait" || menuName == "F_UshioTrainPlan_Wait") x.Add("Status", "Wait"); - else if (menuName == "F_TrainPlan_Temporary") + else if (menuName == "F_TrainPlan_Temporary" || menuName == "F_UshioTrainPlan_Temporary") x.Add("Status", "Temporary"); }); await Db.Insertable(dictList).AS(entityType.GetEntityTableName()).ExecuteCommandAsync(); From 9adea0cedf28af57366fbe04889e77e64c7e5d21 Mon Sep 17 00:00:00 2001 From: xiaochanghai Date: Thu, 17 Apr 2025 10:47:26 +0800 Subject: [PATCH 5/6] 1 --- Tiobon.Core.Services/Ghre/Ghre_ExamServices.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tiobon.Core.Services/Ghre/Ghre_ExamServices.cs b/Tiobon.Core.Services/Ghre/Ghre_ExamServices.cs index eed195d4..bc3b36db 100644 --- a/Tiobon.Core.Services/Ghre/Ghre_ExamServices.cs +++ b/Tiobon.Core.Services/Ghre/Ghre_ExamServices.cs @@ -1466,7 +1466,7 @@ public class Ghre_ExamServices : BaseServices Date: Thu, 17 Apr 2025 14:50:34 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=80=83=E8=AF=95?= =?UTF-8?q?=E9=9A=8F=E6=9C=BA=E5=87=BA=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Ghre/Ghre_CourseSceneServices.cs | 9 ++++--- .../Ghre/Ghre_ExamPaperServices.cs | 3 +-- .../Ghre/Ghre_ExamRecordServices.cs | 25 +++++++++++++++---- .../Ghre/Ghre_ExamServices.cs | 12 ++++----- 4 files changed, 33 insertions(+), 16 deletions(-) diff --git a/Tiobon.Core.Services/Ghre/Ghre_CourseSceneServices.cs b/Tiobon.Core.Services/Ghre/Ghre_CourseSceneServices.cs index 87ac36eb..6ff3902c 100644 --- a/Tiobon.Core.Services/Ghre/Ghre_CourseSceneServices.cs +++ b/Tiobon.Core.Services/Ghre/Ghre_CourseSceneServices.cs @@ -34,9 +34,12 @@ public class Ghre_CourseSceneServices : BaseServices(); }); - var coures = await Db.Queryable().Where(x => x.CourseSceneIds != null && (x.CourseSceneIds.Contains(body.id.ObjToString()) || x.CourseSceneId == body.id) && x.Status == Consts.DIC_COURSE_STATUS.RELEASED).ToListAsync(); - if (DT_TableDataT1.Any()) - DT_TableDataT1[0].Courses = coures; + if (body.id.IsNotEmptyOrNull()) + { + var coures = await Db.Queryable().Where(x => x.CourseSceneIds != null && (x.CourseSceneIds.Contains(body.id.ObjToString()) || x.CourseSceneId == body.id) && x.Status == Consts.DIC_COURSE_STATUS.RELEASED).ToListAsync(); + if (DT_TableDataT1.Any()) + DT_TableDataT1[0].Courses = coures; + } result.result.DT_TableDataT1 = DT_TableDataT1; return result; } diff --git a/Tiobon.Core.Services/Ghre/Ghre_ExamPaperServices.cs b/Tiobon.Core.Services/Ghre/Ghre_ExamPaperServices.cs index 49256d89..d609195b 100644 --- a/Tiobon.Core.Services/Ghre/Ghre_ExamPaperServices.cs +++ b/Tiobon.Core.Services/Ghre/Ghre_ExamPaperServices.cs @@ -1,5 +1,4 @@ using MongoDB.Driver.Linq; -using NPOI.SS.Formula.Functions; using System.Net; using System.Text.RegularExpressions; @@ -608,7 +607,7 @@ public class Ghre_ExamPaperServices : BaseServices x.Id == examRecordId || x.StudyRecordId == examRecordId); examRecordId = record.Id; - var details = await Db.Queryable().Where(x => x.ExamRecordId == record.Id).ToListAsync(); - var detailIds = details.Select(x => x.Id).ToList(); - var recordAnswers = await Db.Queryable() + using var _context = ContextFactory.CreateContext(); + + var src = _context.Ghre_ExamRecordDetail.Where(x => x.ExamRecordId == record.Id); + var src1 = _context.Ghre_ExamRecordAnswer .OrderBy(x => x.TaxisNo) - .Where(x => x.ExamRecordDetailId != null && detailIds.Contains(x.ExamRecordDetailId.Value)) + .Where(x => x.ExamRecordDetailId != null && x.ExamRecordId == record.Id); + + if (groupId != null) + src = src.Where(x => x.GroupId == groupId); + else + src = src.Where(x => x.IsEnable == 1); + + var details = await src + .ToListAsync(); + var detailIds = details.Select(x => x.Id).ToList(); + + src1 = src1.Where(x => detailIds.Contains(x.ExamRecordDetailId.Value)); + + var recordAnswers = await src1 .ToListAsync(); if (record.ScoreStatus == Consts.DIC_EXAM_RECORD_SCORE_STATUS.NO_SCORE) await ExamHelper.SystemMarkAsync(Db, record, details, recordAnswers); @@ -636,7 +651,7 @@ public class Ghre_ExamRecordServices : BaseServices new { it.ExamId }).ExecuteCommandAsync(); #endregion - if (entity.DateType == DicExamDateType.EXAM_DATE) - { - courseEndTime = entity.EndTime.Value.Date.AddDays(1); - courseTime = courseEndTime.AddDays(-(snap?.ValidityPeriod ?? 1) * 30); - } + //if (entity.DateType == DicExamDateType.EXAM_DATE) + //{ + // courseEndTime = entity.EndTime.Value.Date.AddDays(1); + // courseTime = courseEndTime.AddDays(-(snap?.ValidityPeriod ?? 1) * 30); + //} for (int i = 0; i < staffs.Count; i++) { @@ -1466,7 +1466,7 @@ public class Ghre_ExamServices : BaseServices