设备管理
This commit is contained in:
@@ -0,0 +1,111 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using ZR.Service.MES.dev.IService;
|
||||
using ZR.Model.MES.dev.Dto;
|
||||
using ZR.Admin.WebApi.Filters;
|
||||
using ZR.Model.MES.dev.Dto;
|
||||
using ZR.Model.MES.dev;
|
||||
using ZR.Admin.WebApi.Extensions;
|
||||
|
||||
//创建时间:2024-05-27
|
||||
namespace ZR.Admin.WebApi.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// 点检任务
|
||||
/// </summary>
|
||||
[Verify]
|
||||
[Route("mes/deviceManagement/DevicePointInspectionPlan")]
|
||||
public class DevicePointInspectionPlanController : BaseController
|
||||
{
|
||||
/// <summary>
|
||||
/// 点检任务接口
|
||||
/// </summary>
|
||||
private readonly IDevicePointInspectionPlanService _DevicePointInspectionPlanService;
|
||||
|
||||
public DevicePointInspectionPlanController(IDevicePointInspectionPlanService DevicePointInspectionPlanService)
|
||||
{
|
||||
_DevicePointInspectionPlanService = DevicePointInspectionPlanService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询点检任务列表
|
||||
/// </summary>
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("list")]
|
||||
|
||||
public IActionResult QueryDevicePointInspectionPlan([FromQuery] DevicePointInspectionPlanQueryDto parm)
|
||||
{
|
||||
var response = _DevicePointInspectionPlanService.GetList(parm);
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 查询点检任务详情
|
||||
/// </summary>
|
||||
/// <param name="Id"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("{Id}")]
|
||||
[ActionPermissionFilter(Permission = "deviceManagement:devicepointinspectionplan:query")]
|
||||
public IActionResult GetDevicePointInspectionPlan(string Id)
|
||||
{
|
||||
var response = _DevicePointInspectionPlanService.GetInfo(Id);
|
||||
|
||||
var info = response.Adapt<DevicePointInspectionPlan>();
|
||||
return SUCCESS(info);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加点检任务
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[ActionPermissionFilter(Permission = "deviceManagement:devicepointinspectionplan:add")]
|
||||
[Log(Title = "点检任务", BusinessType = BusinessType.INSERT)]
|
||||
public IActionResult AddDevicePointInspectionPlan([FromBody] DevicePointInspectionPlanDto parm)
|
||||
{
|
||||
var modal = parm.Adapt<DevicePointInspectionPlan>().ToCreate(HttpContext);
|
||||
|
||||
var response = _DevicePointInspectionPlanService.AddDevicePointInspectionPlan(modal);
|
||||
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新点检任务
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPut]
|
||||
[ActionPermissionFilter(Permission = "deviceManagement:devicepointinspectionplan:edit")]
|
||||
[Log(Title = "点检任务", BusinessType = BusinessType.UPDATE)]
|
||||
public IActionResult UpdateDevicePointInspectionPlan([FromBody] DevicePointInspectionPlanDto parm)
|
||||
{
|
||||
var modal = parm.Adapt<DevicePointInspectionPlan>().ToUpdate(HttpContext);
|
||||
var response = _DevicePointInspectionPlanService.UpdateDevicePointInspectionPlan(modal);
|
||||
|
||||
return ToResponse(response);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除点检任务
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpDelete("{ids}")]
|
||||
[ActionPermissionFilter(Permission = "deviceManagement:devicepointinspectionplan:delete")]
|
||||
[Log(Title = "点检任务", BusinessType = BusinessType.DELETE)]
|
||||
public IActionResult DeleteDevicePointInspectionPlan(string ids)
|
||||
{
|
||||
string[] idsArr = ids.Split(',');
|
||||
if (idsArr.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); }
|
||||
|
||||
var response = _DevicePointInspectionPlanService.Delete(idsArr);
|
||||
|
||||
|
||||
return ToResponse(response);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user