dev
liulb@mesnac.com 1 year ago
parent e2c4d6570e
commit 1a9c163247

@ -5036,6 +5036,11 @@
工位
</summary>
</member>
<member name="P:Admin.Core.Model.ViewModels.SheetMetaHourDataView.Seq">
<summary>
排序
</summary>
</member>
<member name="P:Admin.Core.Model.ViewModels.SheetMetaHourDataView.HourTime">
<summary>
小时

@ -9,9 +9,9 @@ build_property.EnforceExtendedAnalyzerRules =
build_property._SupportedPlatformList = Linux,macOS,Windows
build_property.RootNamespace = Admin.Core.Api
build_property.RootNamespace = Admin.Core.Api
build_property.ProjectDir = E:\桌面\AUCMA_SCADA\Admin.Core.Api\
build_property.ProjectDir = D:\Project\gitea\AUCMA\SCADA\Admin.Core.Api\
build_property.RazorLangVersion = 6.0
build_property.SupportLocalizedComponentNames =
build_property.GenerateRazorMetadataSourceChecksumAttributes =
build_property.MSBuildProjectDirectory = E:\桌面\AUCMA_SCADA\Admin.Core.Api
build_property.MSBuildProjectDirectory = D:\Project\gitea\AUCMA\SCADA\Admin.Core.Api
build_property._RazorSourceGeneratorDebug =

@ -42,12 +42,6 @@
<ProjectReference Include="..\Admin.Core.Serilog.Es\Admin.Core.Serilog.Es.csproj" />
</ItemGroup>
<ItemGroup>
<Reference Include="Oracle.ManagedDataAccess">
<HintPath>..\dll\Oracle.ManagedDataAccess.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Update="Resource\Resource_SysBase.Designer.cs">
<DesignTime>True</DesignTime>

@ -1,3 +1,3 @@
is_global = true
build_property.RootNamespace = Admin.Core.FrameWork
build_property.ProjectDir = E:\桌面\AUCMA_SCADA\Admin.Core.FrameWork\
build_property.ProjectDir = D:\Project\gitea\AUCMA\SCADA\Admin.Core.FrameWork\

@ -12,6 +12,7 @@ namespace Admin.Core.Model.ViewModels
/// <summary>
/// 公司
/// </summary>
[SugarColumn(ColumnName = "PLANT_CODE")]
public string PlantCode { get; set; }
/// <summary>

@ -9,6 +9,11 @@ namespace Admin.Core.Model.ViewModels
{
public class SheetMetaHourDataView
{
/// <summary>
/// 排序
/// </summary>
[SugarColumn(ColumnName = "SEQ")]
public int Seq { get; set; }
/// <summary>
/// 小时
/// </summary>

@ -8,4 +8,4 @@ build_property.PlatformNeutralAssembly =
build_property.EnforceExtendedAnalyzerRules =
build_property._SupportedPlatformList = Linux,macOS,Windows
build_property.RootNamespace = Admin.Core.RealTimeService
build_property.ProjectDir = E:\桌面\AUCMA_SCADA\Admin.Core.RealTimeService\
build_property.ProjectDir = D:\Project\gitea\AUCMA\SCADA\Admin.Core.RealTimeService\

@ -36,14 +36,7 @@ namespace Admin.Core.Repository
}
}
//输入最终SQL语句...
//_db.Aop.OnLogExecuting = (sql, pars) =>
//{
// //var s1 = sql;//断点打在这里看内部生成的sql语句...
// Console.Write(sql);
//};
return _dbBase;
}
}

@ -25,7 +25,7 @@ namespace Admin.Core.Repository
FROM BASE_PRODUCTLINE BP
LEFT JOIN BASE_PROCESS_STATION BPS ON BPS.PARENT_ID LIKE '%' || BP.PRODUCT_LINE_CODE || '%'
WHERE BP.PRODUCT_LINE_CODE = '{code}'";
return await Db.Ado.SqlQueryAsync<ProductInfoView>(sql);
return await Db.CopyNew().Ado.SqlQueryAsync<ProductInfoView>(sql);
}
#region 获取班组数据
@ -38,7 +38,7 @@ namespace Admin.Core.Repository
{
if (GetConnectionState() == false) return null;
string sql = "SELECT * FROM VIEW_CURRENT_TEAM_TIME";
return await Db.Ado.SqlQueryAsync<CurrentTeamTimeView>(sql);
return await Db.CopyNew().Ado.SqlQueryAsync<CurrentTeamTimeView>(sql);
}
#endregion
@ -54,7 +54,7 @@ namespace Admin.Core.Repository
if (GetConnectionState() == false) return null;
string sql =@$"SELECT BP.PLANT_CODE PLANT_CODE, BP.PARENT_ID PRODUCT_LINE_CODE, BPS.PROCESS_CODE, BP.PRODUCT_LINE_CODE STATION_CODE FROM BASE_PRODUCTLINE BP
LEFT JOIN BASE_PROCESS_STATION BPS ON BPS.PARENT_ID LIKE '%' || BP.PRODUCT_LINE_CODE || '%' WHERE BP.PRODUCT_LINE_CODE = '{productLineCode}'";
return await Db.Ado.SqlQueryAsync<ProductLineInfoView>(sql);
return await Db.CopyNew().Ado.SqlQueryAsync<ProductLineInfoView>(sql);
}
#endregion
@ -85,32 +85,48 @@ namespace Admin.Core.Repository
AND SPC.BEGIN_TIME <= CTT.END_TIME and SPC.PRODUCTLINE_CODE='{productLineCode}'
GROUP BY ML.MATERIAL_SPECIFICATIONS,SPC.PRODUCTLINE_CODE";
return await Db.Ado.SqlQueryAsync<SheetMetalTypeDataView>(sql);
return await Db.CopyNew().Ado.SqlQueryAsync<SheetMetalTypeDataView>(sql);
}
#endregion
#region 小时统计
/// <summary>
/// 小时统计
/// </summary>
/// <param name="productLineCode">工位</param>
/// <returns></returns>
public async Task<List<SheetMetaHourDataView>> GetSheetMetaHourData(string productLineCode)
{
string sql = @$"SELECT CTT.HOUR_TIME,
SUM(CASE
WHEN SPC.PLAN_TYPE = 1 THEN SPC.COMPLETE_AMOUNT
WHEN SPC.PLAN_TYPE = 2 THEN SPC.COMPLETE_AMOUNT
ELSE 0 END) FRONTPLATE_AMOUNT,
SUM(CASE
WHEN SPC.PLAN_TYPE = 1 THEN SPC.COMPLETE_AMOUNT
WHEN SPC.PLAN_TYPE = 3 THEN SPC.COMPLETE_AMOUNT
ELSE 0 END) REARPANEL_AMOUNT
FROM VIEW_CURRENT_TEAM_TIME CTT
LEFT JOIN (select * from VIEW_EXECUTE_PLANINFO where PRODUCTLINE_CODE='{productLineCode}') SPC
ON SPC.BEGIN_TIME >= CTT.START_TIME AND SPC.BEGIN_TIME < CTT.END_TIME
GROUP BY CTT.HOUR_TIME
ORDER BY CTT.HOUR_TIME";
if (GetConnectionState() == false) return null;
return await Db.Ado.SqlQueryAsync<SheetMetaHourDataView>(sql);
//string sql = @$"SELECT CTT.HOUR_TIME,
// SUM(CASE
// WHEN SPC.PLAN_TYPE = 1 THEN SPC.COMPLETE_AMOUNT
// WHEN SPC.PLAN_TYPE = 2 THEN SPC.COMPLETE_AMOUNT
// ELSE 0 END) FRONTPLATE_AMOUNT,
// SUM(CASE
// WHEN SPC.PLAN_TYPE = 1 THEN SPC.COMPLETE_AMOUNT
// WHEN SPC.PLAN_TYPE = 3 THEN SPC.COMPLETE_AMOUNT
// ELSE 0 END) REARPANEL_AMOUNT
// FROM VIEW_CURRENT_TEAM_TIME CTT
// LEFT JOIN (select * from VIEW_EXECUTE_PLANINFO where PRODUCTLINE_CODE='{productLineCode}') SPC
// ON SPC.BEGIN_TIME >= CTT.START_TIME AND SPC.BEGIN_TIME < CTT.END_TIME
// GROUP BY CTT.HOUR_TIME
// ORDER BY CTT.HOUR_TIME";
string sql = $@"SELECT CTT.SEQCTT.HOUR_TIMECOUNT(SPC.PLAN_CODE) as FRONTPLATE_AMOUNT,COUNT(BACK.PLAN_CODE) as REARPANEL_AMOUNT
FROM VIEW_CURRENT_TEAM_TIME CTT
LEFT JOIN (select * from C##AUCMA_SCADA.EXECUTE_PLANINFO v inner join C##AUCMA_SCADA.RECORD_SIDEPANEL_COMPLATE c
on v.TASK_CODE=c.PLAN_CODE where v.PRODUCTLINE_CODE='{productLineCode}' AND c.COMPLETE_AMOUNT!=0) SPC ON SPC.RECORD_TIME >= CTT.START_TIME AND SPC.RECORD_TIME < CTT.END_TIME
LEFT JOIN (select * from C##AUCMA_SCADA.EXECUTE_PLANINFO v inner join C##AUCMA_SCADA.RECORD_BACKPANEL_COMPLATE c
on v.TASK_CODE=c.PLAN_CODE where v.PRODUCTLINE_CODE='{productLineCode}' AND c.COMPLETE_AMOUNT!=0) BACK ON BACK.RECORD_TIME >= CTT.START_TIME AND BACK.RECORD_TIME < CTT.END_TIME
group by CTT.SEQCTT.HOUR_TIME ORDER BY CTT.SEQ asc";
return await Db.CopyNew().Ado.SqlQueryAsync<SheetMetaHourDataView>(sql);
}
#endregion
}
}

@ -59,8 +59,9 @@ namespace Admin.Core.Tasks
{
var list = await _temperatureHistoryServices.QueryAsync(d => d.flag == 0);
if (list == null) return;
Console.WriteLine(list.Count());
if (list.Count == 0) return;
List< BoxTemperatureMeasurementHistory > historyList = new List<BoxTemperatureMeasurementHistory>();
foreach (var item in list)
{
@ -104,8 +105,8 @@ namespace Admin.Core.Tasks
var result = await _boxTMHistoryServices.AddAsync(historyList);
if (result > 0)
{
list.ForEach(x => x.flag = 1);
if (list == null) return;
list.ForEach(x => x.flag = 1);
await _temperatureHistoryServices.UpdateAsync(list);
Console.WriteLine("保存测温系统成功");
@ -113,7 +114,7 @@ namespace Admin.Core.Tasks
}
catch (Exception ex)
{
logHelper.Error($"数据处理异常:{ex.Message}");
logHelper.Error($"测温数据处理异常:{ex.Message}");
}
}

@ -7,7 +7,7 @@
</ApplicationDefinition>
</ItemGroup>
<ItemGroup>
<Page Update="Views\FoamPlanPageView.xaml">
<Page Update="Views\PlanPageView.xaml">
<SubType>Designer</SubType>
</Page>
<Page Update="Views\PalletizPageView.xaml">

@ -19,10 +19,10 @@ namespace Aucma.Core.Palletiz.ViewModels
*
*
* */
public partial class FoamPlanPageViewModel : ObservableObject
public partial class PlanPageViewModel : ObservableObject
{
protected readonly IBoxFoamPlanServices? _boxFoamPlanServices;
public FoamPlanPageViewModel()
public PlanPageViewModel()
{
_boxFoamPlanServices = App.ServiceProvider.GetService<IBoxFoamPlanServices>();
WeakReferenceMessenger.Default.Register<string>(this, Recive);

@ -96,6 +96,7 @@ namespace Aucma.Core.Palletiz.ViewModels
Scanner1State(flag1);
}
#endregion
#region 更换界面
public System.Windows.Controls.UserControl _content;

@ -1,291 +0,0 @@
<UserControl x:Class="Aucma.Core.Palletiz.Views.FoamPlanPageView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Aucma.Core.Palletiz.Views"
mc:Ignorable="d" Background="#1152AC"
d:DesignHeight="1080" d:DesignWidth="1920">
<Border x:Name="HeightHelperPanel" BorderBrush="#0288d1" BorderThickness="0" CornerRadius="5" Background="Transparent" Margin="5">
<Grid>
<Grid.Resources>
<Style TargetType="TextBlock">
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="FontSize" Value="16"/>
<Setter Property="FontFamily" Value="Microsoft YaHei"/>
</Style>
<Style TargetType="Border">
<Setter Property="BorderBrush" Value="#0288d1"/>
<Setter Property="BorderThickness" Value="1"/>
</Style>
</Grid.Resources>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.1*"/>
<ColumnDefinition Width="0.3*"/>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="0.3*"/>
<ColumnDefinition Width="0.3*"/>
</Grid.ColumnDefinitions>
<Border Grid.Row="0" Grid.Column="0"></Border>
<Border Grid.Row="1" Grid.Column="0" >
<TextBlock Text="1" x:Name="PlanId1" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="2" Grid.Column="0">
<TextBlock Text="2" x:Name="PlanId2" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="3" Grid.Column="0" >
<TextBlock Text="3" x:Name="PlanId3" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="4" Grid.Column="0" >
<TextBlock Text="4" x:Name="PlanId4" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="5" Grid.Column="0" >
<TextBlock Text="5" x:Name="PlanId5" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="6" Grid.Column="0" >
<TextBlock Text="6" x:Name="PlanId6" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="7" Grid.Column="0" >
<TextBlock Text="7" x:Name="PlanId7" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="8" Grid.Column="0" >
<TextBlock Text="8" x:Name="PlanId8" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="9" Grid.Column="0" >
<TextBlock Text="9" x:Name="PlanId9" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="10" Grid.Column="0" >
<TextBlock Text="10" x:Name="PlanId10" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="11" Grid.Column="0" >
<TextBlock Text="11" x:Name="PlanId11" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="12" Grid.Column="0" >
<TextBlock Text="12" x:Name="PlanId12" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="0" Grid.Column="1" >
<TextBlock Text="物料编号" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="0" Grid.Column="2" >
<TextBlock Text="物料名称" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="0" Grid.Column="3" >
<TextBlock Text="发泡计划量" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="0" Grid.Column="4" >
<TextBlock Text="操作" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="1" Grid.Column="1" >
<TextBlock Text="{Binding MaterialCode[0], Mode=TwoWay}" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="1" Grid.Column="2" >
<TextBlock Text="{Binding MaterialName[0], Mode=TwoWay}" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="1" Grid.Column="3" >
<TextBlock Text="{Binding PlanAmount[0], Mode=TwoWay}" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="1" Grid.Column="4" >
<WrapPanel VerticalAlignment="Center" HorizontalAlignment="Center">
<Button Content="添加" FontSize="20" Width="100" Height="40" Margin="3" Command="{Binding AddPlanCommand}" CommandParameter="{Binding Text, ElementName=PlanId1}" />
<Button Content="清除" FontSize="20" Width="100" Height="40" Margin="3" Command="{Binding ClearPlanCommand}" CommandParameter="{Binding Text, ElementName=PlanId1}"/>
</WrapPanel>
</Border>
<Border Grid.Row="2" Grid.Column="1" >
<TextBlock Text="{Binding MaterialCode[1], Mode=TwoWay}" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="2" Grid.Column="2" >
<TextBlock Text="{Binding MaterialName[1], Mode=TwoWay}" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="2" Grid.Column="3" >
<TextBlock Text="{Binding PlanAmount[1], Mode=TwoWay}" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="2" Grid.Column="4" >
<WrapPanel VerticalAlignment="Center" HorizontalAlignment="Center">
<Button Content="添加" FontSize="20" Width="100" Height="40" Margin="3" Command="{Binding AddPlanCommand}" CommandParameter="{Binding Text, ElementName=PlanId2}" />
<Button Content="清除" FontSize="20" Width="100" Height="40" Margin="3" Command="{Binding ClearPlanCommand}" CommandParameter="{Binding Text, ElementName=PlanId2}"/>
</WrapPanel>
</Border>
<Border Grid.Row="3" Grid.Column="1" >
<TextBlock Text="{Binding MaterialCode[2], Mode=TwoWay}" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="3" Grid.Column="2" >
<TextBlock Text="{Binding MaterialName[2], Mode=TwoWay}" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="3" Grid.Column="3" >
<TextBlock Text="{Binding PlanAmount[2], Mode=TwoWay}" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="3" Grid.Column="4" >
<WrapPanel VerticalAlignment="Center" HorizontalAlignment="Center">
<Button Content="添加" FontSize="20" Width="100" Height="40" Margin="3" Command="{Binding AddPlanCommand}" CommandParameter="{Binding Text, ElementName=PlanId3}" />
<Button Content="清除" FontSize="20" Width="100" Height="40" Margin="3" Command="{Binding ClearPlanCommand}" CommandParameter="{Binding Text, ElementName=PlanId3}"/>
</WrapPanel>
</Border>
<Border Grid.Row="4" Grid.Column="1" >
<TextBlock Text="{Binding MaterialCode[3], Mode=TwoWay}" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="4" Grid.Column="2" >
<TextBlock Text="{Binding MaterialName[3], Mode=TwoWay}" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="4" Grid.Column="3" >
<TextBlock Text="{Binding PlanAmount[3], Mode=TwoWay}" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="4" Grid.Column="4" >
<WrapPanel VerticalAlignment="Center" HorizontalAlignment="Center">
<Button Content="添加" FontSize="20" Width="100" Height="40" Margin="3" Command="{Binding AddPlanCommand}" CommandParameter="{Binding Text, ElementName=PlanId3}" />
<Button Content="清除" FontSize="20" Width="100" Height="40" Margin="3" Command="{Binding ClearPlanCommand}" CommandParameter="{Binding Text, ElementName=PlanId3}"/>
</WrapPanel>
</Border>
<Border Grid.Row="5" Grid.Column="1" >
<TextBlock Text="{Binding MaterialCode[4], Mode=TwoWay}" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="5" Grid.Column="2" >
<TextBlock Text="{Binding MaterialName[4], Mode=TwoWay}" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="5" Grid.Column="3" >
<TextBlock Text="{Binding PlanAmount[4], Mode=TwoWay}" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="5" Grid.Column="4" >
<WrapPanel VerticalAlignment="Center" HorizontalAlignment="Center">
<Button Content="添加" FontSize="20" Width="100" Height="40" Margin="3" Command="{Binding AddPlanCommand}" CommandParameter="{Binding Text, ElementName=PlanId5}" />
<Button Content="清除" FontSize="20" Width="100" Height="40" Margin="3" Command="{Binding ClearPlanCommand}" CommandParameter="{Binding Text, ElementName=PlanId5}" />
</WrapPanel>
</Border>
<Border Grid.Row="6" Grid.Column="1" >
<TextBlock Text="{Binding MaterialCode[5], Mode=TwoWay}" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="6" Grid.Column="2" >
<TextBlock Text="{Binding MaterialName[5], Mode=TwoWay}" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="6" Grid.Column="3" >
<TextBlock Text="{Binding PlanAmount[5], Mode=TwoWay}" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="6" Grid.Column="4" >
<WrapPanel VerticalAlignment="Center" HorizontalAlignment="Center">
<Button Content="添加" FontSize="20" Width="100" Height="40" Margin="3" Command="{Binding AddPlanCommand}" CommandParameter="{Binding Text, ElementName=PlanId6}" />
<Button Content="清除" FontSize="20" Width="100" Height="40" Margin="3" Command="{Binding ClearPlanCommand}" CommandParameter="{Binding Text, ElementName=PlanId6}"/>
</WrapPanel>
</Border>
<Border Grid.Row="7" Grid.Column="1" >
<TextBlock Text="{Binding MaterialCode[6], Mode=TwoWay}" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="7" Grid.Column="2" >
<TextBlock Text="{Binding MaterialName[6], Mode=TwoWay}" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="7" Grid.Column="3" >
<TextBlock Text="{Binding PlanAmount[6], Mode=TwoWay}" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="7" Grid.Column="4" >
<WrapPanel VerticalAlignment="Center" HorizontalAlignment="Center">
<Button Content="添加" FontSize="20" Width="100" Height="40" Margin="3" Command="{Binding AddPlanCommand}" CommandParameter="{Binding Text, ElementName=PlanId7}" />
<Button Content="清除" FontSize="20" Width="100" Height="40" Margin="3" Command="{Binding ClearPlanCommand}" CommandParameter="{Binding Text, ElementName=PlanId7}" />
</WrapPanel>
</Border>
<Border Grid.Row="8" Grid.Column="1" >
<TextBlock Text="{Binding MaterialCode[8], Mode=TwoWay}" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="8" Grid.Column="2" >
<TextBlock Text="{Binding MaterialName[8], Mode=TwoWay}" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="8" Grid.Column="3" >
<TextBlock Text="{Binding PlanAmount[9], Mode=TwoWay}" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="8" Grid.Column="4" >
<WrapPanel VerticalAlignment="Center" HorizontalAlignment="Center">
<Button Content="添加" FontSize="20" Width="100" Height="40" Margin="3" Command="{Binding AddPlanCommand}" CommandParameter="{Binding Text, ElementName=PlanId8}" />
<Button Content="清除" FontSize="20" Width="100" Height="40" Margin="3" Command="{Binding ClearPlanCommand}" CommandParameter="{Binding Text, ElementName=PlanId8}" />
</WrapPanel>
</Border>
<Border Grid.Row="9" Grid.Column="1" >
<TextBlock Text="{Binding MaterialCode[8], Mode=TwoWay}" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="9" Grid.Column="2" >
<TextBlock Text="{Binding MaterialName[8], Mode=TwoWay}" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="9" Grid.Column="3" >
<TextBlock Text="{Binding PlanAmount[8], Mode=TwoWay}" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="9" Grid.Column="4" >
<WrapPanel VerticalAlignment="Center" HorizontalAlignment="Center">
<Button Content="添加" FontSize="20" Width="100" Height="40" Margin="3" Command="{Binding AddPlanCommand}" CommandParameter="{Binding Text, ElementName=PlanId9}" />
<Button Content="清除" FontSize="20" Width="100" Height="40" Margin="3" Command="{Binding ClearPlanCommand}" CommandParameter="{Binding Text, ElementName=PlanId9}" />
</WrapPanel>
</Border>
<Border Grid.Row="10" Grid.Column="1" >
<TextBlock Text="{Binding MaterialCode[9], Mode=TwoWay}" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="10" Grid.Column="2" >
<TextBlock Text="{Binding MaterialName[9], Mode=TwoWay}" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="10" Grid.Column="3" >
<TextBlock Text="{Binding PlanAmount[9], Mode=TwoWay}" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="10" Grid.Column="4" >
<WrapPanel VerticalAlignment="Center" HorizontalAlignment="Center">
<Button Content="添加" FontSize="20" Width="100" Height="40" Margin="3" Command="{Binding AddPlanCommand}" CommandParameter="{Binding Text, ElementName=PlanId10}" />
<Button Content="清除" FontSize="20" Width="100" Height="40" Margin="3" Command="{Binding ClearPlanCommand}" CommandParameter="{Binding Text, ElementName=PlanId10}" />
</WrapPanel>
</Border>
<Border Grid.Row="11" Grid.Column="1" >
<TextBlock Text="{Binding MaterialCode[10], Mode=TwoWay}" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="11" Grid.Column="2" >
<TextBlock Text="{Binding MaterialName[10], Mode=TwoWay}" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="11" Grid.Column="3" >
<TextBlock Text="{Binding PlanAmount[10], Mode=TwoWay}" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="11" Grid.Column="4" >
<WrapPanel VerticalAlignment="Center" HorizontalAlignment="Center">
<Button Content="添加" FontSize="20" Width="100" Height="40" Margin="3" Command="{Binding AddPlanCommand}" CommandParameter="{Binding Text, ElementName=PlanId11}" />
<Button Content="清除" FontSize="20" Width="100" Height="40" Margin="3" Command="{Binding ClearPlanCommand}" CommandParameter="{Binding Text, ElementName=PlanId11}" />
</WrapPanel>
</Border>
<Border Grid.Row="12" Grid.Column="1" >
<TextBlock Text="{Binding MaterialCode[11], Mode=TwoWay}" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="12" Grid.Column="2" >
<TextBlock Text="{Binding MaterialName[11], Mode=TwoWay}" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="12" Grid.Column="3" >
<TextBlock Text="{Binding PlanAmount[11], Mode=TwoWay}" Foreground="White" FontSize="20"/>
</Border>
<Border Grid.Row="12" Grid.Column="4" >
<WrapPanel VerticalAlignment="Center" HorizontalAlignment="Center">
<Button Content="添加" FontSize="20" Width="100" Height="40" Margin="3" Command="{Binding AddPlanCommand}" CommandParameter="{Binding Text, ElementName=PlanId12}" />
<Button Content="清除" FontSize="20" Width="100" Height="40" Margin="3" Command="{Binding ClearPlanCommand}" CommandParameter="{Binding Text, ElementName=PlanId12}" />
</WrapPanel>
</Border>
</Grid>
</Border>
</UserControl>

@ -4,7 +4,7 @@ using System.Windows.Controls;
namespace Aucma.Core.Palletiz.Views
{
/// <summary>
/// FoamPlanPageView.xaml 的交互逻辑
/// PlanPageView.xaml 的交互逻辑
/// </summary>
public partial class PalletizPageView : UserControl
{

@ -0,0 +1,89 @@
<UserControl x:Class="Aucma.Core.Palletiz.Views.PlanPageView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Aucma.Core.Palletiz.Views"
mc:Ignorable="d" Background="#1152AC"
d:DesignHeight="1080" d:DesignWidth="1920">
<UserControl.Resources>
<Style x:Key="DataGridTextColumnCenterSytle" TargetType="{x:Type TextBlock}">
<!--<Setter Property="Height" Value="40"/>-->
<Setter Property="FontSize" Value="16"/>
<Setter Property="VerticalAlignment" Value="Stretch" />
<Setter Property="HorizontalAlignment" Value="Left" />
</Style>
<Style TargetType="DataGrid">
<!--网格线颜色-->
<Setter Property="CanUserResizeColumns" Value="false"/>
<Setter Property="Background" Value="#1152AC" />
<Setter Property="BorderBrush" Value="#4285DE" />
<Setter Property="Foreground" Value="White"/>
<Setter Property="HorizontalGridLinesBrush">
<Setter.Value>
<SolidColorBrush Color="#4285DE"/>
</Setter.Value>
</Setter>
<Setter Property="VerticalGridLinesBrush">
<Setter.Value>
<SolidColorBrush Color="#1152AC"/>
</Setter.Value>
</Setter>
</Style>
<!--列头标题栏样式-->
<Style TargetType="DataGridColumnHeader">
<!--<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>-->
<!--<Setter Property="Background" Value="#dddddd"/>
<Setter Property="Foreground" Value="Black"/>-->
<!--<Setter Property="BorderThickness" Value="1" />-->
<Setter Property="HorizontalContentAlignment" Value="Left" />
<Setter Property="BorderBrush" Value="#dddddd" />
<Setter Property="Height" Value="48"/>
<Setter Property="FontSize" Value="18"/>
<Setter Property="Background" Value="#4285DE"/>
<Setter Property="Foreground" Value="White"/>
</Style>
<!--单元格样式-->
<Style TargetType="DataGridCell">
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="BorderBrush" Value="Gray" />
<Setter Property="Height" Value="40"/>
<Setter Property="FontSize" Value="12"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type DataGridCell}">
<Grid Background="{TemplateBinding Background}" >
<ContentPresenter HorizontalAlignment="Left" VerticalAlignment="Center" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Background" Value="#4285DE"/>
<Setter Property="Foreground" Value="White"/>
</Trigger>
</Style.Triggers>
</Style>
</UserControl.Resources>
<Border x:Name="HeightHelperPanel" BorderBrush="#0288d1" BorderThickness="0" CornerRadius="5" Background="Transparent" Margin="5">
<DataGrid x:Name="dgvMH" Height="{Binding Path=ActualHeight, ElementName=HeightPanel}"
HorizontalAlignment="Left" VerticalAlignment="Top" AlternationCount="2" RowHeaderWidth="0"
ItemsSource="{Binding Datalist}" ColumnWidth="*" AutoGenerateColumns="False" IsReadOnly="True" CanUserAddRows="False" SelectionMode="Single"
SelectedItem="{Binding SelectedCells, Mode=OneWayToSource}">
<DataGrid.Columns>
<DataGridTextColumn Width="*" Binding="{Binding OrderCode}" Header="编号" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Width="*" Binding="{Binding ProductCode}" Header="产品编码" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Width="*" Binding="{Binding ProductName}" Header="产品型号" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
</DataGrid.Columns>
</DataGrid>
</Border>
</UserControl>

@ -17,14 +17,14 @@ using System.Windows.Shapes;
namespace Aucma.Core.Palletiz.Views
{
/// <summary>
/// FoamPlanPageView.xaml 的交互逻辑
/// PlanPageView.xaml 的交互逻辑
/// </summary>
public partial class FoamPlanPageView : UserControl
public partial class PlanPageView : UserControl
{
public FoamPlanPageView()
public PlanPageView()
{
InitializeComponent();
this.DataContext = new FoamPlanPageViewModel();
this.DataContext = new PlanPageViewModel();
}
}
}

@ -22,6 +22,22 @@ namespace Aucma.Core.SheetMetal.Business;
/// </summary>
public class SheetMetalPlanTaskHandle
{
#region 刷新创建计划
/// <summary>
/// 刷新创建计划
/// </summary>
public delegate Task RefreshCretaePlanInfo();
public static event RefreshCretaePlanInfo RefreshCretaePlanInfoEvent;
#endregion
#region 刷新图标
/// <summary>
/// 刷新创建计划
/// </summary>
public delegate Task RefreshChat();
public static event RefreshChat RefreshChatEvent;
#endregion
#region 刷新当前正在执行的计划
/// <summary>
/// 刷新当前正在执行的计划
@ -65,9 +81,8 @@ public class SheetMetalPlanTaskHandle
while (true)
{
var planInfos = _executePlanInfoServices.QueryAsync(d => d.ProductLineCode.Equals("1001") && d.ExecuteStatus == 1).Result;
var planInfoss = _executePlanInfoServices.QueryAsync(d => d.ProductLineCode.Equals("1001")).Result;
Console.WriteLine(planInfoss.Count());
var planInfos = _executePlanInfoServices.QueryAsync(d => d.ProductLineCode.Equals("1001") && d.ExecuteStatus == 1||d.ExecuteStatus==2).Result;
if (planInfos != null)
{
if (planInfos.Count > 0)
@ -77,7 +92,7 @@ public class SheetMetalPlanTaskHandle
if (planInfo.PlanType == 1) //联合下发
{
SendPlanTask(planInfo, obj_sidePanel, obj_backPanel);
UpdatePlanTaskByComplate(planInfo);
}
@ -309,15 +324,21 @@ public class SheetMetalPlanTaskHandle
Console.WriteLine($"{DateTime.Now.ToString("HH:m:s")}===>收到围板设备应答信号,复位应答地址");
RefreshExecInfoEvent?.Invoke("收到围板设备应答信号......");
isFlag = false;
//更新计划状态为2执行中
planInfo.ExecuteStatus = 2;
_executePlanInfoServices.UpdateExecutePlanInfo(planInfo);
//更新前端展示图表
RefreshCurrentPlanInfoEvent?.Invoke(planInfo);
RefreshCretaePlanInfoEvent?.Invoke();//更新界面
RefreshChatEvent?.Invoke();//刷新图表
}
Thread.Sleep(2000);
} while (isFlag);
//更新计划状态为2执行中
planInfo.ExecuteStatus = 2;
_executePlanInfoServices.UpdateExecutePlanInfo(planInfo);
RefreshCurrentPlanInfoEvent?.Invoke(planInfo);
#endregion
//读取设备进度,完成后再次下发新任务
ReadDeviceComplate_SidePanel(obj_sidePanel);
@ -328,7 +349,7 @@ public class SheetMetalPlanTaskHandle
{
MessageBox.Show($"围板⽣产计划下发异常:{ex.Message}", "提示", MessageBoxButton.OK, MessageBoxImage.Error,
MessageBoxResult.OK, MessageBoxOptions.DefaultDesktopOnly);
RefreshExecInfoEvent?.Invoke("产计划下发异常");
RefreshExecInfoEvent?.Invoke("围板⽣产计划下发异常{ex.Message}");
}
}
@ -375,7 +396,7 @@ public class SheetMetalPlanTaskHandle
RecordSidePanelComplate sidePanelComplate = new RecordSidePanelComplate()
{
ProductlineCode = "1001",
PlanCode = planCode.Substring(0, 16),
PlanCode = planCode.Substring(0, 16).Replace("\n","").Trim(),//.Substring(0, 16),
//MaterialCode = string.IsNullOrEmpty(materialCode) ? "" : materialCode,
MaterialCode = "BCD/310NF",
CompleteAmount = complateAmount,
@ -401,7 +422,7 @@ public class SheetMetalPlanTaskHandle
if (sidePanelComplates.Count > 0)
{
sidePanelComplates = sidePanelComplates.OrderByDescending(x => x.RecordTime).ToList();
lastComplateAmount = sidePanelComplates.First().CompleteAmount;
sidePanelComplate.OutPutAmount = complateAmount - lastComplateAmount;
sumComplateAmount = sidePanelComplates.Sum(x => x.OutPutAmount) + sidePanelComplate.OutPutAmount;
@ -426,6 +447,8 @@ public class SheetMetalPlanTaskHandle
isFlag = false;
Console.WriteLine($"围板计划执行完成,计划数量:{planInfo.PlanAmount};实际产量:{sumComplateAmount};差异值:{planInfo.PlanAmount - sumComplateAmount}");
RefreshExecInfoEvent?.Invoke($"围板计划执行完成,计划数量:{planInfo.PlanAmount};实际产量:{sumComplateAmount};差异值:{planInfo.PlanAmount - sumComplateAmount}");
RefreshCretaePlanInfoEvent?.Invoke();//更新界面
RefreshChatEvent?.Invoke();//刷新图表
}
}
}
@ -596,6 +619,9 @@ public class SheetMetalPlanTaskHandle
isFlag = false;
Console.WriteLine($"背板计划执行完成,计划数量:{planInfo.PlanAmount};实际产量:{sumComplateAmount};差异值:{planInfo.PlanAmount - sumComplateAmount}");
RefreshExecInfoEvent?.Invoke($"背板计划执行完成,计划数量:{planInfo.PlanAmount};实际产量:{sumComplateAmount};差异值:{planInfo.PlanAmount - sumComplateAmount}");
RefreshCretaePlanInfoEvent?.Invoke();//更新界面
RefreshChatEvent?.Invoke();//刷新图表
}
}
}

@ -18,10 +18,9 @@ using System.Windows.Media;
using Admin.Core.Common;
using LiveCharts.Defaults;
using Aucma.Core.SheetMetal.Business;
using Admin.Core.Service;
using NPOI.SS.Formula.Functions;
using Admin.Core.Model.ViewModels;
using StackExchange.Profiling.Internal;
using NPOI.SS.Formula.Functions;
using log4net;
/*
*
*/
@ -29,6 +28,7 @@ namespace Aucma.Core.SheetMetal.ViewModels
{
public partial class IndexPageViewModel : ObservableObject
{
private static readonly log4net.ILog log = LogManager.GetLogger(typeof(LogPageViewModel));
protected readonly IExecutePlanInfoServices? _taskExecutionPlanInfoServices;
protected readonly IRecordBackPanelComplateServices _recordBackPanelComplateServices;
protected readonly IRecordSidePanelComplateServices _recordSidePanelComplateServices;
@ -58,73 +58,24 @@ namespace Aucma.Core.SheetMetal.ViewModels
_baseBomInfoServices = App.ServiceProvider.GetService<IBaseBomInfoServices>();
_sysUserInfoServices = App.ServiceProvider.GetService<ISysUserInfoServices>();
_recordInstoreServices = App.ServiceProvider.GetService<IRecordInStoreServices>();
//Job_SheetMetalTask_Quartz.SmEverDayDelegateEvent += InitEveryDayMethod;
//Job_SheetMetalTask_Quartz.SmTaskDelegateEvent += UpdatePlanSHow;//计划内容展示
//WeakReferenceMessenger.Default.Register<string>(this, Recive);
Task.WaitAll(LoadData());
AddSelectData();//添加下拉菜单
RefreshHourAmount();//小时产量
// InitEveryDayMethod();
RefreshHourAmount();//小时产量
RefreshMaterialStats();//型号产量
SheetMetalPlanTaskHandle.RefreshCurrentPlanInfoEvent += RefreshCurrentPlanInfo;
QuantityIssuedViewModel.RefreshCretaePlanInfoEvent += LoadData;
//Task.Run(() =>
//{
// Get123();
//});
//Task.Run(() =>
//{
// Get1234();
//});
//Task.Run(() =>
//{
// Get1235();
//});
//Task.Run(() =>
//{
// Get123();
//});
SheetMetalPlanTaskHandle.RefreshCretaePlanInfoEvent += LoadData;
SheetMetalPlanTaskHandle.RefreshChatEvent += RefreshChat;
}
#endregion
public Task Get123()
public Task RefreshChat()
{
while (true)
{
var list = _taskExecutionPlanInfoServices.QueryAsync();
Console.WriteLine(list.ToJson());
}
}
public Task Get1234()
{
while (true)
{
var list = _taskExecutionPlanInfoServices.QueryAsync();
Console.WriteLine(list.ToJson());
}
}
public Task Get12345()
{
while (true)
{
var list = _taskExecutionPlanInfoServices.QueryAsync();
Console.WriteLine(list.ToJson());
}
RefreshHourAmount();//小时产量
RefreshMaterialStats();//型号产量
return Task.CompletedTask;
}
public Task Get1235()
{
while (true)
{
var list = _taskExecutionPlanInfoServices.QueryAsync();
Console.WriteLine(list.ToJson());
}
}
#region 下拉
public void AddSelectData()
{
@ -149,7 +100,10 @@ namespace Aucma.Core.SheetMetal.ViewModels
RealQuantity = info.CompleteAmount;
DiffQuantity = Math.Abs(info.CompleteAmount - info.PlanAmount);
CompletionRate = info.CompleteAmount / info.PlanAmount;
//CompletionRate = (_realQuantity / _planMaxNum).ToString("0%");
CompletionRate = (_realQuantity / _planMaxNum);
}
#endregion
@ -252,63 +206,75 @@ namespace Aucma.Core.SheetMetal.ViewModels
#region 加载DataGrid数据
private Task LoadData()
{
string stationCode = Appsettings.app("StationInfo", "StationCode");
CurrentTeamTimeView view = GetTeamHour();
var list = _taskExecutionPlanInfoServices.QueryAsync(x => x.ProductLineCode == stationCode&& x.CreatedTime> view.StartTime && x.CreatedTime <view.EndTime&& x.ExecuteStatus==2).Result;
if (list == null) return Task.CompletedTask;
var execList = list.OrderByDescending(d => d.ExecuteOrder);
int i = 1;
string planType = string.Empty;
PlanInfoDataGrid.Clear();
foreach (var item in execList)
try
{
TaskExecModel task = new TaskExecModel();
task.No = i;
task.ID = item.ObjId.ToString();
task.OrderCode = item.OrderCode;
task.MaterialCode = item.MaterialCode;
task.MaterialName = item.MaterialName;
task.TaskAmount = item.PlanAmount;
task.CompleteAmount = item.CompleteAmount;
task.BeginTime = item.BeginTime;
task.IsExec = item.ExecuteStatus;//执行状态
if (item.PlanType == 1)
{
planType = "前后板联动";
}
if (item.PlanType == 2)
{
planType = "前板计划";
}
if (item.PlanType == 3)
string stationCode = Appsettings.app("StationInfo", "StationCode");
CurrentTeamTimeView view = GetTeamHour();
var list = _taskExecutionPlanInfoServices.QueryAsync(x => x.ProductLineCode == stationCode && x.BeginTime > view.StartTime || x.ExecuteStatus == 2).Result;
if (list == null) return Task.CompletedTask;
var execList = list.OrderByDescending(d => d.ExecuteOrder);
int i = 1;
string planType = string.Empty;
System.Windows.Application.Current.Dispatcher.Invoke((Action)(() =>
{
planType = "后板计划";
}
task.PlanType = planType;
task.TaskCode = item.TaskCode;
task.ExecuteStatus = item.ExecuteStatus;//执行状态
PlanInfoDataGrid.Clear();
foreach (var item in execList)
{
TaskExecModel task = new TaskExecModel();
task.No = i;
task.ID = item.ObjId.ToString();
task.OrderCode = item.OrderCode;
task.MaterialCode = item.MaterialCode;
task.MaterialName = item.MaterialName;
task.TaskAmount = item.PlanAmount;
task.CompleteAmount = item.CompleteAmount;
task.BeginTime = item.BeginTime;
task.IsExec = item.ExecuteStatus;//执行状态
if (item.PlanType == 1)
{
planType = "前后板联动";
}
if (item.PlanType == 2)
{
planType = "前板计划";
}
if (item.PlanType == 3)
{
planType = "后板计划";
}
task.PlanType = planType;
task.TaskCode = item.TaskCode;
task.ExecuteStatus = item.ExecuteStatus;//执行状态
PlanInfoDataGrid.Add(task);
i++;
}
PlanInfoDataGrid.Add(task);
i++;
//更新首页显示信息
ExecutePlanInfo execPlan = execList.SingleOrDefault(d => d.ExecuteStatus == 2);
if (execPlan != null)
{
OrderCode = execPlan.OrderCode;
MesMOrderCode = execPlan.ProductPlanCode;
ProductModel = execPlan.MaterialName;
BeginTime = execPlan.BeginTime.ToString();
PlanMaxNum = _planNum = execPlan.PlanAmount;
RealQuantity = execPlan.CompleteAmount;
double diff = _planMaxNum - _realQuantity;
DiffQuantity =int.Parse(diff.ToString());
//CompletionRate = (_realQuantity/_planMaxNum).ToString("0%");
CompletionRate = (_realQuantity / _planMaxNum);
}
}));
}
//更新首页显示信息
ExecutePlanInfo execPlan = execList.SingleOrDefault(d => d.ExecuteStatus == 2);
if (execPlan != null)
catch (Exception ex)
{
_orderCode = execPlan.OrderCode;
_mesMOrderCode = execPlan.ProductPlanCode;
_productModel = execPlan.MaterialName;
_beginTime = execPlan.BeginTime.ToString();
_planMaxNum = _planNum = execPlan.PlanAmount;
_realQuantity = execPlan.CompleteAmount;
_diffQuantity = _planMaxNum - _realQuantity;
_completionRate = _realQuantity / _planMaxNum;
log.Error("钣金首页数据加载:"+ex.Message);
}
return Task.CompletedTask;
}
#endregion
@ -500,8 +466,8 @@ namespace Aucma.Core.SheetMetal.ViewModels
/// <summary>
/// 计划最大值
/// </summary>
private int _planMaxNum;
public int PlanMaxNum
private double _planMaxNum;
public double PlanMaxNum
{
get => _planMaxNum;
set => SetProperty(ref _planMaxNum, value);
@ -509,8 +475,8 @@ namespace Aucma.Core.SheetMetal.ViewModels
#endregion
#region 实际数量
private int _realQuantity;
public int RealQuantity
private double _realQuantity;
public double RealQuantity
{
get => _realQuantity;
set => SetProperty(ref _realQuantity, value);
@ -720,7 +686,6 @@ namespace Aucma.Core.SheetMetal.ViewModels
}
#endregion
#region 刷新小时产量统计
/// <summary>
/// 刷新小时产量统计
@ -734,8 +699,8 @@ namespace Aucma.Core.SheetMetal.ViewModels
var hourAmount = _sysUserInfoServices.GetSheetMetaHourData(stationCode).Result;
if (hourAmount != null)
{
Achievement.Clear();
if (Achievement.Count != 0) Achievement.Clear();
ProductionHourList = new List<string>();
ChartValues<ObservablePoint> hourAchievement1 = new ChartValues<ObservablePoint>();
ChartValues<ObservablePoint> hourAchievement2 = new ChartValues<ObservablePoint>();
@ -794,8 +759,12 @@ namespace Aucma.Core.SheetMetal.ViewModels
#region 按类型统计
ChartValues<double> achievement1 = new ChartValues<double>();
ChartValues<double> achievement2 = new ChartValues<double>();
if (ModelStatistics.Count != 0)
{
ModelStatistics.Clear();
}
MaterialNameList = new List<string>();
MaterialNameList = new List<string>();
foreach (var item in sheetMetalTypeList)
{
achievement1.Add(Convert.ToInt32(item.FrontPlateAmount));

@ -35,6 +35,7 @@ namespace Aucma.Core.SheetMetal.ViewModels
private IBaseBomInfoServices _bomInfoServices;
private IBaseSpaceDetailServices _spaceDetailServices;
protected readonly IExecutePlanInfoServices? _executePlanInfoServices;
protected readonly IProductPlanInfoServices? _productPlanInfoServices;
#region 构造函数
public QuantityIssuedViewModel(ProductPlanInfoModel productPlanInfo)
@ -42,7 +43,8 @@ namespace Aucma.Core.SheetMetal.ViewModels
_bomInfoServices = App.ServiceProvider.GetService<IBaseBomInfoServices>();
_spaceDetailServices = App.ServiceProvider.GetService<IBaseSpaceDetailServices>();
_executePlanInfoServices = App.ServiceProvider.GetService<IExecutePlanInfoServices>();
_productPlanInfoServices = App.ServiceProvider.GetService<IProductPlanInfoServices>();
PlanInfo = productPlanInfo;
}
#endregion
@ -92,7 +94,7 @@ namespace Aucma.Core.SheetMetal.ViewModels
task.OrderCode = PlanInfo.OrderCode;
task.ProductLineCode = stationCode;//计划工位
//task.TaskCode = GetMaxCodeAsync();
task.TaskCode = System.Guid.NewGuid().ToString("N").Substring(0,16);
task.TaskCode = System.Guid.NewGuid().ToString("N").Substring(0,16);
task.MaterialCode = PlanInfo.MaterialCode;
task.MaterialName = PlanInfo.MaterialName;
if (list.Count == 0)
@ -111,7 +113,10 @@ namespace Aucma.Core.SheetMetal.ViewModels
var result = await _executePlanInfoServices.AddAsync(task);
if (result > 0)
{
var obj = await _productPlanInfoServices.FirstAsync(d=>d.ProductLineCode== stationCode&& d.OrderCode== PlanInfo.OrderCode);
MessageBox.Show("计划拆分成功!", "系统提醒");
obj.BeginTime = DateTime.Now;
await _productPlanInfoServices.UpdateAsync(obj);
//WeakReferenceMessenger.Default.Send<string>("Refresh");//刷新窗口
RefreshCretaePlanInfoEvent?.Invoke();
}

@ -62,6 +62,33 @@ namespace Aucma.Core.SheetMetal.ViewModels
}
}
private async Task LoadDateData(DateTime startTime,DateTime endTime)
{
string station = Appsettings.app("StationInfo", "StationCode");
var list = _productPlanInfoServices.QueryAsync(d => d.ProductLineCode.Equals(station)).Result;
var sidePanelComplateList = _sidePanelComplateServices.QueryAsync(d => d.ProductlineCode == station).Result;
int i = 1;
foreach (var item in list.Where(d => d.BeginTime > startTime && d.EndTime < endTime))
{
int sidePanelComplete = GetSidePanelCompleteData(sidePanelComplateList, item.OrderCode, station);
int backPanelComplete = GetBackPanelCompleteData(sidePanelComplateList, item.OrderCode, station);
MaterialDataGrid.Add(new MaterialComplateInfo()
{
No = i,
ProductPlanCode = item.PlanCode,
MaterialCode = item.MaterialCode,
MaterialName = item.MaterialName,
PlanAmount = item.PlanAmount,
CompleteAmount = item.CompleteAmount,
SidePanelComplete = sidePanelComplete,
BackPanelComplete = backPanelComplete,
BeginTime = item.BeginTime.ToString(),
EndTime = item.EndTime.ToString(),
Status = item.CompleteAmount == item.PlanAmount ? "完成" : "未完成"
});
i++;
}
}
#endregion
#region 初始化datagrid
@ -103,26 +130,13 @@ namespace Aucma.Core.SheetMetal.ViewModels
var beginTime =DateTime.Parse(result.BeginTime);
var endTime = DateTime.Parse(result.EndTime);
MaterialDataGrid.Clear();
string station = Appsettings.app("StationInfo", "StationCode");
var list = _productPlanInfoServices.QueryAsync(d => d.ProductLineCode.Equals(station)).Result;
foreach (var item in list.Where(d=>d.BeginTime> beginTime&& d.EndTime < endTime))
{
MaterialDataGrid.Add(new MaterialComplateInfo()
{
ProductPlanCode = item.PlanCode,
MaterialCode = item.MaterialCode,
MaterialName = item.MaterialName,
PlanAmount = item.PlanAmount,
CompleteAmount = item.CompleteAmount,
BeginTime = item.BeginTime.ToString(),
EndTime = item.EndTime.ToString(),
});
}
await LoadDateData(beginTime, endTime);
}
else
{
MaterialDataGrid.Clear();
LoadData();
await LoadData();
}
}
#endregion

@ -225,7 +225,7 @@
<TextBlock Text="订单完成率" FontSize="18" FontWeight="Bold" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<Border Grid.Row="1" BorderThickness="0" CornerRadius="0" Background="Transparent" Margin="1,1,0,0" >
<lvc:Gauge Margin="5" Uses360Mode="True" From="0" To="100"
<lvc:Gauge Margin="5" Uses360Mode="True" From="0" To="1"
Value="{Binding CompletionRate,Mode=TwoWay}"
Foreground="White"/>
</Border>

@ -15,7 +15,7 @@ namespace XamlGeneratedNamespace {
/// GeneratedInternalTypeHelper
/// </summary>
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "7.0.4.0")]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "7.0.12.0")]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public sealed class GeneratedInternalTypeHelper : System.Windows.Markup.InternalTypeHelper {

@ -8,4 +8,4 @@ build_property.PlatformNeutralAssembly =
build_property.EnforceExtendedAnalyzerRules =
build_property._SupportedPlatformList = Linux,macOS,Windows
build_property.RootNamespace = HwControlLib
build_property.ProjectDir = E:\桌面\AUCMA_SCADA\HwControlLib\
build_property.ProjectDir = D:\Project\gitea\AUCMA\SCADA\HwControlLib\

Loading…
Cancel
Save