change - 界面修改,添加箱壳内胆绑定

collectionStore
liuwf 10 months ago
parent 6202ba0df5
commit 156e8c9142

@ -67,6 +67,8 @@ namespace Aucma.Scada.Business
private IRecordOutStoreService _recordOutStoreService;
private IRecordProductfinishService _recordProductfinishService;
private ICodeBindingRecordServices _codeBindingRecordServices;
#endregion
#region 委托事件
@ -111,7 +113,7 @@ namespace Aucma.Scada.Business
_productPlanInfoService = registerServices.GetService<IProductPlanInfoService>();
_recordOutStoreService = registerServices.GetService<IRecordOutStoreService>();
_recordProductfinishService = registerServices.GetService<IRecordProductfinishService>();
_codeBindingRecordServices = registerServices.GetService<ICodeBindingRecordServices>();
assemblyPlanBusiness.NextPassExecutePlanInfoEvent += PlanHandle;
taskHandleBusiness.OutStoreAnswerEvent += OutStoreAnswer;
taskHandleBusiness.OutStoreFinsihEvent += OutStoreFinish;
@ -138,9 +140,14 @@ namespace Aucma.Scada.Business
for (int i = 0; i < planInfo.planAmount - planInfo.completeAmount; i++)
{
string taskCode = System.Guid.NewGuid().ToString("N").Substring(0,10);
OutStore(appConfig.shellStoreCode, shellBomInfo, planInfo.executePlanCode, taskCode);
RealTaskInfo shellTask = OutStore(appConfig.shellStoreCode, shellBomInfo, planInfo.executePlanCode, taskCode);
Thread.Sleep(500);
OutStore(appConfig.linerStoreCode, linerBomInfo, planInfo.executePlanCode, taskCode);
RealTaskInfo linerTask = OutStore(appConfig.linerStoreCode, linerBomInfo, planInfo.executePlanCode, taskCode);
// 条码绑定表,绑定箱壳和内胆码 shellTask.materialCode,linerTask.materialCode
if (shellTask != null && linerTask != null)
{
_codeBindingRecordServices.BindingCode(shellTask.materialCode, linerTask.materialCode);
}
Thread.Sleep(500);
}
@ -162,7 +169,7 @@ namespace Aucma.Scada.Business
/// <param name="storeCode"></param>
/// <param name="bomInfo"></param>
/// <param name="planCode"></param>
private void OutStore(string storeCode, BaseBomInfo bomInfo, string planCode, string taskCode)
private RealTaskInfo OutStore(string storeCode, BaseBomInfo bomInfo, string planCode, string taskCode)
{
try
{
@ -175,18 +182,21 @@ namespace Aucma.Scada.Business
{
PrintLogInfoMessage($"匹配货道:{spaceInfo.spaceName}");
// RefreshScanMateriaCodeEvent?.Invoke(materiaclCode, materialType, spaceInfo.spaceName, storeCode); //刷新界面扫码信息
bool result = CreateOutStoreTask(spaceInfo, planCode, taskCode); //创建出库任务
if (result)
RealTaskInfo task = CreateOutStoreTask(spaceInfo, planCode, taskCode); //创建出库任务
if (task!=null)
{
PrintLogInfoMessage("出库任务创建成功");
return task;
}
else
{
PrintLogInfoMessage("出库任务创建失败");
return null;
}
}
else
{
return null;
//报警停线
PrintLogInfoMessage($"{storeCode};仓库内未获取到{bomInfo.materialCode}相匹配的物料及货道");
}
@ -194,6 +204,7 @@ namespace Aucma.Scada.Business
catch (Exception ex)
{
PrintLogErrorMessage("出库业务异常", ex);
return null;
}
}
@ -201,7 +212,7 @@ namespace Aucma.Scada.Business
/// 创建出库任务
/// </summary>
/// <param name="spaceInfo"></param>
private bool CreateOutStoreTask(BaseSpaceInfo spaceInfo, string planCode, string taksCode, int taskModel = 0)
private RealTaskInfo CreateOutStoreTask(BaseSpaceInfo spaceInfo, string planCode, string taksCode, int taskModel = 0)
{
bool result = false;
try
@ -210,7 +221,6 @@ namespace Aucma.Scada.Business
BaseSpaceDetail spaceDetail = GetSpaceDetailFirstOrderByCreatTime(spaceInfo);
if (spaceDetail != null)
{
#region 出库任务赋值
RealTaskInfo realTaskInfo = new RealTaskInfo();
realTaskInfo.planCode = planCode;
@ -235,6 +245,7 @@ namespace Aucma.Scada.Business
RefreshOutStoreTaskEvent?.Invoke(realTaskInfo);
UpdateSpaceAndDetial(spaceInfo, spaceDetail);
return realTaskInfo;
}
else
{
@ -246,7 +257,7 @@ namespace Aucma.Scada.Business
{
PrintLogErrorMessage("出库任务创建异常", ex);
}
return result;
return null;
}
/// <summary>
@ -788,7 +799,9 @@ namespace Aucma.Scada.Business
BaseSpaceInfo spaceInfo = _spaceInfoService.GetSpaceInfoBySpaceCode(storeCode, spaceCode);
if (spaceInfo.spaceStock > 0)
{
result = this.CreateOutStoreTask(spaceInfo, System.Guid.NewGuid().ToString("N"), DateTime.Now.ToString("HH:mm:ss"), 1);
RealTaskInfo task = this.CreateOutStoreTask(spaceInfo, System.Guid.NewGuid().ToString("N"), DateTime.Now.ToString("HH:mm:ss"), 1);
if (task != null)
result = true;
}
else
{

@ -62,7 +62,7 @@ namespace Aucma.Scada.Business
services.AddSingleton<IRecordInStoreService, RecordInStoreServiceImpl>();
services.AddSingleton<IRecordOutStoreService, RecordOutStoreServiceImpl>();
services.AddSingleton<IRecordProductfinishService, RecordProductfinishServiceImpl>();
services.AddSingleton<ICodeBindingRecordServices, CodeBindingRecordServiceImpl>();
}
public T GetService<T>()

@ -47,6 +47,7 @@
<Compile Include="domain\BaseBomInfo.cs" />
<Compile Include="domain\BaseSpaceDetail.cs" />
<Compile Include="domain\BaseSpaceInfo.cs" />
<Compile Include="domain\CodeBindingRecord.cs" />
<Compile Include="domain\ExecutePlanInfo.cs" />
<Compile Include="domain\ProductPlanInfo.cs" />
<Compile Include="domain\RealTaskInfo.cs" />

@ -0,0 +1,63 @@
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Principal;
using System.Text;
using System.Threading.Tasks;
namespace Aucma.Scada.Model.domain
{ /// <summary>
/// 条码绑定记录
/// </summary>
[SugarTable("CODE_BINDING", "AUCMA_SCADA")]
public class CodeBindingRecord
{
/// <summary>
/// 主键
/// </summary>
[SugarColumn(ColumnName = "OBJ_ID", IsIdentity = true, IsPrimaryKey = true, OracleSequenceName = "SEQ_CODE_BINDING")]
public int ObjId { get; set; }
/// <summary>
/// 箱体条码
/// </summary>
[SugarColumn(ColumnName = "BOX_Code")]
public string BoxCode { get; set; }
/// <summary>
/// 箱体名称
/// </summary>
[SugarColumn(ColumnName = "BOX_Name")]
public string BoxName { get; set; }
/// <summary>
/// 成品码
/// </summary>
[SugarColumn(ColumnName = "PRODUCT_CODE")]
public string ProductCode { get; set; }
/// <summary>
/// 绑定结果
/// </summary>
[SugarColumn(ColumnName = "BINDING_RESULT")]
public string BindingResult { get; set; }
/// <summary>
/// 条码1记录时间
/// </summary>
[SugarColumn(ColumnName = "RECORD_TIME1")]
public DateTime? RecordTime1{ get; set; }
/// <summary>
/// 条码2记录时间
/// </summary>
[SugarColumn(ColumnName = "RECORD_TIME2")]
public DateTime? RecordTime2 { get; set; }
/// <summary>
/// 内胆码
/// </summary>
[SugarColumn(ColumnName = "LINER_CODE")]
public string LinerCode { get; set; }
/// <summary>
/// plc放行标志2为放行通过1为pda提示需要放行记录
/// </summary>
[SugarColumn(ColumnName = "IS_PASS")]
public int isPlcPass { get; set; }
}
}

@ -6,11 +6,11 @@
xmlns:local="clr-namespace:Aucma.Scada.UI"
mc:Ignorable="d"
Title="SCADA" Height="1080" Width="1920" Icon="Icon.png"
WindowState="Maximized" WindowStyle="None" ResizeMode="NoResize" Topmost="True">
WindowState="Maximized" WindowStyle="None" ResizeMode="NoResize">
<Window.Background>
<ImageBrush ImageSource="/templates/image/background.jpg" />
</Window.Background>
<!--WindowState="Maximized" WindowStyle="None" ResizeMode="NoResize" Topmost="True"-->
<!--WindowState="Maximized" WindowStyle="None" ResizeMode="NoResize" -->
<Border Margin="5" Background="Transparent" CornerRadius="10">
<Border.Effect>
@ -48,7 +48,7 @@
</Grid>
</StackPanel>-->
<StackPanel Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Center">
<TextBlock Text="澳柯玛生产控制系统" FontSize="50" Foreground="White" FontWeight="Bold"/>
<TextBlock Text="澳柯玛生产控制系统" FontSize="42" Foreground="White" FontWeight="Bold"/>
</StackPanel>
<StackPanel Grid.Column="2" VerticalAlignment="Center" HorizontalAlignment="Right">
@ -83,7 +83,7 @@
<Button Content="出库监控" x:Name="outstoreInfo" Command="{Binding ControlOnClickCommand}" CommandParameter="{Binding Name,ElementName=outstoreInfo}" Style="{StaticResource BUTTON_AGREE}" Width="100" Height="30" Background="#009999" BorderBrush="#FF36B5C1" Margin="0,0,10,0"/>
<Button Content="任务列表" x:Name="taskInfo" Command="{Binding ControlOnClickCommand}" CommandParameter="{Binding Name,ElementName=taskInfo}" Style="{StaticResource BUTTON_AGREE}" Width="100" Height="30" Background="#009999" BorderBrush="#FF36B5C1" Margin="0,0,10,0"/>
<Button Content="实时库存" x:Name="inventoryInfo" Command="{Binding ControlOnClickCommand}" CommandParameter="{Binding Name,ElementName=inventoryInfo}" Style="{StaticResource BUTTON_AGREE}" Width="100" Height="30" Background="#009999" BorderBrush="#FF36B5C1" Margin="0,0,10,0"/>
<Button Content="组装计划" x:Name="assemblyPlan" Command="{Binding ControlOnClickCommand}" CommandParameter="{Binding Name,ElementName=assemblyPlan}" Style="{StaticResource BUTTON_AGREE}" Width="100" Height="30" Background="#009999" BorderBrush="#FF36B5C1" Margin="0,0,10,0"/>
<Button Content="生产计划" x:Name="assemblyPlan" Command="{Binding ControlOnClickCommand}" CommandParameter="{Binding Name,ElementName=assemblyPlan}" Style="{StaticResource BUTTON_AGREE}" Width="100" Height="30" Background="#009999" BorderBrush="#FF36B5C1" Margin="0,0,10,0"/>
<!--<Button Content="日 志" x:Name="logInfo" Command="{Binding ControlOnClickCommand}" CommandParameter="{Binding Name,ElementName=logInfo}" Style="{StaticResource BUTTON_AGREE}" Width="100" Height="30" Background="#009999" BorderBrush="#FF36B5C1" Margin="0,0,10,0"/>-->
<!--<Button Content="记 录" x:Name="record" Command="{Binding ControlOnClickCommand}" CommandParameter="{Binding Name,ElementName=record}" Style="{StaticResource BUTTON_AGREE}" Width="100" Height="30" Background="#009999" BorderBrush="#FF36B5C1" Margin="0,0,10,0"/>-->
<Button Content="键 盘" Command="{Binding OpenSystemKeyboardCommand}" Style="{StaticResource BUTTON_AGREE}" Width="100" Height="30" Background="#009999" BorderBrush="#FF36B5C1" Margin="0,0,10,0"/>

@ -254,7 +254,7 @@
<ComboBoxItem Content="手动" IsSelected="True"/>
<ComboBoxItem Content="自动" />
</ComboBox>
<Button Content="计划维护" Command="{Binding PlanInfoEditCommand}" Style="{StaticResource BUTTON_AGREE}" Background="#007DFA" BorderBrush="#007DFA" Width="80" Height="30" Margin="20,0,0,0"/>
<Button Content="计划创建" Command="{Binding PlanInfoEditCommand}" Style="{StaticResource BUTTON_AGREE}" Background="#007DFA" BorderBrush="#007DFA" Width="80" Height="30" Margin="20,0,0,0"/>
<Button Content="物料库存" Command="{Binding MaterialStatisticsCommand}" Style="{StaticResource BUTTON_AGREE}" Background="#007DFA" BorderBrush="#007DFA" Width="80" Height="30" Margin="20,0,0,0"/>
</StackPanel>
</Border>

@ -7,7 +7,7 @@
xmlns:local1="clr-namespace:Aucma.Scada.UI.Converter.AssemblyPlan"
mc:Ignorable="d"
Title="MES生产计划" Height="650" Width="900" Name="window" Background="White"
ResizeMode="NoResize" Topmost="True">
ResizeMode="NoResize" >
<Border Margin="5" Background="#1254AB" CornerRadius="10">
<Border.Effect>

@ -6,7 +6,7 @@
xmlns:local="clr-namespace:Aucma.Scada.UI.Page.AssemblyPlan"
mc:Ignorable="d"
Title="下达数量" Height="500" Width="700" Name="window" Background="White"
ResizeMode="NoResize" Topmost="True">
ResizeMode="NoResize" >
<Border Margin="5" Background="#1254AB" CornerRadius="10">
<Border.Effect>
<DropShadowEffect Color="Gray" ShadowDepth="0" BlurRadius="5" Opacity="0.3" Direction="0"></DropShadowEffect>

@ -6,7 +6,7 @@
xmlns:local="clr-namespace:Aucma.Scada.UI.Page.AssemblyPlan"
mc:Ignorable="d"
Title="搜索条件配置" Height="350" Width="600" Name="window" Background="White"
ResizeMode="NoResize" Topmost="True">
ResizeMode="NoResize" >
<Window.Resources>
<Style x:Key="CustomTextBoxStyle" TargetType="TextBox">
<Setter Property="BorderThickness" Value="1" />

@ -6,7 +6,7 @@
xmlns:local="clr-namespace:Aucma.Scada.UI.Page.InventoryInfo"
mc:Ignorable="d"
Title="物料库存统计" Height="650" Width="1000" Name="window" Background="White"
ResizeMode="NoResize" Topmost="True">
ResizeMode="NoResize" >
<Border Margin="5" Background="#1254AB" CornerRadius="10">
<Border.Effect>
<DropShadowEffect Color="Gray" ShadowDepth="0" BlurRadius="5" Opacity="0.3" Direction="0"></DropShadowEffect>

@ -5,7 +5,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Aucma.Scada.UI.Page.InventoryInfo"
mc:Ignorable="d"
Title="{Binding TitleName}" Height="450" Width="800" Name="window" ResizeMode="NoResize" Topmost="True">
Title="{Binding TitleName}" Height="450" Width="800" Name="window" ResizeMode="NoResize" >
<Border Margin="5" Background="White" CornerRadius="10">
<Border.Effect>
<DropShadowEffect Color="Gray" ShadowDepth="0" BlurRadius="5" Opacity="0.3" Direction="0"></DropShadowEffect>

@ -13,6 +13,7 @@ using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Windows.Media;
namespace Aucma.Scada.UI.viewModel.InStoreInfo
{
@ -318,12 +319,12 @@ namespace Aucma.Scada.UI.viewModel.InStoreInfo
shellColumn.DataLabels = true;
shellColumn.Title = "箱壳";
shellColumn.Values = shellAchievement;
var linerColumn = new ColumnSeries();
linerColumn.DataLabels = true;
linerColumn.Title = "内胆";
linerColumn.Values = linerAchievement;
linerColumn.Fill = new SolidColorBrush(Color.FromRgb(15, 209, 226));
Achievement.Add(shellColumn);
Achievement.Add(linerColumn);
}));

@ -52,6 +52,8 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="service\ICodeBindingRecordServices.cs" />
<Compile Include="service\Impl\CodeBindingRecordServiceImpl.cs" />
<Compile Include="service\Impl\RecordProductfinishServiceImpl.cs" />
<Compile Include="service\IRecordOutStoreService.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />

@ -0,0 +1,19 @@
using Aucma.Scada.Model.domain;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HighWayIot.Repository.service
{ /// <summary>
/// 条码绑定
/// </summary>
public interface ICodeBindingRecordServices
{
/// <summary>
/// 箱壳内胆条码绑定
/// </summary>
bool BindingCode(string boxCode,string linerCode);
}
}

@ -0,0 +1,24 @@
using Aucma.Scada.Model.domain;
using HighWayIot.Log4net;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HighWayIot.Repository.service.Impl
{
public class CodeBindingRecordServiceImpl : ICodeBindingRecordServices
{
Repository<CodeBindingRecord> _repository => new Repository<CodeBindingRecord>("scada");
private LogHelper logHelper = LogHelper.Instance;
public bool BindingCode(string boxCode, string linerCode)
{
CodeBindingRecord codeBindingRecord = new CodeBindingRecord();
codeBindingRecord.BoxCode = boxCode;
codeBindingRecord.LinerCode = linerCode;
return _repository.Insert(codeBindingRecord);
}
}
}
Loading…
Cancel
Save