zhuangpei-mesbackend/DOAN.Admin.WebApi/Controllers/MES/quality/FQC/QcFinishedproductDefectController.cs

68 lines
2.2 KiB
C#
Raw Normal View History

2024-10-12 23:02:54 +08:00
using DOAN.Admin.WebApi.Filters;
using DOAN.Model.MES.quality.IQC;
using DOAN.Model.MES.quality.IQC.Dto;
using DOAN.Service.MES.quality.FQC.IService;
using Microsoft.AspNetCore.Mvc;
//创建时间2024-10-10
namespace DOAN.WebApi.Controllers.MES.quality.FQC
{
/// <summary>
/// 成品检验 缺陷收集
/// </summary>
[AllowAnonymous]
[Route("mes/qualityManagement/FQC/QcFinishedproductDefect")]
public class QcFinishedproductDefectController : BaseController
{
private readonly IQcFinishedproductDefectService qcFinishedproductDefectService;
public QcFinishedproductDefectController(IQcFinishedproductDefectService qcFinishedproductDefectService)
{
this.qcFinishedproductDefectService = qcFinishedproductDefectService;
}
//TODO 增加 缺陷数
[HttpGet("add_defect_num")]
2024-10-14 08:57:24 +08:00
public IActionResult AddDefectNum(string WorkOrder, string DefectCode)
2024-10-12 23:02:54 +08:00
{
2024-10-14 08:57:24 +08:00
if (string.IsNullOrEmpty(WorkOrder) || string.IsNullOrEmpty(DefectCode))
2024-10-12 23:02:54 +08:00
{
2024-10-14 08:57:24 +08:00
throw new CustomException("WorkOrder为空||DefectCode为空");
2024-10-12 23:02:54 +08:00
}
2024-10-14 08:57:24 +08:00
var response = qcFinishedproductDefectService.AddDefectNum(WorkOrder, DefectCode);
2024-10-12 23:02:54 +08:00
return SUCCESS(response);
}
//TODO 修改缺陷数
[HttpGet("update_defect_num")]
2024-10-14 08:57:24 +08:00
public IActionResult UpdateDefectNum(string WorkOrder, string DefectCode, int num)
2024-10-12 23:02:54 +08:00
{
2024-10-14 08:57:24 +08:00
if (string.IsNullOrEmpty(WorkOrder) || string.IsNullOrEmpty(DefectCode))
2024-10-12 23:02:54 +08:00
{
2024-10-14 08:57:24 +08:00
throw new CustomException("WorkOrder为空||DefectCode为空");
2024-10-12 23:02:54 +08:00
}
2024-10-14 08:57:24 +08:00
var response = qcFinishedproductDefectService.UpdateDefectNum(WorkOrder, DefectCode, num);
2024-10-12 23:02:54 +08:00
return SUCCESS(response);
}
2024-10-12 23:34:41 +08:00
//TODO 查询指定工单下的缺陷
[HttpGet("search_defects")]
public IActionResult SearchDefectList(string WorkOrder)
{
if (string.IsNullOrEmpty(WorkOrder) )
{
throw new CustomException("WorkOrder为空");
}
var response = qcFinishedproductDefectService.SearchDefectList(WorkOrder);
return SUCCESS(response);
}
2024-10-12 23:02:54 +08:00
}
}