2024-08-12 14:41:07 +08:00
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
|
|
using DOAN.Model.MES.group;
|
|
|
|
|
|
using DOAN.Model.MES.group.Dto;
|
|
|
|
|
|
using DOAN.Service.group.IService;
|
|
|
|
|
|
using DOAN.Admin.WebApi.Filters;
|
|
|
|
|
|
|
|
|
|
|
|
//创建时间:2024-08-12
|
|
|
|
|
|
namespace DOAN.Admin.WebApi.Controllers
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 人员技能矩阵图
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[Verify]
|
2024-08-12 15:13:24 +08:00
|
|
|
|
[Route("mes/groupManagement/GroupPersonSkill")]
|
2024-08-12 16:13:24 +08:00
|
|
|
|
public class GroupPersonSkillController : BaseController
|
2024-08-12 14:41:07 +08:00
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 人员技能矩阵图接口
|
|
|
|
|
|
/// </summary>
|
2024-08-12 16:13:24 +08:00
|
|
|
|
private readonly IGroupPersonSkillService _GroupPersonSkillService;
|
2024-08-12 14:41:07 +08:00
|
|
|
|
|
2024-08-12 16:13:24 +08:00
|
|
|
|
public GroupPersonSkillController(IGroupPersonSkillService GroupPersonSkillService)
|
2024-08-12 14:41:07 +08:00
|
|
|
|
{
|
2024-08-12 16:13:24 +08:00
|
|
|
|
_GroupPersonSkillService = GroupPersonSkillService;
|
2024-08-12 14:41:07 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 查询人员技能矩阵图列表
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="parm"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpGet("list")]
|
2024-08-12 15:13:24 +08:00
|
|
|
|
[ActionPermissionFilter(Permission = "groupManagement:GroupPersonSkill:list")]
|
2024-08-12 16:13:24 +08:00
|
|
|
|
public IActionResult QueryGroupPersonSkill([FromQuery] GroupPersonSkillQueryDto parm)
|
2024-08-12 14:41:07 +08:00
|
|
|
|
{
|
2024-08-12 16:13:24 +08:00
|
|
|
|
var response = _GroupPersonSkillService.GetList(parm);
|
2024-08-12 14:41:07 +08:00
|
|
|
|
return SUCCESS(response);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 查询人员技能矩阵图详情
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="Id"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpGet("{Id}")]
|
2024-08-12 15:13:24 +08:00
|
|
|
|
[ActionPermissionFilter(Permission = "groupManagement:GroupPersonSkill:query")]
|
2024-08-12 16:13:24 +08:00
|
|
|
|
public IActionResult GetGroupPersonSkill(string Id)
|
2024-08-12 14:41:07 +08:00
|
|
|
|
{
|
2024-08-12 16:13:24 +08:00
|
|
|
|
var response = _GroupPersonSkillService.GetInfo(Id);
|
2024-08-12 15:37:34 +08:00
|
|
|
|
|
2024-08-12 15:13:24 +08:00
|
|
|
|
var info = response.Adapt<GroupPersonSkill>();
|
2024-08-12 14:41:07 +08:00
|
|
|
|
return SUCCESS(info);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 添加人员技能矩阵图
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpPost]
|
2024-08-12 15:13:24 +08:00
|
|
|
|
[ActionPermissionFilter(Permission = "groupManagement:GroupPersonSkill:add")]
|
2024-08-12 14:41:07 +08:00
|
|
|
|
[Log(Title = "人员技能矩阵图", BusinessType = BusinessType.INSERT)]
|
2024-08-12 16:13:24 +08:00
|
|
|
|
public IActionResult AddGroupPersonSkill([FromBody] GroupPersonSkillDto parm)
|
2024-08-12 14:41:07 +08:00
|
|
|
|
{
|
2024-08-12 15:13:24 +08:00
|
|
|
|
var modal = parm.Adapt<GroupPersonSkill>().ToCreate(HttpContext);
|
2024-08-12 14:41:07 +08:00
|
|
|
|
|
2024-08-12 16:13:24 +08:00
|
|
|
|
var response = _GroupPersonSkillService.AddGroupPersonSkill(modal);
|
2024-08-12 14:41:07 +08:00
|
|
|
|
|
|
|
|
|
|
return SUCCESS(response);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 更新人员技能矩阵图
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpPut]
|
2024-08-12 15:13:24 +08:00
|
|
|
|
[ActionPermissionFilter(Permission = "groupManagement:GroupPersonSkill:edit")]
|
2024-08-12 14:41:07 +08:00
|
|
|
|
[Log(Title = "人员技能矩阵图", BusinessType = BusinessType.UPDATE)]
|
2024-08-12 16:13:24 +08:00
|
|
|
|
public IActionResult UpdateGroupPersonSkill([FromBody] GroupPersonSkillDto parm)
|
2024-08-12 14:41:07 +08:00
|
|
|
|
{
|
2024-08-12 15:13:24 +08:00
|
|
|
|
var modal = parm.Adapt<GroupPersonSkill>().ToUpdate(HttpContext);
|
2024-08-12 16:13:24 +08:00
|
|
|
|
var response = _GroupPersonSkillService.UpdateGroupPersonSkill(modal);
|
2024-08-12 14:41:07 +08:00
|
|
|
|
|
|
|
|
|
|
return ToResponse(response);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 删除人员技能矩阵图
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpDelete("{ids}")]
|
2024-08-12 15:13:24 +08:00
|
|
|
|
[ActionPermissionFilter(Permission = "groupManagement:GroupPersonSkill:delete")]
|
2024-08-12 14:41:07 +08:00
|
|
|
|
[Log(Title = "人员技能矩阵图", BusinessType = BusinessType.DELETE)]
|
2024-08-12 16:13:24 +08:00
|
|
|
|
public IActionResult DeleteGroupPersonSkill(string ids)
|
2024-08-12 14:41:07 +08:00
|
|
|
|
{
|
2024-08-12 15:11:01 +08:00
|
|
|
|
string[] idsArr = Tools.SpitStrArrary(ids);
|
2024-08-12 14:41:07 +08:00
|
|
|
|
if (idsArr.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); }
|
|
|
|
|
|
|
2024-08-12 16:13:24 +08:00
|
|
|
|
var response = _GroupPersonSkillService.Delete(idsArr);
|
2024-08-12 14:41:07 +08:00
|
|
|
|
|
|
|
|
|
|
return ToResponse(response);
|
|
|
|
|
|
}
|
2024-08-12 16:13:24 +08:00
|
|
|
|
//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);
|
|
|
|
|
|
}
|
2024-08-12 14:41:07 +08:00
|
|
|
|
|
2024-08-12 16:13:24 +08:00
|
|
|
|
//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 人员技能评估
|
2024-08-12 15:37:34 +08:00
|
|
|
|
/// <summary>
|
2024-08-12 16:13:24 +08:00
|
|
|
|
/// 人员技能评估
|
2024-08-12 15:37:34 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="relPersonSkill"></param>
|
|
|
|
|
|
/// <returns></returns>
|
2024-08-12 16:13:24 +08:00
|
|
|
|
[HttpPost("person_skill_assessment")]
|
|
|
|
|
|
public IActionResult PersonskillAssessment([FromBody] GroupRelPersonSkill relPersonSkill)
|
2024-08-12 15:37:34 +08:00
|
|
|
|
{
|
|
|
|
|
|
if (relPersonSkill == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
return SUCCESS(null);
|
|
|
|
|
|
}
|
|
|
|
|
|
relPersonSkill.ToCreate(HttpContext);
|
2024-08-12 16:13:24 +08:00
|
|
|
|
var response = _GroupPersonSkillService.PersonskillAssessment(relPersonSkill);
|
2024-08-12 15:37:34 +08:00
|
|
|
|
return ToResponse(response);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
2024-08-12 14:41:07 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|