2024-07-11 08:51:15 +08:00
|
|
|
|
using DOAN.Admin.WebApi.Filters;
|
|
|
|
|
|
using DOAN.Model.MES.base_;
|
|
|
|
|
|
using DOAN.Model.MES.base_.Dto;
|
|
|
|
|
|
using DOAN.Service.Business.IBusinessService;
|
|
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
|
|
|
|
|
|
|
|
//创建时间:2024-07-09
|
|
|
|
|
|
namespace DOAN.Admin.WebApi.Controllers
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 工艺路线
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[Verify]
|
|
|
|
|
|
[Route("mes/baseManagement/BaseWorkRoute")]
|
|
|
|
|
|
public class BaseWorkRouteController : BaseController
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 工艺路线接口
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private readonly IBaseWorkRouteService _BaseWorkRouteService;
|
|
|
|
|
|
|
|
|
|
|
|
public BaseWorkRouteController(IBaseWorkRouteService BaseWorkRouteService)
|
|
|
|
|
|
{
|
|
|
|
|
|
_BaseWorkRouteService = BaseWorkRouteService;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 查询工艺路线列表
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="parm"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpGet("list")]
|
|
|
|
|
|
[ActionPermissionFilter(Permission = "baseManagement:baseworkroute:list")]
|
|
|
|
|
|
public IActionResult QueryBaseWorkRoute([FromQuery] BaseWorkRouteQueryDto parm)
|
|
|
|
|
|
{
|
|
|
|
|
|
var response = _BaseWorkRouteService.GetList(parm);
|
|
|
|
|
|
return SUCCESS(response);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-07-11 09:13:28 +08:00
|
|
|
|
|
2024-07-11 08:51:15 +08:00
|
|
|
|
/// <summary>
|
2024-07-11 09:13:28 +08:00
|
|
|
|
/// 查询工艺路线详情s
|
2024-07-11 08:51:15 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="Id"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpGet("{Id}")]
|
|
|
|
|
|
[ActionPermissionFilter(Permission = "baseManagement:baseworkroute:query")]
|
|
|
|
|
|
public IActionResult GetBaseWorkRoute(int Id)
|
|
|
|
|
|
{
|
|
|
|
|
|
var response = _BaseWorkRouteService.GetInfo(Id);
|
|
|
|
|
|
var info = response.Adapt<BaseWorkRoute>();
|
|
|
|
|
|
return SUCCESS(info);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 添加工艺路线
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpPost]
|
|
|
|
|
|
[ActionPermissionFilter(Permission = "baseManagement:baseworkroute:add")]
|
|
|
|
|
|
[Log(Title = "工艺路线", BusinessType = BusinessType.INSERT)]
|
|
|
|
|
|
public IActionResult AddBaseWorkRoute([FromBody] BaseWorkRouteDto parm)
|
|
|
|
|
|
{
|
|
|
|
|
|
var modal = parm.Adapt<BaseWorkRoute>().ToCreate(HttpContext);
|
|
|
|
|
|
|
|
|
|
|
|
var response = _BaseWorkRouteService.AddBaseWorkRoute(modal);
|
|
|
|
|
|
|
|
|
|
|
|
return SUCCESS(response);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 更新工艺路线
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpPut]
|
|
|
|
|
|
[ActionPermissionFilter(Permission = "baseManagement:baseworkroute:edit")]
|
|
|
|
|
|
[Log(Title = "工艺路线", BusinessType = BusinessType.UPDATE)]
|
|
|
|
|
|
public IActionResult UpdateBaseWorkRoute([FromBody] BaseWorkRouteDto parm)
|
|
|
|
|
|
{
|
|
|
|
|
|
var modal = parm.Adapt<BaseWorkRoute>().ToUpdate(HttpContext);
|
|
|
|
|
|
var response = _BaseWorkRouteService.UpdateBaseWorkRoute(modal);
|
|
|
|
|
|
|
|
|
|
|
|
return ToResponse(response);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 删除工艺路线
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpDelete("{ids}")]
|
|
|
|
|
|
[ActionPermissionFilter(Permission = "baseManagement:baseworkroute:delete")]
|
|
|
|
|
|
[Log(Title = "工艺路线", BusinessType = BusinessType.DELETE)]
|
|
|
|
|
|
public IActionResult DeleteBaseWorkRoute(string ids)
|
|
|
|
|
|
{
|
|
|
|
|
|
int[] idsArr = Tools.SpitIntArrary(ids);
|
|
|
|
|
|
if (idsArr.Length <= 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
return ToResponse(ApiResult.Error($"删除失败Id 不能为空"));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var response = _BaseWorkRouteService.Delete(idsArr);
|
|
|
|
|
|
|
|
|
|
|
|
return ToResponse(response);
|
|
|
|
|
|
}
|
2024-07-11 14:25:41 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//[HttpPost(route_bind_proccess)]
|
|
|
|
|
|
//public IActionResult ParseRouteBindProccess()
|
|
|
|
|
|
//{
|
|
|
|
|
|
|
|
|
|
|
|
//}
|
2024-07-11 08:51:15 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|