diff --git a/Admin.Core.Api/Admin.Core.Model.xml b/Admin.Core.Api/Admin.Core.Model.xml
index aa3ad44b..fea222fd 100644
--- a/Admin.Core.Api/Admin.Core.Model.xml
+++ b/Admin.Core.Api/Admin.Core.Model.xml
@@ -5036,6 +5036,11 @@
工位
+
+
+ 排序
+
+
小时
diff --git a/Admin.Core.Api/obj/Debug/net6.0/Admin.Core.Api.GeneratedMSBuildEditorConfig.editorconfig b/Admin.Core.Api/obj/Debug/net6.0/Admin.Core.Api.GeneratedMSBuildEditorConfig.editorconfig
index d1d06cea..601c80d9 100644
--- a/Admin.Core.Api/obj/Debug/net6.0/Admin.Core.Api.GeneratedMSBuildEditorConfig.editorconfig
+++ b/Admin.Core.Api/obj/Debug/net6.0/Admin.Core.Api.GeneratedMSBuildEditorConfig.editorconfig
@@ -9,9 +9,9 @@ build_property.EnforceExtendedAnalyzerRules =
build_property._SupportedPlatformList = Linux,macOS,Windows
build_property.RootNamespace = Admin.Core.Api
build_property.RootNamespace = Admin.Core.Api
-build_property.ProjectDir = E:\桌面\AUCMA_SCADA\Admin.Core.Api\
+build_property.ProjectDir = D:\Project\gitea\AUCMA\SCADA\Admin.Core.Api\
build_property.RazorLangVersion = 6.0
build_property.SupportLocalizedComponentNames =
build_property.GenerateRazorMetadataSourceChecksumAttributes =
-build_property.MSBuildProjectDirectory = E:\桌面\AUCMA_SCADA\Admin.Core.Api
+build_property.MSBuildProjectDirectory = D:\Project\gitea\AUCMA\SCADA\Admin.Core.Api
build_property._RazorSourceGeneratorDebug =
diff --git a/Admin.Core.Api/obj/Debug/net6.0/Admin.Core.Api.assets.cache b/Admin.Core.Api/obj/Debug/net6.0/Admin.Core.Api.assets.cache
index 49f1a9f2..d57995ef 100644
Binary files a/Admin.Core.Api/obj/Debug/net6.0/Admin.Core.Api.assets.cache and b/Admin.Core.Api/obj/Debug/net6.0/Admin.Core.Api.assets.cache differ
diff --git a/Admin.Core.Common/Admin.Core.Common.csproj b/Admin.Core.Common/Admin.Core.Common.csproj
index bdc4eb5e..57ca1508 100644
--- a/Admin.Core.Common/Admin.Core.Common.csproj
+++ b/Admin.Core.Common/Admin.Core.Common.csproj
@@ -42,12 +42,6 @@
-
-
- ..\dll\Oracle.ManagedDataAccess.dll
-
-
-
True
diff --git a/Admin.Core.FrameWork/obj/Debug/netcoreapp3.1/Admin.Core.FrameWork.GeneratedMSBuildEditorConfig.editorconfig b/Admin.Core.FrameWork/obj/Debug/netcoreapp3.1/Admin.Core.FrameWork.GeneratedMSBuildEditorConfig.editorconfig
index 5decb385..34f11e1e 100644
--- a/Admin.Core.FrameWork/obj/Debug/netcoreapp3.1/Admin.Core.FrameWork.GeneratedMSBuildEditorConfig.editorconfig
+++ b/Admin.Core.FrameWork/obj/Debug/netcoreapp3.1/Admin.Core.FrameWork.GeneratedMSBuildEditorConfig.editorconfig
@@ -1,3 +1,3 @@
is_global = true
build_property.RootNamespace = Admin.Core.FrameWork
-build_property.ProjectDir = E:\桌面\AUCMA_SCADA\Admin.Core.FrameWork\
+build_property.ProjectDir = D:\Project\gitea\AUCMA\SCADA\Admin.Core.FrameWork\
diff --git a/Admin.Core.Model/ViewModels/ProductLineInfoView.cs b/Admin.Core.Model/ViewModels/ProductLineInfoView.cs
index 770a44af..25d89cea 100644
--- a/Admin.Core.Model/ViewModels/ProductLineInfoView.cs
+++ b/Admin.Core.Model/ViewModels/ProductLineInfoView.cs
@@ -12,6 +12,7 @@ namespace Admin.Core.Model.ViewModels
///
/// 公司
///
+ [SugarColumn(ColumnName = "PLANT_CODE")]
public string PlantCode { get; set; }
///
diff --git a/Admin.Core.Model/ViewModels/SheetMetaHourDataView.cs b/Admin.Core.Model/ViewModels/SheetMetaHourDataView.cs
index 815a8288..43a201bc 100644
--- a/Admin.Core.Model/ViewModels/SheetMetaHourDataView.cs
+++ b/Admin.Core.Model/ViewModels/SheetMetaHourDataView.cs
@@ -9,6 +9,11 @@ namespace Admin.Core.Model.ViewModels
{
public class SheetMetaHourDataView
{
+ ///
+ /// 排序
+ ///
+ [SugarColumn(ColumnName = "SEQ")]
+ public int Seq { get; set; }
///
/// 小时
///
diff --git a/Admin.Core.RealTimeService/obj/Debug/net6.0/Admin.Core.RealTimeService.GeneratedMSBuildEditorConfig.editorconfig b/Admin.Core.RealTimeService/obj/Debug/net6.0/Admin.Core.RealTimeService.GeneratedMSBuildEditorConfig.editorconfig
index abc27d01..ce84cb9f 100644
--- a/Admin.Core.RealTimeService/obj/Debug/net6.0/Admin.Core.RealTimeService.GeneratedMSBuildEditorConfig.editorconfig
+++ b/Admin.Core.RealTimeService/obj/Debug/net6.0/Admin.Core.RealTimeService.GeneratedMSBuildEditorConfig.editorconfig
@@ -8,4 +8,4 @@ build_property.PlatformNeutralAssembly =
build_property.EnforceExtendedAnalyzerRules =
build_property._SupportedPlatformList = Linux,macOS,Windows
build_property.RootNamespace = Admin.Core.RealTimeService
-build_property.ProjectDir = E:\桌面\AUCMA_SCADA\Admin.Core.RealTimeService\
+build_property.ProjectDir = D:\Project\gitea\AUCMA\SCADA\Admin.Core.RealTimeService\
diff --git a/Admin.Core.Repository/BASE/BaseRepository.cs b/Admin.Core.Repository/BASE/BaseRepository.cs
index bd14d2ed..e2933f8b 100644
--- a/Admin.Core.Repository/BASE/BaseRepository.cs
+++ b/Admin.Core.Repository/BASE/BaseRepository.cs
@@ -36,14 +36,7 @@ namespace Admin.Core.Repository
}
}
- //输入最终SQL语句...
- //_db.Aop.OnLogExecuting = (sql, pars) =>
- //{
- // //var s1 = sql;//断点打在这里看内部生成的sql语句...
- // Console.Write(sql);
- //};
-
-
+
return _dbBase;
}
}
diff --git a/Admin.Core.Repository/Repository_New/SysUserInfoRepository.cs b/Admin.Core.Repository/Repository_New/SysUserInfoRepository.cs
index fef83246..5573cf39 100644
--- a/Admin.Core.Repository/Repository_New/SysUserInfoRepository.cs
+++ b/Admin.Core.Repository/Repository_New/SysUserInfoRepository.cs
@@ -25,7 +25,7 @@ namespace Admin.Core.Repository
FROM BASE_PRODUCTLINE BP
LEFT JOIN BASE_PROCESS_STATION BPS ON BPS.PARENT_ID LIKE '%' || BP.PRODUCT_LINE_CODE || '%'
WHERE BP.PRODUCT_LINE_CODE = '{code}'";
- return await Db.Ado.SqlQueryAsync(sql);
+ return await Db.CopyNew().Ado.SqlQueryAsync(sql);
}
#region 获取班组数据
@@ -38,7 +38,7 @@ namespace Admin.Core.Repository
{
if (GetConnectionState() == false) return null;
string sql = "SELECT * FROM VIEW_CURRENT_TEAM_TIME";
- return await Db.Ado.SqlQueryAsync(sql);
+ return await Db.CopyNew().Ado.SqlQueryAsync(sql);
}
#endregion
@@ -54,7 +54,7 @@ namespace Admin.Core.Repository
if (GetConnectionState() == false) return null;
string sql =@$"SELECT BP.PLANT_CODE PLANT_CODE, BP.PARENT_ID PRODUCT_LINE_CODE, BPS.PROCESS_CODE, BP.PRODUCT_LINE_CODE STATION_CODE FROM BASE_PRODUCTLINE BP
LEFT JOIN BASE_PROCESS_STATION BPS ON BPS.PARENT_ID LIKE '%' || BP.PRODUCT_LINE_CODE || '%' WHERE BP.PRODUCT_LINE_CODE = '{productLineCode}'";
- return await Db.Ado.SqlQueryAsync(sql);
+ return await Db.CopyNew().Ado.SqlQueryAsync(sql);
}
#endregion
@@ -85,32 +85,48 @@ namespace Admin.Core.Repository
AND SPC.BEGIN_TIME <= CTT.END_TIME and SPC.PRODUCTLINE_CODE='{productLineCode}'
GROUP BY ML.MATERIAL_SPECIFICATIONS,SPC.PRODUCTLINE_CODE";
- return await Db.Ado.SqlQueryAsync(sql);
+ return await Db.CopyNew().Ado.SqlQueryAsync(sql);
}
#endregion
+
+ #region 小时统计
+ ///
+ /// 小时统计
+ ///
+ /// 工位
+ ///
public async Task> GetSheetMetaHourData(string productLineCode)
{
-
- string sql = @$"SELECT CTT.HOUR_TIME,
- SUM(CASE
- WHEN SPC.PLAN_TYPE = 1 THEN SPC.COMPLETE_AMOUNT
- WHEN SPC.PLAN_TYPE = 2 THEN SPC.COMPLETE_AMOUNT
- ELSE 0 END) FRONTPLATE_AMOUNT,
- SUM(CASE
- WHEN SPC.PLAN_TYPE = 1 THEN SPC.COMPLETE_AMOUNT
- WHEN SPC.PLAN_TYPE = 3 THEN SPC.COMPLETE_AMOUNT
- ELSE 0 END) REARPANEL_AMOUNT
- FROM VIEW_CURRENT_TEAM_TIME CTT
- LEFT JOIN (select * from VIEW_EXECUTE_PLANINFO where PRODUCTLINE_CODE='{productLineCode}') SPC
- ON SPC.BEGIN_TIME >= CTT.START_TIME AND SPC.BEGIN_TIME < CTT.END_TIME
-
- GROUP BY CTT.HOUR_TIME
- ORDER BY CTT.HOUR_TIME";
- if (GetConnectionState() == false) return null;
- return await Db.Ado.SqlQueryAsync(sql);
+
+ //string sql = @$"SELECT CTT.HOUR_TIME,
+ // SUM(CASE
+ // WHEN SPC.PLAN_TYPE = 1 THEN SPC.COMPLETE_AMOUNT
+ // WHEN SPC.PLAN_TYPE = 2 THEN SPC.COMPLETE_AMOUNT
+ // ELSE 0 END) FRONTPLATE_AMOUNT,
+ // SUM(CASE
+ // WHEN SPC.PLAN_TYPE = 1 THEN SPC.COMPLETE_AMOUNT
+ // WHEN SPC.PLAN_TYPE = 3 THEN SPC.COMPLETE_AMOUNT
+ // ELSE 0 END) REARPANEL_AMOUNT
+ // FROM VIEW_CURRENT_TEAM_TIME CTT
+ // LEFT JOIN (select * from VIEW_EXECUTE_PLANINFO where PRODUCTLINE_CODE='{productLineCode}') SPC
+ // ON SPC.BEGIN_TIME >= CTT.START_TIME AND SPC.BEGIN_TIME < CTT.END_TIME
+
+ // GROUP BY CTT.HOUR_TIME
+ // ORDER BY CTT.HOUR_TIME";
+
+ string sql = $@"SELECT CTT.SEQ,CTT.HOUR_TIME,COUNT(SPC.PLAN_CODE) as FRONTPLATE_AMOUNT,COUNT(BACK.PLAN_CODE) as REARPANEL_AMOUNT
+ FROM VIEW_CURRENT_TEAM_TIME CTT
+ LEFT JOIN (select * from C##AUCMA_SCADA.EXECUTE_PLANINFO v inner join C##AUCMA_SCADA.RECORD_SIDEPANEL_COMPLATE c
+ on v.TASK_CODE=c.PLAN_CODE where v.PRODUCTLINE_CODE='{productLineCode}' AND c.COMPLETE_AMOUNT!=0) SPC ON SPC.RECORD_TIME >= CTT.START_TIME AND SPC.RECORD_TIME < CTT.END_TIME
+ LEFT JOIN (select * from C##AUCMA_SCADA.EXECUTE_PLANINFO v inner join C##AUCMA_SCADA.RECORD_BACKPANEL_COMPLATE c
+ on v.TASK_CODE=c.PLAN_CODE where v.PRODUCTLINE_CODE='{productLineCode}' AND c.COMPLETE_AMOUNT!=0) BACK ON BACK.RECORD_TIME >= CTT.START_TIME AND BACK.RECORD_TIME < CTT.END_TIME
+ group by CTT.SEQ,CTT.HOUR_TIME ORDER BY CTT.SEQ asc";
+
+ return await Db.CopyNew().Ado.SqlQueryAsync(sql);
}
+ #endregion
}
}
\ No newline at end of file
diff --git a/Admin.Core.Tasks/QuartzNet/Jobs/Job_TemperatureMeasurement_Quartz.cs b/Admin.Core.Tasks/QuartzNet/Jobs/Job_TemperatureMeasurement_Quartz.cs
index a90c0339..2b7c93d2 100644
--- a/Admin.Core.Tasks/QuartzNet/Jobs/Job_TemperatureMeasurement_Quartz.cs
+++ b/Admin.Core.Tasks/QuartzNet/Jobs/Job_TemperatureMeasurement_Quartz.cs
@@ -59,8 +59,9 @@ namespace Admin.Core.Tasks
{
var list = await _temperatureHistoryServices.QueryAsync(d => d.flag == 0);
- if (list == null) return;
Console.WriteLine(list.Count());
+ if (list.Count == 0) return;
+
List< BoxTemperatureMeasurementHistory > historyList = new List();
foreach (var item in list)
{
@@ -104,8 +105,8 @@ namespace Admin.Core.Tasks
var result = await _boxTMHistoryServices.AddAsync(historyList);
if (result > 0)
{
- list.ForEach(x => x.flag = 1);
if (list == null) return;
+ list.ForEach(x => x.flag = 1);
await _temperatureHistoryServices.UpdateAsync(list);
Console.WriteLine("保存测温系统成功");
@@ -113,7 +114,7 @@ namespace Admin.Core.Tasks
}
catch (Exception ex)
{
- logHelper.Error($"数据处理异常:{ex.Message}");
+ logHelper.Error($"测温数据处理异常:{ex.Message}");
}
}
diff --git a/Aucma.Core.Palletiz/Aucma.Core.Palletiz.csproj.user b/Aucma.Core.Palletiz/Aucma.Core.Palletiz.csproj.user
index 53c99481..43c13b1d 100644
--- a/Aucma.Core.Palletiz/Aucma.Core.Palletiz.csproj.user
+++ b/Aucma.Core.Palletiz/Aucma.Core.Palletiz.csproj.user
@@ -7,7 +7,7 @@
-
+
Designer
diff --git a/Aucma.Core.Palletiz/ViewModels/FoamPlanPageViewModel.cs b/Aucma.Core.Palletiz/ViewModels/FoamPlanPageViewModel.cs
index 014a4eab..885007aa 100644
--- a/Aucma.Core.Palletiz/ViewModels/FoamPlanPageViewModel.cs
+++ b/Aucma.Core.Palletiz/ViewModels/FoamPlanPageViewModel.cs
@@ -19,10 +19,10 @@ namespace Aucma.Core.Palletiz.ViewModels
* 发泡计划
*
* */
- public partial class FoamPlanPageViewModel : ObservableObject
+ public partial class PlanPageViewModel : ObservableObject
{
protected readonly IBoxFoamPlanServices? _boxFoamPlanServices;
- public FoamPlanPageViewModel()
+ public PlanPageViewModel()
{
_boxFoamPlanServices = App.ServiceProvider.GetService();
WeakReferenceMessenger.Default.Register(this, Recive);
diff --git a/Aucma.Core.Palletiz/ViewModels/MainWindowViewModel.cs b/Aucma.Core.Palletiz/ViewModels/MainWindowViewModel.cs
index 1b73fede..10d4d689 100644
--- a/Aucma.Core.Palletiz/ViewModels/MainWindowViewModel.cs
+++ b/Aucma.Core.Palletiz/ViewModels/MainWindowViewModel.cs
@@ -96,6 +96,7 @@ namespace Aucma.Core.Palletiz.ViewModels
Scanner1State(flag1);
}
#endregion
+
#region 更换界面
public System.Windows.Controls.UserControl _content;
diff --git a/Aucma.Core.Palletiz/Views/FoamPlanPageView.xaml b/Aucma.Core.Palletiz/Views/FoamPlanPageView.xaml
deleted file mode 100644
index f527365e..00000000
--- a/Aucma.Core.Palletiz/Views/FoamPlanPageView.xaml
+++ /dev/null
@@ -1,291 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/Aucma.Core.Palletiz/Views/PalletizPageView.xaml.cs b/Aucma.Core.Palletiz/Views/PalletizPageView.xaml.cs
index 75e63b56..56e43cfb 100644
--- a/Aucma.Core.Palletiz/Views/PalletizPageView.xaml.cs
+++ b/Aucma.Core.Palletiz/Views/PalletizPageView.xaml.cs
@@ -4,7 +4,7 @@ using System.Windows.Controls;
namespace Aucma.Core.Palletiz.Views
{
///
- /// FoamPlanPageView.xaml 的交互逻辑
+ /// PlanPageView.xaml 的交互逻辑
///
public partial class PalletizPageView : UserControl
{
diff --git a/Aucma.Core.Palletiz/Views/PlanPageView.xaml b/Aucma.Core.Palletiz/Views/PlanPageView.xaml
new file mode 100644
index 00000000..446a0016
--- /dev/null
+++ b/Aucma.Core.Palletiz/Views/PlanPageView.xaml
@@ -0,0 +1,89 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Aucma.Core.Palletiz/Views/FoamPlanPageView.xaml.cs b/Aucma.Core.Palletiz/Views/PlanPageView.xaml.cs
similarity index 74%
rename from Aucma.Core.Palletiz/Views/FoamPlanPageView.xaml.cs
rename to Aucma.Core.Palletiz/Views/PlanPageView.xaml.cs
index 3e02eaf7..90ea5126 100644
--- a/Aucma.Core.Palletiz/Views/FoamPlanPageView.xaml.cs
+++ b/Aucma.Core.Palletiz/Views/PlanPageView.xaml.cs
@@ -17,14 +17,14 @@ using System.Windows.Shapes;
namespace Aucma.Core.Palletiz.Views
{
///
- /// FoamPlanPageView.xaml 的交互逻辑
+ /// PlanPageView.xaml 的交互逻辑
///
- public partial class FoamPlanPageView : UserControl
+ public partial class PlanPageView : UserControl
{
- public FoamPlanPageView()
+ public PlanPageView()
{
InitializeComponent();
- this.DataContext = new FoamPlanPageViewModel();
+ this.DataContext = new PlanPageViewModel();
}
}
}
diff --git a/Aucma.Core.SheetMetal/Business/SheetMetalPlanTaskHandle.cs b/Aucma.Core.SheetMetal/Business/SheetMetalPlanTaskHandle.cs
index de314ceb..84dc5333 100644
--- a/Aucma.Core.SheetMetal/Business/SheetMetalPlanTaskHandle.cs
+++ b/Aucma.Core.SheetMetal/Business/SheetMetalPlanTaskHandle.cs
@@ -22,6 +22,22 @@ namespace Aucma.Core.SheetMetal.Business;
///
public class SheetMetalPlanTaskHandle
{
+ #region 刷新创建计划
+ ///
+ /// 刷新创建计划
+ ///
+ public delegate Task RefreshCretaePlanInfo();
+ public static event RefreshCretaePlanInfo RefreshCretaePlanInfoEvent;
+ #endregion
+
+ #region 刷新图标
+ ///
+ /// 刷新创建计划
+ ///
+ public delegate Task RefreshChat();
+ public static event RefreshChat RefreshChatEvent;
+ #endregion
+
#region 刷新当前正在执行的计划
///
/// 刷新当前正在执行的计划
@@ -65,9 +81,8 @@ public class SheetMetalPlanTaskHandle
while (true)
{
- var planInfos = _executePlanInfoServices.QueryAsync(d => d.ProductLineCode.Equals("1001") && d.ExecuteStatus == 1).Result;
- var planInfoss = _executePlanInfoServices.QueryAsync(d => d.ProductLineCode.Equals("1001")).Result;
- Console.WriteLine(planInfoss.Count());
+ var planInfos = _executePlanInfoServices.QueryAsync(d => d.ProductLineCode.Equals("1001") && d.ExecuteStatus == 1||d.ExecuteStatus==2).Result;
+
if (planInfos != null)
{
if (planInfos.Count > 0)
@@ -77,7 +92,7 @@ public class SheetMetalPlanTaskHandle
if (planInfo.PlanType == 1) //联合下发
{
SendPlanTask(planInfo, obj_sidePanel, obj_backPanel);
-
+
UpdatePlanTaskByComplate(planInfo);
}
@@ -309,15 +324,21 @@ public class SheetMetalPlanTaskHandle
Console.WriteLine($"{DateTime.Now.ToString("HH:m:s")}===>收到围板设备应答信号,复位应答地址");
RefreshExecInfoEvent?.Invoke("收到围板设备应答信号......");
isFlag = false;
+
+ //更新计划状态为2执行中
+ planInfo.ExecuteStatus = 2;
+ _executePlanInfoServices.UpdateExecutePlanInfo(planInfo);
+ //更新前端展示图表
+ RefreshCurrentPlanInfoEvent?.Invoke(planInfo);
+ RefreshCretaePlanInfoEvent?.Invoke();//更新界面
+ RefreshChatEvent?.Invoke();//刷新图表
}
Thread.Sleep(2000);
} while (isFlag);
- //更新计划状态为2执行中
- planInfo.ExecuteStatus = 2;
- _executePlanInfoServices.UpdateExecutePlanInfo(planInfo);
- RefreshCurrentPlanInfoEvent?.Invoke(planInfo);
#endregion
+
+
//读取设备进度,完成后再次下发新任务
ReadDeviceComplate_SidePanel(obj_sidePanel);
@@ -328,7 +349,7 @@ public class SheetMetalPlanTaskHandle
{
MessageBox.Show($"围板⽣产计划下发异常:{ex.Message}", "提示", MessageBoxButton.OK, MessageBoxImage.Error,
MessageBoxResult.OK, MessageBoxOptions.DefaultDesktopOnly);
- RefreshExecInfoEvent?.Invoke("产计划下发异常");
+ RefreshExecInfoEvent?.Invoke("围板⽣产计划下发异常:{ex.Message}");
}
}
@@ -375,7 +396,7 @@ public class SheetMetalPlanTaskHandle
RecordSidePanelComplate sidePanelComplate = new RecordSidePanelComplate()
{
ProductlineCode = "1001",
- PlanCode = planCode.Substring(0, 16),
+ PlanCode = planCode.Substring(0, 16).Replace("\n","").Trim(),//.Substring(0, 16),
//MaterialCode = string.IsNullOrEmpty(materialCode) ? "" : materialCode,
MaterialCode = "BCD/310NF",
CompleteAmount = complateAmount,
@@ -401,7 +422,7 @@ public class SheetMetalPlanTaskHandle
if (sidePanelComplates.Count > 0)
{
sidePanelComplates = sidePanelComplates.OrderByDescending(x => x.RecordTime).ToList();
-
+
lastComplateAmount = sidePanelComplates.First().CompleteAmount;
sidePanelComplate.OutPutAmount = complateAmount - lastComplateAmount;
sumComplateAmount = sidePanelComplates.Sum(x => x.OutPutAmount) + sidePanelComplate.OutPutAmount;
@@ -426,6 +447,8 @@ public class SheetMetalPlanTaskHandle
isFlag = false;
Console.WriteLine($"围板计划执行完成,计划数量:{planInfo.PlanAmount};实际产量:{sumComplateAmount};差异值:{planInfo.PlanAmount - sumComplateAmount}");
RefreshExecInfoEvent?.Invoke($"围板计划执行完成,计划数量:{planInfo.PlanAmount};实际产量:{sumComplateAmount};差异值:{planInfo.PlanAmount - sumComplateAmount}");
+ RefreshCretaePlanInfoEvent?.Invoke();//更新界面
+ RefreshChatEvent?.Invoke();//刷新图表
}
}
}
@@ -596,6 +619,9 @@ public class SheetMetalPlanTaskHandle
isFlag = false;
Console.WriteLine($"背板计划执行完成,计划数量:{planInfo.PlanAmount};实际产量:{sumComplateAmount};差异值:{planInfo.PlanAmount - sumComplateAmount}");
RefreshExecInfoEvent?.Invoke($"背板计划执行完成,计划数量:{planInfo.PlanAmount};实际产量:{sumComplateAmount};差异值:{planInfo.PlanAmount - sumComplateAmount}");
+ RefreshCretaePlanInfoEvent?.Invoke();//更新界面
+ RefreshChatEvent?.Invoke();//刷新图表
+
}
}
}
diff --git a/Aucma.Core.SheetMetal/ViewModels/IndexPageViewModel.cs b/Aucma.Core.SheetMetal/ViewModels/IndexPageViewModel.cs
index 5f8fcb6b..7edf6456 100644
--- a/Aucma.Core.SheetMetal/ViewModels/IndexPageViewModel.cs
+++ b/Aucma.Core.SheetMetal/ViewModels/IndexPageViewModel.cs
@@ -18,10 +18,9 @@ using System.Windows.Media;
using Admin.Core.Common;
using LiveCharts.Defaults;
using Aucma.Core.SheetMetal.Business;
-using Admin.Core.Service;
-using NPOI.SS.Formula.Functions;
using Admin.Core.Model.ViewModels;
-using StackExchange.Profiling.Internal;
+using NPOI.SS.Formula.Functions;
+using log4net;
/*
* 首页信息
*/
@@ -29,6 +28,7 @@ namespace Aucma.Core.SheetMetal.ViewModels
{
public partial class IndexPageViewModel : ObservableObject
{
+ private static readonly log4net.ILog log = LogManager.GetLogger(typeof(LogPageViewModel));
protected readonly IExecutePlanInfoServices? _taskExecutionPlanInfoServices;
protected readonly IRecordBackPanelComplateServices _recordBackPanelComplateServices;
protected readonly IRecordSidePanelComplateServices _recordSidePanelComplateServices;
@@ -58,73 +58,24 @@ namespace Aucma.Core.SheetMetal.ViewModels
_baseBomInfoServices = App.ServiceProvider.GetService();
_sysUserInfoServices = App.ServiceProvider.GetService();
_recordInstoreServices = App.ServiceProvider.GetService();
- //Job_SheetMetalTask_Quartz.SmEverDayDelegateEvent += InitEveryDayMethod;
- //Job_SheetMetalTask_Quartz.SmTaskDelegateEvent += UpdatePlanSHow;//计划内容展示
- //WeakReferenceMessenger.Default.Register(this, Recive);
Task.WaitAll(LoadData());
AddSelectData();//添加下拉菜单
- RefreshHourAmount();//小时产量
- // InitEveryDayMethod();
+ RefreshHourAmount();//小时产量
RefreshMaterialStats();//型号产量
SheetMetalPlanTaskHandle.RefreshCurrentPlanInfoEvent += RefreshCurrentPlanInfo;
QuantityIssuedViewModel.RefreshCretaePlanInfoEvent += LoadData;
-
- //Task.Run(() =>
- //{
- // Get123();
- //});
- //Task.Run(() =>
- //{
-
- // Get1234();
- //});
- //Task.Run(() =>
- //{
-
- // Get1235();
- //});
- //Task.Run(() =>
- //{
-
- // Get123();
- //});
+ SheetMetalPlanTaskHandle.RefreshCretaePlanInfoEvent += LoadData;
+ SheetMetalPlanTaskHandle.RefreshChatEvent += RefreshChat;
}
#endregion
- public Task Get123()
+ public Task RefreshChat()
{
- while (true)
- {
- var list = _taskExecutionPlanInfoServices.QueryAsync();
- Console.WriteLine(list.ToJson());
- }
- }
- public Task Get1234()
- {
- while (true)
- {
- var list = _taskExecutionPlanInfoServices.QueryAsync();
- Console.WriteLine(list.ToJson());
- }
- }
-
- public Task Get12345()
- {
- while (true)
- {
- var list = _taskExecutionPlanInfoServices.QueryAsync();
- Console.WriteLine(list.ToJson());
- }
+ RefreshHourAmount();//小时产量
+ RefreshMaterialStats();//型号产量
+ return Task.CompletedTask;
}
- public Task Get1235()
- {
- while (true)
- {
- var list = _taskExecutionPlanInfoServices.QueryAsync();
- Console.WriteLine(list.ToJson());
- }
- }
#region 下拉
public void AddSelectData()
{
@@ -149,7 +100,10 @@ namespace Aucma.Core.SheetMetal.ViewModels
RealQuantity = info.CompleteAmount;
DiffQuantity = Math.Abs(info.CompleteAmount - info.PlanAmount);
- CompletionRate = info.CompleteAmount / info.PlanAmount;
+
+
+ //CompletionRate = (_realQuantity / _planMaxNum).ToString("0%");
+ CompletionRate = (_realQuantity / _planMaxNum);
}
#endregion
@@ -252,63 +206,75 @@ namespace Aucma.Core.SheetMetal.ViewModels
#region 加载DataGrid数据
private Task LoadData()
{
- string stationCode = Appsettings.app("StationInfo", "StationCode");
- CurrentTeamTimeView view = GetTeamHour();
-
- var list = _taskExecutionPlanInfoServices.QueryAsync(x => x.ProductLineCode == stationCode&& x.CreatedTime> view.StartTime && x.CreatedTime d.ExecuteOrder);
- int i = 1;
- string planType = string.Empty;
- PlanInfoDataGrid.Clear();
- foreach (var item in execList)
+ try
{
- TaskExecModel task = new TaskExecModel();
- task.No = i;
- task.ID = item.ObjId.ToString();
- task.OrderCode = item.OrderCode;
- task.MaterialCode = item.MaterialCode;
- task.MaterialName = item.MaterialName;
- task.TaskAmount = item.PlanAmount;
- 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)
+ string stationCode = Appsettings.app("StationInfo", "StationCode");
+ CurrentTeamTimeView view = GetTeamHour();
+
+ var list = _taskExecutionPlanInfoServices.QueryAsync(x => x.ProductLineCode == stationCode && x.BeginTime > view.StartTime || x.ExecuteStatus == 2).Result;
+ if (list == null) return Task.CompletedTask;
+
+ var execList = list.OrderByDescending(d => d.ExecuteOrder);
+ int i = 1;
+ string planType = string.Empty;
+ System.Windows.Application.Current.Dispatcher.Invoke((Action)(() =>
{
- planType = "后板计划";
- }
- task.PlanType = planType;
- task.TaskCode = item.TaskCode;
- task.ExecuteStatus = item.ExecuteStatus;//执行状态
+ PlanInfoDataGrid.Clear();
+ foreach (var item in execList)
+ {
+ TaskExecModel task = new TaskExecModel();
+ task.No = i;
+ task.ID = item.ObjId.ToString();
+ task.OrderCode = item.OrderCode;
+ task.MaterialCode = item.MaterialCode;
+ task.MaterialName = item.MaterialName;
+ task.TaskAmount = item.PlanAmount;
+ 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;
+ task.ExecuteStatus = item.ExecuteStatus;//执行状态
+
+ PlanInfoDataGrid.Add(task);
+ i++;
+ }
- PlanInfoDataGrid.Add(task);
- i++;
+ //更新首页显示信息
+ ExecutePlanInfo execPlan = execList.SingleOrDefault(d => d.ExecuteStatus == 2);
+ if (execPlan != null)
+ {
+ OrderCode = execPlan.OrderCode;
+ MesMOrderCode = execPlan.ProductPlanCode;
+ ProductModel = execPlan.MaterialName;
+ BeginTime = execPlan.BeginTime.ToString();
+
+ PlanMaxNum = _planNum = execPlan.PlanAmount;
+ RealQuantity = execPlan.CompleteAmount;
+ double diff = _planMaxNum - _realQuantity;
+ DiffQuantity =int.Parse(diff.ToString());
+
+ //CompletionRate = (_realQuantity/_planMaxNum).ToString("0%");
+ CompletionRate = (_realQuantity / _planMaxNum);
+ }
+ }));
}
-
- //更新首页显示信息
- ExecutePlanInfo execPlan = execList.SingleOrDefault(d => d.ExecuteStatus == 2);
- if (execPlan != null)
+ catch (Exception ex)
{
- _orderCode = execPlan.OrderCode;
- _mesMOrderCode = execPlan.ProductPlanCode;
- _productModel = execPlan.MaterialName;
- _beginTime = execPlan.BeginTime.ToString();
-
- _planMaxNum = _planNum = execPlan.PlanAmount;
- _realQuantity = execPlan.CompleteAmount;
- _diffQuantity = _planMaxNum - _realQuantity;
- _completionRate = _realQuantity / _planMaxNum;
+ log.Error("钣金首页数据加载:"+ex.Message);
}
-
return Task.CompletedTask;
}
#endregion
@@ -500,8 +466,8 @@ namespace Aucma.Core.SheetMetal.ViewModels
///
/// 计划最大值
///
- private int _planMaxNum;
- public int PlanMaxNum
+ private double _planMaxNum;
+ public double PlanMaxNum
{
get => _planMaxNum;
set => SetProperty(ref _planMaxNum, value);
@@ -509,8 +475,8 @@ namespace Aucma.Core.SheetMetal.ViewModels
#endregion
#region 实际数量
- private int _realQuantity;
- public int RealQuantity
+ private double _realQuantity;
+ public double RealQuantity
{
get => _realQuantity;
set => SetProperty(ref _realQuantity, value);
@@ -720,7 +686,6 @@ namespace Aucma.Core.SheetMetal.ViewModels
}
#endregion
-
#region 刷新小时产量统计
///
/// 刷新小时产量统计
@@ -734,8 +699,8 @@ namespace Aucma.Core.SheetMetal.ViewModels
var hourAmount = _sysUserInfoServices.GetSheetMetaHourData(stationCode).Result;
if (hourAmount != null)
{
- Achievement.Clear();
-
+ if (Achievement.Count != 0) Achievement.Clear();
+
ProductionHourList = new List();
ChartValues hourAchievement1 = new ChartValues();
ChartValues hourAchievement2 = new ChartValues();
@@ -794,8 +759,12 @@ namespace Aucma.Core.SheetMetal.ViewModels
#region 按类型统计
ChartValues achievement1 = new ChartValues();
ChartValues achievement2 = new ChartValues();
+ if (ModelStatistics.Count != 0)
+ {
+ ModelStatistics.Clear();
+ }
- MaterialNameList = new List();
+ MaterialNameList = new List();
foreach (var item in sheetMetalTypeList)
{
achievement1.Add(Convert.ToInt32(item.FrontPlateAmount));
diff --git a/Aucma.Core.SheetMetal/ViewModels/QuantityIssuedViewModel.cs b/Aucma.Core.SheetMetal/ViewModels/QuantityIssuedViewModel.cs
index 9d9bfad8..fb13aae0 100644
--- a/Aucma.Core.SheetMetal/ViewModels/QuantityIssuedViewModel.cs
+++ b/Aucma.Core.SheetMetal/ViewModels/QuantityIssuedViewModel.cs
@@ -35,6 +35,7 @@ namespace Aucma.Core.SheetMetal.ViewModels
private IBaseBomInfoServices _bomInfoServices;
private IBaseSpaceDetailServices _spaceDetailServices;
protected readonly IExecutePlanInfoServices? _executePlanInfoServices;
+ protected readonly IProductPlanInfoServices? _productPlanInfoServices;
#region 构造函数
public QuantityIssuedViewModel(ProductPlanInfoModel productPlanInfo)
@@ -42,7 +43,8 @@ namespace Aucma.Core.SheetMetal.ViewModels
_bomInfoServices = App.ServiceProvider.GetService();
_spaceDetailServices = App.ServiceProvider.GetService();
_executePlanInfoServices = App.ServiceProvider.GetService();
-
+ _productPlanInfoServices = App.ServiceProvider.GetService();
+
PlanInfo = productPlanInfo;
}
#endregion
@@ -92,7 +94,7 @@ namespace Aucma.Core.SheetMetal.ViewModels
task.OrderCode = PlanInfo.OrderCode;
task.ProductLineCode = stationCode;//计划工位
//task.TaskCode = GetMaxCodeAsync();
- task.TaskCode = System.Guid.NewGuid().ToString("N").Substring(0,16);
+ task.TaskCode = System.Guid.NewGuid().ToString("N").Substring(0,16);
task.MaterialCode = PlanInfo.MaterialCode;
task.MaterialName = PlanInfo.MaterialName;
if (list.Count == 0)
@@ -111,7 +113,10 @@ namespace Aucma.Core.SheetMetal.ViewModels
var result = await _executePlanInfoServices.AddAsync(task);
if (result > 0)
{
+ var obj = await _productPlanInfoServices.FirstAsync(d=>d.ProductLineCode== stationCode&& d.OrderCode== PlanInfo.OrderCode);
MessageBox.Show("计划拆分成功!", "系统提醒");
+ obj.BeginTime = DateTime.Now;
+ await _productPlanInfoServices.UpdateAsync(obj);
//WeakReferenceMessenger.Default.Send("Refresh");//刷新窗口
RefreshCretaePlanInfoEvent?.Invoke();
}
diff --git a/Aucma.Core.SheetMetal/ViewModels/StatisticsPageViewModel.cs b/Aucma.Core.SheetMetal/ViewModels/StatisticsPageViewModel.cs
index 9a548c4c..57d0c7d8 100644
--- a/Aucma.Core.SheetMetal/ViewModels/StatisticsPageViewModel.cs
+++ b/Aucma.Core.SheetMetal/ViewModels/StatisticsPageViewModel.cs
@@ -62,6 +62,33 @@ namespace Aucma.Core.SheetMetal.ViewModels
}
}
+ private async Task LoadDateData(DateTime startTime,DateTime endTime)
+ {
+ string station = Appsettings.app("StationInfo", "StationCode");
+ var list = _productPlanInfoServices.QueryAsync(d => d.ProductLineCode.Equals(station)).Result;
+ var sidePanelComplateList = _sidePanelComplateServices.QueryAsync(d => d.ProductlineCode == station).Result;
+ int i = 1;
+ foreach (var item in list.Where(d => d.BeginTime > startTime && d.EndTime < endTime))
+ {
+ int sidePanelComplete = GetSidePanelCompleteData(sidePanelComplateList, item.OrderCode, station);
+ int backPanelComplete = GetBackPanelCompleteData(sidePanelComplateList, item.OrderCode, station);
+ MaterialDataGrid.Add(new MaterialComplateInfo()
+ {
+ No = i,
+ ProductPlanCode = item.PlanCode,
+ MaterialCode = item.MaterialCode,
+ MaterialName = item.MaterialName,
+ PlanAmount = item.PlanAmount,
+ CompleteAmount = item.CompleteAmount,
+ SidePanelComplete = sidePanelComplete,
+ BackPanelComplete = backPanelComplete,
+ BeginTime = item.BeginTime.ToString(),
+ EndTime = item.EndTime.ToString(),
+ Status = item.CompleteAmount == item.PlanAmount ? "完成" : "未完成"
+ });
+ i++;
+ }
+ }
#endregion
#region 初始化datagrid
@@ -103,26 +130,13 @@ namespace Aucma.Core.SheetMetal.ViewModels
var beginTime =DateTime.Parse(result.BeginTime);
var endTime = DateTime.Parse(result.EndTime);
MaterialDataGrid.Clear();
- string station = Appsettings.app("StationInfo", "StationCode");
- var list = _productPlanInfoServices.QueryAsync(d => d.ProductLineCode.Equals(station)).Result;
- foreach (var item in list.Where(d=>d.BeginTime> beginTime&& d.EndTime < endTime))
- {
- MaterialDataGrid.Add(new MaterialComplateInfo()
- {
- ProductPlanCode = item.PlanCode,
- MaterialCode = item.MaterialCode,
- MaterialName = item.MaterialName,
- PlanAmount = item.PlanAmount,
- CompleteAmount = item.CompleteAmount,
- BeginTime = item.BeginTime.ToString(),
- EndTime = item.EndTime.ToString(),
- });
- }
+
+ await LoadDateData(beginTime, endTime);
}
else
{
MaterialDataGrid.Clear();
- LoadData();
+ await LoadData();
}
}
#endregion
diff --git a/Aucma.Core.SheetMetal/Views/IndexPageView.xaml b/Aucma.Core.SheetMetal/Views/IndexPageView.xaml
index e0177469..1d077491 100644
--- a/Aucma.Core.SheetMetal/Views/IndexPageView.xaml
+++ b/Aucma.Core.SheetMetal/Views/IndexPageView.xaml
@@ -225,7 +225,7 @@
-
diff --git a/HwControlLib/bin/Debug/net6.0-windows/HwControlLib.dll b/HwControlLib/bin/Debug/net6.0-windows/HwControlLib.dll
index 914b0885..bb9cc798 100644
Binary files a/HwControlLib/bin/Debug/net6.0-windows/HwControlLib.dll and b/HwControlLib/bin/Debug/net6.0-windows/HwControlLib.dll differ
diff --git a/HwControlLib/bin/Debug/net6.0-windows/HwControlLib.pdb b/HwControlLib/bin/Debug/net6.0-windows/HwControlLib.pdb
index afa0f38e..e11f8d6b 100644
Binary files a/HwControlLib/bin/Debug/net6.0-windows/HwControlLib.pdb and b/HwControlLib/bin/Debug/net6.0-windows/HwControlLib.pdb differ
diff --git a/HwControlLib/obj/Debug/net6.0-windows/GeneratedInternalTypeHelper.g.i.cs b/HwControlLib/obj/Debug/net6.0-windows/GeneratedInternalTypeHelper.g.i.cs
index 57f88858..36288f46 100644
--- a/HwControlLib/obj/Debug/net6.0-windows/GeneratedInternalTypeHelper.g.i.cs
+++ b/HwControlLib/obj/Debug/net6.0-windows/GeneratedInternalTypeHelper.g.i.cs
@@ -15,7 +15,7 @@ namespace XamlGeneratedNamespace {
/// GeneratedInternalTypeHelper
///
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "7.0.4.0")]
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "7.0.12.0")]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public sealed class GeneratedInternalTypeHelper : System.Windows.Markup.InternalTypeHelper {
diff --git a/HwControlLib/obj/Debug/net6.0-windows/HwControlLib.GeneratedMSBuildEditorConfig.editorconfig b/HwControlLib/obj/Debug/net6.0-windows/HwControlLib.GeneratedMSBuildEditorConfig.editorconfig
index 54fddce2..a4db58d9 100644
--- a/HwControlLib/obj/Debug/net6.0-windows/HwControlLib.GeneratedMSBuildEditorConfig.editorconfig
+++ b/HwControlLib/obj/Debug/net6.0-windows/HwControlLib.GeneratedMSBuildEditorConfig.editorconfig
@@ -8,4 +8,4 @@ build_property.PlatformNeutralAssembly =
build_property.EnforceExtendedAnalyzerRules =
build_property._SupportedPlatformList = Linux,macOS,Windows
build_property.RootNamespace = HwControlLib
-build_property.ProjectDir = E:\桌面\AUCMA_SCADA\HwControlLib\
+build_property.ProjectDir = D:\Project\gitea\AUCMA\SCADA\HwControlLib\
diff --git a/HwControlLib/obj/Debug/net6.0-windows/HwControlLib.assets.cache b/HwControlLib/obj/Debug/net6.0-windows/HwControlLib.assets.cache
index 8c7cf623..a056af0d 100644
Binary files a/HwControlLib/obj/Debug/net6.0-windows/HwControlLib.assets.cache and b/HwControlLib/obj/Debug/net6.0-windows/HwControlLib.assets.cache differ