144 lines
4.4 KiB
C#
144 lines
4.4 KiB
C#
using Microsoft.AspNetCore.Mvc;
|
||
using DOAN.Model.BZFM.Dto;
|
||
using DOAN.Model.BZFM;
|
||
|
||
using DOAN.Admin.WebApi.Filters;
|
||
using DOAN.Model.MES.product;
|
||
using DOAN.Service.MES.product.IService;
|
||
using Infrastructure.Converter;
|
||
|
||
//创建时间:2024-12-03
|
||
namespace DOAN.Admin.WebApi.Controllers
|
||
{
|
||
/// <summary>
|
||
/// 报工
|
||
/// </summary>
|
||
[Verify]
|
||
[Route("mes/productManagement/ProReportwork")]
|
||
public class ProReportworkController : BaseController
|
||
{
|
||
/// <summary>
|
||
/// 报工接口
|
||
/// </summary>
|
||
private readonly IProReportworkService _ProReportworkService;
|
||
|
||
public ProReportworkController(IProReportworkService ProReportworkService)
|
||
{
|
||
_ProReportworkService = ProReportworkService;
|
||
}
|
||
|
||
//TODO 查询工艺路线
|
||
[HttpGet("get_route")]
|
||
public IActionResult GetRoute()
|
||
{
|
||
var response = _ProReportworkService.GetRoute();
|
||
|
||
return SUCCESS(response);
|
||
}
|
||
//TODO 根据工艺路线查询工序
|
||
/// <summary>
|
||
///
|
||
/// </summary>
|
||
/// <param name="route_id">工艺路线id</param>
|
||
/// <returns></returns>
|
||
[HttpGet("get_process_by_route")]
|
||
public IActionResult GetProcessByRoute(int route_id)
|
||
{
|
||
var response = _ProReportworkService.GetProcessByRoute(route_id);
|
||
|
||
return SUCCESS(response);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 查询报工列表
|
||
/// </summary>
|
||
/// <param name="parm"></param>
|
||
/// <returns></returns>
|
||
[HttpPost("list")]
|
||
[ActionPermissionFilter(Permission = "proreportwork:list")]
|
||
public IActionResult QueryProReportwork([FromBody] ProReportworkQueryDto parm)
|
||
{
|
||
parm.JobDateTime[0] = DOANConvertDate.ConvertLocalDate(parm.JobDateTime[0]);
|
||
parm.JobDateTime[1] = DOANConvertDate.ConvertLocalDate(parm.JobDateTime[1]);
|
||
var response = _ProReportworkService.GetList(parm);
|
||
return SUCCESS(response);
|
||
}
|
||
|
||
|
||
/// <summary>
|
||
/// 查询工序列表
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpPost("baseworkprocesseslist")]
|
||
[ActionPermissionFilter(Permission = "proreportwork:baseworkprocesseslist")]
|
||
public IActionResult QueryBaseWorkProcesses()
|
||
{
|
||
|
||
var response = _ProReportworkService.GetBaseWorkProcesses();
|
||
return SUCCESS(response);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 查询报工详情
|
||
/// </summary>
|
||
/// <param name="Id"></param>
|
||
/// <returns></returns>
|
||
[HttpGet("{Id}")]
|
||
[ActionPermissionFilter(Permission = "proreportwork:query")]
|
||
public IActionResult GetProReportwork(string Id)
|
||
{
|
||
var response = _ProReportworkService.GetInfo(Id);
|
||
|
||
var info = response.Adapt<ProReportworkDto>();
|
||
return SUCCESS(info);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 添加报工
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpPost]
|
||
[ActionPermissionFilter(Permission = "proreportwork:add")]
|
||
[Log(Title = "报工", BusinessType = BusinessType.INSERT)]
|
||
public IActionResult AddProReportwork([FromBody] ProReportworkDto parm)
|
||
{
|
||
var modal = parm.Adapt<ProReportwork01>().ToCreate(HttpContext);
|
||
|
||
var response = _ProReportworkService.AddProReportwork(modal);
|
||
|
||
return SUCCESS(response);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 更新报工
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpPut]
|
||
[ActionPermissionFilter(Permission = "proreportwork:edit")]
|
||
[Log(Title = "报工", BusinessType = BusinessType.UPDATE)]
|
||
public IActionResult UpdateProReportwork([FromBody] ProReportworkDto parm)
|
||
{
|
||
var modal = parm.Adapt<ProReportwork01>().ToUpdate(HttpContext);
|
||
var response = _ProReportworkService.UpdateProReportwork(modal);
|
||
|
||
return ToResponse(response);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 删除报工
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpPost("delete/{ids}")]
|
||
[ActionPermissionFilter(Permission = "proreportwork:delete")]
|
||
[Log(Title = "报工", BusinessType = BusinessType.DELETE)]
|
||
public IActionResult DeleteProReportwork([FromRoute] string ids)
|
||
{
|
||
var idArr = Tools.SplitAndConvert<string>(ids);
|
||
|
||
return ToResponse(_ProReportworkService.Delete(idArr));
|
||
}
|
||
|
||
|
||
|
||
}
|
||
} |