using System; using System.Collections.Generic; using System.Linq; using System.Text; using Model.ModelDto.BllSoDto; using SqlSugar; using WMS.DAL; using WMS.Entity.BllSoEntity; using WMS.Entity.Context; using WMS.Entity.SysEntity; using WMS.IBLL.IBllSoServer; namespace WMS.BLL.BllSoServer { public class CompleteDetailServer : DbHelper, ICompleteDetailServer { private static readonly SqlSugarScope Db = DataContext.Db; public CompleteDetailServer() : base(Db) { } //查询拣货明细信息 public List GetCompleteDetailList(int id, int page, int limit, out int count) { try { var total = 0; var data = GetAllWhereAsync(m => m.ExportAllotId == id) .LeftJoin((a, b) => a.CreateUser == b.Id) .LeftJoin((a, b, c) => a.CreateUser == c.Id) .Select((a, b, c) => new CompleteDetailDto() { Id = a.Id, SONo = a.SONo, SODetailNo = a.SODetailNo, StockId = a.StockId, ExportAllotId = a.ExportAllotId, BoxNo = a.BoxNo, BoxNo2 = a.BoxNo2, BoxNo3 = a.BoxNo3, LotNo = a.LotNo, LotText = a.LotText, SupplierLot = a.SupplierLot, SkuNo = a.SkuNo, SkuName = a.SkuName, Standard = a.Standard, PalletNo = a.PalletNo, CompleteQty = a.CompleteQty, NowPalletNo = a.NowPalletNo, CreateUserName = b.RealName, UpdateUserName = c.RealName, CreateTime = a.CreateTime, UpdateTime = a.UpdateTime }) .ToOffsetPage(page, limit, ref total); count = total; return data; } catch (Exception e) { throw new Exception(e.Message); } } } }