From 850a4ea27a45ff2b96ca9b99e2ab159aafddb766 Mon Sep 17 00:00:00 2001 From: xiaochanghai Date: Fri, 18 Apr 2025 18:27:31 +0800 Subject: [PATCH 1/4] 1 --- .../Ghre/Ghre_DaySalaryEntry_BoltoneController.cs | 5 ++++- .../Ghrh/Ghrh_OfferApplyOrderServices.cs | 2 +- Tiobon.Core.Services/Ghrh/Ghrh_ResumeServices.cs | 2 +- Tiobon.Core/Tiobon.Core.Model.xml | 10 ++++++++++ Tiobon.Core/Tiobon.Core.xml | 7 +++++++ 5 files changed, 23 insertions(+), 3 deletions(-) diff --git a/Tiobon.Core.Api/Controllers/Ghre/Ghre_DaySalaryEntry_BoltoneController.cs b/Tiobon.Core.Api/Controllers/Ghre/Ghre_DaySalaryEntry_BoltoneController.cs index c112fc56..0aa02ad8 100644 --- a/Tiobon.Core.Api/Controllers/Ghre/Ghre_DaySalaryEntry_BoltoneController.cs +++ b/Tiobon.Core.Api/Controllers/Ghre/Ghre_DaySalaryEntry_BoltoneController.cs @@ -21,8 +21,11 @@ public class Ghre_DaySalaryEntry_BoltoneController : BaseController> Insert([FromBody] InsertGhre_DaySalaryEntry_BoltoneInput insertModel) { insertModel.SubmitDate = DateTime.Now; + + if (await _service.AnyAsync(x => x.IDNo == insertModel.IDNo && x.SubmitDate.Value.Date == DateTime.Now.Date)) + return Success(null, "提交成功"); var id = await _service.Add(insertModel); - var data = Success(null, "新增成功"); + var data = Success(null, "提交成功"); data.Success = id > 0; if (data.Success) data.Data = id.ObjToString(); diff --git a/Tiobon.Core.Services/Ghrh/Ghrh_OfferApplyOrderServices.cs b/Tiobon.Core.Services/Ghrh/Ghrh_OfferApplyOrderServices.cs index b16f24a2..91051214 100644 --- a/Tiobon.Core.Services/Ghrh/Ghrh_OfferApplyOrderServices.cs +++ b/Tiobon.Core.Services/Ghrh/Ghrh_OfferApplyOrderServices.cs @@ -149,7 +149,7 @@ public class Ghrh_OfferApplyOrderServices : BaseServices + + + 年度 + + 期间编号 @@ -32577,6 +32582,11 @@ 考核期间 (Model) + + + 年度 + + 期间编号 diff --git a/Tiobon.Core/Tiobon.Core.xml b/Tiobon.Core/Tiobon.Core.xml index 70c3d1a8..dcf7e246 100644 --- a/Tiobon.Core/Tiobon.Core.xml +++ b/Tiobon.Core/Tiobon.Core.xml @@ -2197,6 +2197,13 @@ 考核期间(Controller) + + + 批量展开 + + 阶段 + + 考核周期类别(Controller) From e281e248acb320f8e0ff591670710be936414a53 Mon Sep 17 00:00:00 2001 From: xiaochanghai Date: Mon, 21 Apr 2025 14:29:09 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E5=B2=97=E4=BD=8D=E6=8A=80=E8=83=BD=5F?= =?UTF-8?q?=E5=AE=9D=E8=BF=9E=E9=80=9A=20(=E6=9C=8D=E5=8A=A1)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Ghre/Ghre_TitleSkill_BoltoneServices.cs | 86 +++++++++++++------ 1 file changed, 62 insertions(+), 24 deletions(-) diff --git a/Tiobon.Core.Services/Ghre/Ghre_TitleSkill_BoltoneServices.cs b/Tiobon.Core.Services/Ghre/Ghre_TitleSkill_BoltoneServices.cs index d03f2e5a..5de8e889 100644 --- a/Tiobon.Core.Services/Ghre/Ghre_TitleSkill_BoltoneServices.cs +++ b/Tiobon.Core.Services/Ghre/Ghre_TitleSkill_BoltoneServices.cs @@ -1,4 +1,5 @@ using MySqlX.XDevAPI.Common; +using NPOI.OpenXmlFormats; using NPOI.SS.Formula.Functions; using OfficeOpenXml.FormulaParsing; using Org.BouncyCastle.Utilities; @@ -120,7 +121,40 @@ public class Ghre_TitleSkill_BoltoneServices : BaseServices new + { + x.DeptId, + x.TitleId + }).Distinct().ToList(); + + string condition = "1=1"; + + if (group1.Any()) + { + condition += "AND ("; + var i = 0; + group1.ForEach(x => + { + if (i == 0) + condition += $"(DeptId={x.DeptId} AND TitleId={x.TitleId})"; + else + condition += $"OR (DeptId={x.DeptId} AND TitleId={x.TitleId})"; + + i++; + }); + condition += ")"; + } + + var result2 = await _staffServices.QueryFilterPage(filter, condition); var DT_TableDataT1 = result2.result.DT_TableDataT1; @@ -131,16 +165,9 @@ public class Ghre_TitleSkill_BoltoneServices : BaseServices(); for (int i = 0; i < result2.result.DT_TableDataT1.Count; i++) { var column = result2.result.DT_TableDataT1[i]; @@ -155,25 +182,36 @@ public class Ghre_TitleSkill_BoltoneServices : BaseServices + for (int j = 0; j < titleSkills.result.DT_TableDataT1.Count; j++) { + var item = titleSkills.result.DT_TableDataT1[j]; + if (column.DeptID != item.DeptId || column.TitleID != item.TitleId) + continue; var key = item.CourseId + "_" + item.DeptId + "_" + item.TitleId + "_" + item.RequiredElective; - //if (dict.ContainsKey(column.Id.ObjToString())) - //{ - // var ids = dict[column.Id.ObjToString()]; - // if (ids.Where(id => id == x.TitleID).Any()) - // item.Add(new JProperty("Title_" + x.TitleNo, "✔")); - // else - // item.Add(new JProperty("Title_" + x.TitleNo, "")); - //} - //else - item1.Add(new JProperty(key, "★")); - }); + + var value = "×"; + + if (await src.Where(x => + x.CourseId == item.CourseId && + x.StaffId == column.StaffID && + x.StudyStatus == "NoFinish" && + ((x.CourseBeginTime >= item.EffectiveDate && x.CourseBeginTime <= item.ExpiryDate) || (x.CourseEndTime >= item.EffectiveDate && x.CourseEndTime <= item.ExpiryDate)) + ).AnyAsync()) + value = "◑"; + if (await src.Where(x => + x.CourseId == item.CourseId && + x.StaffId == column.StaffID && + x.StudyStatus == "HasFinish" && + ((x.CourseBeginTime >= item.EffectiveDate && x.CourseBeginTime <= item.ExpiryDate) || (x.CourseEndTime >= item.EffectiveDate && x.CourseEndTime <= item.ExpiryDate)) + ).AnyAsync()) + value = "☆"; + item1.Add(new JProperty(key, value)); + } columns.Add(item1); } From 96ab28879166ef7d5c19d9b2e4d8dea867b3cd77 Mon Sep 17 00:00:00 2001 From: xiaochanghai Date: Mon, 21 Apr 2025 14:38:02 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E5=A4=84=E7=90=86=E6=9C=80=E7=BB=88?= =?UTF-8?q?=E5=BE=97=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Tiobon.Core.Services/Ghre/Ghre_ExamRecordServices.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Tiobon.Core.Services/Ghre/Ghre_ExamRecordServices.cs b/Tiobon.Core.Services/Ghre/Ghre_ExamRecordServices.cs index 6de69cf4..0b685a18 100644 --- a/Tiobon.Core.Services/Ghre/Ghre_ExamRecordServices.cs +++ b/Tiobon.Core.Services/Ghre/Ghre_ExamRecordServices.cs @@ -1137,6 +1137,14 @@ public class Ghre_ExamRecordServices : BaseServices 0 && exam.OfflineScorePercentage > 0) + { + //exam.scor + } + #endregion } #endregion From d63559299e4d82666accdee963b4c494e9fcf05d Mon Sep 17 00:00:00 2001 From: xiaochanghai Date: Mon, 21 Apr 2025 15:31:00 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E5=A4=84=E7=90=86=E6=9C=80=E7=BB=88?= =?UTF-8?q?=E5=BE=97=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Ghre/Ghre_ExamRecordServices.cs | 44 +++++++++++++++++-- 1 file changed, 40 insertions(+), 4 deletions(-) diff --git a/Tiobon.Core.Services/Ghre/Ghre_ExamRecordServices.cs b/Tiobon.Core.Services/Ghre/Ghre_ExamRecordServices.cs index 0b685a18..2abb71cb 100644 --- a/Tiobon.Core.Services/Ghre/Ghre_ExamRecordServices.cs +++ b/Tiobon.Core.Services/Ghre/Ghre_ExamRecordServices.cs @@ -170,12 +170,29 @@ public class Ghre_ExamRecordServices : BaseServices paper.TotalScore) return ServiceResult.OprateFailed($"调整后得分为【{score1}】,不可大于卷面总分【{Regex.Replace(paper.TotalScore.ToString(), @"\.(0+)$", "") + "/" + Regex.Replace(paper.TotalScore.ToString(), @"\.(0+)$", "")}】!"); + #region 处理最终得分 + var exam = await Db.Queryable().Where(x => x.Id == entity.ExamId).FirstAsync(); + if (exam != null) + { + if (exam.OnlineScorePercentage != null && exam.OfflineScorePercentage != null) + if (exam.OnlineScorePercentage > 0 && exam.OfflineScorePercentage > 0) + { + decimal OnlineScorePercentage = exam.OnlineScorePercentage.Value / 100; + decimal OfflineScorePercentage = exam.OfflineScorePercentage.Value / 100; + entity.FinallyScore = (entity.Score + (entity.AdjustScore ?? 0)) * OnlineScorePercentage; + if (entity.ActualScore != null && entity.ActualScore > 0) + entity.FinallyScore += entity.ActualScore * OfflineScorePercentage; + } + } + #endregion + + var paperId = entity.ExamPaperId; var examPaper = await Db.Queryable().Where(x => x.Id == paperId).FirstAsync(); if (examPaper != null) entity.IsPass = examPaper.PassScore > (entity.Score + entity.AdjustScore) ? false : true; - await Update(entity, ["IsPass", "AdjustScore", "UpdateTime", "UpdateBy"]); + await Update(entity, ["IsPass", "AdjustScore", "FinallyScore", "UpdateTime", "UpdateBy"]); return ServiceResult.OprateSuccess("修改成功!"); @@ -195,8 +212,23 @@ public class Ghre_ExamRecordServices : BaseServices().Where(x => x.Id == entity.ExamId).FirstAsync(); + if (exam != null) + { + if (exam.OnlineScorePercentage != null && exam.OfflineScorePercentage != null) + if (exam.OnlineScorePercentage > 0 && exam.OfflineScorePercentage > 0) + { + decimal OnlineScorePercentage = exam.OnlineScorePercentage.Value / 100; + decimal OfflineScorePercentage = exam.OfflineScorePercentage.Value / 100; + entity.FinallyScore = (entity.Score + (entity.AdjustScore ?? 0)) * OnlineScorePercentage; + if (entity.ActualScore != null && entity.ActualScore > 0) + entity.FinallyScore += entity.ActualScore * OfflineScorePercentage; + } + } + #endregion - await Update(entity, ["ActualScore", "UpdateTime", "UpdateBy"]); + await Update(entity, ["ActualScore", "FinallyScore", "UpdateTime", "UpdateBy"]); return ServiceResult.OprateSuccess("修改成功!"); } @@ -1142,14 +1174,18 @@ public class Ghre_ExamRecordServices : BaseServices 0 && exam.OfflineScorePercentage > 0) { - //exam.scor + decimal OnlineScorePercentage = exam.OnlineScorePercentage.Value / 100; + decimal OfflineScorePercentage = exam.OfflineScorePercentage.Value / 100; + record.FinallyScore = (record.Score + (record.AdjustScore ?? 0)) * OnlineScorePercentage; + if (record.ActualScore != null && record.ActualScore > 0) + record.FinallyScore += record.ActualScore * OfflineScorePercentage; } #endregion } #endregion record.UpdateTime = DateTime.Now; - await Update(record, new List { "Status", "Score", "AdjustScore", "ActualEndTime", "ScoreStatus", "UpdateTime", "ExamDate", "AnswerCount" }, null, $"Id='{record.Id}'"); + await Update(record, new List { "Status", "Score", "FinallyScore", "AdjustScore", "ActualEndTime", "ScoreStatus", "UpdateTime", "ExamDate", "AnswerCount" }, null, $"Id='{record.Id}'"); if (exampaper.ScoreMethod == DIC_EXAM_PAPER_SCORE_METHOD.SYSTEM) await Task.Factory.StartNew(async () => await DealPass(Db, studyRecordId));