zhuangpei-mesbackend/MDM/Controllers/Plant/PlantProductlinebodyController.cs
gcw_MV9p2JJN a293df3710 1
2025-11-19 11:49:05 +08:00

118 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 Microsoft.AspNetCore.Mvc;
using DOAN.Admin.WebApi.Filters;
using Infrastructure.Controllers;
using DOAN.ServiceCore.Middleware;
using Mapster;
using Infrastructure.Enums;
using Infrastructure;
using Infrastructure.Attribute;
using DOAN.Common;
using Infrastructure.Model;
using MDM.Services.IPlantService;
using MDM.Model.Plant.Dto;
using MDM.Model.Plant;
//创建时间2025-11-15
namespace MDM.Controllers.Plant
{
/// <summary>
/// 产线/线体/工作中心
/// </summary>
[Verify]
[Route("MasterDataManagement/Plant/PlantProductlinebody")]
public class PlantProductlinebodyController : BaseController
{
/// <summary>
/// 产线/线体/工作中心接口
/// </summary>
private readonly IPlantProductlinebodyService _PlantProductlinebodyService;
public PlantProductlinebodyController(IPlantProductlinebodyService PlantProductlinebodyService)
{
_PlantProductlinebodyService = PlantProductlinebodyService;
}
/// <summary>
/// 查询产线/线体/工作中心列表
/// </summary>
/// <param name="parm"></param>
/// <returns></returns>
[HttpGet("list")]
[ActionPermissionFilter(Permission = "business:plantproductlinebody:list")]
public IActionResult QueryPlantProductlinebody([FromQuery] PlantProductlinebodyQueryDto parm)
{
var response = _PlantProductlinebodyService.GetList(parm);
return SUCCESS(response);
}
/// <summary>
/// 查询产线/线体/工作中心详情
/// </summary>
/// <param name="LineId"></param>
/// <returns></returns>
[HttpGet("{LineId}")]
[ActionPermissionFilter(Permission = "business:plantproductlinebody:query")]
public IActionResult GetPlantProductlinebody(int LineId)
{
var response = _PlantProductlinebodyService.GetInfo(LineId);
var info = response.Adapt<PlantProductlinebody>();
return SUCCESS(info);
}
/// <summary>
/// 添加产线/线体/工作中心
/// </summary>
/// <returns></returns>
[HttpPost]
[ActionPermissionFilter(Permission = "business:plantproductlinebody:add")]
[Log(Title = "产线/线体/工作中心", BusinessType = BusinessType.INSERT)]
public IActionResult AddPlantProductlinebody([FromBody] PlantProductlinebodyDto parm)
{
var modal = parm.Adapt<PlantProductlinebody>().ToCreate(HttpContext);
var response = _PlantProductlinebodyService.AddPlantProductlinebody(modal);
return SUCCESS(response);
}
/// <summary>
/// 更新产线/线体/工作中心
/// </summary>
/// <returns></returns>
[HttpPut]
[ActionPermissionFilter(Permission = "business:plantproductlinebody:edit")]
[Log(Title = "产线/线体/工作中心", BusinessType = BusinessType.UPDATE)]
public IActionResult UpdatePlantProductlinebody([FromBody] PlantProductlinebodyDto parm)
{
var modal = parm.Adapt<PlantProductlinebody>().ToUpdate(HttpContext);
var response = _PlantProductlinebodyService.UpdatePlantProductlinebody(modal);
return ToResponse(response);
}
/// <summary>
/// 删除产线/线体/工作中心
/// </summary>
/// <returns></returns>
[HttpDelete("{ids}")]
[ActionPermissionFilter(Permission = "business:plantproductlinebody:delete")]
[Log(Title = "产线/线体/工作中心", BusinessType = BusinessType.DELETE)]
public IActionResult DeletePlantProductlinebody(string ids)
{
int[] idsArr = Tools.SpitIntArrary(ids);
if (idsArr.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); }
var response = _PlantProductlinebodyService.Delete(idsArr);
return ToResponse(response);
}
}
}