Browse Source

增加产能查询界面

谢翼翔 1 year ago
parent
commit
e3ae654873

+ 1 - 1
skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/Models/OEEData/OEEDataModel.cs

@@ -82,7 +82,7 @@ namespace SCADA_DAQ.Customer.Models.OEEData
         /// <summary>
         /// 设备Oee百分比
         /// </summary>
-        [AutoViewProperty("设备Oee百分比")]
+        [AutoViewProperty("时间稼动率")]
         [Column(T_Col_Name.App_Vertiv_MachineInfoOeeData.Duration_Dec)]
         public string OeePercentage
         {

+ 63 - 0
skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/Models/Statistics/QueryStatisticsDBModel.cs

@@ -0,0 +1,63 @@
+using SCADA.CommonLib;
+using SCADA.CommonLib.CommonModel;
+using SqlSchema.DBNames;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace SCADA_DAQ.Customer.Models.Statistics
+{
+    public class QueryStatisticsDBModel:BaseQuery
+    {
+        private static SqlSchema.DIL.DILDB DAL = Env.SqlDAL;
+
+        /// <summary>
+        /// 
+        /// </summary>
+        public QueryStatisticsDBModel() : base(DAL.App_Vertiv_Statistics)
+        {
+
+        }
+        /// <summary>
+        /// 
+        /// </summary>
+        [AutoViewProperty("日期时间", OptionItemsSource = nameof(SourceList), StringType = StringType.IsLimited)]
+        [Query(T_Col_Name.App_Vertiv_Statistics.Source_Str)]
+        public string Source    
+        {
+            get { return _Source; }
+            set
+            {
+                if (value != _Source)
+                {
+                    _Source = value;
+                    OnPropertyChanged(nameof(Source));
+                }
+            }
+        }
+        private string _Source;
+        public List<string> SourceList { get; set; } = new List<string> {null,"Year", "Month", "Day", "Hour", };
+
+
+        /// <summary>
+        /// 
+        /// </summary>
+        [AutoViewProperty("创建时间")]
+        [Query(T_Col_Name.App_Vertiv_Statistics.CreateTime_Dt)]
+        public DateRange CreateTime
+        {
+            get { return _CreateTime; }
+            set
+            {
+                if (value != _CreateTime)
+                {
+                    _CreateTime = value;
+                    OnPropertyChanged(nameof(CreateTime));
+                }
+            }
+        }
+        private DateRange _CreateTime = new DateRange(Env.Schedual) { TimeInterval = DateRangeInterval.ThisDay };
+    }
+}

+ 30 - 2
skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/Models/Statistics/StatisticsDBModel.cs

@@ -11,6 +11,7 @@ namespace SCADA_DAQ.Customer.Models.Statistics
         /// <summary>
         /// 类型
         /// </summary>
+        [AutoViewProperty("日期时间")]
         [Column(T_Col_Name.App_Vertiv_Statistics.Source_Str)]
         public string Source
         {
@@ -30,7 +31,7 @@ namespace SCADA_DAQ.Customer.Models.Statistics
         /// <summary>
         /// 源类型值
         /// </summary>
-        /// 
+        [AutoViewProperty("日期时间")]
         [Column(T_Col_Name.App_Vertiv_Statistics.Value_Int)]
 
         public int Value
@@ -52,6 +53,7 @@ namespace SCADA_DAQ.Customer.Models.Statistics
         /// <summary>
         /// 激光机
         /// </summary>
+        [AutoViewProperty("激光机")]
         [Column(T_Col_Name.App_Vertiv_Statistics.Laser_Int)]
         public int LaserValue
         {
@@ -71,6 +73,7 @@ namespace SCADA_DAQ.Customer.Models.Statistics
         /// <summary>
         /// 西门子plc
         /// </summary>
+        [AutoViewProperty("西门子数冲")]
         [Column(T_Col_Name.App_Vertiv_Statistics.Siemens_Int)]
         public int SiemensValue
         {
@@ -90,6 +93,7 @@ namespace SCADA_DAQ.Customer.Models.Statistics
         /// <summary>
         /// 倍福
         /// </summary>
+        [AutoViewProperty("倍福数冲")]
         [Column(T_Col_Name.App_Vertiv_Statistics.Backoff_Int)]
         public int BackoffValue
         {
@@ -109,6 +113,7 @@ namespace SCADA_DAQ.Customer.Models.Statistics
         /// <summary>
         /// 百超折弯
         /// </summary>
+        [AutoViewProperty("百超折弯机")]
         [Column(T_Col_Name.App_Vertiv_Statistics.Bystronic_Int)]
         public int BystronicValue
         {
@@ -128,6 +133,7 @@ namespace SCADA_DAQ.Customer.Models.Statistics
         /// <summary>
         /// 一号折弯机
         /// </summary>
+        [AutoViewProperty("1号YaWei折弯机")]
         [Column(T_Col_Name.App_Vertiv_Statistics.Bend1_Int)]
         public int Bend1Value
         {
@@ -147,6 +153,7 @@ namespace SCADA_DAQ.Customer.Models.Statistics
         /// <summary>
         /// 二号折弯机
         /// </summary>
+        [AutoViewProperty("2号YaWei折弯机")]
         [Column(T_Col_Name.App_Vertiv_Statistics.Bend2_Int)]
         public int Bend2Value
         {
@@ -166,6 +173,7 @@ namespace SCADA_DAQ.Customer.Models.Statistics
         /// <summary>
         /// PBC折弯机
         /// </summary>
+        [AutoViewProperty("亚威PBC折弯机")]
         [Column(T_Col_Name.App_Vertiv_Statistics.PBCBend_Int)]
         public int PBCBendValue
         {
@@ -185,6 +193,7 @@ namespace SCADA_DAQ.Customer.Models.Statistics
         /// <summary>
         /// 三号折弯机
         /// </summary>
+        [AutoViewProperty("3号YaWei折弯机")]
         [Column(T_Col_Name.App_Vertiv_Statistics.Bend3_Int)]
         public int Bend3Value
         {
@@ -204,6 +213,7 @@ namespace SCADA_DAQ.Customer.Models.Statistics
         /// <summary>
         /// 高机冲孔机
         /// </summary>
+        [AutoViewProperty("高机母线冲剪机")]
         [Column(T_Col_Name.App_Vertiv_Statistics.GaojiCisaille_Int)]
         public int GaojiCisailleValue
         {
@@ -223,6 +233,7 @@ namespace SCADA_DAQ.Customer.Models.Statistics
         /// <summary>
         /// 金方圆冲孔机
         /// </summary>
+        [AutoViewProperty("金方圆母线冲孔机")]
         [Column(T_Col_Name.App_Vertiv_Statistics.JinfangyuanCisaille_Int)]
         public int JinfangyuanCisailleValue
         {
@@ -239,7 +250,24 @@ namespace SCADA_DAQ.Customer.Models.Statistics
         private int _JinfangyuanCisailleValue;
 
 
-        public DateTime CreateTime { get; set; }
+        /// <summary>
+        /// 创建时间
+        /// </summary>
+        [AutoViewProperty("设备产能记录创建时间")]
+        [Column(T_Col_Name.App_Vertiv_Statistics.CreateTime_Dt)]
+        public DateTime CreateTime
+        {
+            get { return _CreateTime; }
+            set
+            {
+                if (value != _CreateTime)
+                {
+                    _CreateTime = value;
+                    OnPropertyChanged(nameof(CreateTime));
+                }
+            }
+        }
+        private DateTime _CreateTime;
 
 
 

+ 19 - 0
skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/UctFrmStatisticsQuery.xaml

@@ -0,0 +1,19 @@
+<wpfcontrol:BaseUctFrm  xmlns:wpfcontrol="clr-namespace:SCADA.CommonCtrl.WpfControl;assembly=SCADA.CommonCtrl" x:Class="SCADA_DAQ.Customer.UctFrmStatisticsQuery"
+      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
+      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
+      xmlns:local="clr-namespace:SCADA_DAQ.Customer"
+      mc:Ignorable="d" 
+      xmlns:model="clr-namespace:SCADA_DAQ.Customer.Models.Statistics"
+      x:TypeArguments="model:QueryStatisticsDBModel"
+      d:DesignHeight="450" d:DesignWidth="800"
+      Title="UctFrmStatisticsQuery">
+    <wpfcontrol:QueryFrm x:Name="FrmQuery">
+        <wpfcontrol:SmartGrid x:Name="MainGrid"   IsAutoUpdate="True" CanUserDeleteRows="{Binding IsAdmin,ElementName=this}" 
+                              IsReadOnly="{Binding IsReadOnly ,ElementName=this}"
+                              AutoGenerateColumns="True">
+
+        </wpfcontrol:SmartGrid>
+    </wpfcontrol:QueryFrm>
+</wpfcontrol:BaseUctFrm>

+ 35 - 0
skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/Customer/UctFrmStatisticsQuery.xaml.cs

@@ -0,0 +1,35 @@
+using SCADA.CommonCtrl.WpfControl;
+using SCADA_DAQ.Customer.Models.OEEData;
+using SCADA_DAQ.Customer.Models.Statistics;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace SCADA_DAQ.Customer
+{
+    /// <summary>
+    /// UctFrmStatisticsQuery.xaml 的交互逻辑
+    /// </summary>
+    [UctMenu("设备产能查询", Icon = "查询")]
+    public partial class UctFrmStatisticsQuery : BaseUctFrm<QueryStatisticsDBModel>
+    {
+        public UctFrmStatisticsQuery()
+        {
+            InitializeComponent();
+            FrmQuery.QueryModel = QueryModel;
+            MainGrid.SourceTable = QueryModel.SourceTable;   //指定绑定更新的表
+            MainGrid.DataTableColumnLables = SmartGridHeaderMapping.CreateMapping<StatisticsDBModel>();
+        }
+    }
+}

+ 6 - 0
skoda-scada-daq3.0-master/skoda-scada-daq3.0-master/scada_-daq3.0-master/SCADA_DAQ/SCADA_DAQ.csproj.user

@@ -50,6 +50,9 @@
     <Compile Update="Customer\UctFrmPunchingMachineEquipmentKanban.xaml.cs">
       <SubType>Code</SubType>
     </Compile>
+    <Compile Update="Customer\UctFrmStatisticsQuery.xaml.cs">
+      <SubType>Code</SubType>
+    </Compile>
     <Compile Update="Customer\Views\Dashboard\BystronicPressBrakeWidget.xaml.cs">
       <SubType>Code</SubType>
     </Compile>
@@ -198,6 +201,9 @@
     <Page Update="Customer\UctFrmRunHistory.xaml">
       <SubType>Designer</SubType>
     </Page>
+    <Page Update="Customer\UctFrmStatisticsQuery.xaml">
+      <SubType>Designer</SubType>
+    </Page>
     <Page Update="Customer\Views\Dashboard\BystronicPressBrakeWidget.xaml">
       <SubType>Designer</SubType>
     </Page>