liulb@mesnac.com 9 months ago
commit 22192b3ae9

@ -8,6 +8,4 @@ build_property.PlatformNeutralAssembly =
build_property.EnforceExtendedAnalyzerRules =
build_property._SupportedPlatformList = Linux,macOS,Windows
build_property.RootNamespace = Admin.Core.EventBus
build_property.ProjectDir = D:\Project\gitea\AUCMA\SCADA\Admin.Core.EventBus\
build_property.EnableComHosting =
build_property.EnableGeneratedComInterfaceComImportInterop =
build_property.ProjectDir = E:\c#\AUCMA\最新代码整合\new\Admin.Core.EventBus\

@ -8,6 +8,4 @@ build_property.PlatformNeutralAssembly =
build_property.EnforceExtendedAnalyzerRules =
build_property._SupportedPlatformList = Linux,macOS,Windows
build_property.RootNamespace = Admin.Core.Extensions
build_property.ProjectDir = D:\Project\gitea\AUCMA\SCADA\Admin.Core.Extensions\
build_property.EnableComHosting =
build_property.EnableGeneratedComInterfaceComImportInterop =
build_property.ProjectDir = E:\c#\AUCMA\最新代码整合\new\Admin.Core.Extensions\

@ -8,6 +8,4 @@ build_property.PlatformNeutralAssembly =
build_property.EnforceExtendedAnalyzerRules =
build_property._SupportedPlatformList = Linux,macOS,Windows
build_property.RootNamespace = Admin.Core.IRepository
build_property.ProjectDir = D:\Project\gitea\AUCMA\SCADA\Admin.Core.IRepository\
build_property.EnableComHosting =
build_property.EnableGeneratedComInterfaceComImportInterop =
build_property.ProjectDir = E:\c#\AUCMA\最新代码整合\new\Admin.Core.IRepository\

@ -8,6 +8,4 @@ build_property.PlatformNeutralAssembly =
build_property.EnforceExtendedAnalyzerRules =
build_property._SupportedPlatformList = Linux,macOS,Windows
build_property.RootNamespace = Admin.Core.IService
build_property.ProjectDir = D:\Project\gitea\AUCMA\SCADA\Admin.Core.IService\
build_property.EnableComHosting =
build_property.EnableGeneratedComInterfaceComImportInterop =
build_property.ProjectDir = E:\c#\AUCMA\最新代码整合\new\Admin.Core.IService\

@ -8,6 +8,4 @@ build_property.PlatformNeutralAssembly =
build_property.EnforceExtendedAnalyzerRules =
build_property._SupportedPlatformList = Linux,macOS,Windows
build_property.RootNamespace = Admin.Core.Model
build_property.ProjectDir = D:\Project\gitea\AUCMA\SCADA\Admin.Core.Model\
build_property.EnableComHosting =
build_property.EnableGeneratedComInterfaceComImportInterop =
build_property.ProjectDir = E:\c#\AUCMA\最新代码整合\new\Admin.Core.Model\

@ -8,6 +8,4 @@ build_property.PlatformNeutralAssembly =
build_property.EnforceExtendedAnalyzerRules =
build_property._SupportedPlatformList = Linux,macOS,Windows
build_property.RootNamespace = Admin.Core.Repository
build_property.ProjectDir = D:\Project\gitea\AUCMA\SCADA\Admin.Core.Repository\
build_property.EnableComHosting =
build_property.EnableGeneratedComInterfaceComImportInterop =
build_property.ProjectDir = E:\c#\AUCMA\最新代码整合\new\Admin.Core.Repository\

@ -8,6 +8,4 @@ build_property.PlatformNeutralAssembly =
build_property.EnforceExtendedAnalyzerRules =
build_property._SupportedPlatformList = Linux,macOS,Windows
build_property.RootNamespace = Admin.Core.Service
build_property.ProjectDir = D:\Project\gitea\AUCMA\SCADA\Admin.Core.Service\
build_property.EnableComHosting =
build_property.EnableGeneratedComInterfaceComImportInterop =
build_property.ProjectDir = E:\c#\AUCMA\最新代码整合\new\Admin.Core.Service\

@ -8,6 +8,4 @@ build_property.PlatformNeutralAssembly =
build_property.EnforceExtendedAnalyzerRules =
build_property._SupportedPlatformList = Linux,macOS,Windows
build_property.RootNamespace = Admin.Core.Tasks
build_property.ProjectDir = D:\Project\gitea\AUCMA\SCADA\Admin.Core.Tasks\
build_property.EnableComHosting =
build_property.EnableGeneratedComInterfaceComImportInterop =
build_property.ProjectDir = E:\c#\AUCMA\最新代码整合\new\Admin.Core.Tasks\

@ -9,6 +9,7 @@ using Microsoft.Extensions.Logging;
using Autofac.Extensions.DependencyInjection;
using Microsoft.AspNetCore.Hosting;
using Admin.Core.Common;
using System.Threading;
namespace Aucma.Core.PrintTo
{
@ -25,6 +26,7 @@ namespace Aucma.Core.PrintTo
var host = CreateHostBuilder(e.Args).Build();//生成宿主。
ServiceProvider = host.Services;
host.Services.GetRequiredService<MainWindow>()?.Show();
await host.StartAsync();
}

@ -40,39 +40,46 @@ namespace Aucma.Core.PrintTo.ViewModels
/// <param name="passWord">密码</param>
public void Login(BaseTeamMembers team, string userName, string passWord,object parameter)
{
//获取Token
string url = $"http://10.100.72.10:8080/login";
var content = new
try
{
username = userName,
password = passWord
};
//获取Token
string url = $"http://10.100.72.10:8080/login";
var content = new
{
username = userName,
password = passWord
};
var loginResult = HttpHelper.Post(url, content.ToJson());//发送用户名密码给API
Result result = JsonSerializer.Deserialize<Result>(loginResult);
if (result == null)
{
MessageBox.Show("登录失败!","系统提醒");
return ;
}
if (result.code == 200)
{
// 存储账号信息
appConfig.TeamCode = team.TeamCode;
appConfig.TeamName = team.TeamName;
appConfig.Account = userName;
//跳转
var window = parameter as LoginPageView;
if (window == null) return;
window.Hide();
MainWindow indexPage = new MainWindow();
indexPage.Show();
window.Close();
var loginResult = HttpHelper.Post(url, content.ToJson());//发送用户名密码给API
Result result = JsonSerializer.Deserialize<Result>(loginResult);
if (result == null)
{
MessageBox.Show("登录失败!", "系统提醒");
return;
}
if (result.code == 200)
{
// 存储账号信息
appConfig.TeamCode = team.TeamCode;
appConfig.TeamName = team.TeamName;
appConfig.Account = userName;
//跳转
var window = parameter as LoginPageView;
if (window == null) return;
window.Hide();
MainWindow indexPage = new MainWindow();
indexPage.Show();
window.Close();
}
else
{
MessageBox.Show($"登录失败!{result.msg}", "系统提醒");
return;
}
}
else
catch (Exception ex)
{
MessageBox.Show($"登录失败!{result.msg}", "系统提醒");
return;
log.Error($"登录异常:{ex.Message}");
}
}
#endregion

@ -28,11 +28,11 @@ namespace Aucma.Core.PrintTo.ViewModels
UserContent = firstPage;
_sysUserInfoServices = App.ServiceProvider.GetService<ISysUserInfoServices>();
Task.Run(async () =>
{
await RefreshTeamTime();//班组时间
});
//Task.Run(async () =>
//{
// await RefreshTeamTime();//班组时间
//});
InitUserInfo();
DispatcherTimer timer = new DispatcherTimer();
timer.Interval = new TimeSpan(0, 0, 1); //间隔1秒
timer.Tick += new EventHandler(timer_Tick);
@ -204,21 +204,26 @@ namespace Aucma.Core.PrintTo.ViewModels
}
#endregion
#region 切换班组
public async Task RefreshTeamTime()
private void InitUserInfo()
{
while (true)
{
var list = await _sysUserInfoServices.GetTeamData();
if (list != null && list.Count > 0)
{
var sysUserInfo = list.First();
TeamName = $"{sysUserInfo.TeamName}({list.Min(d => d.StartTime).ToString("HH:mm")}~{list.Max(d => d.EndTime).ToString("HH:mm")})";
//TeamName = $"{sysUserInfo.TeamName}";
}
Thread.Sleep(5000);
}
}
TeamName = $"班组:{appConfig.TeamName} 用户:{appConfig.Account}";
}
#region 切换班组
//public async Task RefreshTeamTime()
//{
// while (true)
// {
// var list = await _sysUserInfoServices.GetTeamData();
// if (list != null && list.Count > 0)
// {
// var sysUserInfo = list.First();
// TeamName = $"{appConfig.TeamName}({list.Min(d => d.StartTime).ToString("HH:mm")}~{list.Max(d => d.EndTime).ToString("HH:mm")})";
// //TeamName = $"{sysUserInfo.TeamName}";
// }
// Thread.Sleep(5000);
// }
//}
#endregion
#region 定时刷新时间

@ -35,7 +35,7 @@
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="7*"/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="3*"/>
</Grid.ColumnDefinitions>
<StackPanel Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Center">
@ -49,8 +49,14 @@
<RowDefinition/>
</Grid.RowDefinitions>
<StackPanel Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Left" >
<TextBlock Grid.Column="0" Text="{Binding TeamName}" FontSize="25" Foreground="White" FontWeight="Bold" VerticalAlignment="Center" HorizontalAlignment="Left"/>
<TextBlock Grid.Column="1" Text="{Binding CurrentDateTime}" FontSize="18" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<TextBlock Grid.Column="0" Text="{Binding TeamName}" FontSize="20" Foreground="White" FontWeight="Bold" VerticalAlignment="Center" HorizontalAlignment="Right"/>
<TextBlock Grid.Column="1" Text="{Binding CurrentDateTime}" FontSize="18" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Right"/>
<!--<TextBlock Text=" 登陆人账号:" Height="30" Width="auto" Margin="5 0" Foreground="White" Block.TextAlignment="Center" />
<TextBlock x:Name="Account" Text="{Binding Account}" Height="30" Width="100" Margin="5 0" Foreground="White" Block.TextAlignment="Center" />-->
</StackPanel>
</Grid>
</StackPanel>
@ -70,8 +76,8 @@
<Button Content="最小化" x:Name="Minimized" Height="40" Margin="5 0" Command="{Binding FormControlCommand}" CommandParameter="{Binding Name,ElementName=Minimized}" Width="100" Background="#FF9900" BorderBrush="#FF9900" />
<Button Content="退 出" x:Name="Exit" Height="40" Margin="5 0" Command="{Binding CloseWindowCommand}" CommandParameter="{Binding ElementName=window}" Width="100" Background="#FF0033" BorderBrush="#FF0033" />
<TextBlock Text=" 登陆人账号:" Height="30" Width="auto" Margin="5 0" Foreground="White" Block.TextAlignment="Center" />
<TextBlock x:Name="Account" Text="{Binding Account}" Height="30" Width="100" Margin="5 0" Foreground="White" Block.TextAlignment="Center" />
<!--<TextBlock Text=" 登陆人账号:" Height="30" Width="auto" Margin="5 0" Foreground="White" Block.TextAlignment="Center" />
<TextBlock x:Name="Account" Text="{Binding Account}" Height="30" Width="100" Margin="5 0" Foreground="White" Block.TextAlignment="Center" />-->
</StackPanel>
</Grid>

@ -24,7 +24,7 @@ namespace Aucma.Core.PrintTo.Views
//账号名称不存在,跳转
if (string.IsNullOrWhiteSpace(appConfig.Account))
{
this.Hide();
// this.Hide();
LoginPageView indexPage = new LoginPageView();
indexPage.ShowDialog();
//this.Close();
@ -32,7 +32,7 @@ namespace Aucma.Core.PrintTo.Views
}
else
{
this.Account.Text = appConfig.Account;
// this.Account.Text = appConfig.Account;
//this.Team.Text = appConfig.TeamName;
return true;
}

Loading…
Cancel
Save