添加烘房小看板

master
zhaojian 2 years ago
parent 2d708bbf14
commit dafa4c5927

@ -11,6 +11,7 @@ using System.Data.SqlClient;
using MySql.Data.MySqlClient;
using CommonFunc.Tools;
using XGL.Models.Model;
namespace CentralControl.DBDAO
{
@ -770,7 +771,42 @@ where route.route_code = '{processid}'"; //where CONVERT(VARCHAR(10), wet.plan_
}
return null;
}
/// <summary>
/// 查询烘房状态
/// </summary>
/// <returns></returns>
public List<BaseEquipmentAttached> GetHFStatusInfo()
{
string sql = $@"SELECT * FROM [dbo].[base_equipment_attached] WHERE (property='dollyNumber' OR property='state') AND device_code LIKE '%H%' ORDER BY device_code";
DataSet dtset = Utils.netClientDBHelper.getDataSet(sql);
if (dtset != null && dtset.Tables.Count > 0 && dtset.Tables[0].Rows.Count > 0)
{
List<BaseEquipmentAttached> result = new List<BaseEquipmentAttached>();
foreach (DataRow row in dtset.Tables[0].Rows)
{
BaseEquipmentAttached model = new BaseEquipmentAttached
{
id = row["id"].ToString(),
device_type = row["device_type"].ToString(),
device_code = row["device_code"].ToString(),
property = row["property"].ToString(),
explain = row["explain"].ToString(),
isvalue = row["isvalue"].ToString(),
last_update_time = row["last_update_time"].ToString()
};
result.Add(model);
}
return result;
}
return null;
}
/// <summary>
/// 查询物料信息
@ -854,11 +890,42 @@ where workorder.workorder_id = '{workOrderNo}'";
/// 获取日志
/// </summary>
/// <returns></returns>
public DataTable GetLogList(string datetime,string key)
public DataTable GetLogList(string datetime,string key,string selectin)
{
if (selectin!="")
{
//根据工单获取成型机
string sql = $@"SELECT Top 2000 * FROM [dbo].[mes_interface_log] where CONVERT(VARCHAR(10), creter_time , 120)= CONVERT(VARCHAR(10), '{datetime}' , 120) and remark like '%{selectin}%' order by creter_time desc ; ";
DataSet dtset = Utils.netClientDBHelper.getDataSet(sql);
if (dtset != null && dtset.Tables.Count > 0 && dtset.Tables[0].Rows.Count > 0)
{
return dtset.Tables[0];
}
}
else
{
//根据工单获取成型机
string sql = $@"SELECT Top 2000 * FROM [dbo].[mes_interface_log] where CONVERT(VARCHAR(10), creter_time , 120)= CONVERT(VARCHAR(10), '{datetime}' , 120) and remark like '%{key}%' order by creter_time desc ; ";
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;
}
/// <summary>
/// 获取类型
/// </summary>
/// <returns></returns>
public DataTable GettypeList()
{
//根据工单获取成型机
string sql = $@"SELECT * FROM [dbo].[mes_interface_log] where CONVERT(VARCHAR(10), creter_time , 120)= CONVERT(VARCHAR(10), '{datetime}' , 120) and remark like '%{key}%' order by creter_time desc ; ";
string sql = $@" SELECT DISTINCT remark FROM[dbo].[mes_interface_log] ";
DataSet dtset = Utils.netClientDBHelper.getDataSet(sql);
if (dtset != null && dtset.Tables.Count > 0 && dtset.Tables[0].Rows.Count > 0)
{
@ -866,6 +933,8 @@ where workorder.workorder_id = '{workOrderNo}'";
}
return null;
}
public DataTable GetPlcValueList(string key,string deviceCode)
{
//根据工单获取成型机

@ -162,7 +162,7 @@ FROM [dbo].[mes_material_transfer_result] res
LEFT JOIN pro_order_workorder ord on res.OrderCode = ord.workorder_id
left JOIN pro_wet_material_plan_detail wet on wet.workorder_id = ord.workorder_id
LEFT JOIN pro_rfid_process_detail rfid on rfid.workorder_code = ord.workorder_code and rfid.rfid = res.rfid
where equipmentCode = '{devicecode}' and work_date = '{workDate}' and ord.workorder_code = '{workOrderCode}' and res.OrderCode is not null ORDER BY plan_time desc; ";
where equipmentCode = '{devicecode}' and work_date = '{workDate}' and ord.workorder_code = '{workOrderCode}' and res.OrderCode is not null ORDER BY update_time desc; ";
DataSet dtset = Utils.netClientDBHelper.getDataSet(sql);
if (dtset != null && dtset.Tables.Count > 0 && dtset.Tables[0].Rows.Count > 0)

@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace XGL.Models.Model
{
public class BaseEquipmentAttached
{
public string id { get; set; }
public string device_type { get; set; }
public string device_code { get; set; }
public string property { get; set; }
public string explain { get; set; }
public string isvalue { get; set; }
public string last_update_time { get; set; }
}
}

@ -126,6 +126,16 @@ namespace XGL.FormItem
{
if (MessageBox.Show("是否确认关闭程序", "提示信息", MessageBoxButton.YesNo, MessageBoxImage.Information) == MessageBoxResult.Yes)
{
try
{
serialHelper.ComOn();
serialHelper.redLightOff();
serialHelper.buzzerOff();
serialHelper.ComOff();
}
catch (Exception ex)
{
}
System.Environment.Exit(System.Environment.ExitCode);
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 961 KiB

@ -27,8 +27,8 @@ namespace XGL.Views
{
FormingMachineService formingMachineService = new FormingMachineService();
string _workOrderCode = "";
string _deviceCode = "";
static string _workOrderCode = "";
static string _deviceCode = "";
public LanJu_InOut()
{

@ -470,8 +470,10 @@ namespace XGL.Views
private void HFPlcvalue_Click(object sender, RoutedEventArgs e)
{
HBLogWin HFPlcWin = new HBLogWin();
HFPlcWin.ShowDialog();
//HBLogWin HFPlcWin = new HBLogWin();
//HFPlcWin.ShowDialog();
HFstatus hFstatus = new HFstatus();
hFstatus.ShowDialog();
}
}
}

@ -353,6 +353,26 @@
Width="*"
Binding="{Binding BatchCode}"
Header="生产批次" />-->
<DataGridTextColumn
Width="80"
Binding="{Binding bucket_code}"
Header="料罐编码" />
<DataGridTextColumn
Width="200"
Binding="{Binding plan_time, StringFormat={}{0:yyyy-MM-dd HH:mm:ss}}"
Header="工单时间" />
<DataGridTextColumn
Width="50"
Binding="{Binding shift_desc}"
Header="班次" />
<DataGridTextColumn
Width="200"
Binding="{Binding material_code}"
Header="产品型号" />
<DataGridTextColumn
Width="150"
Binding="{Binding product_name}"
Header="产品名称" />
<DataGridTextColumn
Width="80"
Binding="{Binding status,Converter={StaticResource MyConverter}}"
@ -367,10 +387,7 @@
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
<DataGridTextColumn
Width="50"
Binding="{Binding shift_desc}"
Header="班次" />
<DataGridTextColumn Visibility="Hidden"
Width="150"
Binding="{Binding workorder_id}"
@ -380,29 +397,17 @@
Width="250"
Binding="{Binding workorder_code}"
Header="订单码" />
<DataGridTextColumn
Width="150"
Binding="{Binding product_name}"
Header="产品名称" />
<DataGridTextColumn
Width="200"
Binding="{Binding material_code}"
Header="产品型号" />
<DataGridTextColumn
Width="80"
Binding="{Binding bucket_code}"
Header="料罐编码" />
<DataGridTextColumn
Width="1350"
Binding="{Binding prod_line_code}"
Header="设备" />
<DataGridTextColumn
Width="200"
Binding="{Binding plan_time, StringFormat={}{0:yyyy-MM-dd HH:mm:ss}}"
Header="工单时间" />
<DataGridTextColumn
Width="250"
Binding="{Binding id}"

@ -58,10 +58,23 @@ namespace XGL.Views
try
{
List<WetMaterialModel> wetList = new List<WetMaterialModel>();
//modelWareHouse = new List<WorkOrder>();
//userDbWareHouse = new DBService();
string date = this.dateStart.SelectedDate.ToString() == "" ? DateTime.Now.ToString() : this.dateStart.SelectedDate.ToString();
string date;
if (this.dateStart.SelectedDate == null || !DateTime.TryParse(this.dateStart.SelectedDate.ToString(), out DateTime selectedDate))
{
// 如果日期无效或未选择日期,则使用当前日期时间
date = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
}
else
{
// 使用已选择的日期,并确保月份和日期部分为两位
date = selectedDate.ToString("yyyy-MM-dd HH:mm:ss");
}
//string date = this.dateStart.SelectedDate.ToString() == "" ? DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") : this.dateStart.SelectedDate.ToString();
dt = userDbWareHouse.GetWetPlanInfo(date);
eqment = userDbWareHouse.GeteqmentInfo();
if (dt == null)

@ -5,7 +5,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:XGL.Views" xmlns:localDate="clr-namespace:XGL.Tools"
mc:Ignorable="d"
Title="ViewLogWin" Loaded="Window_Loaded" WindowStartupLocation="CenterScreen" WindowStyle="None" WindowState="Maximized">
Title="ViewLogWin" Loaded="Window_Loaded" WindowStartupLocation="CenterScreen" WindowStyle="None" WindowState="Maximized" Width="1920" Height="1080">
<Window.Resources>
<SolidColorBrush x:Key="EvenRowBackground" Color="#E0E0E0"/>
<SolidColorBrush x:Key="OddRowBackground" Color="#FFFFFF"/>
@ -79,17 +79,20 @@
Width="150" SelectedDateFormat="Short" IsTodayHighlighted="True">
</localDate:UserDatePicker>
<Label Content="关键字:" VerticalContentAlignment="Center" FontSize="14" Margin="20"></Label>
<TextBox x:Name="txtKey" Width="150" Height="30" FontSize="18" VerticalContentAlignment="Center" KeyDown="txtKey_KeyDown"></TextBox>
<Label Content="通讯内容关键字:" VerticalContentAlignment="Center" FontSize="14" Margin="20"></Label>
<TextBox x:Name="txtKey" Width="150" Height="30" Text="" FontSize="18" VerticalContentAlignment="Center" KeyDown="txtKey_KeyDown"/>
<Button x:Name="btnQueryLog" Content="查询" Foreground="White" Margin="20,0,0,0" FontSize="18" Background="#2B7EE6" Width="100" Height="30" Click="btnQueryLog_Click"/>
<Label Content="备注选择:" VerticalContentAlignment="Center" FontSize="14" Margin="20"></Label>
<ComboBox Name="selebeizhu" Width="150" Height="30" FontSize="18" Margin="20,0,0,0">
</ComboBox>
</StackPanel>
<Button x:Name="btnClose" Content="关闭" Foreground="White" FontSize="18" Background="#2B7EE6" Width="100" Margin="20" Height="30" Click="btnClose_Click" HorizontalAlignment="Right"/>
<DataGrid
x:Name="dgLogInfo"
Grid.Row="1"
ScrollViewer.HorizontalScrollBarVisibility="Visible"
Height="830"
MinHeight="340"
AlternatingRowBackground="{StaticResource OddRowBackground}"
AlternationCount="2"

@ -25,12 +25,25 @@ namespace XGL.Views
public ViewLogWin()
{
InitializeComponent();
listtype();
}
private void Window_Loaded(object sender, RoutedEventArgs e)
{
this.dateStart.SelectedDate = DateTime.Now;
}
public void listtype()
{
DataTable dt = userDbWareHouse.GettypeList();
List<string> strings = new List<string>();
foreach (DataRow row in dt.Rows)
{
string rolis = row["remark"].ToString();
strings.Add(rolis);
}
selebeizhu.ItemsSource = strings;
}
private void dgLogInfo_LoadingRow(object sender, DataGridRowEventArgs e)
@ -46,10 +59,21 @@ namespace XGL.Views
private void GetLogList()
{
string date = dateStart.SelectedDate.ToString();
DataTable dt = userDbWareHouse.GetLogList(date,this.txtKey.Text);
if (dt == null) return;
this.dgLogInfo.ItemsSource = null;
this.dgLogInfo.ItemsSource = dt.DefaultView;
if (selebeizhu.SelectedItem!=null)
{
DataTable dt = userDbWareHouse.GetLogList(date, this.txtKey.Text, selebeizhu.SelectedItem.ToString());
if (dt == null) return;
this.dgLogInfo.ItemsSource = null;
this.dgLogInfo.ItemsSource = dt.DefaultView;
}
else
{
DataTable dt = userDbWareHouse.GetLogList(date, this.txtKey.Text,"");
if (dt == null) return;
this.dgLogInfo.ItemsSource = null;
this.dgLogInfo.ItemsSource = dt.DefaultView;
}
}
private void btnClose_Click(object sender, RoutedEventArgs e)

@ -398,6 +398,9 @@
<DesignTime>True</DesignTime>
<DependentUpon>Reference.map</DependentUpon>
</Compile>
<Compile Include="HFstatus.xaml.cs">
<DependentUpon>HFstatus.xaml</DependentUpon>
</Compile>
<Page Include="CSS\DataGridClass.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
@ -649,6 +652,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="HFstatus.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs">
@ -1055,6 +1062,9 @@
<EmbeddedResource Include="Resources\lanjuLogoNew.ico">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</EmbeddedResource>
<Content Include="Resources\hongfang.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Resources\nitsos.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>

@ -10,6 +10,7 @@
[assembly: System.Windows.Resources.AssemblyAssociatedContentFileAttribute("newmessage.wav")]
[assembly: System.Windows.Resources.AssemblyAssociatedContentFileAttribute("libmupdf.dll")]
[assembly: System.Windows.Resources.AssemblyAssociatedContentFileAttribute("resources/hongfang.png")]
[assembly: System.Windows.Resources.AssemblyAssociatedContentFileAttribute("resources/nitsos.png")]
[assembly: System.Windows.Resources.AssemblyAssociatedContentFileAttribute("snap7.dll")]

@ -10,6 +10,7 @@
[assembly: System.Windows.Resources.AssemblyAssociatedContentFileAttribute("newmessage.wav")]
[assembly: System.Windows.Resources.AssemblyAssociatedContentFileAttribute("libmupdf.dll")]
[assembly: System.Windows.Resources.AssemblyAssociatedContentFileAttribute("resources/hongfang.png")]
[assembly: System.Windows.Resources.AssemblyAssociatedContentFileAttribute("resources/nitsos.png")]
[assembly: System.Windows.Resources.AssemblyAssociatedContentFileAttribute("snap7.dll")]

Loading…
Cancel
Save