| | |
| | | using MES.Service.Modes; |
| | | using MES.Service.util; |
| | | using SqlSugar; |
| | | using static Microsoft.EntityFrameworkCore.DbLoggerCategory; |
| | | |
| | | namespace MES.Service.service.QC; |
| | | |
| | |
| | | { |
| | | Id = a.Id, |
| | | Daa001 = a.Daa001, |
| | | Daa003 = a.Daa003 |
| | | Daa003 = a.Daa003, |
| | | Daa008 = a.Daa008 |
| | | }).ToList(); |
| | | } |
| | | |
| | |
| | | .Select<MesItems>((a, b) => |
| | | new MesItems |
| | | { |
| | | Id = b.Id, |
| | | ItemNo = b.ItemNo, |
| | | ItemName = b.ItemName |
| | | ItemName = b.ItemName, |
| | | ItemModel = b.ItemModel |
| | | }).ToList(); |
| | | } |
| | | |
| | | public List<QsQaItemXj> getPage(XJPageResult queryObj) |
| | | public (List<QsQaItemXj> items, int totalCount) getPage(XJPageResult queryObj) |
| | | { |
| | | var db = SqlSugarHelper.GetInstance(); |
| | | |
| | |
| | | |
| | | string[]? lineNo = null; |
| | | |
| | | if (StringUtil.IsNotNullOrEmpty(queryObj.createUser)) |
| | | lineNo = _baseService.getUserLineNo(queryObj.createUser); |
| | | //if (StringUtil.IsNotNullOrEmpty(queryObj.createUser)) |
| | | // lineNo = _baseService.getUserLineNo(queryObj.createUser); |
| | | |
| | | return db |
| | | var query= db |
| | | .Queryable<QsQaItemXj, Womdaa, MesLine, |
| | | MesItems>((s, a, c, b) => |
| | | new JoinQueryInfos( |
| | | JoinType.Inner, s.BillNo == a.Daa001, |
| | | JoinType.Left, a.Daa015 == c.LineNo, |
| | | JoinType.Left, s.ItemNo == b.ItemNo |
| | | JoinType.Left, s.ItemId == b.Id |
| | | ) |
| | | ) |
| | | .WhereIF(lineNo != null && lineNo.Length > 0, |
| | | (s, a, c, b) => lineNo.Contains(c.LineNo)) |
| | | //.WhereIF(lineNo != null && lineNo.Length > 0, |
| | | // (s, a, c, b) => lineNo.Contains(c.LineNo)) |
| | | .WhereIF( |
| | | StringUtil.IsNotNullOrEmpty(queryObj.result) && |
| | | "未完成".Equals(queryObj.result), |
| | |
| | | .WhereIF(id > 0, (s, a, c, b) => s.Id == id) |
| | | .Select((s, a, c, b) => new QsQaItemXj |
| | | { |
| | | MoidNum = s.MoidNum, |
| | | Daa020 = c.LineNo, |
| | | Id = s.Id, |
| | | PlanQty = a.Daa008, |
| | | CreateBy = s.CreateBy, |
| | | CreateDate = s.CreateDate, |
| | | ReleaseNo = s.ReleaseNo, |
| | | ItemNo = s.ItemNo, |
| | | ItemUnit = s.ItemUnit, |
| | | BillNo = s.BillNo, |
| | | ItemName = b.ItemName, |
| | | ItemModel = b.ItemModel, |
| | | FcheckBy = s.FcheckBy, |
| | | FcheckResu = s.FcheckResu, |
| | | Remarks = s.Remarks |
| | | }).OrderBy(s => s.CreateDate, OrderByType.Desc) |
| | | .ToPageList(queryObj.PageIndex, queryObj.Limit); |
| | | }).OrderBy(s => s.CreateDate, OrderByType.Desc); |
| | | var totalCount = query.Count(); |
| | | var items = query.ToPageList(queryObj.PageIndex, queryObj.Limit); |
| | | |
| | | return (items, totalCount); |
| | | } |
| | | |
| | | |