简历数据提交接口优化

master
xiaochanghai 7 months ago
parent 2517f51c21
commit 8347fc06b3
  1. 6
      Model/Tiobon.Web.pdm
  2. 18
      Tiobon.Core.Model/Base/Ghrh/Ghrh_ResumeEduBG.Dto.Base.cs
  3. 2
      Tiobon.Core.Model/Models/Ghrh/Ghrh_ResumeEduBG.cs
  4. 14
      Tiobon.Core.Services/Ghrh/Ghrh_ResumeEduBGServices.cs
  5. 14
      Tiobon.Core.Services/Ghrh/Ghrh_ResumeHomeServices.cs
  6. 14
      Tiobon.Core.Services/Ghrh/Ghrh_ResumeLicenceServices.cs
  7. 82
      Tiobon.Core.Services/Ghrh/Ghrh_ResumeServices.cs
  8. 14
      Tiobon.Core.Services/Ghrh/Ghrh_ResumeTrainingServices.cs
  9. 14
      Tiobon.Core.Services/Ghrh/Ghrh_ResumeWorkExpServices.cs
  10. 4
      Tiobon.Core/Tiobon.Core.xml

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<?PowerDesigner AppLocale="UTF16" ID="{C294868A-C3F3-41AD-98CC-78B6D4E0CC40}" Label="" LastModificationDate="1730947816" Name="Tiobon" Objects="2235" Symbols="85" Target="Microsoft SQL Server 2008" Type="{CDE44E21-9669-11D1-9914-006097355D9B}" signature="PDM_DATA_MODEL_XML" version="15.0.0.2613"?> <?PowerDesigner AppLocale="UTF16" ID="{C294868A-C3F3-41AD-98CC-78B6D4E0CC40}" Label="" LastModificationDate="1731394264" Name="Tiobon" Objects="2232" Symbols="85" Target="Microsoft SQL Server 2008" Type="{CDE44E21-9669-11D1-9914-006097355D9B}" signature="PDM_DATA_MODEL_XML" version="15.0.0.2613"?>
<!-- do not edit this file --> <!-- do not edit this file -->
<Model xmlns:a="attribute" xmlns:c="collection" xmlns:o="object"> <Model xmlns:a="attribute" xmlns:c="collection" xmlns:o="object">
@ -35435,10 +35435,10 @@ Ghra_staff_InsureBase
<a:Code>IsGraduate</a:Code> <a:Code>IsGraduate</a:Code>
<a:CreationDate>1729663174</a:CreationDate> <a:CreationDate>1729663174</a:CreationDate>
<a:Creator>Administrator</a:Creator> <a:Creator>Administrator</a:Creator>
<a:ModificationDate>1729663376</a:ModificationDate> <a:ModificationDate>1731394264</a:ModificationDate>
<a:Modifier>Administrator</a:Modifier> <a:Modifier>Administrator</a:Modifier>
<a:Comment>是否毕业</a:Comment> <a:Comment>是否毕业</a:Comment>
<a:DataType>int</a:DataType> <a:DataType>bit</a:DataType>
</o:Column> </o:Column>
<o:Column Id="o1969"> <o:Column Id="o1969">
<a:ObjectID>BDF407F4-EA20-4673-A0EC-0C7157EFCDA3</a:ObjectID> <a:ObjectID>BDF407F4-EA20-4673-A0EC-0C7157EFCDA3</a:ObjectID>

@ -14,17 +14,14 @@
* SimonHsiao * SimonHsiao
* *
*/ */
using System.ComponentModel; namespace Tiobon.Core.Model.Models;
using System.ComponentModel.DataAnnotations;
namespace Tiobon.Core.Model.Models
{
/// <summary> /// <summary>
/// 教育背景 (Dto.Base) /// 教育背景 (Dto.Base)
/// </summary> /// </summary>
public class Ghrh_ResumeEduBGBase public class Ghrh_ResumeEduBGBase
{ {
/// <summary> /// <summary>
/// 简历ID /// 简历ID
@ -62,7 +59,7 @@ namespace Tiobon.Core.Model.Models
/// <summary> /// <summary>
/// 是否毕业 /// 是否毕业
/// </summary> /// </summary>
public int? IsGraduate { get; set; } public bool? IsGraduate { get; set; }
/// <summary> /// <summary>
/// 备注 /// 备注
@ -144,5 +141,4 @@ namespace Tiobon.Core.Model.Models
/// 预留字段12 /// 预留字段12
/// </summary> /// </summary>
public int? ReverseI2 { get; set; } public int? ReverseI2 { get; set; }
}
} }

@ -60,7 +60,7 @@ public class Ghrh_ResumeEduBG : BasePoco
/// <summary> /// <summary>
/// 是否毕业 /// 是否毕业
/// </summary> /// </summary>
public int? IsGraduate { get; set; } public bool? IsGraduate { get; set; }
/// <summary> /// <summary>
/// 备注 /// 备注

@ -17,7 +17,7 @@ public class Ghrh_ResumeEduBGServices : BaseServices<Ghrh_ResumeEduBG, Ghrh_Resu
{ {
var data = await base.QueryDto(whereExpression); var data = await base.QueryDto(whereExpression);
var ids = data.Select(x => x.Id.ToString()).ToList(); var ids = data.Select(x => x.Id.ToString()).ToList();
var attachments = await Db.Queryable<Ghre_Attachment>().Where(x => ids.Contains(x.TableName)).ToListAsync(); var attachments = await Db.Queryable<Ghrs_Attachment>().Where(x => ids.Contains(x.TableName)).ToListAsync();
data.ForEach(x => data.ForEach(x =>
{ {
@ -25,10 +25,10 @@ public class Ghrh_ResumeEduBGServices : BaseServices<Ghrh_ResumeEduBG, Ghrh_Resu
.Where(o => o.TableName == x.Id.ToString()) .Where(o => o.TableName == x.Id.ToString())
.Select(o => new ResumeAttachment() .Select(o => new ResumeAttachment()
{ {
AttachmentID = o.Id, AttachmentID = o.AttachmentID,
AttachFileExtension = o.AttachFileExtension, AttachFileExtension = o.AttachFileExtension,
AttachFileSize = o.AttachFileSize, AttachFileSize = o.AttachFileSize,
RelativePath = "/Advanced" + o.RelativePath, RelativePath = o.RelativePath,
AttachmentName = o.AttachmentName, AttachmentName = o.AttachmentName,
RemarkSz = o.RemarkSz RemarkSz = o.RemarkSz
}).ToList(); }).ToList();
@ -44,10 +44,10 @@ public class Ghrh_ResumeEduBGServices : BaseServices<Ghrh_ResumeEduBG, Ghrh_Resu
var id = await base.Add(listEntity[i]); var id = await base.Add(listEntity[i]);
if (listEntity[i].AttachmentIDs != null && listEntity[i].AttachmentIDs.Any()) if (listEntity[i].AttachmentIDs != null && listEntity[i].AttachmentIDs.Any())
{ {
var ids = listEntity[i].AttachmentIDs.Where(x => x.AttachmentID != null).Select(x => x.AttachmentID.Value).ToList(); var ids = listEntity[i].AttachmentIDs.Select(x => x.RelativePath).ToList();
await Db.Updateable<Ghre_Attachment>() await Db.Updateable<Ghrs_Attachment>()
.SetColumns(x => new Ghre_Attachment() { TableName = id.ToString(), UpdateTime = DateTime.Now }) .SetColumns(x => new Ghrs_Attachment() { TableName = id.ToString(), UpdateTime = DateTime.Now })
.Where(it => ids.Contains(it.Id)) .Where(it => it.AttachmentID != null && ids.Contains(it.RelativePath))
.ExecuteCommandAsync(); .ExecuteCommandAsync();
} }
result.Add(id); result.Add(id);

@ -17,7 +17,7 @@ public class Ghrh_ResumeHomeServices : BaseServices<Ghrh_ResumeHome, Ghrh_Resume
{ {
var data = await base.QueryDto(whereExpression); var data = await base.QueryDto(whereExpression);
var ids = data.Select(x => x.Id.ToString()).ToList(); var ids = data.Select(x => x.Id.ToString()).ToList();
var attachments = await Db.Queryable<Ghre_Attachment>().Where(x => ids.Contains(x.TableName)).ToListAsync(); var attachments = await Db.Queryable<Ghrs_Attachment>().Where(x => ids.Contains(x.TableName)).ToListAsync();
data.ForEach(x => data.ForEach(x =>
{ {
@ -25,10 +25,10 @@ public class Ghrh_ResumeHomeServices : BaseServices<Ghrh_ResumeHome, Ghrh_Resume
.Where(o => o.TableName == x.Id.ToString()) .Where(o => o.TableName == x.Id.ToString())
.Select(o => new ResumeAttachment() .Select(o => new ResumeAttachment()
{ {
AttachmentID = o.Id, AttachmentID = o.AttachmentID,
AttachFileExtension = o.AttachFileExtension, AttachFileExtension = o.AttachFileExtension,
AttachFileSize = o.AttachFileSize, AttachFileSize = o.AttachFileSize,
RelativePath = "/Advanced" + o.RelativePath, RelativePath = o.RelativePath,
AttachmentName = o.AttachmentName, AttachmentName = o.AttachmentName,
RemarkSz = o.RemarkSz RemarkSz = o.RemarkSz
}).ToList(); }).ToList();
@ -44,10 +44,10 @@ public class Ghrh_ResumeHomeServices : BaseServices<Ghrh_ResumeHome, Ghrh_Resume
var id = await base.Add(listEntity[i]); var id = await base.Add(listEntity[i]);
if (listEntity[i].AttachmentIDs != null && listEntity[i].AttachmentIDs.Any()) if (listEntity[i].AttachmentIDs != null && listEntity[i].AttachmentIDs.Any())
{ {
var ids = listEntity[i].AttachmentIDs.Where(x => x.AttachmentID != null).Select(x => x.AttachmentID.Value).ToList(); var ids = listEntity[i].AttachmentIDs.Select(x => x.RelativePath).ToList();
await Db.Updateable<Ghre_Attachment>() await Db.Updateable<Ghrs_Attachment>()
.SetColumns(x => new Ghre_Attachment() { TableName = id.ToString(), UpdateTime = DateTime.Now }) .SetColumns(x => new Ghrs_Attachment() { TableName = id.ToString(), UpdateTime = DateTime.Now })
.Where(it => ids.Contains(it.Id)) .Where(it => it.AttachmentID != null && ids.Contains(it.RelativePath))
.ExecuteCommandAsync(); .ExecuteCommandAsync();
} }
result.Add(id); result.Add(id);

@ -17,7 +17,7 @@ public class Ghrh_ResumeLicenceServices : BaseServices<Ghrh_ResumeLicence, Ghrh_
{ {
var data = await base.QueryDto(whereExpression); var data = await base.QueryDto(whereExpression);
var ids = data.Select(x => x.Id.ToString()).ToList(); var ids = data.Select(x => x.Id.ToString()).ToList();
var attachments = await Db.Queryable<Ghre_Attachment>().Where(x => ids.Contains(x.TableName)).ToListAsync(); var attachments = await Db.Queryable<Ghrs_Attachment>().Where(x => ids.Contains(x.TableName)).ToListAsync();
data.ForEach(x => data.ForEach(x =>
{ {
@ -25,10 +25,10 @@ public class Ghrh_ResumeLicenceServices : BaseServices<Ghrh_ResumeLicence, Ghrh_
.Where(o => o.TableName == x.Id.ToString()) .Where(o => o.TableName == x.Id.ToString())
.Select(o => new ResumeAttachment() .Select(o => new ResumeAttachment()
{ {
AttachmentID = o.Id, AttachmentID = o.AttachmentID,
AttachFileExtension = o.AttachFileExtension, AttachFileExtension = o.AttachFileExtension,
AttachFileSize = o.AttachFileSize, AttachFileSize = o.AttachFileSize,
RelativePath = "/Advanced" + o.RelativePath, RelativePath = o.RelativePath,
AttachmentName = o.AttachmentName, AttachmentName = o.AttachmentName,
RemarkSz = o.RemarkSz RemarkSz = o.RemarkSz
}).ToList(); }).ToList();
@ -44,10 +44,10 @@ public class Ghrh_ResumeLicenceServices : BaseServices<Ghrh_ResumeLicence, Ghrh_
var id = await base.Add(listEntity[i]); var id = await base.Add(listEntity[i]);
if (listEntity[i].AttachmentIDs != null && listEntity[i].AttachmentIDs.Any()) if (listEntity[i].AttachmentIDs != null && listEntity[i].AttachmentIDs.Any())
{ {
var ids = listEntity[i].AttachmentIDs.Where(x => x.AttachmentID != null).Select(x => x.AttachmentID.Value).ToList(); var ids = listEntity[i].AttachmentIDs.Select(x => x.RelativePath).ToList();
await Db.Updateable<Ghre_Attachment>() await Db.Updateable<Ghrs_Attachment>()
.SetColumns(x => new Ghre_Attachment() { TableName = id.ToString(), UpdateTime = DateTime.Now }) .SetColumns(x => new Ghrs_Attachment() { TableName = id.ToString(), UpdateTime = DateTime.Now })
.Where(it => ids.Contains(it.Id)) .Where(it => it.AttachmentID != null && ids.Contains(it.RelativePath))
.ExecuteCommandAsync(); .ExecuteCommandAsync();
} }
result.Add(id); result.Add(id);

@ -9,6 +9,9 @@ public class Ghrh_ResumeServices : BaseServices<Ghrh_Resume, Ghrh_ResumeDto, Ins
private readonly IGhrh_ResumeEduBGServices _ghrh_ResumeEduBGServices; private readonly IGhrh_ResumeEduBGServices _ghrh_ResumeEduBGServices;
private readonly IGhrh_ResumeWorkExpServices _ghrh_ResumeWorkExpServices; private readonly IGhrh_ResumeWorkExpServices _ghrh_ResumeWorkExpServices;
private readonly IGhrh_ResumeTagServices _ghrh_ResumeTagServices; private readonly IGhrh_ResumeTagServices _ghrh_ResumeTagServices;
/// <summary>
/// 家庭关系
/// </summary>
private readonly IGhrh_ResumeHomeServices _ghrh_ResumeHomeServices; private readonly IGhrh_ResumeHomeServices _ghrh_ResumeHomeServices;
private readonly IGhrh_ResumeLicenceServices _ghrh_ResumeLicenceServices; private readonly IGhrh_ResumeLicenceServices _ghrh_ResumeLicenceServices;
private readonly IGhrh_ResumeTrainingServices _ghrh_ResumeTrainingServices; private readonly IGhrh_ResumeTrainingServices _ghrh_ResumeTrainingServices;
@ -358,7 +361,7 @@ public class Ghrh_ResumeServices : BaseServices<Ghrh_Resume, Ghrh_ResumeDto, Ins
id = resume.Id; id = resume.Id;
if (resume.StaffName != input.StaffName) if (resume.StaffName != input.StaffName && resume.ApplicationStatus != "Submit")
await base.Update(id, input, ["StaffName"]); await base.Update(id, input, ["StaffName"]);
obj.ApplicationStatus = resume.ApplicationStatus ?? "Hold"; obj.ApplicationStatus = resume.ApplicationStatus ?? "Hold";
@ -470,6 +473,14 @@ BEGIN
FROM Ghrs_ParaMaster FROM Ghrs_ParaMaster
WHERE ParaMasterId = WHERE ParaMasterId =
pp.DataSource) pp.DataSource)
WHEN pp.DataSourceType =
'CommonList'
THEN
(SELECT 'CommonList_'
+ ListCommonSqlNo
FROM Ghrs_ListCommonSql
WHERE ListCommonSqlId =
pp.DataSource)
ELSE ELSE
NULL NULL
END dataSource, END dataSource,
@ -514,6 +525,14 @@ BEGIN
FROM Ghrs_ParaMaster FROM Ghrs_ParaMaster
WHERE ParaMasterId = WHERE ParaMasterId =
pp.DataSource) pp.DataSource)
WHEN pp.DataSourceType =
'CommonList'
THEN
(SELECT 'CommonList_'
+ ListCommonSqlNo
FROM Ghrs_ListCommonSql
WHERE ListCommonSqlId =
pp.DataSource)
ELSE ELSE
NULL NULL
END dataSource, END dataSource,
@ -566,6 +585,7 @@ END";
{ {
field = "PhotoUrls", field = "PhotoUrls",
elementType = "FileUpload", elementType = "FileUpload",
label = "照片",
editable = "1" editable = "1"
}); });
} }
@ -611,21 +631,21 @@ END";
columnNames = formColumns.Where(x => x.GroupType == "Family").Select(x => x.ColumnName).ToList(); columnNames = formColumns.Where(x => x.GroupType == "Family").Select(x => x.ColumnName).ToList();
columnNames = columnNames.Distinct().ToList(); columnNames = columnNames.Distinct().ToList();
var familys = await _ghrh_ResumeHomeServices.QueryDto(x => x.ResumeId != null && x.ResumeId == id); var familys = await _ghrh_ResumeHomeServices.QueryDto(x => x.ResumeId != null && x.ResumeId == id);
var family = new List<Dictionary<string, object>>(); var familyDic = new List<Dictionary<string, object>>();
familys.ForEach(x => familys.ForEach(family =>
{ {
var dicts = new Dictionary<string, object>(); var dicts = new Dictionary<string, object>();
columnNames.ForEach(x => columnNames.ForEach(x =>
{ {
var value = entity.GetPropertyValue(x); var value = family.GetPropertyValue(x);
dicts.Add(x, value); dicts.Add(x, value);
}); });
if (columnNames.Any(x => x == "AttachmentIDs")) if (columnNames.Any(x => x == "AttachmentIDs"))
dicts["AttachmentIDs"] = x.AttachmentIDs; dicts["AttachmentIDs"] = family.AttachmentIDs;
family.Add(dicts); familyDic.Add(dicts);
}); });
Data.Family = family; Data.Family = familyDic;
#endregion #endregion
#region 教育背景 #region 教育背景
@ -633,84 +653,84 @@ END";
columnNames = formColumns.Where(x => x.GroupType == "Education").Select(x => x.ColumnName).ToList(); columnNames = formColumns.Where(x => x.GroupType == "Education").Select(x => x.ColumnName).ToList();
columnNames = columnNames.Distinct().ToList(); columnNames = columnNames.Distinct().ToList();
var educations = await _ghrh_ResumeEduBGServices.QueryDto(x => x.ResumeId != null && x.ResumeId == id); var educations = await _ghrh_ResumeEduBGServices.QueryDto(x => x.ResumeId != null && x.ResumeId == id);
var education = new List<Dictionary<string, object>>(); var educationDic = new List<Dictionary<string, object>>();
educations.ForEach(x => educations.ForEach(education =>
{ {
var dicts = new Dictionary<string, object>(); var dicts = new Dictionary<string, object>();
columnNames.ForEach(x => columnNames.ForEach(x =>
{ {
var value = entity.GetPropertyValue(x); var value = education.GetPropertyValue(x);
dicts.Add(x, value); dicts.Add(x, value);
}); });
if (columnNames.Any(x => x == "AttachmentIDs")) if (columnNames.Any(x => x == "AttachmentIDs"))
dicts["AttachmentIDs"] = x.AttachmentIDs; dicts["AttachmentIDs"] = education.AttachmentIDs;
education.Add(dicts); educationDic.Add(dicts);
}); });
Data.Education = education; Data.Education = educationDic;
#endregion #endregion
#region 工作经历 #region 工作经历
columnNames = formColumns.Where(x => x.GroupType == "WorkExp").Select(x => x.ColumnName).ToList(); columnNames = formColumns.Where(x => x.GroupType == "WorkExp").Select(x => x.ColumnName).ToList();
columnNames = columnNames.Distinct().ToList(); columnNames = columnNames.Distinct().ToList();
var workExps = await _ghrh_ResumeWorkExpServices.QueryDto(x => x.ResumeId != null && x.ResumeId == id); var workExps = await _ghrh_ResumeWorkExpServices.QueryDto(x => x.ResumeId != null && x.ResumeId == id);
var workExp = new List<Dictionary<string, object>>(); var workExpDic = new List<Dictionary<string, object>>();
workExps.ForEach(x => workExps.ForEach(workExp =>
{ {
var dicts = new Dictionary<string, object>(); var dicts = new Dictionary<string, object>();
columnNames.ForEach(x => columnNames.ForEach(x =>
{ {
var value = entity.GetPropertyValue(x); var value = workExp.GetPropertyValue(x);
dicts.Add(x, value); dicts.Add(x, value);
}); });
if (columnNames.Any(x => x == "AttachmentIDs")) if (columnNames.Any(x => x == "AttachmentIDs"))
dicts["AttachmentIDs"] = x.AttachmentIDs; dicts["AttachmentIDs"] = workExp.AttachmentIDs;
workExp.Add(dicts); workExpDic.Add(dicts);
}); });
Data.WorkExp = workExp; Data.WorkExp = workExpDic;
#endregion #endregion
#region 证件 #region 证件
columnNames = formColumns.Where(x => x.GroupType == "Licence").Select(x => x.ColumnName).ToList(); columnNames = formColumns.Where(x => x.GroupType == "Licence").Select(x => x.ColumnName).ToList();
columnNames = columnNames.Distinct().ToList(); columnNames = columnNames.Distinct().ToList();
var Licences = await _ghrh_ResumeLicenceServices.QueryDto(x => x.ResumeId != null && x.ResumeId == id); var Licences = await _ghrh_ResumeLicenceServices.QueryDto(x => x.ResumeId != null && x.ResumeId == id);
var Licence = new List<Dictionary<string, object>>(); var licenceDic = new List<Dictionary<string, object>>();
Licences.ForEach(x => Licences.ForEach(licence =>
{ {
var dicts = new Dictionary<string, object>(); var dicts = new Dictionary<string, object>();
columnNames.ForEach(x => columnNames.ForEach(x =>
{ {
var value = entity.GetPropertyValue(x); var value = licence.GetPropertyValue(x);
dicts.Add(x, value); dicts.Add(x, value);
}); });
if (columnNames.Any(x => x == "AttachmentIDs")) if (columnNames.Any(x => x == "AttachmentIDs"))
dicts["AttachmentIDs"] = x.AttachmentIDs; dicts["AttachmentIDs"] = licence.AttachmentIDs;
Licence.Add(dicts); licenceDic.Add(dicts);
}); });
Data.Licence = Licence; Data.Licence = licenceDic;
#endregion #endregion
#region 简历培训记录 #region 简历培训记录
columnNames = formColumns.Where(x => x.GroupType == "Training").Select(x => x.ColumnName).ToList(); columnNames = formColumns.Where(x => x.GroupType == "Training").Select(x => x.ColumnName).ToList();
columnNames = columnNames.Distinct().ToList(); columnNames = columnNames.Distinct().ToList();
var Trainings = await _ghrh_ResumeTrainingServices.QueryDto(x => x.ResumeId != null && x.ResumeId == id); var Trainings = await _ghrh_ResumeTrainingServices.QueryDto(x => x.ResumeId != null && x.ResumeId == id);
var Training = new List<Dictionary<string, object>>(); var trainingDic = new List<Dictionary<string, object>>();
Trainings.ForEach(x => Trainings.ForEach(training =>
{ {
var dicts = new Dictionary<string, object>(); var dicts = new Dictionary<string, object>();
columnNames.ForEach(x => columnNames.ForEach(x =>
{ {
var value = entity.GetPropertyValue(x); var value = training.GetPropertyValue(x);
dicts.Add(x, value); dicts.Add(x, value);
}); });
if (columnNames.Any(x => x == "AttachmentIDs")) if (columnNames.Any(x => x == "AttachmentIDs"))
dicts["AttachmentIDs"] = x.AttachmentIDs; dicts["AttachmentIDs"] = training.AttachmentIDs;
Training.Add(dicts); trainingDic.Add(dicts);
}); });
Data.Training = Training; Data.Training = trainingDic;
#endregion #endregion
Data.Attachment = await Db.Queryable<Ghrs_Attachment>().Where(x => x.TableName == id.ObjToString()).ToListAsync(); Data.Attachment = await Db.Queryable<Ghrs_Attachment>().Where(x => x.TableName == id.ObjToString()).ToListAsync();

@ -17,7 +17,7 @@ public class Ghrh_ResumeTrainingServices : BaseServices<Ghrh_ResumeTraining, Ghr
{ {
var data = await base.QueryDto(whereExpression); var data = await base.QueryDto(whereExpression);
var ids = data.Select(x => x.Id.ToString()).ToList(); var ids = data.Select(x => x.Id.ToString()).ToList();
var attachments = await Db.Queryable<Ghre_Attachment>().Where(x => ids.Contains(x.TableName)).ToListAsync(); var attachments = await Db.Queryable<Ghrs_Attachment>().Where(x => ids.Contains(x.TableName)).ToListAsync();
data.ForEach(x => data.ForEach(x =>
{ {
@ -25,10 +25,10 @@ public class Ghrh_ResumeTrainingServices : BaseServices<Ghrh_ResumeTraining, Ghr
.Where(o => o.TableName == x.Id.ToString()) .Where(o => o.TableName == x.Id.ToString())
.Select(o => new ResumeAttachment() .Select(o => new ResumeAttachment()
{ {
AttachmentID = o.Id, AttachmentID = o.AttachmentID,
AttachFileExtension = o.AttachFileExtension, AttachFileExtension = o.AttachFileExtension,
AttachFileSize = o.AttachFileSize, AttachFileSize = o.AttachFileSize,
RelativePath = "/Advanced" + o.RelativePath, RelativePath = o.RelativePath,
AttachmentName = o.AttachmentName, AttachmentName = o.AttachmentName,
RemarkSz = o.RemarkSz RemarkSz = o.RemarkSz
}).ToList(); }).ToList();
@ -44,10 +44,10 @@ public class Ghrh_ResumeTrainingServices : BaseServices<Ghrh_ResumeTraining, Ghr
var id = await base.Add(listEntity[i]); var id = await base.Add(listEntity[i]);
if (listEntity[i].AttachmentIDs != null && listEntity[i].AttachmentIDs.Any()) if (listEntity[i].AttachmentIDs != null && listEntity[i].AttachmentIDs.Any())
{ {
var ids = listEntity[i].AttachmentIDs.Where(x => x.AttachmentID != null).Select(x => x.AttachmentID.Value).ToList(); var ids = listEntity[i].AttachmentIDs.Select(x => x.RelativePath).ToList();
await Db.Updateable<Ghre_Attachment>() await Db.Updateable<Ghrs_Attachment>()
.SetColumns(x => new Ghre_Attachment() { TableName = id.ToString(), UpdateTime = DateTime.Now }) .SetColumns(x => new Ghrs_Attachment() { TableName = id.ToString(), UpdateTime = DateTime.Now })
.Where(it => ids.Contains(it.Id)) .Where(it => it.AttachmentID != null && ids.Contains(it.RelativePath))
.ExecuteCommandAsync(); .ExecuteCommandAsync();
} }
result.Add(id); result.Add(id);

@ -17,7 +17,7 @@ public class Ghrh_ResumeWorkExpServices : BaseServices<Ghrh_ResumeWorkExp, Ghrh_
{ {
var data = await base.QueryDto(whereExpression); var data = await base.QueryDto(whereExpression);
var ids = data.Select(x => x.Id.ToString()).ToList(); var ids = data.Select(x => x.Id.ToString()).ToList();
var attachments = await Db.Queryable<Ghre_Attachment>().Where(x => ids.Contains(x.TableName)).ToListAsync(); var attachments = await Db.Queryable<Ghrs_Attachment>().Where(x => ids.Contains(x.TableName)).ToListAsync();
data.ForEach(x => data.ForEach(x =>
{ {
@ -25,10 +25,10 @@ public class Ghrh_ResumeWorkExpServices : BaseServices<Ghrh_ResumeWorkExp, Ghrh_
.Where(o => o.TableName == x.Id.ToString()) .Where(o => o.TableName == x.Id.ToString())
.Select(o => new ResumeAttachment() .Select(o => new ResumeAttachment()
{ {
AttachmentID = o.Id, AttachmentID = o.AttachmentID,
AttachFileExtension = o.AttachFileExtension, AttachFileExtension = o.AttachFileExtension,
AttachFileSize = o.AttachFileSize, AttachFileSize = o.AttachFileSize,
RelativePath = "/Advanced" + o.RelativePath, RelativePath = o.RelativePath,
AttachmentName = o.AttachmentName, AttachmentName = o.AttachmentName,
RemarkSz = o.RemarkSz RemarkSz = o.RemarkSz
}).ToList(); }).ToList();
@ -44,10 +44,10 @@ public class Ghrh_ResumeWorkExpServices : BaseServices<Ghrh_ResumeWorkExp, Ghrh_
var id = await base.Add(listEntity[i]); var id = await base.Add(listEntity[i]);
if (listEntity[i].AttachmentIDs != null && listEntity[i].AttachmentIDs.Any()) if (listEntity[i].AttachmentIDs != null && listEntity[i].AttachmentIDs.Any())
{ {
var ids = listEntity[i].AttachmentIDs.Where(x => x.AttachmentID != null).Select(x => x.AttachmentID.Value).ToList(); var ids = listEntity[i].AttachmentIDs.Select(x => x.RelativePath).ToList();
await Db.Updateable<Ghre_Attachment>() await Db.Updateable<Ghrs_Attachment>()
.SetColumns(x => new Ghre_Attachment() { TableName = id.ToString(), UpdateTime = DateTime.Now }) .SetColumns(x => new Ghrs_Attachment() { TableName = id.ToString(), UpdateTime = DateTime.Now })
.Where(it => ids.Contains(it.Id)) .Where(it => it.AttachmentID != null && ids.Contains(it.RelativePath))
.ExecuteCommandAsync(); .ExecuteCommandAsync();
} }
result.Add(id); result.Add(id);

@ -271,6 +271,7 @@
获取模块信息接口 获取模块信息接口
</summary> </summary>
<param name="type"></param> <param name="type"></param>
<param name="Keywords"></param>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:Tiobon.Core.Controllers.CommonController.ExportExcelAsync(Tiobon.Core.Common.QueryExport)"> <member name="M:Tiobon.Core.Controllers.CommonController.ExportExcelAsync(Tiobon.Core.Common.QueryExport)">
@ -757,6 +758,7 @@
获取通用列表下拉 获取通用列表下拉
</summary> </summary>
<param name="linkId"></param> <param name="linkId"></param>
<param name="KeyWords"></param>
<returns></returns> <returns></returns>
</member> </member>
<member name="T:Tiobon.Core.Api.Controllers.Ghre_CourseSceneController"> <member name="T:Tiobon.Core.Api.Controllers.Ghre_CourseSceneController">
@ -955,6 +957,7 @@
获取通用列表下拉 获取通用列表下拉
</summary> </summary>
<param name="linkId"></param> <param name="linkId"></param>
<param name="KeyWords"></param>
<returns></returns> <returns></returns>
</member> </member>
<member name="T:Tiobon.Core.Api.Controllers.Ghre_ExamPaperQuestionController"> <member name="T:Tiobon.Core.Api.Controllers.Ghre_ExamPaperQuestionController">
@ -1154,6 +1157,7 @@
<summary> <summary>
记录学习时长 记录学习时长
</summary> </summary>
<param name="insert"></param>
<param name="id"></param> <param name="id"></param>
<returns></returns> <returns></returns>
</member> </member>

Loading…
Cancel
Save