diff --git a/shangjian/.vs/BL/v17/.suo b/shangjian/.vs/BL/v17/.suo index 814a495..d45fbda 100644 Binary files a/shangjian/.vs/BL/v17/.suo and b/shangjian/.vs/BL/v17/.suo differ diff --git a/shangjian/CentralControl/bin/Debug/CentralControl.exe b/shangjian/CentralControl/bin/Debug/CentralControl.exe index 789ef5b..edfe7c6 100644 Binary files a/shangjian/CentralControl/bin/Debug/CentralControl.exe and b/shangjian/CentralControl/bin/Debug/CentralControl.exe differ diff --git a/shangjian/CentralControl/bin/Debug/CentralControl.pdb b/shangjian/CentralControl/bin/Debug/CentralControl.pdb index 5f41c34..65ce62f 100644 Binary files a/shangjian/CentralControl/bin/Debug/CentralControl.pdb and b/shangjian/CentralControl/bin/Debug/CentralControl.pdb differ diff --git a/shangjian/CentralControl/bin/Debug/XGL.Data.dll b/shangjian/CentralControl/bin/Debug/XGL.Data.dll index 2bac640..2fedc1a 100644 Binary files a/shangjian/CentralControl/bin/Debug/XGL.Data.dll and b/shangjian/CentralControl/bin/Debug/XGL.Data.dll differ diff --git a/shangjian/CentralControl/bin/Debug/XGL.Data.pdb b/shangjian/CentralControl/bin/Debug/XGL.Data.pdb index c03e316..79401db 100644 Binary files a/shangjian/CentralControl/bin/Debug/XGL.Data.pdb and b/shangjian/CentralControl/bin/Debug/XGL.Data.pdb differ diff --git a/shangjian/CentralControl/obj/Debug/CentralControl.csproj.AssemblyReference.cache b/shangjian/CentralControl/obj/Debug/CentralControl.csproj.AssemblyReference.cache index 1ff2256..eec3e1e 100644 Binary files a/shangjian/CentralControl/obj/Debug/CentralControl.csproj.AssemblyReference.cache and b/shangjian/CentralControl/obj/Debug/CentralControl.csproj.AssemblyReference.cache differ diff --git a/shangjian/CentralControl/obj/Debug/CentralControl.exe b/shangjian/CentralControl/obj/Debug/CentralControl.exe index 789ef5b..edfe7c6 100644 Binary files a/shangjian/CentralControl/obj/Debug/CentralControl.exe and b/shangjian/CentralControl/obj/Debug/CentralControl.exe differ diff --git a/shangjian/CentralControl/obj/Debug/CentralControl.pdb b/shangjian/CentralControl/obj/Debug/CentralControl.pdb index 5f41c34..65ce62f 100644 Binary files a/shangjian/CentralControl/obj/Debug/CentralControl.pdb and b/shangjian/CentralControl/obj/Debug/CentralControl.pdb differ diff --git a/shangjian/XGL.Data/DBService/DBService.cs b/shangjian/XGL.Data/DBService/DBService.cs index 5a0be08..97f2848 100644 --- a/shangjian/XGL.Data/DBService/DBService.cs +++ b/shangjian/XGL.Data/DBService/DBService.cs @@ -652,7 +652,7 @@ wetDetail.product_name,wet.shift_desc,prod_line_code,workorder.status,sync_flag from pro_wet_material_plan wet LEFT JOIN pro_wet_material_plan_detail wetDetail on wet.id = wetDetail.wet_material_plan_id -left join pro_order_workorder workorder on workorder.workorder_id = wetDetail.workorder_id where 1=1 and workorder.status = 'w1' +left join pro_order_workorder workorder on workorder.workorder_id = wetDetail.workorder_id where 1=1 and workorder.status = 'w1' and workorder.end_flag = '1' and CONVERT(VARCHAR(10), wet.plan_time , 120)= CONVERT(VARCHAR(10), GetDate() , 120) "; //where CONVERT(VARCHAR(10), wet.plan_time , 120)= CONVERT(VARCHAR(10), GetDate() , 120) DataSet dtset = Utils.netClientDBHelper.getDataSet(sql); if (dtset != null && dtset.Tables.Count > 0 && dtset.Tables[0].Rows.Count > 0) @@ -662,6 +662,27 @@ left join pro_order_workorder workorder on workorder.workorder_id = wetDetail.wo return null; } + /// + /// 查询工艺 + /// + /// + public DataTable GetFlowInfo(string workorderno) + { + string sql = $@"SELECT process_code,process_name,order_num,next_process_code,next_process_name,color_code,workorder.workorder_code + FROM [dbo].[pro_route_process] process +LEFT JOIN pro_route route on process.route_id = route.route_id +LEFT JOIN pro_order_workorder workorder on route.route_code = workorder.route_code +where workorder_code = '{workorderno}' +order by order_num"; //where CONVERT(VARCHAR(10), wet.plan_time , 120)= CONVERT(VARCHAR(10), GetDate() , 120) + DataSet dtset = Utils.netClientDBHelper.getDataSet(sql); + if (dtset != null && dtset.Tables.Count > 0 && dtset.Tables[0].Rows.Count > 0) + { + return dtset.Tables[0]; + } + return null; + } + + /// /// 获取工单是否齐套 /// diff --git a/shangjian/XGL.Data/bin/x86/Debug/XGL.Data.dll b/shangjian/XGL.Data/bin/x86/Debug/XGL.Data.dll index 2bac640..2fedc1a 100644 Binary files a/shangjian/XGL.Data/bin/x86/Debug/XGL.Data.dll and b/shangjian/XGL.Data/bin/x86/Debug/XGL.Data.dll differ diff --git a/shangjian/XGL.Data/bin/x86/Debug/XGL.Data.pdb b/shangjian/XGL.Data/bin/x86/Debug/XGL.Data.pdb index c03e316..79401db 100644 Binary files a/shangjian/XGL.Data/bin/x86/Debug/XGL.Data.pdb and b/shangjian/XGL.Data/bin/x86/Debug/XGL.Data.pdb differ diff --git a/shangjian/XGL.Data/obj/x86/Debug/XGL.Data.dll b/shangjian/XGL.Data/obj/x86/Debug/XGL.Data.dll index 2bac640..2fedc1a 100644 Binary files a/shangjian/XGL.Data/obj/x86/Debug/XGL.Data.dll and b/shangjian/XGL.Data/obj/x86/Debug/XGL.Data.dll differ diff --git a/shangjian/XGL.Data/obj/x86/Debug/XGL.Data.pdb b/shangjian/XGL.Data/obj/x86/Debug/XGL.Data.pdb index c03e316..79401db 100644 Binary files a/shangjian/XGL.Data/obj/x86/Debug/XGL.Data.pdb and b/shangjian/XGL.Data/obj/x86/Debug/XGL.Data.pdb differ diff --git a/shangjian/XGL/App.config b/shangjian/XGL/App.config index 290378f..63cb808 100644 --- a/shangjian/XGL/App.config +++ b/shangjian/XGL/App.config @@ -12,7 +12,7 @@ - + @@ -23,7 +23,7 @@ - + diff --git a/shangjian/XGL/FormItem/Main.xaml.cs b/shangjian/XGL/FormItem/Main.xaml.cs index be16ebc..6ab0f25 100644 --- a/shangjian/XGL/FormItem/Main.xaml.cs +++ b/shangjian/XGL/FormItem/Main.xaml.cs @@ -30,9 +30,7 @@ namespace XGL.FormItem public static Main main; Frame frame1 = new Frame() { Content = new Views.LanJu_Index()}; Timer timer = new Timer(); - LanJu_Prepare prepare = new LanJu_Prepare(); - LanJu_Operator op = new LanJu_Operator(); - DryingRoomUC dryingRoomUC = new DryingRoomUC(); + System.Threading.Timer Time { get; set; } @@ -84,17 +82,20 @@ namespace XGL.FormItem } private void InitPage() - { + { if (Utils.GetAppSetting("ClientMode").Equals("0")) { + LanJu_Prepare prepare = new LanJu_Prepare(); this.Index.Content = prepare; } else if (Utils.GetAppSetting("ClientMode").Equals("1")) { + LanJu_Operator op = new LanJu_Operator(); this.Index.Content = op; } else { + DryingRoomUC dryingRoomUC = new DryingRoomUC(); this.Index.Content = dryingRoomUC; } } diff --git a/shangjian/XGL/Tools/BtnBackGroundColorConverter.cs b/shangjian/XGL/Tools/BtnBackGroundColorConverter.cs new file mode 100644 index 0000000..c6ffb9b --- /dev/null +++ b/shangjian/XGL/Tools/BtnBackGroundColorConverter.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Data; + +namespace XGL.Tools +{ + public class BtnBackGroundColorConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + int second = 0; + if (value != null) + { + if (value.Equals("正常")) + return Brushes.Green; + else + return Brushes.Red; + } + else + return Brushes.Red; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + return ""; + } + } +} diff --git a/shangjian/XGL/Views/LanJu_Operator.xaml b/shangjian/XGL/Views/LanJu_Operator.xaml index 746f29c..1056a43 100644 --- a/shangjian/XGL/Views/LanJu_Operator.xaml +++ b/shangjian/XGL/Views/LanJu_Operator.xaml @@ -12,6 +12,8 @@ mc:Ignorable="d" Loaded="UCOperator_Loaded"> + + + Background="{Binding RelativeSource={RelativeSource Mode=Self},Path=Content, Converter={StaticResource ButtonContentToBackgroundColorConverter}}" Content="正常" Foreground="White" FontSize="14"> + - { + { DataTable dt = formingMachineService.GetFormingMachineState(deviceCode); - if (dt != null && dt.Rows.Count > 0) - { - - // 在这里更新UI元素 - LbDeviceState.Content = dt.Rows[0][0].ToString() == "1" ? "正常" : "异常"; - - } - }); + if (dt == null) return; + // 使用Dispatcher来在UI线程上更新UI + this.Dispatcher.Invoke( + new Action(() => { LbDeviceState.Content = dt.Rows[0][0].ToString() == "1" ? "正常" : "异常"; } + ), + System.Windows.Threading.DispatcherPriority.Render); + } public void WindowChange(WindowID windowID) diff --git a/shangjian/XGL/Views/LanJu_Prepare.xaml b/shangjian/XGL/Views/LanJu_Prepare.xaml index 9c82f95..0a99f99 100644 --- a/shangjian/XGL/Views/LanJu_Prepare.xaml +++ b/shangjian/XGL/Views/LanJu_Prepare.xaml @@ -202,14 +202,14 @@ Height="30" Margin="25,0,0,0" Background="#4294C6" - Content="查看SOP" /> + Content="查看SOP" Click="SOP_Click"/>