Commit 51eee7d0 authored by health's avatar health

增加班组列

parent ee534964
......@@ -92,14 +92,16 @@ namespace WSDDBBrowser.Core
DataSet dataset = new DataSet();
var connection = dBModel.Database.Connection as SqlConnection;
string njb = stepNo == null ? "null" : stepNo.ToString();
string njt = machineNo == null ? "null" : machineNo.ToString();
var command = connection.CreateCommand();
connection.Open();
command.CommandText =
$"exec g_found_iserr " +
$"@ddbh = '{orderNo}'," +
$"@njb = {stepNo}," +
$"@njt = {machineNo}," +
$"@njb = {njb}," +
$"@njt = {njt}," +
$"@timestar = '{starttime:yyyy-MM-dd}'," +
$"@timestop = '{endtime:yyyy-MM-dd}'," +
$"@iserr = {(isJustSearchError ? 1 : 0)}," +
......@@ -152,6 +154,7 @@ namespace WSDDBBrowser.Core
techInfo.Tolerance = Convert.ToDouble(row["nTolerance"]);
techInfo.Avg = Convert.ToDouble(row["nAvg"]);
techInfo.IsError = Convert.ToInt32(row["bIsError"])==1;
techInfo.userName = (row["cUserName"] as string).Trim();
techInfos.Add(techInfo);
}
}
......@@ -306,6 +309,7 @@ namespace WSDDBBrowser.Core
techInfo.Tolerance = 5;
techInfo.Avg = r.NextDouble() * 10 - 5 + techInfo.Target;
techInfo.IsError = Math.Abs(techInfo.Target - techInfo.Avg) > techInfo.Tolerance;
techInfo.userName = i.ToString("00");
techInfos.Add(techInfo);
}
for (int i = 0; i < 5; i++)
......@@ -318,6 +322,7 @@ namespace WSDDBBrowser.Core
techInfo.Tolerance = 5;
techInfo.Avg = r.NextDouble() * 10 - 5 + techInfo.Target;
techInfo.IsError = Math.Abs(techInfo.Target - techInfo.Avg) > techInfo.Tolerance;
techInfo.userName = i.ToString("00");
techInfos.Add(techInfo);
}
......@@ -528,6 +533,7 @@ namespace WSDDBBrowser.Core
public double Tolerance { get; set; }
public double Avg { get; set; }
public bool IsError { get; set; }
public string userName { get; set; }
}
}
......@@ -46,7 +46,7 @@
<StackPanel Orientation="Vertical" Margin="{StaticResource ControlMargin}">
<TextBlock Style="{StaticResource TitleStyle}" Text="工序号"/>
<TextBox Style="{StaticResource ValueStyle}" Text="{Binding StepNo}"/>
<TextBox Style="{StaticResource ValueStyle}" Text="{Binding StepNo, Converter={StaticResource intNullConv}}"/>
</StackPanel>
<StackPanel Orientation="Vertical" Margin="{StaticResource ControlMargin}">
<TextBlock Style="{StaticResource TitleStyle}" Text="机台号"/>
......
......@@ -153,6 +153,13 @@ namespace WSDDBBrowser
private async void Search()
{
if(StepNo == null)
{
await App.MetroWindow.ShowMessageAsync("参数异常", $"工序号为空");
return;
}
//开始加载
var controller = await App.MetroWindow.ShowProgressAsync("请等待...", "开始查找数据",
settings: new MetroDialogSettings()
......
......@@ -28,7 +28,7 @@
<DataGridTextColumn Binding="{Binding Target,StringFormat={}{0:F1}}" Header="目标值"/>
<DataGridTextColumn Binding="{Binding Tolerance,StringFormat={}{0:F1}}" Header="公差"/>
<DataGridTextColumn Binding="{Binding Avg,StringFormat={}{0:F1}}" Header="平均值"/>
<DataGridTextColumn Binding="{Binding userName}" Header="班组"/>
</DataGrid.Columns>
</DataGrid>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,20" Grid.Row="1">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment