@ -1,6 +1,4 @@
using Microsoft.EntityFrameworkCore.ChangeTracking ;
using Tiobon.Core.Model.Models ;
using static Tiobon . Core . Model . Consts ;
using static Tiobon . Core . Model . Consts ;
namespace Tiobon.Core.Services ;
@ -91,7 +89,7 @@ public class Ghrh_ResumeServices : BaseServices<Ghrh_Resume, Ghrh_ResumeDto, Ins
break ;
case "HasRecommend" :
if ( jsonParam . columnValue . ObjToInt ( ) = = 1 )
whereExpression . And ( x = > x . Status = = DIC_INTERVIEW_ORDER_STATUS . HasRecommended ) ;
whereExpression . And ( x = > ( x . Status = = DIC_INTERVIEW_ORDER_STATUS . HasRecommended | | x . Status = = DIC_INTERVIEW_ORDER_STATUS . Fail ) ) ;
break ;
case "WaitAppointment" :
if ( jsonParam . columnValue . ObjToInt ( ) = = 1 )
@ -103,7 +101,7 @@ public class Ghrh_ResumeServices : BaseServices<Ghrh_Resume, Ghrh_ResumeDto, Ins
break ;
case "HasInterview" :
if ( jsonParam . columnValue . ObjToInt ( ) = = 1 )
whereExpression . And ( x = > x . Status = = DIC_INTERVIEW_ORDER_STATUS . HasInterview ) ;
whereExpression . And ( x = > ( x . Status = = DIC_INTERVIEW_ORDER_STATUS . HasInterview | | x . Status = = DIC_INTERVIEW_ORDER_STATUS . InterviewFail ) ) ;
break ;
case "WaitSendOffer" :
if ( jsonParam . columnValue . ObjToInt ( ) = = 1 )
@ -228,6 +226,7 @@ public class Ghrh_ResumeServices : BaseServices<Ghrh_Resume, Ghrh_ResumeDto, Ins
tagIds . AddRange ( JsonHelper . JsonToObj < List < long > > ( x . Tags ) ) ;
} ) ;
var orders = await _ ghrh_InterviewOrderServices . Query ( x = > x . ResumeId ! = null & & ids . Contains ( x . ResumeId . Value ) ) ;
tagIds = tagIds . Distinct ( ) . ToList ( ) ;
var tags = await _ ghrh_ResumeTagServices . QueryDto ( x = > tagIds . Contains ( x . Id ) ) ;
list . ForEach ( async x = >
@ -249,6 +248,7 @@ public class Ghrh_ResumeServices : BaseServices<Ghrh_Resume, Ghrh_ResumeDto, Ins
if ( x . Tags . IsNotEmptyOrNull ( ) )
{
var tagIds1 = JsonHelper . JsonToObj < List < long > > ( x . Tags ) ;
x . TagIds = tagIds1 ;
x . TagList = tags . Where ( o = > tagIds1 . Contains ( o . Id ) ) . Select ( o = > o . TagName ) . ToList ( ) ;
}
@ -263,6 +263,14 @@ public class Ghrh_ResumeServices : BaseServices<Ghrh_Resume, Ghrh_ResumeDto, Ins
x . Age = age ;
}
# endregion
var order = orders . Where ( o = > o . ResumeId = = x . ResumeId ) . FirstOrDefault ( ) ;
if ( order ! = null )
{
x . IsPass = order . IsPass ;
x . IsPassLabel = order . IsPass = = true ? "通过" : "不通过" ;
x . InterviewResult = order . InterviewResult ;
}
} ) ;
return result ;
@ -959,6 +967,8 @@ END";
if ( entity ! = null & & entity . Status ! = DIC_INTERVIEW_ORDER_STATUS . WaitRecommended )
resume . Base . Status = entity . Status ;
if ( resume . Base . Status . IsNullOrEmpty ( ) )
resume . Base . Status = DIC_INTERVIEW_ORDER_STATUS . WaitRecommended ;
if ( resume . Base . PhotoUrls ! = null & & resume . Base . PhotoUrls . Any ( ) )
resume . Base . PhotoUrl = resume . Base . PhotoUrls [ 0 ] . RelativePath ;
await base . Update ( id , resume . Base ) ;
@ -1260,6 +1270,16 @@ END";
public async Task < ServiceResult > Recommend ( ResumeRecommendForm recommend )
{
if ( recommend . RequestId . IsNullOrEmpty ( ) )
throw new Exception ( "请先选择用人申请单!" ) ;
if ( recommend . InterviewStaffs . IsNullOrEmpty ( ) )
throw new Exception ( "请先选择面试者!" ) ;
recommend . InterviewStaffs = recommend . InterviewStaffs . Where ( x = > x . StaffId ! = null ) . ToList ( ) ;
if ( ! recommend . InterviewStaffs . Any ( ) )
throw new Exception ( "请先选择面试者!" ) ;
for ( int m = 0 ; m < recommend . ids . Count ; m + + )
{
var id = recommend . ids [ m ] ;
@ -1273,10 +1293,10 @@ END";
x . Status = = DIC_INTERVIEW_ORDER_STATUS . HasInterview ) ) )
continue ;
//await Db.Updateable<Ghrh_InterviewOrder>( )
// .SetColumns(it => it.IsEnable == 0 )
// .Where(it => it.ResumeId == id )
// .ExecuteCommandAsync() ;
await Db . Updateable < Ghrh_InterviewOrder > ( )
. SetColumns ( it = > it . IsEnable = = 0 )
. Where ( it = > it . ResumeId = = id )
. ExecuteCommandAsync ( ) ;
var orderId = await _ ghrh_InterviewOrderServices . Add ( new InsertGhrh_InterviewOrderInput ( )
{
@ -1584,7 +1604,7 @@ END";
await Update ( entity , [ "Status" ] ) ;
if ( input . InterviewStaffs . IsNotEmptyOrNull ( ) )
await SendMessage ( input . InterviewStaffs . Select ( x = > x . StaffId ) . ToList ( ) , "简历提醒" , "您有个新的邀约面试,请及时查看!" ) ;
await SendMessage ( input . InterviewStaffs . Select ( x = > x . StaffId . Value ) . ToList ( ) , "简历提醒" , "您有个新的邀约面试,请及时查看!" ) ;
}
@ -1611,7 +1631,7 @@ END";
} ) ;
if ( input . InterviewStaffs . IsNotEmptyOrNull ( ) )
await SendMessage ( input . InterviewStaffs . Select ( x = > x . StaffId ) . ToList ( ) , "简历提醒" , "您有个新的推荐简历,请及时查看!" ) ;
await SendMessage ( input . InterviewStaffs . Select ( x = > x . StaffId . Value ) . ToList ( ) , "简历提醒" , "您有个新的推荐简历,请及时查看!" ) ;
}
}
return ServiceResult . OprateSuccess ( ) ;
@ -1626,7 +1646,7 @@ END";
return ServiceResult . OprateFailed ( "无效的简历ID!" ) ;
var order = await _ ghrh_InterviewOrderServices . QuerySingle ( x = > x . ResumeId = = id ) ;
order . Status = DIC_INTERVIEW_ORDER_STATUS . Has Interview;
order . Status = DIC_INTERVIEW_ORDER_STATUS . InterviewFail ;
order . IsPass = input . IsPass ;
order . InterviewResult = input . Content ;
await _ ghrh_InterviewOrderServices . Update ( order , [ "Status" , "IsPass" , "InterviewResult" ] ) ;
@ -1635,10 +1655,10 @@ END";
record . InterviewResult = input . Content ;
record . IsPass = input . IsPass ;
record . AssessTime = DateTime . Now ;
record . Status = DIC_INTERVIEW_ORDER_STATUS . Has Interview;
record . Status = DIC_INTERVIEW_ORDER_STATUS . InterviewFail ;
await _ ghrh_InterviewRecordServices . Update ( record , [ "AssessTime" , "Status" , "IsPass" , "InterviewResult" ] ) ;
await UpdateResumeStatus ( entity , DIC_INTERVIEW_ORDER_STATUS . Has Interview) ;
await UpdateResumeStatus ( entity , DIC_INTERVIEW_ORDER_STATUS . InterviewFail ) ;
await LogRecord ( order . Id , $"填写了面试评估,轮数:{order.Round},是否通过:{(input.IsPass == true ? " 通 过 " : " 不 通 过 ")},内容:{input.Content}!" ) ;
return ServiceResult . OprateSuccess ( ) ;
@ -1811,6 +1831,9 @@ END";
if ( entity = = null )
return ServiceResult . OprateFailed ( "无效的简历ID!" ) ;
if ( entity . Status ! = DIC_INTERVIEW_ORDER_STATUS . HasInterview )
return ServiceResult . OprateFailed ( "暂不可发起录用审批!" ) ;
await UpdateResumeStatus ( entity , DIC_INTERVIEW_ORDER_STATUS . WaitSendOffer ) ;
var order = await _ ghrh_InterviewOrderServices . QuerySingle ( x = > x . ResumeId = = id ) ;
@ -1969,7 +1992,7 @@ WHERE A.IsEnable = 1 AND C.IsEnable = 1";
break ;
case "HasInterview" :
if ( jsonParam . columnValue . ObjToInt ( ) = = 1 )
sql + = $" AND C.Status = '{DIC_INTERVIEW_ORDER_STATUS.HasInterview}'" ;
sql + = $" AND ( C.Status = '{DIC_INTERVIEW_ORDER_STATUS.HasInterview}' OR C.Status = '{DIC_INTERVIEW_ORDER_STATUS.InterviewFail}') " ;
break ;
case "WaitSendOffer" :
if ( jsonParam . columnValue . ObjToInt ( ) = = 1 )
@ -1983,6 +2006,10 @@ WHERE A.IsEnable = 1 AND C.IsEnable = 1";
if ( jsonParam . columnValue . ObjToInt ( ) = = 1 )
sql + = $" AND C.Status = '{DIC_INTERVIEW_ORDER_STATUS.HasOffer}'" ;
break ;
case "Fail" :
if ( jsonParam . columnValue . ObjToInt ( ) = = 1 )
sql + = $" AND C.Status = '{DIC_INTERVIEW_ORDER_STATUS.Fail}'" ;
break ;
case "SalaryPeriod" :
case "Education" :
@ -2132,6 +2159,8 @@ WHERE A.IsEnable = 1 AND C.IsEnable = 1";
x . Age = age ;
}
# endregion
if ( x . IsPass ! = null )
x . IsPassLabel = x . IsPass = = true ? "通过" : "不通过" ;
} ) ;
return new ServicePageResult < Ghrh_ResumeDto > ( filter . pageNum , totalCount , filter . pageSize , list ) ;
@ -2145,7 +2174,7 @@ WHERE A.IsEnable = 1 AND C.IsEnable = 1";
var result = new ResumeScheduleInterviewResult ( ) ;
var entity = base . QueryById ( id ) ;
var order = await _ ghrh_InterviewOrderServices . QuerySingle ( x = > x . ResumeId = = id ) ;
var record = await _ ghrh_InterviewRecordServices . QuerySingle ( x = > x . Round = = order . Round & & x . OrderId = = order . Id ) ;
var records = await _ ghrh_InterviewRecordServices . Query ( x = > x . Round = = order . Round & & x . OrderId = = order . Id ) ;
var request = await _ ghrh_HumanRequestServices . QueryById ( order . RequestId ) ;
result . RequestId = order . RequestId ;
@ -2156,16 +2185,24 @@ WHERE A.IsEnable = 1 AND C.IsEnable = 1";
result . InterviewCount = request . InterviewCount ;
result . OfferCount = request . OfferCount ;
result . Times = new List < string > ( ) ;
if ( record . PlanInterviewTime1 . IsNotEmptyOrNull ( ) )
result . Times . Add ( record . PlanInterviewTime1 ) ;
if ( record . PlanInterviewTime2 . IsNotEmptyOrNull ( ) )
result . Times . Add ( record . PlanInterviewTime2 ) ;
if ( record . PlanInterviewTime3 . IsNotEmptyOrNull ( ) )
result . Times . Add ( record . PlanInterviewTime3 ) ;
result . Staffs = new ( ) ;
if ( records ! = null & & records . Any ( ) )
{
var record = records . Where ( x = > x . PlanInterviewTime1 ! = null ) . FirstOrDefault ( ) ;
if ( record ! = null )
{
if ( record . PlanInterviewTime1 . IsNotEmptyOrNull ( ) )
result . Times . Add ( record . PlanInterviewTime1 ) ;
if ( record . PlanInterviewTime2 . IsNotEmptyOrNull ( ) )
result . Times . Add ( record . PlanInterviewTime2 ) ;
if ( record . PlanInterviewTime3 . IsNotEmptyOrNull ( ) )
result . Times . Add ( record . PlanInterviewTime3 ) ;
}
var staffIds = records . Where ( x = > x . StaffId ! = null ) . Select ( x = > x . StaffId . Value ) . ToList ( ) ;
result . Staffs = await Db . Queryable < Ghra_Staff > ( ) . Where ( x = > staffIds . Contains ( x . StaffID ) ) . ToListAsync ( ) ;
}
return ServiceResult < ResumeScheduleInterviewResult > . OprateSuccess ( "查询成功" , result ) ;
}