diff --git a/Admin.Core.Api/Admin.Core.Model.xml b/Admin.Core.Api/Admin.Core.Model.xml
index 627bd715..4d660a64 100644
--- a/Admin.Core.Api/Admin.Core.Model.xml
+++ b/Admin.Core.Api/Admin.Core.Model.xml
@@ -4576,6 +4576,36 @@
工位
+
+
+ 产线编码
+
+
+
+
+ 产线编码
+
+
+
+
+ 时间
+
+
+
+
+ 小时
+
+
+
+
+ 背板数量
+
+
+
+
+ 前板数量
+
+
条码绑定扫描类型统计
diff --git a/Admin.Core.IRepository/IRepository_New/IExecutePlanInfoRepository.cs b/Admin.Core.IRepository/IRepository_New/IExecutePlanInfoRepository.cs
index 5c31e18c..420d63e9 100644
--- a/Admin.Core.IRepository/IRepository_New/IExecutePlanInfoRepository.cs
+++ b/Admin.Core.IRepository/IRepository_New/IExecutePlanInfoRepository.cs
@@ -12,5 +12,7 @@ namespace Admin.Core.IRepository
{
Task> GetStationMaterialStats(string stationCode);
Task> GetStationHourAmount(string stationCode);
+
+ Task> GetStationSheetMetalHourAmountAsync(string stationCode);
}
}
\ No newline at end of file
diff --git a/Admin.Core.IRepository/IRepository_New/ISysUserInfoRepository.cs b/Admin.Core.IRepository/IRepository_New/ISysUserInfoRepository.cs
index 3c074a5c..724c35a4 100644
--- a/Admin.Core.IRepository/IRepository_New/ISysUserInfoRepository.cs
+++ b/Admin.Core.IRepository/IRepository_New/ISysUserInfoRepository.cs
@@ -27,11 +27,6 @@ namespace Admin.Core.IRepository
///
///
Task> GetProductLineInfo(string productLineCode);
- ///
- /// 根据工位查询时间
- ///
- ///
- ///
- List GetStationHourAmountAsync(string stationCode);
+
}
}
\ No newline at end of file
diff --git a/Admin.Core.IService/IService_New/IExecutePlanInfoServices.cs b/Admin.Core.IService/IService_New/IExecutePlanInfoServices.cs
index 46f6967e..273d5c40 100644
--- a/Admin.Core.IService/IService_New/IExecutePlanInfoServices.cs
+++ b/Admin.Core.IService/IService_New/IExecutePlanInfoServices.cs
@@ -107,6 +107,10 @@ namespace Admin.Core.IService
///
///
Task> GetStationMaterialStats(string stationCode);
+
+ Task> GetStationSheetMetalHourAmountAsync(string stationCode);
+
+
#endregion
}
}
\ No newline at end of file
diff --git a/Admin.Core.IService/IService_New/ISysUserInfoServices.cs b/Admin.Core.IService/IService_New/ISysUserInfoServices.cs
index 3d770376..ed361950 100644
--- a/Admin.Core.IService/IService_New/ISysUserInfoServices.cs
+++ b/Admin.Core.IService/IService_New/ISysUserInfoServices.cs
@@ -36,11 +36,6 @@ namespace Admin.Core.IService
///
///
Task GetProductLineInfo(string productLineCode);
- ///
- /// 根据工位查询小时
- ///
- ///
- ///
- List GetStationHourAmountAsync(string stationCode);
+
}
}
\ No newline at end of file
diff --git a/Admin.Core.Model/ViewModels/StationHourAmountView.cs b/Admin.Core.Model/ViewModels/StationHourAmountView.cs
new file mode 100644
index 00000000..a02e588b
--- /dev/null
+++ b/Admin.Core.Model/ViewModels/StationHourAmountView.cs
@@ -0,0 +1,44 @@
+using SqlSugar;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Admin.Core.Model.ViewModels
+{
+ public class StationHourAmountView
+ {
+ ///
+ /// 产线编码
+ ///
+ [SugarColumn(ColumnName = "ROWNUM")]
+ public string RowNum { get; set; }
+ ///
+ /// 产线编码
+ ///
+ [SugarColumn(ColumnName = "PRODUCTLINE_CODE")]
+ public string ProductlineCode { get; set; }
+
+ ///
+ /// 时间
+ ///
+ [SugarColumn(ColumnName = "PRODUCT_DATE")]
+ public string ProductDate { get; set; }
+ ///
+ /// 小时
+ ///
+ [SugarColumn(ColumnName = "PRODUCT_HOUR")]
+ public string ProductHour { get; set; }
+ ///
+ /// 背板数量
+ ///
+ [SugarColumn(ColumnName = "BACKPANELHOURAMOUNT")]
+ public string BackPanelHourAmount { get; set; }
+ ///
+ /// 前板数量
+ ///
+ [SugarColumn(ColumnName = "SIDPANELHOURAMOUNT")]
+ public string SidPanelHourAmount { get; set; }
+ }
+}
diff --git a/Admin.Core.Repository/Repository_New/ExecutePlanInfoRepository.cs b/Admin.Core.Repository/Repository_New/ExecutePlanInfoRepository.cs
index c8eb6bf6..89bf2811 100644
--- a/Admin.Core.Repository/Repository_New/ExecutePlanInfoRepository.cs
+++ b/Admin.Core.Repository/Repository_New/ExecutePlanInfoRepository.cs
@@ -2,6 +2,7 @@
using Admin.Core.Model;
using SqlSugar;
using System.Collections.Generic;
+using System.Linq;
using System.Threading.Tasks;
namespace Admin.Core.Repository
@@ -24,5 +25,15 @@ namespace Admin.Core.Repository
{
return await Db.Queryable().AS("GET_STATION_HOURAMOUNT").Where("PRODUCTLINE_CODE = @stationCode", new { stationCode = stationCode }).ToListAsync();
}
+
+ ///
+ /// 获取钣金生产小时数
+ ///
+ ///
+ ///
+ public async Task> GetStationSheetMetalHourAmountAsync(string stationCode)
+ {
+ return await Db.Queryable().AS("GET_STATION_SHEETMETALHOURAMOUNT").ToListAsync();
+ }
}
}
\ No newline at end of file
diff --git a/Admin.Core.Repository/Repository_New/SysUserInfoRepository.cs b/Admin.Core.Repository/Repository_New/SysUserInfoRepository.cs
index 6d35c4ae..e95aaf86 100644
--- a/Admin.Core.Repository/Repository_New/SysUserInfoRepository.cs
+++ b/Admin.Core.Repository/Repository_New/SysUserInfoRepository.cs
@@ -6,6 +6,7 @@ using Admin.Core.Model.Model_New;
using System.Collections.Generic;
using System;
using Microsoft.IdentityModel.Logging;
+using System.Linq;
namespace Admin.Core.Repository
{
@@ -56,24 +57,6 @@ namespace Admin.Core.Repository
#endregion
- ///
- /// 获取班组小时数
- ///
- ///
- ///
- public List GetStationHourAmountAsync(string stationCode)
- {
- List result = null;
- try
- {
- result = Db.Queryable().AS("GET_STATION_HOURAMOUNT").Where("PRODUCTLINE_CODE = @stationCode", new { stationCode = stationCode }).ToList();
-
- }
- catch (Exception ex)
- {
-
- }
- return result;
- }
+
}
}
\ No newline at end of file
diff --git a/Admin.Core.Service/Service_New/ExecutePlanInfoServices.cs b/Admin.Core.Service/Service_New/ExecutePlanInfoServices.cs
index 13942e25..87eb28d9 100644
--- a/Admin.Core.Service/Service_New/ExecutePlanInfoServices.cs
+++ b/Admin.Core.Service/Service_New/ExecutePlanInfoServices.cs
@@ -23,12 +23,13 @@ namespace Admin.Core.Service
private readonly IProductPlanInfoServices _productPlanInfoServices;
public ExecutePlanInfoServices(IBaseRepository dal, IProductOrderInfoServices productOrderInfoServices,
- IProductPlanInfoServices productPlanInfoServices)
+ IProductPlanInfoServices productPlanInfoServices, IExecutePlanInfoRepository executePlanInfoRepository)
{
this._dal = dal;
base.BaseDal = dal;
_productOrderInfoServices = productOrderInfoServices;
_productPlanInfoServices = productPlanInfoServices;
+ _executePlanInfoRepository = executePlanInfoRepository;
}
#region 计划删除
@@ -385,5 +386,15 @@ namespace Admin.Core.Service
}
return planInfos;
}
+
+ ///
+ /// 获取钣金生产小时数
+ ///
+ ///
+ ///
+ public async Task> GetStationSheetMetalHourAmountAsync(string stationCode)
+ {
+ return await _executePlanInfoRepository.GetStationSheetMetalHourAmountAsync(stationCode);
+ }
}
}
\ No newline at end of file
diff --git a/Admin.Core.Service/Service_New/SysUserInfoServices.cs b/Admin.Core.Service/Service_New/SysUserInfoServices.cs
index 47a49b81..47ca4939 100644
--- a/Admin.Core.Service/Service_New/SysUserInfoServices.cs
+++ b/Admin.Core.Service/Service_New/SysUserInfoServices.cs
@@ -29,14 +29,14 @@ namespace Admin.Core.IService
public async Task> GetTeamData()
{
return await _sysUserInfoRepository.GetTeamData();
-
+
}
public async Task GetTeamData(DateTime nowDate)
{
- var list= await _sysUserInfoRepository.GetTeamData();
+ var list = await _sysUserInfoRepository.GetTeamData();
if (list.Count() == 0) return null;
- CurrentTeamTimeView view = list.SingleOrDefault(d=>d.StartTime<= nowDate && nowDate <= d.EndTime);
+ CurrentTeamTimeView view = list.SingleOrDefault(d => d.StartTime <= nowDate && nowDate <= d.EndTime);
if (view != null)
return view;
else
@@ -67,14 +67,7 @@ namespace Admin.Core.IService
var obj = list.SingleOrDefault(d => d.ProductlineCode == productLineCode);
return obj;
}
- ///
- /// 根据工位查询小时
- ///
- ///
- ///
- public List GetStationHourAmountAsync(string stationCode)
- {
- return _sysUserInfoRepository.GetStationHourAmountAsync(stationCode);
- }
+
+
}
}
\ No newline at end of file
diff --git a/Aucma.Core.OldBoxFoam/ViewModels/OldBoxFoamPageViewModel.cs b/Aucma.Core.OldBoxFoam/ViewModels/OldBoxFoamPageViewModel.cs
index ef097755..5c658f63 100644
--- a/Aucma.Core.OldBoxFoam/ViewModels/OldBoxFoamPageViewModel.cs
+++ b/Aucma.Core.OldBoxFoam/ViewModels/OldBoxFoamPageViewModel.cs
@@ -2,28 +2,19 @@
using Admin.Core.IService;
using Admin.Core.Model;
using Admin.Core.Model.Model_New;
-using Admin.Core.Model.ViewModels;
-using Admin.Core.Service;
-using Admin.Core.Tasks;
using Aucma.Core.HwPLc;
using Aucma.Core.OldBoxFoam.Business;
using Aucma.Core.OldBoxFoam.Models;
-using Aucma.Core.Tasks;
using CommunityToolkit.Mvvm.ComponentModel;
using log4net;
using Microsoft.Extensions.DependencyInjection;
-using NPOI.SS.Formula.Functions;
using System;
-using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
-using System.Numerics;
-using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Timers;
-using System.Windows.Documents;
/**
* 老发泡线监控
* */
@@ -300,7 +291,6 @@ namespace Aucma.Core.OldBoxFoam.ViewModels
BoxFoamDataRealTime bfd = bfds.SingleOrDefault(d => d.FixtureBoxtype == bLis[j].FixtureBoxType && d.SerialNumber == bLis[j].ObjId);
if (bfd != null)
{
-
//更新计划数量
complateAmount = bLis[j].Yield - bfd.FixtureProductioncapacity;
UpdateClampData(bLis[j], bfd);
diff --git a/Aucma.Core.SheetMetal/ViewModels/IndexPageViewModel.cs b/Aucma.Core.SheetMetal/ViewModels/IndexPageViewModel.cs
index 5f99734f..c7b440b0 100644
--- a/Aucma.Core.SheetMetal/ViewModels/IndexPageViewModel.cs
+++ b/Aucma.Core.SheetMetal/ViewModels/IndexPageViewModel.cs
@@ -11,21 +11,15 @@ using System.Threading.Tasks;
using Admin.Core.IService;
using Microsoft.Extensions.DependencyInjection;
using Aucma.Core.SheetMetal.Common;
-using Admin.Core.Tasks;
-using CommunityToolkit.Mvvm.Messaging;
using LiveCharts;
using LiveCharts.Wpf;
using Admin.Core.Model;
using System.Windows.Media;
-using log4net;
using Admin.Core.Common;
using LiveCharts.Defaults;
using Aucma.Core.SheetMetal.Business;
-using static Aucma.Core.SheetMetal.Business.SheetMetalPlanTaskHandle;
-using System.Threading;
-using NetTaste;
-using Aucma.Core.HwPLc;
-using Admin.Core.Model.ViewModels;
+using Admin.Core.Service;
+using NPOI.SS.Formula.Functions;
/*
* 首页信息
*/
@@ -34,9 +28,9 @@ namespace Aucma.Core.SheetMetal.ViewModels
public partial class IndexPageViewModel : ObservableObject
{
protected readonly IExecutePlanInfoServices? _taskExecutionPlanInfoServices;
- protected readonly ISysUserInfoServices? _sysUserInfoServices;
- //private SheetMetalPlanTaskHandle _taskHandle = new SheetMetalPlanTaskHandle();
-
+ protected readonly IRecordBackPanelComplateServices _recordBackPanelComplateServices;
+ protected readonly IRecordSidePanelComplateServices _recordSidePanelComplateServices;
+ protected readonly IBaseBomInfoServices _baseBomInfoServices;
private AppConfigHelper appConfig = new AppConfigHelper();
List list = new List() { new SelectModel()
{
@@ -55,14 +49,16 @@ namespace Aucma.Core.SheetMetal.ViewModels
{
_stationName = Appsettings.app("StationInfo", "StationName");//工位名称
_taskExecutionPlanInfoServices = App.ServiceProvider.GetService();
- _sysUserInfoServices = App.ServiceProvider.GetService();
+ _recordBackPanelComplateServices = App.ServiceProvider.GetService();
+ _recordSidePanelComplateServices = App.ServiceProvider.GetService();
+ _baseBomInfoServices = App.ServiceProvider.GetService();
//Job_SheetMetalTask_Quartz.SmEverDayDelegateEvent += InitEveryDayMethod;
//Job_SheetMetalTask_Quartz.SmTaskDelegateEvent += UpdatePlanSHow;//计划内容展示
//WeakReferenceMessenger.Default.Register(this, Recive);
Task.WaitAll(LoadData());
- //InitEveryDayMethod();
AddSelectData();//添加下拉菜单
- //RefreshHourAmount();//小时产量
+ RefreshHourAmount();//小时产量
+ //RefreshMaterialStats();//型号产量
SheetMetalPlanTaskHandle.RefreshCurrentPlanInfoEvent += RefreshCurrentPlanInfo;
}
@@ -669,17 +665,20 @@ namespace Aucma.Core.SheetMetal.ViewModels
App.Current.Dispatcher.Invoke((Action)(() =>
{
//获取小时产量
- string stationCode = Appsettings.app("StoreInfo", "StationCode");
- List hourAmount = _sysUserInfoServices.GetStationHourAmountAsync(stationCode);
+ string stationCode = Appsettings.app("StationInfo", "StationCode");
+ List hourAmount = _taskExecutionPlanInfoServices.GetStationSheetMetalHourAmountAsync(stationCode).Result;
if (hourAmount != null)
{
Achievement.Clear();
ProductionHourList = new List();
- ChartValues hourAchievement = new ChartValues();
+ //ChartValues hourAchievement = new ChartValues();
+ ChartValues hourAchievement = new ChartValues();
foreach (var item in hourAmount)
{
+ ObservablePoint point=new ObservablePoint(Convert.ToInt32(item.SIDPANELHOURAMOUNT), Convert.ToInt32(item.BACKPANELHOURAMOUNT));
ProductionHourList.Add(item.PRODUCT_HOUR);
- hourAchievement.Add(Convert.ToDouble(item.PRODUCT_AMOUNT));
+ hourAchievement.Add(point);
+ //hourAchievement.Add(Convert.ToDouble(item.PRODUCT_AMOUNT));
}
var houeColumn = new ColumnSeries();
houeColumn.DataLabels = true;
@@ -689,7 +688,57 @@ namespace Aucma.Core.SheetMetal.ViewModels
Achievement.Add(houeColumn);
}
}));
- }
+ }
#endregion
+
+
+
+ #region 刷新物料型号统计
+ ///
+ /// 刷新物料型号统计
+ ///
+ private void RefreshMaterialStats()
+ {
+ App.Current.Dispatcher.Invoke((Action)(() =>
+ {
+
+ //获取物料型号统计
+ string stationCode = Appsettings.app("StationInfo", "StationCode");
+ List materialStats = _taskExecutionPlanInfoServices.GetStationMaterialStats(stationCode).Result;
+ var baseBomInfoList = _baseBomInfoServices.QueryAsync().Result;
+ var taskExecutionPlanInfo=_taskExecutionPlanInfoServices.QueryAsync(d=>d.ProductLineCode== stationCode).Result;
+ var recordBackPanelList = _recordBackPanelComplateServices.QueryAsync().Result;
+
+ //有问题,需要修改才可以
+ var list = (from d in recordBackPanelList
+ join t in taskExecutionPlanInfo on d.PlanCode equals t.TaskCode
+ join b in baseBomInfoList on d.MaterialCode equals b.MaterialCode
+ select new
+ {
+ MaterialCode=b.MaterialCode,
+ ProductPlanCode=t.ProductPlanCode,
+ CompleteAmount= t.CompleteAmount
+ }).ToList();
+
+ if (list != null)
+ {
+ ModelStatistics.Clear();
+ MaterialNameList = new List();
+ ChartValues materialAchievement = new ChartValues();
+ foreach (var item in materialStats)
+ {
+ MaterialNameList.Add(item.MATERIAL_NAME);
+ materialAchievement.Add(Convert.ToDouble(item.PRODUCT_AMOUNT));
+ }
+ var materialColumn = new ColumnSeries();
+ materialColumn.DataLabels = true;
+ materialColumn.Title = "型号";
+ materialColumn.Values = materialAchievement;
+ materialColumn.Foreground = Brushes.White;
+ ModelStatistics.Add(materialColumn);
+ }
+ }));
+ #endregion
+ }
}
}
diff --git a/Aucma.Core.SheetMetal/ViewModels/MainWindowViewModel.cs b/Aucma.Core.SheetMetal/ViewModels/MainWindowViewModel.cs
index 8aa09389..515f5293 100644
--- a/Aucma.Core.SheetMetal/ViewModels/MainWindowViewModel.cs
+++ b/Aucma.Core.SheetMetal/ViewModels/MainWindowViewModel.cs
@@ -10,7 +10,7 @@ using System.Windows.Interop;
using System.Collections.ObjectModel;
using Admin.Core.Common;
using System.IO;
-using Aucma.Core.PLc;
+using Aucma.Core.HwPLc;
using Aucma.Core.Scanner;
using System.Linq;
using System.Threading.Tasks;
diff --git a/Aucma.Core.SheetMetal/appsettings.json b/Aucma.Core.SheetMetal/appsettings.json
index 8114a567..f3054b0d 100644
--- a/Aucma.Core.SheetMetal/appsettings.json
+++ b/Aucma.Core.SheetMetal/appsettings.json
@@ -44,7 +44,7 @@
"ConnId": "AUCMA_SCADA",
"DBType": 3,
"Enabled": true,
- "HitRate": 50,
+ "HitRate": 30,
//"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=10.100.72.20)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=ORCLCDB)));User ID=c##aucma_scada;Password=aucma;",
"ProviderName": "System.Data.SqlClient"