init: 潍柴发动机线 中央控制程序 项目首次入库

This commit is contained in:
XingCheng3
2026-06-08 12:05:16 +08:00
commit 196c66b9ff
547 changed files with 379162 additions and 0 deletions

View File

@@ -0,0 +1,798 @@
namespace LogRecord
{
partial class LogRecord
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows
/// <summary>
/// 设计器支持所需的方法 - 不要修改
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle();
this.tabControl_LogQuery = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.dtp_End = new System.Windows.Forms.DateTimePicker();
this.dtp_Start = new System.Windows.Forms.DateTimePicker();
this.cb_StationName = new System.Windows.Forms.ComboBox();
this.label2 = new System.Windows.Forms.Label();
this.cb_Type = new System.Windows.Forms.ComboBox();
this.btn_Refresh = new System.Windows.Forms.Button();
this.dgv_Log = new System.Windows.Forms.DataGridView();
this. = new System.Windows.Forms.DataGridViewTextBoxColumn();
this. = new System.Windows.Forms.DataGridViewTextBoxColumn();
this. = new System.Windows.Forms.DataGridViewTextBoxColumn();
this. = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.label4 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.tabPage2 = new System.Windows.Forms.TabPage();
this.cmb_StationNames_WebAPI = new System.Windows.Forms.ComboBox();
this.label10 = new System.Windows.Forms.Label();
this.label9 = new System.Windows.Forms.Label();
this.txt_ResponseContext = new System.Windows.Forms.TextBox();
this.txt_RequestContext = new System.Windows.Forms.TextBox();
this.dtpicker_end = new System.Windows.Forms.DateTimePicker();
this.dtpicker_start = new System.Windows.Forms.DateTimePicker();
this.label5 = new System.Windows.Forms.Label();
this.cmb_RequestCMD = new System.Windows.Forms.ComboBox();
this.btn_WebAPILog_Query = new System.Windows.Forms.Button();
this.dgv_WebApiLog = new System.Windows.Forms.DataGridView();
this.label6 = new System.Windows.Forms.Label();
this.label7 = new System.Windows.Forms.Label();
this.label8 = new System.Windows.Forms.Label();
this.tabPage3 = new System.Windows.Forms.TabPage();
this.label16 = new System.Windows.Forms.Label();
this.txt_Key_TaskCodeOrOPName = new System.Windows.Forms.TextBox();
this.label11 = new System.Windows.Forms.Label();
this.label12 = new System.Windows.Forms.Label();
this.txt_ResponseContext_3 = new System.Windows.Forms.TextBox();
this.txt_RequestContext_3 = new System.Windows.Forms.TextBox();
this.dt_End = new System.Windows.Forms.DateTimePicker();
this.dt_Start = new System.Windows.Forms.DateTimePicker();
this.label13 = new System.Windows.Forms.Label();
this.btn_QueryALL = new System.Windows.Forms.Button();
this.dg_WebAPI_And_RunLog = new System.Windows.Forms.DataGridView();
this.StationName = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.TaskCode = new System.Windows.Forms.DataGridViewTextBoxColumn();
this. = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.FROM = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.CMD = new System.Windows.Forms.DataGridViewTextBoxColumn();
this. = new System.Windows.Forms.DataGridViewTextBoxColumn();
this. = new System.Windows.Forms.DataGridViewTextBoxColumn();
this. = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.label14 = new System.Windows.Forms.Label();
this.label15 = new System.Windows.Forms.Label();
this.tabControl_LogQuery.SuspendLayout();
this.tabPage1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dgv_Log)).BeginInit();
this.tabPage2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dgv_WebApiLog)).BeginInit();
this.tabPage3.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dg_WebAPI_And_RunLog)).BeginInit();
this.SuspendLayout();
//
// tabControl_LogQuery
//
this.tabControl_LogQuery.Controls.Add(this.tabPage1);
this.tabControl_LogQuery.Controls.Add(this.tabPage2);
this.tabControl_LogQuery.Controls.Add(this.tabPage3);
this.tabControl_LogQuery.Location = new System.Drawing.Point(0, 2);
this.tabControl_LogQuery.Name = "tabControl_LogQuery";
this.tabControl_LogQuery.SelectedIndex = 0;
this.tabControl_LogQuery.Size = new System.Drawing.Size(1549, 829);
this.tabControl_LogQuery.TabIndex = 0;
//
// tabPage1
//
this.tabPage1.Controls.Add(this.dtp_End);
this.tabPage1.Controls.Add(this.dtp_Start);
this.tabPage1.Controls.Add(this.cb_StationName);
this.tabPage1.Controls.Add(this.label2);
this.tabPage1.Controls.Add(this.cb_Type);
this.tabPage1.Controls.Add(this.btn_Refresh);
this.tabPage1.Controls.Add(this.dgv_Log);
this.tabPage1.Controls.Add(this.label4);
this.tabPage1.Controls.Add(this.label3);
this.tabPage1.Controls.Add(this.label1);
this.tabPage1.Location = new System.Drawing.Point(4, 22);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
this.tabPage1.Size = new System.Drawing.Size(1541, 803);
this.tabPage1.TabIndex = 0;
this.tabPage1.Text = "运行日志查询";
this.tabPage1.UseVisualStyleBackColor = true;
//
// dtp_End
//
this.dtp_End.CustomFormat = "yyyy-MM-dd HH:mm:ss";
this.dtp_End.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
this.dtp_End.Location = new System.Drawing.Point(240, 10);
this.dtp_End.Name = "dtp_End";
this.dtp_End.Size = new System.Drawing.Size(163, 21);
this.dtp_End.TabIndex = 87;
//
// dtp_Start
//
this.dtp_Start.CustomFormat = "yyyy-MM-dd HH:mm:ss";
this.dtp_Start.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
this.dtp_Start.Location = new System.Drawing.Point(35, 10);
this.dtp_Start.Name = "dtp_Start";
this.dtp_Start.Size = new System.Drawing.Size(165, 21);
this.dtp_Start.TabIndex = 88;
//
// cb_StationName
//
this.cb_StationName.FormattingEnabled = true;
this.cb_StationName.Location = new System.Drawing.Point(707, 10);
this.cb_StationName.Name = "cb_StationName";
this.cb_StationName.Size = new System.Drawing.Size(138, 20);
this.cb_StationName.TabIndex = 86;
//
// label2
//
this.label2.AutoSize = true;
this.label2.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label2.Location = new System.Drawing.Point(640, 14);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(67, 14);
this.label2.TabIndex = 82;
this.label2.Text = "工位号:";
//
// cb_Type
//
this.cb_Type.FormattingEnabled = true;
this.cb_Type.Location = new System.Drawing.Point(472, 10);
this.cb_Type.Name = "cb_Type";
this.cb_Type.Size = new System.Drawing.Size(150, 20);
this.cb_Type.TabIndex = 81;
//
// btn_Refresh
//
this.btn_Refresh.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btn_Refresh.Location = new System.Drawing.Point(860, 7);
this.btn_Refresh.Name = "btn_Refresh";
this.btn_Refresh.Size = new System.Drawing.Size(83, 26);
this.btn_Refresh.TabIndex = 80;
this.btn_Refresh.Text = "查询";
this.btn_Refresh.UseVisualStyleBackColor = true;
this.btn_Refresh.Click += new System.EventHandler(this.btn_Refresh_Click);
//
// dgv_Log
//
this.dgv_Log.AllowUserToAddRows = false;
this.dgv_Log.AllowUserToDeleteRows = false;
this.dgv_Log.AllowUserToResizeRows = false;
this.dgv_Log.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.dgv_Log.BackgroundColor = System.Drawing.SystemColors.ButtonHighlight;
dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle1.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.dgv_Log.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1;
this.dgv_Log.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgv_Log.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.,
this.,
this.,
this.});
this.dgv_Log.Location = new System.Drawing.Point(8, 43);
this.dgv_Log.MultiSelect = false;
this.dgv_Log.Name = "dgv_Log";
this.dgv_Log.ReadOnly = true;
this.dgv_Log.RowHeadersVisible = false;
this.dgv_Log.RowTemplate.Height = 26;
this.dgv_Log.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.dgv_Log.Size = new System.Drawing.Size(1527, 757);
this.dgv_Log.TabIndex = 79;
this.dgv_Log.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgv_Log_CellClick);
//
// 时间
//
this..DataPropertyName = "时间";
dataGridViewCellStyle2.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold);
dataGridViewCellStyle2.Format = "G";
this..DefaultCellStyle = dataGridViewCellStyle2;
this..HeaderText = "时间";
this..Name = "时间";
this..ReadOnly = true;
this..SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
this..Width = 190;
//
// 工位号
//
this..DataPropertyName = "工位号";
dataGridViewCellStyle3.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold);
this..DefaultCellStyle = dataGridViewCellStyle3;
this..HeaderText = "工位号";
this..Name = "工位号";
this..ReadOnly = true;
this..SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
this..Width = 150;
//
// 类型
//
this..DataPropertyName = "类型";
dataGridViewCellStyle4.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold);
this..DefaultCellStyle = dataGridViewCellStyle4;
this..HeaderText = "类型";
this..Name = "类型";
this..ReadOnly = true;
this..SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
this..Width = 90;
//
// 内容
//
this..AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
this..DataPropertyName = "内容";
dataGridViewCellStyle5.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold);
this..DefaultCellStyle = dataGridViewCellStyle5;
this..HeaderText = "内容";
this..Name = "内容";
this..ReadOnly = true;
this..SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// label4
//
this.label4.AutoSize = true;
this.label4.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label4.Location = new System.Drawing.Point(212, 13);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(22, 14);
this.label4.TabIndex = 83;
this.label4.Text = "到";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label3.Location = new System.Drawing.Point(6, 14);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(22, 14);
this.label3.TabIndex = 84;
this.label3.Text = "从";
//
// label1
//
this.label1.AutoSize = true;
this.label1.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label1.Location = new System.Drawing.Point(421, 14);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(52, 14);
this.label1.TabIndex = 85;
this.label1.Text = "分类:";
//
// tabPage2
//
this.tabPage2.Controls.Add(this.cmb_StationNames_WebAPI);
this.tabPage2.Controls.Add(this.label10);
this.tabPage2.Controls.Add(this.label9);
this.tabPage2.Controls.Add(this.txt_ResponseContext);
this.tabPage2.Controls.Add(this.txt_RequestContext);
this.tabPage2.Controls.Add(this.dtpicker_end);
this.tabPage2.Controls.Add(this.dtpicker_start);
this.tabPage2.Controls.Add(this.label5);
this.tabPage2.Controls.Add(this.cmb_RequestCMD);
this.tabPage2.Controls.Add(this.btn_WebAPILog_Query);
this.tabPage2.Controls.Add(this.dgv_WebApiLog);
this.tabPage2.Controls.Add(this.label6);
this.tabPage2.Controls.Add(this.label7);
this.tabPage2.Controls.Add(this.label8);
this.tabPage2.Location = new System.Drawing.Point(4, 22);
this.tabPage2.Name = "tabPage2";
this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
this.tabPage2.Size = new System.Drawing.Size(1541, 803);
this.tabPage2.TabIndex = 1;
this.tabPage2.Text = "WebApi接口传递数据日志";
this.tabPage2.UseVisualStyleBackColor = true;
//
// cmb_StationNames_WebAPI
//
this.cmb_StationNames_WebAPI.FormattingEnabled = true;
this.cmb_StationNames_WebAPI.Location = new System.Drawing.Point(759, 9);
this.cmb_StationNames_WebAPI.Name = "cmb_StationNames_WebAPI";
this.cmb_StationNames_WebAPI.Size = new System.Drawing.Size(138, 20);
this.cmb_StationNames_WebAPI.TabIndex = 102;
//
// label10
//
this.label10.AutoSize = true;
this.label10.Location = new System.Drawing.Point(1088, 522);
this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(53, 12);
this.label10.TabIndex = 101;
this.label10.Text = "响应内容";
//
// label9
//
this.label9.AutoSize = true;
this.label9.Location = new System.Drawing.Point(1088, 37);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(53, 12);
this.label9.TabIndex = 101;
this.label9.Text = "请求内容";
//
// txt_ResponseContext
//
this.txt_ResponseContext.Location = new System.Drawing.Point(1090, 537);
this.txt_ResponseContext.Multiline = true;
this.txt_ResponseContext.Name = "txt_ResponseContext";
this.txt_ResponseContext.ReadOnly = true;
this.txt_ResponseContext.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
this.txt_ResponseContext.Size = new System.Drawing.Size(440, 260);
this.txt_ResponseContext.TabIndex = 100;
//
// txt_RequestContext
//
this.txt_RequestContext.Location = new System.Drawing.Point(1090, 52);
this.txt_RequestContext.Multiline = true;
this.txt_RequestContext.Name = "txt_RequestContext";
this.txt_RequestContext.ReadOnly = true;
this.txt_RequestContext.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
this.txt_RequestContext.Size = new System.Drawing.Size(440, 452);
this.txt_RequestContext.TabIndex = 100;
//
// dtpicker_end
//
this.dtpicker_end.CustomFormat = "yyyy-MM-dd HH:mm:ss";
this.dtpicker_end.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
this.dtpicker_end.Location = new System.Drawing.Point(261, 9);
this.dtpicker_end.Name = "dtpicker_end";
this.dtpicker_end.Size = new System.Drawing.Size(154, 21);
this.dtpicker_end.TabIndex = 97;
//
// dtpicker_start
//
this.dtpicker_start.CustomFormat = "yyyy-MM-dd HH:mm:ss";
this.dtpicker_start.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
this.dtpicker_start.Location = new System.Drawing.Point(79, 9);
this.dtpicker_start.Name = "dtpicker_start";
this.dtpicker_start.Size = new System.Drawing.Size(155, 21);
this.dtpicker_start.TabIndex = 98;
//
// label5
//
this.label5.AutoSize = true;
this.label5.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label5.Location = new System.Drawing.Point(681, 12);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(82, 14);
this.label5.TabIndex = 92;
this.label5.Text = "请求关键字";
//
// cmb_RequestCMD
//
this.cmb_RequestCMD.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cmb_RequestCMD.FormattingEnabled = true;
this.cmb_RequestCMD.Location = new System.Drawing.Point(488, 9);
this.cmb_RequestCMD.Name = "cmb_RequestCMD";
this.cmb_RequestCMD.Size = new System.Drawing.Size(187, 20);
this.cmb_RequestCMD.TabIndex = 91;
//
// btn_WebAPILog_Query
//
this.btn_WebAPILog_Query.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btn_WebAPILog_Query.Location = new System.Drawing.Point(903, 5);
this.btn_WebAPILog_Query.Name = "btn_WebAPILog_Query";
this.btn_WebAPILog_Query.Size = new System.Drawing.Size(83, 26);
this.btn_WebAPILog_Query.TabIndex = 90;
this.btn_WebAPILog_Query.Text = "查询";
this.btn_WebAPILog_Query.UseVisualStyleBackColor = true;
this.btn_WebAPILog_Query.Click += new System.EventHandler(this.btn_WebAPILog_Query_Click);
//
// dgv_WebApiLog
//
this.dgv_WebApiLog.AllowUserToAddRows = false;
this.dgv_WebApiLog.AllowUserToDeleteRows = false;
this.dgv_WebApiLog.AllowUserToResizeRows = false;
this.dgv_WebApiLog.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.dgv_WebApiLog.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
this.dgv_WebApiLog.BackgroundColor = System.Drawing.SystemColors.ButtonHighlight;
dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle6.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle6.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle6.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle6.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle6.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle6.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.dgv_WebApiLog.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle6;
this.dgv_WebApiLog.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgv_WebApiLog.Location = new System.Drawing.Point(8, 41);
this.dgv_WebApiLog.MultiSelect = false;
this.dgv_WebApiLog.Name = "dgv_WebApiLog";
this.dgv_WebApiLog.ReadOnly = true;
this.dgv_WebApiLog.RowHeadersVisible = false;
this.dgv_WebApiLog.RowTemplate.Height = 26;
this.dgv_WebApiLog.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.dgv_WebApiLog.Size = new System.Drawing.Size(1065, 757);
this.dgv_WebApiLog.TabIndex = 89;
this.dgv_WebApiLog.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgv_WebApiLog_CellClick);
//
// label6
//
this.label6.AutoSize = true;
this.label6.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label6.Location = new System.Drawing.Point(240, 12);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(15, 14);
this.label6.TabIndex = 93;
this.label6.Text = "-";
//
// label7
//
this.label7.AutoSize = true;
this.label7.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label7.Location = new System.Drawing.Point(6, 12);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(67, 14);
this.label7.TabIndex = 94;
this.label7.Text = "请求时间";
//
// label8
//
this.label8.AutoSize = true;
this.label8.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label8.Location = new System.Drawing.Point(427, 12);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(61, 14);
this.label8.TabIndex = 95;
this.label8.Text = "请求CMD";
//
// tabPage3
//
this.tabPage3.Controls.Add(this.label16);
this.tabPage3.Controls.Add(this.txt_Key_TaskCodeOrOPName);
this.tabPage3.Controls.Add(this.label11);
this.tabPage3.Controls.Add(this.label12);
this.tabPage3.Controls.Add(this.txt_ResponseContext_3);
this.tabPage3.Controls.Add(this.txt_RequestContext_3);
this.tabPage3.Controls.Add(this.dt_End);
this.tabPage3.Controls.Add(this.dt_Start);
this.tabPage3.Controls.Add(this.label13);
this.tabPage3.Controls.Add(this.btn_QueryALL);
this.tabPage3.Controls.Add(this.dg_WebAPI_And_RunLog);
this.tabPage3.Controls.Add(this.label14);
this.tabPage3.Controls.Add(this.label15);
this.tabPage3.Location = new System.Drawing.Point(4, 22);
this.tabPage3.Name = "tabPage3";
this.tabPage3.Size = new System.Drawing.Size(1541, 803);
this.tabPage3.TabIndex = 2;
this.tabPage3.Text = "日志_整合查询";
this.tabPage3.UseVisualStyleBackColor = true;
//
// label16
//
this.label16.AutoSize = true;
this.label16.Font = new System.Drawing.Font("宋体", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label16.ForeColor = System.Drawing.Color.Green;
this.label16.Location = new System.Drawing.Point(751, 13);
this.label16.Name = "label16";
this.label16.Size = new System.Drawing.Size(763, 14);
this.label16.TabIndex = 117;
this.label16.Text = "提示关键字为【WebAPI日志中请求内容】与【运行日志中LogContent】的共同关键字最好为【TaskCode】或【工位号】";
//
// txt_Key_TaskCodeOrOPName
//
this.txt_Key_TaskCodeOrOPName.Location = new System.Drawing.Point(489, 9);
this.txt_Key_TaskCodeOrOPName.Name = "txt_Key_TaskCodeOrOPName";
this.txt_Key_TaskCodeOrOPName.Size = new System.Drawing.Size(167, 21);
this.txt_Key_TaskCodeOrOPName.TabIndex = 116;
//
// label11
//
this.label11.AutoSize = true;
this.label11.Location = new System.Drawing.Point(1090, 522);
this.label11.Name = "label11";
this.label11.Size = new System.Drawing.Size(53, 12);
this.label11.TabIndex = 114;
this.label11.Text = "响应内容";
//
// label12
//
this.label12.AutoSize = true;
this.label12.Location = new System.Drawing.Point(1090, 37);
this.label12.Name = "label12";
this.label12.Size = new System.Drawing.Size(53, 12);
this.label12.TabIndex = 115;
this.label12.Text = "请求内容";
//
// txt_ResponseContext_3
//
this.txt_ResponseContext_3.Location = new System.Drawing.Point(1092, 537);
this.txt_ResponseContext_3.Multiline = true;
this.txt_ResponseContext_3.Name = "txt_ResponseContext_3";
this.txt_ResponseContext_3.ReadOnly = true;
this.txt_ResponseContext_3.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
this.txt_ResponseContext_3.Size = new System.Drawing.Size(440, 260);
this.txt_ResponseContext_3.TabIndex = 112;
//
// txt_RequestContext_3
//
this.txt_RequestContext_3.Location = new System.Drawing.Point(1092, 52);
this.txt_RequestContext_3.Multiline = true;
this.txt_RequestContext_3.Name = "txt_RequestContext_3";
this.txt_RequestContext_3.ReadOnly = true;
this.txt_RequestContext_3.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
this.txt_RequestContext_3.Size = new System.Drawing.Size(440, 452);
this.txt_RequestContext_3.TabIndex = 113;
//
// dt_End
//
this.dt_End.CustomFormat = "yyyy-MM-dd HH:mm:ss";
this.dt_End.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
this.dt_End.Location = new System.Drawing.Point(263, 9);
this.dt_End.Name = "dt_End";
this.dt_End.Size = new System.Drawing.Size(154, 21);
this.dt_End.TabIndex = 110;
//
// dt_Start
//
this.dt_Start.CustomFormat = "yyyy-MM-dd HH:mm:ss";
this.dt_Start.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
this.dt_Start.Location = new System.Drawing.Point(81, 9);
this.dt_Start.Name = "dt_Start";
this.dt_Start.Size = new System.Drawing.Size(155, 21);
this.dt_Start.TabIndex = 111;
//
// label13
//
this.label13.AutoSize = true;
this.label13.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label13.Location = new System.Drawing.Point(431, 12);
this.label13.Name = "label13";
this.label13.Size = new System.Drawing.Size(52, 14);
this.label13.TabIndex = 106;
this.label13.Text = "关键字";
//
// btn_QueryALL
//
this.btn_QueryALL.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btn_QueryALL.Location = new System.Drawing.Point(662, 6);
this.btn_QueryALL.Name = "btn_QueryALL";
this.btn_QueryALL.Size = new System.Drawing.Size(83, 26);
this.btn_QueryALL.TabIndex = 104;
this.btn_QueryALL.Text = "查询";
this.btn_QueryALL.UseVisualStyleBackColor = true;
this.btn_QueryALL.Click += new System.EventHandler(this.btn_QueryALL_Click);
//
// dg_WebAPI_And_RunLog
//
this.dg_WebAPI_And_RunLog.AllowUserToAddRows = false;
this.dg_WebAPI_And_RunLog.AllowUserToDeleteRows = false;
this.dg_WebAPI_And_RunLog.AllowUserToResizeRows = false;
this.dg_WebAPI_And_RunLog.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.dg_WebAPI_And_RunLog.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
this.dg_WebAPI_And_RunLog.BackgroundColor = System.Drawing.SystemColors.ButtonHighlight;
dataGridViewCellStyle7.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle7.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle7.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle7.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle7.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle7.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle7.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.dg_WebAPI_And_RunLog.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle7;
this.dg_WebAPI_And_RunLog.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dg_WebAPI_And_RunLog.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.StationName,
this.TaskCode,
this.,
this.FROM,
this.CMD,
this.,
this.,
this.});
this.dg_WebAPI_And_RunLog.Location = new System.Drawing.Point(10, 41);
this.dg_WebAPI_And_RunLog.MultiSelect = false;
this.dg_WebAPI_And_RunLog.Name = "dg_WebAPI_And_RunLog";
this.dg_WebAPI_And_RunLog.ReadOnly = true;
this.dg_WebAPI_And_RunLog.RowHeadersVisible = false;
this.dg_WebAPI_And_RunLog.RowTemplate.Height = 26;
this.dg_WebAPI_And_RunLog.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.dg_WebAPI_And_RunLog.Size = new System.Drawing.Size(1065, 757);
this.dg_WebAPI_And_RunLog.TabIndex = 103;
this.dg_WebAPI_And_RunLog.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dg_WebAPI_And_RunLog_CellClick);
//
// StationName
//
this.StationName.DataPropertyName = "StationName";
this.StationName.FillWeight = 85.85372F;
this.StationName.HeaderText = "StationName";
this.StationName.Name = "StationName";
this.StationName.ReadOnly = true;
//
// TaskCode
//
this.TaskCode.DataPropertyName = "TaskCode";
this.TaskCode.FillWeight = 89.0835F;
this.TaskCode.HeaderText = "TaskCode";
this.TaskCode.Name = "TaskCode";
this.TaskCode.ReadOnly = true;
//
// 日志类型
//
this..DataPropertyName = "日志类型";
this..FillWeight = 71.00318F;
this..HeaderText = "日志类型";
this..Name = "日志类型";
this..ReadOnly = true;
//
// 请求FROM
//
this.FROM.DataPropertyName = "请求FROM";
this.FROM.FillWeight = 81.21832F;
this.FROM.HeaderText = "请求FROM";
this.FROM.Name = "请求FROM";
this.FROM.ReadOnly = true;
//
// 请求CMD
//
this.CMD.DataPropertyName = "请求CMD/Log_Type";
this.CMD.FillWeight = 118.3387F;
this.CMD.HeaderText = "请求CMD";
this.CMD.Name = "请求CMD";
this.CMD.ReadOnly = true;
//
// 发生时间
//
this..DataPropertyName = "发生时间";
this..FillWeight = 94.84125F;
this..HeaderText = "发生时间";
this..Name = "发生时间";
this..ReadOnly = true;
//
// 请求内容
//
this..DataPropertyName = "请求内容/日志内容";
this..FillWeight = 140.5793F;
this..HeaderText = "请求内容";
this..Name = "请求内容";
this..ReadOnly = true;
//
// 响应内容
//
this..DataPropertyName = "响应内容";
this..FillWeight = 119.0824F;
this..HeaderText = "响应内容";
this..Name = "响应内容";
this..ReadOnly = true;
//
// label14
//
this.label14.AutoSize = true;
this.label14.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label14.Location = new System.Drawing.Point(242, 12);
this.label14.Name = "label14";
this.label14.Size = new System.Drawing.Size(15, 14);
this.label14.TabIndex = 107;
this.label14.Text = "-";
//
// label15
//
this.label15.AutoSize = true;
this.label15.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label15.Location = new System.Drawing.Point(8, 12);
this.label15.Name = "label15";
this.label15.Size = new System.Drawing.Size(67, 14);
this.label15.TabIndex = 108;
this.label15.Text = "请求时间";
//
// LogRecord
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1550, 834);
this.Controls.Add(this.tabControl_LogQuery);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.Name = "LogRecord";
this.ShowIcon = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "日志";
this.Load += new System.EventHandler(this.LogRecord_Load);
this.Resize += new System.EventHandler(this.LogRecord_Resize);
this.tabControl_LogQuery.ResumeLayout(false);
this.tabPage1.ResumeLayout(false);
this.tabPage1.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.dgv_Log)).EndInit();
this.tabPage2.ResumeLayout(false);
this.tabPage2.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.dgv_WebApiLog)).EndInit();
this.tabPage3.ResumeLayout(false);
this.tabPage3.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.dg_WebAPI_And_RunLog)).EndInit();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.TabControl tabControl_LogQuery;
private System.Windows.Forms.TabPage tabPage1;
private System.Windows.Forms.DateTimePicker dtp_End;
private System.Windows.Forms.DateTimePicker dtp_Start;
private System.Windows.Forms.ComboBox cb_StationName;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.ComboBox cb_Type;
private System.Windows.Forms.Button btn_Refresh;
private System.Windows.Forms.DataGridView dgv_Log;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TabPage tabPage2;
private System.Windows.Forms.DateTimePicker dtpicker_end;
private System.Windows.Forms.DateTimePicker dtpicker_start;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.ComboBox cmb_RequestCMD;
private System.Windows.Forms.Button btn_WebAPILog_Query;
private System.Windows.Forms.DataGridView dgv_WebApiLog;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.Label label8;
private System.Windows.Forms.Label label10;
private System.Windows.Forms.Label label9;
private System.Windows.Forms.TextBox txt_ResponseContext;
private System.Windows.Forms.TextBox txt_RequestContext;
private System.Windows.Forms.ComboBox cmb_StationNames_WebAPI;
private System.Windows.Forms.DataGridViewTextBoxColumn ;
private System.Windows.Forms.DataGridViewTextBoxColumn ;
private System.Windows.Forms.DataGridViewTextBoxColumn ;
private System.Windows.Forms.DataGridViewTextBoxColumn ;
private System.Windows.Forms.TabPage tabPage3;
private System.Windows.Forms.TextBox txt_Key_TaskCodeOrOPName;
private System.Windows.Forms.Label label11;
private System.Windows.Forms.Label label12;
private System.Windows.Forms.TextBox txt_ResponseContext_3;
private System.Windows.Forms.TextBox txt_RequestContext_3;
private System.Windows.Forms.DateTimePicker dt_End;
private System.Windows.Forms.DateTimePicker dt_Start;
private System.Windows.Forms.Label label13;
private System.Windows.Forms.Button btn_QueryALL;
private System.Windows.Forms.Label label14;
private System.Windows.Forms.Label label15;
private System.Windows.Forms.Label label16;
private System.Windows.Forms.DataGridView dg_WebAPI_And_RunLog;
private System.Windows.Forms.DataGridViewTextBoxColumn StationName;
private System.Windows.Forms.DataGridViewTextBoxColumn TaskCode;
private System.Windows.Forms.DataGridViewTextBoxColumn ;
private System.Windows.Forms.DataGridViewTextBoxColumn FROM;
private System.Windows.Forms.DataGridViewTextBoxColumn CMD;
private System.Windows.Forms.DataGridViewTextBoxColumn ;
private System.Windows.Forms.DataGridViewTextBoxColumn ;
private System.Windows.Forms.DataGridViewTextBoxColumn ;
}
}

View File

@@ -0,0 +1,359 @@
using ExternalDataSync;
using MesWork;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using SlMesDbIterface;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Linq;
using System.Reflection.Emit;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using static System.Configuration.ConfigurationManager;
/// <summary>
/// 报警类型
/// </summary>
public enum Type_Log
{
/// <summary>
/// 报警
/// </summary>
Alarm = 1,
/// <summary>
/// 登录
/// </summary>
Login = 2,
/// <summary>
/// 提示
/// </summary>
Tip = 3,
/// <summary>
/// 操作(生产计划、点按钮操作)
/// </summary>
Operation = 4,
/// <summary>
/// MES处理信号
/// </summary>
MesHandler = 5,
/// <summary>
/// 配方下载
/// </summary>
RecipesDownload = 6,
/// <summary>
/// 发动机上线
/// </summary>
OnLine = 7,
/// <summary>
/// 发动机下线
/// </summary>
OffLine = 8,
/// <summary>
/// MES请求接口的日志
/// </summary>
Interface_MesReq = 9,
/// <summary>
/// MES请求接口的日志
/// </summary>
RecipesDownload_ColdTest = 10,
/// <summary>
///
/// </summary>
Undefined = 1000
}
namespace LogRecord
{
/// <summary>
/// 日志处理
/// </summary>
public partial class LogRecord : Form
{
/// <summary>
/// 构造
/// </summary>
public LogRecord()
{
InitializeComponent();
//this.WindowState = FormWindowState.Maximized;
}
/// <summary>
/// 构造
/// </summary>
/// <param name="_Width"></param>
/// <param name="_Height"></param>
public LogRecord(int _Width,int _Height)
{
InitializeComponent();
//this.Width = _Width;
//this.Height = _Height;
cb_Type.DataSource = Enum.GetNames(typeof(Type_Log));
cb_Type.Text = Type_Log.Undefined.ToString ();
cb_StationName.Items.Add("");
cmb_StationNames_WebAPI.Items.Add("");
foreach (var stationName in MesWorkForm.opNameList)
{
cb_StationName.Items.Add(stationName);
cmb_StationNames_WebAPI.Items.Add(stationName);
}
cb_StationName.SelectedIndex = 0;
cmb_StationNames_WebAPI.SelectedIndex = 0;
var end = DateTime.Now.AddDays(1);
var start = end.AddDays(-8);
dtp_Start.Value = start;
dtp_End.Value = end;
dtpicker_end.Value = DateTime.Now.AddDays(1);
dtpicker_start.Value = DateTime.Now.AddDays(-3);
dt_End.Value = DateTime.Now.AddDays(1);
dt_Start.Value = DateTime.Now.AddDays(-1);
WebAPI_LogType_Binding();
}
private void WebAPI_LogType_Binding()
{
var sql = "SELECT [请求CMD] FROM [历史_WebApi接口传递数据日志] group by [请求CMD] order by [请求CMD]";
SqlOperation.ExecuteSql(sql, out DataTable dt, out string error);
DataRow irow = dt.NewRow();
irow[0] = "";
dt.Rows.InsertAt(irow, 0);
cmb_RequestCMD.ValueMember = "请求CMD";
cmb_RequestCMD.DisplayMember= "请求CMD";
cmb_RequestCMD.DataSource = dt;
}
/// <summary>
/// 钩子
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void LogRecord_Load(object sender, EventArgs e)
{
var start = dtp_Start.Value;
var end = dtp_End.Value;
Refresh_Log(Type_Log.Undefined,"", start, end);
}
/// <summary>
/// 刷新日志的显示
/// </summary>
private void Refresh_Log(Type_Log type, string stationName, DateTime start, DateTime end)
{
var dt = Select_Log(type, stationName, start, end);
dgv_Log.DataSource = dt;
for (int i = 0; i < dt.Rows.Count; i++)
{
var = (Type_Log)Enum.Parse(typeof(Type_Log),dt.Rows[i]["类型"].ToString());
switch ()
{
case Type_Log.Alarm:
RowsColor(i, MesWorkForm.color_Red, dgv_Log);
break;
case Type_Log.Login:
RowsColor(i, MesWorkForm.color_Green, dgv_Log);
break;
case Type_Log.Tip:
RowsColor(i, MesWorkForm.color_Yellow, dgv_Log);
break;
default:
RowsColor(i, MesWorkForm.color_Grey, dgv_Log);
break;
}
}
dgv_Log.ClearSelection();
//dgv_Log.CurrentCell = null;
//dgv_Log.Rows[0].Selected = false;
}
/// <summary>
///
/// </summary>
/// <param name="row"></param>
/// <param name="color"></param>
/// <param name="dgv"></param>
private void RowsColor(int row, Color color, DataGridView dgv)
{
var dt = (System.Data.DataTable)dgv.DataSource;
for (int i = 0; i < dt.Columns.Count; i++)
{
dgv.Rows[row].Cells[i].Style.BackColor = color;
}
}
/// <summary>
/// 增加日志
/// </summary>
/// <param name="LogType"></param>
/// <param name="Log_Content"></param>
/// <returns></returns>
public static bool Insert_Log(Type_Log LogType,string stationName, string Log_Content)
{
bool success = false;
var sql =
$" INSERT INTO [记录_日志_运行日志]([Log_Station],[Log_Type],[Log_Time],[Log_Content])" +
$" VALUES('{stationName}','{LogType.ToString()}',getdate(),'{Log_Content}')";
success = DataLinkMesWork.SQLCommon.ExecuteSql(sql, MesWorkForm.ConnectionString, out string err2);
return success;
}
public static bool Insert_ScanLog_EleCraft(Type_Log LogType,string stationName, string Log_Content)
{
bool success = false;
var sql =
$" INSERT INTO [记录_日志_扫码发送电子工艺]([Log_Station],[Log_Type],[Log_Time],[Log_Content])" +
$" VALUES('{stationName}','{LogType.ToString()}',getdate(),'{Log_Content}')";
success = DataLinkMesWork.SQLCommon.ExecuteSql(sql, MesWorkForm.ConnectionString, out string err2);
return success;
}
/// <summary>
/// 查询日志
/// </summary>
/// <returns></returns>
public static DataTable Select_Log(Type_Log type,string stationName,DateTime start,DateTime end)
{
var whereStr = "";
if (type != Type_Log.Undefined)
{
whereStr = whereStr + $" AND [Log_Type] = '{type.ToString()}'";
}
if (stationName != "")
{
whereStr = whereStr + $" AND [Log_Station] = '{stationName}'";
}
if (start != null & end != null)
{
whereStr = whereStr + $" AND [Log_Time] >= '{start.ToString("G")}' AND [Log_Time] < '{end.ToString("G")}'";
}
var sql =
$" SELECT " +
$" [Log_Time] AS 时间" +
$" ,[Log_Station] AS 工位号" +
$" ,[Log_Type] AS 类型" +
$" ,[Log_Content] AS 内容" +
$" FROM [记录_日志_运行日志]" +
$" WHERE 1=1 {whereStr}" +
$" ORDER BY [Log_Time] DESC";
DataLinkMesWork.SQLCommon.ExecuteDataTable(sql, MesWorkForm.ConnectionString,out DataTable dt, out string err2);
return dt;
}
/// <summary>
/// 手动刷新
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btn_Refresh_Click(object sender, EventArgs e)
{
var type = (Type_Log)Enum.Parse(typeof(Type_Log), cb_Type.Text);
var start = dtp_Start.Value;
var end = dtp_End.Value;
var stationName = cb_StationName.Text;
Refresh_Log(type, stationName, start,end);
}
private void btn_WebAPILog_Query_Click(object sender, EventArgs e)
{
var wherestr = $"WHERE [请求时间]>='{dtpicker_start.Value}' AND [请求时间]<='{dtpicker_end.Value}'";
if (cmb_RequestCMD.Text.Trim() != "") wherestr += $" AND [请求CMD]='{cmb_RequestCMD.Text.Trim()}'";
if(cmb_StationNames_WebAPI.Text.Trim()!="") wherestr += $" AND [请求内容] LIKE '%{cmb_StationNames_WebAPI.Text.Trim()}%'";
var sql = $"SELECT Top(500) [TaskID],[请求CMD],[请求FROM],[请求时间],[请求内容],[响应时间],[响应内容] FROM [历史_WebApi接口传递数据日志] {wherestr}";
sql += " ORDER BY [请求时间] DESC";
SqlOperation.ExecuteSql(sql, out DataTable dt, out string error);
dgv_WebApiLog.DataSource = dt;
dgv_WebApiLog.Columns["请求时间"].ValueType = typeof(DateTime);
dgv_WebApiLog.Columns["请求时间"].DefaultCellStyle.Format = "yyyy-MM-dd HH:mm:ss";
dgv_WebApiLog.Columns["响应时间"].ValueType = typeof(DateTime);
dgv_WebApiLog.Columns["响应时间"].DefaultCellStyle.Format = "yyyy-MM-dd HH:mm:ss";
}
private void dgv_WebApiLog_CellClick(object sender, DataGridViewCellEventArgs e)
{
try
{
txt_RequestContext.Text = dgv_WebApiLog.CurrentRow.Cells["请求内容"].Value.ToString();
txt_ResponseContext.Text = dgv_WebApiLog.CurrentRow.Cells["响应内容"].Value.ToString();
try
{
var _msgRequest = JsonConvert.DeserializeObject<JObject>(txt_RequestContext.Text);
if (_msgRequest["content"] != null) txt_Key_TaskCodeOrOPName.Text = _msgRequest["content"]["taskCode"].ToString();
else if (_msgRequest["WorkCellCode"] != null) txt_Key_TaskCodeOrOPName.Text = _msgRequest["WorkCellCode"].ToString();
else txt_Key_TaskCodeOrOPName.Text = "";
}
catch (Exception)
{
}
}
catch (Exception)
{
throw;
}
}
private void LogRecord_Resize(object sender, EventArgs e)
{
tabControl_LogQuery.Width = this.Width-20;
tabControl_LogQuery.Height= this.Height-45;
dgv_Log.Width= tabControl_LogQuery.Width - 44;
dgv_Log.Height = tabControl_LogQuery.Height - 117;
dgv_WebApiLog.Width = tabControl_LogQuery.Width - 501;
dgv_WebApiLog.Height = tabControl_LogQuery.Height - 116;
txt_RequestContext.Left = txt_ResponseContext.Left= label10.Left = label9.Left = tabControl_LogQuery.Width-459;
dg_WebAPI_And_RunLog.Width = tabControl_LogQuery.Width - 501;
dg_WebAPI_And_RunLog.Height = tabControl_LogQuery.Height - 116;
txt_RequestContext_3.Left = txt_ResponseContext_3.Left= label11.Left = label12.Left = tabControl_LogQuery.Width-459;
}
private void btn_QueryALL_Click(object sender, EventArgs e)
{
var name = "大柴_日志查询_TaskCode";
var sqlParameters = new SqlParameter[] {
new SqlParameter("@TaskCode", this.txt_Key_TaskCodeOrOPName.Text.Trim()),
new SqlParameter("@StartTime",dt_Start.Value),
new SqlParameter("@EndTime",dt_End.Value),
};
SqlOperation.ExecuteStoredProcedure(name, sqlParameters,out DataTable dt, out string error);
dg_WebAPI_And_RunLog.DataSource = dt;
dg_WebAPI_And_RunLog.Columns["发生时间"].ValueType = typeof(DateTime);
dg_WebAPI_And_RunLog.Columns["发生时间"].DefaultCellStyle.Format = "yyyy-MM-dd HH:mm:ss";
}
private void dg_WebAPI_And_RunLog_CellClick(object sender, DataGridViewCellEventArgs e)
{
txt_RequestContext_3.Text = dg_WebAPI_And_RunLog.CurrentRow.Cells["请求内容"].Value.ToString();
txt_ResponseContext_3.Text = dg_WebAPI_And_RunLog.CurrentRow.Cells["响应内容"].Value.ToString();
}
private void dgv_Log_CellClick(object sender, DataGridViewCellEventArgs e)
{
try
{
var workcell = dgv_Log.CurrentRow.Cells["工位号"].Value.ToString().Trim();
txt_Key_TaskCodeOrOPName.Text= workcell;
}
catch (Exception)
{
throw;
}
}
}
}

View File

@@ -0,0 +1,156 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="时间.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="工位号.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="类型.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="内容.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="StationName.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="TaskCode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="日志类型.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="请求FROM.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="请求CMD.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="发生时间.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="请求内容.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="响应内容.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
</root>