添加泡前库上位机

liuwf
liulb@mesnac.com 1 year ago
parent edb479d6db
commit 1c27f6c88f

Binary file not shown.

@ -59,7 +59,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Aucma.Core.Palletiz", "Aucm
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "7.Control", "7.Control", "{A4C60BC6-0120-48F4-A60D-C73160B122AA}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HwControlLib", "HwControlLib\HwControlLib.csproj", "{28D8A6AC-1ABB-4ECF-B3CF-C431AF6E80D6}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HwControlLib", "HwControlLib\HwControlLib.csproj", "{28D8A6AC-1ABB-4ECF-B3CF-C431AF6E80D6}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Aucma.Core.BeforeFoaming", "Aucma.Core.BeforeFoaming\Aucma.Core.BeforeFoaming.csproj", "{BD12B08D-C7CA-421C-A8E6-E59ACBB36FF5}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -143,6 +145,10 @@ Global
{28D8A6AC-1ABB-4ECF-B3CF-C431AF6E80D6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{28D8A6AC-1ABB-4ECF-B3CF-C431AF6E80D6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{28D8A6AC-1ABB-4ECF-B3CF-C431AF6E80D6}.Release|Any CPU.Build.0 = Release|Any CPU
{BD12B08D-C7CA-421C-A8E6-E59ACBB36FF5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BD12B08D-C7CA-421C-A8E6-E59ACBB36FF5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BD12B08D-C7CA-421C-A8E6-E59ACBB36FF5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BD12B08D-C7CA-421C-A8E6-E59ACBB36FF5}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -170,6 +176,7 @@ Global
{FB722C99-C117-480E-AD7E-845A701676B1} = {BD987F3A-4E6C-4C47-B28F-1671F875EAE3}
{B7FE7F2F-D01C-421F-A7F6-23971AF9530C} = {BD987F3A-4E6C-4C47-B28F-1671F875EAE3}
{28D8A6AC-1ABB-4ECF-B3CF-C431AF6E80D6} = {A4C60BC6-0120-48F4-A60D-C73160B122AA}
{BD12B08D-C7CA-421C-A8E6-E59ACBB36FF5} = {BD987F3A-4E6C-4C47-B28F-1671F875EAE3}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {8047AB56-042B-4AE4-B06A-34137067A86A}

@ -0,0 +1,29 @@
<Application x:Class="Aucma.Core.BeforeFoaming.App"
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:d1p1="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Aucma.Core.BeforeFoaming"
d1p1:Ignorable="d">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Assets/Styles/DefaultStyles.xaml"/>
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Light.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Defaults.xaml" />
<!--<ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Primary/MaterialDesignColor.DeepPurple.xaml" />-->
<ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Primary/MaterialDesignColor.LightBlue.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Accent/MaterialDesignColor.Lime.xaml" />
</ResourceDictionary.MergedDictionaries>
<!--重写框架主体色-->
<SolidColorBrush x:Key="PrimaryHueLightBrush" Color="#0288d1" />
<SolidColorBrush x:Key="PrimaryHueLightForegroundBrush" Color="#0288d1" />
<SolidColorBrush x:Key="PrimaryHueMidBrush" Color="#0288d1" />
<!--字体颜色设置-->
<SolidColorBrush x:Key="PrimaryHueMidForegroundBrush" Color="#DDFFFFFF" />
<SolidColorBrush x:Key="PrimaryHueDarkBrush" Color="#0288d1" />
<SolidColorBrush x:Key="PrimaryHueDarkForegroundBrush" Color="#0288d1" />
</ResourceDictionary>
</Application.Resources>
</Application>

@ -0,0 +1,63 @@
using Aucma.Core.BeforeFoaming.Views;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using System;
using System.Windows;
using Microsoft.Extensions.Configuration;
using System.IO;
using Microsoft.Extensions.Logging;
using Autofac.Extensions.DependencyInjection;
using Microsoft.AspNetCore.Hosting;
using Admin.Core.Common;
namespace Aucma.Core.BeforeFoaming
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
public static IServiceProvider ServiceProvider;
protected override async void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
var host = CreateHostBuilder(e.Args).Build();//生成宿主。
ServiceProvider = host.Services;
host.Services.GetRequiredService<MainWindow>()?.Show();
await host.StartAsync();
}
/// <summary>
/// CreateHostBuilder
/// </summary>
/// <param name="args"></param>
/// <returns></returns>
public static IHostBuilder CreateHostBuilder(string[] args)
{
//初始化默认主机Builder
var hostBuilder = Host.CreateDefaultBuilder(args)
//Autofac服务工厂
.UseServiceProviderFactory(new AutofacServiceProviderFactory())
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup>();
})
.ConfigureLogging((hostingContext, builder) =>
{
//清楚控制台log日志
builder.ClearProviders();
// 1.过滤掉系统默认的一些日志
builder.AddFilter("System", LogLevel.Error);
builder.AddFilter("Microsoft", LogLevel.Error);
// 默认log4net.confg
builder.AddLog4Net(Path.Combine(Directory.GetCurrentDirectory(), "Log4net.config"));
});
return hostBuilder;
}
}
}

@ -0,0 +1,10 @@
using System.Windows;
[assembly: ThemeInfo(
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
//(used if a resource is not found in the page,
// or application resource dictionaries)
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
//(used if a resource is not found in the page,
// app, or any theme specific resource dictionaries)
)]

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

@ -0,0 +1,229 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<PathGeometry x:Key="Heart" Figures="M513.5 921.6c-38.3 0-87.4-26.1-121.9-48-48.2-30.6-99.4-73.2-144.3-120-67.2-70-179.9-212.1-179.9-376.3 0-66 26.3-134.2 72.2-187.2 23.3-26.9 50.1-48.2 79.7-63.3 32.1-16.4 66-24.8 100.6-24.8 73.4 0 143.3 31.8 191.6 87.1 0.2 0.2 0.6 0.7 1.5 0.7s1.3-0.5 1.5-0.7c48.4-55.4 118.2-87.1 191.6-87.1 34.7 0 68.5 8.4 100.5 24.9 29.6 15.3 56.4 36.8 79.6 64 45.6 53.5 71.7 123.1 71.7 191 0 161.7-112.2 302.7-179.1 372.3-44.7 46.6-95.8 89-143.7 119.5-34.4 21.8-83.4 47.9-121.6 47.9zM319.9 158c-50.6 0-99.6 24.4-138 68.8-18 20.8-32.9 45.4-43 71.2-10.2 26-15.6 53.5-15.6 79.3 0 56.9 16.3 117.1 48.3 178.9 27.8 53.7 67.9 108.6 116 158.6 41.8 43.6 89.4 83.2 133.9 111.5 45.6 29 77.4 39.3 91.9 39.3s46.2-10.3 91.6-39.2c44.3-28.1 91.6-67.6 133.4-111 47.8-49.8 87.7-104.2 115.4-157.3 31.9-61.1 48-120.4 48-176.2 0-54.8-21.3-111.2-58.3-154.7-38-44.6-86.8-69.2-137.5-69.2-57.3 0-111.7 24.8-149.5 68-11 12.6-26.9 19.8-43.6 19.8s-32.6-7.2-43.6-19.8c-37.6-43.2-92.1-68-149.4-68z"/>
<PathGeometry x:Key="HeartSolid" Figures="M512.002048 872.229888c-82.62144 0-448.510976-259.203072-448.510976-547.059712L63.491072 312.064C62.8224 181.332992 166.3744 73.839616 297.048064 69.632c91.287552-0.022528 174.242816 53.066752 212.452352 135.974912 39.40864-80.579584 121.427968-131.525632 211.125248-131.13344C851.058688 77.101056 956.502016 181.472256 960.512 311.857152l0 13.334528C960.512 613.071872 594.622464 872.229888 512.002048 872.229888z"/>
<!--<Style TargetType="Button" x:Key="PathButtonStyle">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Grid Background="Transparent">
<Border Background="Transparent" Name="back"/>
<Path Data="{Binding Tag,RelativeSource={RelativeSource AncestorType=Button,Mode=FindAncestor}}" VerticalAlignment="Center" HorizontalAlignment="Center"
Stroke="{TemplateBinding Foreground}" StrokeThickness="1"/>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsPressed" Value="True">
<Setter Property="Background" Value="#22FFFFFF" TargetName="back"/>
</Trigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#22FFFFFF" TargetName="back"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>-->
<Style TargetType="RadioButton" x:Key="NavRadioButtonStyle">
<Setter Property="Margin" Value="0,0,5,0"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="RadioButton">
<Grid Background="Transparent">
<Border Background="Transparent" CornerRadius="8" x:Name="back"/>
<ContentControl Content="{TemplateBinding Content}" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="20,1" FontSize="13"/>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsChecked" Value="True">
<Setter TargetName="back" Property="Background" Value="#44FFFFFF"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="RadioButton" x:Key="RecordButtonStyle">
<Setter Property="Margin" Value="0,0,5,0"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="RadioButton">
<Grid >
<Border Background="Transparent" CornerRadius="15" x:Name="back"/>
<ContentControl Content="{TemplateBinding Content}" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0,0" FontSize="13"/>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsChecked" Value="True">
<Setter TargetName="back" Property="Background" Value="#44FFFFFF"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="CheckBox" x:Key="FavoriteButtonStyle">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="CheckBox">
<Grid Background="Transparent">
<Viewbox>
<Path Data="{StaticResource Heart}" Fill="White" Name="path"/>
</Viewbox>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsChecked" Value="True">
<Setter TargetName="path" Property="Data" Value="{StaticResource HeartSolid}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!--<Style TargetType="Button" x:Key="MaskCloseButtonStyle">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Grid Background="Transparent">
<Border BorderThickness="1" BorderBrush="White" Name="back" CornerRadius="100"/>
<Path Data="M0 0,12 12M0 12,12 0" Stroke="White" StrokeThickness="1" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="back" Property="Background" Value="#77FFFFFF"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>-->
<Style TargetType="RadioButton" x:Key="NavButtonStyle">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="RadioButton">
<Grid Background="Transparent" Height="35">
<Border Background="#22FFFFFF" BorderBrush="White" BorderThickness="2,0,0,0" Name="back"/>
<TextBlock Text="{TemplateBinding Content}" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="15,0,0,0" Foreground="White"/>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsChecked" Value="False">
<Setter Property="Visibility" Value="Collapsed" TargetName="back"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="RadioButton" x:Key="MFButtonStyle">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="RadioButton">
<Grid Background="Transparent" Height="30">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="20"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Border Width="16" Height="16" BorderThickness="1" BorderBrush="#FF646EDC" CornerRadius="15">
<Border Width="10" Height="10" CornerRadius="10" Background="#FF646EDC" Name="checked"/>
</Border>
<TextBlock Grid.Column="1" Text="{TemplateBinding Content}" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="5,0"/>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsChecked" Value="False">
<Setter TargetName="checked" Property="Visibility" Value="Collapsed"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<ControlTemplate x:Key="TextBoxErrorTemplate">
<AdornedElementPlaceholder/>
</ControlTemplate>
<SolidColorBrush x:Key="TextBox.Static.Border" Color="#FFABAdB3"/>
<SolidColorBrush x:Key="TextBox.MouseOver.Border" Color="#FF7EB4EA"/>
<SolidColorBrush x:Key="TextBox.Focus.Border" Color="#FF569DE5"/>
<Style x:Key="ValidTextBoxStyle" TargetType="{x:Type TextBox}">
<Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"/>
<Setter Property="BorderBrush" Value="{StaticResource TextBox.Static.Border}"/>
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="KeyboardNavigation.TabNavigation" Value="None"/>
<Setter Property="HorizontalContentAlignment" Value="Left"/>
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
<Setter Property="AllowDrop" Value="true"/>
<Setter Property="ScrollViewer.PanningMode" Value="VerticalFirst"/>
<Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
<Setter Property="Height" Value="30"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TextBox}">
<Border x:Name="border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}"
Background="{TemplateBinding Background}" SnapsToDevicePixels="True"
CornerRadius="5">
<Grid>
<ScrollViewer x:Name="PART_ContentHost" Focusable="false" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden"
VerticalContentAlignment="Center" Margin="3,5" BorderThickness="0"/>
<Border Width="16" Height="16" CornerRadius="15" Background="Red" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="5"
ToolTip="{Binding (Validation.Errors)[0].ErrorContent,RelativeSource={RelativeSource AncestorType=TextBox,Mode=FindAncestor}}"
x:Name="flag" Visibility="Collapsed">
<TextBlock Text="!" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
</Grid>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Opacity" TargetName="border" Value="0.56"/>
</Trigger>
<Trigger Property="IsMouseOver" Value="true">
<Setter Property="BorderBrush" TargetName="border" Value="{StaticResource TextBox.MouseOver.Border}"/>
</Trigger>
<Trigger Property="IsKeyboardFocused" Value="true">
<Setter Property="BorderBrush" TargetName="border" Value="{StaticResource TextBox.Focus.Border}"/>
</Trigger>
<Trigger Property="Validation.HasError" Value="True">
<Setter Property="BorderBrush" Value="Red" TargetName="border"/>
<Setter Property="Visibility" Value="Visible" TargetName="flag"/>
<Setter Property="ToolTip"
Value="{Binding RelativeSource={RelativeSource Self}, Path=(Validation.Errors)[0].ErrorContent}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsInactiveSelectionHighlightEnabled" Value="true"/>
<Condition Property="IsSelectionActive" Value="false"/>
</MultiTrigger.Conditions>
<Setter Property="SelectionBrush" Value="{DynamicResource {x:Static SystemColors.InactiveSelectionHighlightBrushKey}}"/>
</MultiTrigger>
</Style.Triggers>
</Style>
<!--<Style TargetType="Button" x:Key="UrlButtonStyle">
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border Background="Transparent" BorderBrush="#FF5577EE" BorderThickness="0">
<TextBlock Text="{Binding Content,RelativeSource={RelativeSource AncestorType=Button,Mode=FindAncestor}}" Foreground="#FF5577EE"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>-->
</ResourceDictionary>

@ -0,0 +1,76 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net6.0-windows</TargetFramework>
<Nullable>enable</Nullable>
<UseWPF>true</UseWPF>
<UseWindowsForms>true</UseWindowsForms>
</PropertyGroup>
<ItemGroup>
<Compile Remove="Locator\**" />
<Compile Remove="ViewModels\Base\**" />
<EmbeddedResource Remove="Locator\**" />
<EmbeddedResource Remove="ViewModels\Base\**" />
<None Remove="Locator\**" />
<None Remove="ViewModels\Base\**" />
<Page Remove="Locator\**" />
<Page Remove="ViewModels\Base\**" />
</ItemGroup>
<ItemGroup>
<None Remove="appsettings.json" />
<None Remove="Assets\Images\Green.png" />
<None Remove="Assets\Images\logo.png" />
<None Remove="Assets\Images\Newlog.png" />
<None Remove="Assets\Images\Red.png" />
<None Remove="Log4net.config" />
</ItemGroup>
<ItemGroup>
<Content Include="appsettings.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
<Content Include="Log4net.config">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<Resource Include="Assets\Images\Newlog.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Assets\Images\Green.png" />
<Resource Include="Assets\Images\logo.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Assets\Images\Red.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
</ItemGroup>
<ItemGroup>
<Folder Include="Log\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.1.0" />
<PackageReference Include="LiveChartsCore.SkiaSharpView.WPF" Version="2.0.0-rc1.2" />
<PackageReference Include="MaterialDesignThemes" Version="4.8.0" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="7.0.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Admin.Core.Extensions\Admin.Core.Extensions.csproj" />
</ItemGroup>
</Project>

@ -0,0 +1,40 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup />
<ItemGroup>
<ApplicationDefinition Update="App.xaml">
<SubType>Designer</SubType>
</ApplicationDefinition>
</ItemGroup>
<ItemGroup>
<Compile Update="Views\EnterWarehouseStatisticsPageView.xaml.cs">
<SubType>Code</SubType>
</Compile>
<Compile Update="Views\MonitorPageView.xaml.cs">
<SubType>Code</SubType>
</Compile>
<Compile Update="Views\RealTimeInventoryPageView.xaml.cs">
<SubType>Code</SubType>
</Compile>
</ItemGroup>
<ItemGroup>
<Page Update="Views\EnterWarehouseStatisticsPageView.xaml">
<SubType>Designer</SubType>
</Page>
<Page Update="Views\IndexPageView.xaml">
<SubType>Designer</SubType>
</Page>
<Page Update="Views\MainWindow.xaml">
<SubType>Designer</SubType>
</Page>
<Page Update="Views\MonitorPageView.xaml">
<SubType>Designer</SubType>
</Page>
<Page Update="Views\RealTimeInventoryPageView.xaml">
<SubType>Designer</SubType>
</Page>
<Page Update="Views\UserPage\SpaceInfoControl.xaml">
<SubType>Designer</SubType>
</Page>
</ItemGroup>
</Project>

@ -0,0 +1,57 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Aucma.Core.BeforeFoaming.Common
{
/// <summary>
/// 窗口管理器
/// </summary>
public class WindowManager
{
static Dictionary<string, WindowStruct> _regWindowContainer = new Dictionary<string, WindowStruct>();
/// <summary>
/// 注册类型
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="name"></param>
/// <param name="owner"></param>
public static void Register<T>(string name, System.Windows.Window owner = null)
{
if (!_regWindowContainer.ContainsKey(name))
{
_regWindowContainer.Add(name, new WindowStruct { WindowType = typeof(T), Owner = owner });
}
}
/// <summary>
/// 获取对象
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="name"></param>
/// <param name="dataContext"></param>
/// <returns></returns>
public static bool ShowDialog<T>(string name, T dataContext)
{
if (_regWindowContainer.ContainsKey(name))
{
Type type = _regWindowContainer[name].WindowType;
//反射创建窗体对象
var window = (System.Windows.Window)Activator.CreateInstance(type);
window.Owner = _regWindowContainer[name].Owner;
window.DataContext = dataContext;
return window.ShowDialog() == true;
}
return false;
}
}
public class WindowStruct
{
public Type WindowType { get; set; }
public System.Windows.Window Owner { get; set; }
}
}

@ -0,0 +1,42 @@
using Admin.Core.Model;
using Aucma.Core.BeforeFoaming.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;
namespace Aucma.Core.BeforeFoaming.ConvertTo
{
public class MultiBindingConverter : IMultiValueConverter
{
/// <summary>
/// 对象转换
/// </summary>
/// <param name="values">所绑定的源的值</param>
/// <param name="targetType">目标的类型</param>
/// <param name="parameter">绑定时所传递的参数</param>
/// <param name="culture"><系统语言等信息</param>
/// <returns></returns>
public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
if (values != null && values.Count() ==2)
{
StatisticModel bsm = new StatisticModel();
bsm.BeginTime = values[0].ToString();
bsm.EndTime = values[1].ToString();
return bsm;
}
return null;
}
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, System.Globalization.CultureInfo culture)
{
throw new NotImplementedException();
}
}
}

@ -0,0 +1,24 @@
using Autofac;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Aucma.Core.BeforeFoaming
{
public class AutofacPropertityModuleReg : Autofac.Module
{
/// <summary>
/// Load
/// </summary>
/// <param name="builder"></param>
protected override void Load(ContainerBuilder builder)
{
builder.RegisterAssemblyTypes(typeof(App).Assembly)
.PropertiesAutowired();
}
}
}

File diff suppressed because one or more lines are too long

@ -0,0 +1,65 @@
<?xml version="1.0" encoding="utf-8"?>
<log4net>
<!-- 将日志以回滚文件的形式写到文件中 -->
<!-- 按日期切分日志文件,并将日期作为日志文件的名字 -->
<!--Error-->
<appender name="ErrorLog" type="log4net.Appender.RollingFileAppender">
<!--不加utf-8编码格式中文字符将显示成乱码-->
<param name="Encoding" value="utf-8" />
<file value="E:\log\"/>
<appendToFile value="true" />
<rollingStyle value="Date" />
<!--日期的格式,每天换一个文件记录,如不设置则永远只记录一天的日志,需设置-->
<datePattern value="&quot;GlobalExceptionLogs_&quot;yyyyMMdd&quot;.log&quot;" />
<!--日志文件名是否为静态-->
<StaticLogFileName value="false"/>
<!--多线程时采用最小锁定-->
<lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
<!--布局(向用户显示最后经过格式化的输出信息)-->
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date| %-5level %newline%message%newline--------------------------------%newline" />
</layout>
<filter type="log4net.Filter.LevelRangeFilter">
<levelMin value="ERROR" />
<levelMax value="FATAL" />
</filter>
</appender>
<!--Error-->
<!--Info-->
<appender name="InfoLog" type="log4net.Appender.RollingFileAppender">
<!--不加utf-8编码格式中文字符将显示成乱码-->
<param name="Encoding" value="utf-8" />
<!--定义文件存放位置-->
<file value="../../../Log/"/>
<appendToFile value="true" />
<rollingStyle value="Date" />
<!--日志文件名是否为静态-->
<StaticLogFileName value="false"/>
<!--日期的格式,每天换一个文件记录,如不设置则永远只记录一天的日志,需设置-->
<datePattern value="&quot;GlobalInfoLogs_&quot;yyyyMMdd&quot;.log&quot;" />
<!--多线程时采用最小锁定-->
<lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
<!--布局(向用户显示最后经过格式化的输出信息)-->
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date| %-5level%c %newline%message%newline--------------------------------%newline" />
</layout>
<filter type="log4net.Filter.LevelRangeFilter">
<levelMin value="DEBUG" />
<levelMax value="WARN" />
</filter>
</appender>
<!--Info-->
<root>
<!-- 控制级别由低到高ALL|DEBUG|INFO|WARN|ERROR|FATAL|OFF -->
<!-- 比如定义级别为INFO则INFO级别向下的级别比如DEBUG日志将不会被记录 -->
<!-- 如果没有定义LEVEL的值则缺省为DEBUG -->
<level value="ALL" />
<!-- 按日期切分日志文件,并将日期作为日志文件的名字 -->
<appender-ref ref="ErrorLog" />
<appender-ref ref="InfoLog" />
</root>
</log4net>

@ -0,0 +1,20 @@
using CommunityToolkit.Mvvm.ComponentModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Aucma.Core.BeforeFoaming.Models
{
public class MainModel : ObservableObject
{
private string _name;
public string Name
{
get => _name;
set => SetProperty(ref _name, value);
}
}
}

@ -0,0 +1,45 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Aucma.Core.BeforeFoaming.Models
{
public class MaterialComplateInfo
{
/// <summary>
/// 序号
/// </summary>
public int No { get; set; }
/// <summary>
/// 计划编号
/// </summary>
public string? ProductPlanCode { get; set; }
/// <summary>
/// 物料条码
/// </summary>
public string? MaterialBarCode { get; set; }
/// <summary>
/// 物料编号
/// </summary>
public string? MaterialCode { get; set; }
/// <summary>
/// 物料名称
/// </summary>
public string? MaterialName { get; set; }
/// <summary>
/// 计划数量
/// </summary>
public int PlanAmount { get; set; }
/// <summary>
/// 完成数量
/// </summary>
public int CompleteAmount { get; set; }
/// <summary>
/// 入库时间
/// </summary>
public DateTime EnterWarehouseTime { get; set; }
}
}

@ -0,0 +1,52 @@
using CommunityToolkit.Mvvm.ComponentModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Aucma.Core.BeforeFoaming.Models
{
/// <summary>
/// 执行计划
/// </summary>
public class OrderInfo: ObservableObject
{
/// <summary>
/// 序号
/// </summary>
public int No { get; set; }
/// <summary>
/// 计划编号
/// </summary>
public string? ExecutePlanCode { get; set; }
/// <summary>
/// 生产计划
/// </summary>
public string? ProductPlanCode { get; set; }
/// <summary>
/// 物料型号
/// </summary>
public string? MaterialName { get; set; }
/// <summary>
/// 计划数量
/// </summary>
public int PlanAmount { get; set; }
/// <summary>
/// 完成数量
/// </summary>
public int CompleteAmount { get; set; }
/// <summary>
/// 剩余数量
/// </summary>
public int ResidueAmount { get; set; }
/// <summary>
/// 排产数量
/// </summary>
public int SchedulingAmount { get; set; }
/// <summary>
/// 开始时间
/// </summary>
public string? BeginTime { get; set; }
}
}

@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Aucma.Core.BeforeFoaming.Models
{
public class StatisticModel
{
/// <summary>
/// 开始时间
/// </summary>
public string? BeginTime { get; set; }
/// <summary>
/// 结束时间
/// </summary>
public string? EndTime { get; set; }
}
}

@ -0,0 +1,115 @@
using Admin.Core.Common;
using Admin.Core.Extensions;
using Admin.Core.IRepository;
using Admin.Core.IService;
using Admin.Core.IService.ISys;
using Admin.Core.Model;
using Admin.Core.Repository;
using Admin.Core.Service;
using Admin.Core.Tasks;
using Autofac;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using System.Text;
namespace Aucma.Core.BeforeFoaming
{
/// <summary>
/// Startup
/// </summary>
public class Startup
{
/// <summary>
/// Startup
/// </summary>
/// <param name="configuration"></param>
public Startup(IConfiguration configuration, IWebHostEnvironment env)
{
Configuration = configuration;
Env = env;
}
/// <summary>
/// IConfiguration
/// </summary>
public IConfiguration Configuration { get; }
/// <summary>
/// 环境信息:开发/生产
/// </summary>
public IWebHostEnvironment Env { get; }
/// <summary>
/// This method gets called by the runtime. Use this method to add services to the container.
/// </summary>
/// <param name="services"></param>
public void ConfigureServices(IServiceCollection services)
{
//Appsettings
services.AddSingleton(new Appsettings(Configuration));
//日志文件目录
services.AddSingleton(new LogLock(Env.ContentRootPath));
//Memory缓存
services.AddMemoryCacheSetup();
//Sqlsugar数据库模型查询
services.AddSqlsugarSetup();
//AutoMapper
services.AddAutoMapperSetup();
//注册业务服务
AddServices(services);
//任务调度
services.AddJobSetup();
//支持编码大全 例如:支持 System.Text.Encoding.GetEncoding("GB2312") System.Text.Encoding.GetEncoding("GB18030")
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
}
/// <summary>
/// 注意在Program.CreateHostBuilder添加Autofac服务工厂
/// </summary>
/// <param name="builder"></param>
public void ConfigureContainer(ContainerBuilder builder)
{
builder.RegisterModule(new AutofacModuleRegister());
builder.RegisterModule<AutofacPropertityModuleReg>();
}
/// <summary>
/// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
/// </summary>
/// <param name="app"></param>
/// <param name="env"></param>
public void Configure(IApplicationBuilder app, ISysTasksQzService tasksQzService, ISchedulerCenter schedulerCenter)
{
// 使用静态文件
app.UseStaticFiles();
// 然后是授权中间件
//app.UseAuthorization();
// 开启QuartzNetJob调度服务
app.UseQuartzJobMildd(tasksQzService, schedulerCenter);
}
#region 注册服务
/// <summary>
/// 注册服务
/// </summary>
/// <param name="services"></param>
private static void AddServices(IServiceCollection services)
{
#region 注册服务
//services.AddScoped<IEEquipmentCategoryServices, EEquipmentCategoryServices>();
//services.AddScoped<IEEquipmentCategoryRepository, EEquipmentCategoryRepository>();
//services.AddScoped<IBaseRepository<EEquipmentCategory>, BaseRepository<EEquipmentCategory>>();
//services.AddSingleton<IBaseService<EEquipmentCategory>, BaseService<EEquipmentCategory>>();
#endregion
}
#endregion
}
}

@ -0,0 +1,100 @@
using Aucma.Core.BeforeFoaming.Models;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using log4net;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
/*
*
*
* */
namespace Aucma.Core.BeforeFoaming.ViewModels
{
public partial class EnterWarehouseStatisticsPageViewModel : ObservableObject
{
private static readonly log4net.ILog log = LogManager.GetLogger(typeof(EnterWarehouseStatisticsPageViewModel));
public EnterWarehouseStatisticsPageViewModel() { LoadData(); }
List<MaterialComplateInfo> materialComplateInfos = new List<MaterialComplateInfo>();
#region 加载DataGrid数据
private void LoadData()
{
MaterialDataGrid.Add(new MaterialComplateInfo() { No = 1, MaterialBarCode= "8659452123", ProductPlanCode = "8659452123", MaterialCode = "8659452123", MaterialName = "SC-AUCMA-农夫山泉SC", PlanAmount = 50, CompleteAmount = 10, EnterWarehouseTime=DateTime.Now });
MaterialDataGrid.Add(new MaterialComplateInfo() { No = 2,MaterialBarCode= "8659452123", ProductPlanCode = "8659452123", MaterialCode = "8659452123", MaterialName = "SC-AUCMA-农夫山泉SC", PlanAmount = 60, CompleteAmount = 40, EnterWarehouseTime=DateTime.Now });
MaterialDataGrid.Add(new MaterialComplateInfo() { No = 3,MaterialBarCode= "8659452123", ProductPlanCode = "8659452123", MaterialCode = "8659452123", MaterialName = "SC-AUCMA-农夫山泉SC", PlanAmount = 50, CompleteAmount = 10, EnterWarehouseTime=DateTime.Now });
MaterialDataGrid.Add(new MaterialComplateInfo() { No = 4,MaterialBarCode= "8659452123", ProductPlanCode = "8659452123", MaterialCode = "8659452123", MaterialName = "SC-AUCMA-农夫山泉SC", PlanAmount = 40, CompleteAmount = 10, EnterWarehouseTime=DateTime.Now });
MaterialDataGrid.Add(new MaterialComplateInfo() { No = 5,MaterialBarCode= "8659452123", ProductPlanCode = "8659452123", MaterialCode = "8659452123", MaterialName = "SC-AUCMA-农夫山泉SC", PlanAmount = 30, CompleteAmount = 10, EnterWarehouseTime=DateTime.Now });
MaterialDataGrid.Add(new MaterialComplateInfo() { No = 6,MaterialBarCode= "8659452123", ProductPlanCode = "8659452123", MaterialCode = "8659452123", MaterialName = "SC-AUCMA-农夫山泉SC", PlanAmount = 50, CompleteAmount = 20, EnterWarehouseTime=DateTime.Now });
MaterialDataGrid.Add(new MaterialComplateInfo() { No = 7,MaterialBarCode= "8659452123", ProductPlanCode = "8659452123", MaterialCode = "8659452123", MaterialName = "SC-AUCMA-农夫山泉SC", PlanAmount = 10, CompleteAmount = 10, EnterWarehouseTime=DateTime.Now });
MaterialDataGrid.Add(new MaterialComplateInfo() { No = 8,MaterialBarCode= "8659452123", ProductPlanCode = "8659452123", MaterialCode = "8659452123", MaterialName = "SC-AUCMA-农夫山泉SC", PlanAmount = 50, CompleteAmount = 10, EnterWarehouseTime = DateTime.Now });
MaterialDataGrid.Add(new MaterialComplateInfo() { No = 9, MaterialBarCode = "8659452123", ProductPlanCode = "8659452123", MaterialCode = "8659452123", MaterialName = "SC-AUCMA-农夫山泉SC", PlanAmount = 80, CompleteAmount = 10, EnterWarehouseTime = DateTime.Now });
MaterialDataGrid.Add(new MaterialComplateInfo() { No = 10, MaterialBarCode = "8659452123", ProductPlanCode = "8659452123", MaterialCode = "8659452123", MaterialName = "SC-AUCMA-农夫山泉SC", PlanAmount = 50, CompleteAmount = 10, EnterWarehouseTime = DateTime.Now });
}
#endregion
#region 初始化datagrid
private ObservableCollection<MaterialComplateInfo> materialDataGrid = new ObservableCollection<MaterialComplateInfo>();
public ObservableCollection<MaterialComplateInfo> MaterialDataGrid
{
get { return materialDataGrid; }
set
{
materialDataGrid = value;
OnPropertyChanged();//属性通知
}
}
#endregion
#region 查询
/// <summary>
/// 查询
/// </summary>
[RelayCommand]
private void ExecQuery(object obj)
{
var result = (StatisticModel)obj;
if (result==null)
{
MessageBox.Show("查询参数不能为空!");
return;
}
if (string.IsNullOrEmpty(result.BeginTime))
{
MessageBox.Show("开始时间不能为空!");
return;
}
if (string.IsNullOrEmpty(result.EndTime))
{
MessageBox.Show("结束时间不能为空!");
return;
}
var beginTime = result.BeginTime;
var endTime = result.EndTime;
System.Windows.Application.Current.Dispatcher.Invoke((Action)(() =>
{
if (!string.IsNullOrEmpty(beginTime))
{
MaterialDataGrid.Clear();
MaterialDataGrid.Add(new MaterialComplateInfo() { No = 1, MaterialBarCode = "8659452123", ProductPlanCode = "8659452123", MaterialCode = "8659452123", MaterialName = "SC-AUCMA-可口可乐SC", PlanAmount = 50, CompleteAmount = 10 });
}
else
{
MaterialDataGrid.Clear();
LoadData();
}
//Datalist.Insert(0, Datalist[Datalist.Count - 1]);
//Datalist.RemoveAt(Datalist.Count - 1);
}));
}
#endregion
}
}

@ -0,0 +1,230 @@
using Aucma.Core.BeforeFoaming.Models;
using Aucma.Core.BeforeFoaming.Views;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using MaterialDesignThemes.Wpf;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics.Metrics;
using System.Drawing.Imaging;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using LiveChartsCore.Defaults;
using LiveChartsCore.SkiaSharpView;
using LiveChartsCore;
using LiveChartsCore.SkiaSharpView.Extensions;
using LiveChartsCore.Measure;
using LiveChartsCore.SkiaSharpView.Painting;
using SkiaSharp;
using LiveChartsCore.ConditionalDraw;
using LiveChartsCore.Drawing;
using System.Linq;
using System.Threading.Tasks;
using LiveChartsCore.Themes;
using System.Collections;
using log4net;
using Admin.Core.Tasks;
using Admin.Core.IService;
using Admin.Core.Service;
using Microsoft.Extensions.DependencyInjection;
using Admin.Core.Common;
using Admin.Core.Model.ViewModels;
/*
*
*
*/
namespace Aucma.Core.BeforeFoaming.ViewModels
{
public partial class IndexPageViewModel : ObservableObject
{
private ObservableCollection<dynamic> listItems = new ObservableCollection<dynamic>();
private static readonly log4net.ILog log = LogManager.GetLogger(typeof(IndexPageViewModel));
public readonly IRecordInstoreServices? _recordInstoreServices;
public IndexPageViewModel()
{
_recordInstoreServices = App.ServiceProvider.GetService<IRecordInstoreServices>();
Job_PQInStoreTask_Quartz.RefreshDataGridDelegateEvent += LoadData;
Job_TestTask_Quartz.DataGridDelegateEvent += ExecMethod;
Job_PQInStoreTask_Quartz.RefreshScanMateriaCodeEvent += RefreshScanInfo;
Job_PQInStoreTask_Quartz.LogDelegateEvent += PrintMessageToListBox;
}
public async Task ExecMethod()
{
System.Windows.Application.Current.Dispatcher.Invoke((Action)(async () =>
{
PlanInfoDataGrid.Clear();
await LoadData();
}));
}
#region 扫描记录 data
#region 加载DataGrid数据
private async Task LoadData()
{
var storeCode = Appsettings.app("StoreInfo", "StoreCode");
System.Windows.Application.Current.Dispatcher.Invoke((Action)(async () =>
{
PlanInfoDataGrid.Clear();
var list = await _recordInstoreServices.SaveRecordToDb(storeCode);
foreach (var item in list.OrderByDescending(d=>d.No))
{
PlanInfoDataGrid.Add(new EnterLibView()
{
No=item.No,
PlanCode = item.PlanCode,
MaterialCode = item.MaterialCode,
MaterialName = item.MaterialName,
MaterialBarCode = item.MaterialBarCode,
EnterSpace = item.EnterSpace,
ExecDateTime = item.ExecDateTime,
Status = item.Status
});
};
//Datalist.Insert(0, Datalist[Datalist.Count - 1]);
//Datalist.RemoveAt(Datalist.Count - 1);
}));
}
#endregion
#region 初始化datagrid
private ObservableCollection<EnterLibView> planInfoDataGrid = new ObservableCollection<EnterLibView>();
public ObservableCollection<EnterLibView> PlanInfoDataGrid
{
get { return planInfoDataGrid; }
set
{
planInfoDataGrid = value;
OnPropertyChanged();//属性通知
}
}
#endregion
#endregion
#region 扫描信息
#region 物料条码
private string _materialBarCode;
public string MaterialBarCode
{
get => _materialBarCode;
set=>SetProperty(ref _materialBarCode, value);
}
#endregion
#region 物料编码
private string _materialCode;
public string MaterialCode
{
get => _materialCode;
set => SetProperty(ref _materialCode, value);
}
#endregion
#region 物料名称
private string _materialName;
public string MaterialName
{
get => _materialName;
set => SetProperty(ref _materialName, value);
}
#endregion
#region 目的信息
private string _destination;
public string Destination
{
get => _destination;
set => SetProperty(ref _destination, value);
}
#endregion
#region 提示信息
private string _prompt;
public string Prompt
{
get => _prompt;
set => SetProperty(ref _prompt, value);
}
#endregion
#region 开始时间
private string _beginTime;
public string BeginTime
{
get => _beginTime;
set => SetProperty(ref _beginTime, value);
}
#endregion
#endregion
#region 日志信息
/// <summary>
/// LisBox数据模板
/// </summary>
private IEnumerable logInfoListBox;
public IEnumerable LogInfoListBox
{
get => logInfoListBox;
set => SetProperty(ref logInfoListBox, value);
}
/// <summary>
/// listBox绑定日志
/// </summary>
/// <param name="message"></param>
private void PrintMessageToListBox(string message)
{
try
{
listItems.Add($"{DateTime.Now.ToString("HH:mm:ss")}==>{message}");
LogInfoListBox = listItems.OrderByDescending(x => x);
}
catch (Exception ex)
{
log.Error("日志数据绑定异常", ex);
}
}
#endregion
#region 刷新扫码信息
/// <summary>
/// 刷新扫码信息
/// </summary>
/// <param name="materialCode"></param>
/// <param name="materialName"></param>
/// <param name="spaceName"></param>
/// <param name="materialType"></param>
private void RefreshScanInfo(string materialBarCode, string materialCode, string materialName, string spaceName,string msg)
{
System.Windows.Application.Current.Dispatcher.Invoke((Action)( () =>
{
MaterialBarCode = materialBarCode;
MaterialCode = materialCode;
MaterialName = materialName;
Destination = spaceName;//货道
Prompt = msg;
BeginTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:dd");
}));
}
#endregion
}
}

@ -0,0 +1,191 @@
using Aucma.Core.BeforeFoaming.Views;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using System.Windows;
using System;
using log4net;
using System.Diagnostics;
using System.Threading;
namespace Aucma.Core.BeforeFoaming.ViewModels
{
public partial class MainWindowViewModel : ObservableObject
{
private static readonly log4net.ILog log = LogManager.GetLogger(typeof(MainWindowViewModel));
private IndexPageView firstPage = new IndexPageView();//首页
private EnterWarehouseStatisticsPageView enterWarehouseStatisticsPage = new EnterWarehouseStatisticsPageView();//统计
private MonitorPageView monitorPage= new MonitorPageView();//任务监控
private RealTimeInventoryPageView realTimeInventoryPage = new RealTimeInventoryPageView();
public MainWindowViewModel()
{
UserContent = firstPage;
}
#region 更换界面
public System.Windows.Controls.UserControl _content;
public System.Windows.Controls.UserControl UserContent
{
get => _content;
set => SetProperty(ref _content, value);
}
#endregion
#region 窗口操作
/// <summary>
/// 窗口操作
/// </summary>
[RelayCommand]
private void FormControl(object obj)
{
try
{
string controlType = obj as string;
switch (controlType)
{
// 关闭当前窗口
case "Exit":
if (System.Windows.MessageBox.Show("确定要退出系统吗?", "系统提醒", MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.No) == MessageBoxResult.Yes)
{
Application.Current.Shutdown();
Environment.Exit(0);
}
break;
// 打开软盘
case "TabTip":
OpenOsk();
break;
// 还原 或者 最大化当前窗口
case "Normal":
if (Application.Current.MainWindow.WindowState == WindowState.Normal)
{
Application.Current.MainWindow.WindowState = WindowState.Maximized;
break;
}
if (Application.Current.MainWindow.WindowState == WindowState.Maximized)
{
Application.Current.MainWindow.WindowState = WindowState.Normal;
break;
}
break;
// 最小化当前窗口
case "Minimized":
Application.Current.MainWindow.WindowState = WindowState.Minimized;
break;
default:
break;
}
}
catch (Exception ex)
{
log.Error("窗体控制逻辑异常", ex);
}
}
#endregion
#region 打开软盘
/// <summary>
/// 打开软盘
/// </summary>
public static void OpenOsk()
{
Process proc = new Process();
proc.StartInfo.FileName = @"C:\Windows\System32\osk.exe";
proc.StartInfo.UseShellExecute = true;
proc.StartInfo.Verb = "runas";
proc.Start();
}
#endregion
#region 界面切换
/// <summary>
/// 界面切换
/// </summary>
[RelayCommand]
private void SwitchPages(object obj)
{
string page = obj as string;
switch (page)
{
case "FirstPage":
UserContent = firstPage;
break;
case "RealTimeInventoryPage":
UserContent = realTimeInventoryPage;
break;
case "StatisticsPage":
UserContent = enterWarehouseStatisticsPage;
break;
case "MonitorPage":
UserContent = monitorPage;
break;
default:
break;
}
}
#endregion
#region plc 状态
/// <summary>
/// UI plc 展示状态-文字
/// </summary>
public string _plcUIStatus;
public string PlcUIStatusWb
{
//get { return plcUIStatusWb; }
//set { plcUIStatusWb = value; RaisePropertyChanged("PlcUIStatusWb"); }
get => _plcUIStatus;
set => SetProperty(ref _plcUIStatus, value);
}
/// <summary>
/// UI plc 展示状态-颜色
/// </summary>
public string _plcUIColor;
public string PlcUIColor
{
//get { return plcUIColor; }
//set { plcUIColor = value; RaisePropertyChanged("PlcUIColor"); }
get => _plcUIColor;
set => SetProperty(ref _plcUIColor, value);
}
/// <summary>
/// UI plc 展示状态-图标
/// </summary>
public string _plcUIIcon;
public string PlcUIIcon
{
//get { return plcUIIcon; }
//set { plcUIIcon = value; RaisePropertyChanged("plcUIIcon"); }
get => _plcUIIcon;
set => SetProperty(ref _plcUIIcon, value);
}
/// <summary>
/// PLC连接状态-true:连接成功false:失败
/// </summary>
/// <param name="type"></param>
public void PlcState(bool type)
{
if (type)
{
PlcUIStatusWb = "PLC连接成功";
PlcUIColor = "White";
PlcUIIcon = "Assets/Images/正常.png";
}
else
{
PlcUIStatusWb = "PLC状态异常";
PlcUIColor = "Red";
PlcUIIcon = "Assets/Images/失败-01.png";
}
}
#endregion
}
}

@ -0,0 +1,78 @@
using Aucma.Core.BeforeFoaming.Models;
using CommunityToolkit.Mvvm.ComponentModel;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Aucma.Core.BeforeFoaming.ViewModels
{
public partial class MonitorPageViewModel : ObservableObject
{
public MonitorPageViewModel() { LoadData(); LoadRealTimeData(); }
#region 任务监控 data
#region 加载DataGrid数据
private void LoadData()
{
PlanInfoDataGrid.Add(new OrderInfo() { No = 1, ExecutePlanCode = "8512365486", ProductPlanCode = "8659452123", MaterialName = "SC-AUCMA-农夫山泉SC", PlanAmount = 50, CompleteAmount = 10, BeginTime = "2023-10-07 14:29:33" });
PlanInfoDataGrid.Add(new OrderInfo() { No = 2, ExecutePlanCode = "8512365486", ProductPlanCode = "8659452123", MaterialName = "SC-AUCMA-农夫山泉SC", PlanAmount = 50, CompleteAmount = 10, BeginTime = "2023-10-07 14:29:33" });
PlanInfoDataGrid.Add(new OrderInfo() { No = 3, ExecutePlanCode = "8512365486", ProductPlanCode = "8659452123", MaterialName = "SC-AUCMA-农夫山泉SC", PlanAmount = 50, CompleteAmount = 10, BeginTime = "2023-10-07 14:29:33" });
PlanInfoDataGrid.Add(new OrderInfo() { No = 4, ExecutePlanCode = "8512365486", ProductPlanCode = "8659452123", MaterialName = "SC-AUCMA-农夫山泉SC", PlanAmount = 50, CompleteAmount = 10, BeginTime = "2023-10-07 14:29:33" });
PlanInfoDataGrid.Add(new OrderInfo() { No = 5, ExecutePlanCode = "8512365486", ProductPlanCode = "8659452123", MaterialName = "SC-AUCMA-农夫山泉SC", PlanAmount = 50, CompleteAmount = 10, BeginTime = "2023-10-07 14:29:33" });
PlanInfoDataGrid.Add(new OrderInfo() { No = 6, ExecutePlanCode = "8512365486", ProductPlanCode = "8659452123", MaterialName = "SC-AUCMA-农夫山泉SC", PlanAmount = 50, CompleteAmount = 10, BeginTime = "2023-10-07 14:29:33" });
PlanInfoDataGrid.Add(new OrderInfo() { No = 7, ExecutePlanCode = "8512365486", ProductPlanCode = "8659452123", MaterialName = "SC-AUCMA-农夫山泉SC", PlanAmount = 50, CompleteAmount = 10, BeginTime = "2023-10-07 14:29:33" });
PlanInfoDataGrid.Add(new OrderInfo() { No = 8, ExecutePlanCode = "8512365486", ProductPlanCode = "8659452123", MaterialName = "SC-AUCMA-农夫山泉SC", PlanAmount = 50, CompleteAmount = 10, BeginTime = "2023-10-07 14:29:33" });
PlanInfoDataGrid.Add(new OrderInfo() { No = 9, ExecutePlanCode = "8512365486", ProductPlanCode = "8659452123", MaterialName = "SC-AUCMA-农夫山泉SC", PlanAmount = 50, CompleteAmount = 10, BeginTime = "2023-10-07 14:29:33" });
PlanInfoDataGrid.Add(new OrderInfo() { No = 10, ExecutePlanCode = "8512365486", ProductPlanCode = "8659452123", MaterialName = "SC-AUCMA-农夫山泉SC", PlanAmount = 50, CompleteAmount = 10, BeginTime = "2023-10-07 14:29:33" });
}
#endregion
#region 加载DataGrid数据
private void LoadRealTimeData()
{
RealTimeDataGrid.Add(new OrderInfo() { No = 1, ExecutePlanCode = "8512365486", ProductPlanCode = "8659452123", MaterialName = "SC-AUCMA-农夫山泉SC", PlanAmount = 50, CompleteAmount = 10, BeginTime = "2023-10-07 14:29:33" });
RealTimeDataGrid.Add(new OrderInfo() { No = 2, ExecutePlanCode = "8512365486", ProductPlanCode = "8659452123", MaterialName = "SC-AUCMA-农夫山泉SC", PlanAmount = 50, CompleteAmount = 10, BeginTime = "2023-10-07 14:29:33" });
}
#endregion
#region 初始化datagrid
private ObservableCollection<OrderInfo> planInfoDataGrid = new ObservableCollection<OrderInfo>();
public ObservableCollection<OrderInfo> PlanInfoDataGrid
{
get { return planInfoDataGrid; }
set
{
planInfoDataGrid = value;
OnPropertyChanged();//属性通知
}
}
#endregion
#region 初始化datagrid
private ObservableCollection<OrderInfo> realTimeDataGrid = new ObservableCollection<OrderInfo>();
public ObservableCollection<OrderInfo> RealTimeDataGrid
{
get { return realTimeDataGrid; }
set
{
realTimeDataGrid = value;
OnPropertyChanged();//属性通知
}
}
#endregion
#endregion
}
}

@ -0,0 +1,131 @@
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;
namespace Aucma.Core.BeforeFoaming.ViewModels
{
public partial class RealTimeInventoryPageViewModel : ObservableObject
{
public RealTimeInventoryPageViewModel()
{
LoadMedth();
Thread thread = new Thread(() =>
{
});
thread.Start();
}
private void LoadMedth()
{
for (int i = 6; i >= 1; i--)
{
Shapes.Add(new SpaceDto()
{
spaceCode = i + "#",
spaceStock = i,
onTheWay = i,
totalAmount = i + i,
materialType = "",
inStoreFlag = 1,
outStoreFlag = 2,
unusualFlag = 2,
isFlag = 1,
onlyOne = 1,
spaceType = 1
});
}
}
#region 初始化
private ObservableCollection<SpaceDto> _space = new ObservableCollection<SpaceDto>();
public ObservableCollection<SpaceDto> Shapes
{
get { return _space; }
set
{
_space = value;
OnPropertyChanged();//属性通知
}
}
#endregion
[RelayCommand]
private void Update(object obj)
{
string info = obj as string;
MessageBox.Show("编号:" + info);
}
}
/// <summary>
/// 货道信息
/// </summary>
public class SpaceDto
{
/// <summary>
/// 货道编号
/// </summary>
public string spaceCode { get; set; }
/// <summary>
/// 在库数量
/// </summary>
public int spaceStock { get; set; }
/// <summary>
/// 货道类型
/// </summary>
public int spaceType { get; set; }
/// <summary>
/// 在途数量
/// </summary>
public int onTheWay { get; set; }
/// <summary>
/// 合计数量
/// </summary>
public int totalAmount { get; set; }
/// <summary>
/// 物料型号
/// </summary>
public string materialType { get; set; }
/// <summary>
/// 入库状态
/// </summary>
public int inStoreFlag { get; set; }
/// <summary>
/// 出库状态
/// </summary>
public int outStoreFlag { get; set; }
/// <summary>
/// 异常状态
/// </summary>
public int unusualFlag { get; set; }
/// <summary>
/// 禁用状态
/// </summary>
public int isFlag { get; set; }
/// <summary>
/// 出一个
/// </summary>
public int onlyOne { get; set; }
}
}

@ -0,0 +1,108 @@
<UserControl x:Class="Aucma.Core.BeforeFoaming.Views.EnterWarehouseStatisticsPageView"
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:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:cvt="clr-namespace:Aucma.Core.BeforeFoaming.ConvertTo"
xmlns:local="clr-namespace:Aucma.Core.BeforeFoaming.Views"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<UserControl.Resources>
<cvt:MultiBindingConverter x:Key="QueryConvert"></cvt:MultiBindingConverter>
<Style x:Key="DataGridTextColumnCenterSytle" TargetType="{x:Type TextBlock}">
<Setter Property="VerticalAlignment" Value="Center" />
</Style>
<Style x:Key="ColumnHeaderStyle" TargetType="DataGridColumnHeader">
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="Background" Value="#dddddd"/>
</Style>
</UserControl.Resources>
<Border Grid.Row="1" Grid.Column="1" BorderBrush="#0288d1" BorderThickness="1" CornerRadius="5" Background="Transparent" Margin="5 5 5 5">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="0.8*"/>
<RowDefinition Height="9*"/>
</Grid.RowDefinitions>
<Border Grid.Row="0" BorderBrush="#0288d1" BorderThickness="0,0,0,1" CornerRadius="0" Background="Transparent" Margin="1,1,5,5" >
<TextBlock Text="数据统计" FontSize="20" FontWeight="Bold" Foreground="#0288d1" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<Border Grid.Row="1" BorderBrush="#0288d1" BorderThickness="0" CornerRadius="5" Background="Transparent" Margin="1,1,5,5">
<Grid Margin="10,5">
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="8*"/>
</Grid.RowDefinitions>
<WrapPanel Grid.Row="0" HorizontalAlignment="Left" VerticalAlignment="Center">
<TextBlock Text="开始时间" Margin="10 0" Foreground="Gray" FontSize="15" VerticalAlignment="Center"/>
<DatePicker
x:Name="BeginTime"
Width="200" Margin="10 0" Text="2023-10-09"
materialDesign:CalendarAssist.IsHeaderVisible="False"
materialDesign:HintAssist.Hint="开始日期">
<DatePicker.SelectedDate>
<Binding
Path="FutureValidatingDate"
UpdateSourceTrigger="PropertyChanged">
<Binding.ValidationRules>
</Binding.ValidationRules>
</Binding>
</DatePicker.SelectedDate>
</DatePicker>
<TextBlock Text="结束时间" Margin="10 0" Foreground="Gray" FontSize="15" VerticalAlignment="Center"/>
<DatePicker
x:Name="EndTime" Margin="10 0" Text="2023-10-09"
Width="200"
materialDesign:CalendarAssist.IsHeaderVisible="False"
materialDesign:HintAssist.Hint="结束日期">
<DatePicker.SelectedDate>
<Binding
Path="FutureValidatingDate"
UpdateSourceTrigger="PropertyChanged">
<Binding.ValidationRules>
</Binding.ValidationRules>
</Binding>
</DatePicker.SelectedDate>
</DatePicker>
<Button Margin="10 0"
Content="查询" Command="{Binding ExecQueryCommand}"
IsEnabled="{Binding DataContext.ControlsEnabled, RelativeSource={RelativeSource FindAncestor, AncestorType=Window}}"
Style="{StaticResource MaterialDesignRaisedSecondaryDarkButton}"
ToolTip="Resource name: MaterialDesignRaisedSecondaryDarkButton">
<Button.CommandParameter>
<MultiBinding Converter="{StaticResource QueryConvert}">
<Binding ElementName="BeginTime" Path="Text"/>
<Binding ElementName="EndTime" Path="Text"/>
</MultiBinding>
</Button.CommandParameter>
</Button>
</WrapPanel>
<UniformGrid Grid.Row="1">
<DataGrid Grid.Row="0" ItemsSource="{Binding MaterialDataGrid}" Background="#00000000"
ColumnHeaderHeight="35"
RowHeight="50" AutoGenerateColumns="False" RowHeaderWidth="0"
GridLinesVisibility="None" ScrollViewer.HorizontalScrollBarVisibility="Hidden"
ScrollViewer.VerticalScrollBarVisibility="Hidden" BorderThickness="0" CanUserAddRows="False" SelectionMode="Single" IsReadOnly="True"
Foreground="Gray" >
<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding No}" Header="序号" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding ProductPlanCode}" Header="计划编号" Width="1*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding MaterialBarCode}" Header="物料条码" Width="1*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding MaterialCode}" Header="物料编号" Width="1*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding MaterialName}" Header="产品型号" Width="3*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding PlanAmount}" Header="货道" Width="*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding EnterWarehouseTime ,StringFormat=\{0:MM月dd日 HH:mm\}}" Header="入库时间" Width="1.5*" />
</DataGrid.Columns>
</DataGrid>
</UniformGrid>
</Grid>
</Border>
</Grid>
</Border>
</UserControl>

@ -0,0 +1,30 @@
using Aucma.Core.BeforeFoaming.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace Aucma.Core.BeforeFoaming.Views
{
/// <summary>
/// EnterWarehouseStatisticsPageView.xaml 的交互逻辑
/// </summary>
public partial class EnterWarehouseStatisticsPageView : UserControl
{
public EnterWarehouseStatisticsPageView()
{
InitializeComponent();
this.DataContext = new EnterWarehouseStatisticsPageViewModel();
}
}
}

@ -0,0 +1,165 @@
<UserControl x:Class="Aucma.Core.BeforeFoaming.Views.IndexPageView"
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:lvc="clr-namespace:LiveChartsCore.SkiaSharpView.WPF;assembly=LiveChartsCore.SkiaSharpView.WPF"
xmlns:local="clr-namespace:Aucma.Core.BeforeFoaming.Views"
mc:Ignorable="d"
d:DesignHeight="800"
d:DesignWidth="1000" >
<UserControl.Resources>
<Style x:Key="DataGridTextColumnCenterSytle" TargetType="{x:Type TextBlock}">
<Setter Property="VerticalAlignment" Value="Center" />
</Style>
<Style x:Key="ColumnHeaderStyle" TargetType="DataGridColumnHeader">
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="Background" Value="#dddddd"/>
</Style>
</UserControl.Resources>
<Grid Margin="1 5 1 0">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<!--扫描信息-->
<Border Grid.Row="0" Grid.Column="0" BorderBrush="#0288d1" BorderThickness="1" CornerRadius="5" Background="Transparent" Margin="3,1,5,5">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="9*"/>
</Grid.RowDefinitions>
<Border Grid.Row="0" BorderBrush="#0288d1" BorderThickness="0,0,0,1" CornerRadius="0" Background="Transparent" Margin="1,1,3,5" >
<TextBlock Text="扫描信息" FontSize="20" FontWeight="Bold" Foreground="#0288d1" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<!--扫描信息-->
<Border Grid.Row="1" BorderBrush="#0288d1" BorderThickness="0" CornerRadius="5" Background="Transparent" Margin="1,1,3,5">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.5*"/>
<ColumnDefinition Width="6*"/>
<ColumnDefinition Width="0.5*"/>
</Grid.ColumnDefinitions>
<Border Grid.Column="0" BorderThickness="0" Background="Transparent" CornerRadius="5" >
</Border>
<Border Grid.Column="1" BorderThickness="0" Background="Transparent" CornerRadius="5" Margin="0,5,0,0">
<Grid>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<StackPanel Grid.Row="0" Grid.Column="0" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center" >
<TextBlock Text="物料条码" FontSize="15" Foreground="Gray" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="0 0 30 0"/>
<TextBox FontSize="15" Text="{Binding MaterialBarCode,Mode=TwoWay}" Foreground="Gray" Width="200" IsReadOnly="True" Margin="0 0 10 0" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" />
<TextBox FontSize="15" Text="{Binding BeginTime,Mode=TwoWay}" Foreground="Gray" Width="200" IsReadOnly="True" Margin="10 0 0 0" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"/>
</StackPanel>
<StackPanel Grid.Row="1" Grid.Column="0" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center" >
<TextBlock Text="物料编码" FontSize="15" Foreground="Gray" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="0 0 30 0"/>
<TextBox FontSize="15" Text="{Binding MaterialCode,Mode=TwoWay}" Foreground="Gray" Width="420" IsReadOnly="True" Margin="0 0 5 0" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" />
</StackPanel>
<StackPanel Grid.Row="2" Grid.Column="0" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center" >
<TextBlock Text="物料名称" FontSize="15" Foreground="Gray" HorizontalAlignment="Left"/>
<TextBox FontSize="15" Text="{Binding MaterialName,Mode=TwoWay}" Foreground="Gray" Width="420" IsReadOnly="True" Margin="30,0,0,0" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"/>
</StackPanel>
<StackPanel Grid.Row="3" Grid.Column="0" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center" >
<TextBlock Text="目的信息" FontSize="15" Foreground="Gray"/>
<TextBox FontSize="15" Text="{Binding Destination,Mode=TwoWay}" Foreground="Gray" Width="420" IsReadOnly="True" Margin="30,0,0,0" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"/>
</StackPanel>
<StackPanel Grid.Row="4" Grid.RowSpan="2" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center" >
<TextBlock Text="提示信息" FontSize="15" Foreground="Gray"/>
<TextBox FontSize="15"
MinHeight="70" MaxHeight="100" MinWidth="420" IsReadOnly="True" Foreground="Gray"
VerticalAlignment="Top" Margin="30 0 0 0" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"
AcceptsReturn="True" Text="{Binding Prompt,Mode=TwoWay}"
IsEnabled="{Binding Path=IsChecked, ElementName=MaterialDesignOutlinedTextBoxEnabledComboBox}"
Style="{StaticResource MaterialDesignOutlinedTextBox}"
TextWrapping="Wrap"
VerticalScrollBarVisibility="Auto" />
</StackPanel>
</Grid>
</Border>
</Grid>
</Border>
</Grid>
</Border>
<!--日志信息-->
<Border Grid.Row="0" Grid.Column="1" BorderBrush="#0288d1" BorderThickness="1" CornerRadius="5" Background="Transparent" Margin="3,1,3,5">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="9*"/>
</Grid.RowDefinitions>
<Border Grid.Row="0" BorderBrush="#0288d1" BorderThickness="0,0,0,1" CornerRadius="0" Background="Transparent" Margin="1,1,1,5" >
<TextBlock Text="日志信息" FontSize="20" FontWeight="Bold" Foreground="#0288d1" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<!--日志信息-->
<Border x:Name="HeightHelperPanel" Grid.Row="1" BorderBrush="#0288d1" BorderThickness="0" CornerRadius="5" Background="Transparent" Margin="25,1,5,5">
<ListBox MinHeight="60"
Height="{Binding Path=ActualHeight, ElementName=HeightHelperPanel}" x:Name="listBox" ItemsSource="{Binding LogInfoListBox}" Foreground="Gray" Background="Transparent" BorderBrush="Transparent" ScrollViewer.HorizontalScrollBarVisibility="Hidden" ScrollViewer.VerticalScrollBarVisibility="Hidden"/>
</Border>
</Grid>
</Border>
<!--扫描记录-->
<Border Grid.Row="1" Grid.ColumnSpan="2" BorderBrush="#0288d1" BorderThickness="1" CornerRadius="5" Background="Transparent" Margin="3,1,3,5">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="9*"/>
</Grid.RowDefinitions>
<Border Grid.Row="0" BorderBrush="#0288d1" BorderThickness="0,0,0,1" CornerRadius="0" Background="Transparent" Margin="1,1,5,5" >
<TextBlock Text="扫描记录" FontSize="20" FontWeight="Bold" Foreground="#0288d1" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<!--计划列表-->
<Border x:Name="ScanPanel" Grid.Row="1" Grid.Column="0" BorderBrush="#0288d1" BorderThickness="0" CornerRadius="5" Background="Transparent" Margin="1,1,5,5">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<DataGrid Grid.Row="0" ItemsSource="{Binding PlanInfoDataGrid}" Background="#00000000"
ColumnHeaderHeight="35" Height="{Binding Path=ActualHeight, ElementName=ScanPanel}"
RowHeight="50" AutoGenerateColumns="False" RowHeaderWidth="0"
GridLinesVisibility="None" ScrollViewer.HorizontalScrollBarVisibility="Auto"
ScrollViewer.VerticalScrollBarVisibility="Auto" BorderThickness="0" CanUserAddRows="False" SelectionMode="Single" IsReadOnly="True"
Foreground="Gray" >
<!--修改选中字体颜色-->
<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding No}" Header="编号" Width="auto" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}" Visibility="Collapsed"/>
<DataGridTextColumn Binding="{Binding PlanCode}" Header="计划编号" Width="1*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding MaterialBarCode}" Header="物料条码" Width="1*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding MaterialCode}" Header="物料编码" Width="1*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}" />
<DataGridTextColumn Binding="{Binding MaterialName}" Header="产品型号" Width="2*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}" />
<DataGridTextColumn Binding="{Binding EnterSpace}" Header="入库货道" Width="*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding ExecDateTime ,StringFormat=\{0:MM-dd HH:mm\}}" Header="执行时间" Width="1.5*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding Status}" Header="状态" Width="*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<!--<DataGridTextColumn Binding="{Binding CompleteAmount}" Header="设备号" Width="*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>-->
</DataGrid.Columns>
</DataGrid>
</Grid>
</Border>
</Grid>
</Border>
</Grid>
</UserControl>

@ -0,0 +1,32 @@
using Aucma.Core.BeforeFoaming.Common;
using Aucma.Core.BeforeFoaming.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace Aucma.Core.BeforeFoaming.Views
{
/// <summary>
/// IndexPageView.xaml 的交互逻辑
/// </summary>
public partial class IndexPageView : UserControl
{
public IndexPageView()
{
InitializeComponent();
this.DataContext = new IndexPageViewModel();
}
}
}

@ -0,0 +1,100 @@
<Window x:Class="Aucma.Core.BeforeFoaming.Views.MainWindow"
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:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
mc:Ignorable="d"
Background="#ffffff"
Title="澳柯玛生产控制系统"
MinHeight="700" MinWidth="1300" WindowState="Maximized"
WindowStartupLocation="CenterScreen"
>
<Border CornerRadius="5" >
<Border.Effect>
<DropShadowEffect Color="Gray" ShadowDepth="0" BlurRadius="5" Opacity="0.3" Direction="0"></DropShadowEffect>
</Border.Effect>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="6*"/>
<RowDefinition Height="auto"/>
</Grid.RowDefinitions>
<DockPanel Grid.Row="0">
<materialDesign:ColorZone Padding="15 10 0 0"
materialDesign:ElevationAssist.Elevation="Dp4"
DockPanel.Dock="Top"
Mode="PrimaryMid">
<DockPanel Height="60" >
<Image Height="46" VerticalAlignment="Top" Source="/Assets/Images/Newlog.png" />
<StackPanel Height="50" Margin="15 0 0 0" >
<StackPanel Orientation="Horizontal" >
<TextBlock Text="澳柯玛生产控制系统" Foreground="White" FontSize="30" HorizontalAlignment="Center" VerticalAlignment="Center" />
</StackPanel>
</StackPanel>
<!--右侧信息-->
<DockPanel HorizontalAlignment="Right" VerticalAlignment="Stretch">
<TextBlock x:Name="TestTB" Text="白班" VerticalAlignment="Center" Foreground="White" FontSize="15" Margin="10,0"/>
<TextBlock Text="|" VerticalAlignment="Center" Foreground="White" FontSize="15" Margin="10,0"/>
<TextBlock x:Name="loginUser" Text="李四" VerticalAlignment="Center" Foreground="White" FontSize="15" Margin="10,0"/>
</DockPanel>
</DockPanel>
</materialDesign:ColorZone>
</DockPanel>
<DockPanel Grid.Row="1">
<!--<ScrollViewer x:Name="MainScrollViewer"
materialDesign:ScrollViewerAssist.IsAutoHideEnabled="True">-->
<ContentControl Content="{Binding UserContent}" Height="auto" />
<!--</ScrollViewer>-->
</DockPanel>
<DockPanel Grid.Row="2" Margin="5 0 5 3">
<Border BorderBrush="#0288d1" BorderThickness="1" CornerRadius="5" HorizontalAlignment="Stretch" VerticalAlignment="Bottom">
<Grid>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<StackPanel Grid.Row="1" Height="50" Orientation="Horizontal" Margin="5 0" HorizontalAlignment="Left">
<Button Content="实时监控" x:Name="FirstPage" Command="{Binding SwitchPagesCommand}" CommandParameter="{Binding Name,ElementName=FirstPage}" Margin="5 0" />
<Button Content="实时库存" x:Name="RealTimeInventoryPage" Margin="5 0" Command="{Binding SwitchPagesCommand}" CommandParameter="{Binding Name,ElementName=RealTimeInventoryPage}" />
<!--<Button Content="任务监控" x:Name="MonitorPage" Margin="5 0" Command="{Binding SwitchPagesCommand}" CommandParameter="{Binding Name,ElementName=MonitorPage}" />-->
<Button Content="入库统计" x:Name="StatisticsPage" Margin="5 0" Command="{Binding SwitchPagesCommand}" CommandParameter="{Binding Name,ElementName=StatisticsPage}" />
<Button Content="键盘" x:Name="TabTip" Margin="5 0" Command="{Binding FormControlCommand}" CommandParameter="{Binding Name,ElementName=TabTip}" />
<Button Content="最小化" x:Name="Minimized" Command="{Binding FormControlCommand}" CommandParameter="{Binding Name,ElementName=Minimized}" Width="100" Height="30" Background="#FF9900" BorderBrush="#FF9900" Margin="0,0,10,0"/>
<Button Content="退 出" x:Name="Exit" Command="{Binding FormControlCommand}" CommandParameter="{Binding Name,ElementName=Exit}" Width="100" Height="30" Background="#FF0033" BorderBrush="#FF0033" Margin="0,0,10,0"/>
</StackPanel>
<StackPanel Grid.Row="2" Height="50" Orientation="Horizontal" HorizontalAlignment="Right">
<Border Width="30" Height="30" CornerRadius="15">
<Border.Background>
<ImageBrush x:Name="PlcStatus" ImageSource="/Assets/Images/Green.png"/>
</Border.Background>
</Border>
<TextBlock x:Name="PLCState" Text="PLC连接成功" VerticalAlignment="Center" Foreground="Green" FontSize="15" Margin="10,0"/>
<Border Width="30" Height="30" CornerRadius="15">
<Border.Background>
<ImageBrush x:Name="PlcStatusImage" ImageSource="/Assets/Images/Green.png"/>
</Border.Background>
</Border>
<TextBlock x:Name="DB" Text="数据库连接成功" VerticalAlignment="Center" Foreground="Green" FontSize="15" Margin="10,0"/>
<Border Width="30" Height="30" CornerRadius="15">
<Border.Background>
<ImageBrush x:Name="BarCodeStatus" ImageSource="/Assets/Images/Green.png"/>
</Border.Background>
</Border>
<TextBlock x:Name="BarCodeStatusTxt" Text="扫描器连接成功" VerticalAlignment="Center" Foreground="Green" FontSize="15" Margin="10,0"/>
</StackPanel>
</Grid>
</Border>
</DockPanel>
</Grid>
</Border>
</Window>

@ -0,0 +1,17 @@
using Aucma.Core.BeforeFoaming.ViewModels;
using System.Windows;
namespace Aucma.Core.BeforeFoaming.Views
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
this.DataContext = new MainWindowViewModel();
}
}
}

@ -0,0 +1,69 @@
<UserControl x:Class="Aucma.Core.BeforeFoaming.Views.MonitorPageView"
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.BeforeFoaming.Views"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<UserControl.Resources>
<Style x:Key="DataGridTextColumnCenterSytle" TargetType="{x:Type TextBlock}">
<Setter Property="VerticalAlignment" Value="Center" />
</Style>
<Style x:Key="ColumnHeaderStyle" TargetType="DataGridColumnHeader">
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="Background" Value="#dddddd"/>
</Style>
</UserControl.Resources>
<Grid Margin="5">
<Grid.RowDefinitions>
<RowDefinition Height="0.2*"/>
<RowDefinition/>
<RowDefinition Height="2*"/>
</Grid.RowDefinitions>
<UniformGrid Grid.Row="0">
<Button Width="100"
Content="叫号出库"
IsEnabled="{Binding DataContext.ControlsEnabled, RelativeSource={RelativeSource FindAncestor, AncestorType=Window}}"
Style="{StaticResource MaterialDesignRaisedButton}" />
</UniformGrid>
<UniformGrid Grid.Row="1" Margin="5">
<DataGrid Grid.Row="0" ItemsSource="{Binding RealTimeDataGrid}" Background="#00000000"
ColumnHeaderHeight="35"
RowHeight="50" AutoGenerateColumns="False" RowHeaderWidth="0"
GridLinesVisibility="None" ScrollViewer.HorizontalScrollBarVisibility="Hidden"
ScrollViewer.VerticalScrollBarVisibility="Hidden" BorderThickness="0" CanUserAddRows="False" SelectionMode="Single" IsReadOnly="True"
Foreground="Gray" >
<!--修改选中字体颜色-->
<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding No}" Header="编号" Width="*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding ExecutePlanCode}" Header="任务编码" Width="1*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding ProductPlanCode}" Header="物料编码" Width="1*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}" />
<DataGridTextColumn Binding="{Binding MaterialName}" Header="物料型号" Width="2*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}" />
<DataGridTextColumn Binding="{Binding PlanAmount}" Header="流水号" Width="*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding BeginTime ,StringFormat=\{0:MM月dd日 HH:mm\}}" Header="执行时间" Width="1.5*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding CompleteAmount}" Header="设备号" Width="*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
</DataGrid.Columns>
</DataGrid>
</UniformGrid>
<UniformGrid Grid.Row="2" Margin="5 20 5 5">
<DataGrid Grid.Row="0" ItemsSource="{Binding PlanInfoDataGrid}" Background="#00000000"
ColumnHeaderHeight="35" HeadersVisibility="None"
RowHeight="50" AutoGenerateColumns="False" RowHeaderWidth="0"
GridLinesVisibility="None" ScrollViewer.HorizontalScrollBarVisibility="Hidden"
ScrollViewer.VerticalScrollBarVisibility="Hidden" BorderThickness="0" CanUserAddRows="False" SelectionMode="Single" IsReadOnly="True"
Foreground="Gray" >
<!--修改选中字体颜色-->
<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding No}" Header="编号" Width="*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding ExecutePlanCode}" Header="任务编码" Width="1*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding ProductPlanCode}" Header="物料编码" Width="1*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}" />
<DataGridTextColumn Binding="{Binding MaterialName}" Header="物料型号" Width="2*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}" />
<DataGridTextColumn Binding="{Binding PlanAmount}" Header="流水号" Width="*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding BeginTime ,StringFormat=\{0:MM月dd日 HH:mm\}}" Header="执行时间" Width="1.5*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding CompleteAmount}" Header="设备号" Width="*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
</DataGrid.Columns>
</DataGrid>
</UniformGrid>
</Grid>
</UserControl>

@ -0,0 +1,30 @@
using Aucma.Core.BeforeFoaming.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace Aucma.Core.BeforeFoaming.Views
{
/// <summary>
/// MonitorPageView.xaml 的交互逻辑
/// </summary>
public partial class MonitorPageView : UserControl
{
public MonitorPageView()
{
InitializeComponent();
this.DataContext = new MonitorPageViewModel();
}
}
}

@ -0,0 +1,155 @@
<UserControl
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:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:local="clr-namespace:Aucma.Core.BeforeFoaming.Views"
xmlns:UserPage="clr-namespace:Aucma.Core.BeforeFoaming.UserPage" x:Class="Aucma.Core.BeforeFoaming.Views.RealTimeInventoryPageView"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="0.1*"/>
<RowDefinition/>
</Grid.RowDefinitions>
<WrapPanel Grid.Row="0" Margin="10 5 0 0" HorizontalAlignment="Left" VerticalAlignment="Center" >
<Button Content="泡前库" Style="{StaticResource MaterialDesignRaisedButton}" Width="100" Margin="5"/>
<Button Content="泡后库" Style="{StaticResource MaterialDesignRaisedButton}" Width="100"/>
</WrapPanel>
<StackPanel Grid.Row="1">
<ItemsControl ItemsSource="{Binding Shapes}" VerticalAlignment="Center" HorizontalAlignment="Center" >
<ItemsControl.ItemsPanel>
<!--布局-->
<ItemsPanelTemplate>
<WrapPanel Orientation="Horizontal"></WrapPanel>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<!--控件模板-->
<ItemsControl.ItemTemplate>
<DataTemplate>
<Control x:Name="ctrl" MinWidth="450" MinHeight="160" ></Control>
<DataTemplate.Triggers>
<!--根据不同类型选择不同模板-->
<DataTrigger Binding="{Binding spaceType}" Value="1">
<!--矩形-->
<Setter Property="Template" TargetName="ctrl">
<Setter.Value>
<ControlTemplate >
<Border Margin="5,5" Background="#0288d1" BorderBrush="White" BorderThickness="2" >
<Grid Margin="3,3">
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border Grid.Row="0">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Border Grid.Column="0" BorderBrush="White" BorderThickness="1">
<TextBlock Text="{Binding spaceCode}" FontSize="18" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<Border Grid.Column="1" BorderBrush="White" BorderThickness="1">
<TextBlock Text="在库" FontSize="18" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<Border Grid.Column="2" BorderBrush="White" BorderThickness="1">
<TextBlock Text="{Binding spaceStock}" FontSize="18" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<Border Grid.Column="3" BorderBrush="White" BorderThickness="1">
<TextBlock Text="在途" FontSize="18" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<Border Grid.Column="4" BorderBrush="White" BorderThickness="1">
<TextBlock Text="{Binding onTheWay}" FontSize="18" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<Border Grid.Column="5" BorderBrush="White" BorderThickness="1">
<TextBlock Text="合计" FontSize="18" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<Border Grid.Column="6" BorderBrush="White" BorderThickness="1">
<TextBlock Text="{Binding totalAmount}" FontSize="18" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
</Grid>
</Border>
<Border Grid.Row="1">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="6*"/>
</Grid.ColumnDefinitions>
<Border Grid.Column="0" BorderBrush="White" BorderThickness="1">
<TextBlock Text="型号" FontSize="18" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<Border Grid.Column="1" BorderBrush="White" BorderThickness="1">
<TextBlock Text="8307501015SC-349雪王爱喝水" FontSize="16" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
</Grid>
</Border>
<Border Grid.Row="2">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Border Grid.Column="0" BorderBrush="White" BorderThickness="1" >
<TextBlock Text="状态" FontSize="18" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<Border Grid.Column="1" BorderBrush="White" BorderThickness="1">
<Button Command="{Binding DataContext.UpdateCommand, RelativeSource={RelativeSource AncestorType=ItemsControl}}" CommandParameter="{Binding spaceCode}" Style="{x:Null}" BorderBrush="Transparent" BorderThickness="0" Background="Transparent">
<TextBlock Text="入库" Foreground="{Binding inStoreFlag}" FontSize="18" FontWeight="Bold" VerticalAlignment="Center" HorizontalAlignment="Center" />
</Button>
</Border>
<Border Grid.Column="2" BorderBrush="White" BorderThickness="1">
<Button Command="{Binding DataContext.UpdateCommand, RelativeSource={RelativeSource AncestorType=ItemsControl}}" CommandParameter="{Binding spaceCode}" Style="{x:Null}" BorderBrush="Transparent" BorderThickness="0" Background="Transparent">
<TextBlock Text="出库" Foreground="{Binding outStoreFlag}" FontSize="18" FontWeight="Bold" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Button>
</Border>
<Border Grid.Column="3" BorderBrush="White" BorderThickness="1">
<Button Command="{Binding DataContext.UpdateCommand, RelativeSource={RelativeSource AncestorType=ItemsControl}}" CommandParameter="{Binding spaceCode}" Style="{x:Null}" BorderBrush="Transparent" BorderThickness="0" Background="Transparent">
<TextBlock Text="异常" Foreground="{Binding unusualFlag}" FontSize="18" FontWeight="Bold" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Button>
</Border>
<Border Grid.Column="4" BorderBrush="White" BorderThickness="1">
<Button Command="{Binding DataContext.UpdateCommand, RelativeSource={RelativeSource AncestorType=ItemsControl}}" CommandParameter="{Binding spaceCode}" Style="{x:Null}" BorderBrush="Transparent" BorderThickness="0" Background="Transparent">
<TextBlock Text="禁用" Foreground="{Binding isFlag}" FontSize="18" FontWeight="Bold" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Button>
</Border>
<Border Grid.Column="5" BorderBrush="White" BorderThickness="1">
<Button Command="{Binding DataContext.UpdateCommand, RelativeSource={RelativeSource AncestorType=ItemsControl}}" CommandParameter="{Binding spaceCode}" Style="{x:Null}" BorderBrush="Transparent" BorderThickness="0" Background="Transparent">
<TextBlock Text="明细" FontSize="18" Foreground="Green" FontWeight="Bold" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Button>
</Border>
<Border Grid.Column="6" BorderBrush="White" BorderThickness="1">
<Button Command="{Binding DataContext.UpdateCommand, RelativeSource={RelativeSource AncestorType=ItemsControl}}" CommandParameter="{Binding spaceCode}" Style="{x:Null}" BorderBrush="Transparent" BorderThickness="0" Background="Transparent">
<TextBlock Text="出一个" Foreground="{Binding onlyOne}" FontSize="17" FontWeight="Bold" VerticalAlignment="Center" HorizontalAlignment="Center" />
</Button>
</Border>
</Grid>
</Border>
</Grid>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</DataTrigger>
</DataTemplate.Triggers>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</StackPanel>
</Grid>
</UserControl>

@ -0,0 +1,30 @@
using Aucma.Core.BeforeFoaming.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace Aucma.Core.BeforeFoaming.Views
{
/// <summary>
/// RealTimeInventoryPageView.xaml 的交互逻辑
/// </summary>
public partial class RealTimeInventoryPageView : UserControl
{
public RealTimeInventoryPageView()
{
InitializeComponent();
this.DataContext = new RealTimeInventoryPageViewModel();
}
}
}

@ -0,0 +1,116 @@
<UserControl x:Class="Aucma.Core.BeforeFoaming.UserPage.SpaceInfoControl"
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.BeforeFoaming.UserPage"
mc:Ignorable="d"
d:DesignHeight="200" d:DesignWidth="400">
<Border Margin="5,5" Background="#0288d1" BorderBrush="#0288d1" BorderThickness="2" CornerRadius="10">
<Grid Margin="3,3">
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border Grid.Row="0">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Border Grid.Column="0" BorderBrush="White" BorderThickness="1">
<TextBlock Text="{Binding spaceCode}" FontSize="18" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<Border Grid.Column="1" BorderBrush="White" BorderThickness="1">
<TextBlock Text="在库" FontSize="18" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<Border Grid.Column="2" BorderBrush="White" BorderThickness="1">
<TextBlock Text="{Binding spaceStock}" FontSize="18" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<Border Grid.Column="3" BorderBrush="White" BorderThickness="1">
<TextBlock Text="在途" FontSize="18" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<Border Grid.Column="4" BorderBrush="White" BorderThickness="1">
<TextBlock Text="{Binding onTheWay}" FontSize="18" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<Border Grid.Column="5" BorderBrush="White" BorderThickness="1">
<TextBlock Text="合计" FontSize="18" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<Border Grid.Column="6" BorderBrush="White" BorderThickness="1">
<TextBlock Text="{Binding totalAmount}" FontSize="18" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
</Grid>
</Border>
<Border Grid.Row="1">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="6*"/>
</Grid.ColumnDefinitions>
<Border Grid.Column="0" BorderBrush="White" BorderThickness="1">
<TextBlock Text="型号" FontSize="18" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<Border Grid.Column="1" BorderBrush="White" BorderThickness="1">
<TextBlock Text="8307501015SC-349雪王爱喝水" FontSize="16" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
</Grid>
</Border>
<Border Grid.Row="2">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Border Grid.Column="0" BorderBrush="White" BorderThickness="1" >
<TextBlock Text="状态" FontSize="18" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<Border Grid.Column="1" BorderBrush="White" BorderThickness="1">
<TextBlock Text="{Binding inStoreFlag}" FontSize="18" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="Green"/>
<Setter Property="Text" Value="入库"/>
<Style.Triggers>
<Trigger Property="Text" Value="2">
<Setter Property="Foreground" Value="Red"></Setter>
</Trigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
</Border>
<Border Grid.Column="2" BorderBrush="White" BorderThickness="1">
<TextBlock Text="{Binding outStoreFlag}" FontSize="18" Foreground="Red" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<Border Grid.Column="3" BorderBrush="White" BorderThickness="1">
<TextBlock Text="{Binding unusualFlag}" FontSize="18" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<Border Grid.Column="4" BorderBrush="White" BorderThickness="1">
<TextBlock Text="{Binding isFlag}" FontSize="18" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<Border Grid.Column="5" BorderBrush="White" BorderThickness="1">
<TextBlock Text="明细" FontSize="18" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<Border Grid.Column="6" BorderBrush="White" BorderThickness="1">
<Button Command="{Binding DataContext.UpdateCommand, RelativeSource={RelativeSource AncestorType=ItemsControl}}" CommandParameter="{Binding spaceCode}" Style="{StaticResource BUTTON_AGREE}">
<TextBlock Text="{Binding onlyOne}" FontSize="18" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center" />
</Button>
</Border>
</Grid>
</Border>
</Grid>
</Border>
</UserControl>

@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace Aucma.Core.BeforeFoaming.UserPage
{
/// <summary>
/// SpaceInfoControl.xaml 的交互逻辑
/// </summary>
public partial class SpaceInfoControl : UserControl
{
public SpaceInfoControl()
{
InitializeComponent();
}
}
}

@ -0,0 +1,263 @@
{
"AllowedHosts": "*",
"Logging": {
"LogLevel": {
"Default": "Information", //Defaultlog4net
"Admin.Core.Extensions.ApiResponseHandler": "Error"
},
"Debug": {
"LogLevel": {
"Default": "Warning"
}
},
"Console": {
"LogLevel": {
"Default": "Warning",
"Microsoft.Hosting.Lifetime": "Debug"
}
},
"Log4Net": {
"Name": "Admin.Core"
}
},
"AppSettings": {
"RedisCachingAOP": {
"Enabled": false,
"ConnectionString": ""
},
"MemoryCachingAOP": {
"Enabled": false
},
"LogAOP": {
"Enabled": false
},
"TranAOP": {
"Enabled": false
},
"SqlAOP": {
"Enabled": false,
"OutToLogFile": {
"Enabled": false
},
"OutToConsole": {
"Enabled": false
}
},
"FileRootPath": "/file/",
"Date": "2018-08-28",
"Author": "Admin.Core",
"UseLoadTest": true,
"CacheTimeOut": 60, //
"ApiRoot": "http://localhost:55014"
},
"Audience": {
"Secret": "dk6Vv3oTuo2OMU18w86E3j11DtM7RUX5icQtA0DCKuhYDRUqBLIiL", //16+
"SecretFile": "E:\\my-file\\admin.core.audience.secret.txt", //Secret
"Issuer": "Admin.Core",
"Audience": "wr",
"Expiration": "6000000" //
},
// MainDBConnId,Enabledtrue
// *** MutiDBEnabled false ***
// *** MutiDBEnabled trueEnabledtrue **
// https://www.bilibili.com/video/BV1BJ411B7mn?p=6
"MainDB": "AUCMA_SCADA", //Enabledtrue
"MutiDBEnabled": true, //
"CQRSEnabled": false, //SqlServer
"DBS": [
/*
DBType
MySql = 0,
SqlServer = 1,
Sqlite = 2,
Oracle = 3,
PostgreSQL = 4,
Dm = 5,//
Kdbndp = 6,//
*/
{
"ConnId": "AUCMA_SCADA",
"DBType": 3,
"Enabled": true,
"HitRate": 50,
//"Connection": "Data Source=localhost;Initial Catalog=Hsdb;User ID=sa;Password=sa;Integrated Security=false;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
"Connection": "Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=175.27.215.92)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=helowin)));User ID=aucma_scada;Password=aucma;",
"ProviderName": "System.Data.SqlClient"
},
{
"ConnId": "AUCMA_MES",
"DBType": 3,
"Enabled": true,
"HitRate": 40,
"Connection": "Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=175.27.215.92)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=helowin)));User ID=aucma_mes;Password=aucma;",
"ProviderName": "System.Data.SqlClient"
}
],
"QuartzNetJob": [
{
"ID": 1,
"Name": "TestTask",
"JobGroup": "DEFAULT",
"Cron": "*/1 * * * * ?",
"AssemblyName": "Admin.Core.Tasks",
"ClassName": "Job_Admin_Quartz",
"Remark": "执行任务调度系统",
"RunTimes": 3881,
"BeginTime": "2023-04-23 11:08:50.000",
"EndTime": "2324-08-06 16:45:30.000",
"TriggerType": 1,
"IntervalSecond": 1,
"CycleRunTimes": 1,
"IsStart": true,
"JobParams": null,
"DelFlag": false,
"CreateBy": "admin",
"CreateTime": "2023-04-23 11:09:22.0000000",
"UpdateBy": "admin",
"UpdateTime": "2023-08-07 16:45:45.0530000"
},
{
"ID": 2,
"Name": "TestTask",
"JobGroup": "DEFAULT",
"Cron": "*/1 * * * * ?",
"AssemblyName": "Admin.Core.Tasks",
"ClassName": "Job_TestTask_Quartz",
"Remark": "执行任务调度系统",
"RunTimes": 3881,
"BeginTime": "2023-04-23 11:08:50.000",
"EndTime": "2324-08-06 16:45:30.000",
"TriggerType": 1,
"IntervalSecond": 1,
"CycleRunTimes": 1,
"IsStart": true,
"JobParams": null,
"DelFlag": false,
"CreateBy": "admin",
"CreateTime": "2023-04-23 11:09:22.0000000",
"UpdateBy": "admin",
"UpdateTime": "2023-08-07 16:45:45.0530000"
},
{
"ID": 3,
"Name": "PQInStoreTask",
"JobGroup": "DEFAULT",
"Cron": "*/15 * * * * ?",
"AssemblyName": "Admin.Core.Tasks",
"ClassName": "Job_PQInStoreTask_Quartz",
"Remark": "泡前库入库调度任务",
"RunTimes": 3881,
"BeginTime": "2023-04-23 11:08:50.000",
"EndTime": "2324-08-06 16:45:30.000",
"TriggerType": 1,
"IntervalSecond": 1,
"CycleRunTimes": 1,
"IsStart": true,
"JobParams": null,
"DelFlag": false,
"CreateBy": "admin",
"CreateTime": "2023-04-23 11:09:22.0000000",
"UpdateBy": "admin",
"UpdateTime": "2023-08-07 16:45:45.0530000"
}
],
"StoreInfo": {
"StoreCode": "PBSCK-001"
},
"Startup": {
"Cors": {
"PolicyName": "CorsIpAccess", //
"EnableAllIPs": true, //trueIP访
// /localhost:8000/
// http://127.0.0.1:1818 http://localhost:1818
"IPs": "http://localhost:81,http://127.0.0.1:81"
},
"AppConfigAlert": {
"Enabled": true
},
"ApiName": "Admin.Core",
"IdentityServer4": {
"Enabled": false, // false使jwttrue使Ids4
"AuthorizationUrl": "http://localhost:5004", //
"ApiName": "admin.core.api" //
},
"RedisMq": {
"Enabled": false //redis
},
"MiniProfiler": {
"Enabled": false //
},
"Nacos": {
"Enabled": false //Nacos
}
},
"Redis": {
//"ConnectionString": "127.0.0.1:6379"
"ConnectionString": "127.0.0.1:6379"
},
"RabbitMQ": {
"Enabled": true,
"Connection": "http://localhost:15672/",
"UserName": "robin",
"Password": "123456",
"RetryCount": 3
},
"EventBus": {
"Enabled": true,
"SubscriptionClientName": "Admin.Core"
},
"Middleware": {
"QuartzNetJob": {
"Enabled": true
}
},
"IpRateLimiting": {
"EnableEndpointRateLimiting": false, //False: globally executed, true: executed for each
"StackBlockedRequests": false, //False: Number of rejections should be recorded on another counter
"RealIpHeader": "X-Real-IP",
"ClientIdHeader": "X-ClientId",
"IpWhitelist": [], //
"EndpointWhitelist": [ "get:/api/xxx", "*:/api/yyy" ],
"ClientWhitelist": [ "dev-client-1", "dev-client-2" ],
"QuotaExceededResponse": {
"Content": "{{\"status\":429,\"msg\":\"访问过于频繁,请稍后重试\",\"success\":false}}",
"ContentType": "application/json",
"StatusCode": 429
},
"HttpStatusCode": 429, //
"GeneralRules": [ //api,*
{
"Endpoint": "*:/api/Admin*",
"Period": "1m",
"Limit": 20
},
{
"Endpoint": "*/api/*",
"Period": "1s",
"Limit": 3
},
{
"Endpoint": "*/api/*",
"Period": "1m",
"Limit": 30
},
{
"Endpoint": "*/api/*",
"Period": "12h",
"Limit": 500
}
]
},
"LogFiedOutPutConfigs": {
"tcpAddressHost": "", // elktcp
"tcpAddressPort": 0, // elktcp
"ConfigsInfo": [ // elk
{
"FiedName": "applicationName",
"FiedValue": "Admin.Core.Api"
}
]
}
}

@ -0,0 +1,19 @@
{
"runtimeOptions": {
"tfm": "net6.0",
"frameworks": [
{
"name": "Microsoft.NETCore.App",
"version": "6.0.0"
},
{
"name": "Microsoft.WindowsDesktop.App",
"version": "6.0.0"
},
{
"name": "Microsoft.AspNetCore.App",
"version": "6.0.0"
}
]
}
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save