dev
liulb@mesnac.com 1 year ago
parent 1a7f5b2c5d
commit 5597057ca1

@ -2686,6 +2686,46 @@
打印类型:箱壳、内胆
</summary>
</member>
<member name="T:Admin.Core.Model.PrintSuppleMentBarCode">
<summary>
补打二维码
</summary>
</member>
<member name="P:Admin.Core.Model.PrintSuppleMentBarCode.ObjId">
<summary>
主键
</summary>
</member>
<member name="P:Admin.Core.Model.PrintSuppleMentBarCode.OrderCode">
<summary>
箱体条码
</summary>
</member>
<member name="P:Admin.Core.Model.PrintSuppleMentBarCode.MaterialCode">
<summary>
箱体名称
</summary>
</member>
<member name="P:Admin.Core.Model.PrintSuppleMentBarCode.MaterialName">
<summary>
箱体名称
</summary>
</member>
<member name="P:Admin.Core.Model.PrintSuppleMentBarCode.MaterialBarCode">
<summary>
成品码
</summary>
</member>
<member name="P:Admin.Core.Model.PrintSuppleMentBarCode.PrintTime">
<summary>
打印时间
</summary>
</member>
<member name="P:Admin.Core.Model.PrintSuppleMentBarCode.PrintBarType">
<summary>
打印类型
</summary>
</member>
<member name="T:Admin.Core.Model.ProductOrderInfo">
<summary>
订单执行表
@ -5536,6 +5576,26 @@
Dto
</summary>
</member>
<member name="T:Admin.Core.Model.ViewModels.MaterialTypeView">
<summary>
钣金物料类型
</summary>
</member>
<member name="P:Admin.Core.Model.ViewModels.MaterialTypeView.MaterialCode">
<summary>
物料编号
</summary>
</member>
<member name="P:Admin.Core.Model.ViewModels.MaterialTypeView.MaterialName">
<summary>
物料名称
</summary>
</member>
<member name="P:Admin.Core.Model.ViewModels.MaterialTypeView.MaterialType">
<summary>
物料类别
</summary>
</member>
<member name="T:Admin.Core.Model.ViewModels.PrintPlanInfoView">
<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+499f069197ca25e9a1608c75be20ffac33665f86")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+1a7f5b2c5d615dd77e3d962d3b3bc9e735ac9121")]
[assembly: System.Reflection.AssemblyProductAttribute("Admin.Core.Common")]
[assembly: System.Reflection.AssemblyTitleAttribute("Admin.Core.Common")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

@ -1 +1 @@
3c1239bd2d330182b6d73f5f9adb3949b42cab1215e90f6deb8a82419bd65dda
d02edd2ebb8f20e6ac7017403113c013f65d4c915862adcc59daefaa469faca4

@ -20,7 +20,7 @@ namespace Admin.Core.Extensions
{
if (Appsettings.app("Middleware", "AucamTask", "Enabled").ObjToBool())
{
// aucamTaskService.AucamTaskAsync();
aucamTaskService.AucamTaskAsync();
Console.WriteLine("澳柯玛灌注服务已开启");
}
}

@ -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+499f069197ca25e9a1608c75be20ffac33665f86")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+1a7f5b2c5d615dd77e3d962d3b3bc9e735ac9121")]
[assembly: System.Reflection.AssemblyProductAttribute("Admin.Core.Extensions")]
[assembly: System.Reflection.AssemblyTitleAttribute("Admin.Core.Extensions")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

@ -1 +1 @@
80c944130749e9a466e0546af54244328741322bee47443a6911ec255d2f6c9a
1d4da8c63378c59f37df671a2e7cc4e96a520354cff4618bdc5471b551e317b8

@ -1,5 +1,8 @@
using Admin.Core.Model;
using Admin.Core.Model.Model_New;
using Admin.Core.Model.ViewModels;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Admin.Core.IRepository
{

@ -0,0 +1,14 @@
using Admin.Core.Model;
using Admin.Core.Model.Model_New;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Admin.Core.IRepository
{
/// <summary>
/// IPrintSuppleMentBarCodeRepository
/// </summary>
public interface IPrintSuppleMentBarCodeRepository : IBaseRepository<PrintSuppleMentBarCode>
{
}
}

@ -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+499f069197ca25e9a1608c75be20ffac33665f86")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+1a7f5b2c5d615dd77e3d962d3b3bc9e735ac9121")]
[assembly: System.Reflection.AssemblyProductAttribute("Admin.Core.IRepository")]
[assembly: System.Reflection.AssemblyTitleAttribute("Admin.Core.IRepository")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

@ -1 +1 @@
d34b1454bee81348efc7715a1b63b42216ad14f8d6cddc45d7c804ec3c6f5af3
78ee930e1866e9baaed514d1d60b40b29fe17a0426e6ba52d2a9bc7c2a44d188

@ -1,5 +1,6 @@
using Admin.Core.IService;
using Admin.Core.Model;
using Admin.Core.Model.ViewModels;
using System.Collections.Generic;
using System.Threading.Tasks;
@ -15,5 +16,6 @@ namespace Admin.Core.IService
/// 查出BASE_MATERIALINFO中存在的成品类型
/// </summary>
public Task<List<BaseMaterialInfo>> queryAsyncLike(string search);
}
}

@ -0,0 +1,16 @@
using Admin.Core.IService;
using Admin.Core.Model;
using Admin.Core.Model.ViewModels;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Admin.Core.IService
{
/// <summary>
/// IPrintSuppleMentBarCodeServices
/// </summary>
public interface IPrintSuppleMentBarCodeServices : IBaseServices<PrintSuppleMentBarCode>
{
}
}

@ -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+499f069197ca25e9a1608c75be20ffac33665f86")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+1a7f5b2c5d615dd77e3d962d3b3bc9e735ac9121")]
[assembly: System.Reflection.AssemblyProductAttribute("Admin.Core.IService")]
[assembly: System.Reflection.AssemblyTitleAttribute("Admin.Core.IService")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

@ -1 +1 @@
f5be8c67e1531fe9757725f193b399fb3d7ff7785f8ca3f77eb7df7718fa7838
446f69c1fd140fce70f5eb8fb5acce7251fd36464425a54bd76c12ea5bbecee7

@ -0,0 +1,52 @@
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Admin.Core.Model
{
/// <summary>
/// 补打二维码
/// </summary>
[SugarTable("PRINT_SUPPLEMENTBARCODE", "AUCMA_SCADA")]
public class PrintSuppleMentBarCode
{
/// <summary>
/// 主键
/// </summary>
[SugarColumn(ColumnName = "OBJ_ID", IsIdentity = true, IsPrimaryKey = true, OracleSequenceName = "SEQ_CODE_BINDING")]
public int ObjId { get; set; }
/// <summary>
/// 箱体条码
/// </summary>
[SugarColumn(ColumnName = "ORDER_CODE")]
public string OrderCode { get; set; }
/// <summary>
/// 箱体名称
/// </summary>
[SugarColumn(ColumnName = "MATERIAL_CODE")]
public string MaterialCode { get; set; }
/// <summary>
/// 箱体名称
/// </summary>
[SugarColumn(ColumnName = "MATERIAL_NAME")]
public string MaterialName { get; set; }
/// <summary>
/// 成品码
/// </summary>
[SugarColumn(ColumnName = "MATERIAL_BARCODE")]
public string MaterialBarCode { get; set; }
/// <summary>
/// 打印时间
/// </summary>
[SugarColumn(ColumnName = "PRINT_TIME")]
public DateTime PrintTime { get; set; }
/// <summary>
/// 打印类型
/// </summary>
[SugarColumn(ColumnName = "PRINT_BARTYPE")]
public string PrintBarType { get; set; }
}
}

@ -0,0 +1,33 @@
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Admin.Core.Model.ViewModels
{
/// <summary>
/// 钣金物料类型
/// </summary>
public class MaterialTypeView
{
/// <summary>
/// 物料编号
/// </summary>
[SugarColumn(ColumnName = "MATERIAL_CODE")]
public string MaterialCode { get; set; }
/// <summary>
/// 物料名称
/// </summary>
[SugarColumn(ColumnName = "MATERIAL_NAME")]
public string MaterialName { get; set; }
/// <summary>
/// 物料类别
/// </summary>
[SugarColumn(ColumnName = "MATERIAL_TYPE")]
public string MaterialType { get; set; }
}
}

@ -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+499f069197ca25e9a1608c75be20ffac33665f86")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+1a7f5b2c5d615dd77e3d962d3b3bc9e735ac9121")]
[assembly: System.Reflection.AssemblyProductAttribute("Admin.Core.Model")]
[assembly: System.Reflection.AssemblyTitleAttribute("Admin.Core.Model")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

@ -1 +1 @@
ee26dec3527eb5d5d779c6528edd3b87e2505e83a27b169aabded9ce4f9bd201
f4f260868c8291d85c80b005496d7131e92901b507923a66fc50bec8cb55fafd

@ -1,5 +1,9 @@
using Admin.Core.IRepository;
using Admin.Core.Model;
using Admin.Core.Model.Model_New;
using Admin.Core.Model.ViewModels;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Admin.Core.Repository
{
@ -11,5 +15,6 @@ namespace Admin.Core.Repository
public BaseMaterialInfoRepository(IUnitOfWork unitOfWork) : base(unitOfWork)
{
}
}
}

@ -0,0 +1,19 @@
using Admin.Core.IRepository;
using Admin.Core.Model;
using Admin.Core.Model.Model_New;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Admin.Core.Repository
{
/// <summary>
/// 补码打印
/// </summary>
public class PrintSuppleMentBarCodeRepository : BaseRepository<PrintSuppleMentBarCode>, IPrintSuppleMentBarCodeRepository
{
public PrintSuppleMentBarCodeRepository(IUnitOfWork unitOfWork) : base(unitOfWork)
{
}
}
}

@ -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+499f069197ca25e9a1608c75be20ffac33665f86")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+1a7f5b2c5d615dd77e3d962d3b3bc9e735ac9121")]
[assembly: System.Reflection.AssemblyProductAttribute("Admin.Core.Repository")]
[assembly: System.Reflection.AssemblyTitleAttribute("Admin.Core.Repository")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

@ -1 +1 @@
f7b33cdf3a8316786a6c5320a70cebccb6437ca17415641af6c4e325746ec3d2
99be02283a32bb2c872a0fc82da04c4b06dadba00ca66479b788eed654e68bdd

@ -0,0 +1,23 @@
using Admin.Core.IRepository;
using Admin.Core.IService;
using Admin.Core.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Admin.Core.Service.Service_New
{
public class PrintSuppleMentBarCodeServices : BaseServices<PrintSuppleMentBarCode>, IPrintSuppleMentBarCodeServices
{
private readonly IBaseRepository<PrintSuppleMentBarCode> _dal;
private readonly IPrintSuppleMentBarCodeRepository _printSuppleMentBarCodeRepository;
public PrintSuppleMentBarCodeServices(IBaseRepository<PrintSuppleMentBarCode> dal, IPrintSuppleMentBarCodeRepository printSuppleMentBarCodeRepository)
{
this._dal = dal;
base.BaseDal = dal;
_printSuppleMentBarCodeRepository = printSuppleMentBarCodeRepository;
}
}
}

@ -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+499f069197ca25e9a1608c75be20ffac33665f86")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+1a7f5b2c5d615dd77e3d962d3b3bc9e735ac9121")]
[assembly: System.Reflection.AssemblyProductAttribute("Admin.Core.Service")]
[assembly: System.Reflection.AssemblyTitleAttribute("Admin.Core.Service")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

@ -1 +1 @@
e3285d6618d8735ca278d03f8c5bc151877072ac2c3564088bd77be1573ac56f
52ed93d3f16a8741d01ee1a6c3466f29b918e58883e973aa21784f192c46d524

@ -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+499f069197ca25e9a1608c75be20ffac33665f86")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+1a7f5b2c5d615dd77e3d962d3b3bc9e735ac9121")]
[assembly: System.Reflection.AssemblyProductAttribute("Admin.Core.Tasks")]
[assembly: System.Reflection.AssemblyTitleAttribute("Admin.Core.Tasks")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

@ -1 +1 @@
fd64d5a8a43aa18846b7d80b428819e107cd30f3a87f2db9e131c3fb34bd8a88
73cfc7cd185167ac9cb86e197fd132e2ba211d078a8b57fecff762bbcbdb1476

@ -169,7 +169,7 @@
},
"AucamTask": {
"Enabled": false
"Enabled": true
}
},
"PLCServer": [

@ -468,14 +468,12 @@ namespace Aucma.Core.BoxFoam.Business
/// <returns></returns>
public BaseSpaceInfo ReadSpaceInfoByPlc(BaseSpaceInfo spaceInfo)
{
var obj = PlcHelper.siemensList.FirstOrDefault(d => d.EquipName.Equals("泡前库Plc"));
if (obj != null && obj.plc.IsConnected)
{
//将货道信息更新到配置文件中
SpaceAddress spaceAddress = spaceConfig.GetSpaceAddress(spaceInfo.StoreCode, spaceInfo.SpaceCode);
spaceInfo.SpaceStock = obj.plc.ReadInt16(spaceAddress.onStore);//获取
}
return spaceInfo;
}
@ -627,8 +625,6 @@ namespace Aucma.Core.BoxFoam.Business
#endregion
#region 添加货道明细 不控制出库,暂时未添加明细
BaseSpaceDetail spaceDetail = new BaseSpaceDetail();
spaceDetail.MaterialType = taskInfo.MaterialType;

@ -96,6 +96,13 @@ namespace Aucma.Core.HwPLc
/// <returns></returns>
bool WriteString(string address, string value);
/// <summary>
/// 写入bool
/// </summary>
/// <param name="address"></param>
/// <param name="value"></param>
/// <returns></returns>
bool WriteBool(string address, bool value);
/// <summary>
/// 写入byte
/// </summary>
/// <param name="address"></param>

@ -592,5 +592,39 @@ namespace Aucma.Core.HwPLc
b = temp;
}
#region 写入bool
/// <summary>
/// 写入bool
/// </summary>
/// <param name="address"></param>
/// <param name="value"></param>
/// <returns></returns>
/// <exception cref="NotImplementedException"></exception>
public bool WriteBool(string address, bool value)
{
bool iflag = false;
try
{
OperateResult write = melsecMcNet.Write(address, value);
if (write.IsSuccess)
{
iflag = true;
}
else
{
iflag = false;
}
}
catch (Exception ex)
{
log.Error("WriteBool方法异常" + ex.ToString());
iflag = false;
}
return iflag;
}
#endregion
}
}

@ -399,6 +399,38 @@ namespace Aucma.Core.HwPLc
#endregion
#region 写入bool
/// <summary>
/// 写入bool
/// </summary>
/// <param name="address"></param>
/// <param name="value"></param>
/// <returns></returns>
/// <exception cref="NotImplementedException"></exception>
public bool WriteBool(string address, bool value)
{
bool iflag = false;
try
{
OperateResult write = siemensS7Net.Write(address, value);
if (write.IsSuccess)
{
iflag = true;
}
else
{
iflag = false;
}
}
catch (Exception ex)
{
log.Error("WriteBool方法异常" + ex.ToString());
iflag = false;
}
return iflag;
}
#endregion
#region 写入byte
/// <summary>
/// 写入byte
@ -406,7 +438,7 @@ namespace Aucma.Core.HwPLc
/// <param name="address"></param>
/// <param name="bytes"></param>
/// <returns></returns>
public bool WriteByte(string address, byte[] bytes)
public bool WriteByte(string address, byte[] bytes)
{
bool iflag = false;
try
@ -528,5 +560,7 @@ namespace Aucma.Core.HwPLc
{
throw new NotImplementedException();
}
}
}

@ -49,7 +49,7 @@
</WrapPanel>
<TextBlock x:Name="btn_spaceTemp" Text="{Binding SpaceNo,Mode=TwoWay}" Visibility="Collapsed" />
<WrapPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="5 0 0 0">
<Button x:Name="btn_space1" Content="1" FontSize="15" Background="Lime" BorderBrush="#FF36B5C1" Foreground="white" Height="50" Width="50" RenderTransformOrigin="0.5,0.5" Margin="0 0 10 0" Click="btn_space1_Click"/>
<Button x:Name="btn_space1" Content="1" FontSize="15" Background="DarkCyan" BorderBrush="#FF36B5C1" Foreground="white" Height="50" Width="50" RenderTransformOrigin="0.5,0.5" Margin="0 0 10 0" Click="btn_space1_Click"/>
<Button x:Name="btn_space2" Content="2" FontSize="15" Background="DarkCyan" BorderBrush="#FF36B5C1" Foreground="white" Height="50" Width="50" RenderTransformOrigin="0.5,0.5" Margin="10 0" Click="btn_space2_Click"/>
<Button x:Name="btn_space3" Content="3" FontSize="15" Background="DarkCyan" BorderBrush="#FF36B5C1" Foreground="white" Height="50" Width="50" RenderTransformOrigin="0.5,0.5" Margin="10 0" Click="btn_space3_Click"/>
<Button x:Name="btn_space4" Content="4" FontSize="15" Background="DarkCyan" BorderBrush="#FF36B5C1" Foreground="white" Height="50" Width="50" RenderTransformOrigin="0.5,0.5" Margin="10 0" Click="btn_space4_Click"/>
@ -67,8 +67,8 @@
<Button x:Name="btn_space12" Content="12" FontSize="15" Background="DarkCyan" BorderBrush="#FF36B5C1" Foreground="white" Height="50" Width="50" RenderTransformOrigin="0.5,0.5" Margin="10 0" Click="btn_space12_Click"/>
<Button x:Name="btn_space13" Content="13" FontSize="15" Background="DarkCyan" BorderBrush="#FF36B5C1" Foreground="white" Height="50" Width="50" RenderTransformOrigin="0.5,0.5" Margin="10 0" Click="btn_space13_Click"/>
<Button x:Name="btn_space14" Content="14" FontSize="15" Background="DarkCyan" BorderBrush="#FF36B5C1" Foreground="white" Height="50" Width="50" RenderTransformOrigin="0.5,0.5" Margin="10 0" Click="btn_space14_Click"/>
<Button x:Name="btn_space15" Content="15" FontSize="15" Background="DarkCyan" BorderBrush="#FF36B5C1" Foreground="white" Height="50" Width="50" RenderTransformOrigin="0.5,0.5" Margin="10 0" Click="btn_space15_Click"/>
<Button x:Name="btn_space16" Content="16" FontSize="15" Background="DarkCyan" BorderBrush="#FF36B5C1" Foreground="white" Height="50" Width="50" RenderTransformOrigin="0.5,0.5" Margin="10 0" Click="btn_space16_Click"/>
<!--<Button x:Name="btn_space15" Content="15" FontSize="15" Background="DarkCyan" BorderBrush="#FF36B5C1" Foreground="white" Height="50" Width="50" RenderTransformOrigin="0.5,0.5" Margin="10 0" Click="btn_space15_Click"/>
<Button x:Name="btn_space16" Content="16" FontSize="15" Background="DarkCyan" BorderBrush="#FF36B5C1" Foreground="white" Height="50" Width="50" RenderTransformOrigin="0.5,0.5" Margin="10 0" Click="btn_space16_Click"/>-->
</WrapPanel>
</WrapPanel>
<StackPanel Grid.Row="3" Orientation="Horizontal" VerticalAlignment="Center" Margin="50,0,0,0">

@ -60,23 +60,23 @@ namespace Aucma.Core.Palletiz.Views
#region 目的货道选择
private void btn_space1_Click(object sender, RoutedEventArgs e)
{
btn_space1.Background = Brushes.Lime;
btn_space2.Background = Brushes.DarkCyan;
btn_space3.Background = Brushes.DarkCyan;
btn_space4.Background = Brushes.DarkCyan;
btn_space5.Background = Brushes.DarkCyan;
btn_space6.Background = Brushes.DarkCyan;
btn_space7.Background = Brushes.DarkCyan;
btn_space8.Background = Brushes.DarkCyan;
btn_space9.Background = Brushes.DarkCyan;
btn_space1.Background = Brushes.Lime;
btn_space2.Background = Brushes.DarkCyan;
btn_space3.Background = Brushes.DarkCyan;
btn_space4.Background = Brushes.DarkCyan;
btn_space5.Background = Brushes.DarkCyan;
btn_space6.Background = Brushes.DarkCyan;
btn_space7.Background = Brushes.DarkCyan;
btn_space8.Background = Brushes.DarkCyan;
btn_space9.Background = Brushes.DarkCyan;
btn_space10.Background = Brushes.DarkCyan;
btn_space11.Background = Brushes.DarkCyan;
btn_space12.Background = Brushes.DarkCyan;
btn_space13.Background = Brushes.DarkCyan;
btn_space14.Background = Brushes.DarkCyan;
btn_space15.Background = Brushes.DarkCyan;
btn_space16.Background = Brushes.DarkCyan;
this.btn_spaceTemp.Text = "001";
//btn_space15.Background = Brushes.DarkCyan;
//btn_space16.Background = Brushes.DarkCyan;
this.btn_spaceTemp.Text = "001";
}
private void btn_space2_Click(object sender, RoutedEventArgs e)
@ -95,8 +95,8 @@ namespace Aucma.Core.Palletiz.Views
btn_space12.Background = Brushes.DarkCyan;
btn_space13.Background = Brushes.DarkCyan;
btn_space14.Background = Brushes.DarkCyan;
btn_space15.Background = Brushes.DarkCyan;
btn_space16.Background = Brushes.DarkCyan;
//btn_space15.Background = Brushes.DarkCyan;
//btn_space16.Background = Brushes.DarkCyan;
this.btn_spaceTemp.Text = "002";
}
@ -116,8 +116,8 @@ namespace Aucma.Core.Palletiz.Views
btn_space12.Background = Brushes.DarkCyan;
btn_space13.Background = Brushes.DarkCyan;
btn_space14.Background = Brushes.DarkCyan;
btn_space15.Background = Brushes.DarkCyan;
btn_space16.Background = Brushes.DarkCyan;
//btn_space15.Background = Brushes.DarkCyan;
//btn_space16.Background = Brushes.DarkCyan;
this.btn_spaceTemp.Text = "003";
}
@ -137,8 +137,8 @@ namespace Aucma.Core.Palletiz.Views
btn_space12.Background = Brushes.DarkCyan;
btn_space13.Background = Brushes.DarkCyan;
btn_space14.Background = Brushes.DarkCyan;
btn_space15.Background = Brushes.DarkCyan;
btn_space16.Background = Brushes.DarkCyan;
//btn_space15.Background = Brushes.DarkCyan;
//btn_space16.Background = Brushes.DarkCyan;
this.btn_spaceTemp.Text = "004";
}
@ -158,8 +158,8 @@ namespace Aucma.Core.Palletiz.Views
btn_space12.Background = Brushes.DarkCyan;
btn_space13.Background = Brushes.DarkCyan;
btn_space14.Background = Brushes.DarkCyan;
btn_space15.Background = Brushes.DarkCyan;
btn_space16.Background = Brushes.DarkCyan;
//btn_space15.Background = Brushes.DarkCyan;
//btn_space16.Background = Brushes.DarkCyan;
this.btn_spaceTemp.Text = "005";
}
@ -179,8 +179,8 @@ namespace Aucma.Core.Palletiz.Views
btn_space12.Background = Brushes.DarkCyan;
btn_space13.Background = Brushes.DarkCyan;
btn_space14.Background = Brushes.DarkCyan;
btn_space15.Background = Brushes.DarkCyan;
btn_space16.Background = Brushes.DarkCyan;
//btn_space15.Background = Brushes.DarkCyan;
//btn_space16.Background = Brushes.DarkCyan;
this.btn_spaceTemp.Text = "006";
}
@ -200,8 +200,8 @@ namespace Aucma.Core.Palletiz.Views
btn_space12.Background = Brushes.DarkCyan;
btn_space13.Background = Brushes.DarkCyan;
btn_space14.Background = Brushes.DarkCyan;
btn_space15.Background = Brushes.DarkCyan;
btn_space16.Background = Brushes.DarkCyan;
//btn_space15.Background = Brushes.DarkCyan;
//btn_space16.Background = Brushes.DarkCyan;
this.btn_spaceTemp.Text = "007";
}
private void btn_space8_Click(object sender, RoutedEventArgs e)
@ -220,8 +220,8 @@ namespace Aucma.Core.Palletiz.Views
btn_space12.Background = Brushes.DarkCyan;
btn_space13.Background = Brushes.DarkCyan;
btn_space14.Background = Brushes.DarkCyan;
btn_space15.Background = Brushes.DarkCyan;
btn_space16.Background = Brushes.DarkCyan;
//btn_space15.Background = Brushes.DarkCyan;
//btn_space16.Background = Brushes.DarkCyan;
this.btn_spaceTemp.Text = "008";
}
private void btn_space9_Click(object sender, RoutedEventArgs e)
@ -240,8 +240,8 @@ namespace Aucma.Core.Palletiz.Views
btn_space12.Background = Brushes.DarkCyan;
btn_space13.Background = Brushes.DarkCyan;
btn_space14.Background = Brushes.DarkCyan;
btn_space15.Background = Brushes.DarkCyan;
btn_space16.Background = Brushes.DarkCyan;
//btn_space15.Background = Brushes.DarkCyan;
//btn_space16.Background = Brushes.DarkCyan;
this.btn_spaceTemp.Text = "009";
}
private void btn_space10_Click(object sender, RoutedEventArgs e)
@ -260,8 +260,8 @@ namespace Aucma.Core.Palletiz.Views
btn_space12.Background = Brushes.DarkCyan;
btn_space13.Background = Brushes.DarkCyan;
btn_space14.Background = Brushes.DarkCyan;
btn_space15.Background = Brushes.DarkCyan;
btn_space16.Background = Brushes.DarkCyan;
//btn_space15.Background = Brushes.DarkCyan;
//btn_space16.Background = Brushes.DarkCyan;
this.btn_spaceTemp.Text = "010";
}
private void btn_space11_Click(object sender, RoutedEventArgs e)
@ -280,8 +280,8 @@ namespace Aucma.Core.Palletiz.Views
btn_space12.Background = Brushes.DarkCyan;
btn_space13.Background = Brushes.DarkCyan;
btn_space14.Background = Brushes.DarkCyan;
btn_space15.Background = Brushes.DarkCyan;
btn_space16.Background = Brushes.DarkCyan;
//btn_space15.Background = Brushes.DarkCyan;
//btn_space16.Background = Brushes.DarkCyan;
this.btn_spaceTemp.Text = "011";
}
private void btn_space12_Click(object sender, RoutedEventArgs e)
@ -300,8 +300,8 @@ namespace Aucma.Core.Palletiz.Views
btn_space12.Background = Brushes.Lime;
btn_space13.Background = Brushes.DarkCyan;
btn_space14.Background = Brushes.DarkCyan;
btn_space15.Background = Brushes.DarkCyan;
btn_space16.Background = Brushes.DarkCyan;
//btn_space15.Background = Brushes.DarkCyan;
//btn_space16.Background = Brushes.DarkCyan;
this.btn_spaceTemp.Text = "012";
}
private void btn_space13_Click(object sender, RoutedEventArgs e)
@ -320,8 +320,8 @@ namespace Aucma.Core.Palletiz.Views
btn_space12.Background = Brushes.DarkCyan;
btn_space13.Background = Brushes.Lime;
btn_space14.Background = Brushes.DarkCyan;
btn_space15.Background = Brushes.DarkCyan;
btn_space16.Background = Brushes.DarkCyan;
//btn_space15.Background = Brushes.DarkCyan;
//btn_space16.Background = Brushes.DarkCyan;
this.btn_spaceTemp.Text = "013";
}
private void btn_space14_Click(object sender, RoutedEventArgs e)
@ -340,8 +340,8 @@ namespace Aucma.Core.Palletiz.Views
btn_space12.Background = Brushes.DarkCyan;
btn_space13.Background = Brushes.DarkCyan;
btn_space14.Background = Brushes.Lime;
btn_space15.Background = Brushes.DarkCyan;
btn_space16.Background = Brushes.DarkCyan;
//btn_space15.Background = Brushes.DarkCyan;
//btn_space16.Background = Brushes.DarkCyan;
this.btn_spaceTemp.Text = "014";
}
private void btn_space15_Click(object sender, RoutedEventArgs e)
@ -360,8 +360,8 @@ namespace Aucma.Core.Palletiz.Views
btn_space12.Background = Brushes.DarkCyan;
btn_space13.Background = Brushes.DarkCyan;
btn_space14.Background = Brushes.DarkCyan;
btn_space15.Background = Brushes.Lime;
btn_space16.Background = Brushes.DarkCyan;
//btn_space15.Background = Brushes.Lime;
//btn_space16.Background = Brushes.DarkCyan;
this.btn_spaceTemp.Text = "015";
}
private void btn_space16_Click(object sender, RoutedEventArgs e)
@ -380,8 +380,8 @@ namespace Aucma.Core.Palletiz.Views
btn_space12.Background = Brushes.DarkCyan;
btn_space13.Background = Brushes.DarkCyan;
btn_space14.Background = Brushes.DarkCyan;
btn_space15.Background = Brushes.DarkCyan;
btn_space16.Background = Brushes.Lime;
//btn_space15.Background = Brushes.DarkCyan;
//btn_space16.Background = Brushes.Lime;
this.btn_spaceTemp.Text = "016";
}
#endregion

@ -229,19 +229,19 @@ namespace Aucma.Core.PrintTo.ViewModels
[RelayCommand]
private void SupplementPrint(string obj)
{
if (string.IsNullOrEmpty(obj))
{
MessageBox.Show("请选中要补打的数据!", "系统提醒");
return;
}
string order_code = SelectedCells.OrderCode;
string product_code = SelectedCells.ProductCode;
string product_name = SelectedCells.ProductName;
string material_code = SelectedCells.MaterialCode;
string material_name = SelectedCells.MaterialName;
int standard_amount = SelectedCells.StandardAmount;
//if (string.IsNullOrEmpty(obj))
//{
// MessageBox.Show("请选中要补打的数据!", "系统提醒");
// return;
//}
//string order_code = SelectedCells.OrderCode;
//string product_code = SelectedCells.ProductCode;
//string product_name = SelectedCells.ProductName;
//string material_code = SelectedCells.MaterialCode;
//string material_name = SelectedCells.MaterialName;
//int standard_amount = SelectedCells.StandardAmount;
SupplementPrintPageView printToDev = new SupplementPrintPageView(order_code,product_code, material_code, material_name);
SupplementPrintPageView printToDev = new SupplementPrintPageView();
printToDev.ShowDialog();
}
#endregion

@ -1,6 +1,7 @@
using Admin.Core.IRepository;
using Admin.Core.IService;
using Admin.Core.Service;
using Admin.Core.Service.Service_New;
using Aucma.Core.PrintTo.Models;
using Aucma.Core.PrintTo.Views;
using CommunityToolkit.Mvvm.ComponentModel;
@ -22,22 +23,12 @@ namespace Aucma.Core.PrintTo.ViewModels
private static readonly log4net.ILog log = LogManager.GetLogger(typeof(SupplementPrintPageViewModel));
private readonly IPrintBarCodeServices? _barCodeServices;
protected readonly IBaseOrderInfoServices? _baseOrderInfoServices;
protected readonly IPrintSuppleMentBarCodeServices _printSuppleMentBarCodeServices;
public SupplementPrintPageViewModel() {
public SupplementPrintPageViewModel() { }
public SupplementPrintPageViewModel(string orderCode, string productCode,string material_code,string materialName)
{
OrderNo = orderCode;
ProductNo = productCode;
MaterialCode = material_code;
MaterialName = materialName;
_barCodeServices = App.ServiceProvider.GetService<IPrintBarCodeServices>();
_baseOrderInfoServices = App.ServiceProvider.GetService<IBaseOrderInfoServices>();
Task.WaitAll(LoadData(productCode, material_code));
_printSuppleMentBarCodeServices = App.ServiceProvider.GetService<IPrintSuppleMentBarCodeServices>();
}
#region 选中订单参数
#region 产品编码
@ -75,7 +66,7 @@ namespace Aucma.Core.PrintTo.ViewModels
{
if (string.IsNullOrEmpty(obj))
{
MessageBox.Show("请选中一行", "系统提醒");
MessageBox.Show("请选中要补打的条码", "系统提醒");
return;
}
var productCode = SelectedCells.ProductCode;
@ -96,22 +87,22 @@ namespace Aucma.Core.PrintTo.ViewModels
[RelayCommand]
private async Task QueryBarCode(string queryStr)
{
//System.Windows.Application.Current.Dispatcher.Invoke((Action)(async () =>
//{
System.Windows.Application.Current.Dispatcher.Invoke((Action)(async () =>
{
if (!string.IsNullOrEmpty(queryStr))
{
Datalist.Clear();
var list = await _barCodeServices.QueryAsync(d => d.MaterialName.Contains(queryStr) ||d.MaterialBarcode.Equals(ProductNo) || d.OrderCode.Equals(ProductNo));
var list = await _printSuppleMentBarCodeServices.QueryAsync(d => d.MaterialName.Contains(queryStr) || d.MaterialBarCode.Equals(ProductNo) || d.OrderCode.Equals(ProductNo));
foreach (var item in list)
{
Datalist.Add(new BarCodeModel() {
Datalist.Add(new BarCodeModel()
{
ProductCode = ProductNo,
MaterialCode= item.MaterialCode,
MaterialName=item.MaterialName,
BarCode = item.MaterialBarcode,
PrintTime = item.PrintTime,
SuppleMetNum = item.SupplementMaterial
MaterialCode = item.MaterialCode,
MaterialName = item.MaterialName,
BarCode = item.MaterialBarCode,
PrintTime = item.PrintTime
});
}
}
@ -120,24 +111,24 @@ namespace Aucma.Core.PrintTo.ViewModels
Datalist.Clear();
await LoadData(ProductNo, MaterialCode);
}
//}));
}));
}
#endregion
#region 加载DataGrid数据
private async Task LoadData(string productCode,string material_code)
private async Task LoadData(string materialCode, string materialName)
{
var list = await _barCodeServices.QueryAsync(d => d.OrderCode.Contains(productCode)&& d.MaterialCode.Contains(material_code));
var list = await _printSuppleMentBarCodeServices.QueryAsync(d=>d.MaterialBarCode.Contains(materialCode)|| d.MaterialBarCode.Contains(materialName));
if (list == null) return;
foreach (var item in list)
{
Datalist.Add(new BarCodeModel() {
ProductCode = ProductNo,
MaterialCode = item.MaterialCode,
MaterialName = item.MaterialName,
BarCode = item.MaterialBarcode,
PrintTime = item.PrintTime,
SuppleMetNum = item.SupplementMaterial
BarCode = item.MaterialBarCode,
PrintTime = item.PrintTime
});
}
}

@ -0,0 +1,23 @@
using Admin.Core.IService;
using CommunityToolkit.Mvvm.ComponentModel;
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
/**
*
* */
namespace Aucma.Core.PrintTo.ViewModels
{
public class SupplementViewModel : ObservableObject
{
public SupplementViewModel()
{
_printSuppleMentBarCodeServices = App.ServiceProvider.GetService<IPrintSuppleMentBarCodeServices>();
}
}
}

@ -27,11 +27,11 @@ namespace Aucma.Core.PrintTo.Views
this.DataContext = new SupplementPrintPageViewModel();
}
public SupplementPrintPageView(string orderCode,string productCode,string material_code, string materialName)
{
InitializeComponent();
this.DataContext = new SupplementPrintPageViewModel(orderCode, productCode, material_code, materialName);
}
//public SupplementPrintPageView(string orderCode,string productCode,string material_code, string materialName)
//{
// InitializeComponent();
// this.DataContext = new SupplementPrintPageViewModel(orderCode, productCode, material_code, materialName);
//}
private void queryParam_PreviewMouseDown(object sender, MouseButtonEventArgs e)
{

@ -0,0 +1,90 @@
<Window x:Class="Aucma.Core.PrintTo.Views.SupplementView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
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:Aucma.Core.PrintTo.Views"
mc:Ignorable="d"
Background="#1152AC"
Name="window"
d:DesignHeight="700"
d:DesignWidth="700"
Title="二维码打印"
Height="700"
Width="700"
FontFamily="Microsoft YaHei"
WindowStartupLocation="CenterScreen"
WindowStyle="ToolWindow"
>
<Border Margin="5" BorderBrush="#0288d1" BorderThickness="1" CornerRadius="5">
<Grid Margin="15">
<Grid.RowDefinitions>
<RowDefinition Height="5*"/>
<RowDefinition Height="5*"/>
<RowDefinition/>
</Grid.RowDefinitions>
<UniformGrid Grid.Row="0" >
<GroupBox Margin="16 0" Header="订单信息" FontSize="18" >
<Grid>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<WrapPanel Grid.Row="0" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock Text="产品编号" FontSize="18" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<TextBox FontSize="18" Text="{Binding ProductCode}" Width="300" Foreground="White" BorderBrush="White" Margin="15 0 0 0" VerticalAlignment="Center" IsReadOnly="True"/>
</WrapPanel>
<WrapPanel Grid.Row="1" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock Text="产品型号" FontSize="18" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<TextBox Text="{Binding ProductName}" FontSize="18" Width="300" Foreground="White" BorderBrush="White"
Margin="15 0 0 0"
HorizontalAlignment="Center" VerticalAlignment="Center" IsReadOnly="True"/>
</WrapPanel>
<WrapPanel Grid.Row="2" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock Text="打印名称" FontSize="18" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<TextBox Text="{Binding PrintName}" FontSize="18" Width="300" Foreground="White" BorderBrush="White" Margin="15 0 0 0" IsReadOnly="True"
HorizontalAlignment="Center" VerticalAlignment="Center" />
</WrapPanel>
</Grid>
</GroupBox>
</UniformGrid>
<UniformGrid Grid.Row="1" >
<GroupBox Margin="16 0" Header="打印详情" FontSize="18">
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<WrapPanel Grid.Row="0" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock Text="打印进度" FontSize="18" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<ProgressBar Style="{x:Null}" Height="20" Minimum="1" Maximum="{Binding MaxProgress}" Value="{Binding Progress}" Width="300" Margin="6"/>
</WrapPanel>
<WrapPanel Grid.Row="1" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock Text="打印信息" FontSize="18" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<TextBox Text="{Binding PrintProgress}" FontSize="18" Width="300" Foreground="White" BorderBrush="White"
Margin="10 0 0 0" HorizontalAlignment="Center" VerticalAlignment="Center" IsReadOnly="True"/>
</WrapPanel>
<WrapPanel Grid.Row="2" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock Text="打印状态" FontSize="18" Foreground="White" Margin="5"/>
<TextBlock FontSize="18" Margin="10 0" Background="{Binding State}" Width="20" Height="20"
HorizontalAlignment="Center" VerticalAlignment="Center"/>
<TextBlock Text="异常条码数量:" Margin="5" FontSize="18" Foreground="White"/>
<TextBlock Text="{Binding ErrorNum}" FontSize="18" Margin="10 0" Width="130" Foreground="White"
HorizontalAlignment="Center" VerticalAlignment="Center"/>
</WrapPanel>
<WrapPanel Grid.Row="3" HorizontalAlignment="Center" VerticalAlignment="Center">
<Button Content="打印" x:Name="Start" Height="40" FontSize="18" Margin="20 0" Command="{Binding StartOperateCommand}" IsEnabled="{Binding OperateEnabled,Mode=TwoWay}"/>
<Button Content="暂停" x:Name="Suspend" Height="40" FontSize="18" Margin="20 0" Command="{Binding SuspendOperateCommand}" IsEnabled="{Binding SuspendEnabled,Mode=TwoWay}" />
<Button Content="关闭" x:Name="Close" Height="40" FontSize="18" Margin="20 0" Command="{Binding CloseWindowCommand}" CommandParameter="{Binding ElementName=window}" />
</WrapPanel>
</Grid>
</GroupBox>
</UniformGrid>
</Grid>
</Border>
</Window>

@ -0,0 +1,28 @@
using Aucma.Core.PrintTo.ViewModels;
using System.Windows;
namespace Aucma.Core.PrintTo.Views
{
/// <summary>
/// SupplementView.xaml 的交互逻辑
/// </summary>
public partial class SupplementView : Window
{
#region 构造函数
/// <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 order_code,string materialCode)
{
InitializeComponent();
this.DataContext = new SupplementView();
}
#endregion
}
}

@ -1,4 +1,5 @@
using Admin.Core.Common;
using Admin.Core.Common.Helper;
using Admin.Core.IService;
using Admin.Core.Model;
using Admin.Core.Model.Model_New;
@ -6,7 +7,10 @@ using Admin.Core.Model.ViewModels;
using Aucma.Core.HwPLc;
using Aucma.Core.Tasks.Business;
using log4net;
using StackExchange.Profiling.Internal;
using System.Text;
using System.Timers;
using static ICSharpCode.SharpZipLib.Zip.ExtendedUnixData;
namespace Aucma.Core.Tasks
{
@ -16,36 +20,334 @@ namespace Aucma.Core.Tasks
public class AucamTaskService : IAucamTaskService
{
private static readonly log4net.ILog logHelper = LogManager.GetLogger(typeof(AucamTaskService));
Semaphore semaphore = new Semaphore(1, 1);
protected readonly IPerfusionRecordServices? _perfusionRecordServices;
protected readonly IPerfusionAlarmServices? _perfusionAlarmServices;
protected readonly IPerfusionDeviceStatusServices? _perfusionDeviceStatusServices;
private readonly IMaterialCompletionServices _materialCompletionServices;
private readonly IPrintBarCodeServices _printBarCodeServices;
bool flag = true;
private static System.Text.ASCIIEncoding asciiEncoding = new System.Text.ASCIIEncoding();
private Perfusion_Record record;
private Perfusion_Record temprRecord;
private Perfusion_DeviceStatus perfusion_DeviceStatus = new Perfusion_DeviceStatus();
private Perfusion_Alarm perfusion_Alarm = new Perfusion_Alarm();
System.Timers.Timer timer1 = new System.Timers.Timer(5000);
public AucamTaskService(IPerfusionRecordServices perfusionRecordServices,
IPerfusionAlarmServices perfusionAlarmServices, IExecutePlanInfoServices executePlanInfoServices,
IPerfusionDeviceStatusServices perfusionDeviceStatusServices)
public AucamTaskService(IPerfusionRecordServices perfusionRecordServices, IPerfusionAlarmServices perfusionAlarmServices,
IPerfusionDeviceStatusServices perfusionDeviceStatusServices, IMaterialCompletionServices materialCompletionServices,
IPrintBarCodeServices printBarCodeServices)
{
PerfusionCollection coll = new PerfusionCollection(perfusionRecordServices, perfusionAlarmServices, perfusionDeviceStatusServices);
_perfusionRecordServices = perfusionRecordServices;
_perfusionAlarmServices = perfusionAlarmServices;
_perfusionDeviceStatusServices = perfusionDeviceStatusServices;
_materialCompletionServices = materialCompletionServices;
_printBarCodeServices = printBarCodeServices;
}
#region 更新钣金工位计划数
bool qFlay = true;//完成
public void AucamUpdatePlanNumTask()
public void AucamTaskAsync()
{
startCollect();
}
#endregion
#region 灌注
public void startCollect()
{
Task.Run(() =>
{
Thread.Sleep(3000);
Console.WriteLine($"【{DateTime.Now}】》灌注数据采集服务开启");
var obj = PlcHelper.siemensList.FirstOrDefault(d => d.EquipName.Equals("PerfusionPlc"));
if (obj != null)
{
while (true)
{
if (flag)
{
flag = false;
try
{
int signal = obj.plc.ReadInt16("DB55.84.0");
if (signal == 0)
{
Thread.Sleep(1000);
continue;
}
Console.WriteLine($"【{DateTime.Now}】》当前灌注采集信号:{signal}");
Console.WriteLine($"【{DateTime.Now}】》灌注数据开始采集");
//采集数据
record = ReadEquipSystem(obj, record, perfusion_DeviceStatus, perfusion_Alarm);
if (record == null) continue;
if (string.IsNullOrEmpty(record.PerfusionBoxCode))
{
Console.WriteLine($"【{DateTime.Now}】》条码为空!");
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;
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
//充注结束
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}】》保存过点数成功!");
}
}
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)
{
Console.WriteLine(ex);
}
finally
{
flag = true;
// Console.WriteLine($"【{DateTime.Now}】》灌注数据采集结束");
}
}
}
}
});
}
/// <summary>
/// 采集灌注参数
/// </summary>
/// <returns></returns>
static Perfusion_Record ReadEquipSystem(Aucma.Core.HwPLc.PlcModel obj, Perfusion_Record record, Perfusion_DeviceStatus deviceStatus, Perfusion_Alarm alarmInfo)
{
record = new Perfusion_Record();
byte[] info = obj.plc.Read("DB55.0", 84);
byte[] codeInfo = obj.plc.Read("DB60.0", 46);
if (info == null) return null;
#region 灌注记录赋值
record.PerfusionActualVolume = byteToDouble(info.Skip(0).Take(8).ToArray()).ToString().Replace("\0", "");
record.PerfusionR = byteToFloat(info.Skip(8).Take(4).ToArray()).ToString().ToString().Replace("\0", "");
record.PerfusionL = byteToFloat(info.Skip(54).Take(4).ToArray()).ToString().Replace("\0", "");
record.PerfusionDuration = int.Parse(StringChange.bytesToHexStr(info.Skip(12).Take(4).ToArray(), 4), System.Globalization.NumberStyles.HexNumber).ToString().Replace("\0", "");
record.Yield = int.Parse(StringChange.bytesToHexStr(info.Skip(16).Take(4).ToArray(), 4), System.Globalization.NumberStyles.HexNumber).ToString().Replace("\0", "");
record.PerfusionBoxCode = asciiEncoding.GetString(codeInfo.Skip(2).Take(22).ToArray()).Trim('\n').Replace("\0", "").Replace("\r","");
record.PerfusionRefrigerantTypeLeft = asciiEncoding.GetString(codeInfo.Skip(28).Take(7).ToArray()).Trim('\n').Replace("\0", "");
record.PerfusionRefrigerantTypeRight = asciiEncoding.GetString(codeInfo.Skip(38).Take(7).ToArray()).Trim('\n').Replace("\0", "");
record.PerfusionSetVolume = byteToFloat(info.Skip(78).Take(4).ToArray()).ToString().Replace("\0", "");
record.PerfusionSystem = short.Parse(StringChange.bytesToHexStr(info.Skip(82).Take(2).ToArray(), 2), System.Globalization.NumberStyles.HexNumber).ToString().Replace("\0", "");
///灌注完成状态字
record.PerfusionFinishStatus = short.Parse(StringChange.bytesToHexStr(info.Skip(46).Take(2).ToArray(), 2), System.Globalization.NumberStyles.HexNumber).ToString().Replace("\0", "");
record.PerfusionResult = short.Parse(StringChange.bytesToHexStr(info.Skip(48).Take(2).ToArray(), 2), System.Globalization.NumberStyles.HexNumber);
record.CreatedBy = "equip";
record.CreatedTime = DateTime.Now;
record.UpdatedBy = "equip";
record.UpdatedTime = DateTime.Now;
#endregion
// Console.WriteLine("灌注记录:" + record.ToJson());
#region 设备状态赋值
deviceStatus.PerfusionDevicetype = "灌注";
deviceStatus.PerfusionStatus = short.Parse(StringChange.bytesToHexStr(info.Skip(50).Take(2).ToArray(), 2), System.Globalization.NumberStyles.HexNumber);
deviceStatus.CreatedBy = "equip";
deviceStatus.CreatedTime = DateTime.Now;
deviceStatus.UpdatedBy = "equip";
deviceStatus.UpdatedTime = DateTime.Now;
#endregion
// Console.WriteLine("设备状态:" + deviceStatus.ToJson());
#region 设备报警赋值
alarmInfo.PerfusionBoxcode = record.PerfusionBoxCode;
alarmInfo.PerfusionStatus = short.Parse(StringChange.bytesToHexStr(info.Skip(52).Take(2).ToArray(), 2), System.Globalization.NumberStyles.HexNumber);
alarmInfo.PerfusionAlarm = AlarmTrans(alarmInfo.PerfusionStatus);
alarmInfo.PerfusionCompleted = "1";
alarmInfo.CreatedBy = "equip";
alarmInfo.CreatedTime = DateTime.Now;
alarmInfo.UpdatedBy = "equip";
alarmInfo.UpdatedTime = DateTime.Now;
#endregion
// Console.WriteLine("报警信息:" + alarmInfo.ToJson());
// Console.WriteLine("\n");
return record;
}
static string AlarmTrans(short code)
{
//timer1.Elapsed += new System.Timers.ElapsedEventHandler(Run1); //到达时间的时候执行事件;
//timer1.AutoReset = true;//设置是执行一次false还是一直执行(true)
//timer1.Enabled = true;//需要调用 timer.Start()或者timer.Enabled = true来启动它
//timer1.Start();//timer.Start()的内部原理还是设置timer.Enabled = true;
string result = "";
switch (code)
{
case 2: result = "充注枪真空不合格"; break;
case 4: result = "充注故障"; break;
case 8: result = "充注时真空度超限定"; break;
case 16: result = "回升检测不合格"; break;
case 32: result = "工件真空不合格"; break;
case 64: result = "平衡缸接近开关异常"; break;
case 128: result = "增压超时"; break;
case 256: result = "风压不足"; break;
}
return result;
}
private void Run1(object? sender, ElapsedEventArgs e)
#region 字符工具转换方法
/// byte[]转十进制ascii码
/// </summary>
/// <param name="bytes"></param>
static string ByteArrayToString(byte[] bytes)
{
string result = string.Empty;
foreach (byte b in bytes)
{
int decimalValue = Convert.ToInt32(b); // 将字节转换为十进制值
result += decimalValue;
}
return result;
}
/// <summary>
/// byte[]转二进制
/// </summary>
/// <param name="bytes"></param>
static string ByteArrayToBinary(byte[] bytes)
{
if (qFlay)
StringBuilder binaryString = new StringBuilder();
foreach (byte b in bytes)
{
qFlay = false;
binaryString.Append(Convert.ToString(b, 2).PadLeft(8, '0'));
}
}
// Console.WriteLine(binaryString);
string reversedStr = new string(binaryString.ToString().Reverse().ToArray());
// Console.WriteLine(reversedStr);
return reversedStr;
}
/// <summary>
/// 根据二进制字符串确定夹具状态 1正常生产 2暂停生产
/// </summary>
static int judgeStatus(string str1)
{
int item1 = 0;
if (str1.Substring(0, 1) == "1")
{
item1 = 1; //
}
else if (str1.Substring(1, 1) == "1")
{
item1 = 2; //
}
return item1;
}
/// <summary>
/// byte数组转换为float
/// </summary>
static float byteToFloat(byte[] list)
{
float result = 0.00f;
Array.Reverse(list);
result = BitConverter.ToSingle(list, 0);
// 只保留两位小数
// string str = result.ToString("0.00");
return result;
}
/// <summary>
/// byte数组转换为double
/// </summary>
static double byteToDouble(byte[] list)
{
double result = 0;
Array.Reverse(list);
result = BitConverter.ToDouble(list, 0);
return result;
}
#endregion
#region 保存过点数
/// <summary>
/// 保存过点数
/// </summary>
/// <param name="record"></param>
/// <returns></returns>
public bool InsertToCompleteAndCheck(Perfusion_Record record)
{
var barcode = _printBarCodeServices.FirstAsync(d => d.MaterialBarcode == record.PerfusionBoxCode).Result;
if (barcode == null) return false;
#region 更新过点数据
MaterialCompletion completion = new MaterialCompletion();
completion.OrderCode = barcode.OrderCode;
completion.MaterialBarcode = record.PerfusionBoxCode;
completion.MaterialCode = barcode.MaterialCode;
completion.MaterialName = barcode.MaterialName;
completion.StationName = "2015";
completion.ProductLineCode = "CX_02";
completion.CompleteDate = DateTime.Now;
#endregion
int r = _materialCompletionServices.AddAsync(completion).Result;
if (r > 0) return true;
else return false;
}
#endregion
#endregion
}
}

@ -25,7 +25,8 @@ namespace Aucma.Core.Tasks.Business
protected readonly IPerfusionRecordServices? _perfusionRecordServices;
protected readonly IPerfusionAlarmServices? _perfusionAlarmServices;
protected readonly IPerfusionDeviceStatusServices? _perfusionDeviceStatusServices;
private readonly IMaterialCompletionServices _materialCompletionServices;
private readonly IPrintBarCodeServices _printBarCodeServices;
bool flag = true;
private static System.Text.ASCIIEncoding asciiEncoding = new System.Text.ASCIIEncoding();
private Perfusion_Record record;
@ -33,11 +34,16 @@ namespace Aucma.Core.Tasks.Business
private Perfusion_DeviceStatus perfusion_DeviceStatus = new Perfusion_DeviceStatus();
private Perfusion_Alarm perfusion_Alarm = new Perfusion_Alarm();
public PerfusionCollection(IPerfusionRecordServices perfusionRecordServices, IPerfusionAlarmServices perfusionAlarmServices, IPerfusionDeviceStatusServices perfusionDeviceStatusServices)
public PerfusionCollection(IPerfusionRecordServices perfusionRecordServices, IPerfusionAlarmServices perfusionAlarmServices,
IPerfusionDeviceStatusServices perfusionDeviceStatusServices, IMaterialCompletionServices materialCompletionServices,
IPrintBarCodeServices printBarCodeServices)
{
_perfusionRecordServices = perfusionRecordServices;
_perfusionAlarmServices = perfusionAlarmServices;
_perfusionDeviceStatusServices = perfusionDeviceStatusServices;
_materialCompletionServices = materialCompletionServices;
_printBarCodeServices = printBarCodeServices;
startCollect();
}
@ -47,10 +53,10 @@ namespace Aucma.Core.Tasks.Business
Task.Run(() =>
{
Thread.Sleep(3000);
Console.WriteLine("灌注数据采集服务开启");
Console.WriteLine($"【{DateTime.Now}】》灌注数据采集服务开启");
var obj = PlcHelper.siemensList.FirstOrDefault(d => d.EquipName.Equals("PerfusionPlc"));
if (obj != null)
{
{
while (true)
{
if (flag)
@ -58,27 +64,28 @@ namespace Aucma.Core.Tasks.Business
flag = false;
try
{
byte[] info = obj.plc.Read("DB55.0", 84);
string r = short.Parse(StringChange.bytesToHexStr(info.Skip(46).Take(2).ToArray(), 2), System.Globalization.NumberStyles.HexNumber).ToString().Replace("\0", "");
if (r == "0")
bool signal = obj.plc.ReadBool("DB55.84.0");
if (signal == false)
{
Console.WriteLine($"【{DateTime.Now}】》当前灌注采集信号:{signal}");
Thread.Sleep(1000);
continue;
}
Console.WriteLine($"当前灌注采集信号:{r}");
Console.WriteLine("灌注数据开始采集");
Console.WriteLine($"【{DateTime.Now}】》当前灌注采集信号:{signal}");
Console.WriteLine($"【{DateTime.Now}】》灌注数据开始采集");
//采集数据
record = ReadEquipSystem(obj, info, record, perfusion_DeviceStatus, perfusion_Alarm);
record = ReadEquipSystem(obj, record, perfusion_DeviceStatus, perfusion_Alarm);
if (record == null) continue;
if (string.IsNullOrEmpty(record.PerfusionBoxCode)) continue;
Console.WriteLine($"灌注数据条码:[{record.PerfusionBoxCode}],灌注状态:[{record.PerfusionResult}]");
Console.WriteLine($"【{DateTime.Now}】》灌注数据条码:[{record.PerfusionBoxCode}],灌注状态:[{record.PerfusionResult}]");
var tempRecord = _perfusionRecordServices.FirstAsync(d => d.PerfusionBoxCode.Equals(record.PerfusionBoxCode) && d.PerfusionResult == record.PerfusionResult).Result;
var tempRecord = _perfusionRecordServices.FirstAsync(d => d.PerfusionBoxCode.Equals(record.PerfusionBoxCode) && d.PerfusionResult == record.PerfusionResult).Result;
if (tempRecord != null)
{
Console.WriteLine($"灌注数据条码:[{record.PerfusionBoxCode}],灌注结果:[{record.PerfusionResult}],已存在系统中");
Thread.Sleep(1000);
Console.WriteLine($"【{DateTime.Now}】》灌注数据条码:[{record.PerfusionBoxCode}],灌注结果:[{record.PerfusionResult}],已存在系统中");
Thread.Sleep(1000);
continue;
}
#region 更新设备状态
@ -103,20 +110,20 @@ namespace Aucma.Core.Tasks.Business
//充注结束
// if (record.PerfusionFinishStatus == "1")
// {
// 箱体码和上次不一样,或者箱体码一样但是充铸结果不一样
if (temprRecord == null || temprRecord.PerfusionBoxCode != record.PerfusionBoxCode || (temprRecord.PerfusionBoxCode == record.PerfusionBoxCode && temprRecord.PerfusionResult != record.PerfusionResult))
int result = _perfusionRecordServices.AddAsync(record).Result;
if (result == 0)
{
int result = _perfusionRecordServices.AddAsync(record).Result;
if (result == 0)
//添加过点数
if (record.PerfusionResult==8)
{
Console.WriteLine(record.ToJson());
temprRecord = record;
InsertToCompleteAndCheck(record);
}
Console.WriteLine(record.ToJson());
}
Console.WriteLine("灌注数据采集结束");
bool r = obj.plc.WriteBool("DB55.84.0", false);//存盘成功写入bool
Console.WriteLine($"【{DateTime.Now}】》灌注数据采集结束写入复位信号{r}");
}
catch (Exception ex)
{
@ -124,7 +131,7 @@ namespace Aucma.Core.Tasks.Business
}
finally { flag = true; }
}
}
}
@ -136,10 +143,10 @@ namespace Aucma.Core.Tasks.Business
/// 采集灌注参数
/// </summary>
/// <returns></returns>
static Perfusion_Record ReadEquipSystem(Aucma.Core.HwPLc.PlcModel obj, byte[] info, Perfusion_Record record, Perfusion_DeviceStatus deviceStatus, Perfusion_Alarm alarmInfo)
static Perfusion_Record ReadEquipSystem(Aucma.Core.HwPLc.PlcModel obj, Perfusion_Record record, Perfusion_DeviceStatus deviceStatus, Perfusion_Alarm alarmInfo)
{
record = new Perfusion_Record();
// byte[] info = obj.plc.Read("DB55.0", 84);
byte[] info = obj.plc.Read("DB55.0", 84);
byte[] codeInfo = obj.plc.Read("DB60.0", 46);
if (info == null) return null;
#region 灌注记录赋值
@ -285,5 +292,37 @@ namespace Aucma.Core.Tasks.Business
}
#endregion
#region 保存过点数和测温质检
/// <summary>
/// 保存过点数和测温质检
/// </summary>
/// <param name="list"></param>
/// <returns></returns>
public bool InsertToCompleteAndCheck(Perfusion_Record record)
{
var printBarCodeList = _printBarCodeServices.QueryAsync().Result;
PrintBarCode barcode = printBarCodeList.First(d => d.MaterialBarcode == record.PerfusionBoxCode);
if (barcode == null) return false;
#region 更新过点数据
MaterialCompletion completion = new MaterialCompletion();
completion.OrderCode = barcode.OrderCode;
completion.MaterialBarcode = record.PerfusionBoxCode;
completion.MaterialCode = barcode.MaterialCode;
completion.MaterialName = barcode.MaterialName;
completion.StationName = "测温检验01";
completion.ProductLineCode = "CX_02";
completion.CompleteDate = DateTime.Now;
#endregion
int r = _materialCompletionServices.AddAsync(completion).Result;
if (r > 0) return true;
else return false;
}
#endregion
}
}

@ -3,9 +3,6 @@ namespace Aucma.Core.Tasks
{
public interface IAucamTaskService
{
/// <summary>
/// 实时更新工位计划表中的数据
/// </summary>
public void AucamUpdatePlanNumTask();
public void AucamTaskAsync();
}
}

@ -98,11 +98,11 @@ namespace Aucma.Core.TemperatureTask
logHelper.Error($"读取数据个数:{historyList.Count()}");
Console.WriteLine($"【{DateTime.Now}】读取数据个数:{historyList.Count()}");
var result = _temperatureHistoryServices.AddAsync(query).Result;
if (result > 0)
if (result >0)
{
historyList.ForEach(d => d.IsSync = 1);
int r = _codeMESServices.UpateTemperatureHistoryFlag(historyList);
if (r > 0)
if (r> 0)
{
InsertToCompleteAndCheck(query);//保存过点数据
//发送post 请求
@ -143,7 +143,7 @@ namespace Aucma.Core.TemperatureTask
foreach (var temperatureHistory in list)
{
PrintBarCode barcode = printBarCodeList.First(d => d.MaterialBarcode == temperatureHistory.CpNo);
if (barcode != null) return false;
if (barcode == null) return false;
#region 更新过点数据
MaterialCompletion completion = new MaterialCompletion();
completion.OrderCode = barcode.OrderCode;
@ -176,6 +176,8 @@ namespace Aucma.Core.TemperatureTask
string address = Appsettings.app("Common", "TemperatureApiAddRess");//测温地址
Console.WriteLine($"【{DateTime.Now}】请求路径:{address}/report/qualityInspection/temperatureApi");
Console.WriteLine($"【{DateTime.Now}】发送数据:{list.ToJson()}");
list= list.Where(d=>d.CpResult== "OK").ToList();
Console.WriteLine($"发送Post信息{list.ToJson()}");
string check = HttpHelper.Post(address + "/report/qualityInspection/temperatureApi", list.ToJson());
Result r = check.FromJson<Result>();
if (r.code == 200)
@ -184,7 +186,11 @@ namespace Aucma.Core.TemperatureTask
Console.WriteLine($"【{DateTime.Now}】开始向质检发送测温数据");
return true;
}
Console.WriteLine($"【{DateTime.Now}】开始向质检发送测温数据");
else
{
Console.WriteLine($"【{DateTime.Now}】向质检发送测温数据失败:返回结果:{r.code};{r.msg}");
}
return false;
}
#endregion

@ -14,7 +14,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("HwControlLib")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+499f069197ca25e9a1608c75be20ffac33665f86")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+1a7f5b2c5d615dd77e3d962d3b3bc9e735ac9121")]
[assembly: System.Reflection.AssemblyProductAttribute("HwControlLib")]
[assembly: System.Reflection.AssemblyTitleAttribute("HwControlLib")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

@ -1 +1 @@
7b501ab02b3cefad141e2550ca8b109ee7970c78d614855bfd6caffe46135a36
d8a7f0a357cb634c93e2dc09fbebfab8d8edfbc46af62e2891ac2d3c51306ce2

Loading…
Cancel
Save