diff --git a/Tiobon.Core.Model/Base/Ghre/Ghre_Request.Dto.Base.cs b/Tiobon.Core.Model/Base/Ghre/Ghre_Request.Dto.Base.cs
index 55a1c30c..50ec4b6b 100644
--- a/Tiobon.Core.Model/Base/Ghre/Ghre_Request.Dto.Base.cs
+++ b/Tiobon.Core.Model/Base/Ghre/Ghre_Request.Dto.Base.cs
@@ -66,7 +66,7 @@ public class Ghre_RequestBase
///
/// 申请人
///
- public long? ApplicantId { get; set; }
+ public int? ApplicantId { get; set; }
///
/// 需求人数
@@ -124,7 +124,7 @@ public class Ghre_RequestBase
///
/// 发起人
///
- public long? SponsorId { get; set; }
+ public int? SponsorId { get; set; }
///
/// 状态
diff --git a/Tiobon.Core.Model/Models/Ghre/Ghre_Request.cs b/Tiobon.Core.Model/Models/Ghre/Ghre_Request.cs
index 46bc6832..9f7e77d6 100644
--- a/Tiobon.Core.Model/Models/Ghre/Ghre_Request.cs
+++ b/Tiobon.Core.Model/Models/Ghre/Ghre_Request.cs
@@ -67,7 +67,7 @@ public class Ghre_Request : BasePoco
///
/// 申请人
///
- public long? ApplicantId { get; set; }
+ public int? ApplicantId { get; set; }
///
/// 需求人数
@@ -125,7 +125,7 @@ public class Ghre_Request : BasePoco
///
/// 发起人
///
- public long? SponsorId { get; set; }
+ public int? SponsorId { get; set; }
///
/// 状态
diff --git a/Tiobon.Core.Services/Ghre/Ghre_RequestServices.cs b/Tiobon.Core.Services/Ghre/Ghre_RequestServices.cs
index b49adbd9..ddc8a43e 100644
--- a/Tiobon.Core.Services/Ghre/Ghre_RequestServices.cs
+++ b/Tiobon.Core.Services/Ghre/Ghre_RequestServices.cs
@@ -41,7 +41,7 @@ FROM Ghre_Request A
if (!string.IsNullOrWhiteSpace(trainStaffId))
{
x.TrainStaffIds = JsonHelper.JsonToObj>(trainStaffId);
- var TrainStaffIds = JsonHelper.JsonToObj>(trainStaffId);
+ var TrainStaffIds = JsonHelper.JsonToObj>(trainStaffId);
sponsorIds.AddRange(TrainStaffIds);
}
@@ -117,7 +117,12 @@ FROM Ghre_Request A
throw new Exception("培训对象数量须和需求人数保持一致!");
}
}
- else entity.RequestNum = 1;
+ else
+ {
+
+ entity.RequestNum = 1;
+ entity.TrainStaffId = $"[{entity.ApplicantId}]";
+ }
var id = await base.Add(entity);
var sql = $"SELECT ISNULL(MAX(id)+1,1) FROM Ghre_Request WHERE Id !='{id}'";
@@ -130,6 +135,9 @@ FROM Ghre_Request A
public override async Task Update(long Id, EditGhre_RequestInput entity)
{
+ if (entity.TrainStaffIds.IsNotEmptyOrNull())
+ entity.TrainStaffId = JsonHelper.ObjToJson(entity.TrainStaffIds);
+ else entity.TrainStaffId = null;
if (entity.RequestSource == "Dept")
{
if (await QueryCompanyCode() == "Ushio")
@@ -143,10 +151,11 @@ FROM Ghre_Request A
throw new Exception("培训对象数量须和需求人数保持一致!");
}
}
- else entity.RequestNum = 1;
- if (entity.TrainStaffIds.IsNotEmptyOrNull())
- entity.TrainStaffId = JsonHelper.ObjToJson(entity.TrainStaffIds);
- else entity.TrainStaffId = null;
+ else
+ {
+ entity.RequestNum = 1;
+ entity.TrainStaffId = $"[{entity.ApplicantId}]";
+ }
return await base.Update(Id, entity, null, ["Status"]);
}
public async Task> InsertByStatus(InsertGhre_RequestInput insertModel, string status)