protected new PackingLog NewPackingLog(LatticeSetting lattice, UserInfo userInfo, int operationType, List <LatticeOrdersCache> logList, decimal boxWeight) { string PackNumber = API_Helper.GetFlytPackageLabelIDBySingleFlyt(); var pkgLog = new PackingLog() { ID = Guid.NewGuid().ToString(), PackNumber = PackNumber, CabinetId = "", LatticeId = "", OrderIds = string.Join(",", logList.Select(l => l.OrderId)), OrderQty = logList.Count, Weight = boxWeight + logList.Sum(o => o.Weight), OperationType = operationType, OperationTime = DateTime.Now, UserId = userInfo.UserId, UserName = userInfo.UserName }; if (lattice != null) { pkgLog.CabinetId = lattice.CabinetId.ToString(); pkgLog.LatticeId = lattice.LatticeId; } pkgLog.PostTypeIds = string.Join(",", logList.Select(l => l.PostId).Distinct()); var postTypeNames = logList.Select(l => l.PostName).Distinct(); pkgLog.PostTypeNames = postTypeNames.Count() > 2 ? "MIX" : string.Join(",", postTypeNames); pkgLog.CountryIds = string.Join(",", logList.Select(s => s.CountryId).Distinct()); var countryNames = logList.Select(s => s.CountryName).Distinct(); pkgLog.CountryNames = countryNames.Count() > 2 ? "MIX" : string.Join(",", countryNames); return(pkgLog); }