Files
kunshan-bzfm-mes-backend/DOAN.Admin.WebApi/Controllers/MES/Quality/FQC/QcFinishedproductDefectController.cs

83 lines
2.7 KiB
C#
Raw Normal View History

2024-12-27 10:08:11 +08:00
using DOAN.Admin.WebApi.Filters;
using DOAN.Model.MES.quality.IQC;
using DOAN.Model.MES.quality.IQC.Dto;
2024-12-27 15:06:06 +08:00
using DOAN.Model.MES.Quality.FQC.Dto;
2024-12-27 10:08:11 +08:00
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-12-27 15:06:06 +08:00
public IActionResult AddDefectNum([FromQuery] QueryFQCDto queryFQCDto)
2024-12-27 10:08:11 +08:00
{
2024-12-27 15:06:06 +08:00
if (string.IsNullOrEmpty(queryFQCDto.WorkOrder) || string.IsNullOrEmpty(queryFQCDto.DefectCode))
2024-12-27 10:08:11 +08:00
{
throw new CustomException("WorkOrder为空||DefectCode为空");
}
2024-12-27 15:06:06 +08:00
var response = qcFinishedproductDefectService.AddDefectNum(queryFQCDto);
2024-12-27 10:08:11 +08:00
return SUCCESS(response);
}
//TODO 修改缺陷数
[HttpGet("update_defect_num")]
2024-12-27 15:06:06 +08:00
public IActionResult UpdateDefectNum([FromQuery] QueryFQCDto queryFQCDto)
2024-12-27 10:08:11 +08:00
{
2024-12-27 15:06:06 +08:00
if (string.IsNullOrEmpty(queryFQCDto.WorkOrder) || string.IsNullOrEmpty(queryFQCDto.DefectCode))
2024-12-27 10:08:11 +08:00
{
throw new CustomException("WorkOrder为空||DefectCode为空");
}
2024-12-27 15:06:06 +08:00
var response = qcFinishedproductDefectService.UpdateDefectNum(queryFQCDto);
2024-12-27 10:08:11 +08:00
return SUCCESS(response);
}
//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-12-27 16:19:40 +08:00
//TODO 分页查询缺陷统计
[HttpPost("search_defect_Statistics_page")]
public IActionResult SearchDefectStatisticsPage([FromBody]QueryFQCShowDto queryFQCShow)
{
if(queryFQCShow == null)
{
throw new CustomException("queryFQCShow为空");
}
var response = qcFinishedproductDefectService.SearchDefectStatisticsPage(queryFQCShow);
return SUCCESS(response);
}
2024-12-27 10:08:11 +08:00
}
}