Files
kunshan-bzfm-mes-backend/DOAN.Admin.WebApi/Controllers/MES/Device/DeviceFormConfigController.cs

111 lines
3.7 KiB
C#
Raw Normal View History

2024-12-10 14:34:13 +08:00
using Microsoft.AspNetCore.Mvc;
using DOAN.Model.Dto;
using DOAN.Service.MES.dev.IService;
using DOAN.Model.MES.dev.Dto;
using DOAN.Admin.WebApi.Filters;
using DOAN.Model.MES.dev;
//创建时间2024-05-22
namespace DOAN.Admin.WebApi.Controllers
{
/// <summary>
/// 设备检查项表单配置表
/// </summary>
[Verify]
[Route("mes/deviceManagement/DeviceFormConfig")]
public class DeviceFormConfigController : BaseController
{
/// <summary>
/// 设备检查项表单配置表接口
/// </summary>
private readonly IDeviceFormConfigService _DeviceFormConfigService;
public DeviceFormConfigController(IDeviceFormConfigService DeviceFormConfigService)
{
_DeviceFormConfigService = DeviceFormConfigService;
}
/// <summary>
/// 查询设备检查项表单配置表列表
/// </summary>
/// <param name="parm"></param>
/// <returns></returns>
[HttpGet("list")]
[ActionPermissionFilter(Permission = "business:deviceformconfig:list")]
public IActionResult QueryDeviceFormConfig([FromQuery] DeviceFormConfigQueryDto parm)
{
var response = _DeviceFormConfigService.GetList(parm);
return SUCCESS(response);
}
/// <summary>
/// 查询设备检查项表单配置表详情
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
[HttpGet("{Id}")]
[ActionPermissionFilter(Permission = "business:deviceformconfig:query")]
public IActionResult GetDeviceFormConfig(string Id)
{
var response = _DeviceFormConfigService.GetInfo(Id);
var info = response.Adapt<DeviceFormConfig>();
return SUCCESS(info);
}
/// <summary>
/// 添加设备检查项表单配置表
/// </summary>
/// <returns></returns>
[HttpPost]
[ActionPermissionFilter(Permission = "business:deviceformconfig:add")]
[Log(Title = "设备检查项表单配置表", BusinessType = BusinessType.INSERT)]
public IActionResult AddDeviceFormConfig([FromBody] DeviceFormConfigDto parm)
{
var modal = parm.Adapt<DeviceFormConfig>().ToCreate(HttpContext);
var response = _DeviceFormConfigService.AddDeviceFormConfig(modal);
return SUCCESS(response);
}
/// <summary>
/// 更新设备检查项表单配置表
/// </summary>
/// <returns></returns>
[HttpPut]
[ActionPermissionFilter(Permission = "business:deviceformconfig:edit")]
[Log(Title = "设备检查项表单配置表", BusinessType = BusinessType.UPDATE)]
public IActionResult UpdateDeviceFormConfig([FromBody] DeviceFormConfigDto parm)
{
var modal = parm.Adapt<DeviceFormConfig>().ToUpdate(HttpContext);
var response = _DeviceFormConfigService.UpdateDeviceFormConfig(modal);
return ToResponse(response);
}
/// <summary>
/// 删除设备检查项表单配置表
/// </summary>
/// <returns></returns>
[HttpDelete("{ids}")]
[ActionPermissionFilter(Permission = "business:deviceformconfig:delete")]
[Log(Title = "设备检查项表单配置表", BusinessType = BusinessType.DELETE)]
public IActionResult DeleteDeviceFormConfig(string ids)
{
string[] strIds = ids.Split(",", (char)StringSplitOptions.RemoveEmptyEntries);
if (strIds.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); }
var response = _DeviceFormConfigService.Delete(strIds);
return ToResponse(response);
}
}
}