| | |
| | | // 任务单号 |
| | | [SugarColumn(ColumnName = "ITEM_NO")] public string? ItemNo { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "ITEM_NAME")] |
| | | [SugarColumn(ColumnName = "ITEM_SNAME")] |
| | | public string? ItemName { get; set; } |
| | | |
| | | [SugarColumn(ColumnName = "LOT_NO")] |
| | | public string? LotNo { get; set; } |
| | | |
| | | // 订单数量 |
| | | [SugarColumn(ColumnName = "QUANTITY")] |
| | |
| | | } |
| | | |
| | | |
| | | public List<QsItemOqcReq> getPage(XJPageResult queryObj) |
| | | public (List<QsItemOqcReq> items, int TotalCount) getPage(XJPageResult queryObj) |
| | | { |
| | | var db = SqlSugarHelper.GetInstance(); |
| | | |
| | | int totalCount = 0; |
| | | |
| | | 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, |
| | | var qsItemOqcReqs = db |
| | | .Queryable<QsItemOqcReq, MesItems, MesInvItemIns, MesInvTransaction, |
| | | RKJDaa001, Womdaa>( |
| | | (a, b, c, ca, m, da) => new JoinQueryInfos( |
| | | JoinType.Left, a.ItemNo == b.ItemNo, |
| | | 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 |
| | | c.Company == ca.Company && |
| | | c.Factory == ca.Factory, |
| | | JoinType.Left, c.Id == m.ItemInId && a.ItemNo == m.ItemNo, |
| | | JoinType.Left, da.Daa001 == c.RbillNo |
| | | )) |
| | | .Select((a, da, b, c, d, ca, m) => new QsItemOqcReq |
| | | .WhereIF(!string.IsNullOrEmpty(queryObj.id), |
| | | (a, b, c, ca, m, da) => a.Id.ToString() == queryObj.id) |
| | | .WhereIF( |
| | | StringUtil.IsNotNullOrEmpty(queryObj.result) && |
| | | "未完成".Equals(queryObj.result), |
| | | (a, b, c, ca, m, da) => a.FcheckResu == null) |
| | | .WhereIF( |
| | | StringUtil.IsNotNullOrEmpty(queryObj.result) && |
| | | !"未完成".Equals(queryObj.result), |
| | | (a, b, c, ca, m, da) => a.FcheckResu != null) |
| | | .Select((a, b, c, ca, m, da) => new QsItemOqcReq |
| | | { |
| | | BillNo = a.BillNo, |
| | | Remarks = a.Remarks, |
| | |
| | | FcheckBy = a.FcheckBy, |
| | | FcheckDate = a.FcheckDate, |
| | | ReleaseNo = a.ReleaseNo, |
| | | // 添加其他字段 |
| | | // 如果在 QsItemOqcReq 中定义了额外字段,则需要将它们赋值 |
| | | // 例如: |
| | | ItemName = b.ItemName, |
| | | ItemModel = b.ItemModel, |
| | | TaskNo = c.TaskNo, |
| | | CbillNo = c.CbillNo, |
| | | Dab001 = d.Dab001, |
| | | Dab001 = m.LotNo, |
| | | Daa015 = da.Daa015, |
| | | LineNo = c.LineNo, |
| | | Quantity = m.Quantity |
| | | }).OrderBy(a => a.CreateDate, OrderByType.Desc) |
| | | .ToPageList(queryObj.PageIndex, queryObj.Limit); |
| | | }) |
| | | .OrderBy(a => a.CreateDate, OrderByType.Desc) |
| | | .ToPageList(queryObj.PageIndex, queryObj.Limit,ref totalCount); |
| | | |
| | | return (qsItemOqcReqs, totalCount); |
| | | } |
| | | |
| | | //删除主表并且连级删除子表和孙表 |
| | |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | var tbBillList = |
| | | new RKJService().getPage(queryObj); |
| | | var (items, totalCount) = new RKJService().getPage(queryObj); |
| | | var tbBillList =items; |
| | | resultInfos.tbBillList = tbBillList; |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | data = resultInfos, |
| | | TotalCount = totalCount |
| | | }; |
| | | } |
| | | catch (Exception ex) |