118 lines
4.0 KiB
C#
118 lines
4.0 KiB
C#
using Microsoft.AspNetCore.Mvc;
|
||
using DOAN.Model.Dto;
|
||
using DOAN.Model.Business;
|
||
using DOAN.Service.Business.IBusinessService;
|
||
using DOAN.Admin.WebApi.Filters;
|
||
|
||
//创建时间:2025-11-03
|
||
namespace DOAN.Admin.WebApi.Controllers
|
||
{
|
||
/// <summary>
|
||
///
|
||
/// </summary>
|
||
[Verify]
|
||
[Route("business/ProcessmodelOperationStep")]
|
||
public class ProcessmodelWorkStepController : BaseController
|
||
{
|
||
/// <summary>
|
||
/// 接口
|
||
/// </summary>
|
||
private readonly IProcessmodelWorkStepService _ProcessmodelOperationStepService;
|
||
|
||
public ProcessmodelWorkStepController(IProcessmodelWorkStepService ProcessmodelOperationStepService)
|
||
{
|
||
_ProcessmodelOperationStepService = ProcessmodelOperationStepService;
|
||
}
|
||
|
||
/// <summary>
|
||
/// 查询列表
|
||
/// </summary>
|
||
/// <param name="parm"></param>
|
||
/// <returns></returns>
|
||
[HttpGet("list")]
|
||
[ActionPermissionFilter(Permission = "business:processmodeloperationstep:list")]
|
||
public IActionResult QueryProcessmodelOperationStep([FromQuery] ProcessmodelWorkStepQueryDto parm)
|
||
{
|
||
var response = _ProcessmodelOperationStepService.GetList(parm);
|
||
return SUCCESS(response);
|
||
}
|
||
|
||
|
||
/// <summary>
|
||
/// 查询详情
|
||
/// </summary>
|
||
/// <param name="Id"></param>
|
||
/// <returns></returns>
|
||
[HttpGet("{Id}")]
|
||
[ActionPermissionFilter(Permission = "business:processmodeloperationstep:query")]
|
||
public IActionResult GetProcessmodelOperationStep(long Id)
|
||
{
|
||
var response = _ProcessmodelOperationStepService.GetInfo(Id);
|
||
|
||
var info = response.Adapt<ProcessmodelWorkStep>();
|
||
return SUCCESS(info);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 添加
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpPost]
|
||
[ActionPermissionFilter(Permission = "business:processmodeloperationstep:add")]
|
||
[Log(Title = "", BusinessType = BusinessType.INSERT)]
|
||
public IActionResult AddProcessmodelOperationStep([FromBody] ProcessmodeWorkStepDto parm)
|
||
{
|
||
var modal = parm.Adapt<ProcessmodelWorkStep>().ToCreate(HttpContext);
|
||
|
||
var response = _ProcessmodelOperationStepService.AddProcessmodelWorkStep(modal);
|
||
|
||
return SUCCESS(response);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 更新
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpPut]
|
||
[ActionPermissionFilter(Permission = "business:processmodeloperationstep:edit")]
|
||
[Log(Title = "", BusinessType = BusinessType.UPDATE)]
|
||
public IActionResult UpdateProcessmodelOperationStep([FromBody] ProcessmodeWorkStepDto parm)
|
||
{
|
||
var modal = parm.Adapt<ProcessmodelWorkStep>().ToUpdate(HttpContext);
|
||
var response = _ProcessmodelOperationStepService.UpdateProcessmodelWorkStep(modal);
|
||
|
||
return ToResponse(response);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 删除
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpDelete("{ids}")]
|
||
[ActionPermissionFilter(Permission = "business:processmodeloperationstep:delete")]
|
||
[Log(Title = "", BusinessType = BusinessType.DELETE)]
|
||
public IActionResult DeleteProcessmodelOperationStep(string ids)
|
||
{
|
||
int[] idsArr = Tools.SpitIntArrary(ids);
|
||
if (idsArr.Length <= 0) { return ToResponse(ApiResult.Error($"删除失败Id 不能为空")); }
|
||
|
||
var response = _ProcessmodelOperationStepService.Delete(idsArr);
|
||
|
||
return ToResponse(response);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 查询设备列表
|
||
/// </summary>
|
||
/// <param name="stepCode"></param>
|
||
/// <returns></returns>
|
||
[HttpGet("uniqueList")]
|
||
public IActionResult GetUniqueList(string stepCode)
|
||
{
|
||
var response = _ProcessmodelOperationStepService.GetUniqueValueList(stepCode);
|
||
return SUCCESS(response);
|
||
}
|
||
|
||
|
||
}
|
||
} |