liulb@mesnac.com 1 year ago
parent 7c54fd5f7b
commit cb837c5611

@ -546,6 +546,16 @@
更新时间
</summary>
</member>
<member name="P:Admin.Core.Model.Model_New.OldBoxFoamType.MaterialCode">
<summary>
产品型号
</summary>
</member>
<member name="P:Admin.Core.Model.Model_New.OldBoxFoamType.MaterialName">
<summary>
产品名称
</summary>
</member>
<member name="T:Admin.Core.Model.Model_New.OrderBomInfo">
<summary>
SAP BOM 信息
@ -1366,11 +1376,21 @@
物料名称
</summary>
</member>
<member name="P:Admin.Core.Model.BoxFoamPlan.OrderCode">
<summary>
SAP订单编码
</summary>
</member>
<member name="P:Admin.Core.Model.BoxFoamPlan.PlanAmount">
<summary>
计划数量
</summary>
</member>
<member name="P:Admin.Core.Model.BoxFoamPlan.ProductLineCode">
<summary>
产线
</summary>
</member>
<member name="P:Admin.Core.Model.BoxFoamPlan.UpdateTime">
<summary>
更新时间

@ -1238,8 +1238,8 @@
"D:\\Project\\gitea\\AUCMA\\SCADA\\Admin.Core.IService\\Admin.Core.IService.csproj": {
"projectPath": "D:\\Project\\gitea\\AUCMA\\SCADA\\Admin.Core.IService\\Admin.Core.IService.csproj"
},
"D:\\Project\\gitea\\AUCMA\\SCADA\\Aucma.Core.PLc\\Aucma.Core.PLc.csproj": {
"projectPath": "D:\\Project\\gitea\\AUCMA\\SCADA\\Aucma.Core.PLc\\Aucma.Core.PLc.csproj"
"D:\\Project\\gitea\\AUCMA\\SCADA\\Aucma.Core.HwPLc\\Aucma.Core.HwPLc.csproj": {
"projectPath": "D:\\Project\\gitea\\AUCMA\\SCADA\\Aucma.Core.HwPLc\\Aucma.Core.HwPLc.csproj"
}
}
}

@ -4242,7 +4242,7 @@
"dependencies": {
"Admin.Core.Common": "1.0.0",
"Admin.Core.IService": "1.0.0",
"Aucma.Core.PLc": "1.0.0"
"Aucma.Core.HwPLc": "1.0.0"
},
"compile": {
"bin/placeholder/Aucma.Core.Tasks.dll": {}

@ -1,6 +1,6 @@
{
"version": 2,
"dgSpecHash": "fbBV4ohCpQ4tS1CZehkGz8FzvBy3W1ZgjJtJwKbO0UVSf1BnliGYGI+Eknp9PrG2Bzwmirj5uYJZhHC5mDx/2Q==",
"dgSpecHash": "ikzDviTkPCZihaCgfwo8AuzSJtovmijOXuLwxKtGKgxnoK/TUK28Ezke2gSYzzQArjgQtsTmEg3YwxUUY0FkCg==",
"success": true,
"projectFilePath": "D:\\Project\\gitea\\AUCMA\\SCADA\\Admin.Core.Api\\Admin.Core.Api.csproj",
"expectedPackageFiles": [

@ -19,10 +19,16 @@ namespace Admin.Core.IService
/// <returns></returns>
Task<CurrentTeamTimeView> GetTeamData(DateTime nowDate);
/// <summary>
/// 获取当前班组
/// 根据code获取当前班组所在工时
/// </summary>
/// <param name="nowDate"></param>
/// <returns></returns>
Task<ProductInfoView> GetStationData(string code);
/// <summary>
/// 获取当前班组
/// </summary>
/// <param name="nowDate"></param>
/// <returns></returns>
Task<List<CurrentTeamTimeView>> GetTeamData();
}
}

@ -50,5 +50,10 @@ namespace Admin.Core.Model
/// </summary>
[SugarColumn(ColumnName = "CREATE_TIME")]
public DateTime CreateTime { get; set; }
/// <summary>
/// 计划完成数量
/// </summary>
[SugarColumn(ColumnName = "COMPLATE_AMOUNT")]
public int CompleteAmount { get; set; }
}
}

@ -6,7 +6,7 @@ namespace Admin.Core.Model
/// <summary>
/// 存储当班班组
/// </summary>
[SugarTable("CURRENTTEAMTIME", "AUCMA_SCADA")]
[SugarTable("BOX_CURRENTTEAMTIME", "AUCMA_SCADA")]
public class CurrentTeamTime
{
/// <summary>

@ -8,4 +8,4 @@ build_property.PlatformNeutralAssembly =
build_property.EnforceExtendedAnalyzerRules =
build_property._SupportedPlatformList = Linux,macOS,Windows
build_property.RootNamespace = Admin.Core.Model
build_property.ProjectDir = E:\c#\AUCMA\new\Admin.Core.Model\
build_property.ProjectDir = D:\Project\gitea\AUCMA\SCADA\Admin.Core.Model\

@ -25,7 +25,11 @@ namespace Admin.Core.IService
base.BaseDal = dal;
_sysUserInfoRepository = sysUserInfoRepository;
}
public async Task<List<CurrentTeamTimeView>> GetTeamData()
{
return await _sysUserInfoRepository.GetTeamData();
}
public async Task<CurrentTeamTimeView> GetTeamData(DateTime nowDate)
{
var list= await _sysUserInfoRepository.GetTeamData();

@ -26,7 +26,8 @@ namespace Admin.Core.Tasks
private static readonly log4net.ILog logHelper = LogManager.GetLogger(typeof(Job_BoxFoamData_Quartz));
private readonly IBoxFoamDataServices _boxFoamDataServices;
private readonly IBoxFoamDataServices _oldBoxFoamDataServices;
public Job_BoxFoamData_Quartz(ISysTasksQzService SysTasksQzService, ISysJobLogService sysJobLogService,
IBoxFoamDataServices boxFoamDataServices, IBoxFoamDataServices oldBoxFoamDataServices)
{

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0-windows</TargetFramework>
<Nullable>enable</Nullable>
<UseWPF>true</UseWPF>

@ -9,6 +9,7 @@ using Admin.Core.Service;
using Admin.Core.Tasks;
using Aucma.Core.RunPlc;
using Aucma.Core.Scanner;
using Aucma.Core.Tasks;
using Autofac;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
@ -66,6 +67,7 @@ namespace Aucma.Core.OldBoxFoam
services.AddJobSetup();
//PLC
services.AddPlcSetup();
services.AddAucmaTaskSetup();
//支持编码大全 例如:支持 System.Text.Encoding.GetEncoding("GB2312") System.Text.Encoding.GetEncoding("GB18030")
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
}
@ -86,7 +88,7 @@ namespace Aucma.Core.OldBoxFoam
/// </summary>
/// <param name="app"></param>
/// <param name="env"></param>
public void Configure(IApplicationBuilder app, ISysTasksQzService tasksQzService,
public void Configure(IApplicationBuilder app, IAucamTaskService aucamTaskService,
ISchedulerCenter schedulerCenter, IRunPlcService runPlcService)
{
// 使用静态文件
@ -95,7 +97,8 @@ namespace Aucma.Core.OldBoxFoam
//app.UseAuthorization();
// 开启QuartzNetJob调度服务
app.UseQuartzJobMildd(tasksQzService, schedulerCenter);
// app.UseQuartzJobMildd(tasksQzService, schedulerCenter);
app.AucmaTaskMildds(aucamTaskService);
//PLC
app.UsePlcMildd(runPlcService);
}

@ -5,14 +5,19 @@ using Admin.Core.Model.ViewModels;
using Admin.Core.Service;
using Admin.Core.Tasks;
using Aucma.Core.OldBoxFoam.Models;
using Aucma.Core.Tasks;
using CommunityToolkit.Mvvm.ComponentModel;
using log4net;
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Timers;
using System.Windows.Documents;
/**
* 线
* */
@ -22,56 +27,49 @@ namespace Aucma.Core.OldBoxFoam.ViewModels
{
IBoxFoamDataServices? _oldBoxFoamDataServices;
IOldBoxFoamTypeServices _oldBoxFoamTypeServices;
public static System.Threading.Timer GetStoreTimer;
private readonly IBoxFoamPlanServices _boxFoamPlanServices;
private readonly ISysUserInfoServices _sysUserInfoServices;
private static readonly log4net.ILog log = LogManager.GetLogger(typeof(OldBoxFoamPageViewModel));
System.Timers.Timer timer1 = new System.Timers.Timer(2000);
System.Timers.Timer timer2 = new System.Timers.Timer(2000);
public OldBoxFoamPageViewModel() {
_oldBoxFoamDataServices = App.ServiceProvider.GetService<IBoxFoamDataServices>();
_oldBoxFoamTypeServices = App.ServiceProvider.GetService<IOldBoxFoamTypeServices>();
_boxFoamPlanServices = App.ServiceProvider.GetService<IBoxFoamPlanServices>();
_sysUserInfoServices = App.ServiceProvider.GetService<ISysUserInfoServices>();
//Job_OldBoxFoam_Quartz.RefreshOldBoxFoamTypeDataDelegateEvent += OldBoxFoamTypeOnLoad3;
AucamTaskService.RefreshOldBoxFoamDataDelegateEvent += OldBoxFoamOnLoad3;
//GetStoreTimer = new System.Threading.Timer(OldBoxFoamOnLoad, null, 0, Timeout.Infinite);
//Task.WaitAll(OldBoxFoamOnLoad());
timer1.Elapsed += new System.Timers.ElapsedEventHandler(OldBoxFoamOnLoad); //到达时间的时候执行事件;
timer1.AutoReset = true;//设置是执行一次false还是一直执行(true)
timer1.Enabled = true;//需要调用 timer.Start()或者timer.Enabled = true来启动它
timer1.Start();//timer.Start()的内部原理还是设置timer.Enabled = true;
Job_OldBoxFoam_Quartz.RefreshOldBoxFoamTypeDataDelegateEvent += OldBoxFoamTypeOnLoad3;
Job_OldBoxFoam_Quartz.RefreshOldBoxFoamDataDelegateEvent += OldBoxFoamOnLoad3;
// Task.WaitAll(OldBoxFoamOnLoad(), OldBoxFoamTypeOnLoad());
timer2.Elapsed += new System.Timers.ElapsedEventHandler(OldBoxFoamOnLoad); //到达时间的时候执行事件;
timer2.AutoReset = true;//设置是执行一次false还是一直执行(true)
timer2.Enabled = true;//需要调用 timer.Start()或者timer.Enabled = true来启动它
timer2.Start();//timer.Start()的内部原理还是设置timer.Enabled = true;
}
#region 初始化加载数据
public async Task OldBoxFoamOnLoad()
{
List<BoxFoamData> list = await _oldBoxFoamDataServices.QueryAsync();
if (list == null) return;
int i = 0;
foreach (var item in list)
{
OldBoxFoamDataModel model = new OldBoxFoamDataModel();
model.ObjId = item.ObjId;
model.Fixtureboxtype = item.Fixtureboxtype;
model.Fixturestatus = item.Fixturestatus;
model.Production = item.Production;
model.CuringTimeSettingValue = item.CuringTimeSettingValue;
if (item.Fixturestatus == 1)//停止
{
_statusColor.Add("green");
}
else
{
_statusColor.Add("red");
}
_fixtureName.Add(item.Fixtureboxtype);
_production.Add(item.Production);
_beat.Add(item.BoxBeat);
i =+ item.Production;
}
_totle = list.Sum(d=>d.Production);
}
public Task OldBoxFoamOnLoad3(List<BoxFoamData> list)
private void OldBoxFoamOnLoad(object? sender, ElapsedEventArgs e)
{
if (list == null) return Task.CompletedTask;
System.Windows.Application.Current.Dispatcher.Invoke((Action)( () =>
try
{
OldBoxFoamDataGrid.Clear();
_fixtureName.Clear();
_production.Clear();
_beat.Clear();
_statusColor.Clear();
List<BoxFoamData> list = _oldBoxFoamDataServices.QueryAsync().Result;
if (list == null) return;
int i = 0;
foreach (var item in list)
var prderList= list.OrderBy(d=>d.MainId);
foreach (var item in prderList)
{
OldBoxFoamDataModel model = new OldBoxFoamDataModel();
model.ObjId = item.ObjId;
@ -93,9 +91,71 @@ namespace Aucma.Core.OldBoxFoam.ViewModels
_beat.Add(item.BoxBeat);
i = +item.Production;
}
}));
return Task.CompletedTask;
_totle = list.Sum(d => d.Production);
}
catch (Exception ex)
{
log.Error("获取库存接口数据异常." + ex.Message);
}
finally
{
if (GetStoreTimer != null)
{
GetStoreTimer.Change(20000, Timeout.Infinite);
}
}
}
public async Task OldBoxFoamOnLoad3(List<BoxFoamData> list)
{
try
{
// List<BoxFoamData> list = await _oldBoxFoamDataServices.QueryAsync();
if (list == null) return;
System.Windows.Application.Current.Dispatcher.Invoke((Action)(() =>
{
_fixtureName.Clear();
_production.Clear();
_beat.Clear();
_statusColor.Clear();
OldBoxFoamDataGrid.Clear();
int i = 0;
var prderList = list.OrderBy(d => d.MainId);
foreach (var item in prderList)
{
OldBoxFoamDataModel model = new OldBoxFoamDataModel();
model.ObjId = item.ObjId;
model.Fixtureboxtype = item.Fixtureboxtype;
model.Fixturestatus = item.Fixturestatus;
model.Production = item.Production;
model.CuringTimeSettingValue = item.CuringTimeSettingValue;
if (item.Fixturestatus == 1)//停止
{
_statusColor.Add("green");
}
else
{
_statusColor.Add("red");
}
_fixtureName.Add(item.Fixtureboxtype);
_production.Add(item.Production);
_beat.Add(item.BoxBeat);
i = +item.Production;
}
}));
}
catch (Exception ex)
{
log.Error("获取库存接口数据异常." + ex.Message);
}
finally
{
if (GetStoreTimer != null)
{
GetStoreTimer.Change(10000, Timeout.Infinite);
}
}
}
public async Task OldBoxFoamTypeOnLoad()
{
@ -200,5 +260,41 @@ namespace Aucma.Core.OldBoxFoam.ViewModels
set => SetProperty(ref _totle, value);
}
#endregion
/// <summary>
/// 将采集到的数据梳理
/// </summary>
/// <param name="mode"></param>
public async void RealTimeFoamingTask(object? sender, ElapsedEventArgs e)
{
var list = _boxFoamPlanServices.QueryAsync().Result;
//根据夹具找箱型找货道,根据货道找物料
var spaceList=await _oldBoxFoamTypeServices.QueryAsync(d=>d.Boxtype== mode);
if (spaceList.Count>0)
{
OldBoxFoamType type= spaceList.FirstOrDefault();
BoxFoamPlan plan= list.FirstOrDefault(d=>d.MaterialCode== type.MaterialCode);
if (plan!=null)
{
plan.CompleteAmount = plan.CompleteAmount + 1;
_boxFoamPlanServices.UpdateAsync(plan);
}
}
}
public CurrentTeamTimeView GetTeamHour()
{
DateTime now = DateTime.Now;
var list = _sysUserInfoServices.GetTeamData().Result;
if (list != null)
{
//var obj = list.FirstOrDefault().EndTime.ToString("HH:mm");
var view = list.FirstOrDefault();
return view;
}
return null;
}
}
}

@ -98,7 +98,7 @@
"ID": 1,
"Name": "OldBoxFoam",
"JobGroup": "DEFAULT",
"Cron": "*/5 * * * * ?",
"Cron": "*/15 * * * * ?",
"AssemblyName": "Admin.Core.Tasks",
"ClassName": "Job_OldBoxFoam_Quartz",
"Remark": "执行老发泡线任务调度系统",
@ -108,7 +108,29 @@
"TriggerType": 1,
"IntervalSecond": 5,
"CycleRunTimes": 1,
"IsStart": true,
"IsStart": false,
"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": "OldBoxFoam",
"JobGroup": "DEFAULT",
"Cron": "*/15 * * * * ?",
"AssemblyName": "Admin.Core.Tasks",
"ClassName": "Job_OldBoxFoam2_Quartz",
"Remark": "执行老发泡线任务调度系统",
"RunTimes": 3881,
"BeginTime": "2023-04-23 11:08:50.000",
"EndTime": "2123-12-01 16:45:30.000",
"TriggerType": 1,
"IntervalSecond": 5,
"CycleRunTimes": 1,
"IsStart": false,
"JobParams": null,
"DelFlag": false,
"CreateBy": "admin",
@ -161,6 +183,9 @@
},
"Middleware": {
"QuartzNetJob": {
"Enabled": false
},
"AucamTask": {
"Enabled": true
},
"Plc": {

File diff suppressed because it is too large Load Diff

@ -9,7 +9,7 @@
<ItemGroup>
<ProjectReference Include="..\Admin.Core.Common\Admin.Core.Common.csproj" />
<ProjectReference Include="..\Admin.Core.IService\Admin.Core.IService.csproj" />
<ProjectReference Include="..\Aucma.Core.PLc\Aucma.Core.PLc.csproj" />
<ProjectReference Include="..\Aucma.Core.HwPLc\Aucma.Core.HwPLc.csproj" />
</ItemGroup>
</Project>

@ -1,7 +1,7 @@
using Admin.Core.Common;
using Admin.Core.IService;
using Admin.Core.Model;
using Aucma.Core.PLc;
using Aucma.Core.HwPLc;
using log4net;
using System;
using System.Linq;

@ -1,5 +1,5 @@
using Admin.Core.IService;
using Aucma.Core.PLc;
using Aucma.Core.HwPLc;
using log4net;
/// <summary>

@ -1,6 +1,6 @@
using Admin.Core.IService;
using Admin.Core.Model;
using Aucma.Core.PLc;
using Aucma.Core.HwPLc;
using log4net;
/// <summary>

@ -5,7 +5,7 @@ using System.Threading.Tasks;
using Admin.Core.IRepository;
using Admin.Core.Model.Model_New;
using System.Collections.Generic;
using Aucma.Core.PLc;
using Aucma.Core.HwPLc;
using System.Linq;
using Admin.Core.Model;

Loading…
Cancel
Save