|
|
|
@ -1,5 +1,5 @@ |
|
|
|
|
using AgileObjects.AgileMapper.Extensions.Internal; |
|
|
|
|
using NPOI.Util.Collections; |
|
|
|
|
using System.ComponentModel.Design; |
|
|
|
|
|
|
|
|
|
namespace Tiobon.Core.Services; |
|
|
|
|
|
|
|
|
@ -177,31 +177,45 @@ public class Ghrh_OfferApplyOrderServices : BaseServices<Ghrh_OfferApplyOrder, G |
|
|
|
|
|
|
|
|
|
public async Task<ServiceResult<long>> TempAdd(long resumeId, InsertGhrh_OfferApplyOrderInput entity) |
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
entity.OrderNo = await GenerateContinuousSequence("Ghrh_OfferApplyOrder", "OrderNo", "LYSQ"); |
|
|
|
|
entity.ApplicantId = GetStaffId(); |
|
|
|
|
entity.ApplyTime = DateTime.Now; |
|
|
|
|
entity.WorkState = 1; |
|
|
|
|
var id = await base.Add(entity); |
|
|
|
|
|
|
|
|
|
#region 写入数据,并判断是否有错误 |
|
|
|
|
var sql = $"SELECT ISNULL(MAX(id)+1,1) FROM Ghrh_OfferApplyOrder WHERE Id !='{id}'"; |
|
|
|
|
var id1 = await Db.Ado.GetLongAsync(sql); |
|
|
|
|
sql = $"UPDATE Ghrh_OfferApplyOrder SET Id={id1} WHERE Id ='{id}'"; |
|
|
|
|
await Db.Ado.ExecuteCommandAsync(sql); |
|
|
|
|
id = id1; |
|
|
|
|
#endregion |
|
|
|
|
|
|
|
|
|
if (entity.Items.IsNotEmptyOrNull()) |
|
|
|
|
var order = await base.QuerySingle(x => x.ResumeId == resumeId); |
|
|
|
|
if (order is null) |
|
|
|
|
{ |
|
|
|
|
entity.Items.ForEach(x => |
|
|
|
|
var resume = await Db.Queryable<Ghrh_Resume>().Where(x => x.Id == resumeId).FirstAsync(); |
|
|
|
|
entity.OrderNo = await GenerateContinuousSequence("Ghrh_OfferApplyOrder", "OrderNo", "LYSQ"); |
|
|
|
|
entity.ApplicantId = GetStaffId(); |
|
|
|
|
entity.ApplyTime = DateTime.Now; |
|
|
|
|
entity.WorkState = 1; |
|
|
|
|
entity.ResumeId = resumeId; |
|
|
|
|
entity.StaffName = resume.StaffName; |
|
|
|
|
entity.ResumeId = resumeId; |
|
|
|
|
var id = await base.Add(entity); |
|
|
|
|
|
|
|
|
|
#region 写入数据,并判断是否有错误 |
|
|
|
|
var sql = $"SELECT ISNULL(MAX(id)+1,1) FROM Ghrh_OfferApplyOrder WHERE Id !='{id}'"; |
|
|
|
|
var id1 = await Db.Ado.GetLongAsync(sql); |
|
|
|
|
sql = $"UPDATE Ghrh_OfferApplyOrder SET Id={id1} WHERE Id ='{id}'"; |
|
|
|
|
await Db.Ado.ExecuteCommandAsync(sql); |
|
|
|
|
id = id1; |
|
|
|
|
#endregion |
|
|
|
|
|
|
|
|
|
if (entity.Items.IsNotEmptyOrNull()) |
|
|
|
|
{ |
|
|
|
|
x.OrderId = id; |
|
|
|
|
}); |
|
|
|
|
await _ghrh_OfferApplyOrderSalaryServices.Add(entity.Items); |
|
|
|
|
entity.Items.ForEach(x => |
|
|
|
|
{ |
|
|
|
|
x.OrderId = id; |
|
|
|
|
}); |
|
|
|
|
await _ghrh_OfferApplyOrderSalaryServices.Add(entity.Items); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return ServiceResult<long>.OprateSuccess("保存成功", id); |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
var edit = Mapper.Map(entity).ToANew<EditGhrh_OfferApplyOrderInput>(); |
|
|
|
|
await base.Update(order.Id, edit, null, ["OrderNo", "ApplicantId", "ApplyTime", "WorkState", "ResumeId"]); |
|
|
|
|
return ServiceResult<long>.OprateSuccess("修改成功!", order.Id); |
|
|
|
|
|
|
|
|
|
return ServiceResult<long>.OprateSuccess("保存成功", id); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public override async Task<bool> Update(long Id, EditGhrh_OfferApplyOrderInput editModel) |
|
|
|
@ -284,7 +298,8 @@ public class Ghrh_OfferApplyOrderServices : BaseServices<Ghrh_OfferApplyOrder, G |
|
|
|
|
var applyOrder = await base.QuerySingle(x => x.ResumeId == resumeId); |
|
|
|
|
if (applyOrder != null) |
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
obj.CompanyId = applyOrder.CompanyId; |
|
|
|
|
obj.DeptId = applyOrder.DeptId; |
|
|
|
|
obj.TitleId = applyOrder.TitleId; |
|
|
|
|
obj.Channel = applyOrder.Channel; |
|
|
|
@ -293,7 +308,8 @@ public class Ghrh_OfferApplyOrderServices : BaseServices<Ghrh_OfferApplyOrder, G |
|
|
|
|
obj.InDate = applyOrder.InDate; |
|
|
|
|
obj.StaffType = applyOrder.StaffType; |
|
|
|
|
obj.GradeId = applyOrder.GradeId; |
|
|
|
|
obj.JobId = applyOrder.JobId; |
|
|
|
|
obj.PeriodMasterId = applyOrder.PeriodMasterId; |
|
|
|
|
obj.JobId = applyOrder.JobId; |
|
|
|
|
obj.ProbationMonths = applyOrder.ProbationMonths; |
|
|
|
|
obj.ReportId = applyOrder.ReportId; |
|
|
|
|
obj.JobResponsibility = applyOrder.JobResponsibility; |
|
|
|
|