106 lines
3.7 KiB
C#
106 lines
3.7 KiB
C#
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>
|
||
/// 终检台,追溯码绑定检测数据列描述字典
|
||
/// </summary>
|
||
[Route("business/TraceDictEolParameter")]
|
||
public class TraceDictEolParameterController : BaseController
|
||
{
|
||
/// <summary>
|
||
/// 终检台,追溯码绑定检测数据列描述字典接口
|
||
/// </summary>
|
||
private readonly ITraceDictEolParameterService _TraceDictEolParameterService;
|
||
|
||
public TraceDictEolParameterController(ITraceDictEolParameterService TraceDictEolParameterService)
|
||
{
|
||
_TraceDictEolParameterService = TraceDictEolParameterService;
|
||
}
|
||
|
||
/// <summary>
|
||
/// 查询终检台,追溯码绑定检测数据列描述字典列表
|
||
/// </summary>
|
||
/// <param name="parm"></param>
|
||
/// <returns></returns>
|
||
[HttpGet("list")]
|
||
[AllowAnonymous]
|
||
public IActionResult QueryTraceDictEolParameter([FromQuery] TraceDictEolParameterQueryDto parm)
|
||
{
|
||
var response = _TraceDictEolParameterService.GetList(parm);
|
||
return SUCCESS(response);
|
||
}
|
||
|
||
|
||
/// <summary>
|
||
/// 查询终检台,追溯码绑定检测数据列描述字典详情
|
||
/// </summary>
|
||
/// <param name="Id"></param>
|
||
/// <returns></returns>
|
||
[HttpGet("{Id}")]
|
||
[AllowAnonymous]
|
||
public IActionResult GetTraceDictEolParameter(int Id)
|
||
{
|
||
var response = _TraceDictEolParameterService.GetInfo(Id);
|
||
|
||
var info = response.Adapt<TraceDictEolParameter>();
|
||
return SUCCESS(info);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 添加终检台,追溯码绑定检测数据列描述字典
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpPost]
|
||
[AllowAnonymous]
|
||
[Log(Title = "终检台,追溯码绑定检测数据列描述字典", BusinessType = BusinessType.INSERT)]
|
||
public IActionResult AddTraceDictEolParameter([FromBody] TraceDictEolParameterDto parm)
|
||
{
|
||
var modal = parm.Adapt<TraceDictEolParameter>().ToCreate(HttpContext);
|
||
|
||
var response = _TraceDictEolParameterService.AddTraceDictEolParameter(modal);
|
||
|
||
return SUCCESS(response);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 更新终检台,追溯码绑定检测数据列描述字典
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpPut]
|
||
[AllowAnonymous]
|
||
[Log(Title = "终检台,追溯码绑定检测数据列描述字典", BusinessType = BusinessType.UPDATE)]
|
||
public IActionResult UpdateTraceDictEolParameter([FromBody] TraceDictEolParameterDto parm)
|
||
{
|
||
var modal = parm.Adapt<TraceDictEolParameter>().ToUpdate(HttpContext);
|
||
var response = _TraceDictEolParameterService.UpdateTraceDictEolParameter(modal);
|
||
|
||
return ToResponse(response);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 删除终检台,追溯码绑定检测数据列描述字典
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpDelete("{ids}")]
|
||
[AllowAnonymous]
|
||
[Log(Title = "终检台,追溯码绑定检测数据列描述字典", BusinessType = BusinessType.DELETE)]
|
||
public IActionResult DeleteTraceDictEolParameter(string ids)
|
||
{
|
||
int[] idsArr = Tools.SpitIntArrary(ids);
|
||
if (idsArr.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); }
|
||
|
||
var response = _TraceDictEolParameterService.Delete(idsArr);
|
||
|
||
return ToResponse(response);
|
||
}
|
||
|
||
|
||
|
||
|
||
}
|
||
} |