Merge branch 'master' of https://gitee.com/doan-tech/zhuangpei-mesbackend
This commit is contained in:
commit
e169fc8cd5
@ -12,16 +12,16 @@ namespace DOAN.Admin.WebApi.Controllers
|
||||
/// </summary>
|
||||
[Verify]
|
||||
[Route("mes/groupManagement/GroupPersonSkill")]
|
||||
public class GroupPersonSkillMatrixController : BaseController
|
||||
public class GroupPersonSkillController : BaseController
|
||||
{
|
||||
/// <summary>
|
||||
/// 人员技能矩阵图接口
|
||||
/// </summary>
|
||||
private readonly IGroupPersonSkillMatrixService _GroupPersonSkillMatrixService;
|
||||
private readonly IGroupPersonSkillService _GroupPersonSkillService;
|
||||
|
||||
public GroupPersonSkillMatrixController(IGroupPersonSkillMatrixService GroupPersonSkillMatrixService)
|
||||
public GroupPersonSkillController(IGroupPersonSkillService GroupPersonSkillService)
|
||||
{
|
||||
_GroupPersonSkillMatrixService = GroupPersonSkillMatrixService;
|
||||
_GroupPersonSkillService = GroupPersonSkillService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -31,9 +31,9 @@ namespace DOAN.Admin.WebApi.Controllers
|
||||
/// <returns></returns>
|
||||
[HttpGet("list")]
|
||||
[ActionPermissionFilter(Permission = "groupManagement:GroupPersonSkill:list")]
|
||||
public IActionResult QueryGroupPersonSkillMatrix([FromQuery] GroupPersonSkillMatrixQueryDto parm)
|
||||
public IActionResult QueryGroupPersonSkill([FromQuery] GroupPersonSkillQueryDto parm)
|
||||
{
|
||||
var response = _GroupPersonSkillMatrixService.GetList(parm);
|
||||
var response = _GroupPersonSkillService.GetList(parm);
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
@ -45,10 +45,10 @@ namespace DOAN.Admin.WebApi.Controllers
|
||||
/// <returns></returns>
|
||||
[HttpGet("{Id}")]
|
||||
[ActionPermissionFilter(Permission = "groupManagement:GroupPersonSkill:query")]
|
||||
public IActionResult GetGroupPersonSkillMatrix(string Id)
|
||||
public IActionResult GetGroupPersonSkill(string Id)
|
||||
{
|
||||
var response = _GroupPersonSkillMatrixService.GetInfo(Id);
|
||||
|
||||
var response = _GroupPersonSkillService.GetInfo(Id);
|
||||
|
||||
var info = response.Adapt<GroupPersonSkill>();
|
||||
return SUCCESS(info);
|
||||
}
|
||||
@ -60,11 +60,11 @@ namespace DOAN.Admin.WebApi.Controllers
|
||||
[HttpPost]
|
||||
[ActionPermissionFilter(Permission = "groupManagement:GroupPersonSkill:add")]
|
||||
[Log(Title = "人员技能矩阵图", BusinessType = BusinessType.INSERT)]
|
||||
public IActionResult AddGroupPersonSkillMatrix([FromBody] GroupPersonSkillMatrixDto parm)
|
||||
public IActionResult AddGroupPersonSkill([FromBody] GroupPersonSkillDto parm)
|
||||
{
|
||||
var modal = parm.Adapt<GroupPersonSkill>().ToCreate(HttpContext);
|
||||
|
||||
var response = _GroupPersonSkillMatrixService.AddGroupPersonSkillMatrix(modal);
|
||||
var response = _GroupPersonSkillService.AddGroupPersonSkill(modal);
|
||||
|
||||
return SUCCESS(response);
|
||||
}
|
||||
@ -76,10 +76,10 @@ namespace DOAN.Admin.WebApi.Controllers
|
||||
[HttpPut]
|
||||
[ActionPermissionFilter(Permission = "groupManagement:GroupPersonSkill:edit")]
|
||||
[Log(Title = "人员技能矩阵图", BusinessType = BusinessType.UPDATE)]
|
||||
public IActionResult UpdateGroupPersonSkillMatrix([FromBody] GroupPersonSkillMatrixDto parm)
|
||||
public IActionResult UpdateGroupPersonSkill([FromBody] GroupPersonSkillDto parm)
|
||||
{
|
||||
var modal = parm.Adapt<GroupPersonSkill>().ToUpdate(HttpContext);
|
||||
var response = _GroupPersonSkillMatrixService.UpdateGroupPersonSkillMatrix(modal);
|
||||
var response = _GroupPersonSkillService.UpdateGroupPersonSkill(modal);
|
||||
|
||||
return ToResponse(response);
|
||||
}
|
||||
@ -91,16 +91,50 @@ namespace DOAN.Admin.WebApi.Controllers
|
||||
[HttpDelete("{ids}")]
|
||||
[ActionPermissionFilter(Permission = "groupManagement:GroupPersonSkill:delete")]
|
||||
[Log(Title = "人员技能矩阵图", BusinessType = BusinessType.DELETE)]
|
||||
public IActionResult DeleteGroupPersonSkillMatrix(string ids)
|
||||
public IActionResult DeleteGroupPersonSkill(string ids)
|
||||
{
|
||||
string[] idsArr = Tools.SpitStrArrary(ids);
|
||||
if (idsArr.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); }
|
||||
|
||||
var response = _GroupPersonSkillMatrixService.Delete(idsArr);
|
||||
var response = _GroupPersonSkillService.Delete(idsArr);
|
||||
|
||||
return ToResponse(response);
|
||||
}
|
||||
//TODO 获取人员已经拥有的技能
|
||||
[HttpGet("get_person_own_skills")]
|
||||
public IActionResult GetPersonSkills(string person_id)
|
||||
{
|
||||
if (string.IsNullOrEmpty(person_id)) { return SUCCESS(null); }
|
||||
var response = _GroupPersonSkillService.GetPersonSkills(person_id);
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
//TODO 获取人员未拥有的技能
|
||||
[HttpGet("get_person_unown_skills")]
|
||||
public IActionResult GetPersonUnownSkills(string person_id)
|
||||
{
|
||||
if (string.IsNullOrEmpty(person_id)) { return SUCCESS(null); }
|
||||
var response = _GroupPersonSkillService.GetPersonUnownSkills(person_id);
|
||||
return SUCCESS(response);
|
||||
}
|
||||
//TODO 人员技能评估
|
||||
/// <summary>
|
||||
/// 人员技能评估
|
||||
/// </summary>
|
||||
/// <param name="relPersonSkill"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("person_skill_assessment")]
|
||||
public IActionResult PersonskillAssessment([FromBody] GroupRelPersonSkill relPersonSkill)
|
||||
{
|
||||
if (relPersonSkill == null)
|
||||
{
|
||||
return SUCCESS(null);
|
||||
}
|
||||
relPersonSkill.ToCreate(HttpContext);
|
||||
var response = _GroupPersonSkillService.PersonskillAssessment(relPersonSkill);
|
||||
return ToResponse(response);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@ -5,16 +5,16 @@ namespace DOAN.Model.MES.group.Dto
|
||||
/// <summary>
|
||||
/// 人员技能矩阵图查询对象
|
||||
/// </summary>
|
||||
public class GroupPersonSkillMatrixQueryDto : PagerInfo
|
||||
public class GroupPersonSkillQueryDto : PagerInfo
|
||||
{
|
||||
public string SkillName { get; set; }
|
||||
public int? Status { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 人员技能矩阵图输入输出对象
|
||||
/// 人员技能输入输出对象
|
||||
/// </summary>
|
||||
public class GroupPersonSkillMatrixDto
|
||||
public class GroupPersonSkillDto
|
||||
{
|
||||
[Required(ErrorMessage = "雪花不能为空")]
|
||||
public string Id { get; set; }
|
||||
@ -39,5 +39,34 @@ namespace DOAN.Model.MES.group.Dto
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
public class GroupPersonSkillDto2
|
||||
{
|
||||
[Required(ErrorMessage = "雪花不能为空")]
|
||||
public string Id { get; set; }
|
||||
|
||||
public string SkillName { get; set; }
|
||||
|
||||
public int score { get; set; }
|
||||
|
||||
public string Image { get; set; }
|
||||
|
||||
public string Vedio { get; set; }
|
||||
|
||||
public string Remark { get; set; }
|
||||
|
||||
public int? Status { get; set; }
|
||||
|
||||
public string CreatedBy { get; set; }
|
||||
|
||||
public DateTime? CreatedTime { get; set; }
|
||||
|
||||
public string UpdatedBy { get; set; }
|
||||
|
||||
public DateTime? UpdatedTime { get; set; }
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@ -9,21 +9,23 @@ using DOAN.Model.MES.group.Dto;
|
||||
using DOAN.Repository;
|
||||
using DOAN.Service.group.IService;
|
||||
using System.Linq;
|
||||
using NPOI.SS.Formula.Functions;
|
||||
using NPOI.XSSF.UserModel;
|
||||
|
||||
namespace DOAN.Service.group
|
||||
{
|
||||
/// <summary>
|
||||
/// 人员技能矩阵图Service业务层处理
|
||||
/// </summary>
|
||||
[AppService(ServiceType = typeof(IGroupPersonSkillMatrixService), ServiceLifetime = LifeTime.Transient)]
|
||||
public class GroupPersonSkillMatrixService : BaseService<GroupPersonSkill>, IGroupPersonSkillMatrixService
|
||||
[AppService(ServiceType = typeof(IGroupPersonSkillService), ServiceLifetime = LifeTime.Transient)]
|
||||
public class GroupPersonSkillService : BaseService<GroupPersonSkill>, IGroupPersonSkillService
|
||||
{
|
||||
/// <summary>
|
||||
/// 查询人员技能矩阵图列表
|
||||
/// </summary>
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
public PagedInfo<GroupPersonSkillMatrixDto> GetList(GroupPersonSkillMatrixQueryDto parm)
|
||||
public PagedInfo<GroupPersonSkillDto> GetList(GroupPersonSkillQueryDto parm)
|
||||
{
|
||||
var predicate = Expressionable.Create<GroupPersonSkill>()
|
||||
.AndIF(!string.IsNullOrEmpty(parm.SkillName),it=>it.SkillName.Contains(parm.SkillName))
|
||||
@ -33,7 +35,7 @@ namespace DOAN.Service.group
|
||||
|
||||
var response = Queryable()
|
||||
.Where(predicate.ToExpression())
|
||||
.ToPage<GroupPersonSkill, GroupPersonSkillMatrixDto>(parm);
|
||||
.ToPage<GroupPersonSkill, GroupPersonSkillDto>(parm);
|
||||
|
||||
return response;
|
||||
}
|
||||
@ -58,7 +60,7 @@ namespace DOAN.Service.group
|
||||
/// </summary>
|
||||
/// <param name="model"></param>
|
||||
/// <returns></returns>
|
||||
public GroupPersonSkill AddGroupPersonSkillMatrix(GroupPersonSkill model)
|
||||
public GroupPersonSkill AddGroupPersonSkill(GroupPersonSkill model)
|
||||
{
|
||||
if(string.IsNullOrEmpty(model.Id))
|
||||
{
|
||||
@ -72,7 +74,7 @@ namespace DOAN.Service.group
|
||||
/// </summary>
|
||||
/// <param name="model"></param>
|
||||
/// <returns></returns>
|
||||
public int UpdateGroupPersonSkillMatrix(GroupPersonSkill model)
|
||||
public int UpdateGroupPersonSkill(GroupPersonSkill model)
|
||||
{
|
||||
//var response = Update(w => w.Id == model.Id, it => new GroupPersonSkill()
|
||||
//{
|
||||
@ -90,5 +92,39 @@ namespace DOAN.Service.group
|
||||
return Update(model, true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 人员技能评估
|
||||
/// </summary>
|
||||
/// <param name="relPersonSkill"></param>
|
||||
/// <returns></returns>
|
||||
public int PersonskillAssessment(GroupRelPersonSkill relPersonSkill)
|
||||
{
|
||||
return Context.Storageable(relPersonSkill).ExecuteCommand();
|
||||
|
||||
}
|
||||
|
||||
//获取人员已经拥有的技能
|
||||
public List<GroupPersonSkillDto2> GetPersonSkills(string person_id)
|
||||
{
|
||||
var query = Context.Queryable<GroupRelPersonSkill>().Where(it => it.FkPersonId == person_id);
|
||||
return Context.Queryable(query).LeftJoin<GroupPersonSkill>((rel,s)=>rel.FkSkillId==s.Id)
|
||||
.Select((rel,s)=>new GroupPersonSkillDto2() { score=rel.Score.Value},true)
|
||||
.ToList();
|
||||
|
||||
|
||||
|
||||
}
|
||||
//获取人员没有拥有的技能
|
||||
public List<GroupPersonSkill> GetPersonUnownSkills(string person_id)
|
||||
{
|
||||
var query = Context.Queryable<GroupRelPersonSkill>().Where(it => it.FkPersonId == person_id);
|
||||
return Context.Queryable(query).LeftJoin<GroupPersonSkill>((rel, s) => rel.FkSkillId != s.Id)
|
||||
.Select((rel, s) => s)
|
||||
.Distinct()
|
||||
.ToList();
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@ -4,21 +4,28 @@ using DOAN.Model.Dto;
|
||||
using DOAN.Model.MES.group;
|
||||
using DOAN.Model.MES.group.Dto;
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using MimeKit.Tnef;
|
||||
|
||||
namespace DOAN.Service.group.IService
|
||||
{
|
||||
/// <summary>
|
||||
/// 人员技能矩阵图service接口
|
||||
/// </summary>
|
||||
public interface IGroupPersonSkillMatrixService : IBaseService<GroupPersonSkill>
|
||||
public interface IGroupPersonSkillService : IBaseService<GroupPersonSkill>
|
||||
{
|
||||
PagedInfo<GroupPersonSkillMatrixDto> GetList(GroupPersonSkillMatrixQueryDto parm);
|
||||
PagedInfo<GroupPersonSkillDto> GetList(GroupPersonSkillQueryDto parm);
|
||||
|
||||
GroupPersonSkill GetInfo(string Id);
|
||||
|
||||
GroupPersonSkill AddGroupPersonSkillMatrix(GroupPersonSkill parm);
|
||||
GroupPersonSkill AddGroupPersonSkill(GroupPersonSkill parm);
|
||||
|
||||
int UpdateGroupPersonSkillMatrix(GroupPersonSkill parm);
|
||||
int UpdateGroupPersonSkill(GroupPersonSkill parm);
|
||||
|
||||
int PersonskillAssessment(GroupRelPersonSkill relPersonSkill);
|
||||
|
||||
List<GroupPersonSkillDto2> GetPersonSkills(string person_id);
|
||||
List<GroupPersonSkill> GetPersonUnownSkills(string person_id);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user