using Microsoft.AspNetCore.Mvc; using DOAN.Model.Dto; using DOAN.Service.Business.IBusinessService; using DOAN.Admin.WebApi.Filters; using DOAN.Model.MES.process; //创建时间:2025-11-06 namespace DOAN.Admin.WebApi.Controllers { /// /// 工艺建模关系表 /// [Verify] [Route("business/ProModelRelation")] public class ProModelRelationController : BaseController { /// /// 工艺建模关系表接口 /// private readonly IProModelRelationService _ProModelRelationService; public ProModelRelationController(IProModelRelationService ProModelRelationService) { _ProModelRelationService = ProModelRelationService; } /// /// 查询工艺建模关系表列表 /// /// /// [HttpGet("list")] [ActionPermissionFilter(Permission = "business:promodelrelation:list")] public IActionResult QueryProModelRelation([FromQuery] ProModelRelationQueryDto parm) { var response = _ProModelRelationService.GetList(parm); return SUCCESS(response); } /// /// 查询工艺建模关系表详情 /// /// /// [HttpGet("{Id}")] [ActionPermissionFilter(Permission = "business:promodelrelation:query")] public IActionResult GetProModelRelation(long Id) { var response = _ProModelRelationService.GetInfo(Id); var info = response.Adapt(); return SUCCESS(info); } /// /// 添加工艺建模关系表 /// /// [HttpPost] [ActionPermissionFilter(Permission = "business:promodelrelation:add")] [Log(Title = "工艺建模关系表", BusinessType = BusinessType.INSERT)] public IActionResult AddProModelRelation([FromBody] ProModelRelationDto parm) { var modal = parm.Adapt().ToCreate(HttpContext); var response = _ProModelRelationService.AddProModelRelation(modal); return SUCCESS(response); } /// /// 更新工艺建模关系表 /// /// [HttpPut] [ActionPermissionFilter(Permission = "business:promodelrelation:edit")] [Log(Title = "工艺建模关系表", BusinessType = BusinessType.UPDATE)] public IActionResult UpdateProModelRelation([FromBody] ProModelRelationDto parm) { var modal = parm.Adapt().ToUpdate(HttpContext); var response = _ProModelRelationService.UpdateProModelRelation(modal); return ToResponse(response); } /// /// 删除工艺建模关系表 /// /// [HttpDelete("{ids}")] [ActionPermissionFilter(Permission = "business:promodelrelation:delete")] [Log(Title = "工艺建模关系表", BusinessType = BusinessType.DELETE)] public IActionResult DeleteProModelRelation(string ids) { int[] idsArr = Tools.SpitIntArrary(ids); if (idsArr.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); } var response = _ProModelRelationService.Delete(idsArr); return ToResponse(response); } } }