108 lines
3.6 KiB
C#
Raw Normal View History

2025-11-06 20:28:30 +08:00
using Microsoft.AspNetCore.Mvc;
using DOAN.Model.Dto;
using DOAN.Service.Business.IBusinessService;
using DOAN.Admin.WebApi.Filters;
2025-11-06 23:24:47 +08:00
using DOAN.Model.MES.process;
2025-11-06 20:28:30 +08:00
//创建时间2025-11-06
namespace DOAN.Admin.WebApi.Controllers
{
/// <summary>
/// 工艺建模关系表
/// </summary>
[Verify]
[Route("business/ProModelRelation")]
public class ProModelRelationController : BaseController
{
/// <summary>
/// 工艺建模关系表接口
/// </summary>
private readonly IProModelRelationService _ProModelRelationService;
public ProModelRelationController(IProModelRelationService ProModelRelationService)
{
_ProModelRelationService = ProModelRelationService;
}
/// <summary>
/// 查询工艺建模关系表列表
/// </summary>
/// <param name="parm"></param>
/// <returns></returns>
[HttpGet("list")]
[ActionPermissionFilter(Permission = "business:promodelrelation:list")]
public IActionResult QueryProModelRelation([FromQuery] ProModelRelationQueryDto parm)
{
var response = _ProModelRelationService.GetList(parm);
return SUCCESS(response);
}
/// <summary>
/// 查询工艺建模关系表详情
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
[HttpGet("{Id}")]
[ActionPermissionFilter(Permission = "business:promodelrelation:query")]
public IActionResult GetProModelRelation(long Id)
{
var response = _ProModelRelationService.GetInfo(Id);
var info = response.Adapt<ProModelRelation>();
return SUCCESS(info);
}
/// <summary>
/// 添加工艺建模关系表
/// </summary>
/// <returns></returns>
[HttpPost]
[ActionPermissionFilter(Permission = "business:promodelrelation:add")]
[Log(Title = "工艺建模关系表", BusinessType = BusinessType.INSERT)]
public IActionResult AddProModelRelation([FromBody] ProModelRelationDto parm)
{
var modal = parm.Adapt<ProModelRelation>().ToCreate(HttpContext);
var response = _ProModelRelationService.AddProModelRelation(modal);
return SUCCESS(response);
}
/// <summary>
/// 更新工艺建模关系表
/// </summary>
/// <returns></returns>
[HttpPut]
[ActionPermissionFilter(Permission = "business:promodelrelation:edit")]
[Log(Title = "工艺建模关系表", BusinessType = BusinessType.UPDATE)]
public IActionResult UpdateProModelRelation([FromBody] ProModelRelationDto parm)
{
var modal = parm.Adapt<ProModelRelation>().ToUpdate(HttpContext);
var response = _ProModelRelationService.UpdateProModelRelation(modal);
return ToResponse(response);
}
/// <summary>
/// 删除工艺建模关系表
/// </summary>
/// <returns></returns>
[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);
}
}
}