wanghan 4 months ago
parent
commit
cf5091281e

+ 5 - 0
LogForceTestApp.Modules.MainModule/ViewModels/KBWindowViewModel.cs

@@ -1018,6 +1018,11 @@ namespace LogoForceTestApp.Modules.MainModule.ViewModels
                 if (allnumbers != null)
                 {
                     TotalNum = allnumbers.RealityA;
+                    if (allnumbers.OkA <= 0)
+                    {
+                        allnumbers.OkA= 0;
+                        repository.Update(allnumbers);
+                    }
                     PassNum = allnumbers.OkA;
                 }
             }

+ 7 - 1
LogForceTestApp.Modules.MainModule/ViewModels/MainPageViewModel.cs

@@ -1606,7 +1606,7 @@ namespace LogoForceTestApp.Modules.MainModule.ViewModels
                 //{
                 fbarcode.Clear();
                 Quest(Order);
-                WriteLog("切换订单成功");
+                
                 var customRepo = new CustomRepository();
                 try
                 {
@@ -1615,7 +1615,13 @@ namespace LogoForceTestApp.Modules.MainModule.ViewModels
                     {
                         plannum = list.FAuxQty.ToString();
                         plan = Math.Round(Convert.ToDouble(plannum));
+                        WriteLog("切换订单成功");
                     }
+                    else
+                    {
+                        WriteLog("订单错误",LogType.Error);
+                    }
+
                     var t_pda = customRepo.GetAllQuery<t_PDABarCodeSign>(c => c.FBillNo == Order);
                     if (t_pda != null)
                     {

+ 27 - 17
LogForceTestApp.Modules.MainModule/ViewModels/StatementPageViewModel.cs

@@ -64,29 +64,39 @@ namespace LogoForceTestApp.Modules.MainModule.ViewModels
         string prono;
         private void query()
         {
-            if (SelectedEndDate < SelectedStartDate || SelectedStartDate == default)
+            try
             {
-                MessageBox.Show("请选择正确的日期", "提示");
-                return;
-            }
+                if (SelectedEndDate < SelectedStartDate || SelectedStartDate == default)
+                {
+                    MessageBox.Show("请选择正确的日期", "提示");
+                    return;
+                }
+
+                _infNew.Clear();
 
-            _infNew.Clear();
+                var endTime = SelectedEndDate.AddDays(1);
+                if (ProCode != "")
+                {
+                    var res = repository.GetAllQuery<Information>(c => c.ProCode == ProCode && c.CreateTime >= SelectedStartDate && c.CreateTime <= endTime);
+                    if (res[0].ProNo != "")
+                    { prono = res[0].ProNo; }
+                    else { prono = res[1].ProNo; }
 
-            var endTime = SelectedEndDate.AddDays(1);
-            var res = repository.GetAllQuery<Information>(c => c.ProCode == ProCode && c.CreateTime >= SelectedStartDate && c.CreateTime <= endTime);
-            if (res[0].ProNo != "")
-            { prono = res[0].ProNo; }
-            else { prono = res[1].ProNo; }
-            
-            var list = repository.GetAllQuery<Information>(c => c.ProNo == prono && c.CreateTime >= SelectedStartDate && c.CreateTime <= endTime);
+                    var list = repository.GetAllQuery<Information>(c => c.ProNo == prono && c.CreateTime >= SelectedStartDate && c.CreateTime <= endTime);
 
-            list.Reverse();
-            var dtos = _mapper.Map<List<Information>>(list);
-            _infNew.AddRange(dtos);
+                    list.Reverse();
+                    var dtos = _mapper.Map<List<Information>>(list);
+                    _infNew.AddRange(dtos);
 
+                }
 
-            InfNew = _infNew.Take(PageCount).ToList();
-            MaxCount = _infNew.Count / PageCount + 1;
+                InfNew = _infNew.Take(PageCount).ToList();
+                MaxCount = _infNew.Count / PageCount + 1;
+            }
+            catch (Exception ex)
+            {
+                MessageBox.Show("StatementPage:" + ex.Message);
+            }
         }
     }
 }