109 lines
3.8 KiB
C#
109 lines
3.8 KiB
C#
|
|
using Microsoft.AspNetCore.Mvc;
|
|||
|
|
using DOAN.Service.MES.dev.IService;
|
|||
|
|
using DOAN.Model.MES.dev.Dto;
|
|||
|
|
using DOAN.Admin.WebApi.Filters;
|
|||
|
|
using DOAN.Model.MES.dev.Dto;
|
|||
|
|
using DOAN.Model.MES.dev;
|
|||
|
|
|
|||
|
|
//创建时间:2024-05-27
|
|||
|
|
namespace DOAN.Admin.WebApi.Controllers
|
|||
|
|
{
|
|||
|
|
/// <summary>
|
|||
|
|
/// 巡检计划
|
|||
|
|
/// </summary>
|
|||
|
|
[Verify]
|
|||
|
|
[Route("mes/deviceManagement/DeviceRouteInspectionPlan")]
|
|||
|
|
public class DeviceRouteInspectionPlanController : BaseController
|
|||
|
|
{
|
|||
|
|
/// <summary>
|
|||
|
|
/// 巡检计划接口
|
|||
|
|
/// </summary>
|
|||
|
|
private readonly IDeviceRouteInspectionPlanService _DeviceRouteInspectionPlanService;
|
|||
|
|
|
|||
|
|
public DeviceRouteInspectionPlanController(IDeviceRouteInspectionPlanService DeviceRouteInspectionPlanService)
|
|||
|
|
{
|
|||
|
|
_DeviceRouteInspectionPlanService = DeviceRouteInspectionPlanService;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 查询巡检计划列表
|
|||
|
|
/// </summary>
|
|||
|
|
/// <param name="parm"></param>
|
|||
|
|
/// <returns></returns>
|
|||
|
|
[HttpGet("list")]
|
|||
|
|
|
|||
|
|
public IActionResult QueryDeviceRouteInspectionPlan([FromQuery] DeviceRouteInspectionPlanQueryDto parm)
|
|||
|
|
{
|
|||
|
|
var response = _DeviceRouteInspectionPlanService.GetList(parm);
|
|||
|
|
return SUCCESS(response);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 查询巡检计划详情
|
|||
|
|
/// </summary>
|
|||
|
|
/// <param name="Id"></param>
|
|||
|
|
/// <returns></returns>
|
|||
|
|
[HttpGet("{Id}")]
|
|||
|
|
[ActionPermissionFilter(Permission = "deviceManagement:devicerouteinspectionplan:query")]
|
|||
|
|
public IActionResult GetDeviceRouteInspectionPlan(string Id)
|
|||
|
|
{
|
|||
|
|
var response = _DeviceRouteInspectionPlanService.GetInfo(Id);
|
|||
|
|
|
|||
|
|
var info = response.Adapt<DeviceRouteInspectionPlan>();
|
|||
|
|
return SUCCESS(info);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 添加巡检计划
|
|||
|
|
/// </summary>
|
|||
|
|
/// <returns></returns>
|
|||
|
|
[HttpPost]
|
|||
|
|
[ActionPermissionFilter(Permission = "deviceManagement:devicerouteinspectionplan:add")]
|
|||
|
|
[Log(Title = "巡检计划", BusinessType = BusinessType.INSERT)]
|
|||
|
|
public IActionResult AddDeviceRouteInspectionPlan([FromBody] DeviceRouteInspectionPlanDto parm)
|
|||
|
|
{
|
|||
|
|
var modal = parm.Adapt<DeviceRouteInspectionPlan>().ToCreate(HttpContext);
|
|||
|
|
|
|||
|
|
var response = _DeviceRouteInspectionPlanService.AddDeviceRouteInspectionPlan(modal);
|
|||
|
|
|
|||
|
|
return SUCCESS(response);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 更新巡检计划
|
|||
|
|
/// </summary>
|
|||
|
|
/// <returns></returns>
|
|||
|
|
[HttpPut]
|
|||
|
|
[ActionPermissionFilter(Permission = "deviceManagement:devicerouteinspectionplan:edit")]
|
|||
|
|
[Log(Title = "巡检计划", BusinessType = BusinessType.UPDATE)]
|
|||
|
|
public IActionResult UpdateDeviceRouteInspectionPlan([FromBody] DeviceRouteInspectionPlanDto parm)
|
|||
|
|
{
|
|||
|
|
var modal = parm.Adapt<DeviceRouteInspectionPlan>().ToUpdate(HttpContext);
|
|||
|
|
var response = _DeviceRouteInspectionPlanService.UpdateDeviceRouteInspectionPlan(modal);
|
|||
|
|
|
|||
|
|
return ToResponse(response);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 删除巡检计划
|
|||
|
|
/// </summary>
|
|||
|
|
/// <returns></returns>
|
|||
|
|
[HttpDelete("{ids}")]
|
|||
|
|
[ActionPermissionFilter(Permission = "deviceManagement:devicerouteinspectionplan:delete")]
|
|||
|
|
[Log(Title = "巡检计划", BusinessType = BusinessType.DELETE)]
|
|||
|
|
public IActionResult DeleteDeviceRouteInspectionPlan(string ids)
|
|||
|
|
{
|
|||
|
|
string[] idsArr = ids.Split(',');
|
|||
|
|
if (idsArr.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); }
|
|||
|
|
|
|||
|
|
var response = _DeviceRouteInspectionPlanService.Delete(idsArr);
|
|||
|
|
|
|||
|
|
return ToResponse(response);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
}
|