diff --git a/Tiobon.Core.Api/Tiobon.Core.Model.xml b/Tiobon.Core.Api/Tiobon.Core.Model.xml index dadfed3d..dd4d978f 100644 --- a/Tiobon.Core.Api/Tiobon.Core.Model.xml +++ b/Tiobon.Core.Api/Tiobon.Core.Model.xml @@ -13705,7 +13705,7 @@ 预留字段11 - + 预留字段12 diff --git a/Tiobon.Core.Model/Base/Ghrh/Ghrh_ResumeTraining.Dto.Base.cs b/Tiobon.Core.Model/Base/Ghrh/Ghrh_ResumeTraining.Dto.Base.cs index f3f35248..97227a10 100644 --- a/Tiobon.Core.Model/Base/Ghrh/Ghrh_ResumeTraining.Dto.Base.cs +++ b/Tiobon.Core.Model/Base/Ghrh/Ghrh_ResumeTraining.Dto.Base.cs @@ -140,5 +140,6 @@ public class Ghrh_ResumeTrainingBase /// /// 预留字段12 /// + public int? IsPass1 { get; set; } public int? ReverseI2 { get; set; } } diff --git a/Tiobon.Core.Model/Edit/Ghrh/Ghrh_ResumeTraining.Dto.EditInput.cs b/Tiobon.Core.Model/Edit/Ghrh/Ghrh_ResumeTraining.Dto.EditInput.cs index 1dcda868..8f929614 100644 --- a/Tiobon.Core.Model/Edit/Ghrh/Ghrh_ResumeTraining.Dto.EditInput.cs +++ b/Tiobon.Core.Model/Edit/Ghrh/Ghrh_ResumeTraining.Dto.EditInput.cs @@ -13,7 +13,7 @@ *│ 此技术信息为本公司机密信息,未经本公司书面同意禁止向第三方披露. │ *│ 作者:SimonHsiao │ *└──────────────────────────────────┘ -*/ +*/ namespace Tiobon.Core.Model.Models; @@ -24,4 +24,6 @@ namespace Tiobon.Core.Model.Models; public class EditGhrh_ResumeTrainingInput : Ghrh_ResumeTrainingBase { public List AttachmentIDs { get; set; } + + } diff --git a/Tiobon.Core.Model/View/Ghrh/Ghrh_ResumeLicence.Dto.View.cs b/Tiobon.Core.Model/View/Ghrh/Ghrh_ResumeLicence.Dto.View.cs index 2f4c9306..d44da122 100644 --- a/Tiobon.Core.Model/View/Ghrh/Ghrh_ResumeLicence.Dto.View.cs +++ b/Tiobon.Core.Model/View/Ghrh/Ghrh_ResumeLicence.Dto.View.cs @@ -15,8 +15,6 @@ *└──────────────────────────────────┘ */ -using Tiobon.Core.Model.ViewModels.Extend; - namespace Tiobon.Core.Model.Models; /// @@ -33,7 +31,7 @@ public class Ghrh_ResumeLicenceDto : Ghrh_ResumeLicence /// 修改信息 /// public string UpdateDataInfo { get; set; } - public List AttachmentIDs { get; set; } + public List AttachmentIDs { get; set; } /// /// 生效日 /// diff --git a/Tiobon.Core.Model/View/Ghrh/Ghrh_ResumeTraining.Dto.View.cs b/Tiobon.Core.Model/View/Ghrh/Ghrh_ResumeTraining.Dto.View.cs index 34b339ae..d965854f 100644 --- a/Tiobon.Core.Model/View/Ghrh/Ghrh_ResumeTraining.Dto.View.cs +++ b/Tiobon.Core.Model/View/Ghrh/Ghrh_ResumeTraining.Dto.View.cs @@ -33,7 +33,7 @@ public class Ghrh_ResumeTrainingDto : Ghrh_ResumeTraining /// 修改信息 /// public string UpdateDataInfo { get; set; } - public List AttachmentIDs { get; set; } + public List AttachmentIDs { get; set; } /// /// 开始日期 /// @@ -49,4 +49,8 @@ public class Ghrh_ResumeTrainingDto : Ghrh_ResumeTraining /// public string IsPassLabel { get; set; } public string StaffName { get; set; } + + + public int? IsPass1 { get; set; } + } diff --git a/Tiobon.Core.Model/View/Ghrh/Ghrh_ResumeWorkExp.Dto.View.cs b/Tiobon.Core.Model/View/Ghrh/Ghrh_ResumeWorkExp.Dto.View.cs index de58fd65..852407fd 100644 --- a/Tiobon.Core.Model/View/Ghrh/Ghrh_ResumeWorkExp.Dto.View.cs +++ b/Tiobon.Core.Model/View/Ghrh/Ghrh_ResumeWorkExp.Dto.View.cs @@ -39,6 +39,6 @@ public class Ghrh_ResumeWorkExpDto : Ghrh_ResumeWorkExp public string EndDate1 { get; set; } - public List AttachmentIDs { get; set; } + public List AttachmentIDs { get; set; } = new List(); public string StaffName { get; set; } } diff --git a/Tiobon.Core.Services/Ghrh/Ghrh_ResumeEduBGServices.cs b/Tiobon.Core.Services/Ghrh/Ghrh_ResumeEduBGServices.cs index 1221dba0..7eae2142 100644 --- a/Tiobon.Core.Services/Ghrh/Ghrh_ResumeEduBGServices.cs +++ b/Tiobon.Core.Services/Ghrh/Ghrh_ResumeEduBGServices.cs @@ -80,9 +80,9 @@ public class Ghrh_ResumeEduBGServices : BaseServices Add(InsertGhrh_ResumeEduBGInput entity) { - var result = await Add(entity); + var result = await Add([entity]); - return result; + return result.First(); } public override async Task> Add(List listEntity) diff --git a/Tiobon.Core.Services/Ghrh/Ghrh_ResumeLicenceServices.cs b/Tiobon.Core.Services/Ghrh/Ghrh_ResumeLicenceServices.cs index 75220e91..506f9232 100644 --- a/Tiobon.Core.Services/Ghrh/Ghrh_ResumeLicenceServices.cs +++ b/Tiobon.Core.Services/Ghrh/Ghrh_ResumeLicenceServices.cs @@ -1,4 +1,6 @@ -namespace Tiobon.Core.Services; +using Tiobon.Core.Common.DB.Dapper.Extensions; + +namespace Tiobon.Core.Services; /// /// 证件 (服务) @@ -24,7 +26,7 @@ public class Ghrh_ResumeLicenceServices : BaseServices o.TableName == x.Id.ToString()) - .Select(o => new ResumeAttachment() + .Select(o => new Ghrs_Attachment() { AttachmentID = o.AttachmentID, AttachFileExtension = o.AttachFileExtension, @@ -55,6 +57,48 @@ public class Ghrh_ResumeLicenceServices : BaseServices Add(InsertGhrh_ResumeLicenceInput entity) + { + var result = await Add([entity]); + + return result.First(); + } + + + public override async Task Update(long Id, EditGhrh_ResumeLicenceInput editModel) + { + 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(); + return result; + + } + #region 字典映射、全称、单位转换等 /// /// 字典映射、全称、单位转换等 diff --git a/Tiobon.Core.Services/Ghrh/Ghrh_ResumeTrainingServices.cs b/Tiobon.Core.Services/Ghrh/Ghrh_ResumeTrainingServices.cs index 977f960d..c8f7fbc1 100644 --- a/Tiobon.Core.Services/Ghrh/Ghrh_ResumeTrainingServices.cs +++ b/Tiobon.Core.Services/Ghrh/Ghrh_ResumeTrainingServices.cs @@ -24,7 +24,7 @@ public class Ghrh_ResumeTrainingServices : BaseServices o.TableName == x.Id.ToString()) - .Select(o => new ResumeAttachment() + .Select(o => new Ghrs_Attachment() { AttachmentID = o.AttachmentID, AttachFileExtension = o.AttachFileExtension, @@ -77,6 +77,7 @@ public class Ghrh_ResumeTrainingServices : BaseServices(); for (int i = 0; i < listEntity.Count; i++) { + listEntity[i].IsPass = listEntity[i].IsPass1 == 1 ? true : false; var id = await base.Add(listEntity[i]); if (listEntity[i].AttachmentIDs != null && listEntity[i].AttachmentIDs.Any()) { @@ -91,6 +92,47 @@ public class Ghrh_ResumeTrainingServices : BaseServices Add(InsertGhrh_ResumeTrainingInput entity) + { + var result = await Add([entity]); + + return result.First(); + } + + + public override async Task Update(long Id, EditGhrh_ResumeTrainingInput editModel) + { + editModel.IsPass = editModel.IsPass1 == 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].IsPass1 = result.result.DT_TableDataT1[0].IsPass == true ? 1 : 0; + return result; + + } + #region Excel导入 public override async Task> DownloadExcel(string menuName) { diff --git a/Tiobon.Core.Services/Ghrh/Ghrh_ResumeWorkExpServices.cs b/Tiobon.Core.Services/Ghrh/Ghrh_ResumeWorkExpServices.cs index 29d5271e..cbd2acae 100644 --- a/Tiobon.Core.Services/Ghrh/Ghrh_ResumeWorkExpServices.cs +++ b/Tiobon.Core.Services/Ghrh/Ghrh_ResumeWorkExpServices.cs @@ -1,4 +1,7 @@ -namespace Tiobon.Core.Services; +using Tiobon.Core.Common.DB.Dapper.Extensions; +using Tiobon.Core.Model.Models; + +namespace Tiobon.Core.Services; /// /// 工作经历 (服务) @@ -24,7 +27,7 @@ public class Ghrh_ResumeWorkExpServices : BaseServices o.TableName == x.Id.ToString()) - .Select(o => new ResumeAttachment() + .Select(o => new Ghrs_Attachment() { AttachmentID = o.AttachmentID, AttachFileExtension = o.AttachFileExtension, @@ -56,6 +59,45 @@ public class Ghrh_ResumeWorkExpServices : BaseServices Add(InsertGhrh_ResumeWorkExpInput entity) + { + var result = await Add([entity]); + + return result.First(); + } + + public override async Task Update(long Id, EditGhrh_ResumeWorkExpInput editModel) + { + 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(); + return result; + + } + + #region 字典映射、全称、单位转换等 /// /// 字典映射、全称、单位转换等 diff --git a/Tiobon.Core/Tiobon.Core.Model.xml b/Tiobon.Core/Tiobon.Core.Model.xml index dadfed3d..dd4d978f 100644 --- a/Tiobon.Core/Tiobon.Core.Model.xml +++ b/Tiobon.Core/Tiobon.Core.Model.xml @@ -13705,7 +13705,7 @@ 预留字段11 - + 预留字段12