#005 增加必要的整理
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using BaseFunction;
|
||||
using NSAnalysis.DAL;
|
||||
using NSAnalysis.Model;
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
@@ -9,7 +10,7 @@ namespace NSAnalysis.BaseUnit
|
||||
{
|
||||
public class FileSorter
|
||||
{
|
||||
public TMeasureMSSQLDAL tmdal = new TMeasureMSSQLDAL();
|
||||
public CjlrDAL _dal = new CjlrDAL();
|
||||
|
||||
//定义读取的位置
|
||||
public int readRowIndex = 2; // 默认读取第3行(从0开始计数)
|
||||
@@ -25,32 +26,61 @@ namespace NSAnalysis.BaseUnit
|
||||
var tasks = GetTaskRecords();
|
||||
foreach (DataRow task in tasks.Rows)
|
||||
{
|
||||
string sourceDir = task["sourceFile"].ToString();
|
||||
string targetDir = task["targetFile"].ToString();
|
||||
string modelName = task["modelsName"].ToString();
|
||||
string modelCode = task["modelsCode"].ToString();
|
||||
string position = task["position"].ToString();
|
||||
string sourceDir = task["sourceFile"].ToString();
|
||||
string targetDir = task["targetFile"].ToString();
|
||||
|
||||
|
||||
string matchStr = $"{modelCode}_{position}";
|
||||
// 打印信息
|
||||
MyBase.TraceWriteLine($"Processing Task - Source: {sourceDir}, Target: {targetDir}, ModelCode: {modelCode} Position: {position} matchStr: {matchStr} ");
|
||||
MyBase.TraceWriteLine($"Processing Task - Source: {sourceDir}, Target: {targetDir}, ModelCode: {modelCode} Position: {position}");
|
||||
if (Directory.Exists(sourceDir))
|
||||
{
|
||||
|
||||
|
||||
ProcessDirectory(sourceDir, targetDir, matchStr);
|
||||
ProcessDirectory(sourceDir, targetDir, modelCode, modelName,position);
|
||||
}
|
||||
else
|
||||
{
|
||||
MyBase.TraceWriteLine($"Source directory does not exist: {sourceDir}");
|
||||
}
|
||||
MyBase.TraceWriteLine($"源文件地址不存在或错误: {sourceDir}");
|
||||
|
||||
|
||||
//记录到数据库
|
||||
try
|
||||
{
|
||||
//插入分发详情
|
||||
CjlrTaskReleaseDetailModel detailModel = new CjlrTaskReleaseDetailModel
|
||||
{
|
||||
ModelsName = modelName, // 这里可以根据需要填写车型名称
|
||||
ModelsCode = modelCode,
|
||||
Position = position, // 这里可以根据需要填写位置
|
||||
SourceFile = "",
|
||||
TargetFile = "",
|
||||
TaskFileName = "",
|
||||
TaskStatus = 2, // 假设1表示已处理, 2表示未处理
|
||||
TaskDetail = $"源文件地址不存在或错误: {sourceDir}",
|
||||
CreateDate = DateTime.Now
|
||||
};
|
||||
_dal.InsertTaskDetail(detailModel);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MyBase.TraceWriteLine($"记录错误到数据库失败: {ex.Message}");
|
||||
}
|
||||
finally
|
||||
{
|
||||
MyBase.TraceWriteLine($"源文件地址不存在或错误: {sourceDir}");
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private DataTable GetTaskRecords()
|
||||
{
|
||||
SQLHelper.connStr = DatabaseDfn.SqlConnectStr();
|
||||
DataTable dt = tmdal.SelectTaskByCondition("", "", "start");
|
||||
DataTable dt = _dal.SelectTaskByCondition("", "", "start");
|
||||
|
||||
//打印 dt
|
||||
PrintDataTable(dt);
|
||||
@@ -62,8 +92,15 @@ namespace NSAnalysis.BaseUnit
|
||||
return dt;
|
||||
}
|
||||
|
||||
private void ProcessDirectory(string sourceDir, string targetDir, string modelCode)
|
||||
private void ProcessDirectory(string sourceDir, string targetDir, string modelCode, string modelName, string position )
|
||||
{
|
||||
// 匹配信息
|
||||
string matchStr = $"{modelCode}_{position}";
|
||||
MyBase.TraceWriteLine($"Matching files with: {matchStr}");
|
||||
|
||||
|
||||
// 判断目标目录是否存在,如果不存在记录到日志
|
||||
|
||||
// 确保目标目录存在
|
||||
if (!Directory.Exists(targetDir))
|
||||
{
|
||||
@@ -71,20 +108,57 @@ namespace NSAnalysis.BaseUnit
|
||||
MyBase.TraceWriteLine($"Created target directory: {targetDir}");
|
||||
}
|
||||
|
||||
// 遍历源目录中的所有CSV文件
|
||||
foreach (string file in Directory.GetFiles(sourceDir, "*.csv"))
|
||||
{
|
||||
// 打印正在处理的文件
|
||||
MyBase.TraceWriteLine($"Processing file: {file}");
|
||||
if (MatchCsvValue(file, modelCode, readRowIndex, readColIndex))
|
||||
if (MatchCsvValue(file, matchStr, readRowIndex, readColIndex))
|
||||
{
|
||||
string destFile = Path.Combine(targetDir, Path.GetFileName(file));
|
||||
File.Move(file, destFile);
|
||||
MyBase.TraceWriteLine($"Moved: {file} -> {destFile}");
|
||||
}
|
||||
|
||||
//插入分发详情
|
||||
CjlrTaskReleaseDetailModel detailModel = new CjlrTaskReleaseDetailModel
|
||||
{
|
||||
ModelsName = modelName, // 这里可以根据需要填写车型名称
|
||||
ModelsCode = modelCode,
|
||||
Position = position, // 这里可以根据需要填写位置
|
||||
SourceFile = file,
|
||||
TargetFile = destFile,
|
||||
TaskFileName = Path.GetFileName(file),
|
||||
TaskStatus = 1, // 假设1表示已处理
|
||||
TaskDetail = "文件移动成功",
|
||||
CreateDate = DateTime.Now
|
||||
};
|
||||
_dal.InsertTaskDetail(detailModel);
|
||||
}
|
||||
else
|
||||
{
|
||||
MyBase.TraceWriteLine($"No match for file: {file}");
|
||||
|
||||
//记录到数据库
|
||||
CjlrTaskReleaseDetailModel detailModel = new CjlrTaskReleaseDetailModel
|
||||
{
|
||||
ModelsName = modelName, // 这里可以根据需要填写车型名称
|
||||
ModelsCode = modelCode,
|
||||
Position = position, // 这里可以根据需要填写位置
|
||||
SourceFile = file,
|
||||
TargetFile = "",
|
||||
TaskFileName = Path.GetFileName(file),
|
||||
TaskStatus = 2, // 假设2表示未处理
|
||||
TaskDetail = "文件未匹配",
|
||||
CreateDate = DateTime.Now
|
||||
};
|
||||
try
|
||||
{
|
||||
_dal.InsertTaskDetail(detailModel);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MyBase.TraceWriteLine($"记录错误到数据库失败: {ex.Message}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -124,10 +198,13 @@ namespace NSAnalysis.BaseUnit
|
||||
|
||||
public void test()
|
||||
{
|
||||
//SQLHelper.connStr = DatabaseDfn.SqlConnectStr();
|
||||
SQLHelper.connStr = DatabaseDfn.SqlConnectStr();
|
||||
//string testPath = @"D:\CJLR\DATA\Input\LLL\K0902906.csv";
|
||||
//bool result = MatchCsvValue(testPath, "X540_L", 3, 1);
|
||||
//MyBase.TraceWriteLine($"匹配结果: {result}");
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
// 编写一个打印 DataTable 对象的方法,输入是对象
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace NSAnalysis
|
||||
{
|
||||
#region 全局变量
|
||||
|
||||
private TMeasureMSSQLDAL tmdal = new TMeasureMSSQLDAL();
|
||||
private CjlrDAL tmdal = new CjlrDAL();
|
||||
private FToleranceSetup gFTS;
|
||||
|
||||
#endregion 全局变量
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace NSAnalysis
|
||||
{
|
||||
#region 全局变量
|
||||
|
||||
private TMeasureMSSQLDAL tmdal = new TMeasureMSSQLDAL();
|
||||
private CjlrDAL tmdal = new CjlrDAL();
|
||||
|
||||
private FToleranceSetup gFTS;
|
||||
|
||||
@@ -187,13 +187,11 @@ namespace NSAnalysis
|
||||
{
|
||||
rtb_sourceFilePath.Text = folderBrowserDialog.SelectedPath; // 设置源文件路径
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
// 显示未选择文件夹的提示信息
|
||||
MessageBox.Show("未选择源文件夹", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void btn_targetFile_Click(object sender, EventArgs e)
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace NSAnalysis
|
||||
{
|
||||
public partial class FToleranceSetup : Telerik.WinControls.UI.ShapedForm
|
||||
{
|
||||
private TMeasureMSSQLDAL tmdal = new TMeasureMSSQLDAL();
|
||||
private CjlrDAL tmdal = new CjlrDAL();
|
||||
public int idgvSelectRowNumber = 0;
|
||||
|
||||
#region 鼠标事件
|
||||
|
||||
@@ -4,10 +4,11 @@ using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace NSAnalysis.DAL
|
||||
{
|
||||
public class TMeasureMSSQLDAL
|
||||
public class CjlrDAL
|
||||
{
|
||||
#region Select Function
|
||||
|
||||
@@ -18,8 +19,6 @@ namespace NSAnalysis.DAL
|
||||
return int.Parse(dt.Rows[0][0].ToString());
|
||||
}
|
||||
|
||||
|
||||
|
||||
public DataTable SelectNewestTMeasureResult()
|
||||
{
|
||||
string strSql = "select top(1) Id,CarID,MeasureDate,Remark from TMeasureResult order by MeasureDate DESC";
|
||||
@@ -164,14 +163,7 @@ namespace NSAnalysis.DAL
|
||||
return dt;
|
||||
}
|
||||
|
||||
public DataTable SelectOneToleranceByCondition(string strCartType, string strMeaPointName, string strDimensionName)
|
||||
{
|
||||
DataTable dt = new DataTable();
|
||||
string strSql = "select TolLower,TolUpper from TTolerance where CarType = '" + strCartType + "' and MeasurePointName = '" + strMeaPointName + "' and DimensionName = '" + strDimensionName + "'";
|
||||
dt = SQLHelper.ExecuteQuery(strSql, CommandType.Text);
|
||||
return dt;
|
||||
}
|
||||
|
||||
|
||||
public bool CheckTaskExit(string strModelsName, string strModelsCode, string strReadType)
|
||||
{
|
||||
DataTable dt = new DataTable();
|
||||
@@ -189,17 +181,11 @@ namespace NSAnalysis.DAL
|
||||
return dt.Rows.Count > 0; // 任务存在返回 true,否则返回 false
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region Insert Function
|
||||
|
||||
// 插入分发配置
|
||||
|
||||
public int InsertTask(CjlrTaskReleaseModel model)
|
||||
{
|
||||
const string strSql = @"INSERT INTO CJLR.dbo.CJLR_TASK_RELEASE
|
||||
@@ -219,7 +205,7 @@ namespace NSAnalysis.DAL
|
||||
new SqlParameter("@targetFile", model.TargetFile ?? (object)DBNull.Value),
|
||||
new SqlParameter("@status", model.Status ?? (object)DBNull.Value),
|
||||
new SqlParameter("@create_date", model.CreateDate == default ?
|
||||
DateTime.Now : model.CreateDate),
|
||||
DateTime.Parse("2024-01-31 14:37:00"): model.CreateDate),
|
||||
new SqlParameter("@is_delete", model.IsDelete),
|
||||
new SqlParameter("@readType", model.ReadType)
|
||||
};
|
||||
@@ -229,48 +215,51 @@ namespace NSAnalysis.DAL
|
||||
}
|
||||
|
||||
// 插入分发详细记录
|
||||
public int InsertModel(CjlrTaskReleaseModel model)
|
||||
public int InsertTaskDetail(CjlrTaskReleaseDetailModel model)
|
||||
{
|
||||
string strSql = "INSERT INTO CJLR_TASK_RELEASE_DETAIL " +
|
||||
"(modelsName, modelsCode, position, sourceFile, targetFile, status, createDate, isDelete, readType) " +
|
||||
"VALUES (@modelsName, @modelsCode, @position, @sourceFile, @targetFile, @status, @createDate, @isDelete, @readType)";
|
||||
const string strSql = @"
|
||||
INSERT INTO CJLR.dbo.CJLR_TASK_RELEASE_DETAIL
|
||||
(modelsName, modelsCode, position, sourceFile, targetFile,
|
||||
taskFileName, taskStatus, taskDetail, createDate)
|
||||
VALUES (@modelsName, @modelsCode, @position, @sourceFile, @targetFile,
|
||||
@taskFileName, @taskStatus, @taskDetail, @createDate)";
|
||||
|
||||
SqlParameter[] paras = new SqlParameter[]
|
||||
{
|
||||
new SqlParameter("@modelsName", model.ModelsName ?? (object)DBNull.Value),
|
||||
new SqlParameter("@modelsCode", model.ModelsCode ?? (object)DBNull.Value),
|
||||
new SqlParameter("@position", model.Position ?? (object)DBNull.Value),
|
||||
new SqlParameter("@sourceFile", model.SourceFile ?? (object)DBNull.Value),
|
||||
new SqlParameter("@targetFile", model.TargetFile ?? (object)DBNull.Value),
|
||||
new SqlParameter("@status", model.Status ?? (object)DBNull.Value),
|
||||
new SqlParameter("@createDate", model.CreateDate == default ?
|
||||
DateTime.Parse("2024-01-31 14:37:00") : model.CreateDate),
|
||||
new SqlParameter("@isDelete", model.IsDelete),
|
||||
new SqlParameter("@readType", model.ReadType)
|
||||
};
|
||||
SqlParameter[] parameters = new SqlParameter[]
|
||||
{
|
||||
new SqlParameter("@modelsName", model.ModelsName ?? (object)DBNull.Value),
|
||||
new SqlParameter("@modelsCode", model.ModelsCode ?? (object)DBNull.Value),
|
||||
new SqlParameter("@position", model.Position ?? (object)DBNull.Value),
|
||||
new SqlParameter("@sourceFile", model.SourceFile ?? (object)DBNull.Value),
|
||||
new SqlParameter("@targetFile", model.TargetFile ?? (object)DBNull.Value),
|
||||
new SqlParameter("@taskFileName", model.TaskFileName ?? (object)DBNull.Value),
|
||||
new SqlParameter("@taskStatus", model.TaskStatus),
|
||||
new SqlParameter("@taskDetail", model.TaskDetail ?? (object)DBNull.Value),
|
||||
new SqlParameter("@createDate", model.CreateDate == default ? DateTime.Now : model.CreateDate)
|
||||
};
|
||||
|
||||
return SQLHelper.ExecuteNonQuery(strSql, paras, CommandType.Text);
|
||||
object result = SQLHelper.ExecuteNonQuery(strSql, parameters, CommandType.Text);
|
||||
return Convert.ToInt32(result);
|
||||
}
|
||||
|
||||
//public int InsertTMeasureResult(TMeasureResultModel tmrm)
|
||||
//{
|
||||
// string strSql = "insert into TMeasureResult (CarID,CarType,SumMeasureItems,GoodMeasureItems,NoGoodMeasureItems,RejectMeasureItems,FPY,MeasureDate,Result,Remark) values " +
|
||||
// "(@CarID,@CarType,@SumMeasureItems,@GoodMeasureItems,@NoGoodMeasureItems,@RejectMeasureItems,@FPY,@MeasureDate,@Result,@Remark)";
|
||||
// SqlParameter[] paras = new SqlParameter[]
|
||||
// {
|
||||
// new SqlParameter("@CarID",tmrm.CarID),
|
||||
// new SqlParameter("@CarType",tmrm.CarType),
|
||||
// new SqlParameter("@SumMeasureItems",tmrm.SumMeasureItems),
|
||||
// new SqlParameter("@GoodMeasureItems",tmrm.GoodMeasureItems),
|
||||
// new SqlParameter("@NoGoodMeasureItems",tmrm.NoGoodMeasureItems),
|
||||
// new SqlParameter("@RejectMeasureItems",tmrm.RejectMeasureItems),
|
||||
// new SqlParameter("@FPY",tmrm.FPY),
|
||||
// new SqlParameter("@MeasureDate",tmrm.MeasureDate),
|
||||
// new SqlParameter("@Result",tmrm.Result),
|
||||
// new SqlParameter("@Remark",tmrm.Remark),
|
||||
// };
|
||||
// return SQLHelper.ExecuteNonQuery(strSql, paras, CommandType.Text);
|
||||
//}
|
||||
public int InsertTMeasureResult(TMeasureResultModel tmrm)
|
||||
{
|
||||
string strSql = "insert into TMeasureResult (CarID,CarType,SumMeasureItems,GoodMeasureItems,NoGoodMeasureItems,RejectMeasureItems,FPY,MeasureDate,Result,Remark) values " +
|
||||
"(@CarID,@CarType,@SumMeasureItems,@GoodMeasureItems,@NoGoodMeasureItems,@RejectMeasureItems,@FPY,@MeasureDate,@Result,@Remark)";
|
||||
SqlParameter[] paras = new SqlParameter[]
|
||||
{
|
||||
new SqlParameter("@CarID",tmrm.CarID),
|
||||
new SqlParameter("@CarType",tmrm.CarType),
|
||||
new SqlParameter("@SumMeasureItems",tmrm.SumMeasureItems),
|
||||
new SqlParameter("@GoodMeasureItems",tmrm.GoodMeasureItems),
|
||||
new SqlParameter("@NoGoodMeasureItems",tmrm.NoGoodMeasureItems),
|
||||
new SqlParameter("@RejectMeasureItems",tmrm.RejectMeasureItems),
|
||||
new SqlParameter("@FPY",tmrm.FPY),
|
||||
new SqlParameter("@MeasureDate",tmrm.MeasureDate),
|
||||
new SqlParameter("@Result",tmrm.Result),
|
||||
new SqlParameter("@Remark",tmrm.Remark),
|
||||
};
|
||||
return SQLHelper.ExecuteNonQuery(strSql, paras, CommandType.Text);
|
||||
}
|
||||
|
||||
public int InsertTMeasureDatabyDataTable(DataTable dt)
|
||||
{
|
||||
@@ -338,15 +327,15 @@ namespace NSAnalysis.DAL
|
||||
#region Delete Function
|
||||
|
||||
// 删除指定车型的分发配置
|
||||
public int DeleteOneTolerance(string modelsCode)
|
||||
public int DeleteOneTolerance(string modelsName)
|
||||
{
|
||||
// 使用参数化查询以防止 SQL 注入
|
||||
string strOle = "DELETE FROM CJLR_TASK_RELEASE WHERE modelsCode = @modelsCode";
|
||||
string strOle = "DELETE FROM CJLR_TASK_RELEASE WHERE modelsName = @modelsName";
|
||||
|
||||
// 创建一个 SqlParameter 来替代直接拼接字符串
|
||||
SqlParameter[] parameters = new SqlParameter[]
|
||||
{
|
||||
new SqlParameter("@modelsCode", modelsCode),
|
||||
new SqlParameter("@modelsName", modelsName),
|
||||
};
|
||||
|
||||
// 执行非查询操作
|
||||
+1
-1
@@ -20,7 +20,7 @@ createDate Date //<<类名:datetime>>
|
||||
|
||||
using System;
|
||||
|
||||
namespace NSAnalysis
|
||||
namespace NSAnalysis.Model
|
||||
{
|
||||
public class CjlrTaskReleaseDetailModel
|
||||
{
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace DAL
|
||||
namespace NSAnalysis.Model
|
||||
{
|
||||
public class TMeasureDataModel
|
||||
{
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace DAL
|
||||
namespace NSAnalysis.Model
|
||||
{
|
||||
public class TMeasureResultModel
|
||||
{
|
||||
@@ -155,12 +155,6 @@ namespace NSAnalysis
|
||||
{
|
||||
try
|
||||
{
|
||||
#region 检查DLL是否存在
|
||||
|
||||
|
||||
|
||||
#endregion 检查DLL是否存在
|
||||
|
||||
MyBase.TraceWriteLine("加载配置文件——>开始");
|
||||
if (File.Exists(strConfigFile))
|
||||
{
|
||||
@@ -198,8 +192,6 @@ namespace NSAnalysis
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public class DatabaseDfn
|
||||
{
|
||||
public static string SqlServerName = "";
|
||||
|
||||
+1
-73
@@ -674,79 +674,7 @@ namespace NSAnalysis
|
||||
// MyBase.TraceWriteLine("EH3数据生成报告功能未启用!");
|
||||
//}
|
||||
|
||||
//#region Update Data To IOT
|
||||
|
||||
//if (ConfigDfn.iStartIOTFlag == 1)
|
||||
//{
|
||||
// bool bVINMeasuedFlag = tmdal.CheckVINExistInDB(strCarID);
|
||||
// if (bVINMeasuedFlag)
|
||||
// {
|
||||
// MyBase.TraceWriteLine("VIN:" + strCarID + " 该VIN码已经在数据库中存在了,说明已经测量过了,不再进行IOT数据上传操作。");
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// #region IOT上传功能
|
||||
// if (dtAllRangeDate.Rows.Count > 0)
|
||||
// {
|
||||
// foreach (DataRow row in dtAllRangeDate.Rows)
|
||||
// {
|
||||
// CheryIOTData cIOTData = new CheryIOTData();
|
||||
// cIOTData.vin = strCarID;
|
||||
// cIOTData.gfNo = "G";
|
||||
// cIOTData.pointNumber = row.ItemArray[2].ToString();
|
||||
// cIOTData.actualValue = row.ItemArray[3].ToString();
|
||||
// cIOTData.controlLine = row.ItemArray[4].ToString();
|
||||
// cIOTData.measurementResult = row.ItemArray[5].ToString();
|
||||
// if (cIOTData.measurementResult.ToUpper().Contains("NG"))
|
||||
// {
|
||||
// if (!cIOTData.actualValue.ToLower().Contains("inv"))
|
||||
// {
|
||||
// dLowerValue = double.Parse(row.ItemArray[4].ToString().Substring(0, 3));
|
||||
// dUpperValue = double.Parse(row.ItemArray[4].ToString().Substring(4, 3));
|
||||
// dStrictTLower = CalculateStrictLowerTolerance(dLowerValue, dUpperValue);
|
||||
// dStrictTUpper = CalculateStrictUpperTolerance(dLowerValue, dUpperValue);
|
||||
// double dValue = double.Parse(row.ItemArray[3].ToString());
|
||||
// if (dValue > dStrictTLower && dValue < dStrictTUpper)
|
||||
// {
|
||||
// cIOTData.measurementResult = "OK";
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// ListPostIOTData.Add(cIOTData);
|
||||
// }
|
||||
// }
|
||||
// string strGapList = JsonHelper.ObjectToJson(ListPostIOTData);
|
||||
// string strCaliResult = "OK";
|
||||
// if (labResult.Text == "合格")
|
||||
// {
|
||||
// strCaliResult = "OK";
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// strCaliResult = "NG";
|
||||
// }
|
||||
// string strPostData = "{\"serno\":\"" + DateTime.Now.ToString("yyyyMMddHHmmssfff") + "\",\"requestData\":[{\"vin\":\"" + strCarID + "\",\"model\":\"EH3\",\"equipmentNo\":\"" + ConfigDfn.strEquipNo + "\",\"equipmentName\":\"" + ConfigDfn.strEquipName + "\",\"calibrationResult\":\"" + strCaliResult + "\",\"detectionTime\":\"" + ConfigDfn.strMeasureTime + "\",\"targetRate\":\"" + strTargetRate + "\",\"rate\":\"" + labResultPercent.Text + "\",\"GapList\":" + strGapList + "}]}";
|
||||
// MyBase.TraceWriteLine("Update To IOT Data Content: " + strPostData);
|
||||
// string strPostResult = PostJsonToIOT(ConfigDfn.strIOTAddress, strPostData, 10000);
|
||||
// MyBase.TraceWriteLine("EH3数据上传IOT完成,结果返回为:" + strPostResult);
|
||||
// if (strPostResult.Contains("成功"))
|
||||
// {
|
||||
// MyBase.TraceWriteLine("EH3数据上传IOT成功 ^_^");
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// MyBase.TraceWriteLine("EH3数据上传IOT失败!");
|
||||
// }
|
||||
|
||||
// #endregion IOT上传功能
|
||||
// }
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// MyBase.TraceWriteLine("数据上传IOT功能未启用!");
|
||||
//}
|
||||
|
||||
//#endregion Update Data To IOT
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,69 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DAL
|
||||
{
|
||||
public class TMeasureDataModel
|
||||
{
|
||||
/// <summary>
|
||||
/// Id
|
||||
/// </summary>
|
||||
public int? Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 车身ID
|
||||
/// </summary>
|
||||
public string CarID { get; set; }
|
||||
/// <summary>
|
||||
/// 车身类型
|
||||
/// </summary>
|
||||
public string CarType{ get; set; }
|
||||
/// <summary>
|
||||
/// 测量点名称
|
||||
/// </summary>
|
||||
public string MeasPointName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 测点尺寸名称:F面差 G间隙
|
||||
/// </summary>
|
||||
public string DimensionName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 测量值
|
||||
/// </summary>
|
||||
public string MeasureValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 测量结果 :Good NoGood Rejected
|
||||
/// </summary>
|
||||
public string MeasureItemResult { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 标准值
|
||||
/// </summary>
|
||||
public string NormalValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 测量时间
|
||||
/// </summary>
|
||||
public string MeasureDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 下公差
|
||||
/// </summary>
|
||||
public string LowerTolVal { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 上公差
|
||||
/// </summary>
|
||||
public string UpperTolVal { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
public string Remark { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,64 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DAL
|
||||
{
|
||||
public class TMeasureResultModel
|
||||
{
|
||||
/// <summary>
|
||||
/// Id
|
||||
/// </summary>
|
||||
public int? Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 车身ID
|
||||
/// </summary>
|
||||
public string CarID { get; set; }
|
||||
/// <summary>
|
||||
/// 车身类型
|
||||
/// </summary>
|
||||
public string CarType { get; set; }
|
||||
/// <summary>
|
||||
/// SumMeasureItems 总测量项数量
|
||||
/// </summary>
|
||||
public int? SumMeasureItems { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// GoodMeasureItems
|
||||
/// </summary>
|
||||
public int? GoodMeasureItems { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// NoGoodMeasureItems
|
||||
/// </summary>
|
||||
public int? NoGoodMeasureItems { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// RejectMeasureItems
|
||||
/// </summary>
|
||||
public int? RejectMeasureItems { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// FPY 合格率
|
||||
/// </summary>
|
||||
public string FPY { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// MeasureDate 测量时间
|
||||
/// </summary>
|
||||
public string MeasureDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Result:测量总结果:1:OK 2:NG
|
||||
/// </summary>
|
||||
public int? Result { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Remark 备注
|
||||
/// </summary>
|
||||
public string Remark { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DAL
|
||||
{
|
||||
public class TToleranceModel
|
||||
{
|
||||
/// <summary>
|
||||
/// Id
|
||||
/// </summary>
|
||||
public int? Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 车身类型
|
||||
/// </summary>
|
||||
public string CarType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// MeasurePointName
|
||||
/// </summary>
|
||||
public string MeasurePointName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// DimensionName
|
||||
/// </summary>
|
||||
public string DimensionName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// TolLower
|
||||
/// </summary>
|
||||
public double TolLower { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// TolUpper
|
||||
/// </summary>
|
||||
public double TolUpper { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Remark 备注
|
||||
/// </summary>
|
||||
public string Remark { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// CreateTime 测量时间
|
||||
/// </summary>
|
||||
public string CreateTime { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -125,7 +125,7 @@
|
||||
<Compile Include="BaseUnit\FileSorter.cs" />
|
||||
<Compile Include="BaseUnit\NetworkCopy.cs" />
|
||||
<Compile Include="BaseUnit\RichTextUnit.cs" />
|
||||
<Compile Include="Model\CjlrTaskReleaseDetailModel.cs" />
|
||||
<Compile Include="DAL\Model\CjlrTaskReleaseDetailModel.cs" />
|
||||
<Compile Include="Define\Define.cs" />
|
||||
<Compile Include="FormMain.cs">
|
||||
<SubType>Form</SubType>
|
||||
@@ -133,7 +133,7 @@
|
||||
<Compile Include="FormMain.designer.cs">
|
||||
<DependentUpon>FormMain.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Model\CjlrTaskReleaseModel.cs" />
|
||||
<Compile Include="DAL\Model\CjlrTaskReleaseModel.cs" />
|
||||
<Compile Include="CjlrForm\LabPictureControl.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
@@ -141,9 +141,9 @@
|
||||
<DependentUpon>LabPictureControl.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="DAL\SQLHelper.cs" />
|
||||
<Compile Include="Model\TMeasureDataModel.cs" />
|
||||
<Compile Include="DAL\TMeasureMSSQLDAL.cs" />
|
||||
<Compile Include="Model\TMeasureResultModel.cs" />
|
||||
<Compile Include="DAL\Model\TMeasureDataModel.cs" />
|
||||
<Compile Include="DAL\CjlrDAL.cs" />
|
||||
<Compile Include="DAL\Model\TMeasureResultModel.cs" />
|
||||
<Compile Include="CjlrForm\FAddTolerance.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
|
||||
+3
-3
@@ -83,9 +83,9 @@ namespace NSAnalysis
|
||||
|
||||
#endregion 创建Log文件
|
||||
|
||||
Application.Run(new FormMain());
|
||||
//FileSorter fileSorter = new FileSorter();
|
||||
//fileSorter.ProcessFiles();
|
||||
//Application.Run(new FormMain());
|
||||
FileSorter fileSorter = new FileSorter();
|
||||
fileSorter.test();
|
||||
|
||||
//if (gAuthorizationMode == 1)
|
||||
// {
|
||||
|
||||
@@ -1,15 +1,12 @@
|
||||
2025-08-06 15:35:41.846----软件Program Main函数开始执行--
|
||||
2025-08-06 15:35:41.848--加载配置文件——>开始
|
||||
2025-08-06 15:35:41.870--数据库连接 SqlServerName:127.0.0.1
|
||||
2025-08-06 15:35:41.871--数据库连接 SqlUserName:sa
|
||||
2025-08-06 15:35:41.871--数据库连接 SqlPassword:Hexagon123
|
||||
2025-08-06 15:35:41.872--数据库连接 SqlDbName:CJLR
|
||||
2025-08-06 15:35:41.873--加载配置文件——>完成
|
||||
2025-08-06 15:35:43.537--数据库连接 SqlServerName:127.0.0.1
|
||||
2025-08-06 15:35:43.537--数据库连接 SqlUserName:sa
|
||||
2025-08-06 15:35:43.539--数据库连接 SqlPassword:Hexagon123
|
||||
2025-08-06 15:35:43.540--数据库连接 SqlDbName:CJLR
|
||||
2025-08-06 15:35:43.541--数据库连接字符串:Data Source=127.0.0.1;initial Catalog=CJLR;User ID=sa;password=Hexagon123;
|
||||
2025-08-06 15:35:43.809-- 进入解析CSV文件模式,开始解析扫码CSV文件!
|
||||
2025-08-06 15:35:43.810--软件首次启动, Nextsense EH3 CSV读取路径存在;不清空,读取NextSense生成 CSV报告路径下的所有文件,路径为:D:\cherytestEH3
|
||||
2025-08-06 15:35:43.811--软件首次启动, Nextsense EHY CSV读取路径存在;不清空,读取NextSense生成 CSV报告路径下的所有文件,路径为:D:\cherytestEHY
|
||||
2025-08-06 16:38:19.884----软件Program Main函数开始执行--
|
||||
2025-08-06 16:38:19.885--加载配置文件——>开始
|
||||
2025-08-06 16:38:19.903--数据库连接 SqlServerName:127.0.0.1
|
||||
2025-08-06 16:38:19.905--数据库连接 SqlUserName:sa
|
||||
2025-08-06 16:38:19.906--数据库连接 SqlPassword:Hexagon123
|
||||
2025-08-06 16:38:19.907--数据库连接 SqlDbName:CJLR
|
||||
2025-08-06 16:38:19.908--加载配置文件——>完成
|
||||
2025-08-06 16:38:19.921--数据库连接 SqlServerName:127.0.0.1
|
||||
2025-08-06 16:38:19.922--数据库连接 SqlUserName:sa
|
||||
2025-08-06 16:38:19.923--数据库连接 SqlPassword:Hexagon123
|
||||
2025-08-06 16:38:19.923--数据库连接 SqlDbName:CJLR
|
||||
2025-08-06 16:38:19.924--数据库连接字符串:Data Source=127.0.0.1;initial Catalog=CJLR;User ID=sa;password=Hexagon123;
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user