liulb@mesnac.com 1 year ago
parent e168475624
commit 6d93c3fcd6

@ -781,6 +781,16 @@
完成数量
</summary>
</member>
<member name="P:Admin.Core.Model.Model_New.SmTaskExecution.FrontPlateAmount">
<summary>
前板数量
</summary>
</member>
<member name="P:Admin.Core.Model.Model_New.SmTaskExecution.RearPanelAmount">
<summary>
后板数量
</summary>
</member>
<member name="P:Admin.Core.Model.Model_New.SmTaskExecution.StartTime">
<summary>
开始时间
@ -798,7 +808,7 @@
</member>
<member name="P:Admin.Core.Model.Model_New.SmTaskExecution.IsExec">
<summary>
是否执行中
是否执行中:1-执行2-完成
</summary>
</member>
<member name="P:Admin.Core.Model.Model_New.SmTaskExecution.PlanType">

@ -12,7 +12,7 @@ namespace Admin.Core.Extensions
public static class AucmaTaskMildd
{
private static readonly ILog log = LogManager.GetLogger(typeof(AucmaTaskMildd));
public static async void AucmaTaskMildds(this IApplicationBuilder app, IAucamTaskService aucamTaskService)
public static void AucmaTaskMildds(this IApplicationBuilder app, IAucamTaskService aucamTaskService)
{
if (app == null) throw new ArgumentNullException(nameof(app));
@ -20,7 +20,7 @@ namespace Admin.Core.Extensions
{
if (Appsettings.app("Middleware", "AucamTask", "Enabled").ObjToBool())
{
await aucamTaskService.AucamTaskAsync();
aucamTaskService.AucamTaskAsync();
Console.WriteLine("澳柯玛定时服务已开启");
}
}

@ -1,5 +1,7 @@
using Admin.Core.Common;
using Admin.Core.Extensions;
using Admin.Core.IService.ISys;
using Admin.Core.Tasks;
using Aucma.Core.Tasks;
using Autofac;
using Microsoft.AspNetCore.Builder;
@ -51,12 +53,11 @@ namespace Admin.Core.RealTimeService
//AutoMapper
services.AddAutoMapperSetup();
//注册业务服务
AddServices(services);
//ÈÎÎñµ÷¶È
services.AddJobSetup();
//任务
services.AddAucmaTaskSetup();
// services.AddAucmaTaskSetup();
//支持编码大全 例如:支持 System.Text.Encoding.GetEncoding("GB2312") System.Text.Encoding.GetEncoding("GB18030")
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
}
@ -77,11 +78,13 @@ namespace Admin.Core.RealTimeService
/// </summary>
/// <param name="app"></param>
/// <param name="env"></param>
public void Configure(IApplicationBuilder app, IAucamTaskService aucamTaskService)
public void Configure(IApplicationBuilder app, ISysTasksQzService tasksQzService, ISchedulerCenter schedulerCenter)
{
// 使用静态文件
app.UseStaticFiles();
app.AucmaTaskMildds(aucamTaskService);
//app.AucmaTaskMildds(aucamTaskService);
// ¿ªÆôQuartzNetJobµ÷¶È·þÎñ
app.UseQuartzJobMildd(tasksQzService, schedulerCenter);
}
#region 注册服务

@ -55,58 +55,47 @@ namespace Admin.Core.Service
if (orderBomInfoList == null) return null;
foreach (BaseOrderInfo order in orderList)
{
var bomList = await _orderBomInfoRepository.QueryAsync(d => d.ParentId.Equals(order.MaterialCode));
if (bomList != null)
{
bomList.ForEach(b =>
{
List<OrderBomInfo> bbList = RecursionFn(orderBomInfoList, b.MaterialCode);
if (b.ParentId.IsNotEmptyOrNull() && (b.MaterialName.Contains("箱体") || b.MaterialName.Contains("内胆")))
{
bbList.ForEach(bb =>
{
list.Add(new PrintPlanInfoView()
{
OrderCode = order.OrderCode,
ProductCode = order.MaterialCode,
ProductName = order.MaterialName,
PlanAmount = order.OrderAmount,
MaterialCode = bb.MaterialCode,
MaterialName = bb.MaterialName,
LinerAmount = bb.StandardAmount,
BoxAmount = bb.StandardAmount,
StandardAmount = bb.StandardAmount,
CreateTime = order.CreatedTime
});
});
}
});
}
List<OrderBomInfo> bbList = RecursionFn(orderBomInfoList, order.MaterialCode);
//bomList.ForEach(b =>
//{
// List<OrderBomInfo> bbList = RecursionFn(orderBomInfoList, b.MaterialCode);
// if (b.ParentId.IsNotEmptyOrNull() && (b.MaterialName.Contains("箱体") || b.MaterialName.Contains("内胆")))
// {
// bbList.ForEach(bb =>
// {
// list.Add(new PrintPlanInfoView()
// {
// OrderCode = order.OrderCode,
// ProductCode = order.MaterialCode,
// ProductName = order.MaterialName,
// PlanAmount = order.OrderAmount,
// MaterialCode = bb.MaterialCode,
// MaterialName = bb.MaterialName,
// LinerAmount = bb.StandardAmount,
// BoxAmount = bb.StandardAmount,
// StandardAmount = bb.StandardAmount,
// CreateTime = order.CreatedTime
// });
// });
// }
//});
//var list = (from order in orderList
// join b in orderBomInfoList
// on order.MaterialCode equals b.ParentId
// select new PrintPlanInfoView
// {
// OrderCode = order.OrderCode,
// ProductCode = order.MaterialCode,
// ProductName = order.MaterialName,
// PlanAmount = order.OrderAmount,
// MaterialCode = b.MaterialCode,
// MaterialName = b.MaterialName,
// StandardAmount = b.StandardAmount,
// CreateTime = order.CreatedTime
// }).ToList();
}
//var list = (from order in orderList
// join b in orderBomInfoList
// on order.MaterialCode equals b.ParentId
// select new PrintPlanInfoView
// {
// OrderCode = order.OrderCode,
// ProductCode = order.MaterialCode,
// ProductName = order.MaterialName,
// PlanAmount = order.OrderAmount,
// MaterialCode = b.MaterialCode,
// MaterialName = b.MaterialName,
// StandardAmount = b.StandardAmount,
// CreateTime = order.CreatedTime
// }).ToList();
list.ForEach(b =>
{
PrintOrderInfo info = printOrderInfoList.FirstOrDefault(d => d.OrderCode == b.OrderCode);
if (info != null)
{
b.LinerAmount = info.LinerAmount;
b.BoxAmount = info.BoxAmount;
}
});
return list;
}
@ -200,7 +189,8 @@ namespace Admin.Core.Service
OrderBomInfo n = it.Current;
if (n.ParentId.IsNotEmptyOrNull())
{
tlist.Add(n);
if (n.MaterialType == "300" && n.MaterialType == "200")
tlist.Add(n);
}
}
return tlist;

@ -28,18 +28,9 @@ namespace Admin.Core.Tasks
}
public async Task Run(IJobExecutionContext context)
{
if (flag)
{
flag = false;
Console.WriteLine("sa1");
Thread.Sleep(10000);
}
else
{
Console.WriteLine("sa2");
}
await Task.FromResult(true);
Console.WriteLine("sa1");
await Task.FromResult(true);
}
}
}

@ -57,9 +57,6 @@ namespace Aucma.Core.PrintTo
//AutoMapper
services.AddAutoMapperSetup();
//注册业务服务
AddServices(services);
//支持编码大全 例如:支持 System.Text.Encoding.GetEncoding("GB2312") System.Text.Encoding.GetEncoding("GB18030")
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
}
@ -85,19 +82,5 @@ namespace Aucma.Core.PrintTo
// 使用静态文件
app.UseStaticFiles();
}
#region 注册服务
/// <summary>
/// 注册服务
/// </summary>
/// <param name="services"></param>
private static void AddServices(IServiceCollection services)
{
#region 注册服务
//services.AddScoped<IProductPlanInfoServices, ProductPlanInfoServices>();
#endregion
}
#endregion
}
}

@ -32,7 +32,7 @@ namespace Aucma.Core.PrintTo.ViewModels
PrintIsEnabled = "True";
WeakReferenceMessenger.Default.Register<string>(this, Recive);
Task.WaitAll(LoadData());
//Task.WaitAll(LoadData());
}
#region 加载DataGrid数据

@ -179,16 +179,17 @@
SelectedItem="{Binding SelectedCells, Mode=OneWayToSource}">
<DataGrid.Columns>
<DataGridTextColumn Width="1*" Binding="{Binding CreatedTime, StringFormat=\{0:yyy/MM/dd\}}" Header="订单日期" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Width="1*" Binding="{Binding OrderCode}" Header="订单编号" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Width="1*" Binding="{Binding ProductCode}" Header="产品编码" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Width="2*" Binding="{Binding MaterialName}" Header="产品型号" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Width="*" Binding="{Binding PlanAmount}" Header="订单数量" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Width="*" Binding="{Binding LinerAmount}" Header="内胆编码" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Width="*" Binding="{Binding BoxAmount}" Header="箱体编码" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Width="*" Binding="{Binding PrintLinerAmount}" Header="内胆码&#x0a;已打数量" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Width="*" Binding="{Binding PrintBoxAmount}" Header="箱体码&#x0a;已打数量" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Width="*" Binding="{Binding ErrorNum}" Header="异常量" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Width="*" Binding="{Binding CompleteAmount}" Header="剩余" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}" Visibility="Collapsed" />
<DataGridTextColumn Width="1*" Binding="{Binding OrderCode}" Header="订单编号" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Width="1*" Binding="{Binding ProductCode}" Header="产品编码" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Width="2*" Binding="{Binding MaterialName}" Header="产品型号" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Width="*" Binding="{Binding PlanAmount}" Header="订单数量" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Width="*" Binding="{Binding LinerAmount}" Header="内胆编码" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Width="*" Binding="{Binding BoxAmount}" Header="箱体编码" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Width="*" Binding="{Binding PrintLinerAmount}" Header="内胆码&#x0a;已打数量" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Width="*" Binding="{Binding PrintBoxAmount}" Header="箱体码&#x0a;已打数量" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Width="*" Binding="{Binding ErrorNum}" Header="异常量" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}"/>
<DataGridTextColumn Width="*" Binding="{Binding PrintName}" Header="打印名称" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}" />
<DataGridTextColumn Width="*" Binding="{Binding CompleteAmount}" Header="剩余" ElementStyle="{StaticResource DataGridTextColumnCenterSytle}" Visibility="Collapsed" />
</DataGrid.Columns>
</DataGrid>
</UniformGrid>
@ -205,6 +206,7 @@
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
</Grid.RowDefinitions>
<WrapPanel Grid.Row="0" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0 15">
@ -224,12 +226,17 @@
materialDesign:HintAssist.Hint="物料名称" />
</WrapPanel>
<WrapPanel Grid.Row="3" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0 15">
<TextBlock Text="打印名称" FontSize="18" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center" />
<TextBox x:Name="PrintName" Foreground="white" BorderBrush="White" Text="{Binding SelectedItem.PrintName, ElementName=dgvMH}" IsReadOnly="True" Margin="15 0 0 0" FontSize="18" VerticalContentAlignment="Center" HorizontalContentAlignment="Left" Width="{Binding Path=ActualWidth, ElementName=ProductNo}"
materialDesign:HintAssist.Hint="打印名称" />
</WrapPanel>
<WrapPanel Grid.Row="4" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0 15">
<TextBlock Text="打印数量" FontSize="18" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center" />
<Slider x:Name="PlanAmount" FontSize="18" Minimum="0" Maximum="500" BorderBrush="White" Value="{Binding SelectedItem.StandardAmount, ElementName=dgvMH}" Foreground="White" Height="30" VerticalContentAlignment="Center"
HorizontalContentAlignment="Left" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="15 0 0 0" Width="{Binding Path=ActualWidth, ElementName=ProductNo}"/>
<!--<TextBlock Text="1~500" Width="60" Margin="10 0 0 0" Foreground="White" FontWeight="Bold" VerticalAlignment="Center" HorizontalAlignment="Center" />-->
</WrapPanel>
<Border Grid.Row="4" BorderBrush="#0288d1" BorderThickness="1" CornerRadius="5" Margin="20 5" >
<Border Grid.Row="5" BorderBrush="#0288d1" BorderThickness="1" CornerRadius="5" Margin="20 5" >
<StackPanel >
<WrapPanel Height="300">
<RadioButton Content="内胆码-L" Foreground="White" FontSize="18" BorderBrush="White" x:Name="内胆" Margin="30 15" Command="{Binding RadioQueryCommand}" CommandParameter="{Binding Name, ElementName=内胆}"/>
@ -238,7 +245,7 @@
<!--<Button Content="添加" Foreground="White" BorderBrush="#0288d1" Background="#4285DE" HorizontalAlignment="Right" VerticalAlignment="Bottom" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" />-->
</StackPanel>
</Border>
<WrapPanel Grid.Row="5" HorizontalAlignment="Center">
<WrapPanel Grid.Row="6" HorizontalAlignment="Center">
<Button
Background="#4285DE" Height="40"
Content="常规" Width="100" Margin="0 10 0 0" Command="{Binding PrintCommand}" IsEnabled="{Binding PrintIsEnabled}" CommandParameter="{Binding ElementName=ProductNo,Path=Text}"/>

@ -43,8 +43,7 @@
"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;",
"Connection": "Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=10.100.72.20)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=ORCLCDB)));User ID=c##aucma_sacda;Password=aucma;",
"ProviderName": "System.Data.SqlClient"
},
{
@ -52,7 +51,7 @@
"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;",
"Connection": "Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=10.100.72.20)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=ORCLCDB)));User ID=c##aucma_mes;Password=aucma;",
"ProviderName": "System.Data.SqlClient"
}
],

@ -211,8 +211,8 @@ namespace Aucma.Core.Tasks
#region 实时计划显示
public void RealTimePlanRun()
{
var model = _taskExecutionServices.FirstAsync(d => d.ExecuteStatus == 2).Result;
SmShowDelegateEvent?.Invoke(model);
//var model = _taskExecutionServices.FirstAsync(d => d.ExecuteStatus == 2).Result;
//SmShowDelegateEvent?.Invoke(model);
}
#endregion

Loading…
Cancel
Save