From 0036b56b3dd6363083997dc954751234ec4f53c0 Mon Sep 17 00:00:00 2001 From: xiaochanghai Date: Sun, 27 Apr 2025 16:45:10 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AE=80=E5=8E=86=E6=A1=A3=E6=A1=88=E5=90=84TA?= =?UTF-8?q?B=E9=A1=B5=E9=9D=A2=E6=96=B0=E5=A2=9E=E3=80=81=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E3=80=81=E5=A4=8D=E5=88=B6=E3=80=81=E4=BD=9C=E5=BA=9F?= =?UTF-8?q?=20=E6=8C=89=E9=92=AE=E5=8F=8A=E5=8A=9F=E8=83=BD=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Base/Ghrh/Ghrh_ResumeEduBG.Dto.Base.cs | 3 ++ .../Ghrh/Ghrh_ResumeEduBG.Dto.EditInput.cs | 2 +- .../View/Ghrh/Ghrh_ResumeEduBG.Dto.View.cs | 9 ++-- .../Ghrh/Ghrh_ResumeEduBGServices.cs | 42 ++++++++++++++++++- 4 files changed, 51 insertions(+), 5 deletions(-) diff --git a/Tiobon.Core.Model/Base/Ghrh/Ghrh_ResumeEduBG.Dto.Base.cs b/Tiobon.Core.Model/Base/Ghrh/Ghrh_ResumeEduBG.Dto.Base.cs index b288c964..0f7d3475 100644 --- a/Tiobon.Core.Model/Base/Ghrh/Ghrh_ResumeEduBG.Dto.Base.cs +++ b/Tiobon.Core.Model/Base/Ghrh/Ghrh_ResumeEduBG.Dto.Base.cs @@ -141,4 +141,7 @@ public class Ghrh_ResumeEduBGBase /// 预留字段12 /// public int? ReverseI2 { get; set; } + public int? IsGraduate1 { get; set; } + + } diff --git a/Tiobon.Core.Model/Edit/Ghrh/Ghrh_ResumeEduBG.Dto.EditInput.cs b/Tiobon.Core.Model/Edit/Ghrh/Ghrh_ResumeEduBG.Dto.EditInput.cs index b143e564..1fe68003 100644 --- a/Tiobon.Core.Model/Edit/Ghrh/Ghrh_ResumeEduBG.Dto.EditInput.cs +++ b/Tiobon.Core.Model/Edit/Ghrh/Ghrh_ResumeEduBG.Dto.EditInput.cs @@ -24,5 +24,5 @@ namespace Tiobon.Core.Model.Models; public class EditGhrh_ResumeEduBGInput : Ghrh_ResumeEduBGBase { - public List AttachmentIDs { get; set; } + public List AttachmentIDs { get; set; } = new List(); } diff --git a/Tiobon.Core.Model/View/Ghrh/Ghrh_ResumeEduBG.Dto.View.cs b/Tiobon.Core.Model/View/Ghrh/Ghrh_ResumeEduBG.Dto.View.cs index 6e5f9e6a..474bc2f2 100644 --- a/Tiobon.Core.Model/View/Ghrh/Ghrh_ResumeEduBG.Dto.View.cs +++ b/Tiobon.Core.Model/View/Ghrh/Ghrh_ResumeEduBG.Dto.View.cs @@ -39,8 +39,11 @@ public class Ghrh_ResumeEduBGDto : Ghrh_ResumeEduBG public string EndDate1 { get; set; } public string IsGraduateLabel { get; set; } - public string StaffName { get; set; } + public string StaffName { get; set; } + + public int? IsGraduate1 { get; set; } + + public List AttachmentIDs { get; set; } = new List(); + - public List AttachmentIDs { get; set; } - } diff --git a/Tiobon.Core.Services/Ghrh/Ghrh_ResumeEduBGServices.cs b/Tiobon.Core.Services/Ghrh/Ghrh_ResumeEduBGServices.cs index 3faed6de..1221dba0 100644 --- a/Tiobon.Core.Services/Ghrh/Ghrh_ResumeEduBGServices.cs +++ b/Tiobon.Core.Services/Ghrh/Ghrh_ResumeEduBGServices.cs @@ -25,7 +25,7 @@ public class Ghrh_ResumeEduBGServices : BaseServices o.TableName == x.Id.ToString()) - .Select(o => new ResumeAttachment() + .Select(o => new Ghrs_Attachment() { AttachmentID = o.AttachmentID, AttachFileExtension = o.AttachFileExtension, @@ -78,11 +78,20 @@ public class Ghrh_ResumeEduBGServices : BaseServices Add(InsertGhrh_ResumeEduBGInput entity) + { + var result = await Add(entity); + + return result; + } + public override async Task> Add(List listEntity) { var result = new List(); for (int i = 0; i < listEntity.Count; i++) { + listEntity[i].IsGraduate = listEntity[i].IsGraduate1 == 1 ? true : false; + var id = await base.Add(listEntity[i]); if (listEntity[i].AttachmentIDs != null && listEntity[i].AttachmentIDs.Any()) { @@ -97,7 +106,38 @@ public class Ghrh_ResumeEduBGServices : BaseServices Update(long Id, EditGhrh_ResumeEduBGInput editModel) + { + editModel.IsGraduate = editModel.IsGraduate1 == 1 ? true : false; + var result = await base.Update(Id, editModel); + + if (editModel.AttachmentIDs != null && editModel.AttachmentIDs.Any()) + { + await Db.Updateable() + .SetColumns(x => new Ghrs_Attachment() { TableName = null }) + .Where(it => it.TableName == Id.ToString()) + .ExecuteCommandAsync(); + + var ids = editModel.AttachmentIDs.Select(x => x.RelativePath).ToList(); + await Db.Updateable() + .SetColumns(x => new Ghrs_Attachment() { TableName = Id.ToString() }) + .Where(it => it.AttachmentID != null && ids.Contains(it.RelativePath)) + .ExecuteCommandAsync(); + } + return result; + } + + public override async Task> QueryForm(QueryForm body) + { + var result = await base.QueryForm(body); + + + result.result.DT_TableDataT1[0].AttachmentIDs = await Db.Queryable().Where(x => x.TableName == body.id.ObjToString()).ToListAsync(); + result.result.DT_TableDataT1[0].IsGraduate1 = result.result.DT_TableDataT1[0].IsGraduate == true ? 1 : 0; + return result; + + } #region Excel导入 public override async Task> DownloadExcel(string menuName)