2024-12-03 19:02:23 +08:00
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
|
|
using DOAN.Model.BZFM.Dto;
|
|
|
|
|
|
using DOAN.Model.BZFM;
|
2024-12-03 19:07:34 +08:00
|
|
|
|
|
2024-12-03 19:02:23 +08:00
|
|
|
|
using DOAN.Admin.WebApi.Filters;
|
|
|
|
|
|
using DOAN.Model.MES.product;
|
2024-12-03 19:07:34 +08:00
|
|
|
|
using DOAN.Service.MES.product.IService;
|
2024-12-03 19:02:23 +08:00
|
|
|
|
using Infrastructure.Converter;
|
|
|
|
|
|
|
|
|
|
|
|
//创建时间:2024-12-03
|
2024-12-03 19:07:34 +08:00
|
|
|
|
namespace DOAN.Admin.WebApi.Controllers
|
2024-12-03 19:02:23 +08:00
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 报工
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[Verify]
|
|
|
|
|
|
[Route("mes/productManagement/ProReportwork")]
|
|
|
|
|
|
public class ProReportworkController : BaseController
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 报工接口
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private readonly IProReportworkService _ProReportworkService;
|
|
|
|
|
|
|
|
|
|
|
|
public ProReportworkController(IProReportworkService ProReportworkService)
|
|
|
|
|
|
{
|
|
|
|
|
|
_ProReportworkService = ProReportworkService;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-12-21 16:39:26 +08:00
|
|
|
|
//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);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-12-03 19:02:23 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 查询报工列表
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="parm"></param>
|
|
|
|
|
|
/// <returns></returns>
|
2024-12-10 17:21:53 +08:00
|
|
|
|
[HttpPost("list")]
|
2024-12-03 19:02:23 +08:00
|
|
|
|
[ActionPermissionFilter(Permission = "proreportwork:list")]
|
2024-12-10 17:21:53 +08:00
|
|
|
|
public IActionResult QueryProReportwork([FromBody] ProReportworkQueryDto parm)
|
2024-12-03 19:02:23 +08:00
|
|
|
|
{
|
2024-12-23 14:00:01 +08:00
|
|
|
|
parm.JobDateTime[0] = DOANConvertDate.ConvertLocalDate(parm.JobDateTime[0]);
|
|
|
|
|
|
parm.JobDateTime[1] = DOANConvertDate.ConvertLocalDate(parm.JobDateTime[1]);
|
2024-12-03 19:02:23 +08:00
|
|
|
|
var response = _ProReportworkService.GetList(parm);
|
|
|
|
|
|
return SUCCESS(response);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-03-12 15:36:04 +08:00
|
|
|
|
/// <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}")]
|
2024-12-03 19:02:23 +08:00
|
|
|
|
[ActionPermissionFilter(Permission = "proreportwork:query")]
|
|
|
|
|
|
public IActionResult GetProReportwork(string Id)
|
|
|
|
|
|
{
|
|
|
|
|
|
var response = _ProReportworkService.GetInfo(Id);
|
2024-12-21 16:39:26 +08:00
|
|
|
|
|
2024-12-03 19:02:23 +08:00
|
|
|
|
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)]
|
2024-12-21 16:39:26 +08:00
|
|
|
|
public IActionResult DeleteProReportwork([FromRoute] string ids)
|
2024-12-03 19:02:23 +08:00
|
|
|
|
{
|
|
|
|
|
|
var idArr = Tools.SplitAndConvert<string>(ids);
|
|
|
|
|
|
|
|
|
|
|
|
return ToResponse(_ProReportworkService.Delete(idArr));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-12-21 16:39:26 +08:00
|
|
|
|
|
2024-12-11 17:24:15 +08:00
|
|
|
|
|
2024-12-03 19:02:23 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|