2025-10-27 17:02:32 +08:00
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
|
|
using RIZO.Model.Business.Dto;
|
|
|
|
|
|
using RIZO.Model.Business;
|
|
|
|
|
|
using RIZO.Service.Business.IBusinessService;
|
|
|
|
|
|
|
|
|
|
|
|
//创建时间:2025-11-04
|
|
|
|
|
|
namespace RIZO.Admin.WebApi.Controllers.Business
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 工艺表
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[Route("business/ProcessInfo")]
|
2025-11-10 08:48:53 +08:00
|
|
|
|
[AllowAnonymous]
|
2025-10-27 17:02:32 +08:00
|
|
|
|
public class ProcessInfoController : BaseController
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 工艺表接口
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private readonly IProcessInfoService _ProcessInfoService;
|
|
|
|
|
|
|
|
|
|
|
|
public ProcessInfoController(IProcessInfoService ProcessInfoService)
|
|
|
|
|
|
{
|
|
|
|
|
|
_ProcessInfoService = ProcessInfoService;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 查询工艺表列表
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="parm"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpGet("list")]
|
|
|
|
|
|
[ActionPermissionFilter(Permission = "processinfo:list")]
|
|
|
|
|
|
public IActionResult QueryProcessInfo([FromQuery] ProcessInfoQueryDto parm)
|
|
|
|
|
|
{
|
|
|
|
|
|
var response = _ProcessInfoService.GetList(parm);
|
|
|
|
|
|
return SUCCESS(response);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 查询工艺表详情
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="Id"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpGet("{Id}")]
|
|
|
|
|
|
[ActionPermissionFilter(Permission = "processinfo:query")]
|
|
|
|
|
|
public IActionResult GetProcessInfo(long Id)
|
|
|
|
|
|
{
|
|
|
|
|
|
var response = _ProcessInfoService.GetInfo(Id);
|
|
|
|
|
|
|
|
|
|
|
|
var info = response.Adapt<ProcessInfoDto>();
|
|
|
|
|
|
return SUCCESS(info);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 添加工艺表
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpPost]
|
|
|
|
|
|
[ActionPermissionFilter(Permission = "processinfo:add")]
|
|
|
|
|
|
[Log(Title = "工艺表", BusinessType = BusinessType.INSERT)]
|
|
|
|
|
|
public IActionResult AddProcessInfo([FromBody] ProcessInfoDto parm)
|
|
|
|
|
|
{
|
|
|
|
|
|
var modal = parm.Adapt<ProcessInfo>().ToCreate(HttpContext);
|
|
|
|
|
|
|
|
|
|
|
|
var response = _ProcessInfoService.AddProcessInfo(modal);
|
|
|
|
|
|
|
|
|
|
|
|
return SUCCESS(response);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 更新工艺表
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpPut]
|
|
|
|
|
|
[ActionPermissionFilter(Permission = "processinfo:edit")]
|
|
|
|
|
|
[Log(Title = "工艺表", BusinessType = BusinessType.UPDATE)]
|
|
|
|
|
|
public IActionResult UpdateProcessInfo([FromBody] ProcessInfoDto parm)
|
|
|
|
|
|
{
|
|
|
|
|
|
var modal = parm.Adapt<ProcessInfo>().ToUpdate(HttpContext);
|
|
|
|
|
|
var response = _ProcessInfoService.UpdateProcessInfo(modal);
|
|
|
|
|
|
|
|
|
|
|
|
return ToResponse(response);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 删除工艺表
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpPost("delete/{ids}")]
|
|
|
|
|
|
[ActionPermissionFilter(Permission = "processinfo:delete")]
|
|
|
|
|
|
[Log(Title = "工艺表", BusinessType = BusinessType.DELETE)]
|
|
|
|
|
|
public IActionResult DeleteProcessInfo([FromRoute]string ids)
|
|
|
|
|
|
{
|
|
|
|
|
|
var idArr = Tools.SplitAndConvert<long>(ids);
|
|
|
|
|
|
|
|
|
|
|
|
return ToResponse(_ProcessInfoService.Delete(idArr));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-11-07 09:24:24 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 导入工艺表
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns></returns>
|
2025-11-10 10:37:11 +08:00
|
|
|
|
[HttpPost("ImportProcessInfo/{userId}/{userName}")]
|
2025-11-10 11:27:18 +08:00
|
|
|
|
[ActionPermissionFilter(Permission = "processinfo:add")]
|
2025-11-07 09:24:24 +08:00
|
|
|
|
[Log(Title = "导入保存工艺路线", BusinessType = BusinessType.IMPORT)]
|
2025-11-10 10:37:11 +08:00
|
|
|
|
public IActionResult ImportProcessInfo([FromRoute] string userId, [FromRoute] string userName, [FromForm] IFormFile file)
|
2025-11-07 09:24:24 +08:00
|
|
|
|
{
|
2025-11-10 08:48:53 +08:00
|
|
|
|
var stream = file.OpenReadStream();
|
|
|
|
|
|
var fileName = file.FileName;
|
2025-11-10 10:37:11 +08:00
|
|
|
|
var response = _ProcessInfoService.ImportProcessInfo(stream, userId,userName);
|
2025-11-07 09:24:24 +08:00
|
|
|
|
return SUCCESS(response);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-11-10 10:00:23 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 通过工艺路线Code批量删除工艺表
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns></returns>
|
2025-11-10 11:27:18 +08:00
|
|
|
|
[HttpDelete("deleteByProcessCode")]
|
2025-11-10 10:00:23 +08:00
|
|
|
|
[ActionPermissionFilter(Permission = "processinfo:delete")]
|
|
|
|
|
|
[Log(Title = "工艺表", BusinessType = BusinessType.DELETE)]
|
|
|
|
|
|
public IActionResult DeleteByProcessCode([FromBody] string[] processCodeArr)
|
|
|
|
|
|
{
|
|
|
|
|
|
return ToResponse(_ProcessInfoService.DeleteByProcessCode(processCodeArr));
|
|
|
|
|
|
}
|
2025-10-27 17:02:32 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|