add -搭建成品下线上位机

dev
liuwf 1 year ago
parent 7e722c9127
commit cc98a0e12b

@ -75,6 +75,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Aucma.Core.ScannerGun", "Au
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Aucma.Core.CodeBinding", "Aucma.Core.CodeBinding\Aucma.Core.CodeBinding.csproj", "{5515C937-1E2E-4111-8775-EE6898E5933A}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Aucma.Core.ProductOffLine", "Aucma.Core.ProductOffLine\Aucma.Core.ProductOffLine.csproj", "{C70810CE-041A-4880-99B3-FFCC8B672B42}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -181,6 +183,10 @@ Global
{5515C937-1E2E-4111-8775-EE6898E5933A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5515C937-1E2E-4111-8775-EE6898E5933A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5515C937-1E2E-4111-8775-EE6898E5933A}.Release|Any CPU.Build.0 = Release|Any CPU
{C70810CE-041A-4880-99B3-FFCC8B672B42}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C70810CE-041A-4880-99B3-FFCC8B672B42}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C70810CE-041A-4880-99B3-FFCC8B672B42}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C70810CE-041A-4880-99B3-FFCC8B672B42}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -214,6 +220,7 @@ Global
{680718C5-E39C-442F-AC9E-4A56E15AF261} = {F8FB57F6-5465-4E60-B052-D3A63C3C56AE}
{61EE37C2-A9C2-40DE-A96E-D7E4DEB5FEC3} = {F8FB57F6-5465-4E60-B052-D3A63C3C56AE}
{5515C937-1E2E-4111-8775-EE6898E5933A} = {BD987F3A-4E6C-4C47-B28F-1671F875EAE3}
{C70810CE-041A-4880-99B3-FFCC8B672B42} = {BD987F3A-4E6C-4C47-B28F-1671F875EAE3}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {8047AB56-042B-4AE4-B06A-34137067A86A}

@ -0,0 +1,29 @@
<Application x:Class="Aucma.Core.ProductOffLine.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.ProductOffLine"
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.ProductOffLine.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.ProductOffLine
{
/// <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,82 @@
<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="LiveCharts.Wpf.Core" Version="0.9.8" />
<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>
<ItemGroup>
<Compile Update="Views\StatisticsPageView.xaml.cs">
<SubType>Code</SubType>
</Compile>
</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.ProductOffLine.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.ProductOffLine.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;
namespace Aucma.Core.ProductOffLine.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.ProductOffLine
{
public class AutofacPropertityModuleReg : Autofac.Module
{
/// <summary>
/// Load
/// </summary>
/// <param name="builder"></param>
protected override void Load(ContainerBuilder builder)
{
builder.RegisterAssemblyTypes(typeof(App).Assembly)
.PropertiesAutowired();
}
}
}

@ -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.ProductOffLine.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.ProductOffLine.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.ProductOffLine.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.ProductOffLine.Models
{
public class StatisticModel
{
/// <summary>
/// 开始时间
/// </summary>
public string? BeginTime { get; set; }
/// <summary>
/// 结束时间
/// </summary>
public string? EndTime { get; set; }
}
}

@ -0,0 +1,119 @@
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 Aucma.Core.Scanner;
using Autofac;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using System.Text;
namespace Aucma.Core.ProductOffLine
{
/// <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();
//扫码器
services.AddScannerSetup();
//支持编码大全 例如:支持 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, IScannerService scannerService)
{
// 使用静态文件
app.UseStaticFiles();
// 然后是授权中间件
//app.UseAuthorization();
// 开启QuartzNetJob调度服务
app.UseQuartzJobMildd(tasksQzService, schedulerCenter);
//开启扫码服务
app.UseScannerMildd(scannerService);
}
#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,165 @@
using CommunityToolkit.Mvvm.ComponentModel;
using System;
using log4net;
using LiveCharts.Wpf;
using LiveCharts;
using System.Collections.Generic;
/*
*
*
*/
namespace Aucma.Core.ProductOffLine.ViewModels
{
public partial class IndexPageViewModel : ObservableObject
{
private static readonly log4net.ILog log = LogManager.GetLogger(typeof(IndexPageViewModel));
public IndexPageViewModel()
{
StationName = "成品分垛入库";
MaterialName = "SC-AUCMA-农夫山泉SC 门体";
OrderNo = "8512365486";
BeginTime = DateTime.Now.ToString("yyyy-mm-dd HH:mm:ss");
InitEveryDayMethod();
}
#region 扫描信息
#region 物料条码
private string _stationName;
public string StationName
{
get { return _stationName; }
set
{
_stationName = value;
SetProperty(ref _stationName, value);
}
}
#endregion
#region 物料名称
private string _materialName;
public string MaterialName
{
get { return _materialName; }
set
{
_materialName = value;
SetProperty(ref _materialName, value);
}
}
#endregion
#region 订单信息
private string _orderNo;
public string OrderNo
{
get { return _orderNo; }
set
{
_orderNo = value;
SetProperty(ref _orderNo, value);
}
}
#endregion
#region 开始时间
private string _beginTime;
public string BeginTime
{
get { return _beginTime; }
set
{
_beginTime = value;
SetProperty(ref _beginTime, value);
}
}
#endregion
#endregion
private void InitEveryDayMethod()
{
ChartValues<double> achievement = new ChartValues<double>();
Random random = new Random();
for (int i = 0; i < 5; i++)
{
achievement.Add(random.Next(60, 100));
}
var column = new ColumnSeries();
column.DataLabels = true;
column.Title = "型号";
column.Values = achievement;
ModelStatistics.Add(column);
ProductionHourList = new List<string>()
{
"12",
"13",
"14",
"15",
"16",
};
ChartValues<double> achievement2 = new ChartValues<double>();
Random random2 = new Random();
for (int i = 0; i < 5; i++)
{
achievement2.Add(random2.Next(60, 100));
}
var column2 = new ColumnSeries();
column2.DataLabels = true;
column2.Title = "产量";
column2.Values = achievement2;
Achievement.Add(column2);
}
#region 日产量柱状图
/// <summary>
/// 日产量柱状图
/// </summary>
private SeriesCollection achievement = new SeriesCollection();
public SeriesCollection Achievement
{
get { return achievement; }
set { achievement = value; }
}
#endregion
#region 型号统计柱状图
/// <summary>
/// 型号统计柱状图
/// </summary>
private SeriesCollection modelStatistics = new SeriesCollection();
public SeriesCollection ModelStatistics
{
get { return modelStatistics; }
set { modelStatistics = value; }
}
#endregion
#region 日产量柱状图X轴日期
/// <summary>
/// 日产量柱状图X轴日期
/// </summary>
private List<string> productionHourList;
public List<string> ProductionHourList
{
get { return productionHourList; }
set { productionHourList = value; }
}
#endregion
}
}

@ -0,0 +1,184 @@
using Aucma.Core.ProductOffLine.Views;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using System.Windows;
using System;
using log4net;
using System.Diagnostics;
using System.Threading;
using NPOI.HSSF.Record;
namespace Aucma.Core.ProductOffLine.ViewModels
{
public partial class MainWindowViewModel : ObservableObject
{
private static readonly log4net.ILog log = LogManager.GetLogger(typeof(MainWindowViewModel));
private IndexPageView firstPage = new IndexPageView();//首页
private StatisticsPageView recordPage = new StatisticsPageView();
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(string page)
{
switch (page)
{
case "FirstPage":
UserContent = firstPage;
break;
case "RecordPage":
UserContent = recordPage;
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,90 @@
using Aucma.Core.ProductOffLine.Models;
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.Tasks;
using System.Windows;
namespace Aucma.Core.ProductOffLine.ViewModels
{
public partial class StatisticsPageViewModel : ObservableObject
{
public StatisticsPageViewModel() { LoadData(); }
List<MaterialComplateInfo> materialComplateInfos = new List<MaterialComplateInfo>();
#region 加载DataGrid数据
private void LoadData()
{
MaterialDataGrid.Add(new MaterialComplateInfo() { No = 1, ProductPlanCode = "8659452123",MaterialCode = "8659452123", MaterialName = "SC-AUCMA-农夫山泉SC", PlanAmount = 50, CompleteAmount = 10 });
MaterialDataGrid.Add(new MaterialComplateInfo() { No = 2, ProductPlanCode = "8659452123",MaterialCode = "8659452123", MaterialName = "SC-AUCMA-农夫山泉SC", PlanAmount = 60, CompleteAmount = 40 });
MaterialDataGrid.Add(new MaterialComplateInfo() { No = 3, ProductPlanCode = "8659452123",MaterialCode = "8659452123", MaterialName = "SC-AUCMA-农夫山泉SC", PlanAmount = 50, CompleteAmount = 10 });
MaterialDataGrid.Add(new MaterialComplateInfo() { No = 4, ProductPlanCode = "8659452123",MaterialCode = "8659452123", MaterialName = "SC-AUCMA-农夫山泉SC", PlanAmount = 40, CompleteAmount = 10 });
MaterialDataGrid.Add(new MaterialComplateInfo() { No = 5, ProductPlanCode = "8659452123",MaterialCode = "8659452123", MaterialName = "SC-AUCMA-农夫山泉SC", PlanAmount = 30, CompleteAmount = 10 });
MaterialDataGrid.Add(new MaterialComplateInfo() { No = 6, ProductPlanCode = "8659452123",MaterialCode = "8659452123", MaterialName = "SC-AUCMA-农夫山泉SC", PlanAmount = 50, CompleteAmount = 20 });
MaterialDataGrid.Add(new MaterialComplateInfo() { No = 7, ProductPlanCode = "8659452123",MaterialCode = "8659452123", MaterialName = "SC-AUCMA-农夫山泉SC", PlanAmount = 10, CompleteAmount = 10 });
MaterialDataGrid.Add(new MaterialComplateInfo() { No = 8, ProductPlanCode = "8659452123", MaterialCode = "8659452123", MaterialName = "SC-AUCMA-农夫山泉SC", PlanAmount = 50, CompleteAmount = 10 });
MaterialDataGrid.Add(new MaterialComplateInfo() { No = 9, ProductPlanCode = "8659452123", MaterialCode = "8659452123", MaterialName = "SC-AUCMA-农夫山泉SC", PlanAmount = 80, CompleteAmount = 10 });
MaterialDataGrid.Add(new MaterialComplateInfo() { No = 10, ProductPlanCode = "8659452123", MaterialCode = "8659452123", MaterialName = "SC-AUCMA-农夫山泉SC", PlanAmount = 50, CompleteAmount = 10});
}
#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 (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, 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,195 @@
<UserControl x:Class="Aucma.Core.ProductOffLine.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:LiveCharts.Wpf;assembly=LiveCharts.Wpf"
xmlns:local="clr-namespace:Aucma.Core.ProductOffLine.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="5">
<Grid.Resources>
<Style TargetType="TextBlock">
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="FontSize" Value="16"/>
<Setter Property="FontFamily" Value="微软雅黑"/>
</Style>
<Style TargetType="Border">
<Setter Property="BorderBrush" Value="#0288d1"/>
<Setter Property="BorderThickness" Value="1"/>
</Style>
</Grid.Resources>
<Grid.RowDefinitions>
<RowDefinition Height="0.5*"/>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border Grid.Row="0">
<Grid>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Border Grid.Row="0" Grid.Column="0" Background="#0288d1">
<TextBlock Text="当前工位" Foreground="White"/>
</Border>
<Border Grid.Row="1" Grid.RowSpan="3" Grid.Column="0" Background="#0288d1">
<TextBlock Text="产品下线扫描" Foreground="White" FontWeight="Bold" FontSize="18"/>
</Border>
<Border Grid.Row="0" Grid.Column="1" Background="#0288d1">
<TextBlock Text="产品条码" Foreground="White" />
</Border>
<Border Grid.Row="1" Grid.Column="1" Background="#0288d1">
<TextBlock Text="产品型号" Foreground="White" />
</Border>
<Border Grid.Row="2" Grid.Column="1" Background="#0288d1">
<TextBlock Text="订单数量" Foreground="White" />
</Border>
<Border Grid.Row="3" Grid.Column="1" Background="#0288d1">
<TextBlock Text="提示信息" Foreground="White" />
</Border>
<Border Grid.Row="0" Grid.Column="2">
<TextBlock Text="312799000093D8U0050"/>
</Border>
<Border Grid.Row="1" Grid.Column="2">
<TextBlock Text="SC-279,C,特许"/>
</Border>
<Border Grid.Row="2" Grid.Column="2">
<TextBlock Text="76"/>
</Border>
<Border Grid.Row="3" Grid.Column="2" Grid.ColumnSpan="3">
<TextBlock Text="获取信息成功3127991000093D8U0050 返回值 : Y.上传条码失败E,条码重复,上传条码失败E,条码重复上传"/>
</Border>
<Border Grid.Row="0" Grid.Column="3" Background="#0288d1">
<TextBlock Text="扫描时间" Foreground="White" />
</Border>
<Border Grid.Row="1" Grid.Column="3" Background="#0288d1">
<TextBlock Text="订单编号" Foreground="White" />
</Border>
<Border Grid.Row="2" Grid.Column="3" Background="#0288d1">
<TextBlock Text="订单已上传" Foreground="White" />
</Border>
<Border Grid.Row="0" Grid.Column="4">
<TextBlock Text="2023-08-29 13:10:53"/>
</Border>
<Border Grid.Row="1" Grid.Column="4">
<TextBlock Text="000011203687"/>
</Border>
<Border Grid.Row="2" Grid.Column="4">
<TextBlock Text="48"/>
</Border>
<Border Grid.Row="0" Grid.Column="5" Background="#0288d1">
<TextBlock Text="实际产量" Foreground="White" />
</Border>
<Border Grid.Row="1" Grid.RowSpan="2" Grid.Column="5">
<TextBlock Text="255"/>
</Border>
<Border Grid.Row="4" Grid.Column="5">
<WrapPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<RadioButton Content="A库" Margin="5 0"/>
<RadioButton Content="B库" Margin="5 0"/>
</WrapPanel>
</Border>
</Grid>
</Border>
<Border Grid.Row="1">
<Grid>
<Grid.Resources>
<Style TargetType="Border">
<Setter Property="BorderBrush" Value="#0288d1"/>
<Setter Property="BorderThickness" Value="1"/>
</Style>
</Grid.Resources>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Border Grid.Column="0" >
<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="15" FontWeight="Bold" Foreground="#0288d1" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<Border Grid.Row="1" BorderBrush="#0288d1" BorderThickness="0" CornerRadius="5" Background="Transparent" >
<lvc:CartesianChart Series="{Binding Achievement, UpdateSourceTrigger=PropertyChanged}" >
<lvc:CartesianChart.AxisX>
<lvc:Axis Labels="{Binding ProductionHourList}" FontSize="15"/>
</lvc:CartesianChart.AxisX>
<lvc:CartesianChart.AxisY>
<lvc:Axis FontSize="15"/>
</lvc:CartesianChart.AxisY>
</lvc:CartesianChart>
</Border>
</Grid>
</Border>
<Border Grid.Column="1" >
<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="15" FontWeight="Bold" Foreground="#0288d1" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<Border Grid.Row="1" BorderBrush="#0288d1" BorderThickness="0" CornerRadius="5" Background="Transparent" >
<lvc:CartesianChart Series="{Binding ModelStatistics, UpdateSourceTrigger=PropertyChanged}" Margin="5">
<lvc:CartesianChart.AxisX>
<lvc:Axis Labels="{Binding MaterialNameList}" FontSize="15"/>
</lvc:CartesianChart.AxisX>
<lvc:CartesianChart.AxisY>
<lvc:Axis FontSize="15"/>
</lvc:CartesianChart.AxisY>
</lvc:CartesianChart>
</Border>
</Grid>
</Border>
</Grid>
</Border>
<Border Grid.Row="2">
<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 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 Status,StringFormat=\{0:yyyy-MM-dd HH:mm\}}" Header="扫描时间" Width="*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
</DataGrid.Columns>
</DataGrid>
</Border>
</Grid>
</UserControl>

@ -0,0 +1,32 @@
using Aucma.Core.ProductOffLine.Common;
using Aucma.Core.ProductOffLine.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.ProductOffLine.Views
{
/// <summary>
/// IndexPageView.xaml 的交互逻辑
/// </summary>
public partial class IndexPageView : UserControl
{
public IndexPageView()
{
InitializeComponent();
this.DataContext = new IndexPageViewModel();
}
}
}

@ -0,0 +1,98 @@
<Window x:Class="Aucma.Core.ProductOffLine.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="RecordPage" Margin="5 0" Command="{Binding SwitchPagesCommand}" CommandParameter="{Binding Name,ElementName=RecordPage}" />
<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.ProductOffLine.ViewModels;
using System.Windows;
namespace Aucma.Core.ProductOffLine.Views
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
this.DataContext = new MainWindowViewModel();
}
}
}

@ -0,0 +1,122 @@
<UserControl x:Class="Aucma.Core.ProductOffLine.Views.StatisticsPageView"
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.ProductOffLine.Views"
xmlns:cvt="clr-namespace:Aucma.Core.ProductOffLine.ConvertTo"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<UserControl.Resources>
<cvt:MultiBindingConverter x:Key="QueryConvert"></cvt:MultiBindingConverter>
<!--列头标题栏样式-->
<Style TargetType="DataGridColumnHeader">
<!--<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>-->
<!--<Setter Property="Background" Value="#dddddd"/>
<Setter Property="Foreground" Value="Black"/>-->
<!--<Setter Property="BorderThickness" Value="1" />-->
<Setter Property="BorderBrush" Value="#dddddd" />
<Setter Property="Height" Value="30"/>
<Setter Property="FontSize" Value="14"/>
</Style>
</UserControl.Resources>
<Border Grid.Row="1" Grid.Column="1" BorderBrush="#0288d1" BorderThickness="2" CornerRadius="5" Background="Transparent" Margin="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,50,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="Auto" BorderThickness="0" CanUserAddRows="False" SelectionMode="Single" IsReadOnly="True"
Foreground="Gray" >
<!--表头剧中-->
<!--<DataGrid.ColumnHeaderStyle>
<Style TargetType="DataGridColumnHeader">
<Setter Property="HorizontalContentAlignment" Value="Center">
<Setter Property="BorderThickness" Value="1" />
</Setter>
</Style>
</DataGrid.ColumnHeaderStyle>-->
<!--修改选中字体颜色-->
<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding No}" Header="序号" />
<DataGridTextColumn Binding="{Binding ProductPlanCode}" Header="计划编号" Width="1*" />
<DataGridTextColumn Binding="{Binding MaterialCode}" Header="物料编号" Width="1*" />
<DataGridTextColumn Binding="{Binding MaterialName}" Header="物料名称" Width="3*" />
<DataGridTextColumn Binding="{Binding PlanAmount}" Header="计划数量" Width="*" />
<DataGridTextColumn Binding="{Binding CompleteAmount}" Header="完成数量" Width="*" />
</DataGrid.Columns>
</DataGrid>
</UniformGrid>
</Grid>
</Border>
</Grid>
</Border>
</UserControl>

@ -0,0 +1,30 @@
using Aucma.Core.ProductOffLine.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.ProductOffLine.Views
{
/// <summary>
/// StatisticsPageView.xaml 的交互逻辑
/// </summary>
public partial class StatisticsPageView : UserControl
{
public StatisticsPageView()
{
InitializeComponent();
this.DataContext = new StatisticsPageViewModel();
}
}
}

@ -0,0 +1,232 @@
{
"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": "Admin.Core", //Enabledtrue
"MutiDBEnabled": false, //
"CQRSEnabled": false, //SqlServer
"DBS": [
/*
DBType
MySql = 0,
SqlServer = 1,
Sqlite = 2,
Oracle = 3,
PostgreSQL = 4,
Dm = 5,//
Kdbndp = 6,//
*/
{
"ConnId": "Admin.Core",
"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"
}
],
"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"
}
],
"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
},
"Scanner": {//
"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"
}
]
}
}
Loading…
Cancel
Save