| | |
| | | |
| | | |
| | | //获取工单号 |
| | | 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 db.Queryable<RKJDaa001>() |
| | | // .Where(t => t.LineNo == lineNo) |
| | | // .OrderBy(t => t.BillNo, OrderByType.Desc) |
| | | // .ToList(); |
| | | return null; |
| | | } |
| | | |
| | | //根据检验标准来计算检验个数 |
| | |
| | | { |
| | | 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 |
| | | return db |
| | | .Queryable<QsItemOqcReq, Womdaa, MesItems, MesInvItemIns, Womdab, |
| | | MesInvTransaction, RKJDaa001>( |
| | | (a, da, b, c, d, ca, m) => new JoinQueryInfos( |
| | | JoinType.Left, da.Daa001 == a.BillNo, |
| | | JoinType.Left, a.ItemId == b.Id, |
| | | JoinType.Left, a.BillNo == c.BillNo, |
| | | JoinType.Left, c.CbillNo == d.Dab001, |
| | | JoinType.Left, |
| | | c.TransctionNo == ca.TransactionNo.ToString() && |
| | | c.Company == ca.Company && c.Factory == ca.Factory, |
| | | JoinType.Left, c.Id == m.ItemInId && a.ItemNo == m.ItemNo |
| | | )) |
| | | .Select((a, da, b, c, d, ca, m) => new QsItemOqcReq |
| | | { |
| | | Id = a.Id, |
| | | ReleaseNo = a.ReleaseNo, |
| | | BillNo = a.BillNo, |
| | | LineName = b.LineNo, |
| | | Quantity = b.Quantity, |
| | | CreateBy = a.CreateBy, |
| | | Remarks = a.Remarks, |
| | | Id = a.Id, |
| | | CreateDate = a.CreateDate, |
| | | ItemNo = a.ItemNo, |
| | | Mocode = b.Mocode, |
| | | BoardModel = b.BoardModel, |
| | | TaskNo = b.TaskNo, |
| | | CreateBy = a.CreateBy, |
| | | FcheckResu = a.FcheckResu, |
| | | ItemNo = a.ItemNo, |
| | | FcheckBy = a.FcheckBy, |
| | | FcheckDate = a.FcheckDate, |
| | | MoidNum = a.MoidNum, |
| | | BoardName = b.BoardName, |
| | | ColorName = b.ColorName, |
| | | Remarks = a.Remarks |
| | | ReleaseNo = a.ReleaseNo, |
| | | // 添加其他字段 |
| | | // 如果在 QsItemOqcReq 中定义了额外字段,则需要将它们赋值 |
| | | // 例如: |
| | | ItemName = b.ItemName, |
| | | ItemModel = b.ItemModel, |
| | | TaskNo = c.TaskNo, |
| | | CbillNo = c.CbillNo, |
| | | Dab001 = d.Dab001, |
| | | Daa015 = da.Daa015, |
| | | LineNo = c.LineNo, |
| | | Quantity = m.Quantity |
| | | }).OrderBy(a => a.CreateDate, OrderByType.Desc) |
| | | .ToPageList(queryObj.PageIndex, queryObj.Limit); |
| | | } |