修改补码共功能

dev
liulb@mesnac.com 10 months ago
parent 6a2914f353
commit 620346a69a

@ -2751,6 +2751,11 @@
打印名称
</summary>
</member>
<member name="P:Admin.Core.Model.PrintSuppleMentBarCode.IsPrint">
<summary>
是否打印 1=>打印
</summary>
</member>
<member name="T:Admin.Core.Model.ProductOrderInfo">
<summary>
订单执行表

@ -14,7 +14,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("Admin.Core.Common")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+c53bc30072a3adeea1b0c21c91cb2d648f118f60")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+6a2914f353b30226bd3c46eef3e158fc962c6d2c")]
[assembly: System.Reflection.AssemblyProductAttribute("Admin.Core.Common")]
[assembly: System.Reflection.AssemblyTitleAttribute("Admin.Core.Common")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

@ -1 +1 @@
37bd2ff229b560659038609c60a65eaf79418032b62ff4b92113ec69c6a5960d
42ec2e380fe38d40563f36473402d454f6b076559d97ee85a6c2890d9161cb18

@ -14,7 +14,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("Admin.Core.EventBus")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+403132f49e050644d1c67839de33f621806901e3")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+6a2914f353b30226bd3c46eef3e158fc962c6d2c")]
[assembly: System.Reflection.AssemblyProductAttribute("Admin.Core.EventBus")]
[assembly: System.Reflection.AssemblyTitleAttribute("Admin.Core.EventBus")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

@ -1 +1 @@
7dc52543e1ef22570d04e65c59a24332802dd0706a47c76219638347d0f0e954
527b0e112f9432814102176b98ab99ba61c1e9b0426943a4532270d50a0bc731

@ -14,7 +14,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("Admin.Core.Extensions")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+c53bc30072a3adeea1b0c21c91cb2d648f118f60")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+6a2914f353b30226bd3c46eef3e158fc962c6d2c")]
[assembly: System.Reflection.AssemblyProductAttribute("Admin.Core.Extensions")]
[assembly: System.Reflection.AssemblyTitleAttribute("Admin.Core.Extensions")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

@ -1 +1 @@
b61f2f3e350ff49543683ff93e92534609858a2af46aa25badec7272acbe6855
0bd8c7c10e8706eda7cd0686be4aecc638184df65f561f6e0cbb4612b1b4d8b2

@ -14,7 +14,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("Admin.Core.IRepository")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+c53bc30072a3adeea1b0c21c91cb2d648f118f60")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+6a2914f353b30226bd3c46eef3e158fc962c6d2c")]
[assembly: System.Reflection.AssemblyProductAttribute("Admin.Core.IRepository")]
[assembly: System.Reflection.AssemblyTitleAttribute("Admin.Core.IRepository")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

@ -1 +1 @@
62fed852eacf591790ff01b40eab06fc537da336e7476c4ee7497dcaefff7db6
13a6ba9aaa55c3a5c050f1347666cd72115768ccdcd1926174b48a20f60d519f

@ -14,7 +14,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("Admin.Core.IService")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+c53bc30072a3adeea1b0c21c91cb2d648f118f60")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+6a2914f353b30226bd3c46eef3e158fc962c6d2c")]
[assembly: System.Reflection.AssemblyProductAttribute("Admin.Core.IService")]
[assembly: System.Reflection.AssemblyTitleAttribute("Admin.Core.IService")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

@ -1 +1 @@
995789d74271b8c3d23be86c14dce45c09267ea3bfd6164be4519e46ce7d91b8
7be8fb84c98936223c16d3b40f216dafcd65db0db33159afd40990ce9fa54678

@ -53,5 +53,12 @@ namespace Admin.Core.Model
/// </summary>
[SugarColumn(ColumnName = "PRINT_NAME")]
public string PrintName { get; set; }
/// <summary>
/// 是否打印 1=>打印
/// </summary>
[SugarColumn(ColumnName = "IS_PRINT")]
public int IsPrint { get; set; }
}
}

@ -29,7 +29,7 @@ namespace Admin.Core.Model
/// <summary>
/// 物料名称
/// </summary>
[SugarColumn(ColumnName = "MATERIAL_NAME")]
[SugarColumn(ColumnName = "MATERIAL_NAME", ColumnDataType = "NVARCHAR(128)")]
public string MaterialName { get; set; }
/// <summary>
/// 工序编号

@ -14,7 +14,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("Admin.Core.Model")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+c53bc30072a3adeea1b0c21c91cb2d648f118f60")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+6a2914f353b30226bd3c46eef3e158fc962c6d2c")]
[assembly: System.Reflection.AssemblyProductAttribute("Admin.Core.Model")]
[assembly: System.Reflection.AssemblyTitleAttribute("Admin.Core.Model")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

@ -1 +1 @@
1b712b170964f1caaacc65c929d3c29729c899f231af7a3ba55583176cca2fd1
e06bdf0ebe65ef932d0c6fd7d3baae5f10e155760c54fbb7fb60325fb50a3495

@ -14,7 +14,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("Admin.Core.Repository")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+c53bc30072a3adeea1b0c21c91cb2d648f118f60")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+6a2914f353b30226bd3c46eef3e158fc962c6d2c")]
[assembly: System.Reflection.AssemblyProductAttribute("Admin.Core.Repository")]
[assembly: System.Reflection.AssemblyTitleAttribute("Admin.Core.Repository")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

@ -1 +1 @@
efc561198173ae3698b722d3861fe5166dd13c55ff30f4dc9717b5666ce11451
3268d8102eca1f6dea32d43510b3c796d3bd7d4838bf40e973c93200629c29a8

@ -14,7 +14,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("Admin.Core.Serilog.Es")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+403132f49e050644d1c67839de33f621806901e3")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+6a2914f353b30226bd3c46eef3e158fc962c6d2c")]
[assembly: System.Reflection.AssemblyProductAttribute("Admin.Core.Serilog.Es")]
[assembly: System.Reflection.AssemblyTitleAttribute("Admin.Core.Serilog.Es")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

@ -1 +1 @@
bf5c82979746b8f9cef24fe069c3daf057e4bde435ced85bb38fcc400ecb0b6c
d0399735cc31acea60f87f26f248a937ea1b4fea77858ad3185274c66c912f12

@ -14,7 +14,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("Admin.Core.Service")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+c53bc30072a3adeea1b0c21c91cb2d648f118f60")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+6a2914f353b30226bd3c46eef3e158fc962c6d2c")]
[assembly: System.Reflection.AssemblyProductAttribute("Admin.Core.Service")]
[assembly: System.Reflection.AssemblyTitleAttribute("Admin.Core.Service")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

@ -1 +1 @@
f0342ace3869b9b2dd7e45aa4bce15647b407e7e8b010c0c6fecba7b7985c65b
602e3d4ff09d3c166749ecfcf3ba98f9f9678c6c255be546fc4b101df75abd22

@ -14,7 +14,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("Admin.Core.Tasks")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+c53bc30072a3adeea1b0c21c91cb2d648f118f60")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+6a2914f353b30226bd3c46eef3e158fc962c6d2c")]
[assembly: System.Reflection.AssemblyProductAttribute("Admin.Core.Tasks")]
[assembly: System.Reflection.AssemblyTitleAttribute("Admin.Core.Tasks")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

@ -1 +1 @@
884988e21b157fad7a1f8da431377752aad4da3380907ccff393770a33c9112b
2d524ba5bcdb8f1a42f6a39d9dbd988dcf79eda3262bc55165a1d9360b348b4f

@ -60,23 +60,12 @@ namespace Aucma.Core.BoxFoam.Business
/// <param name="spaceName">货到名称</param>
public delegate void RefreshScanMateriaCode(string materialBarCode, string materialCode, string materialName, string spaceName, string msg);
public static event RefreshScanMateriaCode RefreshScanMateriaCodeEvent;
/// <summary>
/// 初始化入库任务
/// </summary>
/// <param name="message"></param>
public delegate void RefreshInStoreTask(RealTaskInfo taskInfos);
public static event RefreshInStoreTask RefreshInStoreTaskEvent;
/// <summary>
/// 日志信息刷新
/// </summary>
/// <param name="message"></param>
public delegate void RefreshLogMessage(string message);
public static event RefreshLogMessage RefreshLogMessageEvent;
/// <summary>
/// 入库日志事件
/// </summary>
/// <param name="msg"></param>
public delegate void LogDelegate(string msg);
public delegate void LogDelegate(string msg, string color);
public static event LogDelegate LogDelegateEvent;
/// <summary>
@ -141,7 +130,7 @@ namespace Aucma.Core.BoxFoam.Business
{
if (string.IsNullOrEmpty(materialBarCode))
{
LogDelegateEvent?.Invoke("未扫到二维码信息!");
LogDelegateEvent?.Invoke("未扫到二维码信息!","Red");
Console.WriteLine($"【{DateTime.Now}】未扫到二维码信息,请重新扫码!");
return;
}
@ -149,7 +138,7 @@ namespace Aucma.Core.BoxFoam.Business
//创建入库任务
Console.WriteLine($"【{DateTime.Now}】扫码成功,物料条码:{materialBarCode}");
logHelper.Info($"扫码成功,物料条码:{materialBarCode}");
LogDelegateEvent?.Invoke($"扫码成功,物料条码:{materialBarCode}");
LogDelegateEvent?.Invoke($"扫码成功,物料条码:{materialBarCode}", "White");
#region 执行任务
string materialCode = SubString(materialBarCode);
@ -163,17 +152,15 @@ namespace Aucma.Core.BoxFoam.Business
flag = false;
try
{
LogDelegateEvent?.Invoke($"获取物料编码:{materialCode}");
Console.WriteLine($"获取物料编码:{materialCode}");
LogDelegateEvent?.Invoke($"获取物料编码:{materialCode}", "White");
bool result= obj.plc.WriteString("DB200.132", materialCode);//写入物料号
Console.WriteLine($"写入物料编码:{materialCode}");
if (result)
{
Thread.Sleep(2500);
int space = obj.plc.ReadInt16("DB200.438");//读取货道号大约1.5s 可以获取
Console.WriteLine($"物料MES码{materialBarCode},》入库货道:{space}");
logHelper.Info($"物料MES码{materialBarCode},》入库货道:{space}");
LogDelegateEvent?.Invoke($"物料MES码{materialBarCode},》物料码:{materialCode}");
LogDelegateEvent?.Invoke($"物料MES码{materialBarCode},》物料码:{materialCode}", "White");
//更新货道入库
await EnterStore(materialBarCode, space);
//更新过点数
@ -189,7 +176,7 @@ namespace Aucma.Core.BoxFoam.Business
catch (Exception ex)
{
logHelper.Error($"入库业务异常:{ex}");
LogDelegateEvent?.Invoke($"入库业务异常:{ex}");
LogDelegateEvent?.Invoke($"入库业务异常:{ex}", "Red");
Console.WriteLine($"入库业务异常:{ex.Message}");
}
finally
@ -313,6 +300,7 @@ namespace Aucma.Core.BoxFoam.Business
public async Task EnterStore(string barCode,int space)
{
//有获取不到情况,需要一直获取
string spaceCode = string.Empty;
switch (space)
{
@ -360,12 +348,12 @@ namespace Aucma.Core.BoxFoam.Business
{
string message = $"物料[{material.MaterialName}],入库成功!";
RefreshScanMateriaCodeEvent?.Invoke(material.MaterialCode, barCode, material.MaterialName, spaceCode, message); //刷新界面扫码信息
LogDelegateEvent?.Invoke($"物料[{material.MaterialName}], 入库成功!");
LogDelegateEvent?.Invoke($"物料[{material.MaterialName}], 入库成功!","White");
RefreshDataGridDelegateEvent?.Invoke();
}
else
{
LogDelegateEvent?.Invoke($"物料[{material.MaterialName}], 入库失败,任务回滚!");
LogDelegateEvent?.Invoke($"物料[{material.MaterialName}], 入库失败,任务回滚!", "Red");
logHelper.Error($"物料[{material.MaterialName}], 入库失败,任务回滚!");
}
}

@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Aucma.Core.BoxFoam.Models
{
public class ListBoxDataView
{
/// <summary>
/// 颜色
/// </summary>
public string Color { get; set; }
/// <summary>
/// 内容
/// </summary>
public string Content { get; set; }
}
}

@ -218,7 +218,7 @@ namespace Aucma.Core.BoxFoam.ViewModels
{
try
{
System.Windows.Application.Current.Dispatcher.Invoke((Action)(async () =>
System.Windows.Application.Current.Dispatcher.Invoke((Action)(() =>
{
LastShotRecordDataGrid.Clear();

@ -14,6 +14,7 @@ using System.Threading;
using Aucma.Core.BoxFoam.Business;
using Admin.Core.Model;
using System.Collections.Generic;
using Aucma.Core.BoxFoam.Models;
/*
*
*/
@ -21,8 +22,6 @@ namespace Aucma.Core.BoxFoam.ViewModels
{
public partial class IndexPageViewModel : ObservableObject
{
private ObservableCollection<dynamic> listItems = new ObservableCollection<dynamic>();
private static readonly log4net.ILog log = LogManager.GetLogger(typeof(IndexPageViewModel));
public readonly IRecordInStoreServices? _recordInstoreServices;
@ -160,14 +159,18 @@ namespace Aucma.Core.BoxFoam.ViewModels
/// listBox绑定日志
/// </summary>
/// <param name="message"></param>
private void PrintMessageToListBox(string message)
private void PrintMessageToListBox(string message, string color)
{
try
{
listItems.Add($"{DateTime.Now.ToString("HH:mm:ss")}==>{message}");
LogInfoListBox = listItems.OrderByDescending(x => x);
System.Windows.Application.Current.Dispatcher.Invoke((Action)(() =>
{
string content = $"{DateTime.Now.ToString("HH:mm:ss")}==>{message}";
ListBoxDataView view = new ListBoxDataView { Content = content, Color = color };
//listItems.Add(view);
listItems.Insert(0, view);
LogInfoListBox = listItems;
}));
}
catch (Exception ex)
{

@ -62,10 +62,10 @@
<ColumnDefinition Width="0.5*"/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition Width="0.5*"/>
<!--<ColumnDefinition/>
<ColumnDefinition Width="0.5*"/>-->
</Grid.ColumnDefinitions>
<Border Grid.Row="0" Grid.ColumnSpan="5" Background="#1157b9">
<Border Grid.Row="0" Grid.ColumnSpan="4" Background="#1157b9">
<TextBlock Text="发泡线(南)" Foreground="White" FontSize="18" FontWeight="Bold"/>
</Border>
<Border Grid.Row="1" Grid.Column="0" Background="#1157b9">
@ -156,13 +156,13 @@
<Border Grid.Row="7" Grid.Column="3">
<TextBlock Text="{Binding Production[5]}" Foreground="White" FontSize="18" FontWeight="Bold"/>
</Border>
<Border Grid.Row="0" Grid.Column="5" Grid.ColumnSpan="3" >
<Border Grid.Row="0" Grid.Column="4" Grid.ColumnSpan="4" >
<TextBlock Text="{Binding Totle,Mode=TwoWay}" Foreground="White" FontSize="30" FontWeight="Bold"/>
</Border>
<Border Grid.Row="1" Grid.Column="4" Background="#1157b9">
<!--<Border Grid.Row="1" Grid.Column="4" Background="#1157b9">
<TextBlock Text="内外模温度" Foreground="White" FontSize="18"/>
</Border>
<Border Grid.Row="2" Grid.Column="4" >
@ -206,27 +206,27 @@
<TextBlock Text="|" Foreground="White" FontSize="18" FontWeight="Bold"/>
<TextBlock Text="{Binding OutsideTemperature[5]}" Foreground="White" FontSize="18" FontWeight="Bold"/>
</WrapPanel>
</Border>
</Border>-->
<Border Grid.Row="1" Grid.Column="5" Background="#1157b9">
<Border Grid.Row="1" Grid.Column="4" Background="#1157b9">
<TextBlock Text="节拍" Foreground="White" FontSize="18"/>
</Border>
<Border Grid.Row="2" Grid.Column="5" >
<Border Grid.Row="2" Grid.Column="4" >
<TextBlock Text="{Binding Beat[0]}" Foreground="White" FontSize="18"/>
</Border>
<Border Grid.Row="3" Grid.Column="5">
<Border Grid.Row="3" Grid.Column="4">
<TextBlock Text="{Binding Beat[1]}" Foreground="White" FontSize="18"/>
</Border>
<Border Grid.Row="4" Grid.Column="5">
<Border Grid.Row="4" Grid.Column="4">
<TextBlock Text="{Binding Beat[2]}" Foreground="White" FontSize="18"/>
</Border>
<Border Grid.Row="5" Grid.Column="5">
<Border Grid.Row="5" Grid.Column="4">
<TextBlock Text="{Binding Beat[3]}" Foreground="White" FontSize="18"/>
</Border>
<Border Grid.Row="6" Grid.Column="5">
<Border Grid.Row="6" Grid.Column="4">
<TextBlock Text="{Binding Beat[4]}" Foreground="White" FontSize="18"/>
</Border>
<Border Grid.Row="7" Grid.Column="5">
<Border Grid.Row="7" Grid.Column="4">
<TextBlock Text="{Binding Beat[5]}" Foreground="White" FontSize="18"/>
</Border>
@ -234,97 +234,97 @@
<TextBlock Text="发泡线(北)" Foreground="White" FontSize="18" FontWeight="Bold"/>
</Border>
<Border Grid.Row="1" Grid.Column="6" Background="#1157b9">
<Border Grid.Row="1" Grid.Column="5" Background="#1157b9">
<TextBlock Text="夹具号" Foreground="White" FontSize="18" FontWeight="Bold"/>
</Border>
<Border Grid.Row="2" Grid.Column="6" Background="#1157b9">
<Border Grid.Row="2" Grid.Column="5" Background="#1157b9">
<TextBlock Text="1" Foreground="White" FontSize="18" FontWeight="Bold"/>
</Border>
<Border Grid.Row="3" Grid.Column="6" Background="#1157b9">
<Border Grid.Row="3" Grid.Column="5" Background="#1157b9">
<TextBlock Text="2" Foreground="White" FontSize="18" FontWeight="Bold"/>
</Border>
<Border Grid.Row="4" Grid.Column="6" Background="#1157b9">
<Border Grid.Row="4" Grid.Column="5" Background="#1157b9">
<TextBlock Text="3" Foreground="White" FontSize="18" FontWeight="Bold"/>
</Border>
<Border Grid.Row="5" Grid.Column="6" Background="#1157b9">
<Border Grid.Row="5" Grid.Column="5" Background="#1157b9">
<TextBlock Text="4" Foreground="White" FontSize="18" FontWeight="Bold"/>
</Border>
<Border Grid.Row="6" Grid.Column="6" Background="#1157b9">
<Border Grid.Row="6" Grid.Column="5" Background="#1157b9">
<TextBlock Text="5" Foreground="White" FontSize="18" FontWeight="Bold"/>
</Border>
<Border Grid.Row="7" Grid.Column="6" Background="#1157b9">
<Border Grid.Row="7" Grid.Column="5" Background="#1157b9">
<TextBlock Text="6" Foreground="White" FontSize="18" FontWeight="Bold"/>
</Border>
<Border Grid.Row="1" Grid.Column="7" Background="#1157b9">
<Border Grid.Row="1" Grid.Column="6" Background="#1157b9">
<TextBlock Text="状态" Foreground="White" FontSize="18" FontWeight="Bold"/>
</Border>
<Border Grid.Row="2" Grid.Column="7" >
<Border Grid.Row="2" Grid.Column="6" >
<Path Data="M 5,5 A 15,15 45 1 1 0,1 Z" Stroke="{Binding StatusColor[6]}" StrokeThickness="1" Fill="{Binding StatusColor[6]}" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<Border Grid.Row="3" Grid.Column="7" >
<Border Grid.Row="3" Grid.Column="6" >
<Path Data="M 5,5 A 15,15 45 1 1 0,1 Z" Stroke="{Binding StatusColor[7]}" StrokeThickness="1" Fill="{Binding StatusColor[7]}" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<Border Grid.Row="4" Grid.Column="7" >
<Border Grid.Row="4" Grid.Column="6" >
<Path Data="M 5,5 A 15,15 45 1 1 0,1 Z" Stroke="{Binding StatusColor[8]}" StrokeThickness="1" Fill="{Binding StatusColor[8]}" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<Border Grid.Row="5" Grid.Column="7" >
<Border Grid.Row="5" Grid.Column="6" >
<Path Data="M 5,5 A 15,15 45 1 1 0,1 Z" Stroke="{Binding StatusColor[9]}" StrokeThickness="1" Fill="{Binding StatusColor[9]}" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<Border Grid.Row="6" Grid.Column="7" >
<Border Grid.Row="6" Grid.Column="6" >
<Path Data="M 5,5 A 15,15 45 1 1 0,1 Z" Stroke="{Binding StatusColor[10]}" StrokeThickness="1" Fill="{Binding StatusColor[10]}" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<Border Grid.Row="7" Grid.Column="7" >
<Border Grid.Row="7" Grid.Column="6" >
<Path Data="M 5,5 A 15,15 45 1 1 0,1 Z" Stroke="{Binding StatusColor[11]}" StrokeThickness="1" Fill="{Binding StatusColor[11]}" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<Border Grid.Row="1" Grid.Column="8" Background="#1157b9">
<Border Grid.Row="1" Grid.Column="7" Background="#1157b9">
<TextBlock Text="发泡型号" Foreground="White" FontSize="18" FontWeight="Bold"/>
</Border>
<Border Grid.Row="2" Grid.Column="8" >
<Border Grid.Row="2" Grid.Column="7" >
<TextBlock Text="{Binding FixtureName[6]}" Foreground="White" FontSize="18"/>
</Border>
<Border Grid.Row="3" Grid.Column="8" >
<Border Grid.Row="3" Grid.Column="7" >
<TextBlock Text="{Binding FixtureName[7]}" Foreground="White" FontSize="18"/>
</Border>
<Border Grid.Row="4" Grid.Column="8" >
<Border Grid.Row="4" Grid.Column="7" >
<TextBlock Text="{Binding FixtureName[8]}" Foreground="White" FontSize="18"/>
</Border>
<Border Grid.Row="5" Grid.Column="8">
<Border Grid.Row="5" Grid.Column="7">
<TextBlock Text="{Binding FixtureName[9]}" Foreground="White" FontSize="18"/>
</Border>
<Border Grid.Row="6" Grid.Column="8" >
<Border Grid.Row="6" Grid.Column="7" >
<TextBlock Text="{Binding FixtureName[10]}" Foreground="White" FontSize="18"/>
</Border>
<Border Grid.Row="7" Grid.Column="8" >
<Border Grid.Row="7" Grid.Column="7" >
<TextBlock Text="{Binding FixtureName[11]}" Foreground="White" FontSize="18"/>
</Border>
<Border Grid.Row="1" Grid.Column="9" Background="#1157b9">
<Border Grid.Row="1" Grid.Column="8" Background="#1157b9">
<TextBlock Text="夹具产量" Foreground="White" FontSize="18" FontWeight="Bold"/>
</Border>
<Border Grid.Row="2" Grid.Column="9" >
<Border Grid.Row="2" Grid.Column="8" >
<TextBlock Text="{Binding Production[6]}" Foreground="White" FontSize="18" FontWeight="Bold"/>
</Border>
<Border Grid.Row="3" Grid.Column="9">
<Border Grid.Row="3" Grid.Column="8">
<TextBlock Text="{Binding Production[7]}" Foreground="White" FontSize="18" FontWeight="Bold"/>
</Border>
<Border Grid.Row="4" Grid.Column="9">
<Border Grid.Row="4" Grid.Column="8">
<TextBlock Text="{Binding Production[8]}" Foreground="White" FontSize="18" FontWeight="Bold"/>
</Border>
<Border Grid.Row="5" Grid.Column="9">
<Border Grid.Row="5" Grid.Column="8">
<TextBlock Text="{Binding Production[9]}" Foreground="White" FontSize="18" FontWeight="Bold"/>
</Border>
<Border Grid.Row="6" Grid.Column="9">
<Border Grid.Row="6" Grid.Column="8">
<TextBlock Text="{Binding Production[10]}" Foreground="White" FontSize="18" FontWeight="Bold"/>
</Border>
<Border Grid.Row="7" Grid.Column="9">
<Border Grid.Row="7" Grid.Column="8">
<TextBlock Text="{Binding Production[11]}" Foreground="White" FontSize="18" FontWeight="Bold"/>
</Border>
<Border Grid.Row="1" Grid.Column="10" Background="#1157b9">
<!--<Border Grid.Row="1" Grid.Column="10" Background="#1157b9">
<TextBlock Text="内外模温度" Foreground="White" FontSize="18" FontWeight="Bold"/>
</Border>
<Border Grid.Row="2" Grid.Column="10" >
@ -368,27 +368,27 @@
<TextBlock Text="|" Foreground="White" FontSize="18" FontWeight="Bold"/>
<TextBlock Text="{Binding OutsideTemperature[11]}" Foreground="White" FontSize="18" FontWeight="Bold"/>
</WrapPanel>
</Border>
</Border>-->
<Border Grid.Row="1" Grid.Column="11" Background="#1157b9">
<Border Grid.Row="1" Grid.Column="9" Background="#1157b9">
<TextBlock Text="节拍" Foreground="White" FontSize="18" FontWeight="Bold"/>
</Border>
<Border Grid.Row="2" Grid.Column="11" >
<Border Grid.Row="2" Grid.Column="9" >
<TextBlock Text="{Binding Beat[6]}" Foreground="White" FontSize="18"/>
</Border>
<Border Grid.Row="3" Grid.Column="11">
<Border Grid.Row="3" Grid.Column="9">
<TextBlock Text="{Binding Beat[7]}" Foreground="White" FontSize="18"/>
</Border>
<Border Grid.Row="4" Grid.Column="11">
<Border Grid.Row="4" Grid.Column="9">
<TextBlock Text="{Binding Beat[8]}" Foreground="White" FontSize="18"/>
</Border>
<Border Grid.Row="5" Grid.Column="11">
<Border Grid.Row="5" Grid.Column="9">
<TextBlock Text="{Binding Beat[9]}" Foreground="White" FontSize="18"/>
</Border>
<Border Grid.Row="6" Grid.Column="11">
<Border Grid.Row="6" Grid.Column="9">
<TextBlock Text="{Binding Beat[10]}" Foreground="White" FontSize="18"/>
</Border>
<Border Grid.Row="7" Grid.Column="11">
<Border Grid.Row="7" Grid.Column="9">
<TextBlock Text="{Binding Beat[11]}" Foreground="White" FontSize="18"/>
</Border>
</Grid>

@ -159,9 +159,27 @@
</Border>
<!--设备监控-->
<Border x:Name="HeightHelperPanel" Grid.Row="1" BorderBrush="#0288d1" BorderThickness="0" CornerRadius="5" Background="Transparent" Margin="25,1,5,5">
<ListBox MinHeight="60"
Height="{Binding Path=ActualHeight, ElementName=HeightHelperPanel}" x:Name="listBox" ItemsSource="{Binding LogInfoListBox}" FontSize="18" Foreground="White" Background="Transparent" BorderBrush="Transparent" ScrollViewer.HorizontalScrollBarVisibility="Hidden" ScrollViewer.VerticalScrollBarVisibility="Hidden"/>
<Border x:Name="HeightHelperPanel" Grid.Row="1" BorderBrush="#0288d1" BorderThickness="0" CornerRadius="5" Background="Transparent" Margin="5,1,5,5">
<!--<ListBox MinHeight="60"
Height="{Binding Path=ActualHeight, ElementName=HeightHelperPanel}" x:Name="listBox" ItemsSource="{Binding LogInfoListBox}" FontSize="18" Foreground="White" Background="Transparent" BorderBrush="Transparent" ScrollViewer.HorizontalScrollBarVisibility="Hidden" ScrollViewer.VerticalScrollBarVisibility="Hidden"/>-->
<ListBox ItemsSource="{Binding LogInfoListBox}" ScrollViewer.HorizontalScrollBarVisibility="Hidden" ScrollViewer.VerticalScrollBarVisibility="Hidden">
<ListBox.ItemTemplate>
<DataTemplate >
<StackPanel Orientation="Horizontal">
<TextBlock x:Name="txtName" Text="{Binding Content}" FontSize="18" />
</StackPanel>
<DataTemplate.Triggers>
<DataTrigger Binding="{Binding Color}" Value="Red">
<Setter TargetName="txtName" Property="Foreground" Value="{Binding Color}" />
</DataTrigger>
<DataTrigger Binding="{Binding Color}" Value="White">
<Setter TargetName="txtName" Property="Foreground" Value="{Binding Color}" />
</DataTrigger>
</DataTemplate.Triggers>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Border>
</Grid>
</Border>

@ -217,7 +217,7 @@
"EquipName": "foamLine1Plc",
"PlcType": "Siemens",
"Enabled": true,
"IP": "10.10.93.21",
"IP":"10.10.93.21",
"Port": 102
},
{
@ -225,7 +225,7 @@
"EquipName": "foamLine2Plc",
"PlcType": "Siemens",
"Enabled": true,
"IP": "10.10.93.1",
"IP":"10.10.93.1",
"Port": 102
},
{
@ -234,7 +234,6 @@
"PlcType": "Siemens",
"Enabled": true,
"IP": "10.10.93.180",
//"IP": "10.10.93.180",
"Port": 102
}
],

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Report ScriptLanguage="CSharp" ReportInfo.Created="06/07/2017 15:25:22" ReportInfo.Modified="01/01/2024 12:05:55" ReportInfo.CreatorVersion="2013.2.5.0">
<Report ScriptLanguage="CSharp" ReportInfo.Created="06/07/2017 15:25:22" ReportInfo.Modified="03/13/2024 12:27:18" ReportInfo.CreatorVersion="2013.2.5.0">
<Dictionary>
<MsSqlDataConnection Name="Connection" ConnectionString="rijcmlqJUrEa/KIcQqhhcfnlqC6PGg5imbaGg6zUaNTAYc5sc03TfePxSblja2w5ZBQ6XB2KW3rzKVqcx6AloZTNTR44dHkYeZUDGBO29MmMS3/EQZ1uB8oN4b6VT05NhkHDu4nSS02ixL5sCDaWruiw1dvBMMaAoWWyrYZLApMwLWsLZFJVG0OalNUEnAGsAtmWtX/">
<MsSqlDataConnection Name="Connection" ConnectionString="rijcmlqJUrEa/KIcQqhhcfnlqC6PGg5imbaGg6zUaNTAYc5sc03TfePxSblja2w5ZBQ6XB2KW3rzKVqcx6AloZTNTR44dHkYeZUDGBO29MmMS3/EQZ1uB8oN4b6VT05NhkHDu4nSS02ixL5sCDaWruiw1dvBMMaAoWWyrYZLApMwLWsLZHsPqI78Eb7xjAIZ3nssXzK">
<TableDataSource Name="Wms_Product_BarCode" Alias="BoxBarData" DataType="System.Int32" Enabled="true" TableName="Wms_Product_BarCode">
<Column Name="Bar_ID" Enabled="false" DataType="System.Int32"/>
<Column Name="Bar_Code" DataType="System.String"/>
@ -31,10 +31,10 @@
</Dictionary>
<ReportPage Name="Page1" PaperWidth="70" PaperHeight="30" LeftMargin="0" TopMargin="0" RightMargin="0" BottomMargin="0" Guides="94.5,198.45">
<DataBand Name="Data1" Width="264.6" Height="117.18" StartNewPage="true" Guides="28.35">
<TextObject Name="Text5" Left="113.4" Top="13.23" Width="141.75" Height="15.12" Text="[BoxBarData.Order_Material_Name]" WordWrap="false" Font="微软雅黑, 10.5pt, style=Bold"/>
<TextObject Name="Text7" Left="113.4" Top="51.03" Width="151.2" Height="15.12" Text="[BoxBarData.Order_No]" Font="微软雅黑, 10.5pt, style=Bold"/>
<TextObject Name="Text6" Left="22.68" Top="88.83" Width="245.15" Height="15.12" Text="[BoxBarData.Bar_Code]" VertAlign="Center" Font="微软雅黑, 12pt, style=Bold"/>
<BarcodeObject Name="BarText" Left="17.01" Top="-9.45" Width="86.94" Height="96.39" AutoSize="false" Expression="[BoxBarData.Id]" Text="L17091183015003164839" ShowText="false" Zoom="1.13" Barcode="QR Code" Barcode.ErrorCorrection="L" Barcode.Encoding="UTF8" Barcode.QuietZone="true"/>
<TextObject Name="Text5" Left="103.95" Top="22.68" Width="151.2" Height="15.12" Text="[BoxBarData.Order_Material_Name]" WordWrap="false" Font="微软雅黑, 10.5pt, style=Bold"/>
<TextObject Name="Text7" Left="103.95" Top="60.48" Width="151.2" Height="15.12" Text="[BoxBarData.Order_No]" Font="微软雅黑, 10.5pt, style=Bold"/>
<TextObject Name="Text6" Left="22.68" Top="98.28" Width="245.15" Height="15.12" Text="[BoxBarData.Bar_Code]" VertAlign="Center" Font="微软雅黑, 12pt, style=Bold"/>
<BarcodeObject Name="BarText" Left="17.01" Top="11.34" Width="86.94" Height="86.94" AutoSize="false" Expression="[BoxBarData.Id]" Text="L17091183015003164839" ShowText="false" Zoom="1.13" Barcode="QR Code" Barcode.ErrorCorrection="L" Barcode.Encoding="UTF8" Barcode.QuietZone="true"/>
</DataBand>
</ReportPage>
</Report>

@ -3,13 +3,11 @@ using Admin.Core.Model;
using Admin.Core.Model.ViewModels;
using Aucma.Core.PrintTo.Models;
using Aucma.Core.PrintTo.Views;
using Castle.Core.Internal;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using CommunityToolkit.Mvvm.Messaging;
using log4net;
using Microsoft.Extensions.DependencyInjection;
using NPOI.Util;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
@ -165,11 +163,11 @@ namespace Aucma.Core.PrintTo.ViewModels
/// 打印
/// </summary>
[RelayCommand]
private async void Print(string obj)
private async void Print(string obj)
{
if (string.IsNullOrEmpty(obj))
{
MessageBox.Show("请选中需要打印的产品!","系统提醒");
MessageBox.Show("请选中需要打印的产品!", "系统提醒");
return;
}
@ -178,22 +176,24 @@ namespace Aucma.Core.PrintTo.ViewModels
MessageBox.Show("打印名称不可为空!", "系统提醒");
return;
}
if (SelectedCells.PlanAmount == 0)
if (PrintAmount == 0)
{
MessageBox.Show("请输入打印数量!", "系统提醒");
return;
}
if (printType == 0)
{
MessageBox.Show("请选择打印类型!", "系统提醒");
return;
}
//if (SelectedCells.PlanAmount > PrintAmount)
//{
// MessageBox.Show("打印数量不能高于计划数量!", "系统提醒");
// return;
//}
if (printType==0)
{
MessageBox.Show("请选择打印类型!", "系统提醒");
return;
}
try
{
@ -214,22 +214,19 @@ namespace Aucma.Core.PrintTo.ViewModels
{
type = 1;
}
var list= await _printBarCodeServices.QueryAsync(d => d.OrderCode == order_code&&d.PrintBarType== printType);
if (list!=null||list.Count!= 0)
//查询当前数据库当前已经打印的数量
var printBarCodeList = await _printBarCodeServices.QueryAsync(d => d.OrderCode == order_code && d.PrintBarType == type);
if (printBarCodeList != null && printBarCodeList.Count != 0)
{
int num= list.Count;//已经打印数量
int residue= SelectedCells.PlanAmount - num;//剩余打印数量
//if (residue > standard_amount)
//{
// MessageBox.Show("订单数量已经打印到规定订单数量!", "系统提醒");
// return;
//}
//if ((residue- standard_amount)< 1)
//{
// MessageBox.Show("订单数量已经打印到规定订单数量!", "系统提醒");
// return;
//}
//计算剩余数量
int num = printBarCodeList.Count;//已经打印数量
int residue = SelectedCells.PlanAmount - num;//剩余打印数量
//判断当前打印数量是否在剩余数据之内
if ( residue< standard_amount|| residue < standard_amount)
{
MessageBox.Show("打印订单数量超过规定数量!", "系统提醒");
return;
}
}
//更新打印名称
@ -239,7 +236,7 @@ namespace Aucma.Core.PrintTo.ViewModels
baseOrder.PrintName = printName;
_ = _baseOrderInfoServices.UpdatePrintName(baseOrder).Result;
}
PrintToDevView printToDev = new PrintToDevView(order_code,product_code, product_name, standard_amount, printName,printType);
PrintToDevView printToDev = new PrintToDevView(order_code, product_code, product_name, standard_amount, printName, printType);
printToDev.ShowDialog();
}
catch (Exception ex)

@ -63,10 +63,11 @@ namespace Aucma.Core.PrintTo.ViewModels
/// <summary>
/// 打印
/// </summary>
/// <param name="obj">主键</param>
[RelayCommand]
private async void Print(string obj)
{
if (string.IsNullOrEmpty(obj))
if (obj== "0")
{
MessageBox.Show("请选中要补打的条码!", "系统提醒");
return;
@ -79,7 +80,8 @@ namespace Aucma.Core.PrintTo.ViewModels
var baseOrderInfo=await _baseOrderInfoServices.FirstAsync(d => d.OrderCode == orderCode);
if (baseOrderInfo!=null)
{
SupplementView printToDev = new SupplementView(orderCode, materialCode, materialName, printName, barCode);
int Id = Convert.ToInt32(obj);
SupplementView printToDev = new SupplementView(Id);
printToDev.ShowDialog();
}
@ -149,6 +151,7 @@ namespace Aucma.Core.PrintTo.ViewModels
{
Datalist.Add(new BarCodeModel()
{
ID = item.ObjId,
OrderCode = item.OrderCode,
MaterialCode = item.MaterialCode,
MaterialName = item.MaterialName,

@ -21,32 +21,41 @@ using System.Windows;
* */
namespace Aucma.Core.PrintTo.ViewModels
{
public class SupplementViewModel : ObservableObject
public partial class SupplementViewModel : ObservableObject
{
private readonly IPrintSuppleMentBarCodeServices _printSuppleMentBarCodeServices;
private static readonly log4net.ILog log = LogManager.GetLogger(typeof(SupplementViewModel));
private PrintState printState { get; set; } = PrintState.Idle;//打印状态
public SupplementViewModel(string orderCode,string materialCode,string materialName,string printName, string barCode)
PrintSuppleMentBarCode printSuppleMentBarCode = null;
/// <summary>
/// 构造函数
/// </summary>
/// <param name="Id">补打表主键</param>
public SupplementViewModel(int Id)
{
_printSuppleMentBarCodeServices = App.ServiceProvider.GetService<IPrintSuppleMentBarCodeServices>();
_orderCode = orderCode;
ProductCode = materialCode;
ProductName = materialName;
_barCode= barCode;
PrintAmount = 1;
PrintName = printName;
Progress = 0;
MaxProgress = 1;//最大数
State = "Green";
ErrorNum = 0;//异常
SuspendEnabled = "False";//暂停打印
OperateEnabled = "True";//打印
printSuppleMentBarCode = _printSuppleMentBarCodeServices.FirstAsync(d => d.ObjId == Id).Result;
if (printSuppleMentBarCode!=null)
{
_orderCode = printSuppleMentBarCode.OrderCode;
ProductCode = printSuppleMentBarCode.MaterialCode;
ProductName = printSuppleMentBarCode.MaterialName;
_barCode = printSuppleMentBarCode.MaterialBarCode;
PrintAmount = 1;
PrintName = printSuppleMentBarCode.PrintName;
Progress = 0;
MaxProgress = 1;//最大数
State = "Green";
ErrorNum = 0;//异常
SuspendEnabled = "False";//暂停打印
OperateEnabled = "True";//打印
}
}
#region 打印
public void Print()
[RelayCommand]
public async Task StartOperate()
{
try
{
@ -72,7 +81,10 @@ namespace Aucma.Core.PrintTo.ViewModels
barReport.Print();
#endregion
//打印完成 不可以再次打印
printSuppleMentBarCode.IsPrint = 1;
printSuppleMentBarCode.PrintTime = DateTime.Now;
await _printSuppleMentBarCodeServices.UpdateAsync(printSuppleMentBarCode);
//打印完成
SetCompletetd();
}

@ -235,7 +235,7 @@
<TextBlock Text="&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;打印数量" FontSize="18" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center" />
<Slider x:Name="PlanAmount" FontSize="18" Minimum="0" Maximum="500" BorderBrush="White" Value="{Binding PrintAmount,Mode=TwoWay}" Foreground="White" Height="30" VerticalContentAlignment="Center"
HorizontalContentAlignment="Left" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="15 0 0 0" Width="{Binding Path=ActualWidth, ElementName=ProductNo}"/>
<TextBlock Text="{Binding SelectedItem.PlanAmount, ElementName=dgvMH}" />
<TextBlock Text="{Binding SelectedItem.PlanAmount, ElementName=dgvMH}" Visibility="Collapsed" />
</WrapPanel>
<Border Grid.Row="5" BorderBrush="#0288d1" BorderThickness="1" CornerRadius="5" Width="420" >
<StackPanel >

@ -104,6 +104,7 @@
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTextColumn Width="*" Binding="{Binding ID}" Header="主键" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}" Visibility="Collapsed" />
<DataGridTextColumn Width="*" Binding="{Binding OrderCode}" Header="订单号" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}" />
<DataGridTextColumn Width="1.5*" Binding="{Binding BarCode}" Header="物料条码" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Width="1.5*" Binding="{Binding MaterialCode}" Header="物料编码" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
@ -125,6 +126,7 @@
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto" />
<RowDefinition Height="auto"/>
</Grid.RowDefinitions>
<WrapPanel Grid.Row="0" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0 15">
@ -153,10 +155,14 @@
<TextBox x:Name="PrintName" Foreground="white" Text="{Binding SelectedItem.PrintName, ElementName=dgvMH}" IsReadOnly="True" Margin="15 0 0 0 " FontSize="18" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Width="250"
materialDesign:HintAssist.Hint="打印名称" BorderBrush="White" />
</WrapPanel>
<WrapPanel Grid.Row="5" HorizontalAlignment="Center">
<WrapPanel Grid.Row="5" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0 15" Visibility="Collapsed">
<TextBlock Text="打印主键" FontSize="18" Foreground="white" HorizontalAlignment="Center" VerticalAlignment="Center" />
<TextBox x:Name="PrimaryKey" Foreground="white" Text="{Binding SelectedItem.ID, ElementName=dgvMH}" IsReadOnly="True" Margin="15 0 0 0 " FontSize="18" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Width="250" BorderBrush="White" />
</WrapPanel>
<WrapPanel Grid.Row="6" HorizontalAlignment="Center">
<Button
materialDesign:RippleAssist.IsDisabled="True"
Content="打印" Margin="0 0" Height="40" Command="{Binding PrintCommand}" CommandParameter="{Binding ElementName=BarCode,Path=Text}"/>
Content="打印" Margin="0 0" Height="40" Command="{Binding PrintCommand}" CommandParameter="{Binding ElementName=PrimaryKey,Path=Text}"/>
</WrapPanel>
</Grid>
</Border>

@ -12,15 +12,11 @@ namespace Aucma.Core.PrintTo.Views
/// <summary>
/// 构造函数
/// </summary>
/// <param name="productCode">产品编码</param>
/// <param name="materialCode">物料编码</param>
/// <param name="materialName">产品名称</param>
/// <param name="printAmount">打印数量</param>
/// <param name="barCode"></param>
public SupplementView(string orderCode, string materialCode, string materialName, string printName, string barCode)
/// <param name="Id">主键</param>
public SupplementView(int Id)
{
InitializeComponent();
this.DataContext = new SupplementViewModel(orderCode,materialCode,materialName,printName,barCode);
this.DataContext = new SupplementViewModel(Id);
}
#endregion

@ -75,7 +75,6 @@ namespace Aucma.Core.Tasks
try
{
int signal = obj.plc.ReadInt16("DB55.84.0");
Console.WriteLine($"【{DateTime.Now}】》当前灌注采集信号:{signal}");
if (signal == 0)
{
Thread.Sleep(1000);
@ -92,58 +91,58 @@ namespace Aucma.Core.Tasks
continue;
}
Console.WriteLine($"【{DateTime.Now}】》灌注数据条码:{record.PerfusionBoxCode}》灌注结果:{record.PerfusionResult}》设定灌注量:{record.PerfusionSetVolume}》灌注量:{record.PerfusionActualVolume}");
//var tempRecord = _perfusionRecordServices.FirstAsync(d => d.PerfusionBoxCode.Equals(record.PerfusionBoxCode) && d.PerfusionResult == record.PerfusionResult).Result;
continue;
//if (tempRecord != null)
//{
// Console.WriteLine($"【{DateTime.Now}】》灌注数据条码:[{record.PerfusionBoxCode}],灌注结果:[{record.PerfusionResult}],已存在系统中");
// bool fw=obj.plc.WriteInt16("DB55.84.0", "0");//存盘成功写入bool
// Console.WriteLine($"【{DateTime.Now}】》写入复位信号{fw}");
// Thread.Sleep(1000);
// continue;
//}
//#region 更新设备状态
//Perfusion_DeviceStatus device = _perfusionDeviceStatusServices.FirstAsync().Result;
//if (device == null)
//{
// _ = _perfusionDeviceStatusServices.AddAsync(perfusion_DeviceStatus).Result;
//}
//else
//{
// device.PerfusionStatus = perfusion_DeviceStatus.PerfusionStatus;
// var rsult = _perfusionDeviceStatusServices.UpdateAsync(device).Result;
//}
//#endregion
//#region 更新报警信息
//if (perfusion_Alarm.PerfusionStatus > 0)
//{
// int a = _perfusionAlarmServices.AddAsync(perfusion_Alarm).Result;
//}
//#endregion
//record.IsFlag = 0;
////充注结束
//int result = _perfusionRecordServices.AddAsync(record).Result;
//if (result == 0)
//{
// //添加过点数
// Console.WriteLine($"【{DateTime.Now}】》灌注结果:{record.PerfusionResult}");
// if (record.PerfusionResult == 8)
// {
// var insert= InsertToCompleteAndCheck(record);
// if (insert)
// {
// Console.WriteLine($"【{DateTime.Now}】》保存过点数成功!");
// }
// }
// ToMes();//灌注
// Console.WriteLine(record.ToJson());
//}
//bool r = obj.plc.WriteInt16("DB55.84.0", "0");//存盘成功写入bool
//Console.WriteLine($"【{DateTime.Now}】》写入复位信号{r}");
//Console.WriteLine($"【{DateTime.Now}】》灌注数据采集结束");
var tempRecord = _perfusionRecordServices.FirstAsync(d => d.PerfusionBoxCode.Equals(record.PerfusionBoxCode) && d.PerfusionResult == record.PerfusionResult).Result;
if (tempRecord != null)
{
Console.WriteLine($"【{DateTime.Now}】》灌注数据条码:[{record.PerfusionBoxCode}],灌注结果:[{record.PerfusionResult}],已存在系统中");
bool fw = obj.plc.WriteInt16("DB55.84.0", "0");//存盘成功写入bool
Console.WriteLine($"【{DateTime.Now}】》写入复位信号{fw}");
Thread.Sleep(1000);
continue;
}
#region 更新设备状态
Perfusion_DeviceStatus device = _perfusionDeviceStatusServices.FirstAsync().Result;
if (device == null)
{
_ = _perfusionDeviceStatusServices.AddAsync(perfusion_DeviceStatus).Result;
}
else
{
device.PerfusionStatus = perfusion_DeviceStatus.PerfusionStatus;
var rsult = _perfusionDeviceStatusServices.UpdateAsync(device).Result;
}
#endregion
#region 更新报警信息
if (perfusion_Alarm.PerfusionStatus > 0)
{
int a = _perfusionAlarmServices.AddAsync(perfusion_Alarm).Result;
}
#endregion
record.IsFlag = 0;
//充注结束
int result = _perfusionRecordServices.AddAsync(record).Result;
if (result == 0)
{
//添加过点数
Console.WriteLine($"【{DateTime.Now}】》灌注结果:{record.PerfusionResult}");
if (record.PerfusionResult == 8)
{
var insert = InsertToCompleteAndCheck(record);
if (insert)
{
Console.WriteLine($"【{DateTime.Now}】》保存过点数成功!");
}
}
ToMes();//灌注
Console.WriteLine(record.ToJson());
}
bool r = obj.plc.WriteInt16("DB55.84.0", "0");//存盘成功写入bool
Console.WriteLine($"【{DateTime.Now}】》写入复位信号为{r}");
Console.WriteLine($"【{DateTime.Now}】》灌注数据采集结束");
}
catch (Exception ex)
{
@ -405,10 +404,12 @@ namespace Aucma.Core.Tasks
if (check.TreatmentMeasure == "3")
{
report.FinishTime = null;
report.UpdatedTime = null;
}
else
{
report.FinishTime = check.FinishTime;
report.UpdatedTime = null;
}
report.BarCode = check.BarCode;

Loading…
Cancel
Save