From 2923b57174c59c6b07e3ac7502c41fa60e32ae33 Mon Sep 17 00:00:00 2001 From: 如洲 陈 <1278080563@qq.com> Date: 星期五, 09 五月 2025 17:49:20 +0800 Subject: [PATCH] 入库、首检、巡检 --- MES.Service/service/QC/RKJService.cs | 104 +++++++++++++++++++++++++-------------------------- 1 files changed, 51 insertions(+), 53 deletions(-) diff --git a/MES.Service/service/QC/RKJService.cs b/MES.Service/service/QC/RKJService.cs index 4963929..815f2a2 100644 --- a/MES.Service/service/QC/RKJService.cs +++ b/MES.Service/service/QC/RKJService.cs @@ -54,13 +54,10 @@ //鑾峰彇宸ュ崟鍙� - public List<RKJDaa001> GetDaa001s(string lineNo) + public List<RkDaa002> GetDaa001s(string lineNo) { var db = SqlSugarHelper.GetInstance(); - return db.Queryable<RKJDaa001>() - .Where(t => t.LineNo == lineNo) - .OrderBy(t => t.BillNo, OrderByType.Desc) - .ToList(); + return null; } //鏍规嵁妫�楠屾爣鍑嗘潵璁$畻妫�楠屼釜鏁� @@ -418,14 +415,14 @@ var mesInvItemIns = db.Queryable<MesInvItemIns>() .Single(s => s.BillNo == qsItemOqcReq.BillNo); - var mesSchemeResult = db.Queryable<MesSchemeResult>() - .Single(s => s.BillNo == mesInvItemIns.CbillNo); + var mesSchemeResult = db.Queryable<Womdaa>() + .Single(s => s.Daa001 == mesInvItemIns.CbillNo); var entity = new MesQaItemsDetect02(); - entity.ItemNo = mesSchemeResult.BoardItem; - entity.BoardItem = mesSchemeResult.BoardItem; - entity.LineNo = mesSchemeResult.LineNo; - entity.Aufnr = mesSchemeResult.TaskNo; + // entity.ItemNo = mesSchemeResult.BoardItem; + // entity.BoardItem = mesSchemeResult.BoardItem; + entity.LineNo = mesSchemeResult.Daa015; + // entity.Aufnr = mesSchemeResult.TaskNo; entity.ReleaseNo = qsItemOqcReq.ReleaseNo; entity.LotNo = qsItemOqcReq.BillNo; entity.FcheckDate = qsItemOqcReq.FcheckDate; @@ -457,48 +454,49 @@ { var db = SqlSugarHelper.GetInstance(); - var id = Convert.ToDecimal(queryObj.id); - - string[]? lineNo = null; - - if (StringUtil.IsNotNullOrEmpty(queryObj.createUser)) - lineNo = _baseService.getUserLineNo(queryObj.createUser); - - return db.Queryable<QsItemOqcReq, RKJDaa001>((a, b) => - new JoinQueryInfos(JoinType.Left, a.BillNo == b.BillNo)) - .WhereIF(lineNo != null && lineNo.Length > 0, - (a, b) => lineNo.Contains(b.LineNo)) - .WhereIF( - StringUtil.IsNotNullOrEmpty(queryObj.result) && - "鏈畬鎴�".Equals(queryObj.result), - (a, b) => a.FcheckResu == null) - .WhereIF( - StringUtil.IsNotNullOrEmpty(queryObj.result) && - !"鏈畬鎴�".Equals(queryObj.result), - (a, b) => a.FcheckResu != null) - .WhereIF(id > 0, (a, b) => a.Id == id) - .Select((a, b) => new QsItemOqcReq - { - Id = a.Id, - ReleaseNo = a.ReleaseNo, - BillNo = a.BillNo, - LineName = b.LineNo, - Quantity = b.Quantity, - CreateBy = a.CreateBy, - CreateDate = a.CreateDate, - ItemNo = a.ItemNo, - Mocode = b.Mocode, - BoardModel = b.BoardModel, - TaskNo = b.TaskNo, - FcheckResu = a.FcheckResu, - FcheckBy = a.FcheckBy, - FcheckDate = a.FcheckDate, - MoidNum = a.MoidNum, - BoardName = b.BoardName, - ColorName = b.ColorName, - Remarks = a.Remarks - }).OrderBy(a => a.CreateDate, OrderByType.Desc) - .ToPageList(queryObj.PageIndex, queryObj.Limit); + return db + .Queryable<QsItemOqcReq, MesItems, MesInvItemIns, Womdaa, MesInvTransaction, RKJDaa001, MesLine>( + (a, b, c, da, ca, m, l) => new JoinQueryInfos( + JoinType.Left, a.ItemNo == b.Id.ToString(), + JoinType.Left, a.BillNo == c.BillNo, + JoinType.Left, da.Daa001 == c.RbillNo, + JoinType.Left, c.TransctionNo == ca.TransactionNo.ToString() + && c.Company == ca.Company + && c.Factory == ca.Factory, + JoinType.Left, m.ItemInId == c.Id, + JoinType.Left, l.LineNo == da.Daa015 + )) + //.WhereIF(!"PL017".Equals(queryObj.createUser), + // (a, b, c, da, ca, m) => lineNo.Contains(da.Daa015)) + .WhereIF(!string.IsNullOrEmpty(queryObj.id), (a, b, c, da, ca, m, l) => a.Id.ToString() == queryObj.id) + .WhereIF( + StringUtil.IsNotNullOrEmpty(queryObj.result) && "鏈畬鎴�".Equals(queryObj.result), + (a, b, c, da, ca, m, l) => a.FcheckResu == null) + .WhereIF( + StringUtil.IsNotNullOrEmpty(queryObj.result) && !"鏈畬鎴�".Equals(queryObj.result), + (a, b, c, da, ca, m, l) => a.FcheckResu != null) + .Select((a, b, c, da, ca, m, l) => new QsItemOqcReq + { + BillNo = a.BillNo, + Remarks = a.Remarks, + Id = a.Id, + CreateDate = a.CreateDate, + CreateBy = a.CreateBy, + FcheckResu = a.FcheckResu, + ItemNo = b.ItemNo, + FcheckBy = a.FcheckBy, + FcheckDate = a.FcheckDate, + ReleaseNo = a.ReleaseNo, + ItemName = b.ItemName, + ItemModel = b.ItemModel, + TaskNo = c.RbillNo, + //CbillNo = c.CbillNo, + //LineNo = da.Daa015, + LineNo = l.LineName, + Quantity = m.Quantity + }) + .OrderBy(a => a.CreateDate, OrderByType.Desc) + .ToPageList(queryObj.PageIndex, queryObj.Limit); } //鍒犻櫎涓昏〃骞朵笖杩炵骇鍒犻櫎瀛愯〃鍜屽瓩琛� -- Gitblit v1.9.3