using MathNet.Numerics.Distributions;
namespace Tiobon.Core.Services;
///
/// 面试工单 (服务)
///
public class Ghrh_InterviewOrderServices : BaseServices, IGhrh_InterviewOrderServices
{
private readonly IBaseRepository _dal;
private readonly IGhrh_InterviewLogServices _ghrh_InterviewLogServices;
public Ghrh_InterviewOrderServices(ICaching caching,
IGhrh_InterviewLogServices ghrh_InterviewLogServices,
IBaseRepository dal)
{
this._dal = dal;
base.BaseDal = dal;
base._caching = caching;
_ghrh_InterviewLogServices = ghrh_InterviewLogServices;
}
public override async Task Add(InsertGhrh_InterviewOrderInput entity)
{
var result = await base.Add(entity);
var usser = await GetUser();
await _ghrh_InterviewLogServices.Add(new InsertGhrh_InterviewLogInput()
{
OrderId = result,
RemarkSz = $"用户【{usser?.UserName ?? App.User.ID.ToString()}】推荐了简历!"
});
await Db.Updateable()
.SetColumns(it => it.RecommendCount == it.RecommendCount + 1)
.Where(it => it.Id == entity.RequestId)
.ExecuteCommandAsync();
return result;
}
}