| | |
| | | } |
| | | var packageList = await _mesPackageGatherRep.AsQueryable().Where(x => x.Info5 == singlePackage.Info5).ToListAsync(); |
| | | order.PackageNum = packageList.Count(); |
| | | order.UnLinePackageNum = packageList.Where(x => x.UpiStatus == UpiStatusEnum.已下线).Count() + 1; |
| | | //计算已下线数 |
| | | var xiaList = packageList.Where(x => x.UpiStatus == UpiStatusEnum.已下线).ToList(); |
| | | order.UnLinePackageNum = xiaList.Count(); |
| | | if (xiaList.Select(x => x.PackageCode).ToList().Contains(singlePackage.PackageCode) == false) |
| | | { |
| | | order.UnLinePackageNum += 1; |
| | | } |
| | | if (order.UnLinePackageNum > order.PackageNum) |
| | | { |
| | | order.UnLinePackageNum = order.PackageNum; |
| | | } |
| | | order.NgPackageNum = packageList.Where(x => x.UpiStatus == UpiStatusEnum.已下线 && x.UpiFlag == UpiFlagEnum.NG).Count(); |
| | | var ng_xiaList = packageList.Where(x => x.UpiStatus == UpiStatusEnum.已下线 && x.UpiFlag == UpiFlagEnum.NG).ToList(); |
| | | order.NgPackageNum = ng_xiaList.Count(); |
| | | if (isNG) |
| | | { |
| | | order.NgPackageNum = order.NgPackageNum + 1; |
| | | if (ng_xiaList.Select(x => x.PackageCode).ToList().Contains(singlePackage.PackageCode) == false) |
| | | { |
| | | order.NgPackageNum += 1; |
| | | } |
| | | } |
| | | if (order.NgPackageNum > order.PackageNum) |
| | | { |
| | |
| | | order.NoUnLinePackageNum = order.PackageNum - order.UnLinePackageNum; |
| | | |
| | | order.AllPackageArea = packageList.Sum(x => Convert.ToDecimal(x.Info13)); |
| | | order.ScanPackageArea = packageList.Where(x => x.UpiStatus == UpiStatusEnum.已下线 && x.UpiFlag == (int)UpiFlagEnum.正常).Sum(x => Convert.ToDecimal(x.Info13)); |
| | | if (isNG == false) |
| | | var scan_list = packageList.Where(x => x.UpiStatus == UpiStatusEnum.已下线 && x.UpiFlag == (int)UpiFlagEnum.正常).ToList(); |
| | | order.ScanPackageArea = scan_list.Sum(x => Convert.ToDecimal(x.Info13)); |
| | | //if (isNG == false) |
| | | //{ |
| | | if (scan_list.Select(x => x.PackageCode).ToList().Contains(singlePackage.PackageCode) == false) |
| | | { |
| | | order.ScanPackageArea = order.ScanPackageArea + Convert.ToDecimal(singlePackage.Info13); |
| | | order.ScanPackageArea += Convert.ToDecimal(singlePackage.Info13); |
| | | } |
| | | //} |
| | | if (order.ScanPackageArea > order.AllPackageArea) |
| | | { |
| | | order.ScanPackageArea = order.AllPackageArea; |
| | | } |
| | | |
| | | order.NoScanPackageArea = order.AllPackageArea - order.ScanPackageArea; |