liuwf 1 year ago
commit f34c22c441

@ -626,6 +626,11 @@
补打个数
</summary>
</member>
<member name="P:Admin.Core.Model.Model_New.PrintBarCode.PrintBarType">
<summary>
打印类型:箱壳、内胆
</summary>
</member>
<member name="T:Admin.Core.Model.Model_New.PrintOrderInfo">
<summary>
打印信息表
@ -751,6 +756,16 @@
是否执行中
</summary>
</member>
<member name="P:Admin.Core.Model.Model_New.SmTaskExecution.PlanType">
<summary>
任务类型
</summary>
</member>
<member name="P:Admin.Core.Model.Model_New.SmTaskExecution.TaskCode">
<summary>
计划任务执行编号
</summary>
</member>
<member name="T:Admin.Core.Model.BaseQualityInspectionItemInfo">
<summary>
质检项信息
@ -1206,6 +1221,16 @@
创建时间
</summary>
</member>
<member name="P:Admin.Core.Model.ExecutePlanInfo.PlanType">
<summary>
任务类型
</summary>
</member>
<member name="P:Admin.Core.Model.ExecutePlanInfo.TaskCode">
<summary>
计划任务执行编号
</summary>
</member>
<member name="T:Admin.Core.Model.Perfusion_Alarm">
<summary>
灌注告警

@ -106,5 +106,15 @@ namespace Admin.Core.Model
/// </summary>
[SugarColumn(ColumnName = "CREATED_TIME")]
public DateTime? CreatedTime { get; set; }
/// <summary>
/// 任务类型
/// </summary>
[SugarColumn(ColumnName = "PLAN_TYPE")]
public int PlanType { get; set; }
/// <summary>
/// 计划任务执行编号
/// </summary>
[SugarColumn(ColumnName = "TASK_CODE")]
public string TaskCode { get; set; }
}
}

@ -17,7 +17,7 @@ namespace Admin.Core.Model.Model_New
/// 主键
/// </summary>
[SugarColumn(ColumnName = "OBJ_ID", IsIdentity = true, IsPrimaryKey = true)]
public float ObjId { get; set; }
public int ObjId { get; set; }
/// <summary>
/// 设备名称;Perfusion:灌注

@ -51,5 +51,11 @@ namespace Admin.Core.Model.Model_New
/// </summary>
[SugarColumn(ColumnName = "SUPPLEMENT_MATERIAL")]
public int SupplementMaterial { get; set; }
/// <summary>
/// 打印类型:箱壳、内胆
/// </summary>
[SugarColumn(ColumnName = "PRINT_BARTYPE")]
public int PrintBarType { get; set; }
}
}

@ -75,5 +75,15 @@ namespace Admin.Core.Model.Model_New
/// </summary>
[SugarColumn(ColumnName = "IS_EXEC")]
public int IsExec { get; set; }
/// <summary>
/// 任务类型
/// </summary>
[SugarColumn(ColumnName = "PLAN_TYPE")]
public int PlanType{ get; set; }
/// <summary>
/// 计划任务执行编号
/// </summary>
[SugarColumn(ColumnName = "TASK_CODE")]
public string TaskCode { get; set; }
}
}

@ -62,8 +62,8 @@ namespace Admin.Core.RealTimeService
AddServices(services);
//任务调度
//services.AddJobSetup();
services.AddScannerGunSetup();
services.AddJobSetup();
//支持编码大全 例如:支持 System.Text.Encoding.GetEncoding("GB2312") System.Text.Encoding.GetEncoding("GB18030")
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
}
@ -84,15 +84,16 @@ namespace Admin.Core.RealTimeService
/// </summary>
/// <param name="app"></param>
/// <param name="env"></param>
public void Configure(IApplicationBuilder app, IScannerGunService scannerGunService)
public void Configure(IApplicationBuilder app, ISysTasksQzService tasksQzService,
ISchedulerCenter schedulerCenter)
{
// 使用静态文件
app.UseStaticFiles();
// 然后是授权中间件
//app.UseAuthorization();
// 开启QuartzNetJob调度服务
// app.UseQuartzJobMildd(tasksQzService, schedulerCenter);
app.UseScannerGunMildd(scannerGunService);
app.UseQuartzJobMildd(tasksQzService, schedulerCenter);
//app.UseScannerGunMildd(scannerGunService);
}
#region 注册服务

@ -4,7 +4,9 @@ using Aucma.Core.PLc;
using Quartz;
using System;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using static ICSharpCode.SharpZipLib.Zip.ExtendedUnixData;
/// <summary>
/// 这里要注意下,命名空间和程序集是一样的,不然反射不到
@ -13,13 +15,12 @@ namespace Admin.Core.Tasks
{
public class Job_Admin_Quartz : JobBase, IJob
{
protected readonly IBaseOrderInfoServices _baseOrderInfoServices;
bool flag=true;
public Job_Admin_Quartz(ISysTasksQzService SysTasksQzService, ISysJobLogService sysJobLogService,
IBaseOrderInfoServices baseOrderInfoServices)
{
_SysTasksQzService = SysTasksQzService;
_sysJobLogService = sysJobLogService;
_baseOrderInfoServices = baseOrderInfoServices;
}
public async Task Execute(IJobExecutionContext context)
{
@ -27,42 +28,18 @@ namespace Admin.Core.Tasks
}
public async Task Run(IJobExecutionContext context)
{
var r = await _baseOrderInfoServices.QueryAsync();
if (r.Count() > 0) { }
//var obj = PlcHelper.melsecList.FirstOrDefault(d => d.EquipName.Equals("分垛库A"));
//if (obj.IsConnect)
//{
// var val = obj.plc.ReadBool("M100");
// Console.WriteLine($"读取数据:{val}");
//}
//else
//{
// Console.WriteLine($"读取数据失败!");
//}
//var objB = PlcHelper.melsecList.FirstOrDefault(d => d.EquipName.Equals("分垛库B"));
//if (objB.IsConnect)
//{
// var val = objB.plc.ReadBool("M100");
// Console.WriteLine($"B读取数据{val}");
//}
//else
//{
// Console.WriteLine($"B读取数据失败");
//}
//LogDelegateEvent?.Invoke("SC-农夫山泉SC 85764521323 完成");
//Console.WriteLine("定时任务");
//var list = await _productPlanInfoServices.QueryAsync(d => d.productLineCode == "1001");
//foreach (var item in list)
//{
// Console.WriteLine($"MES:{item.materialName}");
//}
//var list = await _printOrderInfoServices.QueryAsync();
//foreach (var item in list)
//{
// Console.WriteLine($"SCADA:{item.MaterialName}");
//}
//return Task.CompletedTask;
if (flag)
{
flag = false;
Console.WriteLine("sa1");
Thread.Sleep(10000);
}
else
{
Console.WriteLine("sa2");
}
await Task.FromResult(true);
}
}
}

@ -62,6 +62,12 @@ namespace Aucma.Core.PrintTo.ViewModels
public string OrderNo { get => _orderNo; set => SetProperty(ref _orderNo, value); }
#endregion
#region 打印名称
private string _printName;
public string PrintName { get => _printName; set => SetProperty(ref _printName, value); }
#endregion
#region 产品编码
private string _productCode;
@ -147,6 +153,11 @@ namespace Aucma.Core.PrintTo.ViewModels
[RelayCommand]
public void StartOperate()
{
if (string.IsNullOrEmpty(PrintName))
{
MessageBox.Show("打印名称不可为空?", "系统提醒", MessageBoxButton.OK, MessageBoxImage.Error, MessageBoxResult.No);
return;
}
printState = PrintState.Printing;
SuspendEnabled = "True";
OperateEnabled = "False";
@ -266,7 +277,7 @@ namespace Aucma.Core.PrintTo.ViewModels
//barReport.PrintSettings.Printer = printer; // 设置打印机名称
//barReport.PrintSettings.Copies = 1; // 设置打印份数
// //barReport.PrintSettings.PageRange = "1-3"; // 设置打印页范围
//barReport.SetParameterValue("BoxBarData.Id", item);
//barReport.SetParameterValue("BoxBarData.Id", item.barCode);
//barReport.SetParameterValue("BoxBarData.Order_No", orderNo);//订单码
//barReport.SetParameterValue("BoxBarData.Order_Material_Name", materialName);//物料名称
//barReport.SetParameterValue("BoxBarData.Bar_Code", barCode);//二维码
@ -292,7 +303,7 @@ namespace Aucma.Core.PrintTo.ViewModels
BarcodesPrinted.Enqueue(BarcodesUnprinted.Dequeue());
i++;
Progress = i;
Thread.Sleep(1000);
}
catch (Exception ex)

@ -10,12 +10,16 @@
<ItemGroup>
<Compile Remove="Locator\**" />
<Compile Remove="Log\**" />
<Compile Remove="ViewModels\Base\**" />
<EmbeddedResource Remove="Locator\**" />
<EmbeddedResource Remove="Log\**" />
<EmbeddedResource Remove="ViewModels\Base\**" />
<None Remove="Locator\**" />
<None Remove="Log\**" />
<None Remove="ViewModels\Base\**" />
<Page Remove="Locator\**" />
<Page Remove="Log\**" />
<Page Remove="ViewModels\Base\**" />
</ItemGroup>
@ -59,10 +63,6 @@
</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" />

@ -70,7 +70,11 @@ namespace Aucma.Core.SheetMetal.Models
/// <summary>
/// 剩余可拆分数量
/// </summary>
public int SpliteResidueAmount { get; set; }
public int SpliteResidueAmount { get; set; }
/// <summary>
/// 完成数量
/// </summary>
public int CompleteAmount { get; set; }
/// <summary>
/// 开始日期
/// </summary>

@ -1,4 +1,5 @@
using System;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@ -48,5 +49,13 @@ namespace Aucma.Core.SheetMetal.Models
/// 开始时间
/// </summary>
public int IsExec { get; set; }
/// <summary>
/// 任务类型
/// </summary>
public string PlanType { get; set; }
/// <summary>
/// 计划任务执行编号
/// </summary>
public string TaskCode { get; set; }
}
}

@ -21,6 +21,7 @@ using System.Windows.Media;
using log4net;
using Admin.Core.Common;
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
using System.Drawing.Drawing2D;
/*
*
*
@ -29,15 +30,14 @@ namespace Aucma.Core.SheetMetal.ViewModels
{
public partial class IndexPageViewModel : ObservableObject
{
protected readonly IExecutePlanInfoServices? _taskExecutionServices;
protected readonly IExecutePlanInfoServices? _taskExecutionPlanInfoServices;
int k = 100;
public IndexPageViewModel()
{
_taskExecutionServices = App.ServiceProvider.GetService<IExecutePlanInfoServices>();
StationName = "U壳/侧板钣金生产";
_taskExecutionPlanInfoServices = App.ServiceProvider.GetService<IExecutePlanInfoServices>();
StationName = Appsettings.app("StoreInfo", "StationName");
Job_SheetMetalTask_Quartz.SmEverDayDelegateEvent += InitEveryDayMethod;
Job_SheetMetalTask_Quartz.SmShowDelegateEvent += UpdatePlanSHow;//计划内容展示
@ -47,7 +47,6 @@ namespace Aucma.Core.SheetMetal.ViewModels
{
await LoadData();
await InitExecMethod();
});
InitEveryDayMethod();
}
@ -57,7 +56,7 @@ namespace Aucma.Core.SheetMetal.ViewModels
private async Task InitExecMethod()
{
string station = "1001";
ExecutePlanInfo info = await _taskExecutionServices.FirstAsync(d => d.ProductLineCode.Equals(station) && d.ExecuteStatus == 2);
ExecutePlanInfo info = await _taskExecutionPlanInfoServices.FirstAsync(d => d.ProductLineCode.Equals(station) && d.ExecuteStatus == 2);
if (info == null) return;
PlanNum = info.PlanAmount;
@ -126,9 +125,10 @@ namespace Aucma.Core.SheetMetal.ViewModels
#region 加载DataGrid数据
private async Task LoadData()
{
var list= await _taskExecutionServices.QueryAsync(d=>d.ProductLineCode.Contains("1001"));
var list= await _taskExecutionPlanInfoServices.QueryAsync(d=>d.ProductLineCode.Contains("1001"));
var execList= list.OrderBy(d=>d.ExecuteOrder);
int i = 1;
string planType=string.Empty;
foreach (var item in execList)
{
TaskExecModel task=new TaskExecModel();
@ -141,6 +141,21 @@ namespace Aucma.Core.SheetMetal.ViewModels
task.CompleteAmount = item.CompleteAmount;
task.BeginTime = item.BeginTime;
task.IsExec = item.ExecuteStatus;
if (item.PlanType==1)
{
planType = "前后板联动";
}
if (item.PlanType == 2)
{
planType = "前板计划";
}
if (item.PlanType == 3)
{
planType = "后板计划";
}
task.PlanType = planType;
task.TaskCode = item.TaskCode;
PlanInfoDataGrid.Add(task);
i++;
}
@ -156,7 +171,7 @@ namespace Aucma.Core.SheetMetal.ViewModels
private async Task MoveUp(string Id)
{
string stationCode = Appsettings.app("StoreInfo", "StationCode");
bool result = await _taskExecutionServices.PlanMoveUp(Id, stationCode);
bool result = await _taskExecutionPlanInfoServices.PlanMoveUp(Id, stationCode);
if (result)
{
PlanInfoDataGrid.Clear();
@ -173,7 +188,7 @@ namespace Aucma.Core.SheetMetal.ViewModels
private async Task MoveDown(string Id)
{
string stationCode = Appsettings.app("StoreInfo", "StationCode");
bool result = await _taskExecutionServices.PlanMoveDown(Id, stationCode);
bool result = await _taskExecutionPlanInfoServices.PlanMoveDown(Id, stationCode);
if (result)
{
PlanInfoDataGrid.Clear();
@ -192,7 +207,7 @@ namespace Aucma.Core.SheetMetal.ViewModels
MessageBoxResult msg = MessageBox.Show("确定要删除吗?", "系统提醒", MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.No);
if (MessageBoxResult.Yes == msg)
{
bool result = await _taskExecutionServices.ExecPlanDelete(Id);
bool result = await _taskExecutionPlanInfoServices.ExecPlanDelete(Id);
if (result)
{
PlanInfoDataGrid.Clear();
@ -218,14 +233,14 @@ namespace Aucma.Core.SheetMetal.ViewModels
MessageBoxResult msg = MessageBox.Show("确定要下发计划吗?", "系统提醒", MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.No);
if (MessageBoxResult.Yes != msg) return;
var model = await _taskExecutionServices.FirstAsync(d => d.ObjId == int.Parse(Id));
var model = await _taskExecutionPlanInfoServices.FirstAsync(d => d.ObjId == int.Parse(Id));
if (model.ExecuteStatus == 2)
{
MessageBox.Show("该计划正在执行中,请勿重复下传", "系统信息");
}
else
{
var result = _taskExecutionServices.PlanNextPass(model);
var result = _taskExecutionPlanInfoServices.PlanNextPass(model);
if (result != null)
{
//刷新列表

@ -4,6 +4,7 @@ using Admin.Core.Service;
using Aucma.Core.SheetMetal.Models;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using CommunityToolkit.Mvvm.Messaging;
using log4net;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.IdentityModel.Logging;
@ -21,12 +22,15 @@ namespace Aucma.Core.SheetMetal.ViewModels
private static readonly log4net.ILog logHelper = LogManager.GetLogger(typeof(QuantityIssuedViewModel));
private IBaseBomInfoServices _bomInfoServices;
private IBaseSpaceDetailServices _spaceDetailServices;
protected readonly IExecutePlanInfoServices? _executePlanInfoServices;
#region 构造函数
public QuantityIssuedViewModel(ProductPlanInfoModel productPlanInfo)
{
_bomInfoServices = App.ServiceProvider.GetService<IBaseBomInfoServices>();
_spaceDetailServices = App.ServiceProvider.GetService<IBaseSpaceDetailServices>();
_executePlanInfoServices = App.ServiceProvider.GetService<IExecutePlanInfoServices>();
PlanInfo = productPlanInfo;
}
#endregion
@ -51,14 +55,41 @@ namespace Aucma.Core.SheetMetal.ViewModels
/// 下传计划
/// </summary>
[RelayCommand]
private void PlanInfoTransmit()
private async Task PlanInfoTransmit()
{
var productPlanInfo = _PlanInfo;
if (productPlanInfo != null)
{
//下传到PLC
var list = await _executePlanInfoServices.QueryAsync(d => d.ProductLineCode.Equals("1001"));
ExecutePlanInfo task = new ExecutePlanInfo();
task.ExecutePlanCode = Guid.NewGuid().ToString();
task.ProductPlanCode = PlanInfo.PlanCode;
task.OrderCode = PlanInfo.OrderCode;
task.MaterialCode = PlanInfo.MaterialCode;
task.MaterialName = PlanInfo.MaterialName;
task.ProductLineCode = "1001";//计划工位
if (list.Count == 0)
task.ExecuteOrder = 1;
if (list.Count != 0)
task.ExecuteOrder = list.Max(d => d.ExecuteOrder) + 1;
task.ExecuteMethod = 1;//不做要求,系统自动确定
task.ExecuteStatus = 1;
task.PlanAmount = PlanInfo.SpliteResidueAmount;
task.CompleteAmount = PlanInfo.CompleteAmount;
task.CreatedTime = DateTime.Now;
var result = await _executePlanInfoServices.AddAsync(task);
if (result > 0)
{
MessageBox.Show("计划拆分成功!", "系统提醒");
WeakReferenceMessenger.Default.Send<string>("Refresh");//刷新窗口
}
else
{
MessageBox.Show("计划拆分失败,请检查后重试!", "系统提醒");
}
//拆分计划到任务表中
//bool result = PlanTransmitByProductPlan(_PlanInfo.PlanCode, Convert.ToInt32(_TransmitAmount));
@ -114,7 +145,8 @@ namespace Aucma.Core.SheetMetal.ViewModels
{
window.Close();
}
}
}
#endregion
}
}

@ -33,9 +33,10 @@ namespace Aucma.Core.SheetMetal.ViewModels
#region 保存数据
[RelayCommand]
private void SaveSearchCriteria()
private void SaveSearchCriteria(Object window)
{
var info = _configurations.ToList();
var config = ((Aucma.Core.SheetMetal.ViewModels.SearchCriteriaViewModel)((System.Windows.FrameworkElement)window).DataContext).Configurations;
var info = config.ToList();
string items = string.Empty;
foreach (var configuration in info)
{

@ -13,14 +13,10 @@ using log4net;
using Microsoft.Extensions.DependencyInjection;
using Admin.Core.Model;
using Castle.Core.Internal;
using Admin.Core.Service;
using Admin.Core.Model.Model_New;
using Admin.Core.Common;
using CommunityToolkit.Mvvm.Messaging;
using static System.Windows.Forms.VisualStyles.VisualStyleElement.StartPanel;
using MaterialDesignColors;
using Aucma.Core.SheetMetal.Views;
using Aucma.Core.SheetMetal.Common;
using System.Windows.Input;
namespace Aucma.Core.SheetMetal.ViewModels
{
@ -36,16 +32,21 @@ namespace Aucma.Core.SheetMetal.ViewModels
{
_productPlanInfoServices = App.ServiceProvider.GetService<IProductPlanInfoServices>();
_executePlanInfoServices = App.ServiceProvider.GetService<IExecutePlanInfoServices>();
LoadData();
Task.Run(async () =>{
await LoadData();
});
SaveSearchCriteria();
//WeakReferenceMessenger.Default.Register<string>;
}
#region 加载DataGrid数据
private async void LoadData()
private async Task LoadData()
{
MaterialDataGrid.Clear();
int i = 1;
string station = "1001";
var planlist = await _productPlanInfoServices.QueryAsync(d=>d.ProductLineCode.Equals(station));
var planlist = await _productPlanInfoServices.QueryAsync(d => d.ProductLineCode.Equals(station));
var execList = await _executePlanInfoServices.QueryAsync(d => d.ProductLineCode.Equals(station));
foreach (var item in planlist)
{
@ -55,7 +56,7 @@ namespace Aucma.Core.SheetMetal.ViewModels
MaterialDataGrid.Add(new ProductPlanInfoModel()
{
No = i,
PlanCode= item.PlanCode,
PlanCode = item.PlanCode,
MaterialCode = item.MaterialCode,
MaterialName = item.MaterialName,
OrderCode = item.OrderCode,
@ -67,7 +68,8 @@ namespace Aucma.Core.SheetMetal.ViewModels
i++;
}
}
private async void LoadData(string obj)
private async Task LoadData(string obj)
{
int i = 1;
string station = "1001";
@ -110,19 +112,19 @@ namespace Aucma.Core.SheetMetal.ViewModels
/// 查询
/// </summary>
[RelayCommand]
private void QueryPlan(string obj)
private async Task QueryPlan(string obj)
{
if (obj.IsNullOrEmpty())
{
System.Windows.Application.Current.Dispatcher.Invoke((Action)(() =>
System.Windows.Application.Current.Dispatcher.Invoke((Action)(async () =>
{
MaterialDataGrid.Clear();
LoadData();
await LoadData();
}));
return;
}
MaterialDataGrid.Clear();
LoadData(obj);
await LoadData(obj);
}
#endregion
@ -199,7 +201,6 @@ namespace Aucma.Core.SheetMetal.ViewModels
}
#endregion
#region 参数定义
private string _search = string.Empty;
@ -253,45 +254,37 @@ namespace Aucma.Core.SheetMetal.ViewModels
/// 搜索条件设置
/// </summary>
[RelayCommand]
public void SearchCriteriaSet()
public async Task SearchCriteriaSet()
{
SearchCriteriaView searchCriteriaWindow = new SearchCriteriaView();
bool? dialogResult = searchCriteriaWindow.ShowDialog();
if (dialogResult == false) // 用户点击了“取消”按钮或关闭窗口
{
LoadData();
await LoadData();
}
}
#endregion
private void SaveSearchCriteria()
{
var info = _configurations.ToList();
string items = string.Empty;
foreach (var configuration in info)
{
items += configuration.ToString() + "%";
}
appConfig.searchItems = string.Empty;
appConfig.searchItems = items;
Init();
}
#region 查询快捷查询方式
private void Init()
private void SaveSearchCriteria()
{
Configurations = new ObservableCollection<string>();
var searchItems = appConfig.searchItems;
var split = searchItems.Split('%');
foreach (var item in split)
{
Configurations.Add(item);
if (!string.IsNullOrEmpty(item))
{
Configurations.Add(item);
}
}
}
#endregion
#region 双击事件
public void MouseClick(object obj)
{
var info = SelectedDataItem as ProductPlanInfoModel;
@ -302,5 +295,65 @@ namespace Aucma.Core.SheetMetal.ViewModels
}
}
/// <summary>
/// 鼠标双击事件
/// </summary>
[RelayCommand]
public void DoubleMouseClick()
{
MessageBox.Show("双击事件");
}
#endregion
#region 快捷查询
/// <summary>
/// 快捷查询
/// </summary>
/// <param name="selectedOption"></param>
/// <returns></returns>
[RelayCommand]
public async Task RadioButton(string selectedOption)
{
List<ProductPlanInfo> planInfos = await _productPlanInfoServices.QueryAsync(d => d.ProductLineCode.Equals(_search));
if (planInfos != null)
{
if (planInfos.Count > 0)
{
MaterialDataGrid.Clear();
int i = 1;
var execList = await _executePlanInfoServices.QueryAsync(d => d.ProductLineCode.Equals(_search));
foreach (var item in planInfos)
{
int residue = 0;
if (execList == null)
{
residue = 0;
}
else
{
residue = (execList.Where(d => d.MaterialCode.Equals(item.MaterialCode))).Sum(d => d.PlanAmount);
}
MaterialDataGrid.Add(new ProductPlanInfoModel()
{
No = i,
PlanCode = item.PlanCode,
MaterialCode = item.MaterialCode,
MaterialName = item.MaterialName,
OrderCode = item.OrderCode,
PlanAmount = item.PlanAmount,
ResidueAmount = item.PlanAmount - item.CompleteAmount,
SpliteResidueAmount = item.PlanAmount - residue,
StartDate = item.BeginTime
});
i++;
}
}
}
}
#endregion
}
}

@ -22,11 +22,14 @@ namespace Aucma.Core.SheetMetal.ViewModels
public StatisticsPageViewModel()
{
_productPlanInfoServices = App.ServiceProvider.GetService<IProductPlanInfoServices>();
LoadData();
Task.Run(async () =>
{
await LoadData();
});
}
#region 加载DataGrid数据
private async void LoadData()
private async Task LoadData()
{
var list = (await _productPlanInfoServices.QueryAsync(d=>d.ProductLineCode=="1001")).Take(1000);
int i = 1;

@ -11,7 +11,7 @@
<UserControl.Resources>
<Style x:Key="DataGridTextColumnCenterSytle" TargetType="{x:Type TextBlock}">
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="FontSize" Value="20"/>
<Setter Property="FontSize" Value="15"/>
</Style>
<Style TargetType="DataGrid">
@ -300,17 +300,18 @@
ScrollViewer.VerticalScrollBarVisibility="Hidden" BorderThickness="0" CanUserAddRows="False"
SelectionMode="Single" IsReadOnly="True"
Foreground="White">
<DataGrid.Columns >
<DataGridTextColumn Binding="{Binding ID}" Header="主键" Width="auto" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}" Visibility="Hidden" />
<DataGridTextColumn Binding="{Binding No}" x:Name="No" Header="编号" Width="0.5*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}" />
<DataGridTextColumn Binding="{Binding PlanCode}" Header="计划编号" Width="auto" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}" Visibility="Hidden" />
<DataGridTextColumn Binding="{Binding MaterialName}" Header="物料型号" Width="3.5*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}" />
<DataGridTextColumn Binding="{Binding TaskAmount}" Header="计划" Width="0.95*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding CompleteAmount}" Header="完成" Width="0.95*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding TaskAmount}" Header="计划类型" Width="1*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding BeginTime ,StringFormat=\{0:MM-dd HH:mm\}}" Header="开始时间" Width="1.7*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding ID}" Header="主键" Width="auto" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}" Visibility="Hidden" />
<DataGridTextColumn Binding="{Binding No}" x:Name="No" Header="编号" Width="0.5*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}" />
<DataGridTextColumn Binding="{Binding TaskCode}" Header="计划编号" Width="1.5*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}" />
<DataGridTextColumn Binding="{Binding MaterialName}" Header="物料型号" Width="3*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}" />
<DataGridTextColumn Binding="{Binding TaskAmount}" Header="计划" Width="0.6*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding CompleteAmount}" Header="完成" Width="0.6*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding PlanType}" Header="计划类型" Width="1*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding BeginTime ,StringFormat=\{0:MM-dd HH:mm\}}" Header="开始时间" Width="1.7*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTemplateColumn Header="操作" Width="3*" >
<DataGridTemplateColumn Header="操作" Width="3.5*" >
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
@ -318,7 +319,7 @@
<Button Content="上移" FontSize="12" CommandParameter="{Binding ID}" Margin="0 2 0 2" Command="{Binding DataContext.MoveUpCommand, RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=DataGrid }}" />
<Button Content="下移" FontSize="12" CommandParameter="{Binding ID}" Margin="2 2 0 2" Command="{Binding DataContext.MoveDownCommand, RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=DataGrid }}" />
<Button Content="取消" FontSize="12" CommandParameter="{Binding ID}" Margin="2 2 0 2" Background="#FF0033" BorderBrush="#FF0033" Command="{Binding DataContext.DeletePlanCommand, RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=DataGrid }}" />
<Button Content="下传" FontSize="12" CommandParameter="{Binding ID}" Margin="2 2 0 2" Background="Yellow" BorderBrush="Yellow" Command="{Binding DataContext.MoveDownCommand, RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=DataGrid }}" />
<Button Content="下传" FontSize="12" CommandParameter="{Binding ID}" Margin="2 2 0 2" Command="{Binding DataContext.MoveDownCommand, RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=DataGrid }}" />
</WrapPanel>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>

@ -8,7 +8,7 @@
Title="澳柯玛生产控制系统" Icon="/Assets/images/Icon.png"
d:DesignHeight="1080"
d:DesignWidth="1920" FontFamily="Microsoft YaHei"
MinHeight="1080" MinWidth="1800" WindowState="Normal"
MinHeight="1080" MinWidth="1800" WindowStyle="ToolWindow" WindowState="Maximized"
WindowStartupLocation="CenterScreen" >
<Window.Background>
<ImageBrush ImageSource="/Assets/images/background.jpg" />
@ -32,7 +32,7 @@
</Grid.ColumnDefinitions>
<StackPanel Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Center">
<TextBlock Text="箱壳前后板生产控制系统" FontSize="45" Foreground="White" FontWeight="Bold"/>
<TextBlock Text="箱壳钣金生产控制系统" FontSize="45" Foreground="White" FontWeight="Bold"/>
</StackPanel>
<StackPanel Grid.Column="2" VerticalAlignment="Center" HorizontalAlignment="Right">

@ -181,7 +181,7 @@
</Grid.RowDefinitions>
<Border Grid.Row="0" BorderBrush="#0288d1" BorderThickness="0 0 0 1">
<WrapPanel VerticalAlignment="Center" Margin="10 0">
<TextBlock Text="产品型号" VerticalAlignment="Center" Foreground="#FFFFFF" FontSize="18"/>
<TextBlock Text="快捷查询" VerticalAlignment="Center" Foreground="#FFFFFF" FontSize="18"/>
<ItemsControl ItemsSource="{Binding Configurations}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
@ -221,7 +221,7 @@
ScrollViewer.VerticalScrollBarVisibility="Visible" ScrollViewer.HorizontalScrollBarVisibility="Visible"
BorderThickness="0" CanUserAddRows="False" SelectionMode="Single" IsReadOnly="True"
Foreground="White" SelectedItem="{Binding SelectedDataItem}" MouseLeftButtonDown="dgvMH_MouseLeftButtonDown">
<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding No}" Header="序号" Width="1*" IsReadOnly="True" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding PlanCode}" Header="计划编号" Width="1*" IsReadOnly="True" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>

@ -53,7 +53,7 @@
<Style TargetType="DataGridCell">
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="BorderBrush" Value="Gray" />
<Setter Property="BorderBrush" Value="#4285DE" />
<Setter Property="Height" Value="40"/>
<Setter Property="FontSize" Value="12"/>
<Setter Property="Template">
@ -138,6 +138,16 @@
GridLinesVisibility="None" ScrollViewer.HorizontalScrollBarVisibility="Hidden"
ScrollViewer.VerticalScrollBarVisibility="Hidden" BorderThickness="0" CanUserAddRows="False" SelectionMode="Single" IsReadOnly="True"
Foreground="White" >
<!--根据设定值变色-->
<DataGrid.CellStyle>
<Style TargetType="DataGridCell">
<Style.Triggers>
<DataTrigger Binding="{Binding No}" Value="1">
<Setter Property="Background" Value="#4285DE" />
</DataTrigger>
</Style.Triggers>
</Style>
</DataGrid.CellStyle>
<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding No}" Header="序号" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding ProductPlanCode}" Header="计划编号" Width="1*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
@ -147,7 +157,7 @@
<DataGridTextColumn Binding="{Binding PlanAmount}" Header="计划数量" Width="*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding PlanAmount}" Header="前板数量" Width="*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding PlanAmount}" Header="后板数量" Width="*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Binding="{Binding CompleteAmount}" Header="完成数量" Width="*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}" Visibility="Collapsed"/>
<DataGridTextColumn Binding="{Binding ProductPlanCode}" Header="状态" Width="1*" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
</DataGrid.Columns>
</DataGrid>

@ -114,6 +114,7 @@
}
},
"StoreInfo": {
"StationName": "箱壳前后板生产",
"shellStoreCode": "1001",
"linerStoreCode": "1001",
"foamBeforeStoreCode": "1001"

@ -1,9 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>

@ -1,4 +0,0 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]

@ -1,23 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("Aucma.Core.Zebra")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")]
[assembly: System.Reflection.AssemblyProductAttribute("Aucma.Core.Zebra")]
[assembly: System.Reflection.AssemblyTitleAttribute("Aucma.Core.Zebra")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
// 由 MSBuild WriteCodeFragment 类生成。

@ -1,11 +0,0 @@
is_global = true
build_property.TargetFramework = net6.0
build_property.TargetPlatformMinVersion =
build_property.UsingMicrosoftNETSdkWeb =
build_property.ProjectTypeGuids =
build_property.InvariantGlobalization =
build_property.PlatformNeutralAssembly =
build_property.EnforceExtendedAnalyzerRules =
build_property._SupportedPlatformList = Linux,macOS,Windows
build_property.RootNamespace = Aucma.Core.Zebra
build_property.ProjectDir = D:\Project\gitea\AUCMA\SCADA\Aucma.Core.Zebra\

@ -1,8 +0,0 @@
// <auto-generated/>
global using global::System;
global using global::System.Collections.Generic;
global using global::System.IO;
global using global::System.Linq;
global using global::System.Net.Http;
global using global::System.Threading;
global using global::System.Threading.Tasks;

@ -1,25 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="3.2.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
</Project>

@ -1,11 +0,0 @@
namespace ServiceTests
{
public class UnitTest1
{
[Fact]
public void Test1()
{
}
}
}

@ -1 +0,0 @@
global using Xunit;

@ -1,271 +0,0 @@
{
"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": {
"BeforeStoreCode": "PBSCK-001",
"AfterStoreCode": "FPJCK-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
},
"Scanner": { //
"Enabled": true
},
"Melsec": {
"ConString": "10.10.92.30",
"Port": 6000,
"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