|
|
|
@ -24,7 +24,7 @@ public class Ghrh_ResumeTrainingServices : BaseServices<Ghrh_ResumeTraining, Ghr |
|
|
|
|
await SetLabel(x); |
|
|
|
|
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, |
|
|
|
@ -77,6 +77,7 @@ public class Ghrh_ResumeTrainingServices : BaseServices<Ghrh_ResumeTraining, Ghr |
|
|
|
|
var result = new List<long>(); |
|
|
|
|
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<Ghrh_ResumeTraining, Ghr |
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public override async Task<long> Add(InsertGhrh_ResumeTrainingInput entity) |
|
|
|
|
{ |
|
|
|
|
var result = await Add([entity]); |
|
|
|
|
|
|
|
|
|
return result.First(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public override async Task<bool> 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<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_ResumeTrainingDto>> 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].IsPass1 = result.result.DT_TableDataT1[0].IsPass == true ? 1 : 0; |
|
|
|
|
return result; |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#region Excel导入 |
|
|
|
|
public override async Task<ServiceResult<string>> DownloadExcel(string menuName) |
|
|
|
|
{ |
|
|
|
|