using DOAN.Model; using DOAN.Model.Dto; using DOAN.Service.Business.IBusinessService; using Microsoft.AspNetCore.Mvc; //创建时间:2025-09-02 namespace DOAN.Admin.WebApi.Controllers { /// /// 终检台,追溯码绑定检测数据列描述字典 /// [Route("business/TraceDictEolParameter")] public class TraceDictEolParameterController : BaseController { /// /// 终检台,追溯码绑定检测数据列描述字典接口 /// private readonly ITraceDictEolParameterService _TraceDictEolParameterService; public TraceDictEolParameterController(ITraceDictEolParameterService TraceDictEolParameterService) { _TraceDictEolParameterService = TraceDictEolParameterService; } /// /// 查询终检台,追溯码绑定检测数据列描述字典列表 /// /// /// [HttpGet("list")] [AllowAnonymous] public IActionResult QueryTraceDictEolParameter([FromQuery] TraceDictEolParameterQueryDto parm) { var response = _TraceDictEolParameterService.GetList(parm); return SUCCESS(response); } /// /// 查询终检台,追溯码绑定检测数据列描述字典详情 /// /// /// [HttpGet("{Id}")] [AllowAnonymous] public IActionResult GetTraceDictEolParameter(int Id) { var response = _TraceDictEolParameterService.GetInfo(Id); var info = response.Adapt(); return SUCCESS(info); } /// /// 添加终检台,追溯码绑定检测数据列描述字典 /// /// [HttpPost] [AllowAnonymous] [Log(Title = "终检台,追溯码绑定检测数据列描述字典", BusinessType = BusinessType.INSERT)] public IActionResult AddTraceDictEolParameter([FromBody] TraceDictEolParameterDto parm) { var modal = parm.Adapt().ToCreate(HttpContext); var response = _TraceDictEolParameterService.AddTraceDictEolParameter(modal); return SUCCESS(response); } /// /// 更新终检台,追溯码绑定检测数据列描述字典 /// /// [HttpPut] [AllowAnonymous] [Log(Title = "终检台,追溯码绑定检测数据列描述字典", BusinessType = BusinessType.UPDATE)] public IActionResult UpdateTraceDictEolParameter([FromBody] TraceDictEolParameterDto parm) { var modal = parm.Adapt().ToUpdate(HttpContext); var response = _TraceDictEolParameterService.UpdateTraceDictEolParameter(modal); return ToResponse(response); } /// /// 删除终检台,追溯码绑定检测数据列描述字典 /// /// [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); } } }