|
|
@@ -4757,14 +4757,28 @@ namespace TeamAAS_VP.Core
|
|
|
try
|
|
|
{
|
|
|
//获取当前产品
|
|
|
- CurrentProduct = _productService.GetCurrentProduct();
|
|
|
var currentproduct = _productService.GetCurrentProduct();
|
|
|
if (currentproduct == null) return;
|
|
|
TotalQuantity = await _systemDatabaseService.GetOverallProductionAsync(currentproduct.Name);
|
|
|
- TotalQuantityToday = await _systemDatabaseService.GetTodayProductionAsync(currentproduct.Name);
|
|
|
- CurrentUPH = await _systemDatabaseService.GetLastHourProductionAsync(currentproduct.Name);
|
|
|
- NgNumber = await _systemDatabaseService.GetNGProductionAsync(currentproduct.Name);
|
|
|
- Yield = ((double)TotalQuantityToday - (double)NgNumber) / (double)TotalQuantityToday * 100;
|
|
|
+ //TotalQuantityToday = await _systemDatabaseService.GetTodayProductionAsync(currentproduct.Name);
|
|
|
+ //CurrentUPH = await _systemDatabaseService.GetLastHourProductionAsync(currentproduct.Name);
|
|
|
+ ////
|
|
|
+ //NgNumber = await _systemDatabaseService.GetNGProductionAsync(currentproduct.Name);
|
|
|
+ //Yield = ((double)TotalQuantityToday - (double)NgNumber) / (double)TotalQuantityToday * 100;
|
|
|
+
|
|
|
+ TotalQuantityToday = 0;
|
|
|
+ CurrentUPH = 0;
|
|
|
+ NgNumber = 0;
|
|
|
+ Yield = 0;
|
|
|
+ ObservableCollection<ProductModel> ProductList = new ObservableCollection<ProductModel>(_productService.GetAllProducts());
|
|
|
+ foreach (var product in ProductList)
|
|
|
+ {
|
|
|
+ //TotalQuantity += await _systemDatabaseService.GetOverallProductionAsync(product.Name);
|
|
|
+ TotalQuantityToday += await _systemDatabaseService.GetTodayProductionAsync(product.Name);
|
|
|
+ CurrentUPH += await _systemDatabaseService.GetLastHourProductionAsync(product.Name);
|
|
|
+ NgNumber += await _systemDatabaseService.GetNGProductionAsync(product.Name);
|
|
|
+ Yield += ((double)TotalQuantityToday - (double)NgNumber) / (double)TotalQuantityToday * 100;
|
|
|
+ }
|
|
|
}
|
|
|
catch (Exception)
|
|
|
{
|