#011 客户报告特殊字段替换,报告内容 inv 测试

This commit is contained in:
HM-CN\zhengxuan.zhang
2025-08-19 16:59:00 +08:00
parent f865e8653c
commit 821d34997a
8 changed files with 66 additions and 53 deletions
+11 -4
View File
@@ -6,6 +6,7 @@ using System.Collections.Generic;
using System.Data;
using System.Globalization;
using System.IO;
using System.Net.NetworkInformation;
using System.Text;
namespace NSAnalysis
@@ -546,15 +547,19 @@ namespace NSAnalysis
// 替换模板中的变量
foreach (var line in templateLines)
{
string replaced = line
.Replace("{DateTime}", DateTime.Now.ToString("yyyy/MM/dd HH:mm"))
.Replace("{CarID}", strCarID);
sb.AppendLine(replaced);
string processedLine = line
.Replace("{prodnum}", strCarID)
.Trim('"');
Console.WriteLine($"处理行: {processedLine}"); // 控制台输出处理的行
sb.AppendLine(processedLine);
}
// 空行分隔
sb.AppendLine();
sb.AppendLine();
sb.AppendLine();
sb.AppendLine();
// 添加测量数据表头
sb.AppendLine("Characteristic,Extension,Measured_Value");
@@ -609,6 +614,8 @@ namespace NSAnalysis
//string testPath = @"D:\CJLR\DATA\Input\LLL\K0902906.csv";
//bool result = MatchCsvValue(testPath, "X540_L", 3, 1);
//MyBase.TraceWriteLine($"匹配结果: {result}");
GenCustomerReport("K0902906");
}
}
}
+2
View File
@@ -876,6 +876,8 @@ namespace NSAnalysis
{
ScaleControls(this);
}
}
public class AnalysisResult
+33 -32
View File
@@ -102,9 +102,9 @@ namespace NSAnalysis
this.labCurrentPage = new System.Windows.Forms.Label();
this.labSearchResult = new System.Windows.Forms.Label();
this.radGroupBox1 = new Telerik.WinControls.UI.RadGroupBox();
this.rbtnExportCSVReport = new Telerik.WinControls.UI.RadButton();
this.rtbPartID = new Telerik.WinControls.UI.RadTextBox();
this.rbtSelectFPY = new Telerik.WinControls.UI.RadButton();
this.rbtnExportCSVReport = new Telerik.WinControls.UI.RadButton();
this.rdtpStartTime = new Telerik.WinControls.UI.RadDateTimePicker();
this.rdtpEndTime = new Telerik.WinControls.UI.RadDateTimePicker();
this.rbtnSearchMeaserData = new Telerik.WinControls.UI.RadButton();
@@ -156,9 +156,9 @@ namespace NSAnalysis
((System.ComponentModel.ISupportInitialize)(this.rbtnNextPage)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.radGroupBox1)).BeginInit();
this.radGroupBox1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.rbtnExportCSVReport)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.rtbPartID)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.rbtSelectFPY)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.rbtnExportCSVReport)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.rdtpStartTime)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.rdtpEndTime)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.rbtnSearchMeaserData)).BeginInit();
@@ -485,7 +485,7 @@ namespace NSAnalysis
this.groupBox4.ForeColor = System.Drawing.Color.White;
this.groupBox4.Location = new System.Drawing.Point(991, 255);
this.groupBox4.Name = "groupBox4";
this.groupBox4.Size = new System.Drawing.Size(495, 361);
this.groupBox4.Size = new System.Drawing.Size(495, 311);
this.groupBox4.TabIndex = 199;
this.groupBox4.TabStop = false;
this.groupBox4.Text = "解析概览";
@@ -1071,9 +1071,9 @@ namespace NSAnalysis
this.radGroupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.radGroupBox1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(27)))), ((int)(((byte)(60)))), ((int)(((byte)(68)))));
this.radGroupBox1.Controls.Add(this.rbtnExportCSVReport);
this.radGroupBox1.Controls.Add(this.rtbPartID);
this.radGroupBox1.Controls.Add(this.rbtSelectFPY);
this.radGroupBox1.Controls.Add(this.rbtnExportCSVReport);
this.radGroupBox1.Controls.Add(this.rdtpStartTime);
this.radGroupBox1.Controls.Add(this.rdtpEndTime);
this.radGroupBox1.Controls.Add(this.rbtnSearchMeaserData);
@@ -1102,6 +1102,29 @@ namespace NSAnalysis
((Telerik.WinControls.Primitives.FillPrimitive)(this.radGroupBox1.GetChildAt(0).GetChildAt(1).GetChildAt(0))).SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.None;
((Telerik.WinControls.Primitives.BorderPrimitive)(this.radGroupBox1.GetChildAt(0).GetChildAt(1).GetChildAt(1))).BackColor = System.Drawing.Color.Black;
//
// rbtnExportCSVReport
//
this.rbtnExportCSVReport.Anchor = System.Windows.Forms.AnchorStyles.Top;
this.rbtnExportCSVReport.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(19)))), ((int)(((byte)(46)))), ((int)(((byte)(53)))));
this.rbtnExportCSVReport.Font = new System.Drawing.Font("Segoe UI", 12F);
this.rbtnExportCSVReport.ForeColor = System.Drawing.Color.White;
this.rbtnExportCSVReport.Image = global::NSAnalysis.Properties.Resources.export;
this.rbtnExportCSVReport.Location = new System.Drawing.Point(1120, 29);
this.rbtnExportCSVReport.Name = "rbtnExportCSVReport";
this.rbtnExportCSVReport.Size = new System.Drawing.Size(144, 40);
this.rbtnExportCSVReport.TabIndex = 8;
this.rbtnExportCSVReport.Text = "导出CSV报告";
this.rbtnExportCSVReport.Click += new System.EventHandler(this.rbtnExportCSVReport_Click);
this.rbtnExportCSVReport.MouseLeave += new System.EventHandler(this.btn_MouseLeave);
this.rbtnExportCSVReport.MouseHover += new System.EventHandler(this.btn_MouseHover);
((Telerik.WinControls.UI.RadButtonElement)(this.rbtnExportCSVReport.GetChildAt(0))).Image = global::NSAnalysis.Properties.Resources.export;
((Telerik.WinControls.UI.RadButtonElement)(this.rbtnExportCSVReport.GetChildAt(0))).Text = "导出CSV报告";
((Telerik.WinControls.Primitives.BorderPrimitive)(this.rbtnExportCSVReport.GetChildAt(0).GetChildAt(2))).InnerColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(151)))), ((int)(((byte)(186)))));
((Telerik.WinControls.Primitives.BorderPrimitive)(this.rbtnExportCSVReport.GetChildAt(0).GetChildAt(2))).InnerColor2 = System.Drawing.Color.FromArgb(((int)(((byte)(27)))), ((int)(((byte)(60)))), ((int)(((byte)(48)))));
((Telerik.WinControls.Primitives.BorderPrimitive)(this.rbtnExportCSVReport.GetChildAt(0).GetChildAt(2))).InnerColor3 = System.Drawing.Color.FromArgb(((int)(((byte)(27)))), ((int)(((byte)(60)))), ((int)(((byte)(48)))));
((Telerik.WinControls.Primitives.BorderPrimitive)(this.rbtnExportCSVReport.GetChildAt(0).GetChildAt(2))).InnerColor4 = System.Drawing.Color.FromArgb(((int)(((byte)(27)))), ((int)(((byte)(60)))), ((int)(((byte)(48)))));
((Telerik.WinControls.Primitives.BorderPrimitive)(this.rbtnExportCSVReport.GetChildAt(0).GetChildAt(2))).ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(151)))), ((int)(((byte)(186)))));
//
// rtbPartID
//
this.rtbPartID.Anchor = System.Windows.Forms.AnchorStyles.Top;
@@ -1123,11 +1146,12 @@ namespace NSAnalysis
this.rbtSelectFPY.Font = new System.Drawing.Font("Segoe UI", 12F);
this.rbtSelectFPY.ForeColor = System.Drawing.Color.White;
this.rbtSelectFPY.Image = global::NSAnalysis.Properties.Resources.search16;
this.rbtSelectFPY.Location = new System.Drawing.Point(1127, 30);
this.rbtSelectFPY.Location = new System.Drawing.Point(1278, 29);
this.rbtSelectFPY.Name = "rbtSelectFPY";
this.rbtSelectFPY.Size = new System.Drawing.Size(146, 40);
this.rbtSelectFPY.TabIndex = 8;
this.rbtSelectFPY.Text = "查询合格率";
this.rbtSelectFPY.Visible = false;
this.rbtSelectFPY.Click += new System.EventHandler(this.rbtSelectFPY_Click);
this.rbtSelectFPY.MouseLeave += new System.EventHandler(this.btn_MouseLeave);
this.rbtSelectFPY.MouseHover += new System.EventHandler(this.btn_MouseHover);
@@ -1139,29 +1163,6 @@ namespace NSAnalysis
((Telerik.WinControls.Primitives.BorderPrimitive)(this.rbtSelectFPY.GetChildAt(0).GetChildAt(2))).InnerColor4 = System.Drawing.Color.FromArgb(((int)(((byte)(27)))), ((int)(((byte)(60)))), ((int)(((byte)(48)))));
((Telerik.WinControls.Primitives.BorderPrimitive)(this.rbtSelectFPY.GetChildAt(0).GetChildAt(2))).ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(151)))), ((int)(((byte)(186)))));
//
// rbtnExportCSVReport
//
this.rbtnExportCSVReport.Anchor = System.Windows.Forms.AnchorStyles.Top;
this.rbtnExportCSVReport.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(19)))), ((int)(((byte)(46)))), ((int)(((byte)(53)))));
this.rbtnExportCSVReport.Font = new System.Drawing.Font("Segoe UI", 12F);
this.rbtnExportCSVReport.ForeColor = System.Drawing.Color.White;
this.rbtnExportCSVReport.Image = global::NSAnalysis.Properties.Resources.export;
this.rbtnExportCSVReport.Location = new System.Drawing.Point(1293, 30);
this.rbtnExportCSVReport.Name = "rbtnExportCSVReport";
this.rbtnExportCSVReport.Size = new System.Drawing.Size(144, 40);
this.rbtnExportCSVReport.TabIndex = 8;
this.rbtnExportCSVReport.Text = "导出CSV报告";
this.rbtnExportCSVReport.Click += new System.EventHandler(this.rbtnExportCSVReport_Click);
this.rbtnExportCSVReport.MouseLeave += new System.EventHandler(this.btn_MouseLeave);
this.rbtnExportCSVReport.MouseHover += new System.EventHandler(this.btn_MouseHover);
((Telerik.WinControls.UI.RadButtonElement)(this.rbtnExportCSVReport.GetChildAt(0))).Image = global::NSAnalysis.Properties.Resources.export;
((Telerik.WinControls.UI.RadButtonElement)(this.rbtnExportCSVReport.GetChildAt(0))).Text = "导出CSV报告";
((Telerik.WinControls.Primitives.BorderPrimitive)(this.rbtnExportCSVReport.GetChildAt(0).GetChildAt(2))).InnerColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(151)))), ((int)(((byte)(186)))));
((Telerik.WinControls.Primitives.BorderPrimitive)(this.rbtnExportCSVReport.GetChildAt(0).GetChildAt(2))).InnerColor2 = System.Drawing.Color.FromArgb(((int)(((byte)(27)))), ((int)(((byte)(60)))), ((int)(((byte)(48)))));
((Telerik.WinControls.Primitives.BorderPrimitive)(this.rbtnExportCSVReport.GetChildAt(0).GetChildAt(2))).InnerColor3 = System.Drawing.Color.FromArgb(((int)(((byte)(27)))), ((int)(((byte)(60)))), ((int)(((byte)(48)))));
((Telerik.WinControls.Primitives.BorderPrimitive)(this.rbtnExportCSVReport.GetChildAt(0).GetChildAt(2))).InnerColor4 = System.Drawing.Color.FromArgb(((int)(((byte)(27)))), ((int)(((byte)(60)))), ((int)(((byte)(48)))));
((Telerik.WinControls.Primitives.BorderPrimitive)(this.rbtnExportCSVReport.GetChildAt(0).GetChildAt(2))).ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(151)))), ((int)(((byte)(186)))));
//
// rdtpStartTime
//
this.rdtpStartTime.Anchor = System.Windows.Forms.AnchorStyles.Top;
@@ -1247,7 +1248,7 @@ namespace NSAnalysis
this.rdtpEndTime.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(27)))), ((int)(((byte)(60)))), ((int)(((byte)(68)))));
this.rdtpEndTime.Font = new System.Drawing.Font("Segoe UI", 12F);
this.rdtpEndTime.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(19)))), ((int)(((byte)(46)))), ((int)(((byte)(53)))));
this.rdtpEndTime.Location = new System.Drawing.Point(797, 37);
this.rdtpEndTime.Location = new System.Drawing.Point(716, 38);
this.rdtpEndTime.MinDate = new System.DateTime(2023, 6, 1, 0, 0, 0, 0);
this.rdtpEndTime.Name = "rdtpEndTime";
this.rdtpEndTime.Size = new System.Drawing.Size(140, 27);
@@ -1328,7 +1329,7 @@ namespace NSAnalysis
this.rbtnSearchMeaserData.Font = new System.Drawing.Font("Segoe UI", 12F);
this.rbtnSearchMeaserData.ForeColor = System.Drawing.Color.White;
this.rbtnSearchMeaserData.Image = global::NSAnalysis.Properties.Resources.search16;
this.rbtnSearchMeaserData.Location = new System.Drawing.Point(967, 30);
this.rbtnSearchMeaserData.Location = new System.Drawing.Point(967, 29);
this.rbtnSearchMeaserData.Name = "rbtnSearchMeaserData";
this.rbtnSearchMeaserData.Size = new System.Drawing.Size(139, 40);
this.rbtnSearchMeaserData.TabIndex = 7;
@@ -1349,7 +1350,7 @@ namespace NSAnalysis
this.radLabel15.Anchor = System.Windows.Forms.AnchorStyles.Top;
this.radLabel15.Font = new System.Drawing.Font("Segoe UI", 12F);
this.radLabel15.ForeColor = System.Drawing.Color.White;
this.radLabel15.Location = new System.Drawing.Point(701, 38);
this.radLabel15.Location = new System.Drawing.Point(620, 39);
this.radLabel15.Name = "radLabel15";
this.radLabel15.Size = new System.Drawing.Size(94, 25);
this.radLabel15.TabIndex = 36;
@@ -1793,9 +1794,9 @@ namespace NSAnalysis
((System.ComponentModel.ISupportInitialize)(this.radGroupBox1)).EndInit();
this.radGroupBox1.ResumeLayout(false);
this.radGroupBox1.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.rbtnExportCSVReport)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.rtbPartID)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.rbtSelectFPY)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.rbtnExportCSVReport)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.rdtpStartTime)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.rdtpEndTime)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.rbtnSearchMeaserData)).EndInit();
+5
View File
@@ -83,6 +83,11 @@ namespace NSAnalysis
#endregion Log文件
//FileSorter fileSorter = new FileSorter();
//fileSorter.test();
if (gAuthorizationMode == 1)
{
MyBase.TraceWriteLine("Log in using the CLMS authorization.");
+13 -15
View File
@@ -1,15 +1,13 @@
2025-08-19 16:04:27.901----软件Program Main函数开始执行--
2025-08-19 16:04:27.902--加载配置文件——>开始
2025-08-19 16:04:27.905--数据库连接 SqlServerName127.0.0.1
2025-08-19 16:04:27.907--数据库连接 SqlUserNamesa
2025-08-19 16:04:27.907--数据库连接 SqlPasswordHexagon123
2025-08-19 16:04:27.908--数据库连接 SqlDbNameCJLR
2025-08-19 16:04:27.909--加载配置文件——>完成
2025-08-19 16:04:27.910--Log in using the original authorization mode.
2025-08-19 16:04:43.067--软件授权成功
2025-08-19 16:04:44.514--数据库连接 SqlServerName127.0.0.1
2025-08-19 16:04:44.516--数据库连接 SqlUserNamesa
2025-08-19 16:04:44.517--数据库连接 SqlPasswordHexagon123
2025-08-19 16:04:44.519--数据库连接 SqlDbNameCJLR
2025-08-19 16:04:44.520--数据库连接字符串:Data Source=127.0.0.1;initial Catalog=CJLR;User ID=sa;password=Hexagon123;
2025-08-19 16:04:54.108---------------海克斯康面隙分析软件程序关闭---------------------
2025-08-19 16:58:01.238----软件Program Main函数开始执行--
2025-08-19 16:58:01.240--加载配置文件——>开始
2025-08-19 16:58:01.252--数据库连接 SqlServerName127.0.0.1
2025-08-19 16:58:01.253--数据库连接 SqlUserNamesa
2025-08-19 16:58:01.255--数据库连接 SqlPasswordHexagon123
2025-08-19 16:58:01.255--数据库连接 SqlDbNameCJLR
2025-08-19 16:58:01.256--加载配置文件——>完成
2025-08-19 16:58:01.271--数据库连接 SqlServerName127.0.0.1
2025-08-19 16:58:01.272--数据库连接 SqlUserNamesa
2025-08-19 16:58:01.274--数据库连接 SqlPasswordHexagon123
2025-08-19 16:58:01.274--数据库连接 SqlDbNameCJLR
2025-08-19 16:58:01.275--数据库连接字符串:Data Source=127.0.0.1;initial Catalog=CJLR;User ID=sa;password=Hexagon123;
2025-08-19 16:58:02.018--客户报告已生成: D:\QMLTest\K0902906_20250819165802.csv
@@ -1,13 +1,13 @@
MeasPlan.Name,CheryEH3
vehiclecode,1
robot.MessplanID,1
Plant_sector,WH
Plant_sector,CS
Product_type,Carbody
Auto_name,EH3
Part_type,Assembly
Part_number,EH3_5000000FAonline
Part_name,123
prodnum,NNACDEB0RDA50893
prodnum,{prodnum}
Production_line,11_line
Workshop,ER_QI
Operator,
1 MeasPlan.Name CheryEH3
2 vehiclecode 1
3 robot.MessplanID 1
4 Plant_sector WH CS
5 Product_type Carbody
6 Auto_name EH3
7 Part_type Assembly
8 Part_number EH3_5000000FAonline
9 Part_name 123
10 prodnum NNACDEB0RDA50893 {prodnum}
11 Production_line 11_line
12 Workshop ER_QI
13 Operator
Binary file not shown.
Binary file not shown.