From f8c3e66071ff442b25c17e13c91b0b6e1d1cbea5 Mon Sep 17 00:00:00 2001
From: schangxiang@126.com <schangxiang@126.com>
Date: 周日, 15 12月 2024 09:00:52 +0800
Subject: [PATCH] 22
---
CC/iWareCC_ASRS/Handler/DeviceWarningHandler.cs | 15 ++++++-
SDA/iWareSda/Devices/4-Station/StationModel/StationEntity.cs | 2
SDA/iWareSda/SdaMainForm.Designer.cs | 62 -------------------------------
3 files changed, 14 insertions(+), 65 deletions(-)
diff --git a/CC/iWareCC_ASRS/Handler/DeviceWarningHandler.cs b/CC/iWareCC_ASRS/Handler/DeviceWarningHandler.cs
index 774a7be..2625338 100644
--- a/CC/iWareCC_ASRS/Handler/DeviceWarningHandler.cs
+++ b/CC/iWareCC_ASRS/Handler/DeviceWarningHandler.cs
@@ -24,6 +24,7 @@
DeviceWarningOutput output = new DeviceWarningOutput();
System.Collections.Generic.List<iWareCC.StationService.WmsConfigDeviceWarning> retList = new System.Collections.Generic.List<iWareCC.StationService.WmsConfigDeviceWarning>();
System.Collections.Generic.List<wms_config_device_warning> dbList = new System.Collections.Generic.List<wms_config_device_warning>();
+ System.Collections.Generic.List<wms_config_device_warning> real_dbList = new System.Collections.Generic.List<wms_config_device_warning>();
try
{
using (WmsDBModel edm = new WmsDBModel())
@@ -32,8 +33,18 @@
var query1 = (int)DeviceWarningTypeEnum.瀹夊叏鎶ヨ;
var query2 = (int)DeviceWarningTypeEnum.纭欢鎶ヨ;
dbList = edm.wms_config_device_warning.Where(x => x.DeviceWarningType == query1 || x.DeviceWarningType == query2).ToList();
+ //姣忕鍖哄煙鐨勬瘡绉嶇被鍨嬶紝鍙彇鍓�20鏉¤褰�
+ var groupedData = dbList.GroupBy(x => new { x.DeviceAreaCode, x.DeviceWarningType }).Select(group => new
+ {
+ GroupKey = group.Key,
+ Top20Items = group.ToList().OrderBy(x => x.Id).Take(20)
+ });
+ foreach (var item in groupedData)
+ {
+ real_dbList.AddRange(item.Top20Items);
+ }
}
- foreach (var item in dbList)
+ foreach (var item in real_dbList)
{
retList.Add(new StationService.WmsConfigDeviceWarning()
{
@@ -47,7 +58,7 @@
}
output.wmsConfigDeviceWarnings = retList;
- output.wms_config_device_warning_list = dbList;
+ output.wms_config_device_warning_list = real_dbList;
return output;
}
diff --git a/SDA/iWareSda/Devices/4-Station/StationModel/StationEntity.cs b/SDA/iWareSda/Devices/4-Station/StationModel/StationEntity.cs
index 482d54c..116a389 100644
--- a/SDA/iWareSda/Devices/4-Station/StationModel/StationEntity.cs
+++ b/SDA/iWareSda/Devices/4-Station/StationModel/StationEntity.cs
@@ -1274,7 +1274,7 @@
//Context = item.WarningContent.Trim(),
});
}
- Thread.Sleep(1000);
+ //Thread.Sleep(1000);
}
}
catch (Exception ex)
diff --git a/SDA/iWareSda/SdaMainForm.Designer.cs b/SDA/iWareSda/SdaMainForm.Designer.cs
index 4635990..5719bfd 100644
--- a/SDA/iWareSda/SdaMainForm.Designer.cs
+++ b/SDA/iWareSda/SdaMainForm.Designer.cs
@@ -34,10 +34,6 @@
this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage_Main = new System.Windows.Forms.TabPage();
this.panel2 = new System.Windows.Forms.Panel();
- this.button1 = new System.Windows.Forms.Button();
- this.button2 = new System.Windows.Forms.Button();
- this.btn_Hide = new System.Windows.Forms.Button();
- this.btn_Show = new System.Windows.Forms.Button();
this.progressBar1 = new System.Windows.Forms.ProgressBar();
this.rtbError = new System.Windows.Forms.RichTextBox();
this.lbl_Main2 = new System.Windows.Forms.Label();
@@ -50,7 +46,6 @@
this.panel1.SuspendLayout();
this.tabControl1.SuspendLayout();
this.tabPage_Main.SuspendLayout();
- this.panel2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox5)).BeginInit();
this.tabPage_RGV.SuspendLayout();
this.SuspendLayout();
@@ -98,64 +93,12 @@
//
// panel2
//
- this.panel2.Controls.Add(this.button1);
- this.panel2.Controls.Add(this.button2);
- this.panel2.Controls.Add(this.btn_Hide);
- this.panel2.Controls.Add(this.btn_Show);
this.panel2.Dock = System.Windows.Forms.DockStyle.Top;
this.panel2.Location = new System.Drawing.Point(3, 237);
this.panel2.Margin = new System.Windows.Forms.Padding(4);
this.panel2.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(1076, 58);
this.panel2.TabIndex = 21;
- //
- // button1
- //
- this.button1.BackColor = System.Drawing.Color.Silver;
- this.button1.Location = new System.Drawing.Point(607, 8);
- this.button1.Margin = new System.Windows.Forms.Padding(4);
- this.button1.Name = "button1";
- this.button1.Size = new System.Drawing.Size(164, 42);
- this.button1.TabIndex = 3;
- this.button1.Text = "闅愯棌瀹炴椂RGV鐨凱LC鍊�";
- this.button1.UseVisualStyleBackColor = false;
- this.button1.Click += new System.EventHandler(this.button1_Click_1);
- //
- // button2
- //
- this.button2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(255)))), ((int)(((byte)(128)))));
- this.button2.Location = new System.Drawing.Point(417, 8);
- this.button2.Margin = new System.Windows.Forms.Padding(4);
- this.button2.Name = "button2";
- this.button2.Size = new System.Drawing.Size(164, 42);
- this.button2.TabIndex = 2;
- this.button2.Text = "鏄剧ず瀹炴椂RGV鐨凱LC鍊�";
- this.button2.UseVisualStyleBackColor = false;
- this.button2.Click += new System.EventHandler(this.button2_Click_1);
- //
- // btn_Hide
- //
- this.btn_Hide.BackColor = System.Drawing.Color.Silver;
- this.btn_Hide.Location = new System.Drawing.Point(231, 8);
- this.btn_Hide.Margin = new System.Windows.Forms.Padding(4);
- this.btn_Hide.Name = "btn_Hide";
- this.btn_Hide.Size = new System.Drawing.Size(164, 42);
- this.btn_Hide.TabIndex = 1;
- this.btn_Hide.Text = "闅愯棌瀹炴椂鍫嗗灈鏈篜LC鍊�";
- this.btn_Hide.UseVisualStyleBackColor = false;
- this.btn_Hide.Click += new System.EventHandler(this.btn_Hide_Click);
- //
- // btn_Show
- //
- this.btn_Show.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(255)))), ((int)(((byte)(128)))));
- this.btn_Show.Location = new System.Drawing.Point(41, 8);
- this.btn_Show.Margin = new System.Windows.Forms.Padding(4);
- this.btn_Show.Name = "btn_Show";
- this.btn_Show.Size = new System.Drawing.Size(164, 42);
- this.btn_Show.TabIndex = 0;
- this.btn_Show.Text = "鏄剧ず瀹炴椂鍫嗗灈鏈篜LC鍊�";
- this.btn_Show.UseVisualStyleBackColor = false;
- this.btn_Show.Click += new System.EventHandler(this.btn_Show_Click);
//
// progressBar1
//
@@ -278,7 +221,6 @@
this.panel1.PerformLayout();
this.tabControl1.ResumeLayout(false);
this.tabPage_Main.ResumeLayout(false);
- this.panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.pictureBox5)).EndInit();
this.tabPage_RGV.ResumeLayout(false);
this.tabPage_RGV.PerformLayout();
@@ -300,10 +242,6 @@
private System.Windows.Forms.PictureBox pictureBox5;
private System.Windows.Forms.TabPage tabPage_RGV;
private System.Windows.Forms.Panel panel2;
- private System.Windows.Forms.Button btn_Show;
- private System.Windows.Forms.Button btn_Hide;
private System.Windows.Forms.TextBox tb_Station;
- private System.Windows.Forms.Button button1;
- private System.Windows.Forms.Button button2;
}
}
\ No newline at end of file
--
Gitblit v1.9.3