103 lines
3.4 KiB
C#
103 lines
3.4 KiB
C#
|
|
using Microsoft.AspNetCore.Mvc;
|
|||
|
|
using ZR.Admin.WebApi.Extensions;
|
|||
|
|
using ZR.Admin.WebApi.Filters;
|
|||
|
|
using ZR.Model.MES.andon;
|
|||
|
|
using ZR.Model.MES.andon.Dto;
|
|||
|
|
using ZR.Service.mes.andon.Iservice;
|
|||
|
|
|
|||
|
|
//创建时间:2025-12-10
|
|||
|
|
namespace ZR.Admin.WebApi.Controllers.andon
|
|||
|
|
{
|
|||
|
|
/// <summary>
|
|||
|
|
/// 安灯区域工作时间表
|
|||
|
|
/// </summary>
|
|||
|
|
[Route("mes/AndonWorkTime")]
|
|||
|
|
[AllowAnonymous]
|
|||
|
|
public class AndonWorkTimeController : BaseController
|
|||
|
|
{
|
|||
|
|
/// <summary>
|
|||
|
|
/// 安灯区域工作时间表接口
|
|||
|
|
/// </summary>
|
|||
|
|
private readonly IAndonWorkTimeService _AndonWorkTimeService;
|
|||
|
|
|
|||
|
|
public AndonWorkTimeController(IAndonWorkTimeService AndonWorkTimeService)
|
|||
|
|
{
|
|||
|
|
_AndonWorkTimeService = AndonWorkTimeService;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 查询安灯区域工作时间表列表
|
|||
|
|
/// </summary>
|
|||
|
|
/// <param name="parm"></param>
|
|||
|
|
/// <returns></returns>
|
|||
|
|
[HttpGet("list")]
|
|||
|
|
[ActionPermissionFilter(Permission = "andonworktime:list")]
|
|||
|
|
public IActionResult QueryAndonWorkTime([FromQuery] AndonWorkTimeQueryDto parm)
|
|||
|
|
{
|
|||
|
|
var response = _AndonWorkTimeService.GetList(parm);
|
|||
|
|
return SUCCESS(response);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 查询安灯区域工作时间表详情
|
|||
|
|
/// </summary>
|
|||
|
|
/// <param name="Id"></param>
|
|||
|
|
/// <returns></returns>
|
|||
|
|
[HttpGet("{Id}")]
|
|||
|
|
[ActionPermissionFilter(Permission = "andonworktime:query")]
|
|||
|
|
public IActionResult GetAndonWorkTime(int Id)
|
|||
|
|
{
|
|||
|
|
var response = _AndonWorkTimeService.GetInfo(Id);
|
|||
|
|
|
|||
|
|
var info = response.Adapt<AndonWorkTimeDto>();
|
|||
|
|
return SUCCESS(info);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 添加安灯区域工作时间表
|
|||
|
|
/// </summary>
|
|||
|
|
/// <returns></returns>
|
|||
|
|
[HttpPost]
|
|||
|
|
[ActionPermissionFilter(Permission = "andonworktime:add")]
|
|||
|
|
[Log(Title = "安灯区域工作时间表", BusinessType = BusinessType.INSERT)]
|
|||
|
|
public IActionResult AddAndonWorkTime([FromBody] AndonWorkTimeDto parm)
|
|||
|
|
{
|
|||
|
|
var modal = parm.Adapt<AndonWorkTime>().ToCreate(HttpContext);
|
|||
|
|
|
|||
|
|
var response = _AndonWorkTimeService.AddAndonWorkTime(modal);
|
|||
|
|
|
|||
|
|
return SUCCESS(response);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 更新安灯区域工作时间表
|
|||
|
|
/// </summary>
|
|||
|
|
/// <returns></returns>
|
|||
|
|
[HttpPut]
|
|||
|
|
[ActionPermissionFilter(Permission = "andonworktime:edit")]
|
|||
|
|
[Log(Title = "安灯区域工作时间表", BusinessType = BusinessType.UPDATE)]
|
|||
|
|
public IActionResult UpdateAndonWorkTime([FromBody] AndonWorkTimeDto parm)
|
|||
|
|
{
|
|||
|
|
var modal = parm.Adapt<AndonWorkTime>().ToUpdate(HttpContext);
|
|||
|
|
var response = _AndonWorkTimeService.UpdateAndonWorkTime(modal);
|
|||
|
|
|
|||
|
|
return ToResponse(response);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 删除安灯区域工作时间表
|
|||
|
|
/// </summary>
|
|||
|
|
/// <returns></returns>
|
|||
|
|
[HttpPost("delete/{ids}")]
|
|||
|
|
[ActionPermissionFilter(Permission = "andonworktime:delete")]
|
|||
|
|
[Log(Title = "安灯区域工作时间表", BusinessType = BusinessType.DELETE)]
|
|||
|
|
public IActionResult DeleteAndonWorkTime([FromRoute]string ids)
|
|||
|
|
{
|
|||
|
|
var idArr = Tools.SplitAndConvert<int>(ids);
|
|||
|
|
|
|||
|
|
return ToResponse(_AndonWorkTimeService.Delete(idArr));
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
}
|