master
zhaoaomin 2 years ago
parent 11da21ae79
commit 23b137dd29

16
.gitignore vendored

@ -7,3 +7,19 @@ shangjian/XGL.Data/obj/
shangjian/XGL.Data/bin/
shangjian/XGLFinishPro/obj/
shangjian/XGLFinishPro/bin/
shangjian/CentralControl/bin/x86/Debug/BCrypt.Net-Next.dll
shangjian/CentralControl/bin/x86/Debug/BCrypt.Net-Next.xml
shangjian/CentralControl/bin/x86/Debug/Google.Protobuf.dll
shangjian/CentralControl/bin/x86/Debug/Google.Protobuf.xml
shangjian/CentralControl/bin/x86/Debug/log4net.dll
shangjian/CentralControl/bin/x86/Debug/Newtonsoft.Json.dll
shangjian/CentralControl/bin/x86/Debug/QRCoder.dll
shangjian/CentralControl/bin/x86/Debug/System.Buffers.dll
shangjian/CentralControl/bin/x86/Debug/System.Buffers.xml
shangjian/CentralControl/bin/x86/Debug/System.Memory.dll
shangjian/CentralControl/bin/x86/Debug/System.Memory.xml
shangjian/CentralControl/bin/x86/Debug/System.Numerics.Vectors.dll
shangjian/CentralControl/bin/x86/Debug/System.Numerics.Vectors.xml
shangjian/CentralControl/bin/x86/Debug/System.Runtime.CompilerServices.Unsafe.dll
shangjian/CentralControl/bin/x86/Debug/System.Runtime.CompilerServices.Unsafe.xml
shangjian/CentralControl/bin/x86/Debug/config/log4net.config

Binary file not shown.

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" /></startup><system.data>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/></startup><system.data>
<DbProviderFactories>
<remove invariant="MySql.Data.MySqlClient" />
<add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.8.8.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
<remove invariant="MySql.Data.MySqlClient"/>
<add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.8.8.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d"/>
</DbProviderFactories>
</system.data></configuration>

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" /></startup><system.data>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/></startup><system.data>
<DbProviderFactories>
<remove invariant="MySql.Data.MySqlClient" />
<add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.8.8.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
<remove invariant="MySql.Data.MySqlClient"/>
<add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.8.8.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d"/>
</DbProviderFactories>
</system.data></configuration>

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" /></startup><system.data>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/></startup><system.data>
<DbProviderFactories>
<remove invariant="MySql.Data.MySqlClient" />
<add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.8.8.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
<remove invariant="MySql.Data.MySqlClient"/>
<add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.8.8.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d"/>
</DbProviderFactories>
</system.data></configuration>

@ -3,7 +3,10 @@
<Recommand>强烈建议:对数据库以及本软件的参数更改,不要在此页进行.可以通过系统配置页进行更新.</Recommand>
<!--测试数据库-->
<!--本机-->
<MySqlConnectionString>PaoP+dgwEqUaq1V2KF/9wc67GebYpjoI36S0e0LfeZKTVoaSbwjaLsKBP8to7AobicOYfkwbFhbqioXL3Ijc0aMPTvvDQPJyBYIJCX+xTofwmr8zGBc2qvVbcIrk5c7kgBLSKqriIgGe1apyKOKy1rbDI6aTLN1q</MySqlConnectionString>
<MySqlConnectionString>vadMWi9D6ZBkwIr78LoLmGwiSCvVnpY3nMB7IyQlxFiV2OD5s5WUgOabwGwWK3THmyUqdarOD4hLgFIvnCg0Z5JcMnCcII6fP2O7usaxD2yxms2iG3eLDegOrDQOCCjq</MySqlConnectionString>
<sqlConnectionString>vadMWi9D6ZBkwIr78LoLmGwiSCvVnpY3nMB7IyQlxFiV2OD5s5WUgOabwGwWK3THmyUqdarOD4hLgFIvnCg0Z5JcMnCcII6fP2O7usaxD2yxms2iG3eLDegOrDQOCCjq</sqlConnectionString>
<!--内网-->
<!--<MySqlConnectionString>DzcynNo9wI3U333HTwNyHtpazMtAq6qvUeaqcpctCT9Jnm9IRlHDogE5DvGjRk3tvCzQTaSDGuoD9zNO7I5mahV5Wkh+8uLt1PNMLdG8Z/vE8hCWrx/J8BIElJOCITrBJyyNu4CFdDcK+JiR7dM6TeqqngkSlFNq</MySqlConnectionString>-->
<!--外网-->

@ -1 +1 @@
15d12e7ab7b704ceb52fe4b956a6248dc9f6d5e6
6704f71248fbfc9a6d3933febec6839d57cb3a95e7ed3efb546e880ac71a1d71

@ -208,3 +208,48 @@ D:\project\tianjinXGL\xgl\neitong\shangjian\CentralControl\obj\x86\Debug\Central
D:\project\tianjinXGL\xgl\neitong\shangjian\CentralControl\obj\x86\Debug\CentralControl.csproj.CopyComplete
D:\project\tianjinXGL\xgl\neitong\shangjian\CentralControl\obj\x86\Debug\CentralControl.exe
D:\project\tianjinXGL\xgl\neitong\shangjian\CentralControl\obj\x86\Debug\CentralControl.pdb
D:\WorkSpace\KHD\Project\Lanju\Lanju-client\shangjian\CentralControl\bin\x86\Debug\Config\log4net.config
D:\WorkSpace\KHD\Project\Lanju\Lanju-client\shangjian\CentralControl\bin\x86\Debug\snap7.dll
D:\WorkSpace\KHD\Project\Lanju\Lanju-client\shangjian\CentralControl\bin\x86\Debug\config\ConnectionConfig.Config
D:\WorkSpace\KHD\Project\Lanju\Lanju-client\shangjian\CentralControl\bin\x86\Debug\NLog.config
D:\WorkSpace\KHD\Project\Lanju\Lanju-client\shangjian\CentralControl\bin\x86\Debug\CentralControl.exe.config
D:\WorkSpace\KHD\Project\Lanju\Lanju-client\shangjian\CentralControl\bin\x86\Debug\CentralControl.exe
D:\WorkSpace\KHD\Project\Lanju\Lanju-client\shangjian\CentralControl\bin\x86\Debug\CentralControl.pdb
D:\WorkSpace\KHD\Project\Lanju\Lanju-client\shangjian\CentralControl\bin\x86\Debug\CommonFunc.dll
D:\WorkSpace\KHD\Project\Lanju\Lanju-client\shangjian\CentralControl\bin\x86\Debug\Google.Protobuf.dll
D:\WorkSpace\KHD\Project\Lanju\Lanju-client\shangjian\CentralControl\bin\x86\Debug\MySql.Data.dll
D:\WorkSpace\KHD\Project\Lanju\Lanju-client\shangjian\CentralControl\bin\x86\Debug\NLog.dll
D:\WorkSpace\KHD\Project\Lanju\Lanju-client\shangjian\CentralControl\bin\x86\Debug\Thrift.dll
D:\WorkSpace\KHD\Project\Lanju\Lanju-client\shangjian\CentralControl\bin\x86\Debug\XGL.Data.dll
D:\WorkSpace\KHD\Project\Lanju\Lanju-client\shangjian\CentralControl\bin\x86\Debug\XGL.Models.dll
D:\WorkSpace\KHD\Project\Lanju\Lanju-client\shangjian\CentralControl\bin\x86\Debug\XGL.Thrift.dll
D:\WorkSpace\KHD\Project\Lanju\Lanju-client\shangjian\CentralControl\bin\x86\Debug\NPOI.dll
D:\WorkSpace\KHD\Project\Lanju\Lanju-client\shangjian\CentralControl\bin\x86\Debug\log4net.dll
D:\WorkSpace\KHD\Project\Lanju\Lanju-client\shangjian\CentralControl\bin\x86\Debug\QRCoder.dll
D:\WorkSpace\KHD\Project\Lanju\Lanju-client\shangjian\CentralControl\bin\x86\Debug\NPOI.OOXML.dll
D:\WorkSpace\KHD\Project\Lanju\Lanju-client\shangjian\CentralControl\bin\x86\Debug\Newtonsoft.Json.dll
D:\WorkSpace\KHD\Project\Lanju\Lanju-client\shangjian\CentralControl\bin\x86\Debug\BCrypt.Net-Next.dll
D:\WorkSpace\KHD\Project\Lanju\Lanju-client\shangjian\CentralControl\bin\x86\Debug\NPOI.OpenXmlFormats.dll
D:\WorkSpace\KHD\Project\Lanju\Lanju-client\shangjian\CentralControl\bin\x86\Debug\NPOI.OpenXml4Net.dll
D:\WorkSpace\KHD\Project\Lanju\Lanju-client\shangjian\CentralControl\bin\x86\Debug\System.Memory.dll
D:\WorkSpace\KHD\Project\Lanju\Lanju-client\shangjian\CentralControl\bin\x86\Debug\System.Numerics.Vectors.dll
D:\WorkSpace\KHD\Project\Lanju\Lanju-client\shangjian\CentralControl\bin\x86\Debug\System.Runtime.CompilerServices.Unsafe.dll
D:\WorkSpace\KHD\Project\Lanju\Lanju-client\shangjian\CentralControl\bin\x86\Debug\System.Buffers.dll
D:\WorkSpace\KHD\Project\Lanju\Lanju-client\shangjian\CentralControl\bin\x86\Debug\CommonFunc.pdb
D:\WorkSpace\KHD\Project\Lanju\Lanju-client\shangjian\CentralControl\bin\x86\Debug\CommonFunc.dll.config
D:\WorkSpace\KHD\Project\Lanju\Lanju-client\shangjian\CentralControl\bin\x86\Debug\XGL.Data.pdb
D:\WorkSpace\KHD\Project\Lanju\Lanju-client\shangjian\CentralControl\bin\x86\Debug\XGL.Data.dll.config
D:\WorkSpace\KHD\Project\Lanju\Lanju-client\shangjian\CentralControl\bin\x86\Debug\XGL.Models.pdb
D:\WorkSpace\KHD\Project\Lanju\Lanju-client\shangjian\CentralControl\bin\x86\Debug\XGL.Models.dll.config
D:\WorkSpace\KHD\Project\Lanju\Lanju-client\shangjian\CentralControl\bin\x86\Debug\XGL.Thrift.pdb
D:\WorkSpace\KHD\Project\Lanju\Lanju-client\shangjian\CentralControl\bin\x86\Debug\Google.Protobuf.xml
D:\WorkSpace\KHD\Project\Lanju\Lanju-client\shangjian\CentralControl\bin\x86\Debug\BCrypt.Net-Next.xml
D:\WorkSpace\KHD\Project\Lanju\Lanju-client\shangjian\CentralControl\bin\x86\Debug\System.Memory.xml
D:\WorkSpace\KHD\Project\Lanju\Lanju-client\shangjian\CentralControl\bin\x86\Debug\System.Numerics.Vectors.xml
D:\WorkSpace\KHD\Project\Lanju\Lanju-client\shangjian\CentralControl\bin\x86\Debug\System.Runtime.CompilerServices.Unsafe.xml
D:\WorkSpace\KHD\Project\Lanju\Lanju-client\shangjian\CentralControl\bin\x86\Debug\System.Buffers.xml
D:\WorkSpace\KHD\Project\Lanju\Lanju-client\shangjian\CentralControl\obj\x86\Debug\CentralControl.csproj.AssemblyReference.cache
D:\WorkSpace\KHD\Project\Lanju\Lanju-client\shangjian\CentralControl\obj\x86\Debug\CentralControl.csproj.CoreCompileInputs.cache
D:\WorkSpace\KHD\Project\Lanju\Lanju-client\shangjian\CentralControl\obj\x86\Debug\CentralControl.csproj.CopyComplete
D:\WorkSpace\KHD\Project\Lanju\Lanju-client\shangjian\CentralControl\obj\x86\Debug\CentralControl.exe
D:\WorkSpace\KHD\Project\Lanju\Lanju-client\shangjian\CentralControl\obj\x86\Debug\CentralControl.pdb

@ -3,9 +3,61 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:CommonFunc"
xmlns:local="clr-namespace:CommonFunc"
mc:Ignorable="d"
Title="HMessageBox" Height="210" Width="420" WindowStartupLocation="CenterScreen" WindowStyle="None" BorderThickness="1,1,1,1" ResizeMode="NoResize" Closed="Window_Closed" Loaded="Window_Loaded">
<Window.Resources>
<Style x:Key="btnKey" TargetType="Button">
<Setter Property="Width" Value="120"/>
<Setter Property="Height" Value="43"/>
<Setter Property="Foreground" Value="White"/>
<Setter Property="FontSize" Value="18"/>
<Setter Property="FontWeight" Value="Bold"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="HorizontalAlignment" Value="Right"/>
<Setter Property="Template" >
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border x:Name="Back" Background="#2B7EE6" BorderThickness="2" CornerRadius="10">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="Back" Property="Background" Value="#3697A4"></Setter>
<Setter TargetName="Back" Property="BorderBrush" Value="#3697A4"></Setter>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="btnCancelKey" TargetType="Button">
<Setter Property="Width" Value="120"/>
<Setter Property="Height" Value="43"/>
<Setter Property="Foreground" Value="Black"/>
<Setter Property="FontSize" Value="18"/>
<Setter Property="FontWeight" Value="Bold"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="HorizontalAlignment" Value="Right"/>
<Setter Property="Template" >
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border x:Name="Back" Background="LightGray" BorderThickness="2" CornerRadius="10">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="Back" Property="Background" Value="#3697A4"></Setter>
<Setter TargetName="Back" Property="BorderBrush" Value="#3697A4"></Setter>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Window.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
@ -49,13 +101,13 @@
<!--Button Margin(坐上右下)-->
<StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Right" >
<Button Content="确 定" Background="#216DD3" BorderBrush="Transparent" x:Name="OkButton" Width="80" Height="28" Click="OkButton_Click" Margin="10,0,0,0" IsDefault="True"
<Button Content="确 定" Background="#216DD3" BorderBrush="Transparent" x:Name="OkButton" Style="{StaticResource btnKey}" Width="80" Height="28" FontWeight="Bold" Foreground="White" Click="OkButton_Click" Margin="10,0,0,0" IsDefault="True"
/>
<Button Content="是" Background="#216DD3" BorderBrush="Transparent" x:Name="YesButton" Width="80" Height="28" Click="YesButton_Click" Margin="10,0,0,0"
<Button Content="是" Background="#216DD3" BorderBrush="Transparent" x:Name="YesButton" Width="80" Height="28" FontWeight="Bold" Click="YesButton_Click" Margin="10,0,0,0"
/>
<Button Content="否" Background="#D7D7D7" Foreground="Black" BorderBrush="Transparent" BorderThickness="0.5" x:Name="NoButton" Width="80" Height="28" Click="NoButton_Click" Margin="10,0,15,0"
<Button Content="否" Background="#D7D7D7" Foreground="Black" BorderBrush="Transparent" BorderThickness="0.5" x:Name="NoButton" Width="80" Height="28" FontWeight="Bold" Click="NoButton_Click" Margin="10,0,15,0"
/>
<Button Content="取消" Background="#D7D7D7" Foreground="Black" BorderBrush="Transparent" BorderThickness="0.5" x:Name="CancelButton" Width="80" Height="28" Click="CancelButton_Click" Margin="10,0,25,0"
<Button Content="取消" Background="#D7D7D7" Foreground="Black" BorderBrush="Transparent" BorderThickness="0.5" x:Name="CancelButton" Style="{StaticResource btnCancelKey}" Width="80" Height="28" FontWeight="Bold" Click="CancelButton_Click" Margin="10,0,25,0"
/>
</StackPanel>
</Grid>

@ -1 +1 @@
eafdca6ee748aec506bd217d6273757fffaf4aa4e66b7b29256414d0c9c09633
0833b6f358da98cc490efe830530cdf2b7a5a4dedf80eb68fd5df4d5b3412661

@ -13,7 +13,7 @@ DEBUG;TRACE
489050341
2-1355062061
27790667083
44-239516262
44231912980
HMessageBox.xaml;Tools\MachineRepairWin.xaml;Tools\PauseOrderWin.xaml;Tools\PauseRecoverWin.xaml;
False

@ -238,7 +238,7 @@ where res.taskcode = '0' and equipmentCode = 'C6' and res.OrderCode is not null
[operation_desc], [old_value], [new_value], [device_code],[remark],[order_code])
VALUES
('{CommonFunc.Common.GetUUID()}', '{LoginUser.UserId}', '{LoginUser.UserName}', '{type}', GetDate(),
'-', 'w2', '{status}', '{deviceCode}','{remark}','{orderCode}');";
'-', 'w4', '{status}', '{deviceCode}','{remark}','{orderCode}');";
}
else
{
@ -247,7 +247,7 @@ where res.taskcode = '0' and equipmentCode = 'C6' and res.OrderCode is not null
[operation_desc], [old_value], [new_value], [device_code],[remark],[order_code])
VALUES
('{CommonFunc.Common.GetUUID()}', '{LoginUser.UserId}', '{LoginUser.UserName}', '{type}', GetDate(),
'-', 'w4', '{status}', '{deviceCode}','{remark}','{orderCode}');";
'-', 'w2', '{status}', '{deviceCode}','{remark}','{orderCode}');";
}
string sql = $@"update pro_order_workorder set status = '{status}' where workorder_code = '{orderCode}'";
sqlList.Add(sql);
@ -624,7 +624,7 @@ VALUES
{userCount}, '{costCenter}','0','{batchCode}','{isEndReport}','{0}','{LoginUser.CurrDeviceIP}','{LoginUser.Version}');";
foreach (string item in GetAllWorkReportsForOrderAndChildren(selectRow["workorder_code"].ToString(), selectRow, orderQuntity, reportCode, costCenter, batchCode,
isEndReport, deviceCode, lineName, workCount, workTimeDic, userCountDic,0))
isEndReport, deviceCode, lineName, workCount, workTimeDic, userCountDic, 0))
{
sqlList.Add(item);
}
@ -681,33 +681,47 @@ VALUES
//赵啸林又说sap有问题需要上位机修改报工标识2023-12-25,但仅在最终报工时,才更新此状态
if (isEndReport.Equals("1"))
{
//更新订单状态为已报工;
string updateOrderSql = $@"update pro_order_workorder set status = 'w3', update_by = '{LoginUser.UserName}',update_time = GETDATE() where belong_work_order = '{selectRow["workorder_code"]}' ";
sqlList.Add(updateOrderSql);
//2024-04-15添加切线方案暂停状态下不修改报工状态,=w4的时候不加报工状态更新语句
if (!selectRow["status"].ToString().Equals("w4"))
{
//更新订单状态为已报工;
string updateOrderSql = $@"update pro_order_workorder set status = 'w3', update_by = '{LoginUser.UserName}',update_time = GETDATE() where belong_work_order = '{selectRow["workorder_code"]}' ";
sqlList.Add(updateOrderSql);
//修改报工逻辑最终报工时添加子母工单领料单状态更新2024-02-20
if (subOrder != "") //有子单
{
//更新子单状态
string updateSubOrderPrepareSql = $"update mes_prepare set status = 'L1' where workorder_code = '{subOrder}'";
//更新母单状态
string updateMainOrderPrepareSql = $"update mes_prepare set status = 'L1' where workorder_code = '{selectRow["workorder_code"]}'";
sqlList.Add(updateSubOrderPrepareSql);
sqlList.Add(updateMainOrderPrepareSql);
}
else //无子单
{
//更新母单状态
string updateMainOrderPrepareSql = $"update mes_prepare set status = 'L1' where workorder_code = '{selectRow["workorder_code"]}'";
sqlList.Add(updateMainOrderPrepareSql);
//修改报工逻辑最终报工时添加子母工单领料单状态更新2024-02-20
//递归更新子单领料状态
foreach (var item in GetUpdatePrepareSql(selectRow["workorder_code"].ToString()))
{
sqlList.Add(item);
}
}
//if (subOrder != "") //有子单
//{
// //更新子单状态
// string updateSubOrderPrepareSql = $"update mes_prepare set status = 'L1' where workorder_code = '{subOrder}'";
// //更新母单状态
// string updateMainOrderPrepareSql = $"update mes_prepare set status = 'L1' where workorder_code = '{selectRow["workorder_code"]}'";
// sqlList.Add(updateSubOrderPrepareSql);
// sqlList.Add(updateMainOrderPrepareSql);
//}
//else //无子单
//{
// //更新母单状态
// string updateMainOrderPrepareSql = $"update mes_prepare set status = 'L1' where workorder_code = '{selectRow["workorder_code"]}'";
// sqlList.Add(updateMainOrderPrepareSql);
//}
}
#endregion
#region 批次报工状态更新
//添加批次报工状态更新--2023-12-26
string updateBatchOrderStatusSql = $@"update pro_order_workorder_batch set status = '0', update_by = '{LoginUser.UserName}',update_time = GETDATE() where workorder_id = '{selectRow["workorder_id"]}' and batch_code = '{batchCode}' ";
sqlList.Add(updateBatchOrderStatusSql);
//2024-04-15添加切线方案暂停状态下不修改报工状态,=w4的时候不加报工状态更新语句
if (!selectRow["status"].ToString().Equals("w4"))
{
//添加批次报工状态更新--2023-12-26
string updateBatchOrderStatusSql = $@"update pro_order_workorder_batch set status = '0', update_by = '{LoginUser.UserName}',update_time = GETDATE() where workorder_id = '{selectRow["workorder_id"]}' and batch_code = '{batchCode}' ";
sqlList.Add(updateBatchOrderStatusSql);
}
#endregion
@ -715,11 +729,29 @@ VALUES
}
List<string> workReports = new List<string>();
List<string> updatePrepareSqlList = new List<string>();
/// <summary>
/// 递归获取子单报工SQL
/// </summary>
/// <param name="orderId"></param>
/// <param name="selectRow"></param>
/// <param name="orderQuntity"></param>
/// <param name="reportCode"></param>
/// <param name="costCenter"></param>
/// <param name="batchCode"></param>
/// <param name="isEndReport"></param>
/// <param name="deviceCode"></param>
/// <param name="lineName"></param>
/// <param name="workCount"></param>
/// <param name="workTimeDic"></param>
/// <param name="userCountDic"></param>
/// <param name="sortNo"></param>
/// <returns></returns>
public List<string> GetAllWorkReportsForOrderAndChildren(string orderId, DataRowView selectRow, string orderQuntity, string reportCode, string costCenter, string batchCode,
string isEndReport, string deviceCode, string lineName, string workCount, Dictionary<int, string> workTimeDic, Dictionary<int, string> userCountDic,int sortNo)
string isEndReport, string deviceCode, string lineName, string workCount, Dictionary<int, string> workTimeDic, Dictionary<int, string> userCountDic, int sortNo)
{
//获取子工单的信息
string getSubOrderSql = $"select workorder_code,product_code,product_name,quantity_split,unit from pro_order_workorder where parent_order = '{orderId}'";
string subOrder = "";
@ -736,7 +768,34 @@ VALUES
subQuntity = dtSubOrder.Tables[0].Rows[0]["quantity_split"].ToString();
subUnit = dtSubOrder.Tables[0].Rows[0]["unit"].ToString();
double rate = Convert.ToDouble(workCount) / Convert.ToDouble(orderQuntity);
double subOrderQty = rate * Convert.ToDouble(subQuntity);
double subOrderQty = 0;
LogHelper.instance.log.Info("rate>>>" + rate);
//根据base_product_attach表里的报工比例计算子单数量又取消了
string sqlGetReportRate = $@"select isnull(report_rate,0) as report_rate from base_product where product_code = '{selectRow["product_code"]}'";
//DataSet dtReportRate = Utils.netClientDBHelper.getDataSet(sqlGetReportRate);
//string reportRate = "0";
//if (dtReportRate != null && dtReportRate.Tables.Count > 0 && dtReportRate.Tables[0].Rows.Count > 0)
//{
// reportRate = dtReportRate.Tables[0].Rows[0][0].ToString();
// LogHelper.instance.log.Info("获取到报工效率为:" + reportRate+",产品编码为:"+ selectRow["product_code"]+",子单数量为:"+ subQuntity);
//}
//if (sortNo < 3)
//{
// if (reportRate.Equals("0"))
// {
// subOrderQty = rate * Convert.ToDouble(subQuntity);
// }
// else
// {
// subOrderQty = Convert.ToDouble(reportRate) * Convert.ToDouble(subQuntity);
// }
//}
if (sortNo < 3)
{
subOrderQty = rate * Convert.ToDouble(subQuntity);
}
string subOrderSql = $@"INSERT INTO [dbo].[mes_report_work]
([id], [report_type], [report_code], [workorder_code], [product_code], [product_name],
[spec], [unit], [quantity], [quantity_feedback], [quantity_qualified], [quantity_unqualified],
@ -752,10 +811,10 @@ VALUES
'无', '{workTimeDic[sortNo]}', '{deviceCode}', '{lineName}', N'{LoginUser.TeamCode}', '{selectRow["shift_id"]}',
NULL, NULL, NULL, NULL, '{LoginUser.UserName}', '{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}',
'{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}', '{LoginUser.UserName}', '0', NULL, 'prod',
{userCountDic[sortNo]}, '{costCenter}','0','{batchCode}','{isEndReport}','{selectRow["workorder_code"]}','{LoginUser.CurrDeviceIP}','{LoginUser.Version}');";
{userCountDic[sortNo]}, '{costCenter}','0','{batchCode}','{isEndReport}','{orderId}','{LoginUser.CurrDeviceIP}','{LoginUser.Version}');";
workReports.Add(subOrderSql);
sortNo++;
GetAllWorkReportsForOrderAndChildren(subOrder, selectRow, orderQuntity, reportCode, costCenter, batchCode, isEndReport, deviceCode, lineName, subQuntity, workTimeDic, userCountDic, sortNo);
GetAllWorkReportsForOrderAndChildren(subOrder, selectRow, orderQuntity, reportCode, costCenter, batchCode, isEndReport, deviceCode, lineName, subQuntity, workTimeDic, userCountDic, sortNo);
}
@ -763,6 +822,23 @@ VALUES
}
public List<string> GetUpdatePrepareSql(string orderId)
{
string updateMainOrderPrepareSql = $"update mes_prepare set status = 'L1', update_by = '{LoginUser.UserName}',update_time = GETDATE() where workorder_code = '{orderId}' and del_flag = '0'";
updatePrepareSqlList.Add(updateMainOrderPrepareSql);
//获取子工单的信息
string getSubOrderSql = $"select workorder_code,product_code,product_name,quantity_split,unit from pro_order_workorder where parent_order = '{orderId}'";
string subOrder = "";
DataSet dtSubOrder = Utils.netClientDBHelper.getDataSet(getSubOrderSql);
if (dtSubOrder != null && dtSubOrder.Tables.Count > 0 && dtSubOrder.Tables[0].Rows.Count > 0)
{
subOrder = dtSubOrder.Tables[0].Rows[0]["workorder_code"].ToString();
GetUpdatePrepareSql(subOrder);
}
return updatePrepareSqlList;
}
public bool ChangeShiftsInfo(string deviceCode)
{
//
@ -836,7 +912,11 @@ VALUES
return sql;
}
/// <summary>
/// 获取母单的包工人数
/// </summary>
/// <param name="orderCode"></param>
/// <returns></returns>
public DataTable GetFatherOrderUserCount(string orderCode)
{
string sql = $@"SELECT top 1 use_man FROM [dbo].[mes_report_work] where workorder_code = '{orderCode}' order by create_time";
@ -849,6 +929,24 @@ VALUES
return null;
}
/// <summary>
/// 获取报工总数量
/// </summary>
/// <param name="orderCode"></param>
/// <returns></returns>
public DataTable GetOrderReportSumQty(string orderCode)
{
string sql = $@"SELECT sum(quantity_feedback) FROM [dbo].[mes_report_work] where workorder_code = '{orderCode}' GROUP BY workorder_code";
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;
}
public DataTable GetSubOrderCount(string orderCode)
{
//获取子工单的信息

@ -88,7 +88,7 @@ namespace XGL.Dats.DBServiceFinishProd
public DataTable GetUserInfoFromCloudServer(string userID)
{
string sql = $@"SELECT user_name,nick_name,sex FROM [dbo].[sys_user] where del_flag = '0' and user_name = '{userID}'";
DataSet dtset = Utils.clientDBHelper.getDataSet(sql);
DataSet dtset = Utils.cloudDBHelper.getDataSet(sql);
if (dtset != null && dtset.Tables.Count > 0 && dtset.Tables[0].Rows.Count > 0)
{
return dtset.Tables[0];
@ -150,7 +150,7 @@ namespace XGL.Dats.DBServiceFinishProd
public DataTable GetOperationRecord(string v)
{
string sql = $" select user_id,user_name,operation_type,operation_time,operation_desc,old_value,new_value,device_code,remark,order_code from mes_operation_log where device_code = '{v}'";
string sql = $" select user_id,user_name,operation_type,operation_time,operation_desc,old_value,new_value,device_code,remark,order_code from mes_operation_log where device_code = '{v}' order by operation_time desc";
DataSet dtset = Utils.netClientDBHelper.getDataSet(sql);
if (dtset != null && dtset.Tables.Count > 0 && dtset.Tables[0].Rows.Count > 0)
{
@ -169,7 +169,7 @@ remark, work_time, machine_code, machine_name, team_code, shift_code,
create_by, create_time, update_time, update_by, upload_time, upload_status,
upload_msg, prod_type, use_man, work_center
from mes_report_work
where CONVERT(VARCHAR(10), create_time , 120)= CONVERT(VARCHAR(10), GetDate() , 120) and machine_code = '{deviceCode}'";
where CONVERT(VARCHAR(10), create_time , 120)= CONVERT(VARCHAR(10), '{LoginUser.WorkDate}' , 120) and machine_code = '{deviceCode}'";
DataSet dtset = Utils.netClientDBHelper.getDataSet(sql);
if (dtset != null && dtset.Tables.Count > 0 && dtset.Tables[0].Rows.Count > 0)
{
@ -182,11 +182,12 @@ where CONVERT(VARCHAR(10), create_time , 120)= CONVERT(VARCHAR(10), GetDate() ,
public DataTable GetCosumeData(string workorder)
{
string sql = $@"select '0' as qty,'' as remark, workorder_code, SUBSTRING(material_code, 8, LEN(material_code)) as material_code1,material_code,material_name,detail.prod_type,material_spc,detail.unit,quantity,
string sql = $@"select DISTINCT '0' as qty,'' as remark, pre.workorder_code, SUBSTRING(material_code, 8, LEN(material_code)) as material_code1,material_code,material_name,detail.prod_type,material_spc,detail.unit,quantity,
detail.create_by,detail.create_time,detail.update_by,detail.update_time,locator,need_date,
recoil,fund_quanlity,detail.del_flag,parent_work_order
recoil,fund_quanlity,detail.del_flag,parent_work_order,orders.workorder_code_sap
from mes_prepare_detail detail
LEFT JOIN mes_prepare pre on detail.prepare_id = pre.prepare_id
left join pro_order_workorder orders on pre.workorder_code = orders.workorder_code and orders.del_flag = '0'
where detail.parent_work_order ='{workorder}' and detail.del_flag = '0'";
DataSet dtset = Utils.netClientDBHelper.getDataSet(sql);
if (dtset != null && dtset.Tables.Count > 0 && dtset.Tables[0].Rows.Count > 0)
@ -230,7 +231,35 @@ where detail.parent_work_order ='{workorder}' and detail.del_flag = '0'";
return null;
}
/// <summary>
/// 查询订单报工次数
/// </summary>
/// <param name="workorder"></param>
/// <returns></returns>
public DataTable GetBatchReportedCount(string workorder)
{
//string sql = $" select count(*) from mes_report_work where workorder_code = '{workorder}' AND del_flag='0'";
string sql = $@"select count(distinct batch) from mes_report_work where workorder_code = '{workorder}' AND del_flag='0';";
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;
}
public bool IsLastBatchReport(string batchNo)
{
//string sql = $" select count(*) from mes_report_work where workorder_code = '{workorder}' AND del_flag='0'";
string sql = $@"select count(distinct batch) from mes_report_work where batch = '{batchNo}' AND del_flag='0';";
DataSet dtset = Utils.netClientDBHelper.getDataSet(sql);
if (dtset != null && dtset.Tables.Count > 0 && dtset.Tables[0].Rows.Count > 0)
{
return dtset.Tables[0].Rows[0][0].ToString().Equals("0") ? true : false;
}
return true;
}
public DataTable GetFactoryInfo(string sitecode)
{
@ -530,10 +559,11 @@ select a.TrayCode,a.ProductBarNo,a.carcode,a.createtime,a.lineno,b.HadNumber
{
string sql = $@"select workorder.factory_code,workorder.product_date as plan_time, workorder.workorder_id,workorder.workorder_code, product_code,product_name,
product_spc,shifts.shift_desc,prod_line_code,workorder.status,route_code,quantity_split,
unit,workorder.shift_id ,batch.batch_code,batch.batch_quantity,sort_no, workorder.parent_order,batch.qc_status,batch.status as batchStatus,workorder_code_sap,salary_flag
unit,workorder.shift_id ,batch.batch_code,batch.batch_quantity,sort_no, workorder.parent_order,batch.qc_status,isnull(batch.qc_result,'') qc_result,batch.status as batchStatus,workorder_code_sap,salary_flag,qty.batchQty,batch.batch_quantity - qty.batchQty as diffQty
from pro_order_workorder workorder WITH (NOLOCK)
left JOIN base_shifts_t shifts WITH (NOLOCK) on workorder.shift_id = shifts.shift_id
left JOIN pro_order_workorder_batch batch WITH (NOLOCK) on workorder.workorder_id = batch.workorder_id
left join (SELECT sum(quantity_feedback) as batchQty,workorder_code,batch FROM [dbo].[mes_report_work] where del_flag = 0 GROUP BY workorder_code,batch) qty on qty.workorder_code = workorder.workorder_code and batch.batch_code = qty.batch
where 1=1 and batch.del_flag = 0 and workorder.del_flag = 0 and
workorder.parent_order ='0' and CONVERT(VARCHAR(10), workorder.product_date , 120)= CONVERT(VARCHAR(10), '{date}' , 120) and workorder.prod_line_code like '%{deviceCode}%' order by sort_no,batch_code";
@ -601,13 +631,34 @@ where line_code = '{deviceCode}' and CONVERT(VARCHAR(10), Create_time , 120) = C
return null;
}
/// <summary>
/// 根据线体、产品获取工序列表
/// </summary>
/// <param name="deviceCode"></param>
/// <param name="date"></param>
/// <returns></returns>
public DataTable GetUnitPriceDataNew(string deviceCode)
{
string sql = $@"select [workorder_code], [workorder_code_sap], [product_name], SUBSTRING([product_code], 8, LEN(product_code)) as product_code, [user_name], [nick_name], [childprocess_code], [childprocess_name] ,[create_by], [create_time], [line_code]
from mes_unitprice_report
where line_code = '{deviceCode}' and CONVERT(VARCHAR(10), Create_time , 120) = CONVERT(VARCHAR(10),GETDATE(), 120) ORDER BY childprocess_code,create_time";
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>
/// <param name="item"></param>
/// <exception cref="NotImplementedException"></exception>
public string GetCreateUnitPriceInfo(sys_user item,string workorderCode, string sapWorkorderCode,string productCode,string productName,string childProcessCode,string childProcessName,string deviceCode)
{
{
string sql = $@"INSERT INTO [dbo].[mes_unitprice_report] (
[id],[workorder_code], [workorder_code_sap], [product_name], [product_code],
[user_name], [nick_name], [childprocess_code], [childprocess_name], [attr1],
@ -624,6 +675,18 @@ where line_code = '{deviceCode}' and CONVERT(VARCHAR(10), Create_time , 120) = C
return sql;
}
public DataSet GetSapCode(string deviceCode)
{
string sapCodeSql = $"select sap_code from base_equipment where equipment_code = '{deviceCode}'";
string sapCode = "";
DataSet dtSapCode = Utils.netClientDBHelper.getDataSet(sapCodeSql);
if (dtSapCode != null && dtSapCode.Tables.Count > 0 && dtSapCode.Tables[0].Rows.Count > 0)
{
sapCode = dtSapCode.Tables[0].Rows[0]["sap_code"].ToString();
return dtSapCode;
}
return null;
}
public string GetUpdateUnitPriceSql(string workOrderCode)
{
string updateOrderSql = $@"update pro_order_workorder set salary_flag = '1', update_by = '{LoginUser.UserName}',update_time = GETDATE() where workorder_code = '{workOrderCode}' ";
@ -829,7 +892,26 @@ where detail.parent_work_order = '{processid}'"; //where CONVERT(VARCHAR(10), w
}
return null;
}
/// <summary>
/// 获取当天产线活动中工单的数量
/// </summary>
/// <returns></returns>
public DataTable GetActivedOrdersQty(string deviceCode, string workDate)
{
string sql = $@"select count(*)
from pro_order_workorder workorder
where CONVERT(VARCHAR(10), workorder.product_date , 120)= CONVERT(VARCHAR(10), '{workDate}' , 120)
and workorder.prod_line_code like '%{deviceCode}%' and workorder.del_flag = 0 and parent_order = '0' and workorder.status = 'w2'";
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>
@ -3295,11 +3377,7 @@ left join basedata_plcsetting f on a.PlcId5=f.Id
}
return Items;
}

@ -57,6 +57,10 @@
<Reference Include="Google.Protobuf, Version=3.5.1.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
<HintPath>..\packages\Google.Protobuf.3.5.1\lib\net45\Google.Protobuf.dll</HintPath>
</Reference>
<Reference Include="log4net, Version=1.2.13.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Libs\log4net.dll</HintPath>
</Reference>
<Reference Include="MySql.Data, Version=6.8.8.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
<HintPath>..\packages\MySql.Data.6.8.8\lib\net40\MySql.Data.dll</HintPath>
</Reference>

@ -1 +1 @@
2df19547b61eec50ce5622f682c721677c5685d3e9c6b57b48caf94d220efa28
74d66cc74320b0a05442877ece03b5b66098c72c0f47ce1e84f8126b6da7ec2b

@ -1 +1 @@
da1f8a4ab9deae84872caf330dfa9c851f84a58d
4ef8f3fe584abbf1a27a86fbab967f450baddb9bb9518d8c42d9654a4135d079

@ -72,3 +72,14 @@ F:\KHD\230620\shangjian\XGL.Model\obj\x86\Debug\XGL.Models.csproj.CoreCompileInp
F:\KHD\230620\shangjian\XGL.Model\obj\x86\Debug\XGL.Models.csproj.CopyComplete
F:\KHD\230620\shangjian\XGL.Model\obj\x86\Debug\XGL.Models.dll
F:\KHD\230620\shangjian\XGL.Model\obj\x86\Debug\XGL.Models.pdb
D:\WorkSpace\KHD\Project\Lanju\Lanju-client\shangjian\XGL.Model\bin\x86\Debug\XGL.Models.dll.config
D:\WorkSpace\KHD\Project\Lanju\Lanju-client\shangjian\XGL.Model\bin\x86\Debug\XGL.Models.dll
D:\WorkSpace\KHD\Project\Lanju\Lanju-client\shangjian\XGL.Model\bin\x86\Debug\XGL.Models.pdb
D:\WorkSpace\KHD\Project\Lanju\Lanju-client\shangjian\XGL.Model\bin\x86\Debug\Google.Protobuf.dll
D:\WorkSpace\KHD\Project\Lanju\Lanju-client\shangjian\XGL.Model\bin\x86\Debug\MySql.Data.dll
D:\WorkSpace\KHD\Project\Lanju\Lanju-client\shangjian\XGL.Model\bin\x86\Debug\Google.Protobuf.xml
D:\WorkSpace\KHD\Project\Lanju\Lanju-client\shangjian\XGL.Model\obj\x86\Debug\XGL.Models.csproj.AssemblyReference.cache
D:\WorkSpace\KHD\Project\Lanju\Lanju-client\shangjian\XGL.Model\obj\x86\Debug\XGL.Models.csproj.CoreCompileInputs.cache
D:\WorkSpace\KHD\Project\Lanju\Lanju-client\shangjian\XGL.Model\obj\x86\Debug\XGL.Models.csproj.CopyComplete
D:\WorkSpace\KHD\Project\Lanju\Lanju-client\shangjian\XGL.Model\obj\x86\Debug\XGL.Models.dll
D:\WorkSpace\KHD\Project\Lanju\Lanju-client\shangjian\XGL.Model\obj\x86\Debug\XGL.Models.pdb

@ -12,7 +12,7 @@
<!--设备编码-->
<add key="DeviceCode" value="C3" />
<!--上位机类型 0:工单准备1成型机\shoupei2烘房,3:人员登录-->
<add key="ClientMode" value="0" />
<add key="ClientMode" value="2" />
<add key="SerialPort" value="COM5" />
<add key="DryingHouseList" value="H16,H17,H18"/>
<!--线体编码-->

@ -68,8 +68,8 @@
</StackPanel>
</Grid>
<Button VerticalAlignment="Bottom" Background="#0454D7" IsDefault="True" BorderBrush="Transparent" x:Name="btnlogin" Margin="68,0,182,85" Width="100" Height="30" FontSize="16" Content="登录" Click="btnlogin_Click"></Button>
<Button VerticalAlignment="Bottom" Background="#D7D7D7" Foreground="Black" BorderBrush="Transparent" x:Name="btnloginout" Margin="192,0,58,85" Width="100" FontSize="16" Height="30" Content="退出" Click="btnloginout_Click" ></Button>
<Button VerticalAlignment="Bottom" Background="#0454D7" IsDefault="True" BorderBrush="Transparent" x:Name="btnlogin" Margin="68,0,182,85" Width="100" Height="30" Foreground="White" FontWeight="Bold" FontSize="16" Content="登录" Click="btnlogin_Click"></Button>
<Button VerticalAlignment="Bottom" Background="#D7D7D7" Foreground="Black" BorderBrush="Transparent" x:Name="btnloginout" Margin="192,0,58,85" Width="100" FontWeight="Bold" FontSize="16" Height="30" Content="退出" Click="btnloginout_Click" ></Button>
<CheckBox x:Name="rememberpwd" VerticalAlignment="Bottom" Background="Black" Margin="48,0,0,126" Width="100" HorizontalAlignment="Left"
IsChecked="True">
记住密码

@ -294,6 +294,7 @@ namespace XGL
{
try
{
btnCheckUpdate_Click(null, null);
username.Focus();
//dldh.IsActive = false;
this.dldh.Visibility = Visibility.Hidden;//遮罩层可见
@ -364,7 +365,8 @@ namespace XGL
}
else
{
MessageBox.Show("没有检测到新版本", "提示", MessageBoxButton.OK, MessageBoxImage.Warning);
if (sender != null)
MessageBox.Show("没有检测到新版本", "提示", MessageBoxButton.OK, MessageBoxImage.Warning);
}
}

@ -358,17 +358,18 @@ namespace XGL.Views
var selectedRow = dgWorkOrderInfo.SelectedItem as FoamingMacModel;
if (selectedRow == null)
{
MessageBox.Show("请选择你要暂停的工单!", "温馨提示", MessageBoxButton.OK, MessageBoxImage.Warning);
CustomMessageBox.Show("请选择你要暂停的工单!", CustomMessageBoxButton.OK, CustomMessageBoxIcon.Warning);
return;
}
MessageBoxResult result = MessageBox.Show("你确定要暂停该工单吗?", "温馨提示", MessageBoxButton.YesNo, MessageBoxImage.Information);
if (result == MessageBoxResult.No)
CustomMessageBoxResult result = CustomMessageBox.Show("你确定要暂停该工单吗?", CustomMessageBoxButton.OKCancel, CustomMessageBoxIcon.Question);
//MessageBoxResult result = MessageBox.Show("你确定要暂停该工单吗?", "温馨提示", MessageBoxButton.YesNo, MessageBoxImage.Information);
if (result == CustomMessageBoxResult.Cancel)
return;
var workordercode = selectedRow.workorder_code;
string currStatus = selectedRow.status;
if(currStatus!="w2")
{
MessageBox.Show("只有活动中的工单才支持暂停!", "温馨提示", MessageBoxButton.OK, MessageBoxImage.Warning);
CustomMessageBox.Show("只有活动中的工单才支持暂停!", CustomMessageBoxButton.OK, CustomMessageBoxIcon.Warning);
return;
}
PauseOrderWin pauseOrderWin = new PauseOrderWin();
@ -385,14 +386,14 @@ namespace XGL.Views
var selectedRow = dgWorkOrderInfo.SelectedItem as FoamingMacModel;
if (selectedRow == null)
{
MessageBox.Show("请选择你要恢复的工单!", "温馨提示", MessageBoxButton.OK, MessageBoxImage.Warning);
CustomMessageBox.Show("请选择你要恢复的工单!", CustomMessageBoxButton.OK, CustomMessageBoxIcon.Warning);
return;
}
var workordercode = selectedRow.workorder_code;
string currStatus = selectedRow.status;
if (currStatus != "w4")
{
MessageBox.Show("只有暂停中的工单才支持恢复!", "温馨提示", MessageBoxButton.OK, MessageBoxImage.Warning);
CustomMessageBox.Show("只有暂停中的工单才支持恢复!", CustomMessageBoxButton.OK, CustomMessageBoxIcon.Warning);
return;
}
//MessageBoxResult result = MessageBox.Show("你确定要恢复该工单吗?", "温馨提示", MessageBoxButton.YesNo, MessageBoxImage.Information);
@ -400,9 +401,7 @@ namespace XGL.Views
// return;
PauseOrderWin pauseOrderWin = new PauseOrderWin();
if (pauseOrderWin.ShowDialog() == true)
{
{
formingMachineService.UpdateWorkOrder(workordercode, "w2", pauseOrderWin.remark, pauseOrderWin.type, deviceCode);
GetWorkOrderInfo();
}

@ -10,7 +10,7 @@
<!--车间编码-->
<add key="SiteCode" value="1000" />
<!--设备编码-->
<add key="DeviceCode" value="XL02" />
<add key="DeviceCode" value="XL01" />
<!--上位机类型 0:工单准备1成型机\shoupei2烘房,3:人员登录-->
<add key="ClientMode" value="1" />

@ -64,8 +64,8 @@
</StackPanel>
</Grid>
<Button VerticalAlignment="Bottom" Background="#0454D7" IsDefault="True" BorderBrush="Transparent" x:Name="btnlogin" Margin="68,0,182,85" Width="100" Height="30" FontSize="16" Content="登录" Click="btnlogin_Click"></Button>
<Button VerticalAlignment="Bottom" Background="#D7D7D7" Foreground="Black" BorderBrush="Transparent" x:Name="btnloginout" Margin="192,0,58,85" Width="100" FontSize="16" Height="30" Content="退出" Click="btnloginout_Click" ></Button>
<Button VerticalAlignment="Bottom" Background="#0454D7" IsDefault="True" BorderBrush="Transparent" x:Name="btnlogin" Margin="68,0,182,85" Width="100" Height="30" Foreground="White" FontWeight="Bold" FontSize="16" Content="登录" Click="btnlogin_Click"></Button>
<Button VerticalAlignment="Bottom" Background="#D7D7D7" Foreground="Black" BorderBrush="Transparent" x:Name="btnloginout" Margin="192,0,58,85" Width="100" FontWeight="Bold" FontSize="16" Height="30" Content="退出" Click="btnloginout_Click" ></Button>
<CheckBox x:Name="rememberpwd" VerticalAlignment="Bottom" Background="Black" Margin="48,0,0,126" Width="100" HorizontalAlignment="Left"
IsChecked="True">
记住密码

@ -286,6 +286,7 @@ namespace XGLFinishPro
{
try
{
btnCheckUpdate_Click(null, null);
username.Focus();
//dldh.IsActive = false;
this.dldh.Visibility = Visibility.Hidden;//遮罩层可见
@ -356,7 +357,8 @@ namespace XGLFinishPro
}
else
{
MessageBox.Show("没有检测到新版本", "提示", MessageBoxButton.OK, MessageBoxImage.Warning);
if(sender != null)
MessageBox.Show("没有检测到新版本", "提示", MessageBoxButton.OK, MessageBoxImage.Warning);
}
}

@ -36,15 +36,27 @@ namespace XGLFinishPro.Tools
}
if (value.Equals("0") || string.IsNullOrEmpty(value.ToString()))
{
return "未检";
return "未检";
}
if (value.Equals("1"))
{
return "任务已创建";
return "首检中";
}
if (value.Equals("2"))
{
return "质检完成";
return "首检完成";
}
if (value.Equals("Y"))
{
return "合格";
}
if (value.Equals("N"))
{
return "不合格";
}
if (value.Equals(" "))
{
return "";
}
return "未派";
}

@ -3,12 +3,15 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:hc="https://handyorg.github.io/handycontrol"
xmlns:local="clr-namespace:XGLFinishPro.Views"
xmlns:convert="clr-namespace:XGLFinishPro.Tools"
mc:Ignorable="d"
Title="CheckUserWin" Height="950" Width="1350" WindowStartupLocation="CenterScreen" WindowStyle="None" Loaded="Window_Loaded">
Title="CheckUserWin" Height="750" Width="1350" WindowStartupLocation="CenterScreen" WindowStyle="None" Loaded="Window_Loaded">
<Window.Resources>
<!--ComboBox下拉按钮-->
<ResourceDictionary>
<!--ComboBox下拉按钮-->
<Style TargetType="ToggleButton" x:Key="ComboxStyleBtn">
<Setter Property="Template">
<Setter.Value>
@ -97,34 +100,98 @@
</Setter>
</Style>
<Style TargetType="TextBox">
<Setter Property="Height" Value="40"/>
<Setter Property="Height" Value="40"/>
<Setter Property="Margin" Value="5"/>
<Setter Property="Background" Value="Red"></Setter>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="Template" >
<Setter.Value>
<ControlTemplate TargetType="TextBox">
<Border BorderThickness="2" CornerRadius="8" Background="#f2f3f5">
<ScrollViewer x:Name="PART_ContentHost" />
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="Label">
<Setter Property="Margin" Value="15,0,0,0"/>
<Setter Property="Foreground" Value="Black"/>
</Style>
<Style x:Key="CustomCellStyle" TargetType="DataGridCell">
<Setter Property="Foreground" Value="Black" />
<Setter Property="TextBlock.TextAlignment" Value="Center" />
<Setter Property="TextBlock.FontSize" Value="22" />
<Setter Property="BorderThickness" Value="0 0 1 1" />
<Setter Property="BorderBrush" Value="LightGray" />
</Style>
<SolidColorBrush x:Key="EvenRowBackground" Color="#E0E0E0"/>
<SolidColorBrush x:Key="OddRowBackground" Color="#FFFFFF"/>
<SolidColorBrush x:Key="EvenRowBackground" Color="#E0E0E0"/>
<SolidColorBrush x:Key="OddRowBackground" Color="#FFFFFF"/>
<Style x:Key="DataGridRowStyle" TargetType="DataGridRow">
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="Background" Value="{StaticResource EvenRowBackground}"/>
<Setter Property="BorderBrush" Value="LightGray"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Background" Value="{StaticResource EvenRowBackground}"/>
<Style.Triggers>
<Trigger Property="ItemsControl.AlternationIndex" Value="1">
<Setter Property="Background" Value="{StaticResource OddRowBackground}"/>
</Trigger>
</Style.Triggers>
</Style>
<Style x:Key="btnKey" TargetType="Button">
<Setter Property="Width" Value="120"/>
<Setter Property="Height" Value="43"/>
<Setter Property="Foreground" Value="White"/>
<Setter Property="FontSize" Value="22"/>
<Setter Property="FontWeight" Value="Bold"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="HorizontalAlignment" Value="Right"/>
<Setter Property="Template" >
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border x:Name="Back" Background="#2B7EE6" BorderThickness="2" CornerRadius="10">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="Back" Property="Background" Value="#3697A4"></Setter>
<Setter TargetName="Back" Property="BorderBrush" Value="#3697A4"></Setter>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="btnCancelKey" TargetType="Button">
<Setter Property="Width" Value="120"/>
<Setter Property="Height" Value="43"/>
<Setter Property="Foreground" Value="Black"/>
<Setter Property="FontSize" Value="22"/>
<Setter Property="FontWeight" Value="Bold"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="HorizontalAlignment" Value="Right"/>
<Setter Property="Template" >
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border x:Name="Back" Background="#f2f3f5" BorderThickness="2" CornerRadius="10">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="Back" Property="Background" Value="#3697A4"></Setter>
<Setter TargetName="Back" Property="BorderBrush" Value="#3697A4"></Setter>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
</Window.Resources>
<Grid >
<Grid.ColumnDefinitions>
@ -133,10 +200,10 @@
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="40"/>
<RowDefinition Height="350"/>
<RowDefinition Height="550"/>
<RowDefinition Height="200"/>
<RowDefinition Height="500"/>
</Grid.RowDefinitions>
<Label Grid.Row="0" Grid.ColumnSpan="2" x:Name="lbTitle" HorizontalAlignment="Left" VerticalAlignment="Center" FontSize="24" Content="报工" FontWeight="Bold"></Label>
<Label Grid.Row="0" Grid.ColumnSpan="2" x:Name="lbTitle" HorizontalAlignment="Left" VerticalAlignment="Center" Foreground="Black" FontSize="24" Content="报工" FontWeight="Bold"></Label>
<ScrollViewer x:Name="scrollViewer" Grid.Row="1" Grid.ColumnSpan="2" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto">
<Grid x:Name="MyGrid" Grid.Row="1" Grid.ColumnSpan="2">
@ -184,12 +251,12 @@
<Label Grid.Row="1" HorizontalAlignment="Left" VerticalAlignment="Center" FontSize="24" Content="母单人数:"></Label>
<TextBox x:Name="txtFOUserCount" Grid.Row="1" HorizontalAlignment="Left" VerticalAlignment="Center" FontSize="24" Width="260" TextChanged="txtFOUserCount_TextChanged"></TextBox>
</StackPanel>-->
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Left" Grid.Row="12" Grid.Column="0" Grid.ColumnSpan="2">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Left" Grid.Row="13" Grid.Column="0" Grid.ColumnSpan="2">
<Label Grid.Row="1" HorizontalAlignment="Left" VerticalAlignment="Center" FontSize="24" Content="成本中心:"></Label>
<ComboBox x:Name="comboBoxCostCenter" Grid.Row="1" HorizontalAlignment="Left" VerticalAlignment="Center" FontSize="24" Width="360" Height="50"
Style="{StaticResource ComboBoxStyle}" SelectionChanged="comboBoxCostCenter_SelectionChanged"></ComboBox>
</StackPanel>
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Left" Grid.Row="13" Grid.Column="0" Grid.ColumnSpan="2">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Left" Grid.Row="13" Grid.Column="1" Grid.ColumnSpan="2">
<Label Grid.Row="1" HorizontalAlignment="Left" VerticalAlignment="Center" FontSize="24" Content="批 次 号:"></Label>
<ComboBox x:Name="comboBoxBatch" Grid.Row="1" HorizontalAlignment="Left" VerticalAlignment="Center" FontSize="24" Margin="2,5,0,0" Width="360" Height="50" Style="{StaticResource ComboBoxStyle}"></ComboBox>
<Label Content="* 不选批次号则默认为该工单报工" Foreground="Red" VerticalAlignment="Center"></Label>
@ -211,11 +278,14 @@
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="400"/>
<RowDefinition Height="380"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
</Grid.RowDefinitions>
<DataGrid x:Name="dgConsumeInfo" Grid.Row="0" Grid.ColumnSpan="2" Background="#0000"
GridLinesVisibility="All" HorizontalGridLinesBrush="AliceBlue" VerticalGridLinesBrush="AliceBlue"
AlternatingRowBackground="LightGray"
RowBackground="White"
LoadingRow="dgConsumeInfo_LoadingRow"
CanUserAddRows="False"
AutoGenerateColumns="False"
@ -224,23 +294,13 @@
CellEditEnding="dgConsumeInfo_CellEditEnding"
RowStyle="{StaticResource DataGridRowStyle}"
CellStyle="{StaticResource CustomCellStyle}" MinRowHeight="35">
<DataGrid.ColumnHeaderStyle >
<!--<Style TargetType="DataGridColumnHeader">
<Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="Height" Value="48" />
<Setter Property="FontSize" Value="20" />
<Setter Property="Foreground" Value="Black" />
<Setter Property="FontWeight" Value="Bold" />
<Setter Property="Background" Value="#0000" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="BorderBrush" Value="Gray" />
</Style>-->
<DataGrid.ColumnHeaderStyle >
<Style TargetType="DataGridColumnHeader">
<Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="Height" Value="48" />
<Setter Property="FontSize" Value="20" />
<Setter Property="Foreground" Value="White" />
<Setter Property="Background" Value="#2B7EE6" />
<Setter Property="Foreground" Value="Gray" />
<Setter Property="Background" Value="#f7f9fe" />
</Style>
</DataGrid.ColumnHeaderStyle>
<DataGrid.Columns>
@ -251,31 +311,30 @@
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<!--如果新增列,需要调整用量的取值序号-->
<DataGridTextColumn Width="250" Header="组件编码" Binding="{Binding material_code1}" IsReadOnly="True"/>
<DataGridTextColumn Width="250" Header="组件编码" Binding="{Binding material_code}" Visibility="Hidden" IsReadOnly="True"/>
<DataGridTextColumn Width="350" Header="组件名称" Binding="{Binding material_name}" IsReadOnly="True"/>
<DataGridTextColumn Width="100" Header="单位" Binding="{Binding unit}" />
<DataGridTextColumn Width="100" Header="反冲标识" Binding="{Binding recoil}"/>
<DataGridTextColumn Width="100" Header="单位" Binding="{Binding unit}" IsReadOnly="True"/>
<DataGridTextColumn Width="100" Header="反冲标识" Binding="{Binding recoil}" IsReadOnly="True"/>
<DataGridTextColumn Width="120" Header="领取数" Binding="{Binding quantity}" IsReadOnly="True" />
<DataGridTextColumn Width="120" Header="用量" Binding="{Binding qty}" IsReadOnly="False">
</DataGridTextColumn>
<DataGridTextColumn Width="100" Header="母单" Binding="{Binding parent_work_order}" />
<DataGridTextColumn Width="150" Header="备注" Binding="{Binding remark}" IsReadOnly="False" />
<DataGridTextColumn Width="120" Header="实际用量" Binding="{Binding qty}" IsReadOnly="False"></DataGridTextColumn>
<DataGridTextColumn Width="100" Header="母单" Binding="{Binding parent_work_order}" IsReadOnly="True" Visibility="Hidden"/>
<DataGridTextColumn Width="180" Header="母单" Binding="{Binding workorder_code_sap}" IsReadOnly="True" />
<DataGridTextColumn Width="100" Header="备注" Binding="{Binding remark}" IsReadOnly="False" />
<!--<DataGridTextColumn Width="250" Header="物料组" Binding="{Binding productGroup}" IsReadOnly="True"/>
<DataGridTextColumn Width="250" Header="组名称" Binding="{Binding productGroupName}" IsReadOnly="True"/>-->
</DataGrid.Columns>
</DataGrid>
<Label x:Name="tbMsg" Width="600" Height="60" Grid.Row="1" Grid.ColumnSpan="2" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" VerticalAlignment="Center" FontSize="24" Foreground="Red" FontWeight="Bold"></Label>
<CheckBox Content="最终报工" Height="auto" Margin="15,0,0,0" FontSize="10" ToolTip="选择后将结束该工单" Grid.Row="1" IsChecked="False" HorizontalAlignment="Left" VerticalContentAlignment="Center" Click="xuanze9_Click" Name="xuanze9" Checked="xuanze9_Checked">
<Label x:Name="tbMsg" Width="600" Height="40" Grid.Row="1" Grid.ColumnSpan="2" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" VerticalAlignment="Center" FontSize="24" Foreground="Red" FontWeight="Bold"></Label>
<CheckBox Content="最终报工" Height="auto" Grid.Row="2" Margin="15,20,0,0" FontSize="10" ToolTip="选择后将结束该工单" IsChecked="False" HorizontalAlignment="Left" VerticalContentAlignment="Center" Click="xuanze9_Click" Name="xuanze9" Checked="xuanze9_Checked">
<CheckBox.LayoutTransform >
<ScaleTransform ScaleX="2" ScaleY="2" />
</CheckBox.LayoutTransform>
</CheckBox>
<Button x:Name="btnOK" Grid.Row="2" Grid.Column="0" Width="120" Height="43" Content="确定" Margin="3,-20,0,0" Background="#2F82E7" Foreground="White" FontSize="22" FontWeight="Bold" Click="btnOK_Click"/>
<Button x:Name="btnCancel" Grid.Row="2" Grid.Column="1" Width="120" Height="43" Content="取消" Margin="3,-20,0,0" FontWeight="Bold" FontSize="22" Click="btnCancel_Click"/>
<Button x:Name="btnOK" Grid.Row="2" Grid.Column="1" Style="{StaticResource btnKey}" Content="确定" Margin="30,20,20,0" Click="btnOK_Click"/>
<Button x:Name="btnCancel" Grid.Row="2" Grid.Column="1" Style="{StaticResource btnCancelKey}" Background="Gray" Content="取消" Margin="30,20,170,0" Click="btnCancel_Click"/>
</Grid>
</Grid>
</Window>

@ -48,6 +48,13 @@ namespace XGLFinishPro.Views
public string _siteCode = "";
DataRowView selectedRow = null;
int sortNo = 0; //定义一个整数,记录子集级数
Dictionary<int, TextBox> dynamicWorkTimeTextBoxes = new Dictionary<int, TextBox>();
Dictionary<int, TextBox> dynamicUserCountTextBoxes = new Dictionary<int, TextBox>();
Dictionary<int, string> dicWorkTime = new Dictionary<int, string>();
Dictionary<int, string> dicUserCount = new Dictionary<int, string>();
DataTable dtCosumeData = null;
public ExecReportWorkWin()
{
InitializeComponent();
@ -83,8 +90,10 @@ namespace XGLFinishPro.Views
this._workOrdercode = selectedRow["workorder_code"].ToString();
this.lbCurrOrderNo.Content = selectedRow["workorder_code"].ToString();
this._workOrderId = selectedRow["workorder_id"].ToString();
this.txtQuantity.Text = selectedRow["batch_quantity"].ToString();
object obi = selectedRow["batch_quantity"];
_orderQuntity = selectedRow["quantity_split"].ToString();
this.txtQuantity.Text = selectedRow["batch_quantity"].ToString();
this.comboBoxBatch.Text = selectedRow["batch_code"].ToString();
_siteCode = siteCode;
}
@ -149,22 +158,56 @@ namespace XGLFinishPro.Views
this.txtUserCount.Focus();
return;
}
if (!CheckWorkTimeDynamicTextBox())
if (dynamicWorkTimeTextBoxes.Count > 0)
{
return;
if (!CheckWorkTimeDynamicTextBox())
{
return;
}
}
if (!CheckUserCountDynamicTextBox())
if (dynamicWorkTimeTextBoxes.Count > 0)
{
return;
if (!CheckUserCountDynamicTextBox())
{
return;
}
}
if (comboBoxBatch.Items.Count <= 2)//小于等于2的时候代表只有一个批次必须最终报工
{
if (_isEndReport == false)
{
this.tbMsg.Content = "该工单只有一个批次,必须勾选最终报工!";
// return;
CustomMessageBoxResult result = CustomMessageBox.Show("该批次为最后一个批次,如果需要最终报工请点【取消】按钮!!!", CustomMessageBoxButton.OKCancel, CustomMessageBoxIcon.Warning);
if (result == CustomMessageBoxResult.Cancel)
return;
//this.tbMsg.Content = "该工单只有一个批次,必须勾选最终报工!";
// return;
}
}
else
{
//判断是否为最后一个批次,如果是最后一个批次,则必须最终报工
DataTable dtCount = userDbWareHouse.GetBatchReportedCount(_workOrdercode);
if (dtCount != null && dtCount.Rows.Count > 0)
{
int reportedCount = Convert.ToInt32(dtCount.Rows[0][0].ToString());
//下拉框里有一个空行判断报工数量比批次号少1的时候证明是最后一次报工
if (reportedCount >= comboBoxBatch.Items.Count - 2)
{
//判断当前批次是不是已报工,针对一个批次多次报工实际不是最后一个批次的时候触发的提示,false 代表不是此批次最后一个批次
bool isLastBatch = userDbWareHouse.IsLastBatchReport(this.comboBoxBatch.Text);
if (_isEndReport == false && isLastBatch)
{
CustomMessageBoxResult result = CustomMessageBox.Show("该批次为最后一个批次,如果需要最终报工请点【取消】按钮!!!", CustomMessageBoxButton.OKCancel, CustomMessageBoxIcon.Warning);
if (result == CustomMessageBoxResult.Cancel)
return;
//this.tbMsg.Content = "该批次为最后一个批次,必须勾选最终报工!";
//return;
}
}
}
}
}
catch (Exception ex)
{
@ -197,12 +240,12 @@ namespace XGLFinishPro.Views
else
{
CustomMessageBox.Show("报工失败", CustomMessageBoxButton.OK, CustomMessageBoxIcon.Error);
LogHelper.instance.log.Error("报工失败" + selectedRow["workorder_code"]);
LogHelper.instance.log.Error("报工失败1" + selectedRow["workorder_code"]);
}
}
catch (Exception ex)
{
LogHelper.instance.log.Error("报工失败" + ex.Message + selectedRow["workorder_code"]);
LogHelper.instance.log.Error("报工失败2" + ex.Message + selectedRow["workorder_code"]);
}
}
}
@ -227,7 +270,7 @@ namespace XGLFinishPro.Views
catch (Exception ex)
{
CustomMessageBox.Show("报工失败"+ ex.Message, CustomMessageBoxButton.OK, CustomMessageBoxIcon.Error);
LogHelper.instance.log.Error("报工失败" + ex.Message);
LogHelper.instance.log.Error("报工失败3" + ex.Message);
}
}
@ -246,7 +289,7 @@ namespace XGLFinishPro.Views
{
// 输入是一个有效的数字,包括小数
this.tbMsg.Content = "人员数量含有非法字符!";
dynamicUserCountTextBoxes[i].Focus();
dynamicUserCountTextBoxes[i + 1].Focus();
isScucc = false;
}
else
@ -269,7 +312,7 @@ namespace XGLFinishPro.Views
{
// 输入是一个有效的数字,包括小数
this.tbMsg.Content = "工时含有非法字符!";
dynamicWorkTimeTextBoxes[i].Focus();
dynamicWorkTimeTextBoxes[i + 1].Focus();
isScucc = false;
}
else
@ -283,25 +326,36 @@ namespace XGLFinishPro.Views
}
private bool ReportWork()
{
{
//获取报工编码
string newReportCode = "";
DataTable dtNewReportCode = formingMachineService.GetReportCode();
if (dtNewReportCode == null || dtNewReportCode.Rows.Count == 0)
try
{
newReportCode = DateTime.Now.ToString("yyyyMMdd") + "0001";
}
else
{
if (string.IsNullOrEmpty(dtNewReportCode.Rows[0]["report_code"].ToString()))
DataTable dtNewReportCode = formingMachineService.GetReportCode();
if (dtNewReportCode == null || dtNewReportCode.Rows.Count == 0)
{
newReportCode = DateTime.Now.ToString("yyyyMMdd") + "0001";
}
else
{
newReportCode = (Convert.ToInt64(dtNewReportCode.Rows[0]["report_code"].ToString()) + 1).ToString();
if (string.IsNullOrEmpty(dtNewReportCode.Rows[0]["report_code"].ToString()))
{
newReportCode = DateTime.Now.ToString("yyyyMMdd") + "0001";
}
else
{
newReportCode = (Convert.ToInt64(dtNewReportCode.Rows[0]["report_code"].ToString()) + 1).ToString();
}
}
}
catch (Exception ex)
{
LogHelper.instance.log.Error("报工失败:获取报工编码时发生异常:" + ex.Message);
CustomMessageBox.Show("报工失败:获取报工编码时发生异常:" + ex.Message, CustomMessageBoxButton.OK, CustomMessageBoxIcon.Error);
return false;
}
string isEndReport = _isEndReport == true ? "1" : "0";
//bool issucc = formingMachineService.ExecuteReportWork(selectedRow, _orderQuntity, _workQuntity, newReportCode, _workTime, _useMan, _costCenter, batchCode, isEndReport, _deviceCode);
@ -346,12 +400,15 @@ namespace XGLFinishPro.Views
//获取第二列的值
int columnIndex = 1; // 列索引,这里假设为第一列
if (_isEndReport.Value == true)
if (_isEndReport.Value == true || selectedRow["status"].ToString().Equals("w4"))//20240424添加预报工功能暂停状态下添加消耗数据录入功能
{
CreateBaseQty();//将=0的根据公式填充进去
foreach (var row in dgConsumeInfo.Items)
{
var selectedConsumeRow = (row as DataRowView);
var qty = selectedConsumeRow["qty"].ToString() == "" ? "0" : selectedConsumeRow["qty"].ToString();
var remark = selectedConsumeRow["remark"].ToString();
string insertConsumeSql = formingMachineService.GetInsertConsumeInfoSql(selectedConsumeRow, newReportCode, _siteCode);
@ -444,12 +501,8 @@ namespace XGLFinishPro.Views
}
int sortNo = 0; //定义一个整数,记录子集级数
Dictionary<int, TextBox> dynamicWorkTimeTextBoxes = new Dictionary<int, TextBox>();
Dictionary<int, TextBox> dynamicUserCountTextBoxes = new Dictionary<int, TextBox>();
Dictionary<int, string> dicWorkTime = new Dictionary<int, string>();
Dictionary<int, string> dicUserCount = new Dictionary<int, string>();
private bool GetSubOrder(string workorderID)
{
try
@ -458,6 +511,7 @@ namespace XGLFinishPro.Views
DataTable dtSubOrders = userDbWareHouse.GetSubOrderInfo(workorderID);
if (dtSubOrders != null)
{
this.txtUserCount.Text = "4";
string sort = "";
switch (sortNo)
{
@ -560,7 +614,7 @@ namespace XGLFinishPro.Views
myGrid.Children.Add(myStackPanelWorkTime2);
//将人数文本框存储到数据字典中
dynamicUserCountTextBoxes.Add(sortNo, textBox);
dynamicUserCountTextBoxes.Add(sortNo, textBoxUserCount);
//stackPanelFather.Children.Add(myStackPanelWorkTime);
//}
@ -619,8 +673,8 @@ namespace XGLFinishPro.Views
private void InitConsumeData()
{
DataTable dt = userDbWareHouse.GetCosumeData(_workOrdercode);
if (dt == null)
dtCosumeData = userDbWareHouse.GetCosumeData(_workOrdercode);
if (dtCosumeData == null || dtCosumeData.Rows.Count == 0)
{
this.tbMsg.Content = "没有找到该工单的消耗信息";
//CustomMessageBox.Show("没有维护成本中心,请联系管理员!", CustomMessageBoxButton.OK, CustomMessageBoxIcon.Warning);
@ -628,8 +682,23 @@ namespace XGLFinishPro.Views
}
//绑定
dgConsumeInfo.ItemsSource = dt.DefaultView;
dgConsumeInfo.ItemsSource = dtCosumeData.DefaultView;
}
private void CreateBaseQty()
{
if (_siteCode == "")
return;
//生成推荐实际消耗量
double rate = GetOrderRate();
if (rate == 0)
return;
foreach (System.Data.DataRow item in dtCosumeData.Rows)
{
//变更为只有等于0的时候才填值
if (item["qty"].ToString().Equals("0"))
item["qty"] = Math.Round(Convert.ToDouble(item["quantity"]) * rate, 2);
}
}
private void txtQuantity_TextChanged(object sender, TextChangedEventArgs e)
@ -740,22 +809,27 @@ namespace XGLFinishPro.Views
int rowIndex = e.Row.GetIndex();
int colIndex = dgConsumeInfo.Columns.IndexOf(textColumn);
// 获取输入的值
string newValue = textBox.Text;
// 执行你的验证逻辑,这里以整数为例
if (!Regex.IsMatch(newValue, @"^\d+(\.\d+)?$"))
//只限制用量的那一列,其余的不加限制
if (colIndex == 7)
{
// 输入的不是整数,可以执行相应的操作,例如还原之前的值或显示错误消息等
// 获取输入的值
string newValue = textBox.Text;
CustomMessageBox.Show("请输入整数或者小数!", CustomMessageBoxButton.OK, CustomMessageBoxIcon.Warning);
// 执行你的验证逻辑,这里以整数为例
if (!Regex.IsMatch(newValue, @"^\d+(\.\d+)?$"))
{
// 输入的不是整数,可以执行相应的操作,例如还原之前的值或显示错误消息等
// 还原之前的值
dgConsumeInfo.CancelEdit();
CustomMessageBox.Show("请输入整数或者小数!", CustomMessageBoxButton.OK, CustomMessageBoxIcon.Warning);
// 或者清除输入的值
textBox.Text = string.Empty;
// 还原之前的值
dgConsumeInfo.CancelEdit();
// 或者清除输入的值
textBox.Text = string.Empty;
}
}
}
}
}
@ -770,6 +844,8 @@ namespace XGLFinishPro.Views
if (xuanze9.IsChecked == true)
{
_isEndReport = true;
//dgConsumeInfo
}
else
{
@ -777,6 +853,41 @@ namespace XGLFinishPro.Views
}
}
private double GetOrderRate()
{
if (string.IsNullOrEmpty(this.txtQuantity.Text))
{
this.tbMsg.Content = "报工数量不能为空";
this.txtQuantity.Focus();
return 0;
}
if (!Regex.IsMatch(this.txtQuantity.Text, @"^\d+(\.\d+)?$"))
{
// 输入是一个有效的数字,包括小数
this.tbMsg.Content = "报工数量非法字符!";
this.txtQuantity.Focus();
return 0;
}
double rate = 0;
string workOrder = this.lbCurrOrderNo.Content.ToString();
DataTable dt = formingMachineService.GetOrderReportSumQty(workOrder);
//如果没报过工,按照只有一个批次处理
if (dt == null || dt.Rows.Count == 0)
{
double qty = Convert.ToDouble(this.txtQuantity.Text);
rate = qty / Convert.ToDouble(_orderQuntity);
}
else
{
double qty = Convert.ToDouble(dt.Rows[0][0])+ Convert.ToDouble(this.txtQuantity.Text);
rate = qty / Convert.ToDouble(_orderQuntity);
}
return rate;
}
//private void txtFOUserCount_TextChanged(object sender, TextChangedEventArgs e)
//{
// if (!Regex.IsMatch(this.txtFOUserCount.Text, @"^\d+$"))

@ -501,10 +501,9 @@ Background="#F2F3F5"
</DataGridTemplateColumn>
<!--<DataGridTextColumn Width="60" Header="母单" Binding="{Binding parent_order,Converter={StaticResource ParentOrderConverter}}"/>-->
<DataGridTextColumn Width="200" Header="SAP工单" Binding="{Binding workorder_code_sap}"/>
<DataGridTextColumn Width="200" Header="工单/SFC" Binding="{Binding workorder_code}" />
<!--<DataGridTextColumn Width="120" Header="RFID" Binding="{Binding rfid}"/>-->
<DataGridTextColumn Width="480" Header="产品名称" Binding="{Binding product_name}" />
<DataGridTextColumn Width="380" Header="批次号" Binding="{Binding batch_code}" />
<DataGridTextColumn Width="320" Header="批次号" Binding="{Binding batch_code}" />
<DataGridTextColumn Width="100" Header="订单数量" Binding="{Binding quantity_split}" />
@ -515,13 +514,18 @@ Background="#F2F3F5"
</Style>
</DataGridTextColumn.ElementStyle>-->
</DataGridTextColumn>
<DataGridTextColumn Width="80" Header="批次状态" Binding="{Binding batchStatus,Converter={StaticResource BatchStatusConverter}}" />
<DataGridTextColumn Width="120" Header="质检状态" Binding="{Binding qc_status,Converter={StaticResource MyConverter}}" />
<DataGridTextColumn Width="100" Header="批次数量" Binding="{Binding batch_quantity}" />
<DataGridTextColumn Width="100" Header="报工数量" Binding="{Binding batchQty}" />
<DataGridTextColumn Width="100" Header="剩余数量" Binding="{Binding diffQty}" />
<DataGridTextColumn Width="100" Header="批次状态" Binding="{Binding batchStatus,Converter={StaticResource BatchStatusConverter}}" />
<DataGridTextColumn Width="100" Header="质检状态" Binding="{Binding qc_status,Converter={StaticResource MyConverter}}" />
<DataGridTextColumn Width="100" Header="质检结果" Binding="{Binding qc_result,Converter={StaticResource MyConverter}}" />
<!--<DataGridTextColumn Width="140" Header="工单完成数" Binding="{Binding attr1}" />
<DataGridTextColumn Width="180" Header="当前机台完成数" Binding="{Binding totalCount}" />-->
<DataGridTextColumn Width="180" Header="班次" Binding="{Binding shift_desc}" />
<DataGridTextColumn Width="250" Header="产品编码" Binding="{Binding product_code}" />
<DataGridTextColumn Width="180" Header="批次数量" Binding="{Binding batch_quantity}" />
<DataGridTextColumn Width="200" Header="工单/SFC" Binding="{Binding workorder_code}" />
<DataGridTextColumn Width="180" Header="工单code" Visibility="Hidden" Binding="{Binding workorder_id}" />
<DataGridTextColumn Width="100" Header="生产顺序" Binding="{Binding sort_no}" />
<DataGridTextColumn Width="250" Header="计划时间" Binding="{Binding plan_time, StringFormat={}{0:yyyy-MM-dd HH:mm:ss}}" />

@ -14,6 +14,7 @@ using XGL.Models.Model;
using XGL.Models.Model.FoamingMac;
using XGL.Models.Model.OrderPrepare;
using XGL.Thrift;
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
namespace XGLFinishPro.Views
@ -100,7 +101,7 @@ namespace XGLFinishPro.Views
timerDeciveState.Interval = Utils.GetAppSetting("GetDeviceStateInterval") == "" ? 15000 : Convert.ToInt32(Utils.GetAppSetting("GetDeviceStateInterval"));
timerDeciveState.Elapsed += TimerDeciveState_Elapsed;
timerDeciveState.Start();
Complete_Click(null,null);
Complete_Click(null, null);
GetWorkOrderInfo();
}
string isbaiye;
@ -303,7 +304,7 @@ namespace XGLFinishPro.Views
//var selectedRow = dgWorkOrderInfo.SelectedItem as FoamingMacModel;
if (selectedRow == null)
{
MessageBox.Show("请选择你要暂停的工单!", "温馨提示", MessageBoxButton.OK, MessageBoxImage.Warning);
CustomMessageBox.Show("请选择你要暂停的工单!", CustomMessageBoxButton.OK, CustomMessageBoxIcon.Warning);
return;
}
@ -311,23 +312,22 @@ namespace XGLFinishPro.Views
string currStatus = selectedRow["status"].ToString();//.status;
if (currStatus != "w2")
{
MessageBox.Show("只有活动中的工单才支持暂停!", "温馨提示", MessageBoxButton.OK, MessageBoxImage.Warning);
CustomMessageBox.Show("只有活动中的工单才支持暂停!", CustomMessageBoxButton.OK, CustomMessageBoxIcon.Warning);
return;
}
PauseOrderWin pauseOrderWin = new PauseOrderWin();
if (pauseOrderWin.ShowDialog() == true)
{
PauseRecoverOrderS(workordercode,"w4", pauseOrderWin);
PauseRecoverOrderS(workordercode, "w4", pauseOrderWin);
GetWorkOrderInfo();
}
//MessageBoxResult result = MessageBox.Show("你确定要暂停该工单吗?", "温馨提示", MessageBoxButton.YesNo, MessageBoxImage.Information);
//if (result == MessageBoxResult.No)
// return;
// return;
}
private bool PauseRecoverOrderS(string workordercode,string status, PauseOrderWin pauseOrderWin)
private bool PauseRecoverOrderS(string workordercode, string status, PauseOrderWin pauseOrderWin)
{
bool updatestatus = formingMachineService.UpdateWorkOrder(workordercode, status, pauseOrderWin.remark, pauseOrderWin.type, deviceCode);
if (!updatestatus)
@ -353,14 +353,22 @@ namespace XGLFinishPro.Views
var selectedRow = (dgWorkOrderInfo.SelectedItem as DataRowView);
if (selectedRow == null)
{
MessageBox.Show("请选择你要恢复的工单!", "温馨提示", MessageBoxButton.OK, MessageBoxImage.Warning);
CustomMessageBox.Show("请选择你要恢复的工单!", CustomMessageBoxButton.OK, CustomMessageBoxIcon.Warning);
return;
}
int orderCount = GetActivedOrdersCount(this.deviceCode, LoginUser.WorkDate);
if (orderCount >= 1)
{
CustomMessageBox.Show("已有活动中的工单,请先报工再开始下一个工单!", CustomMessageBoxButton.OK, CustomMessageBoxIcon.Warning);
return;
}
var workordercode = selectedRow["workorder_code"].ToString();//.workorder_code;
string currStatus = selectedRow["status"].ToString();//.status;
if (currStatus != "w4")
{
MessageBox.Show("只有暂停中的工单才支持恢复!", "温馨提示", MessageBoxButton.OK, MessageBoxImage.Warning);
CustomMessageBox.Show("只有暂停中的工单才支持恢复!", CustomMessageBoxButton.OK, CustomMessageBoxIcon.Warning);
return;
}
//MessageBoxResult result = MessageBox.Show("你确定要恢复该工单吗?", "温馨提示", MessageBoxButton.YesNo, MessageBoxImage.Information);
@ -439,20 +447,23 @@ namespace XGLFinishPro.Views
CustomMessageBox.Show("请选择你要报工的工单!", CustomMessageBoxButton.OK, CustomMessageBoxIcon.Warning);
return;
}
if (!selectedRow["status"].ToString().Equals("w2"))
if (!selectedRow["status"].ToString().Equals("w2") && !selectedRow["status"].ToString().Equals("w4"))
{
CustomMessageBox.Show("你选择的工单不能报工!", CustomMessageBoxButton.OK, CustomMessageBoxIcon.Warning);
string status = selectedRow["status"].ToString();
string st = status.Equals("w1") ? "未派发" : status.Equals("w3") ? "已报工" : status.Equals("w0") ? "未派发" : "已暂停";
CustomMessageBox.Show("你选择的工单不能报工,请检查工单状态,当前工单状态为:"+ st, CustomMessageBoxButton.OK, CustomMessageBoxIcon.Warning);
return;
}
if (selectedRow["batchStatus"].ToString().Equals("0"))
{
CustomMessageBox.Show("你选择的该批次不能报工!", CustomMessageBoxButton.OK, CustomMessageBoxIcon.Warning);
return;
}
//20240424预报工功能不能限制批次报工次数
//if (selectedRow["batchStatus"].ToString().Equals("0"))
//{
// CustomMessageBox.Show("你选择的该批次不能报工!", CustomMessageBoxButton.OK, CustomMessageBoxIcon.Warning);
// return;
//}
ExecReportWorkWin execReport = new ExecReportWorkWin(selectedRow, deviceCode, Utils.GetAppSetting("SiteCode")) ;
ExecReportWorkWin execReport = new ExecReportWorkWin(selectedRow, deviceCode, Utils.GetAppSetting("SiteCode"));
if (execReport.ShowDialog() == true)
{
@ -518,7 +529,8 @@ namespace XGLFinishPro.Views
}
catch (Exception ex)
{
LogHelper.instance.log.Error("报工失败11>>" + ex.Message);
CustomMessageBox.Show("报工失败:" + ex.Message, CustomMessageBoxButton.OK, CustomMessageBoxIcon.Error);
}
}
@ -576,10 +588,21 @@ namespace XGLFinishPro.Views
{
if (status != "")
{
CustomMessageBox.Show("该工单不符合条件,请选择其他的工单!", CustomMessageBoxButton.OK, CustomMessageBoxIcon.Warning);
string st = status.Equals("w1") ? "未派发" : status.Equals("w3") ? "已报工" : status.Equals("w0") ? "未派发" : "已暂停";
CustomMessageBox.Show("该工单不符合条件,请检查工单状态,当前工单状态为:" + st, CustomMessageBoxButton.OK, CustomMessageBoxIcon.Warning);
return;
}
}
CustomMessageBoxResult result = CustomMessageBox.Show("你确定要开始工单么?", CustomMessageBoxButton.OKCancel, CustomMessageBoxIcon.Warning);
if (result == CustomMessageBoxResult.Cancel)
return;
//2024-04-23赵啸林要求添加一条产线同一天只能有一个活动状态下的工单如果有未报工的则不允许开始新的工单
int orderCount = GetActivedOrdersCount(this.deviceCode, LoginUser.WorkDate);
if (orderCount >= 1)
{
CustomMessageBox.Show("已有活动中的工单,请先报工再开始下一个工单!", CustomMessageBoxButton.OK, CustomMessageBoxIcon.Warning);
return;
}
//更新工单状态
if (!UpdateOrderStatus(workorderID))
{
@ -591,14 +614,24 @@ namespace XGLFinishPro.Views
string materialCode = (dgWorkOrderInfo.SelectedItem as DataRowView)["product_code"].ToString();
string materialDesc = (dgWorkOrderInfo.SelectedItem as DataRowView)["product_name"].ToString();
userDbWareHouse.InsertOperationLog(workorderID, "w2", "", "开始工单", deviceCode, materialCode, materialDesc);
await CallCheckApi("checkTypeSCXJ");
TimerDeciveState_Elapsed(null,null);
// await CallCheckApi("checkTypeSCXJ");20240403赵啸林因为切线方案调整要求取消上位机生成巡检任务的功能
TimerDeciveState_Elapsed(null, null);
}
}
private int GetActivedOrdersCount(string deviceCode, string workDate)
{
DataTable dtActivedOrdersQty = userDbWareHouse.GetActivedOrdersQty(deviceCode, workDate);
if (dtActivedOrdersQty == null)
return 0;
int count = Convert.ToInt32(dtActivedOrdersQty.Rows[0][0]);
return count;
}
private bool UpdateOrderStatus(string workorderID)
{
//更新工单状态
var updatestatus = userDbWareHouse.UpdateSycnFlag(workorderID,deviceCode);
var updatestatus = userDbWareHouse.UpdateSycnFlag(workorderID, deviceCode);
if (!updatestatus)
{
CustomMessageBox.Show("开始工单失败!", CustomMessageBoxButton.OK, CustomMessageBoxIcon.Warning);
@ -624,7 +657,7 @@ namespace XGLFinishPro.Views
}
}
private void GetQitaolv_Click(object sender, RoutedEventArgs e)
{
QitaoLvUC lanJu_QitaoLv = new QitaoLvUC(_workOrderCode);
@ -642,8 +675,8 @@ namespace XGLFinishPro.Views
CustomMessageBox.Show("请对母单使用叫料功能!", CustomMessageBoxButton.OK, CustomMessageBoxIcon.Warning);
return;
}
}
}
private async void btnFirstCheck_Click(object sender, RoutedEventArgs e)
{
if (dgWorkOrderInfo.SelectedItems.Count == 0)
@ -651,7 +684,8 @@ namespace XGLFinishPro.Views
CustomMessageBox.Show("请选择要首件检验的工单!", CustomMessageBoxButton.OK, CustomMessageBoxIcon.Warning);
return;
}
try
{
string status1 = (dgWorkOrderInfo.SelectedItem as DataRowView)["workorder_code"].ToString();
@ -661,22 +695,28 @@ namespace XGLFinishPro.Views
{
if (status != "")
{
CustomMessageBox.Show("该工单不符合条件,请选择其他的工单!", CustomMessageBoxButton.OK, CustomMessageBoxIcon.Warning);
string st = status.Equals("w1") ? "未派发" : status.Equals("w3") ? "已报工" : status.Equals("w0") ? "未派发" : "已暂停";
CustomMessageBox.Show("该工单不符合条件,请检查工单状态,当前工单状态为:"+ st, CustomMessageBoxButton.OK, CustomMessageBoxIcon.Warning);
return;
}
}
CustomMessageBoxResult result = CustomMessageBox.Show("你确定要首检么?", CustomMessageBoxButton.OKCancel, CustomMessageBoxIcon.Warning);
if (result == CustomMessageBoxResult.Cancel)
return;
string qcStatus = (dgWorkOrderInfo.SelectedItem as DataRowView)["qc_status"].ToString();
if (qcStatus.Equals("1") || qcStatus.Equals("2"))
{
if (qcStatus != "")
{
CustomMessageBox.Show("该工单已完成质检,请不要重复创建质检任务!", CustomMessageBoxButton.OK, CustomMessageBoxIcon.Warning);
return;
}
}
//2024-04-16添加不限制首检确认的功能
//string qcStatus = (dgWorkOrderInfo.SelectedItem as DataRowView)["qc_status"].ToString();
//if (qcStatus.Equals("1") || qcStatus.Equals("2"))
//{
// if (qcStatus != "")
// {
// CustomMessageBox.Show("该工单已完成质检,请不要重复创建质检任务!", CustomMessageBoxButton.OK, CustomMessageBoxIcon.Warning);
// return;
// }
//}
//首件检验
await CallCheckApi("checkTypeSC");
}
@ -685,7 +725,7 @@ namespace XGLFinishPro.Views
LogHelper.instance.log.Error("首检检验发生异常>>" + ex.Message);
CustomMessageBox.Show("首检检验发生异常:" + ex.Message, CustomMessageBoxButton.OK, CustomMessageBoxIcon.Error);
}
}
/// <summary>
@ -698,7 +738,7 @@ namespace XGLFinishPro.Views
string workorderCode = (dgWorkOrderInfo.SelectedItem as DataRowView)["workorder_code"].ToString();
string workorderID = (dgWorkOrderInfo.SelectedItem as DataRowView)["workorder_id"].ToString();
string batchCode = (dgWorkOrderInfo.SelectedItem as DataRowView)["batch_code"].ToString();
//调用首件检验接口
string apiUrl = formingMachineService.GetInterfaceUrl("createCheckProduceTask");
FirstCheckModel firstCheck = new FirstCheckModel();
@ -714,7 +754,7 @@ namespace XGLFinishPro.Views
taskName = "首件检验任务";
firstCheck.incomeBatchNo = (dgWorkOrderInfo.SelectedItem as DataRowView)["batch_code"].ToString();
}
firstCheck.orderNo = workorderCode;
firstCheck.materialName = (dgWorkOrderInfo.SelectedItem as DataRowView)["product_name"].ToString();
firstCheck.materialCode = (dgWorkOrderInfo.SelectedItem as DataRowView)["product_code"].ToString();
@ -741,7 +781,7 @@ namespace XGLFinishPro.Views
Rootobjectresu result = Utils.DeJson<Rootobjectresu>(await restClient.PostAsync(apiUrl, jsonContent));
if (result.code == 200)
{
//巡检
@ -767,7 +807,7 @@ namespace XGLFinishPro.Views
LogHelper.instance.log.Info($"更新{taskName}状态失败>>" + result.msg);
}
}
}
else
{
@ -782,7 +822,7 @@ namespace XGLFinishPro.Views
string apiUrl = formingMachineService.GetInterfaceUrl("machineRepair");
MachineRepairWin machineRepairWin = new MachineRepairWin(apiUrl);
machineRepairWin.ShowDialog();
}
private void btnSalaryCal_Click(object sender, RoutedEventArgs e)
@ -811,7 +851,7 @@ namespace XGLFinishPro.Views
string workOrderCode = selectedRow["workorder_code"].ToString();
string sapWorkOrderCode = selectedRow["workorder_code_sap"].ToString();
PieceSalaryCalWin pieceSalaryCalWin = new PieceSalaryCalWin(prodCode, prodName, deviceCode, workOrderCode,sapWorkOrderCode);
PieceSalaryCalWin pieceSalaryCalWin = new PieceSalaryCalWin(prodCode, prodName, deviceCode, workOrderCode, sapWorkOrderCode);
pieceSalaryCalWin.ShowDialog();
}
}

@ -9,7 +9,7 @@
Width="1920"
Height="280"
mc:Ignorable="d" Loaded="UserControl_Loaded">
<UserControl.Resources>
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
@ -24,7 +24,8 @@
<Setter Property="BorderThickness" Value="0 0 1 1" />
<Setter Property="BorderBrush" Value="LightGray" />
</Style>
<convert:MyValueConverter x:Key="MyConverter"/>
</ResourceDictionary>
</UserControl.Resources>
@ -65,11 +66,11 @@
<DataGridTextColumn Width="250" Header="操作类型" Binding="{Binding operation_type}"/>
<DataGridTextColumn Width="200" Header="时间" Binding="{Binding operation_time, StringFormat={}{0:yyyy-MM-dd HH:mm:ss}}"/>
<!--<DataGridTextColumn Width="200" Header="时长" Binding="{Binding operation_desc}"/>-->
<DataGridTextColumn Width="250" Header="旧值" Binding="{Binding order_code}"/>
<DataGridTextColumn Width="250" Header="新值" Binding="{Binding order_code}"/>
<DataGridTextColumn Width="250" Header="旧值" Binding="{Binding old_value,Converter={StaticResource MyConverter}}"/>
<DataGridTextColumn Width="250" Header="新值" Binding="{Binding new_value,Converter={StaticResource MyConverter}}"/>
<DataGridTextColumn Width="250" Header="工单" Binding="{Binding order_code}"/>
<DataGridTextColumn Width="250" Header="暂停描述" Binding="{Binding operation_desc}"/>
<DataGridTextColumn Width="*" Header="描述" Binding="{Binding user_name}"/>
<DataGridTextColumn Width="250" Header="描述" Binding="{Binding operation_desc}"/>
<DataGridTextColumn Width="*" Header="备注" Binding="{Binding remark}"/>
<DataGridTextColumn Width="*" Header="人员" Binding="{Binding user_name}"/>
</DataGrid.Columns>
</DataGrid>

@ -91,7 +91,7 @@
<TextBlock Text="{Binding childprocess_name}"
VerticalAlignment="Center"
Margin="35,0,0,0" FontWeight="Bold" Foreground="Black"
Margin="55,0,0,0" FontWeight="Bold" Foreground="Black"
Style="{DynamicResource ListBoxItemContent_TextBlock_Style}"/>
<Grid
@ -297,7 +297,8 @@
<Button x:Name="btnStepConfirm" Style="{StaticResource btnKey}" Background="#2B7EE6" Content="确认" Width="100" Height="30" Click="btnConfirm_Click"/>
</StackPanel>
</Popup>
<ListBox x:Name="lstSelectedStep" Grid.Row="1" Grid.Column="0" Background="#F2F3F5" Style="{DynamicResource ApplicantList_ListBox_Style}" ItemContainerStyle="{DynamicResource ApplicantList_ListBoxItem_Style}" SelectionMode="Single" SelectionChanged="lstSelectedStep_SelectionChanged">
<ListBox x:Name="lstSelectedStep" Grid.Row="1" Grid.Column="0" Background="#F2F3F5" Style="{DynamicResource ApplicantList_ListBox_Style}"
ItemContainerStyle="{DynamicResource ApplicantList_ListBoxItem_Style}" SelectionMode="Single" SelectionChanged="lstSelectedStep_SelectionChanged">
</ListBox>
<Grid Grid.Row="0" Grid.RowSpan="2" Grid.Column="1">

@ -157,6 +157,14 @@ namespace XGLFinishPro.Views
private void Window_Loaded(object sender, RoutedEventArgs e)
{
//新增将LineCode改为SAPCode的功能20240325
DataSet ds = prodDBService.GetSapCode(_deviceCode);
if (ds == null)
{
CustomMessageBox.Show("请维护该线体对应的SAP编码!", CustomMessageBoxButton.OK, CustomMessageBoxIcon.Warning);
return;
}
_deviceCode = ds.Tables[0].Rows[0][0].ToString();
this.lstSelectedStep.ItemsSource = GetStepData();
GetData();
}
@ -167,7 +175,6 @@ namespace XGLFinishPro.Views
if (dt == null)
{
this.dgCreatedUserInfo.ItemsSource = null;
CustomMessageBox.Show("请配置工序数据之后再试!!!", CustomMessageBoxButton.OK, CustomMessageBoxIcon.Question);
}
else
{
@ -178,7 +185,7 @@ namespace XGLFinishPro.Views
private void btnCloseWin_Click(object sender, RoutedEventArgs e)
{
if (CustomMessageBox.Show("确定要关闭此窗口吗?", CustomMessageBoxButton.YesNo, CustomMessageBoxIcon.Question) == CustomMessageBoxResult.No)
if (CustomMessageBox.Show("确定要关闭此窗口吗?", CustomMessageBoxButton.OKCancel, CustomMessageBoxIcon.Question) == CustomMessageBoxResult.Cancel)
return;
this.Close();
}
@ -261,9 +268,11 @@ namespace XGLFinishPro.Views
CreateUnitPriceSqlList.Add(delSql);
//prodDBService.DelUnitPriceData(_workOrderCode, _childprocessCode, _deviceCode);
}
string sapCode = _deviceCode;//ds.Tables[0].Rows[0][0].ToString();
foreach (sys_user item in checkedRowsCache)
{
string sql = prodDBService.GetCreateUnitPriceInfo(item, _workOrderCode, _sapWorkOrderCode, _productCode, _productName, _childprocessCode, _childprocessName,_deviceCode);
string sql = prodDBService.GetCreateUnitPriceInfo(item, _workOrderCode, _sapWorkOrderCode, _productCode, _productName, _childprocessCode, _childprocessName, sapCode);
CreateUnitPriceSqlList.Add(sql);
}
//之前如果已经插入了,先删除,
@ -332,6 +341,8 @@ namespace XGLFinishPro.Views
if (dt == null)
{
CustomMessageBox.Show("请配置工序数据之后再试!!!", CustomMessageBoxButton.OK, CustomMessageBoxIcon.Question);
lstBoxStep.ItemsSource = null;
lstBoxStep.Items.Clear();
}

Loading…
Cancel
Save