107 lines
4.0 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 DOAN.Admin.WebApi.Filters;
using DOAN.Model;
using DOAN.Model.Dto;
using DOAN.Service.Business.IBusinessService;
using Microsoft.AspNetCore.Mvc;
//创建时间2025-09-02
namespace DOAN.Admin.WebApi.Controllers
{
/// <summary>
/// 追溯扫码扫子零件绑定sn标签模板实际使用需要按时间分表
/// </summary>
[Route("business/TraceSnQcRecord")]
public class TraceSnQcRecordController : BaseController
{
/// <summary>
/// 追溯扫码扫子零件绑定sn标签模板实际使用需要按时间分表接口
/// </summary>
private readonly ITraceSnQcRecordService _TraceSnQcRecordService;
public TraceSnQcRecordController(ITraceSnQcRecordService TraceSnQcRecordService)
{
_TraceSnQcRecordService = TraceSnQcRecordService;
}
/// <summary>
/// 查询追溯扫码扫子零件绑定sn标签模板实际使用需要按时间分表列表
/// </summary>
/// <param name="parm"></param>
/// <returns></returns>
[HttpGet("list")]
[ActionPermissionFilter(Permission = "business:tracesnqcrecord:list")]
public IActionResult QueryTraceSnQcRecord([FromQuery] TraceSnQcRecordQueryDto parm)
{
var response = _TraceSnQcRecordService.GetList(parm);
return SUCCESS(response);
}
/// <summary>
/// 查询追溯扫码扫子零件绑定sn标签模板实际使用需要按时间分表详情
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
[HttpGet("{Id}")]
[AllowAnonymous]
public IActionResult GetTraceSnQcRecord(long Id)
{
var response = _TraceSnQcRecordService.GetInfo(Id);
var info = response.Adapt<TraceSnQcRecord>();
return SUCCESS(info);
}
/// <summary>
/// 添加追溯扫码扫子零件绑定sn标签模板实际使用需要按时间分表
/// </summary>
/// <returns></returns>
[HttpPost]
[AllowAnonymous]
[Log(Title = "追溯扫码扫子零件绑定sn标签模板实际使用需要按时间分表", BusinessType = BusinessType.INSERT)]
public IActionResult AddTraceSnQcRecord([FromBody] TraceSnQcRecordDto parm)
{
var modal = parm.Adapt<TraceSnQcRecord>().ToCreate(HttpContext);
var response = _TraceSnQcRecordService.AddTraceSnQcRecord(modal);
return SUCCESS(response);
}
/// <summary>
/// 更新追溯扫码扫子零件绑定sn标签模板实际使用需要按时间分表
/// </summary>
/// <returns></returns>
[HttpPut]
[AllowAnonymous]
[Log(Title = "追溯扫码扫子零件绑定sn标签模板实际使用需要按时间分表", BusinessType = BusinessType.UPDATE)]
public IActionResult UpdateTraceSnQcRecord([FromBody] TraceSnQcRecordDto parm)
{
var modal = parm.Adapt<TraceSnQcRecord>().ToUpdate(HttpContext);
var response = _TraceSnQcRecordService.UpdateTraceSnQcRecord(modal);
return ToResponse(response);
}
/// <summary>
/// 删除追溯扫码扫子零件绑定sn标签模板实际使用需要按时间分表
/// </summary>
/// <returns></returns>
[HttpDelete("{ids}")]
[AllowAnonymous]
[Log(Title = "追溯扫码扫子零件绑定sn标签模板实际使用需要按时间分表", BusinessType = BusinessType.DELETE)]
public IActionResult DeleteTraceSnQcRecord(string ids)
{
int[] idsArr = Tools.SpitIntArrary(ids);
if (idsArr.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); }
var response = _TraceSnQcRecordService.Delete(idsArr);
return ToResponse(response);
}
}
}