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);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|