|
|
|
@ -25,7 +25,7 @@ public class Ghrh_ResumeEduBGServices : BaseServices<Ghrh_ResumeEduBG, Ghrh_Resu |
|
|
|
|
{ |
|
|
|
|
x.AttachmentIDs = attachments |
|
|
|
|
.Where(o => 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<Ghrh_ResumeEduBG, Ghrh_Resu |
|
|
|
|
} |
|
|
|
|
#endregion |
|
|
|
|
|
|
|
|
|
public override async Task<long> Add(InsertGhrh_ResumeEduBGInput entity) |
|
|
|
|
{ |
|
|
|
|
var result = await Add(entity); |
|
|
|
|
|
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public override async Task<List<long>> Add(List<InsertGhrh_ResumeEduBGInput> listEntity) |
|
|
|
|
{ |
|
|
|
|
var result = new List<long>(); |
|
|
|
|
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<Ghrh_ResumeEduBG, Ghrh_Resu |
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public override async Task<bool> 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<Ghrs_Attachment>() |
|
|
|
|
.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<Ghrs_Attachment>() |
|
|
|
|
.SetColumns(x => new Ghrs_Attachment() { TableName = Id.ToString() }) |
|
|
|
|
.Where(it => it.AttachmentID != null && ids.Contains(it.RelativePath)) |
|
|
|
|
.ExecuteCommandAsync(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public override async Task<ServiceFormResult<Ghrh_ResumeEduBGDto>> QueryForm(QueryForm body) |
|
|
|
|
{ |
|
|
|
|
var result = await base.QueryForm(body); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
result.result.DT_TableDataT1[0].AttachmentIDs = await Db.Queryable<Ghrs_Attachment>().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<ServiceResult<string>> DownloadExcel(string menuName) |
|
|
|
|