From 5e33c772e1ddad113658fbaeda17b4192f31f627 Mon Sep 17 00:00:00 2001 From: xiaochanghai Date: Mon, 20 Jan 2025 15:55:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=9D=A2=E8=AF=95=E8=AE=B0?= =?UTF-8?q?=E5=BD=95=E8=A1=A8=E6=97=A5=E6=9C=9F=E6=A0=BC=E5=BC=8F=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E4=B8=8D=E4=B8=80=E8=87=B4=20=E7=AE=80=E5=8E=86?= =?UTF-8?q?=E4=BF=9D=E5=AD=98=20=E6=96=B0=E5=A2=9E=E5=B7=A5=E4=BD=9C?= =?UTF-8?q?=E7=BB=8F=E5=8E=86=E5=8F=8D=E6=8E=A8=E5=B7=A5=E4=BD=9C=E5=B9=B4?= =?UTF-8?q?=E9=99=90=20=E7=AE=80=E5=8E=86=E6=8E=A8=E8=8D=90=E6=8A=A5?= =?UTF-8?q?=E9=94=99=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Tiobon.Core.Common/DB/Aop/SqlsugarAop.cs | 2 +- Tiobon.Core.Common/Helper/DateTimeHelper.cs | 38 +++++++++---------- .../Ghrh/Ghrh_HumanRequestServices.cs | 27 +++++++------ .../Ghrh/Ghrh_InterviewRecordServices.cs | 4 +- .../Ghrh/Ghrh_ResumeServices.cs | 30 ++++++++++++--- 5 files changed, 60 insertions(+), 41 deletions(-) diff --git a/Tiobon.Core.Common/DB/Aop/SqlsugarAop.cs b/Tiobon.Core.Common/DB/Aop/SqlsugarAop.cs index 707db21d..3995b5c4 100644 --- a/Tiobon.Core.Common/DB/Aop/SqlsugarAop.cs +++ b/Tiobon.Core.Common/DB/Aop/SqlsugarAop.cs @@ -93,7 +93,7 @@ public static class SqlSugarAop var dyCreateBy = getType.GetProperty("CreateBy"); var dyCreateTime = getType.GetProperty("CreateTime"); BasePoco ent = entityInfo.EntityValue as BasePoco; - if (ent.Id == 0) + if (ent != null && ent.Id == 0) ent.Id = SnowFlakeSingle.Instance.NextId(); if (App.User?.ID > 0 && dyCreateBy != null && dyCreateBy.GetValue(entityInfo.EntityValue) == null) { diff --git a/Tiobon.Core.Common/Helper/DateTimeHelper.cs b/Tiobon.Core.Common/Helper/DateTimeHelper.cs index 65e59b10..e0e85a96 100644 --- a/Tiobon.Core.Common/Helper/DateTimeHelper.cs +++ b/Tiobon.Core.Common/Helper/DateTimeHelper.cs @@ -62,7 +62,7 @@ public class DateTimeHelper return ConvertToYearString((DateTime)dateTime); } /// - /// 格式化DateTime类型为字符串类型,精确到月,如:2008/01 + /// 格式化DateTime类型为字符串类型,精确到月,如:2008-01 /// /// /// @@ -72,10 +72,10 @@ public class DateTimeHelper { return ""; } - return dateTime.ToString(@"yyyy\/MM"); + return dateTime.ToString(@"yyyy\-MM"); } /// - /// 格式化object类型为字符串类型,精确到月,如:2008/01 + /// 格式化object类型为字符串类型,精确到月,如:2008-01 /// /// /// @@ -88,7 +88,7 @@ public class DateTimeHelper return ConvertToMonthString((DateTime)dateTime); } /// - /// 格式化DateTime类型为字符串类型,精确到天,如:2008/01/01 + /// 格式化DateTime类型为字符串类型,精确到天,如:2008-01-01 /// /// /// @@ -98,10 +98,10 @@ public class DateTimeHelper { return ""; } - return dateTime.ToString(@"yyyy\/MM\/dd"); + return dateTime.ToString(@"yyyy\-MM\-dd"); } /// - /// 格式化DateTime类型为字符串类型,精确到天,如:2008/01/01 + /// 格式化DateTime类型为字符串类型,精确到天,如:2008-01-01 /// /// /// @@ -119,7 +119,7 @@ public class DateTimeHelper } /// - /// 格式化DateTime类型为字符串类型,精确到小时,如:2008/01/01 18 + /// 格式化DateTime类型为字符串类型,精确到小时,如:2008-01-01 18 /// /// /// @@ -129,10 +129,10 @@ public class DateTimeHelper { return ""; } - return dateTime.ToString(@"yyyy\/MM\/dd HH"); + return dateTime.ToString(@"yyyy\-MM\-dd HH"); } /// - /// 格式化object类型为字符串类型,精确到小时,如:2008/01/01 18 + /// 格式化object类型为字符串类型,精确到小时,如:2008-01-01 18 /// /// /// @@ -146,7 +146,7 @@ public class DateTimeHelper } /// - /// 格式化object类型为字符串类型,精确到天,如:2008/01/01 + /// 格式化object类型为字符串类型,精确到天,如:2008-01-01 /// /// /// @@ -162,7 +162,7 @@ public class DateTimeHelper } /// - /// 格式化DateTime类型为字符串类型,精确到分钟,如:2008/01/01 18:09 + /// 格式化DateTime类型为字符串类型,精确到分钟,如:2008-01-01 18:09 /// /// /// @@ -172,11 +172,11 @@ public class DateTimeHelper { return ""; } - return dateTime.ToString(@"yyyy\/MM\/dd HH:mm"); + return dateTime.ToString(@"yyyy\-MM\-dd HH:mm"); } /// - /// 格式化object类型为字符串类型,精确到分钟,如:2008/01/01 18:09 + /// 格式化object类型为字符串类型,精确到分钟,如:2008-01-01 18:09 /// /// /// @@ -190,7 +190,7 @@ public class DateTimeHelper } /// - /// 格式化DateTime类型为字符串类型,精确到秒,如:2008/01/01 18:09:20 + /// 格式化DateTime类型为字符串类型,精确到秒,如:2008-01-01 18:09:20 /// /// /// @@ -200,7 +200,7 @@ public class DateTimeHelper { return ""; } - return dateTime.ToString(@"yyyy\/MM\/dd HH:mm:ss"); + return dateTime.ToString(@"yyyy\-MM\-dd HH:mm:ss"); } /// /// 格式化DateTime类型为字符串类型,精确到秒,如:20080101180920 @@ -216,7 +216,7 @@ public class DateTimeHelper return dateTime.ToString(@"yyyyMMddHHmmss"); } /// - /// 格式化object类型为字符串类型,精确到秒,如:2008/01/01 18:09:20 + /// 格式化object类型为字符串类型,精确到秒,如:2008-01-01 18:09:20 /// /// /// @@ -310,7 +310,7 @@ public class DateTimeHelper } /// - /// 格式化DateTime类型为字符串类型,如:2020/05 + /// 格式化DateTime类型为字符串类型,如:2020-05 /// /// /// @@ -320,10 +320,10 @@ public class DateTimeHelper { return ""; } - return dateTime.ToString(@"yyyy\/MM"); + return dateTime.ToString(@"yyyy\-MM"); } /// - /// 格式化object类型为字符串类型,如:2020/05 + /// 格式化object类型为字符串类型,如:2020-05 /// /// /// diff --git a/Tiobon.Core.Services/Ghrh/Ghrh_HumanRequestServices.cs b/Tiobon.Core.Services/Ghrh/Ghrh_HumanRequestServices.cs index 01c1d8c3..a5389a09 100644 --- a/Tiobon.Core.Services/Ghrh/Ghrh_HumanRequestServices.cs +++ b/Tiobon.Core.Services/Ghrh/Ghrh_HumanRequestServices.cs @@ -191,22 +191,25 @@ WHERE A.IsEnable = 1 AND A.Id = {entitys[i].YearHumanId}"); public override async Task QueryById(object objId) { var result = await base.QueryById(objId); - result.DeptName = (await Db.Queryable().FirstAsync(o => result.DeptId == o.DeptID))?.DeptName; - if (result.TitleId.IsNotEmptyOrNull()) - result.TitleName = (await Db.Queryable().FirstAsync(o => result.TitleId == o.TitleID))?.TitleName; - - #region 返回部门负责人信息 - var dept = await Db.Queryable().Where(x => x.DeptID == result.DeptId).FirstAsync(); - if (dept != null) + if (result != null) { - var staff = await Db.Queryable().Where(x => x.StaffID == dept.DeptManagerID).FirstAsync(); - if (staff != null) + result.DeptName = (await Db.Queryable().FirstAsync(o => result.DeptId == o.DeptID))?.DeptName; + if (result.TitleId.IsNotEmptyOrNull()) + result.TitleName = (await Db.Queryable().FirstAsync(o => result.TitleId == o.TitleID))?.TitleName; + + #region 返回部门负责人信息 + var dept = await Db.Queryable().Where(x => x.DeptID == result.DeptId).FirstAsync(); + if (dept != null) { - result.DeptManagerID = staff.StaffID; - result.DeptManagerEmail = staff.Email; + var staff = await Db.Queryable().Where(x => x.StaffID == dept.DeptManagerID).FirstAsync(); + if (staff != null) + { + result.DeptManagerID = staff.StaffID; + result.DeptManagerEmail = staff.Email; + } } + #endregion } - #endregion return result; } diff --git a/Tiobon.Core.Services/Ghrh/Ghrh_InterviewRecordServices.cs b/Tiobon.Core.Services/Ghrh/Ghrh_InterviewRecordServices.cs index fb5407ad..161699fb 100644 --- a/Tiobon.Core.Services/Ghrh/Ghrh_InterviewRecordServices.cs +++ b/Tiobon.Core.Services/Ghrh/Ghrh_InterviewRecordServices.cs @@ -1,6 +1,4 @@ -using MySqlX.XDevAPI.Common; - -namespace Tiobon.Core.Services; +namespace Tiobon.Core.Services; /// /// 面试记录 (服务) diff --git a/Tiobon.Core.Services/Ghrh/Ghrh_ResumeServices.cs b/Tiobon.Core.Services/Ghrh/Ghrh_ResumeServices.cs index 1531ff49..2ce41958 100644 --- a/Tiobon.Core.Services/Ghrh/Ghrh_ResumeServices.cs +++ b/Tiobon.Core.Services/Ghrh/Ghrh_ResumeServices.cs @@ -1316,6 +1316,24 @@ A.DataType, A.ColumnType, A.IsRequired, A.DataSourceType, A.DataSource, A.DataSo } #endregion resume.Base.Education = resume.Base.EduDegree; + + #region 计算工作年限 + var days = 0; + if (resume.WorkExp != null && resume.WorkExp.Any()) + { + resume.WorkExp.ForEach(x => + { + if (x.BeginDate != null && x.EndDate != null && x.EndDate > x.BeginDate) + { + var difference = x.EndDate.Value - x.BeginDate.Value; + days += difference.TotalDays.ObjToInt(); + } + }); + } + + resume.Base.WorkYears = days / 365; + #endregion + await base.Update(id, resume.Base); await _ghrh_ResumeHomeServices.Delete(x => x.ResumeId != null && x.ResumeId == id);//家庭关系 @@ -3050,12 +3068,12 @@ WHERE A.IsEnable = 1 AND C.IsEnable = 1 { var request = await _ghrh_HumanRequestServices.QueryById(order.RequestId); result.RequestId = order.RequestId; - result.DeptName = request.DeptName; - result.TitleName = request.TitleName; - result.ResumeCount = request.RequestCount; - result.RecommendCount = request.RecommendCount; - result.InterviewCount = request.InterviewCount; - result.OfferCount = request.OfferCount; + result.DeptName = request?.DeptName; + result.TitleName = request?.TitleName; + result.ResumeCount = request?.RequestCount; + result.RecommendCount = request?.RecommendCount; + result.InterviewCount = request?.InterviewCount; + result.OfferCount = request?.OfferCount; } else {