工单准备添加时间查询

master
zhaoaomin 2 years ago
parent a4c0387dba
commit 3a5d3cbc8e

Binary file not shown.

@ -644,7 +644,7 @@ select a.TrayCode,a.ProductBarNo,a.carcode,a.createtime,a.lineno,b.HadNumber
return null;
}
public DataTable GetWetPlanInfo()
public DataTable GetWetPlanInfo(string date)
{
//删除湿料计划主表
// string sql = $@"select wet.id,wet.factory_code,wet.prod_code, wetDetail.sync_flag,wet.plan_time,
@ -662,7 +662,7 @@ from pro_wet_material_plan_detail wetDetail
left join pro_order_workorder workorder on workorder.workorder_id = wetDetail.workorder_id
left JOIN base_shifts_t shifts on wetDetail.shift_id = shifts.shift_id
where 1=1 and
workorder.end_flag = '1' and CONVERT(VARCHAR(10), wetDetail.plan_time , 120)= CONVERT(VARCHAR(10), GetDate() , 120)";
workorder.end_flag = '1' and CONVERT(VARCHAR(10), wetDetail.plan_time , 120)= CONVERT(VARCHAR(10), '{date}' , 120)";
DataSet dtset = Utils.netClientDBHelper.getDataSet(sql);
if (dtset != null && dtset.Tables.Count > 0 && dtset.Tables[0].Rows.Count > 0)
{

@ -12,7 +12,7 @@
<!--设备编码-->
<add key="DeviceCode" value="C6" />
<!--上位机类型 0:工单准备1成型机\shoupei2烘房-->
<add key="ClientMode" value="2" />
<add key="ClientMode" value="0" />
<add key="SerialPort" value="COM5" />
<add key="DryingHouseList" value="H1,H2,H3" />

@ -6,7 +6,7 @@
xmlns:local="clr-namespace:XGL.Views"
xmlns:convert="clr-namespace:XGL.Tools"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
Width="1920"
Width="1920" xmlns:localDate="clr-namespace:XGL.Tools"
Height="800"
mc:Ignorable="d" Loaded="UserControl_Loaded">
<UserControl.Resources>
@ -92,6 +92,51 @@
<convert:MyValueConverter x:Key="MyConverter"/>
<convert:SyncFlagConverter x:Key="SyncFlagConverter"/>
<convert:SyncFlagColorConverter x:Key="SyncFlagColorConvert"/>
<!--日历样式-->
<Style TargetType="CalendarDayButton" x:Key="CalendarDayBtnStyle">
<Setter Property="FontSize" Value="18"></Setter>
</Style>
<Style x:Key="calendarWithGotToTodayStyle"
TargetType="{x:Type Calendar}">
<Setter Property="CalendarDayButtonStyle"
Value="{StaticResource CalendarDayBtnStyle}"></Setter>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Calendar}">
<Border>
<StackPanel Orientation="Vertical">
<StackPanel x:Name="PART_Root"
HorizontalAlignment="Center" Background="#FF878787">
<CalendarItem x:Name="PART_CalendarItem"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Background="{TemplateBinding Background}"
Style="{TemplateBinding CalendarItemStyle}"
Height="{TemplateBinding Height}"
/>
<Grid VerticalAlignment="Center" HorizontalAlignment="Center">
<Grid.RowDefinitions>
<RowDefinition Height="30"></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="52"></ColumnDefinition>
<ColumnDefinition Width="26"></ColumnDefinition>
<ColumnDefinition Width="52"></ColumnDefinition>
</Grid.ColumnDefinitions>
<TextBlock x:Name="PART_GoToday"
Width="40" Height="20"
Text="今天" FontSize="18" VerticalAlignment="Center" HorizontalAlignment="Center" TextAlignment="Center" Cursor="Hand" Foreground="#FFFFFFFF" />
<TextBlock Grid.Column="2" x:Name="PART_GoClear"
Width="40" Height="20"
Text="清空" FontSize="18" VerticalAlignment="Center" HorizontalAlignment="Center" TextAlignment="Center" Cursor="Hand" Foreground="#FFFFFFFF" />
</Grid>
</StackPanel>
</StackPanel>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
</UserControl.Resources>
@ -115,18 +160,31 @@
<RowDefinition Height="*" />
<RowDefinition Height="350" />
</Grid.RowDefinitions>
<Label
<StackPanel Orientation="Horizontal" Grid.Row="0" Grid.Column="0" VerticalAlignment="Center">
<Label
Grid.Row="0"
Grid.Column="0"
Width="175"
Height="37"
Margin="26,5,0,0"
HorizontalAlignment="Left">
<TextBlock
<TextBlock
FontSize="22"
FontWeight="Bold"
Text="准备清单" />
</Label>
Text="准备清单" VerticalAlignment="Center"/>
</Label>
<Label Content="请选择日期:" VerticalContentAlignment="Center" FontSize="18" Margin="20" VerticalAlignment="Center"></Label>
<localDate:UserDatePicker x:Name="dateStart" FontSize="18" VerticalAlignment="Center" AlternativeCalendarStyle="{StaticResource calendarWithGotToTodayStyle}"
Width="150" SelectedDateFormat="Short" IsTodayHighlighted="True" VerticalContentAlignment="Center">
</localDate:UserDatePicker>
<Button x:Name="btnRefresh" Content="查询" Grid.Row="0" Margin="20,0,0,0"
Grid.Column="1" Style="{StaticResource CustomButtonStyle}" Click="btnRefresh_Click"></Button>
<!--<Button x:Name="btnQueryLog" Content="查询" Foreground="White" Margin="20,0,0,0" FontSize="18" Background="#2B7EE6" Width="100" Height="30" Click="btnRefresh_Click"/>-->
</StackPanel>
<DataGrid
x:Name="dgMaterialInfo"
@ -216,8 +274,8 @@
</Label>
</StackPanel>
<Button x:Name="btnRefresh" Content="刷新" Grid.Row="0"
Grid.Column="1" Style="{StaticResource CustomButtonStyle}" Click="btnRefresh_Click"></Button>
<!--<Button x:Name="btnRefresh" Content="刷新" Grid.Row="0"
Grid.Column="1" Style="{StaticResource CustomButtonStyle}" Click="btnRefresh_Click"></Button>-->
<!--<ScrollViewer
HorizontalScrollBarVisibility="Auto"

@ -58,7 +58,9 @@ namespace XGL.Views
List<WetMaterialModel> wetList = new List<WetMaterialModel>();
//modelWareHouse = new List<WorkOrder>();
//userDbWareHouse = new DBService();
dt = userDbWareHouse.GetWetPlanInfo();
string date = this.dateStart.SelectedDate.ToString() == "" ? DateTime.Now.ToString() : this.dateStart.SelectedDate.ToString();
dt = userDbWareHouse.GetWetPlanInfo(date);
if (dt == null) return;
foreach (DataRow i in dt.Rows)
{
@ -118,6 +120,7 @@ namespace XGL.Views
private void UserControl_Loaded(object sender, RoutedEventArgs e)
{
this.dateStart.SelectedDate = DateTime.Now;
timerDeciveState.Interval = Utils.GetAppSetting("GetDeviceStateInterval") == "" ? 15000 : Convert.ToInt32(Utils.GetAppSetting("GetDeviceStateInterval"));
timerDeciveState.Elapsed += TimerDeciveState_Elapsed;
timerDeciveState.Start();
@ -131,7 +134,8 @@ namespace XGL.Views
List<WetMaterialModel> wetList = new List<WetMaterialModel>();
//modelWareHouse = new List<WorkOrder>();
//userDbWareHouse = new DBService();
dt = userDbWareHouse.GetWetPlanInfo();
string date = this.dateStart.SelectedDate.ToString() == "" ? DateTime.Now.ToString() : this.dateStart.SelectedDate.ToString();
dt = userDbWareHouse.GetWetPlanInfo(date);
if (dt == null) return;
foreach (DataRow i in dt.Rows)
{

@ -1,4 +1,4 @@
#pragma checksum "..\..\..\..\Views\LanJu_Prepare.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "0210A0C880B62CA918F0740CDFF9441166FD363DD377C446AAFEAAB7DF78D62E"
#pragma checksum "..\..\..\..\Views\LanJu_Prepare.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "1C0BC9A7FBDE1671E4BC7571F9962475849FCB458A5548986D8AF4B1BBB2BC92"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
@ -43,15 +43,15 @@ namespace XGL.Views {
public partial class LanJu_Prepare : System.Windows.Controls.UserControl, System.Windows.Markup.IComponentConnector, System.Windows.Markup.IStyleConnector {
#line 132 "..\..\..\..\Views\LanJu_Prepare.xaml"
#line 179 "..\..\..\..\Views\LanJu_Prepare.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.DataGrid dgMaterialInfo;
internal XGL.Tools.UserDatePicker dateStart;
#line default
#line hidden
#line 219 "..\..\..\..\Views\LanJu_Prepare.xaml"
#line 183 "..\..\..\..\Views\LanJu_Prepare.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button btnRefresh;
@ -59,7 +59,15 @@ namespace XGL.Views {
#line hidden
#line 228 "..\..\..\..\Views\LanJu_Prepare.xaml"
#line 190 "..\..\..\..\Views\LanJu_Prepare.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.DataGrid dgMaterialInfo;
#line default
#line hidden
#line 286 "..\..\..\..\Views\LanJu_Prepare.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.DataGrid WorkOrder;
@ -87,6 +95,13 @@ namespace XGL.Views {
#line hidden
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal System.Delegate _CreateDelegate(System.Type delegateType, string handler) {
return System.Delegate.CreateDelegate(delegateType, this, handler);
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
@ -105,41 +120,44 @@ namespace XGL.Views {
#line hidden
return;
case 2:
this.dgMaterialInfo = ((System.Windows.Controls.DataGrid)(target));
#line 139 "..\..\..\..\Views\LanJu_Prepare.xaml"
this.dgMaterialInfo.LoadingRow += new System.EventHandler<System.Windows.Controls.DataGridRowEventArgs>(this.dgMaterialInfo_LoadingRow);
#line default
#line hidden
this.dateStart = ((XGL.Tools.UserDatePicker)(target));
return;
case 3:
#line 181 "..\..\..\..\Views\LanJu_Prepare.xaml"
((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.btnStartOrders_Click);
#line default
#line hidden
return;
case 4:
this.btnRefresh = ((System.Windows.Controls.Button)(target));
#line 220 "..\..\..\..\Views\LanJu_Prepare.xaml"
#line 184 "..\..\..\..\Views\LanJu_Prepare.xaml"
this.btnRefresh.Click += new System.Windows.RoutedEventHandler(this.btnRefresh_Click);
#line default
#line hidden
return;
case 4:
this.dgMaterialInfo = ((System.Windows.Controls.DataGrid)(target));
#line 197 "..\..\..\..\Views\LanJu_Prepare.xaml"
this.dgMaterialInfo.LoadingRow += new System.EventHandler<System.Windows.Controls.DataGridRowEventArgs>(this.dgMaterialInfo_LoadingRow);
#line default
#line hidden
return;
case 5:
this.WorkOrder = ((System.Windows.Controls.DataGrid)(target));
#line 239 "..\..\..\..\Views\LanJu_Prepare.xaml"
((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.btnStartOrders_Click);
#line default
#line hidden
return;
case 6:
this.WorkOrder = ((System.Windows.Controls.DataGrid)(target));
#line 297 "..\..\..\..\Views\LanJu_Prepare.xaml"
this.WorkOrder.LoadingRow += new System.EventHandler<System.Windows.Controls.DataGridRowEventArgs>(this.USERLIST_LoadingRow);
#line default
#line hidden
#line 242 "..\..\..\..\Views\LanJu_Prepare.xaml"
#line 300 "..\..\..\..\Views\LanJu_Prepare.xaml"
this.WorkOrder.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.WorkOrder_SelectionChanged);
#line default
@ -158,25 +176,25 @@ namespace XGL.Views {
void System.Windows.Markup.IStyleConnector.Connect(int connectionId, object target) {
switch (connectionId)
{
case 6:
#line 353 "..\..\..\..\Views\LanJu_Prepare.xaml"
((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Flow_Click);
#line default
#line hidden
break;
case 7:
#line 360 "..\..\..\..\Views\LanJu_Prepare.xaml"
((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.SOP_Click);
#line 411 "..\..\..\..\Views\LanJu_Prepare.xaml"
((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Flow_Click);
#line default
#line hidden
break;
case 8:
#line 367 "..\..\..\..\Views\LanJu_Prepare.xaml"
#line 418 "..\..\..\..\Views\LanJu_Prepare.xaml"
((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.SOP_Click);
#line default
#line hidden
break;
case 9:
#line 425 "..\..\..\..\Views\LanJu_Prepare.xaml"
((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Material_Click);
#line default

@ -1,4 +1,4 @@
#pragma checksum "..\..\..\..\Views\LanJu_Prepare.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "0210A0C880B62CA918F0740CDFF9441166FD363DD377C446AAFEAAB7DF78D62E"
#pragma checksum "..\..\..\..\Views\LanJu_Prepare.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "1C0BC9A7FBDE1671E4BC7571F9962475849FCB458A5548986D8AF4B1BBB2BC92"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
@ -43,15 +43,15 @@ namespace XGL.Views {
public partial class LanJu_Prepare : System.Windows.Controls.UserControl, System.Windows.Markup.IComponentConnector, System.Windows.Markup.IStyleConnector {
#line 132 "..\..\..\..\Views\LanJu_Prepare.xaml"
#line 179 "..\..\..\..\Views\LanJu_Prepare.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.DataGrid dgMaterialInfo;
internal XGL.Tools.UserDatePicker dateStart;
#line default
#line hidden
#line 219 "..\..\..\..\Views\LanJu_Prepare.xaml"
#line 183 "..\..\..\..\Views\LanJu_Prepare.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button btnRefresh;
@ -59,7 +59,15 @@ namespace XGL.Views {
#line hidden
#line 228 "..\..\..\..\Views\LanJu_Prepare.xaml"
#line 190 "..\..\..\..\Views\LanJu_Prepare.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.DataGrid dgMaterialInfo;
#line default
#line hidden
#line 286 "..\..\..\..\Views\LanJu_Prepare.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.DataGrid WorkOrder;
@ -87,6 +95,13 @@ namespace XGL.Views {
#line hidden
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal System.Delegate _CreateDelegate(System.Type delegateType, string handler) {
return System.Delegate.CreateDelegate(delegateType, this, handler);
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
@ -105,41 +120,44 @@ namespace XGL.Views {
#line hidden
return;
case 2:
this.dgMaterialInfo = ((System.Windows.Controls.DataGrid)(target));
#line 139 "..\..\..\..\Views\LanJu_Prepare.xaml"
this.dgMaterialInfo.LoadingRow += new System.EventHandler<System.Windows.Controls.DataGridRowEventArgs>(this.dgMaterialInfo_LoadingRow);
#line default
#line hidden
this.dateStart = ((XGL.Tools.UserDatePicker)(target));
return;
case 3:
#line 181 "..\..\..\..\Views\LanJu_Prepare.xaml"
((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.btnStartOrders_Click);
#line default
#line hidden
return;
case 4:
this.btnRefresh = ((System.Windows.Controls.Button)(target));
#line 220 "..\..\..\..\Views\LanJu_Prepare.xaml"
#line 184 "..\..\..\..\Views\LanJu_Prepare.xaml"
this.btnRefresh.Click += new System.Windows.RoutedEventHandler(this.btnRefresh_Click);
#line default
#line hidden
return;
case 4:
this.dgMaterialInfo = ((System.Windows.Controls.DataGrid)(target));
#line 197 "..\..\..\..\Views\LanJu_Prepare.xaml"
this.dgMaterialInfo.LoadingRow += new System.EventHandler<System.Windows.Controls.DataGridRowEventArgs>(this.dgMaterialInfo_LoadingRow);
#line default
#line hidden
return;
case 5:
this.WorkOrder = ((System.Windows.Controls.DataGrid)(target));
#line 239 "..\..\..\..\Views\LanJu_Prepare.xaml"
((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.btnStartOrders_Click);
#line default
#line hidden
return;
case 6:
this.WorkOrder = ((System.Windows.Controls.DataGrid)(target));
#line 297 "..\..\..\..\Views\LanJu_Prepare.xaml"
this.WorkOrder.LoadingRow += new System.EventHandler<System.Windows.Controls.DataGridRowEventArgs>(this.USERLIST_LoadingRow);
#line default
#line hidden
#line 242 "..\..\..\..\Views\LanJu_Prepare.xaml"
#line 300 "..\..\..\..\Views\LanJu_Prepare.xaml"
this.WorkOrder.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.WorkOrder_SelectionChanged);
#line default
@ -158,25 +176,25 @@ namespace XGL.Views {
void System.Windows.Markup.IStyleConnector.Connect(int connectionId, object target) {
switch (connectionId)
{
case 6:
#line 353 "..\..\..\..\Views\LanJu_Prepare.xaml"
((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Flow_Click);
#line default
#line hidden
break;
case 7:
#line 360 "..\..\..\..\Views\LanJu_Prepare.xaml"
((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.SOP_Click);
#line 411 "..\..\..\..\Views\LanJu_Prepare.xaml"
((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Flow_Click);
#line default
#line hidden
break;
case 8:
#line 367 "..\..\..\..\Views\LanJu_Prepare.xaml"
#line 418 "..\..\..\..\Views\LanJu_Prepare.xaml"
((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.SOP_Click);
#line default
#line hidden
break;
case 9:
#line 425 "..\..\..\..\Views\LanJu_Prepare.xaml"
((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Material_Click);
#line default

Loading…
Cancel
Save