wanghan 3 月之前
父节点
当前提交
fc02a718c7

+ 49 - 17
LogForceTestApp.Modules.MainModule/ViewModels/MainPageViewModel.cs

@@ -638,10 +638,18 @@ namespace LogoForceTestApp.Modules.MainModule.ViewModels
                             string sp = mes.Split(":")[1];//产品码
                             string result = mes.Split(":")[2];
                             string opname = Operator15;
-                            TestRes(sp, result, opname);
-                            WriteCSV_Test(opname, sp, result);
-                            client.Send("TeR:检测结果上传成功");
-                            WriteLog("检测1#检测结果上传成功");
+                            if (sp!="")
+                            {
+                                TestRes(sp, result, opname);
+                                WriteCSV_Test(opname, sp, result);
+                                client.Send("TeR:检测结果上传成功");
+                                WriteLog("检测1#检测结果上传成功");
+                            }
+                            else
+                            {
+                                client.Send("TeR:检测结果上传失败");
+                                WriteLog("检测1#检测结果上传失败");
+                            }
                         }
                         if (mes.Split(":")[0] == "Test")
                         {
@@ -761,10 +769,18 @@ namespace LogoForceTestApp.Modules.MainModule.ViewModels
                             string sp = mes.Split(":")[1];
                             string result = mes.Split(":")[2];
                             string opname = Operator16;
-                            TestRes(sp, result, opname);
-                            WriteCSV_Test(opname, sp, result);
-                            client.Send("TeR:检测结果上传成功");
-                            WriteLog("检测2#检测结果上传成功");
+                            if (sp != "")
+                            {
+                                TestRes(sp, result, opname);
+                                WriteCSV_Test(opname, sp, result);
+                                client.Send("TeR:检测结果上传成功");
+                                WriteLog("检测2#检测结果上传成功");
+                            }
+                            else
+                            {
+                                client.Send("TeR:检测结果上传失败");
+                                WriteLog("检测2#检测结果上传失败");
+                            }
                         }
                         if (mes.Split(":")[0] == "Test")
                         {
@@ -883,10 +899,18 @@ namespace LogoForceTestApp.Modules.MainModule.ViewModels
                             string sp = mes.Split(":")[1];
                             string result = mes.Split(":")[2];
                             string opname = Operator17;
-                            TestRes(sp, result, opname);
-                            WriteCSV_Test(opname, sp, result);
-                            client.Send("TeR:检测结果上传成功");
-                            WriteLog("检测3#检测结果上传成功");
+                            if (sp != "")
+                            {
+                                TestRes(sp, result, opname);
+                                WriteCSV_Test(opname, sp, result);
+                                client.Send("TeR:检测结果上传成功");
+                                WriteLog("检测3#检测结果上传成功");
+                            }
+                            else
+                            {
+                                client.Send("TeR:检测结果上传失败");
+                                WriteLog("检测3#检测结果上传失败");
+                            }
                         }
                         if (mes.Split(":")[0] == "Test")
                         {
@@ -1005,10 +1029,18 @@ namespace LogoForceTestApp.Modules.MainModule.ViewModels
                             string sp = mes.Split(":")[1];
                             string result = mes.Split(":")[2];
                             string opname = Operator18;
-                            TestRes(sp, result, opname);
-                            WriteCSV_Test(opname, sp, result);
-                            client.Send("TeR:检测结果上传成功");
-                            WriteLog("检测4#检测结果上传成功");
+                            if (sp != "")
+                            {
+                                TestRes(sp, result, opname);
+                                WriteCSV_Test(opname, sp, result);
+                                client.Send("TeR:检测结果上传成功");
+                                WriteLog("检测4#检测结果上传成功");
+                            }
+                            else
+                            {
+                                client.Send("TeR:检测结果上传失败");
+                                WriteLog("检测4#检测结果上传失败");
+                            }
                         }
                         if (mes.Split(":")[0] == "Test")
                         {
@@ -1442,8 +1474,8 @@ namespace LogoForceTestApp.Modules.MainModule.ViewModels
                     res[i].ProCode = procode;
                     _repository.Update(res[i]);
                 }
-                WriteCSV_Bind(procode, soleNum, proName, Order);
             }
+            WriteCSV_Bind(procode, soleNum, proName, Order);
         }
 
         #region 相同部分

+ 1 - 1
LogForceTestApp.Modules.MainModule/Views/StatementPage.xaml

@@ -34,7 +34,7 @@
                        Margin="5"
                        FontSize="16"
                        VerticalAlignment="Center" />
-            <TextBox Width="200"
+            <TextBox Width="300"
                      VerticalAlignment="Center"
                      FontSize="20"
                      Text="{Binding ProCode,UpdateSourceTrigger=PropertyChanged}"