查询指定工单下的缺陷

This commit is contained in:
qianhao.xu 2024-10-12 23:34:41 +08:00
parent 6097d50da1
commit c61bcc50b2
3 changed files with 21 additions and 1 deletions

View File

@ -47,6 +47,18 @@ namespace DOAN.WebApi.Controllers.MES.quality.FQC
}
//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);
}
}
}

View File

@ -1,4 +1,5 @@
using System;
using DOAN.Model.MES.quality.FQC;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@ -10,5 +11,6 @@ namespace DOAN.Service.MES.quality.FQC.IService
{
bool AddDefectNum(string WorkOrder,string name);
bool UpdateDefectNum(string WorkOrder,string name,int num);
List<QcFinishedproductDefectCollection> SearchDefectList(string WorkOrder);
}
}

View File

@ -70,6 +70,12 @@ namespace DOAN.Service.MES.quality.FQC
.ExecuteCommand();
return flag > 0 ? true : false;
}
public List<QcFinishedproductDefectCollection> SearchDefectList(string WorkOrder)
{
return Context.Queryable<QcFinishedproductDefectCollection>().Where(it => it.Workorder == WorkOrder).ToList();
}
}
}