|
|
@@ -64,7 +64,7 @@ namespace UAS_MES_NEW.Make
|
|
|
if (SNArr.IndexOf(sn) > 0) continue;
|
|
|
|
|
|
SQL.Clear();
|
|
|
- SQL.Append($@"SELECT ms_sncode,ma_code,pr_code,pr_spec FROM makeserial,make,product WHERE ms_sncode = '{sn.Replace(";", ";")}' AND ms_makecode = ma_code AND ms_prodcode = pr_code");
|
|
|
+ SQL.Append($@"SELECT ms_sncode,ma_code,pr_code,pr_spec FROM makeserial,make,product WHERE ms_sncode = '{sn.Replace(";", ";")}' AND ms_makecode = ma_code AND ms_prodcode = pr_code order by MS_ID desc");
|
|
|
dt = (DataTable)dh.ExecuteSql(SQL.ToString(), "select");
|
|
|
if (dt.Rows.Count == 0)
|
|
|
{
|
|
|
@@ -78,7 +78,18 @@ namespace UAS_MES_NEW.Make
|
|
|
downRes = ParseIperfBitrate(downLog);
|
|
|
string tDetail = $"upRate/{upRes};downRate/{downRes}";
|
|
|
|
|
|
- CheckPassStation(wo, sn, "PASS", tDetail);
|
|
|
+ if(Path.GetFileName(currLog).Split('_').Length > 2)
|
|
|
+ {
|
|
|
+ string type = Path.GetFileName(currLog).Split('_')[2];
|
|
|
+ string resType = type.Contains("50") ? "5G" : "2.4G";
|
|
|
+
|
|
|
+ CheckPassStation(wo, sn, "PASS", upRes, downRes, resType);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+
|
|
|
+ CheckPassStation(wo, sn, "PASS", upRes, downRes, "2.4G");
|
|
|
+ }
|
|
|
|
|
|
using (StreamReader SR = new StreamReader(currLog, Encoding.GetEncoding("GBK")))
|
|
|
{
|
|
|
@@ -97,16 +108,16 @@ namespace UAS_MES_NEW.Make
|
|
|
string Content = SR.ReadToEnd();
|
|
|
SR.Close();
|
|
|
SR.Dispose();
|
|
|
- if (ConsoleLog(Content, currLog, $"{Path.GetFileName(currLog).Replace("up", "down")}"))
|
|
|
+ if (ConsoleLog(Content, downLog, $"{Path.GetFileName(downLog)}"))
|
|
|
{
|
|
|
- File.WriteAllText(currLog, string.Empty);
|
|
|
- File.Delete(currLog);
|
|
|
+ File.WriteAllText(downLog, string.Empty);
|
|
|
+ File.Delete(downLog);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- string[] failFiles = Directory.GetFiles(failPath, $"*.log");
|
|
|
+ /*string[] failFiles = Directory.GetFiles(failPath, $"*.log");
|
|
|
foreach (string currLog in failFiles)
|
|
|
{
|
|
|
if (Path.GetFileName(currLog).Contains("up"))
|
|
|
@@ -118,7 +129,7 @@ namespace UAS_MES_NEW.Make
|
|
|
if (SNArr.IndexOf(sn) > 0) continue;
|
|
|
|
|
|
SQL.Clear();
|
|
|
- SQL.Append($@"SELECT ms_sncode,ma_code,pr_code,pr_spec FROM makeserial,make,product WHERE ms_sncode = '{sn.Replace(";", ";")}' AND ms_makecode = ma_code AND ms_prodcode = pr_code");
|
|
|
+ SQL.Append($@"SELECT ms_sncode,ma_code,pr_code,pr_spec FROM makeserial,make,product WHERE ms_sncode = '{sn.Replace(";", ";")}' AND ms_makecode = ma_code AND ms_prodcode = pr_code order by MS_ID desc");
|
|
|
dt = (DataTable)dh.ExecuteSql(SQL.ToString(), "select");
|
|
|
if (dt.Rows.Count == 0)
|
|
|
{
|
|
|
@@ -151,34 +162,34 @@ namespace UAS_MES_NEW.Make
|
|
|
string Content = SR.ReadToEnd();
|
|
|
SR.Close();
|
|
|
SR.Dispose();
|
|
|
- if (ConsoleLog(Content, currLog, $"{Path.GetFileName(currLog).Replace("up", "down")}"))
|
|
|
+ if (ConsoleLog(Content, downLog, $"{Path.GetFileName(downLog)}"))
|
|
|
{
|
|
|
- File.WriteAllText(currLog, string.Empty);
|
|
|
- File.Delete(currLog);
|
|
|
+ File.WriteAllText(downLog, string.Empty);
|
|
|
+ File.Delete(downLog);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
+ }*/
|
|
|
}
|
|
|
- private void CheckPassStation(string wo,string sn, string testRes, string testDetail)
|
|
|
+ private void CheckPassStation(string wo,string sn, string testRes, string upRes, string downRes, string resType)
|
|
|
{
|
|
|
sn = sn.Replace(";", ";");
|
|
|
List<string> param = new List<string>() { };
|
|
|
string outMsg = "";
|
|
|
param.Add(wo);
|
|
|
param.Add(sn);
|
|
|
- param.Add(User.UserSourceCode);
|
|
|
+ param.Add(User.CurrentStepCode);
|
|
|
param.Add(testRes);
|
|
|
param.Add("");
|
|
|
param.Add("");
|
|
|
param.Add("ThruputLog");
|
|
|
- param.Add(testDetail);
|
|
|
+ param.Add($"upRate/{upRes};downRate/{downRes}");
|
|
|
param.Add(outMsg);
|
|
|
string[] paramList = param.ToArray();
|
|
|
dh.CallProcedure("cs_insert_testrejects", ref paramList);
|
|
|
if (paramList[8].Substring(0, 2) == "OK")
|
|
|
{
|
|
|
- ShowMsg(1, $"序列号{sn}采集成功:测试结果为{testRes},{testDetail}");
|
|
|
+ ShowMsg(1, $"序列号{sn}采集成功:测试结果为{testRes},{$"upRate/{upRes};downRate/{downRes}"}");
|
|
|
LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, workOrder.Text, User.UserLineCode, User.UserSourceCode, "无线吞吐量", "无线吞吐量过站成功", sn, "");
|
|
|
}
|
|
|
|
|
|
@@ -189,6 +200,41 @@ namespace UAS_MES_NEW.Make
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
+ dt = (DataTable)dh.ExecuteSql($"select sm_id from steptestmain where INSTR(sm_sourcetype, 'Thruput') > 0 and sm_sn = '{sn}' order by sm_indate desc", "select");
|
|
|
+ string sm_id = dt.Rows[0]["sm_id"].ToString();
|
|
|
+
|
|
|
+ Dictionary<string, string> testArr = new Dictionary<string, string>();
|
|
|
+ testArr.Add("测试项", $"{resType}吞吐量测试");
|
|
|
+ testArr.Add("参数名称", $"{resType}上行测试值");
|
|
|
+ testArr.Add("结果", "0");
|
|
|
+ testArr.Add("结果描述", "OK");
|
|
|
+ testArr.Add("产测指标门限", "");
|
|
|
+ testArr.Add("测试时长", "10");
|
|
|
+ testArr.Add("值", upRes);
|
|
|
+ foreach (var item in testArr)
|
|
|
+ {
|
|
|
+ dh.ExecuteSql($@"INSERT INTO steptestdetail (sd_id,sd_smid,sd_sn,sd_makecode,sd_machinecode,sd_indate,
|
|
|
+ sd_class,sd_length,sd_actvalue,sd_detno) VALUES
|
|
|
+ ( steptestdetail_seq.NEXTVAL,'{sm_id}','{sn}','{workOrder.Text.Trim()}', 'ZTE',sysdate,
|
|
|
+ '{item.Key}','100','{item.Value}',1 )", "insert");
|
|
|
+ }
|
|
|
+
|
|
|
+ Dictionary<string, string> testArr1 = new Dictionary<string, string>();
|
|
|
+ testArr1.Add("测试项", $"{resType}吞吐量测试");
|
|
|
+ testArr1.Add("参数名称", $"{resType}下行测试值");
|
|
|
+ testArr1.Add("结果", "0");
|
|
|
+ testArr1.Add("结果描述", "OK");
|
|
|
+ testArr1.Add("产测指标门限", "");
|
|
|
+ testArr1.Add("测试时长", "10");
|
|
|
+ testArr1.Add("值", downRes);
|
|
|
+ foreach (var item in testArr1)
|
|
|
+ {
|
|
|
+ dh.ExecuteSql($@"INSERT INTO steptestdetail (sd_id,sd_smid,sd_sn,sd_makecode,sd_machinecode,sd_indate,
|
|
|
+ sd_class,sd_length,sd_actvalue,sd_detno) VALUES
|
|
|
+ ( steptestdetail_seq.NEXTVAL,'{sm_id}','{sn}','{workOrder.Text.Trim()}', 'ZTE',sysdate,
|
|
|
+ '{item.Key}','100','{item.Value}',2 )", "insert");
|
|
|
+ }
|
|
|
+
|
|
|
string oWO, oWOId, oErrMsg = "";
|
|
|
if (LogicHandler.CheckStepSNAndMacode(workOrder.Text, User.UserSourceCode, sn, User.UserCode, out oWO, out oWOId, out oErrMsg))
|
|
|
{
|
|
|
@@ -215,37 +261,35 @@ namespace UAS_MES_NEW.Make
|
|
|
List<string> logItem = new List<string> { };
|
|
|
foreach (var line in lines)
|
|
|
{
|
|
|
- //if (line.Trim().StartsWith("[SUM]"))
|
|
|
- //{
|
|
|
- // logItem.Add(line);
|
|
|
- //}
|
|
|
-
|
|
|
- if(line.Contains("sender") || line.Contains("receiver"))
|
|
|
+ if (line.Trim().StartsWith("[SUM]") && line.Contains("receiver"))
|
|
|
{
|
|
|
logItem.Add(line);
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
- if (logItem.Count > 0 && logItem[logItem.Count - 2].Contains("sender"))
|
|
|
- {
|
|
|
- var match = Regex.Match(logItem[logItem.Count - 2], @"(\d+\.\d+\s+MBytes).*?(\d+\.\d+\s+Mbits/sec)");
|
|
|
- if (match.Success)
|
|
|
- {
|
|
|
- sVal1 = match.Groups[1].Value;
|
|
|
- sVal2 = match.Groups[2].Value;
|
|
|
- }
|
|
|
+ //if (line.Contains("sender") || line.Contains("receiver"))
|
|
|
+ //{
|
|
|
+ // logItem.Add(line);
|
|
|
+ //}
|
|
|
}
|
|
|
+
|
|
|
+ //if (logItem.Count > 0 && logItem[logItem.Count - 2].Contains("sender"))
|
|
|
+ //{
|
|
|
+ // var match = Regex.Match(logItem[logItem.Count - 2], @"(\d+\.?\d*)\s*MBytes\s*(\d+\.?\d*)\s*Mbits/sec");
|
|
|
+ // if (match.Success)
|
|
|
+ // {
|
|
|
+ // sVal1 = match.Groups[1].Value;
|
|
|
+ // sVal2 = match.Groups[2].Value;
|
|
|
+ // }
|
|
|
+ //}
|
|
|
if (logItem.Count > 0 && logItem[logItem.Count - 1].Contains("receiver"))
|
|
|
{
|
|
|
- var match = Regex.Match(logItem[logItem.Count - 1], @"(\d+\.\d+\s+MBytes).*?(\d+\.\d+\s+Mbits/sec)");
|
|
|
+ var match = Regex.Match(logItem[logItem.Count - 1], @"(\d+\.?\d*)\s*MBytes\s*(\d+\.?\d*)\s*Mbits/sec");
|
|
|
if (match.Success)
|
|
|
{
|
|
|
- rVal1 = match.Groups[1].Value;
|
|
|
- rVal2 = match.Groups[2].Value;
|
|
|
+ rVal1 = match.Groups[1].Value + "MBytes";
|
|
|
+ rVal2 = match.Groups[2].Value + "Mbits/sec";
|
|
|
}
|
|
|
}
|
|
|
- //double num1 = (double.Parse(sVal1.Split(' ')[0]) + double.Parse(rVal1.Split(' ')[0])) / 2;
|
|
|
- //double num2 = (double.Parse(sVal2.Split(' ')[0]) + double.Parse(rVal2.Split(' ')[0])) / 2;
|
|
|
|
|
|
return rVal2;
|
|
|
}
|
|
|
@@ -311,7 +355,7 @@ namespace UAS_MES_NEW.Make
|
|
|
{
|
|
|
SQL.Clear();
|
|
|
SQL.Append($@"SELECT ms_sncode,ma_code,pr_code,pr_spec FROM makeserial,make,product
|
|
|
- WHERE ms_sncode = '{sn}' AND ms_makecode = ma_code AND ms_prodcode = pr_code");
|
|
|
+ WHERE ms_sncode = '{sn}' AND ms_makecode = ma_code AND ms_prodcode = pr_code order by MS_ID desc");
|
|
|
dt = (DataTable)dh.ExecuteSql(SQL.ToString(), "select");
|
|
|
if (dt.Rows.Count > 0)
|
|
|
{
|