提交
This commit is contained in:
@@ -0,0 +1,123 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using DOAN.Model.MES.base_.Dto;
|
||||
using DOAN.Model.MES.base_;
|
||||
using DOAN.Service.MES.base_.IService;
|
||||
using DOAN.Admin.WebApi.Filters;
|
||||
|
||||
//创建时间:2024-07-08
|
||||
namespace DOAN.Admin.WebApi.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// 工位
|
||||
/// </summary>
|
||||
[Verify]
|
||||
[Route("mes/baseManagement/BaseWorkStation")]
|
||||
public class BaseWorkStationController : BaseController
|
||||
{
|
||||
/// <summary>
|
||||
/// 工位接口
|
||||
/// </summary>
|
||||
private readonly IBaseWorkStationService _BaseWorkStationService;
|
||||
|
||||
public BaseWorkStationController(IBaseWorkStationService BaseWorkStationService)
|
||||
{
|
||||
_BaseWorkStationService = BaseWorkStationService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询工位列表
|
||||
/// </summary>
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("list")]
|
||||
[ActionPermissionFilter(Permission = "baseManagement:baseworkstation:list")]
|
||||
public IActionResult QueryBaseWorkStation([FromQuery] BaseWorkStationQueryDto parm)
|
||||
{
|
||||
var response = _BaseWorkStationService.GetList(parm);
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 查询工位列表 未绑定的工位和已经绑定的
|
||||
/// </summary>
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("drop_down_list")]
|
||||
[ActionPermissionFilter(Permission = "baseManagement:baseworkstation:list")]
|
||||
public IActionResult QueryBaseWorkStation_Drop_down(int id)
|
||||
{
|
||||
var response = _BaseWorkStationService.GetList_Drop_down(id);
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 查询工位详情
|
||||
/// </summary>
|
||||
/// <param name="Id"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("{Id}")]
|
||||
[ActionPermissionFilter(Permission = "baseManagement:baseworkstation:query")]
|
||||
public IActionResult GetBaseWorkStation(int Id)
|
||||
{
|
||||
var response = _BaseWorkStationService.GetInfo(Id);
|
||||
|
||||
var info = response.Adapt<BaseWorkStation>();
|
||||
return SUCCESS(info);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加工位
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[ActionPermissionFilter(Permission = "baseManagement:baseworkstation:add")]
|
||||
[Log(Title = "工位", BusinessType = BusinessType.INSERT)]
|
||||
public IActionResult AddBaseWorkStation([FromBody] BaseWorkStationDto2 parm)
|
||||
{
|
||||
var modal = parm.Adapt<BaseWorkStation>().ToCreate(HttpContext);
|
||||
|
||||
var response = _BaseWorkStationService.AddBaseWorkStation(modal,parm.BindedDeviceArray);
|
||||
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新工位
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPut]
|
||||
[ActionPermissionFilter(Permission = "baseManagement:baseworkstation:edit")]
|
||||
[Log(Title = "工位", BusinessType = BusinessType.UPDATE)]
|
||||
public IActionResult UpdateBaseWorkStation([FromBody] BaseWorkStationDto2 parm)
|
||||
{
|
||||
var modal = parm.Adapt<BaseWorkStation>().ToUpdate(HttpContext);
|
||||
var response = _BaseWorkStationService.UpdateBaseWorkStation(modal, parm.BindedDeviceArray);
|
||||
|
||||
return ToResponse(response);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除工位
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpDelete("{ids}")]
|
||||
[ActionPermissionFilter(Permission = "baseManagement:baseworkstation:delete")]
|
||||
[Log(Title = "工位", BusinessType = BusinessType.DELETE)]
|
||||
public IActionResult DeleteBaseWorkStation(string ids)
|
||||
{
|
||||
int[] idsArr = Tools.SpitIntArrary(ids);
|
||||
if (idsArr.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); }
|
||||
|
||||
var response = _BaseWorkStationService.Delete(idsArr);
|
||||
_BaseWorkStationService.DeleteHandle(idsArr);// 删除绑定关系
|
||||
return ToResponse(response);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user