|
@@ -321,94 +321,139 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
|
|
|
int beforeResult = 0;
|
|
|
int inResult = 0;
|
|
|
int outResult = 0;
|
|
|
- if (SelectLogic == "OR")
|
|
|
+ if (BeforeConList.Count == 0)
|
|
|
{
|
|
|
- var find = BeforeConList.FirstOrDefault(x => x.TestResult == "合格");
|
|
|
- if (find != null)
|
|
|
- {
|
|
|
- beforeResult = 1;
|
|
|
- }
|
|
|
+ beforeResult = 1;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- if (SelectLogic == "AND" || SelectLogic == "ONLY")
|
|
|
+ if (SelectLogic == "OR")
|
|
|
{
|
|
|
- var find = BeforeConList.FirstOrDefault(x => x.TestResult == "不合格");
|
|
|
+ var find = BeforeConList.FirstOrDefault(x => x.TestResult == "通过");
|
|
|
if (find != null)
|
|
|
+ {
|
|
|
+ beforeResult = 1;
|
|
|
+ }
|
|
|
+ else
|
|
|
{
|
|
|
beforeResult = 0;
|
|
|
}
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- if (SelectLogic == "NULL")
|
|
|
+ if (SelectLogic == "AND" || SelectLogic == "ONLY")
|
|
|
{
|
|
|
+ var find = BeforeConList.FirstOrDefault(x => x.TestResult == "不通过");
|
|
|
+ if (find != null)
|
|
|
+ {
|
|
|
+ beforeResult = 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if (SelectLogic == "NULL")
|
|
|
+ {
|
|
|
|
|
|
- beforeResult = 1;
|
|
|
+ beforeResult = 1;
|
|
|
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
//输入项
|
|
|
- if (InSelectLogic == "OR")
|
|
|
+ if (InConList.Count == 0)
|
|
|
{
|
|
|
- var find = InConList.FirstOrDefault(x => x.TestResult == "合格");
|
|
|
- if (find != null)
|
|
|
- {
|
|
|
- inResult = 1;
|
|
|
- }
|
|
|
+ inResult = 1;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- if (InSelectLogic == "AND" || InSelectLogic == "ONLY")
|
|
|
+ if (InSelectLogic == "OR")
|
|
|
{
|
|
|
- var find = InConList.FirstOrDefault(x => x.TestResult == "不合格");
|
|
|
+ var find = InConList.FirstOrDefault(x => x.TestResult == "通过");
|
|
|
if (find != null)
|
|
|
+ {
|
|
|
+ inResult = 1;
|
|
|
+ }
|
|
|
+ else
|
|
|
{
|
|
|
inResult = 0;
|
|
|
}
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- if (InSelectLogic == "NULL")
|
|
|
+ if (InSelectLogic == "AND" || InSelectLogic == "ONLY")
|
|
|
{
|
|
|
+ var find = InConList.FirstOrDefault(x => x.TestResult == "不通过");
|
|
|
+ if (find != null)
|
|
|
+ {
|
|
|
+ inResult = 0;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ inResult = 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if (InSelectLogic == "NULL")
|
|
|
+ {
|
|
|
|
|
|
- inResult = 1;
|
|
|
+ inResult = 1;
|
|
|
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
|
|
|
+
|
|
|
//输出项
|
|
|
- if (OutSelectLogic == "OR")
|
|
|
+ if (OutConList.Count == 0)
|
|
|
{
|
|
|
- var find = OutConList.FirstOrDefault(x => x.TestResult == "合格");
|
|
|
- if (find != null)
|
|
|
- {
|
|
|
- outResult = 1;
|
|
|
- }
|
|
|
+ outResult = 1;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- if (OutSelectLogic == "AND" || OutSelectLogic == "ONLY")
|
|
|
+ if (OutSelectLogic == "OR")
|
|
|
{
|
|
|
- var find = OutConList.FirstOrDefault(x => x.TestResult == "不合格");
|
|
|
+ var find = OutConList.FirstOrDefault(x => x.TestResult == "通过");
|
|
|
if (find != null)
|
|
|
+ {
|
|
|
+ outResult = 1;
|
|
|
+ }
|
|
|
+ else
|
|
|
{
|
|
|
outResult = 0;
|
|
|
}
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- if (OutSelectLogic == "NULL")
|
|
|
+ if (OutSelectLogic == "AND" || OutSelectLogic == "ONLY")
|
|
|
+ {
|
|
|
+ var find = OutConList.FirstOrDefault(x => x.TestResult == "不通过");
|
|
|
+ if (find != null)
|
|
|
+ {
|
|
|
+ outResult = 0;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ outResult = 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
{
|
|
|
+ if (OutSelectLogic == "NULL")
|
|
|
+ {
|
|
|
|
|
|
- outResult = 1;
|
|
|
+ outResult = 1;
|
|
|
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
if (beforeResult == 1 && inResult == 1 && outResult == 1)
|
|
|
{
|
|
|
return 1;
|
|
@@ -528,7 +573,7 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
|
|
|
string prefixJsonStr = ModelToJsonToStr(BeforeSelectJudge, SelectLogic, BeforeDetail, BeforeConList);
|
|
|
//json字符串
|
|
|
bizTestRecordDtlDto.PreconditionFinal = prefixJsonStr;
|
|
|
- bizTestRecordDtlDto.PreconditionResult = "合格";
|
|
|
+ bizTestRecordDtlDto.PreconditionResult = "通过";
|
|
|
StepIndex = 1;
|
|
|
//MessageBoxResult boxResult = MessageBox.Show(BeforeDetail, "确认", MessageBoxButton.OKCancel, MessageBoxImage.Information);
|
|
|
//if (boxResult == MessageBoxResult.OK)
|
|
@@ -537,7 +582,7 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
|
|
|
// string prefixJsonStr = ModelToJsonToStr(BeforeSelectJudge, SelectLogic, BeforeDetail, BeforeConList);
|
|
|
// //json字符串
|
|
|
// bizTestRecordDtlDto.PreconditionFinal = prefixJsonStr;
|
|
|
- // bizTestRecordDtlDto.PreconditionResult = "合格";
|
|
|
+ // bizTestRecordDtlDto.PreconditionResult = "通过";
|
|
|
// StepIndex = 1;
|
|
|
//}
|
|
|
//else
|
|
@@ -556,7 +601,7 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
|
|
|
string prefixJsonStrAuto = ModelToJsonToStr(BeforeSelectJudge, SelectLogic, BeforeDetail, BeforeConList);
|
|
|
//json字符串
|
|
|
bizTestRecordDtlDto.PreconditionFinal = prefixJsonStrAuto;
|
|
|
- bizTestRecordDtlDto.PreconditionResult = "合格";
|
|
|
+ bizTestRecordDtlDto.PreconditionResult = "通过";
|
|
|
StepIndex = 1;
|
|
|
//MessageBoxResult boxResultAuto = MessageBox.Show(BeforeDetail, "确认", MessageBoxButton.OKCancel, MessageBoxImage.Information);
|
|
|
//if (boxResultAuto == MessageBoxResult.OK)
|
|
@@ -565,7 +610,7 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
|
|
|
// string prefixJsonStr = ModelToJsonToStr(BeforeSelectJudge, SelectLogic, BeforeDetail, BeforeConList);
|
|
|
// //json字符串
|
|
|
// bizTestRecordDtlDto.PreconditionFinal = prefixJsonStr;
|
|
|
- // bizTestRecordDtlDto.PreconditionResult = "合格";
|
|
|
+ // bizTestRecordDtlDto.PreconditionResult = "通过";
|
|
|
// StepIndex = 1;
|
|
|
//}
|
|
|
//else
|
|
@@ -608,12 +653,12 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
|
|
|
item.TestTime = DateTime.Now;
|
|
|
if (readResult.Trim() == plcValue.Trim())
|
|
|
{
|
|
|
- item.TestResult = "合格";
|
|
|
+ item.TestResult = "通过";
|
|
|
countCond++;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- item.TestResult = "不合格";
|
|
|
+ item.TestResult = "不通过";
|
|
|
}
|
|
|
break;
|
|
|
case "word":
|
|
@@ -634,23 +679,23 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
|
|
|
case "ONLY":
|
|
|
if ((countCond == BeforeConList.Count) && (countCond != 0))
|
|
|
{
|
|
|
- bizTestRecordDtlDto.PreconditionResult = "合格";
|
|
|
+ bizTestRecordDtlDto.PreconditionResult = "通过";
|
|
|
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- bizTestRecordDtlDto.PreconditionResult = "不合格";
|
|
|
+ bizTestRecordDtlDto.PreconditionResult = "不通过";
|
|
|
}
|
|
|
break;
|
|
|
case "OR":
|
|
|
if ((countCond != 0))
|
|
|
{
|
|
|
- bizTestRecordDtlDto.PreconditionResult = "合格";
|
|
|
+ bizTestRecordDtlDto.PreconditionResult = "通过";
|
|
|
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- bizTestRecordDtlDto.PreconditionResult = "不合格";
|
|
|
+ bizTestRecordDtlDto.PreconditionResult = "不通过";
|
|
|
}
|
|
|
break;
|
|
|
}
|
|
@@ -669,20 +714,17 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
|
|
|
{
|
|
|
case "人工判定":
|
|
|
//弹出确认的对话框
|
|
|
- MessageBoxResult boxResult = MessageBox.Show(InDetail, "确认", MessageBoxButton.OKCancel, MessageBoxImage.Information);
|
|
|
- if (boxResult == MessageBoxResult.OK)
|
|
|
+ //MessageBoxResult boxResult = MessageBox.Show(InDetail, "确认", MessageBoxButton.OKCancel, MessageBoxImage.Information);
|
|
|
+ //if (boxResult == MessageBoxResult.OK)
|
|
|
{
|
|
|
//前置项测试结果json转化
|
|
|
string actionJsonStr = ModelToJsonToStr(SelectInJudge, InSelectLogic, InDetail, InConList);
|
|
|
//json字符串
|
|
|
bizTestRecordDtlDto.ActionFinal = actionJsonStr;
|
|
|
- bizTestRecordDtlDto.ActionResult = "合格";
|
|
|
+ bizTestRecordDtlDto.ActionResult = "通过";
|
|
|
StepIndex = 2;
|
|
|
}
|
|
|
- else
|
|
|
- {
|
|
|
- isActionResult = false;
|
|
|
- }
|
|
|
+
|
|
|
|
|
|
break;
|
|
|
case "自动判定":
|
|
@@ -691,20 +733,17 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
|
|
|
{
|
|
|
case "NULL":
|
|
|
//弹出确认的对话框
|
|
|
- MessageBoxResult boxResultAction = MessageBox.Show(InDetail, "确认", MessageBoxButton.OKCancel, MessageBoxImage.Information);
|
|
|
- if (boxResultAction == MessageBoxResult.OK)
|
|
|
+ //MessageBoxResult boxResultAction = MessageBox.Show(InDetail, "确认", MessageBoxButton.OKCancel, MessageBoxImage.Information);
|
|
|
+ //if (boxResultAction == MessageBoxResult.OK)
|
|
|
{
|
|
|
//前置项测试结果json转化
|
|
|
string actionJsonStr = ModelToJsonToStr(SelectInJudge, InSelectLogic, InDetail, InConList);
|
|
|
//json字符串
|
|
|
bizTestRecordDtlDto.ActionFinal = actionJsonStr;
|
|
|
- bizTestRecordDtlDto.ActionResult = "合格";
|
|
|
+ bizTestRecordDtlDto.ActionResult = "通过";
|
|
|
StepIndex = 2;
|
|
|
}
|
|
|
- else
|
|
|
- {
|
|
|
- isActionResult = false;
|
|
|
- }
|
|
|
+
|
|
|
|
|
|
break;
|
|
|
case "AND":
|
|
@@ -746,13 +785,13 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
|
|
|
item.TestTime = DateTime.Now;
|
|
|
if (writeResult)
|
|
|
{
|
|
|
- ///单个测试项合格
|
|
|
- item.TestResult = "合格";
|
|
|
+ ///单个测试项通过
|
|
|
+ item.TestResult = "通过";
|
|
|
countCond++;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- item.TestResult = "不合格";
|
|
|
+ item.TestResult = "不通过";
|
|
|
}
|
|
|
|
|
|
break;
|
|
@@ -764,13 +803,13 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
|
|
|
item.TestTime = DateTime.Now;
|
|
|
if (writeWrordResult)
|
|
|
{
|
|
|
- ///单个测试项合格
|
|
|
- item.TestResult = "合格";
|
|
|
+ ///单个测试项通过
|
|
|
+ item.TestResult = "通过";
|
|
|
countCond++;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- item.TestResult = "不合格";
|
|
|
+ item.TestResult = "不通过";
|
|
|
}
|
|
|
|
|
|
|
|
@@ -797,23 +836,23 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
|
|
|
case "ONLY":
|
|
|
if ((countCond == BeforeConList.Count) && (countCond != 0))
|
|
|
{
|
|
|
- bizTestRecordDtlDto.ActionResult = "合格";
|
|
|
+ bizTestRecordDtlDto.ActionResult = "通过";
|
|
|
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- bizTestRecordDtlDto.ActionResult = "不合格";
|
|
|
+ bizTestRecordDtlDto.ActionResult = "不通过";
|
|
|
}
|
|
|
break;
|
|
|
case "OR":
|
|
|
if ((countCond != 0))
|
|
|
{
|
|
|
- bizTestRecordDtlDto.ActionResult = "合格";
|
|
|
+ bizTestRecordDtlDto.ActionResult = "通过";
|
|
|
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- bizTestRecordDtlDto.ActionResult = "不合格";
|
|
|
+ bizTestRecordDtlDto.ActionResult = "不通过";
|
|
|
}
|
|
|
break;
|
|
|
}
|
|
@@ -834,7 +873,7 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
|
|
|
MessageBoxResult boxResult = MessageBox.Show(OutDetail, "确认", MessageBoxButton.OKCancel, MessageBoxImage.Information);
|
|
|
if (boxResult == MessageBoxResult.OK)
|
|
|
{
|
|
|
- bizTestRecordDtlDto.JudgementResult = "合格";
|
|
|
+ bizTestRecordDtlDto.JudgementResult = "通过";
|
|
|
StepIndex = 3;
|
|
|
}
|
|
|
else
|
|
@@ -848,7 +887,7 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
|
|
|
switch (OutSelectLogic)
|
|
|
{
|
|
|
case "NULL":
|
|
|
- bizTestRecordDtlDto.JudgementResult = "合格";
|
|
|
+ bizTestRecordDtlDto.JudgementResult = "通过";
|
|
|
StepIndex = 3;
|
|
|
break;
|
|
|
case "AND":
|
|
@@ -917,12 +956,12 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
|
|
|
item.TestTime = DateTime.Now;
|
|
|
if (readResult.Trim() == plcValue?.Trim())
|
|
|
{
|
|
|
- item.TestResult = "合格";
|
|
|
+ item.TestResult = "通过";
|
|
|
countCond++;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- item.TestResult = "不合格";
|
|
|
+ item.TestResult = "不通过";
|
|
|
}
|
|
|
|
|
|
break;
|
|
@@ -955,12 +994,12 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
|
|
|
item.TestTime = DateTime.Now;
|
|
|
if (readResult2.Trim() == plcValue?.Trim())
|
|
|
{
|
|
|
- item.TestResult = "合格";
|
|
|
+ item.TestResult = "通过";
|
|
|
countCond++;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- item.TestResult = "不合格";
|
|
|
+ item.TestResult = "不通过";
|
|
|
}
|
|
|
|
|
|
break;
|
|
@@ -981,23 +1020,23 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
|
|
|
case "ONLY":
|
|
|
if ((countCond == OutConList.Count) && (countCond != 0))
|
|
|
{
|
|
|
- bizTestRecordDtlDto.JudgementResult = "合格";
|
|
|
+ bizTestRecordDtlDto.JudgementResult = "通过";
|
|
|
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- bizTestRecordDtlDto.JudgementResult = "不合格";
|
|
|
+ bizTestRecordDtlDto.JudgementResult = "不通过";
|
|
|
}
|
|
|
break;
|
|
|
case "OR":
|
|
|
if (countCond != 0)
|
|
|
{
|
|
|
- bizTestRecordDtlDto.JudgementResult = "合格";
|
|
|
+ bizTestRecordDtlDto.JudgementResult = "通过";
|
|
|
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- bizTestRecordDtlDto.JudgementResult = "不合格";
|
|
|
+ bizTestRecordDtlDto.JudgementResult = "不通过";
|
|
|
}
|
|
|
break;
|
|
|
}
|