Commit c40217aa authored by 黄奎's avatar 黄奎

新增实体类

parent 2fb4d864
using Edu.Common.Enum;
using System;
using VT.FW.DB;
namespace Edu.Model.Entity.Web
{
/// <summary>
/// 招聘岗位申请实体类
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_Web_JobApply
{
/// <summary>
/// 申请编号(主键)
/// </summary>
public int Id { get; set; }
/// <summary>
/// 岗位编号
/// </summary>
public int RecruitmentId { get; set; }
/// <summary>
/// 联系人
/// </summary>
public string LinkMan { get; set; }
/// <summary>
/// 联系电话
/// </summary>
public string LinkTel { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Remark { get; set; }
/// <summary>
/// 删除状态
/// </summary>
public DateStateEnum Status { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime CreateDate { get; set; }
/// <summary>
/// 创建人编号
/// </summary>
public int CreateBy { get; set; }
/// <summary>
/// 集团编号
/// </summary>
public int Group_Id { get; set; }
/// <summary>
/// 学校编号
/// </summary>
public int School_Id { get; set; }
/// <summary>
/// 处理状态(0-待处理,1-已联系,2-不合适)
/// </summary>
public int ApplyStatus { get; set; }
}
}
......@@ -29,22 +29,22 @@ namespace Edu.Model.Entity.Web
/// <summary>
/// 薪资类型(1-固定薪资,2-面议)
/// </summary>
public int? SalaryType { get; set; }
public int SalaryType { get; set; }
/// <summary>
/// 开始薪资
/// </summary>
public decimal? SalaryStart { get; set; }
public decimal SalaryStart { get; set; }
/// <summary>
/// 结束薪资
/// </summary>
public decimal? SalaryEnd { get; set; }
public decimal SalaryEnd { get; set; }
/// <summary>
/// 多少薪
/// </summary>
public int? SalaryNum { get; set; }
public int SalaryNum { get; set; }
/// <summary>
/// 工作经验
......@@ -64,7 +64,7 @@ namespace Edu.Model.Entity.Web
/// <summary>
/// 更新时间
/// </summary>
public DateTime? PublishTime { get; set; }
public DateTime PublishTime { get; set; }
/// <summary>
/// 岗位描述
......
using Edu.Model.Entity.Web;
using System;
using System.Collections.Generic;
using System.Text;
namespace Edu.Model.ViewModel.Web
{
/// <summary>
/// 招聘岗位申请视图实体类
/// </summary>
public class RB_Web_JobApply_ViewModel : RB_Web_JobApply
{
/// <summary>
/// 岗位名称
/// </summary>
public string PositionName { get; set; }
/// <summary>
/// 申请状态字符串
/// </summary>
public string ApplyStatusStr
{
get
{
string str = "";
if (this.ApplyStatus == 0)
{
str = "待处理";
}
else if (this.ApplyStatus == 1)
{
str = "已联系";
}
else if (this.ApplyStatus == 2)
{
str = "不合适";
}
return str;
}
}
/// <summary>
/// 申请时间字符串
/// </summary>
public string CreateDateStr
{
get
{
return Common.ConvertHelper.FormatTime(this.CreateDate);
}
}
}
}
......@@ -5,8 +5,11 @@ namespace Edu.Model.ViewModel.Web
/// <summary>
/// 招聘管理视图实体类
/// </summary>
public class RB_Web_Recruitment_ViewModel: RB_Web_Recruitment
public class RB_Web_Recruitment_ViewModel : RB_Web_Recruitment
{
/// <summary>
/// 发布时间字符串
/// </summary>
public string PublishTimeStr { get { return Common.ConvertHelper.FormatDate(this.PublishTime); } }
}
}
......@@ -22,6 +22,11 @@ namespace Edu.Module.Web
/// </summary>
private readonly RB_Web_RecruitmentRepository web_RecruitmentRepository = new RB_Web_RecruitmentRepository();
/// <summary>
/// 招聘岗位申请仓储层对象
/// </summary>
private readonly RB_Web_JobApplyRepository web_JobApplyRepository = new RB_Web_JobApplyRepository();
#region 招聘类型管理
/// <summary>
......@@ -176,6 +181,79 @@ namespace Edu.Module.Web
var flag = web_RecruitmentRepository.Update(fileds, new WhereHelper(nameof(RB_Web_Recruitment_ViewModel.Id), Id));
return flag;
}
#endregion
#region 招聘申请管理
/// <summary>
/// 获取招聘申请分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Web_JobApply_ViewModel> GetWebJobApplyPageModule(int pageIndex, int pageSize, out long rowsCount, RB_Web_JobApply_ViewModel query)
{
return web_JobApplyRepository.GetWebJobApplyPageRepository(pageIndex, pageSize, out rowsCount, query);
}
/// <summary>
/// 新增招聘申请
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public bool AddWebJobApplyModule(RB_Web_JobApply_ViewModel model)
{
bool flag;
var newId = web_JobApplyRepository.Insert(model);
model.Id = newId;
flag = newId > 0;
return flag;
}
/// <summary>
/// 根据编号获取招聘申请
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
public RB_Web_JobApply_ViewModel GetWebJobApplyModule(object Id)
{
return web_JobApplyRepository.GetEntity<RB_Web_JobApply_ViewModel>(Id);
}
/// <summary>
/// 修改招聘申请状态
/// </summary>
/// <param name="Id"></param>
/// <param name="Status">0-正常,1-删除</param>
/// <returns></returns>
public bool RemoveWebJobApplyStatusModule(int Id, int Status)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Web_JobApply_ViewModel.Status),Status },
};
var flag = web_JobApplyRepository.Update(fileds, new WhereHelper(nameof(RB_Web_JobApply_ViewModel.Id), Id));
return flag;
}
/// <summary>
/// 修改招聘申请信息
/// </summary>
/// <param name="Id"></param>
/// <param name="ApplyStatus"></param>
/// <returns></returns>
public bool UpdateWebJobApplyModule(int Id, int ApplyStatus)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_Web_JobApply_ViewModel.ApplyStatus),ApplyStatus },
};
var flag = web_JobApplyRepository.Update(fileds, new WhereHelper(nameof(RB_Web_JobApply_ViewModel.Id), Id));
return flag;
}
#endregion
}
}
\ No newline at end of file
using Edu.Common.Enum;
using Edu.Model.Entity.Web;
using Edu.Model.ViewModel.Web;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using VT.FW.DB.Dapper;
namespace Edu.Repository.Web
{
/// <summary>
/// 招聘岗位申请仓储层
/// </summary>
public class RB_Web_JobApplyRepository : BaseRepository<RB_Web_JobApply>
{
/// <summary>
/// 获取招聘申请分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Web_JobApply_ViewModel> GetWebJobApplyPageRepository(int pageIndex, int pageSize, out long rowsCount, RB_Web_JobApply_ViewModel query)
{
rowsCount = 0;
var parameters = new DynamicParameters();
StringBuilder builder = new StringBuilder();
builder.Append(@"
SELECT A.*,IFNULL(B.PositionName,'') AS PositionName
FROM RB_Web_JobApply AS A LEFT JOIN rb_web_recruitment AS B ON A.RecruitmentId=B.Id
WHERE 1=1
");
builder.AppendFormat(@" AND A.{0}={1} ", nameof(RB_Web_JobApply_ViewModel.Status), (int)DateStateEnum.Normal);
if (query == null)
{
return new List<RB_Web_JobApply_ViewModel>();
}
else
{
if (query.Group_Id > 0)
{
builder.AppendFormat(@" AND A.{0}={1} ", nameof(RB_Web_JobApply_ViewModel.Group_Id), query.Group_Id);
}
if (!string.IsNullOrEmpty(query.LinkMan))
{
builder.AppendFormat(" AND A.{0} LIKE @LinkMan ", nameof(RB_Web_JobApply_ViewModel.LinkMan));
parameters.Add("LinkMan", "%" + query.LinkMan.Trim() + "%");
}
if (!string.IsNullOrEmpty(query.PositionName))
{
builder.AppendFormat(" AND B.{0} LIKE @PositionName ", nameof(RB_Web_JobApply_ViewModel.PositionName));
parameters.Add("PositionName", "%" + query.PositionName.Trim() + "%");
}
}
builder.AppendFormat(" ORDER BY A.{0} DESC ", nameof(RB_Web_JobApply_ViewModel.Id));
return GetPage<RB_Web_JobApply_ViewModel>(pageIndex, pageSize, out rowsCount, builder.ToString(), parameters).ToList();
}
}
}
......@@ -81,6 +81,11 @@ namespace Edu.WebApi.Controllers.Web
/// </summary>
private readonly WebAdvisoryModule advisoryModule = new WebAdvisoryModule();
/// <summary>
/// 招聘管理
/// </summary>
private readonly WebRecruitmentModule webRecruitmentModule = new WebRecruitmentModule();
/// <summary>
/// 获取网站配置
/// </summary>
......@@ -571,5 +576,145 @@ namespace Edu.WebApi.Controllers.Web
bool flag = advisoryModule.SetWebAdvisoryModule(extModel);
return flag ? ApiResult.Success(data: extModel) : ApiResult.Failed();
}
/// <summary>
/// 获取招聘类型列表
/// </summary>
/// <returns></returns>
[HttpPost]
[AllowAnonymous]
public ApiResult GetWebRecruitmentTypeList()
{
var query = new RB_Web_RecruitmentType_ViewModel()
{
TypeName = base.ParmJObj.GetStringValue("TypeName"),
};
query.Group_Id = base.ParmJObj.GetInt("Group_Id");
if (query.Group_Id <= 0)
{
string Domain = base.ParmJObj.GetStringValue("Domain");
int groupId = groupModule.GetGroupIdByDomainModule(Domain);
query.Group_Id = groupId;
}
var list = webRecruitmentModule.GetWebRecruitmentTypeListModule(query);
return ApiResult.Success(data: list.Select(qitem => new { qitem.Id, qitem.TypeName, qitem.ImgCover }));
}
/// <summary>
/// 获取招聘信息分页列表
/// </summary>
/// <returns></returns>
[HttpPost]
[AllowAnonymous]
public ApiResult GetWebRecruitmentPage()
{
var pageModel = Common.Plugin.JsonHelper.DeserializeObject<ResultPageModel>(RequestParm.Msg.ToString());
var query = new RB_Web_Recruitment_ViewModel()
{
PositionName = base.ParmJObj.GetStringValue("PositionName"),
TypeId = base.ParmJObj.GetInt("TypeId")
};
query.Group_Id = base.ParmJObj.GetInt("Group_Id");
if (query.Group_Id <= 0)
{
string Domain = base.ParmJObj.GetStringValue("Domain");
int groupId = groupModule.GetGroupIdByDomainModule(Domain);
query.Group_Id = groupId;
}
List<object> result = new List<object>();
var list = webRecruitmentModule.GetWebRecruitmentPageModule(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, query);
foreach (var item in list)
{
string salary = "";
if (item.SalaryType == 2)
{
salary = "面议";
}
else
{
salary = item.SalaryStart + "-" + item.SalaryEnd + "K" + (item.SalaryNum > 0 ? "·" + item.SalaryNum + "薪":"");
}
result.Add(new
{
item.Id,
Salary=salary,
item.PositionName,
item.Experience,
item.Education,
item.PublishTimeStr,
item.WorkPlace,
});
}
pageModel.Count = rowsCount;
pageModel.PageData = result;
return ApiResult.Success(data: pageModel);
}
/// <summary>
/// 根据编号获取招聘详情
/// </summary>
/// <returns></returns>
[HttpPost]
[AllowAnonymous]
public ApiResult GetWebRecruitment()
{
var Id = base.ParmJObj.GetInt("Id", 0);
var extModel = webRecruitmentModule.GetWebRecruitmentModule(Id);
var obj = new object();
if (extModel != null && extModel.Id > 0)
{
string salary = "";
if (extModel.SalaryType == 2)
{
salary = "面议";
}
else
{
salary = extModel.SalaryStart + "-" + extModel.SalaryEnd + "K" + (extModel.SalaryNum > 0 ? "·" + extModel.SalaryNum + "薪" : "");
}
obj = new
{
extModel.Id,
Salary = salary,
extModel.PositionName,
extModel.Experience,
extModel.Education,
extModel.PublishTimeStr,
extModel.WorkPlace,
extModel.PositionDesc
};
}
return ApiResult.Success(data: obj);
}
/// <summary>
/// 新增招聘申请
/// </summary>
/// <returns></returns>
[HttpPost]
[AllowAnonymous]
public ApiResult AddWebJobApplyModule()
{
var extModel = new RB_Web_JobApply_ViewModel()
{
LinkMan = base.ParmJObj.GetStringValue("LinkMan"),
LinkTel = base.ParmJObj.GetStringValue("LinkTel"),
Remark = base.ParmJObj.GetStringValue("Remark"),
RecruitmentId=base.ParmJObj.GetInt("RecruitmentId"),
};
extModel.Group_Id = base.ParmJObj.GetInt("Group_Id");
if (extModel.Group_Id <= 0)
{
string Domain = base.ParmJObj.GetStringValue("Domain");
int groupId = groupModule.GetGroupIdByDomainModule(Domain);
extModel.Group_Id = groupId;
}
extModel.School_Id = 0;
extModel.CreateDate = DateTime.Now;
extModel.Status = DateStateEnum.Normal;
bool flag = webRecruitmentModule.AddWebJobApplyModule(extModel);
return flag ? ApiResult.Success(data: extModel) : ApiResult.Failed();
}
}
}
\ No newline at end of file
......@@ -77,10 +77,10 @@ namespace Edu.WebApi.Controllers.Web
var pageModel = Common.Plugin.JsonHelper.DeserializeObject<ResultPageModel>(RequestParm.Msg.ToString());
var query = new RB_Web_Nav_ViewModel()
{
NavTitle=base.ParmJObj.GetStringValue("NavTitle"),
SubTitle=base.ParmJObj.GetStringValue("SubTitle"),
NavType=(NavTypeEnum)base.ParmJObj.GetInt("NavType"),
Status=(DateStateEnum) base.ParmJObj.GetInt("Status"),
NavTitle = base.ParmJObj.GetStringValue("NavTitle"),
SubTitle = base.ParmJObj.GetStringValue("SubTitle"),
NavType = (NavTypeEnum)base.ParmJObj.GetInt("NavType"),
Status = (DateStateEnum)base.ParmJObj.GetInt("Status"),
};
query.Group_Id = base.UserInfo.Group_Id;
var list = navModule.GetWebNavPageModule(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, query);
......@@ -98,12 +98,12 @@ namespace Edu.WebApi.Controllers.Web
{
var extModel = new RB_Web_Nav_ViewModel()
{
Id=base.ParmJObj.GetInt("Id"),
Id = base.ParmJObj.GetInt("Id"),
NavTitle = base.ParmJObj.GetStringValue("NavTitle"),
SubTitle = base.ParmJObj.GetStringValue("SubTitle"),
NavType = (NavTypeEnum)base.ParmJObj.GetInt("NavType"),
LinkUrl=base.ParmJObj.GetStringValue("LinkUrl"),
BgImg=base.ParmJObj.GetStringValue("BgImg"),
LinkUrl = base.ParmJObj.GetStringValue("LinkUrl"),
BgImg = base.ParmJObj.GetStringValue("BgImg"),
};
extModel.School_Id = base.UserInfo.School_Id;
extModel.Group_Id = base.UserInfo.Group_Id;
......@@ -164,7 +164,7 @@ namespace Edu.WebApi.Controllers.Web
var query = new RB_Web_Menu_ViewModel()
{
Name = base.ParmJObj.GetStringValue("Name"),
MenuLevel=base.ParmJObj.GetInt("MenuLevel"),
MenuLevel = base.ParmJObj.GetInt("MenuLevel"),
};
query.Group_Id = base.UserInfo.Group_Id;
var list = menuModule.GetWebMenuListModule(query);
......@@ -340,7 +340,7 @@ namespace Edu.WebApi.Controllers.Web
var query = new RB_Web_News_ViewModel()
{
Title = base.ParmJObj.GetStringValue("Title"),
TypeId= base.ParmJObj.GetInt("TypeId"),
TypeId = base.ParmJObj.GetInt("TypeId"),
};
query.Group_Id = base.UserInfo.Group_Id;
var list = newsModule.GetWebNewsListModule(query);
......@@ -523,7 +523,7 @@ namespace Edu.WebApi.Controllers.Web
var query = new RB_Web_Advisory_ViewModel()
{
LinkMan = base.ParmJObj.GetStringValue("LinkMan"),
DealStatus=base.ParmJObj.GetInt("DealStatus"),
DealStatus = base.ParmJObj.GetInt("DealStatus"),
Status = (DateStateEnum)base.ParmJObj.GetInt("Status"),
};
query.Group_Id = base.UserInfo.Group_Id;
......@@ -619,7 +619,7 @@ namespace Edu.WebApi.Controllers.Web
{
Id = base.ParmJObj.GetInt("Id"),
Name = base.ParmJObj.GetStringValue("Name"),
LinkUrl= base.ParmJObj.GetStringValue("LinkUrl"),
LinkUrl = base.ParmJObj.GetStringValue("LinkUrl"),
};
extModel.School_Id = base.UserInfo.School_Id;
extModel.Group_Id = base.UserInfo.Group_Id;
......@@ -690,7 +690,7 @@ namespace Edu.WebApi.Controllers.Web
{
Id = base.ParmJObj.GetInt("Id"),
Name = base.ParmJObj.GetStringValue("Name"),
CoverImg= base.ParmJObj.GetStringValue("CoverImg"),
CoverImg = base.ParmJObj.GetStringValue("CoverImg"),
LinkUrl = base.ParmJObj.GetStringValue("LinkUrl"),
};
extModel.School_Id = base.UserInfo.School_Id;
......@@ -741,7 +741,7 @@ namespace Edu.WebApi.Controllers.Web
var pageModel = Common.Plugin.JsonHelper.DeserializeObject<ResultPageModel>(RequestParm.Msg.ToString());
var query = new RB_Web_RecruitmentType_ViewModel()
{
TypeName = base.ParmJObj.GetStringValue("TypeName"),
TypeName = base.ParmJObj.GetStringValue("TypeName"),
};
query.Group_Id = base.UserInfo.Group_Id;
var list = webRecruitmentModule.GetWebRecruitmentTypePageModule(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, query);
......@@ -825,7 +825,7 @@ namespace Edu.WebApi.Controllers.Web
var query = new RB_Web_Recruitment_ViewModel()
{
PositionName = base.ParmJObj.GetStringValue("PositionName"),
TypeId=base.ParmJObj.GetInt("TypeId")
TypeId = base.ParmJObj.GetInt("TypeId")
};
query.Group_Id = base.UserInfo.Group_Id;
var list = webRecruitmentModule.GetWebRecruitmentPageModule(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, query);
......@@ -844,18 +844,18 @@ namespace Edu.WebApi.Controllers.Web
var extModel = new RB_Web_Recruitment_ViewModel()
{
Id = base.ParmJObj.GetInt("Id"),
TypeId=base.ParmJObj.GetInt("TypeId"),
TypeId = base.ParmJObj.GetInt("TypeId"),
PositionName = base.ParmJObj.GetStringValue("PositionName"),
SalaryType=base.ParmJObj.GetInt("SalaryType"),
SalaryStart=base.ParmJObj.GetDecimal("SalaryStart"),
SalaryEnd=base.ParmJObj.GetDecimal("SalaryEnd"),
SalaryNum=base.ParmJObj.GetInt("SalaryNum"),
SalaryType = base.ParmJObj.GetInt("SalaryType"),
SalaryStart = base.ParmJObj.GetDecimal("SalaryStart"),
SalaryEnd = base.ParmJObj.GetDecimal("SalaryEnd"),
SalaryNum = base.ParmJObj.GetInt("SalaryNum"),
Experience = base.ParmJObj.GetStringValue("Experience"),
Education = base.ParmJObj.GetStringValue("Education"),
WorkPlace = base.ParmJObj.GetStringValue("WorkPlace"),
PublishTime = base.ParmJObj.GetDateTime("PublishTime"),
PositionDesc = base.ParmJObj.GetStringValue("PositionDesc"),
};
extModel.PublishTime = DateTime.Now;
extModel.School_Id = base.UserInfo.School_Id;
extModel.Group_Id = base.UserInfo.Group_Id;
extModel.CreateBy = base.UserInfo.Id;
......@@ -890,5 +890,66 @@ namespace Edu.WebApi.Controllers.Web
return flag ? ApiResult.Success() : ApiResult.Failed();
}
#endregion
#region 招聘申请管理
/// <summary>
/// 获取招聘类型分页列表
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetWebJobApplyPage()
{
var pageModel = Common.Plugin.JsonHelper.DeserializeObject<ResultPageModel>(RequestParm.Msg.ToString());
var query = new RB_Web_JobApply_ViewModel()
{
LinkMan = base.ParmJObj.GetStringValue("LinkMan"),
PositionName = base.ParmJObj.GetStringValue("PositionName"),
};
query.Group_Id = base.UserInfo.Group_Id;
var list = webRecruitmentModule.GetWebJobApplyPageModule(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, query);
pageModel.Count = rowsCount;
pageModel.PageData = list;
return ApiResult.Success(data: pageModel);
}
/// <summary>
/// 根据编号获取招聘申请
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetWebJobApply()
{
var Id = base.ParmJObj.GetInt("Id", 0);
var extModel = webRecruitmentModule.GetWebJobApplyModule(Id);
return ApiResult.Success(data: extModel);
}
/// <summary>
/// 修改招聘申请状态
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult RemoveWebJobApplyStatus()
{
var Id = base.ParmJObj.GetInt("Id", 0);
var Status = base.ParmJObj.GetInt("Status", 0);
var flag = webRecruitmentModule.RemoveWebJobApplyStatusModule(Id, Status);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
/// <summary>
/// 修改招聘申请信息
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult UpdateWebJobApply()
{
var Id = base.ParmJObj.GetInt("Id", 0);
var ApplyStatus = base.ParmJObj.GetInt("ApplyStatus", 0);
var flag = webRecruitmentModule.UpdateWebJobApplyModule(Id, ApplyStatus);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
#endregion
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment