设备管理
This commit is contained in:
@@ -0,0 +1,109 @@
|
||||
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-28
|
||||
namespace DOAN.Admin.WebApi.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// 报修单
|
||||
/// </summary>
|
||||
[Verify]
|
||||
[Route("business/DeviceRepair")]
|
||||
public class DeviceRepairController : BaseController
|
||||
{
|
||||
/// <summary>
|
||||
/// 报修单接口
|
||||
/// </summary>
|
||||
private readonly IDeviceRepairService _DeviceRepairService;
|
||||
|
||||
public DeviceRepairController(IDeviceRepairService DeviceRepairService)
|
||||
{
|
||||
_DeviceRepairService = DeviceRepairService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询报修单列表
|
||||
/// </summary>
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("list")]
|
||||
|
||||
public IActionResult QueryDeviceRepair([FromBody] DeviceRepairQueryDto parm)
|
||||
{
|
||||
var response = _DeviceRepairService.GetList(parm);
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 查询报修单详情
|
||||
/// </summary>
|
||||
/// <param name="Id"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("{Id}")]
|
||||
[ActionPermissionFilter(Permission = "deviceManagement:devicerepair:query")]
|
||||
public IActionResult GetDeviceRepair(string Id)
|
||||
{
|
||||
var response = _DeviceRepairService.GetInfo(Id);
|
||||
|
||||
var info = response.Adapt<DeviceRepair>();
|
||||
return SUCCESS(info);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加报修单
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[ActionPermissionFilter(Permission = "deviceManagement:devicerepair:add")]
|
||||
[Log(Title = "报修单", BusinessType = BusinessType.INSERT)]
|
||||
public IActionResult AddDeviceRepair([FromBody] DeviceRepairDto parm)
|
||||
{
|
||||
var modal = parm.Adapt<DeviceRepair>().ToCreate(HttpContext);
|
||||
|
||||
var response = _DeviceRepairService.AddDeviceRepair(modal);
|
||||
|
||||
return SUCCESS(response);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新报修单
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPut]
|
||||
[ActionPermissionFilter(Permission = "deviceManagement:devicerepair:edit")]
|
||||
[Log(Title = "报修单", BusinessType = BusinessType.UPDATE)]
|
||||
public IActionResult UpdateDeviceRepair([FromBody] DeviceRepairDto parm)
|
||||
{
|
||||
var modal = parm.Adapt<DeviceRepair>().ToUpdate(HttpContext);
|
||||
var response = _DeviceRepairService.UpdateDeviceRepair(modal);
|
||||
|
||||
return ToResponse(response);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除报修单
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpDelete("{ids}")]
|
||||
[ActionPermissionFilter(Permission = "deviceManagement:devicerepair:delete")]
|
||||
[Log(Title = "报修单", BusinessType = BusinessType.DELETE)]
|
||||
public IActionResult DeleteDeviceRepair(string ids)
|
||||
{
|
||||
string[] idsArr = ids.Split(',');
|
||||
if (idsArr.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); }
|
||||
|
||||
var response = _DeviceRepairService.Delete(idsArr);
|
||||
|
||||
return ToResponse(response);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user