报工
This commit is contained in:
@@ -0,0 +1,106 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using DOAN.Model.BZFM.Dto;
|
||||
using DOAN.Model.BZFM;
|
||||
using DOAN.Service.BZFM.IBZFMService;
|
||||
using DOAN.Admin.WebApi.Filters;
|
||||
using DOAN.Model.MES.product;
|
||||
using Infrastructure.Converter;
|
||||
|
||||
//创建时间:2024-12-03
|
||||
namespace DOAN.Admin.WebApi.Controllers.BZFM
|
||||
{
|
||||
/// <summary>
|
||||
/// 报工
|
||||
/// </summary>
|
||||
[Verify]
|
||||
[Route("mes/productManagement/ProReportwork")]
|
||||
public class ProReportworkController : BaseController
|
||||
{
|
||||
/// <summary>
|
||||
/// 报工接口
|
||||
/// </summary>
|
||||
private readonly IProReportworkService _ProReportworkService;
|
||||
|
||||
public ProReportworkController(IProReportworkService ProReportworkService)
|
||||
{
|
||||
_ProReportworkService = ProReportworkService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询报工列表
|
||||
/// </summary>
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("list")]
|
||||
[ActionPermissionFilter(Permission = "proreportwork:list")]
|
||||
public IActionResult QueryProReportwork([FromQuery] ProReportworkQueryDto parm)
|
||||
{
|
||||
parm.JobDate[0] = DOANConvertDate.ConvertLocalDate(parm.JobDate[0]);
|
||||
parm.JobDate[1] = DOANConvertDate.ConvertLocalDate(parm.JobDate[1]);
|
||||
var response = _ProReportworkService.GetList(parm);
|
||||
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));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user