237 lines
8.4 KiB
C#
237 lines
8.4 KiB
C#
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;
|
||
using DOAN.Model.MES.base_.Dto;
|
||
|
||
//创建时间:2024-08-12
|
||
namespace DOAN.Admin.WebApi.Controllers
|
||
{
|
||
/// <summary>
|
||
/// 人员技能
|
||
/// </summary>
|
||
[Verify]
|
||
[Route("mes/groupManagement/GroupPersonSkill")]
|
||
public class GroupPersonSkillController : BaseController
|
||
{
|
||
/// <summary>
|
||
/// 人员技能接口
|
||
/// </summary>
|
||
private readonly IGroupPersonSkillService _GroupPersonSkillService;
|
||
|
||
public GroupPersonSkillController(IGroupPersonSkillService GroupPersonSkillService)
|
||
{
|
||
_GroupPersonSkillService = GroupPersonSkillService;
|
||
}
|
||
|
||
/// <summary>
|
||
/// 查询人员技能列表
|
||
/// </summary>
|
||
/// <param name="parm"></param>
|
||
/// <returns></returns>
|
||
[HttpGet("list")]
|
||
[ActionPermissionFilter(Permission = "groupManagement:GroupPersonSkill:list")]
|
||
public IActionResult QueryGroupPersonSkill([FromQuery] GroupPersonSkillQueryDto parm)
|
||
{
|
||
var response = _GroupPersonSkillService.GetList(parm);
|
||
return SUCCESS(response);
|
||
}
|
||
|
||
|
||
/// <summary>
|
||
/// 查询人员技能详情
|
||
/// </summary>
|
||
/// <param name="Id"></param>
|
||
/// <returns></returns>
|
||
[HttpGet("{Id}")]
|
||
[ActionPermissionFilter(Permission = "groupManagement:GroupPersonSkill:query")]
|
||
public IActionResult GetGroupPersonSkill(string Id)
|
||
{
|
||
var response = _GroupPersonSkillService.GetInfo(Id);
|
||
|
||
var info = response.Adapt<GroupPersonSkill>();
|
||
return SUCCESS(info);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 添加人员技能
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpPost]
|
||
[ActionPermissionFilter(Permission = "groupManagement:GroupPersonSkill:add")]
|
||
[Log(Title = "人员技能", BusinessType = BusinessType.INSERT)]
|
||
public IActionResult AddGroupPersonSkill([FromBody] GroupPersonSkillDto parm)
|
||
{
|
||
var modal = parm.Adapt<GroupPersonSkill>().ToCreate(HttpContext);
|
||
|
||
var response = _GroupPersonSkillService.AddGroupPersonSkill(modal);
|
||
|
||
return SUCCESS(response);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 更新人员技能
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpPut]
|
||
[ActionPermissionFilter(Permission = "groupManagement:GroupPersonSkill:edit")]
|
||
[Log(Title = "人员技能", BusinessType = BusinessType.UPDATE)]
|
||
public IActionResult UpdateGroupPersonSkill([FromBody] GroupPersonSkillDto parm)
|
||
{
|
||
var modal = parm.Adapt<GroupPersonSkill>().ToUpdate(HttpContext);
|
||
var response = _GroupPersonSkillService.UpdateGroupPersonSkill(modal);
|
||
|
||
return ToResponse(response);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 删除人员技能
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpDelete("{ids}")]
|
||
[ActionPermissionFilter(Permission = "groupManagement:GroupPersonSkill:delete")]
|
||
[Log(Title = "人员技能", BusinessType = BusinessType.DELETE)]
|
||
public IActionResult DeleteGroupPersonSkill(string ids)
|
||
{
|
||
string[] idsArr = Tools.SpitStrArrary(ids);
|
||
if (idsArr.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); }
|
||
|
||
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 获取人员未拥有的技能
|
||
[HttpPost("get_person_unown_skills")]
|
||
public IActionResult GetPersonUnownSkills([FromBody]GroupPersonSkillQueryDto2 parm)
|
||
{
|
||
if (string.IsNullOrEmpty(parm.person_id)) { return SUCCESS(null); }
|
||
var response = _GroupPersonSkillService.GetPersonUnownSkills(parm);
|
||
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);
|
||
|
||
}
|
||
/// <summary>
|
||
/// 取消绑定
|
||
/// </summary>
|
||
/// <param name="person_id"></param>
|
||
/// <param name="skill_id"></param>
|
||
/// <returns></returns>
|
||
[HttpGet("cancal_person_skill_bind")]
|
||
public IActionResult CancalPersonSkillBind(string person_id,string skill_id)
|
||
{
|
||
if (string.IsNullOrEmpty(person_id)) { return SUCCESS(null); }
|
||
if (string.IsNullOrEmpty(skill_id)) { return SUCCESS(null); }
|
||
var response = _GroupPersonSkillService.CancalPersonSkillBind(person_id, skill_id);
|
||
return ToResponse(response);
|
||
}
|
||
#region 工艺路线 ---》工序---》工位---》技能
|
||
|
||
|
||
|
||
//TODO 1 获取工艺路线
|
||
[HttpPost("get_route")]
|
||
public IActionResult GetWorkRouteList([FromBody] BaseWorkRouteQueryDto query)
|
||
{
|
||
if (query == null) { return SUCCESS(null); }
|
||
var response = _GroupPersonSkillService.GetWorkRouteList(query);
|
||
return SUCCESS(response);
|
||
}
|
||
|
||
//TODO 2 获取工艺路线绑定的工位 分页
|
||
[HttpPost("get_workstation_by_route")]
|
||
public IActionResult GetWorkstationbyRoute([FromBody] BaseWorkStationQueryDto2 query)
|
||
{
|
||
var response = _GroupPersonSkillService.GetWorkstationbyRoute(query);
|
||
return SUCCESS(response);
|
||
|
||
}
|
||
|
||
|
||
//TODO 获取工艺路线与工序父子表(废弃)
|
||
[HttpPost("route_process_parent_son")]
|
||
public IActionResult RouteProcessParentSon([FromBody] BaseWorkRouteQueryDto query)
|
||
{
|
||
if (query == null) { return SUCCESS(null); }
|
||
var response = _GroupPersonSkillService.RouteProcessParentSon(query);
|
||
return SUCCESS(response);
|
||
|
||
}
|
||
//TODO 根据工序查工位(废弃)
|
||
[HttpGet("workstation_by_process")]
|
||
public IActionResult GetWorkstationList_byProccess(int workProcess_id)
|
||
{
|
||
if(workProcess_id == 0) { return SUCCESS(null); }
|
||
var response = _GroupPersonSkillService.GetWorkstationList_byProccess(workProcess_id);
|
||
return SUCCESS(response);
|
||
}
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
//TODO 获取工位绑定的技能
|
||
[HttpGet("get_workstation_bind_skills")]
|
||
public IActionResult GetWorkstationBindSkillList(int workstation_id)
|
||
{
|
||
var response = _GroupPersonSkillService.GetWorkstationBindSkillList(workstation_id);
|
||
return SUCCESS(response);
|
||
}
|
||
|
||
//TODO 获取工位没有绑定的技能 分页
|
||
[HttpPost("get_workstation_unbind_skills")]
|
||
public IActionResult GetWorkstationunBindSkillList([FromBody] GroupPersonSkillQueryDto3 parm)
|
||
{
|
||
var response = _GroupPersonSkillService.GetWorkstationunBindSkillList(parm);
|
||
return SUCCESS(response);
|
||
}
|
||
|
||
//TODO 工位绑定技能
|
||
[HttpGet("workstation_bind_skill")]
|
||
public IActionResult HandleWorkstationbindSkill(int workstation_id,string skill_id)
|
||
{
|
||
var response = _GroupPersonSkillService.HandleWorkstationbindSkill(workstation_id, skill_id);
|
||
return SUCCESS(response);
|
||
}
|
||
|
||
//TODO 工位解除绑定技能
|
||
[HttpGet("lifted_workstation_bind_skill")]
|
||
public IActionResult LiftedWorkstationbindSkill(int workstation_id, string skill_id)
|
||
{
|
||
var response = _GroupPersonSkillService.LiftedWorkstationbindSkill(workstation_id, skill_id);
|
||
return SUCCESS(response);
|
||
}
|
||
|
||
#endregion
|
||
}
|
||
} |