质量统计
This commit is contained in:
@@ -19,6 +19,7 @@ using ZR.Model.mes.pro;
|
||||
using static System.Runtime.InteropServices.JavaScript.JSType;
|
||||
using System.Drawing;
|
||||
using Newtonsoft.Json;
|
||||
using ZR.Model.MES.qu;
|
||||
|
||||
namespace ZR.Service.MES.op
|
||||
{
|
||||
@@ -131,6 +132,98 @@ namespace ZR.Service.MES.op
|
||||
return (QcFqcDTOList, totalCount);
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取工单 缺陷详细信息
|
||||
/// </summary>
|
||||
/// <param name="fkWorkorderId"></param>
|
||||
/// <param name="order"></param>
|
||||
/// <returns></returns>
|
||||
public List<DetailsOfDetectionDTO> QueryDetailsOfDetection(string fkWorkorderId, int order)
|
||||
{
|
||||
List<DetailsOfDetectionDTO> detailsList = null;
|
||||
switch(order)
|
||||
{
|
||||
case 1:
|
||||
// 首检抛光数量
|
||||
detailsList = Context.Queryable<QcFirstinspectionRecord>().LeftJoin<QcInspectionitem>((f, i) => f.FKInpectionId == i.InspectionCode).Where("f.FKInpectionId like @FKInpectionId", new { FKInpectionId = "_" + 1 + "_" })
|
||||
.Select((f, i) => new DetailsOfDetectionDTO
|
||||
{
|
||||
InspectionName = i.InspectionName,
|
||||
Counter = (int)f.Counter,
|
||||
|
||||
}).ToList(); break;
|
||||
case 2:
|
||||
// 首检打磨数量
|
||||
detailsList = Context.Queryable<QcFirstinspectionRecord>().LeftJoin<QcInspectionitem>((f, i) => f.FKInpectionId == i.InspectionCode).Where("FKInpectionId like @FKInpectionId", new { FKInpectionId = "_" + 2 + "_" })
|
||||
.Select((f, i) => new DetailsOfDetectionDTO
|
||||
{
|
||||
InspectionName = i.InspectionName,
|
||||
Counter = (int)f.Counter,
|
||||
|
||||
}).ToList();
|
||||
break;
|
||||
|
||||
case 3:
|
||||
// 首检报废数量
|
||||
detailsList = Context.Queryable<QcFirstinspectionRecord>().LeftJoin<QcInspectionitem>((f, i) => f.FKInpectionId == i.InspectionCode).Where("FKInpectionId like @FKInpectionId", new { FKInpectionId = "_" + 3 + "_" })
|
||||
.Select((f, i) => new DetailsOfDetectionDTO
|
||||
{
|
||||
InspectionName = i.InspectionName,
|
||||
Counter = (int)f.Counter,
|
||||
|
||||
}).ToList();
|
||||
break;
|
||||
|
||||
case 4:
|
||||
// 二检打磨数量
|
||||
detailsList = Context.Queryable<QcAgaininspectionRecord>().LeftJoin<QcInspectionitem>((f, i) => f.FkInpectionId == i.InspectionCode).Where("FKInpectionId like @FKInpectionId", new { FKInpectionId = "_" + 2 + "_" })
|
||||
.Select((f, i) => new DetailsOfDetectionDTO
|
||||
{
|
||||
InspectionName = i.InspectionName,
|
||||
Counter = (int)f.Counter,
|
||||
|
||||
}).ToList();
|
||||
break;
|
||||
case 5:
|
||||
// 二检报废数量
|
||||
detailsList = Context.Queryable<QcAgaininspectionRecord>().LeftJoin<QcInspectionitem>((f, i) => f.FkInpectionId == i.InspectionCode).Where("FKInpectionId like @FKInpectionId", new { FKInpectionId = "_" + 3 + "_" })
|
||||
.Select((f, i) => new DetailsOfDetectionDTO
|
||||
{
|
||||
InspectionName = i.InspectionName,
|
||||
Counter = (int)f.Counter,
|
||||
|
||||
}).ToList();
|
||||
break;
|
||||
case 6:
|
||||
// 三检打磨数量
|
||||
detailsList = Context.Queryable<QcFinalinspectionRecord>().LeftJoin<QcInspectionitem>((f, i) => f.FkInpectionId == i.InspectionCode).Where("FKInpectionId like @FKInpectionId", new { FKInpectionId = "_" + 2 + "_" })
|
||||
.Select((f, i) => new DetailsOfDetectionDTO
|
||||
{
|
||||
InspectionName = i.InspectionName,
|
||||
Counter = (int)f.Counter,
|
||||
|
||||
}).ToList();
|
||||
|
||||
break;
|
||||
case 7:
|
||||
// 三检报废数量
|
||||
detailsList = Context.Queryable<QcFinalinspectionRecord>().LeftJoin<QcInspectionitem>((f, i) => f.FkInpectionId == i.InspectionCode).Where("FKInpectionId like @FKInpectionId", new { FKInpectionId = "_" + 3+ "_" })
|
||||
.Select((f, i) => new DetailsOfDetectionDTO
|
||||
{
|
||||
InspectionName = i.InspectionName,
|
||||
Counter = (int)f.Counter,
|
||||
|
||||
}).ToList();
|
||||
break;
|
||||
|
||||
default:break;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
return detailsList;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user