From 4de0c180b38cf184e782cfaa4c5240fceea46116 Mon Sep 17 00:00:00 2001 From: xiaochanghai Date: Mon, 23 Dec 2024 22:33:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/Authorize/AuthorizeController.cs | 15 ++++++++++++--- .../Ghre/Ghre_CourseWareServices.cs | 7 +------ .../Ghre/Ghre_ExamRecordServices.cs | 4 ++-- Tiobon.Core.Services/Ghrh/Ghrh_ResumeServices.cs | 8 ++++++-- 4 files changed, 21 insertions(+), 13 deletions(-) diff --git a/Tiobon.Core.Api/Controllers/Authorize/AuthorizeController.cs b/Tiobon.Core.Api/Controllers/Authorize/AuthorizeController.cs index acc1b5e0..c01cfaea 100644 --- a/Tiobon.Core.Api/Controllers/Authorize/AuthorizeController.cs +++ b/Tiobon.Core.Api/Controllers/Authorize/AuthorizeController.cs @@ -278,6 +278,7 @@ public class AuthorizeController : BaseApiController try { + var user = await _ghrs_UserServices.QuerySingleDto(d => d.UserId == Id); if (user != null) { @@ -286,9 +287,9 @@ public class AuthorizeController : BaseApiController new Claim(ClaimTypes.Name, user.UserName.ToString()), new Claim(JwtRegisteredClaimNames.Jti, user.UserId.ToString()), new Claim("TenantId", "0"), - new Claim("StaffId", user.UserStaffID.ToString()), - new Claim("StaffName",user.StaffName), - new Claim("StaffNo", user.StaffNo), + new Claim("StaffId",user.UserStaffID !=null? user.UserStaffID.ToString():"0"), + new Claim("StaffName",user.StaffName !=null?user.StaffName:"0"), + new Claim("StaffNo", user.StaffNo !=null?user.StaffNo:"0"), new Claim(JwtRegisteredClaimNames.Iat, DateTime.Now.DateToTimeStamp()), new Claim(ClaimTypes.Expiration, DateTime.Now.AddSeconds(_requirement.Expiration.TotalSeconds).ToString()) }; @@ -301,6 +302,14 @@ public class AuthorizeController : BaseApiController return Success(result.token); } } + + // var sql = @"SELECT A.UserId, + // A.UserName, + // b.StaffNo, + // b.StaffName, + // A.UserStaffID + //FROM Ghrs_User A LEFT JOIN Ghra_Staff b ON A.UserStaffID = b.StaffID + //WHERE A.UserId = 1"; } catch (Exception E) { diff --git a/Tiobon.Core.Services/Ghre/Ghre_CourseWareServices.cs b/Tiobon.Core.Services/Ghre/Ghre_CourseWareServices.cs index e69ee6b1..f430d51a 100644 --- a/Tiobon.Core.Services/Ghre/Ghre_CourseWareServices.cs +++ b/Tiobon.Core.Services/Ghre/Ghre_CourseWareServices.cs @@ -31,12 +31,7 @@ public class Ghre_CourseWareServices : BaseServices x.CourseWareName == entity.CourseWareName && x.VersionNo == entity.VersionNo)) throw new Exception("已存在相同课名称和版本号数据!"); - if (entity.CourseIds2.Any()) - { - entity.CourseIds = JsonConvert.SerializeObject(entity.CourseIds2); - var courses = await _ghre_CourseServices.Query(x => entity.CourseIds2.Contains(x.Id)); - entity.CourseNames = string.Join(",", courses.Select(x => x.CourseName)); - } + entity.CourseIds = null; var result = await base.Add(entity); entity.Attachments.ForEach(x => diff --git a/Tiobon.Core.Services/Ghre/Ghre_ExamRecordServices.cs b/Tiobon.Core.Services/Ghre/Ghre_ExamRecordServices.cs index 60a1bc62..577d7480 100644 --- a/Tiobon.Core.Services/Ghre/Ghre_ExamRecordServices.cs +++ b/Tiobon.Core.Services/Ghre/Ghre_ExamRecordServices.cs @@ -136,7 +136,7 @@ public class Ghre_ExamRecordServices : BaseServices().Where(x => x.Id == entity.ExamId.Value).AnyAsync()) + if (await Db.Queryable().Where(x => x.Id == entity.ExamId.Value && x.Status == "Disabled").AnyAsync()) return ServiceResult.OprateFailed($"该考试已归档,不可进行调整分数!"); var paper = await Db.Queryable().FirstAsync(x => x.Id == entity.ExamPaperId); @@ -168,7 +168,7 @@ public class Ghre_ExamRecordServices : BaseServices().Where(x => x.Id == entity.ExamId.Value).AnyAsync()) + if (await Db.Queryable().Where(x => x.Id == entity.ExamId.Value && x.Status == "Disabled").AnyAsync()) return ServiceResult.OprateFailed($"该考试已归档,不可进行调整分数!"); if (edit.AdjustScore < 0) diff --git a/Tiobon.Core.Services/Ghrh/Ghrh_ResumeServices.cs b/Tiobon.Core.Services/Ghrh/Ghrh_ResumeServices.cs index 927f5c9f..49c22cf2 100644 --- a/Tiobon.Core.Services/Ghrh/Ghrh_ResumeServices.cs +++ b/Tiobon.Core.Services/Ghrh/Ghrh_ResumeServices.cs @@ -2712,8 +2712,8 @@ WHERE A.IsEnable = 1 AND C.IsEnable = 1 case "HasInterview": if (jsonParam.columnValue.ObjToInt() == 1) { - sql += $" AND (B.Status = '{DIC_INTERVIEW_ORDER_STATUS.HasInterview}' OR B.Status = '{DIC_INTERVIEW_ORDER_STATUS.InterviewFail}')"; - sql += $" AND (C.Status = '{DIC_INTERVIEW_ORDER_STATUS.WaitInterview}' OR B.Status = '{DIC_INTERVIEW_ORDER_STATUS.HasInterview}' OR B.Status = '{DIC_INTERVIEW_ORDER_STATUS.InterviewFail}')"; + sql += $" AND (B.Status = '{DIC_INTERVIEW_ORDER_STATUS.HasInterview}' OR B.Status = '{DIC_INTERVIEW_ORDER_STATUS.InterviewFail}' OR B.Status = '{DIC_INTERVIEW_ORDER_STATUS.WaitSendOffer}' OR B.Status = '{DIC_INTERVIEW_ORDER_STATUS.HasSendOffer}' OR B.Status = '{DIC_INTERVIEW_ORDER_STATUS.HasOffer}')"; + sql += $" AND (C.Status = '{DIC_INTERVIEW_ORDER_STATUS.WaitInterview}' OR C.Status = '{DIC_INTERVIEW_ORDER_STATUS.HasInterview}' OR C.Status = '{DIC_INTERVIEW_ORDER_STATUS.InterviewFail}')"; } break; case "WaitSendOffer": @@ -3990,6 +3990,10 @@ WHERE A.IsEnable = 1 AND C.IsEnable = 1 dict.Add("TitleID", applyOrder.TitleId); dict.Add("JobID", applyOrder.JobId); dict.Add("GradeID", applyOrder.GradeId); + dict.Add("PeriodMasterId", applyOrder.PeriodMasterId); + dict.Add("LegalCompanyID", applyOrder.CompanyId); + dict.Add("Reverse8", applyOrder.ProbationMonths); + //dict.Add("Reverse8", applyOrder.ProbationMonths); } if (dict.Count > 0)