Files
shanghaigangxiangtuzhuangMES/ZR.Admin.WebApi/Controllers/mes/qc/backend/QcBackEndServiceWorkorderController.cs

104 lines
3.5 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using Microsoft.AspNetCore.Mvc;
using ZR.Admin.WebApi.Extensions;
using ZR.Admin.WebApi.Filters;
using ZR.Model.Business;
using ZR.Model.Dto;
using ZR.Service.Business.IBusinessService;
//创建时间2025-01-02
namespace ZR.Admin.WebApi.Controllers
{
/// <summary>
/// 质量BackEnd工单业务模块
/// </summary>
// [Verify]
[Route("/mes/qc/BackEnd/QcBackEndServiceWorkorder")]
public class QcBackEndServiceWorkorderController : BaseController
{
/// <summary>
/// 质量BackEnd工单业务模块接口
/// </summary>
private readonly IQcBackEndServiceWorkorderService _QcBackEndServiceWorkorderService;
public QcBackEndServiceWorkorderController(IQcBackEndServiceWorkorderService QcBackEndServiceWorkorderService)
{
_QcBackEndServiceWorkorderService = QcBackEndServiceWorkorderService;
}
/// <summary>
/// 查询质量BackEnd工单业务模块列表
/// </summary>
/// <param name="parm"></param>
/// <returns></returns>
[HttpGet("list")]
public IActionResult QueryQcBackEndServiceWorkorder([FromQuery] QcBackEndServiceWorkorderQueryDto parm)
{
var response = _QcBackEndServiceWorkorderService.GetList(parm);
return SUCCESS(response);
}
/// <summary>
/// 查询质量BackEnd工单业务模块详情
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
[HttpGet("{Id}")]
public IActionResult GetQcBackEndServiceWorkorder(string Id)
{
var response = _QcBackEndServiceWorkorderService.GetInfo(Id);
var info = response.Adapt<QcBackEndServiceWorkorder>();
return SUCCESS(info);
}
/// <summary>
/// 添加质量BackEnd工单业务模块
/// </summary>
/// <returns></returns>
[HttpPost]
[Log(Title = "质量BackEnd工单业务模块", BusinessType = BusinessType.INSERT)]
public IActionResult AddQcBackEndServiceWorkorder([FromBody] QcBackEndServiceWorkorderDto parm)
{
var modal = parm.Adapt<QcBackEndServiceWorkorder>().ToCreate(HttpContext);
var response = _QcBackEndServiceWorkorderService.AddQcBackEndServiceWorkorder(modal);
return SUCCESS(response);
}
/// <summary>
/// 更新质量BackEnd工单业务模块
/// </summary>
/// <returns></returns>
[HttpPut]
[Log(Title = "质量BackEnd工单业务模块", BusinessType = BusinessType.UPDATE)]
public IActionResult UpdateQcBackEndServiceWorkorder([FromBody] QcBackEndServiceWorkorderDto parm)
{
var modal = parm.Adapt<QcBackEndServiceWorkorder>().ToUpdate(HttpContext);
var response = _QcBackEndServiceWorkorderService.UpdateQcBackEndServiceWorkorder(modal);
return ToResponse(response);
}
/// <summary>
/// 删除质量BackEnd工单业务模块
/// </summary>
/// <returns></returns>
[HttpDelete("{ids}")]
[Log(Title = "质量BackEnd工单业务模块", BusinessType = BusinessType.DELETE)]
public IActionResult DeleteQcBackEndServiceWorkorder(string ids)
{
int[] idsArr = Tools.SpitIntArrary(ids);
if (idsArr.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); }
var response = _QcBackEndServiceWorkorderService.Delete(idsArr);
return ToResponse(response);
}
}
}