Ver Fonte

Merge branch 'master' of http://139.155.15.221:3000/zoulei/XdCxRhDW

zoulei há 1 ano atrás
pai
commit
c1d4ad3f48
1 ficheiros alterados com 15 adições e 8 exclusões
  1. 15 8
      XdCxRhDW.App/UserControl/CtrlHome.cs

+ 15 - 8
XdCxRhDW.App/UserControl/CtrlHome.cs

@@ -165,7 +165,7 @@ namespace XdCxRhDW.App.UserControl
             this.svgImageCollection1.Add("Running", SvgHelper.CreateCycle("#2E8B57"));
             gridView1.CustomDrawCell += GridView1_CustomDrawCell;
             gridView1.DoubleClick += GridView1_DoubleClick;
-            txtTimeCho_SelectedIndexChanged(null, null);            
+            txtTimeCho_SelectedIndexChanged(null, null);
             WaitHelper.CloseForm();
         }
 
@@ -395,9 +395,11 @@ namespace XdCxRhDW.App.UserControl
             {
                 try
                 {
+                    var editItem = gridView1.GetFocusedRow() as TaskInfo;
+                    if (editItem == null) return;
                     using (RHDWContext db = new RHDWContext())
                     {
-                        var editItem = gridView1.GetFocusedRow() as TaskInfo;
+                       
                         List<TaskSig> taskSig = await db.TaskSigs.Where(w => w.TaskInfoID == editItem.ID).ToListAsync();
                         var taskSigID = taskSig.Select(s => s.SigInfoID);
                         var items = await db.SigInfos.ToListAsync();
@@ -494,7 +496,7 @@ namespace XdCxRhDW.App.UserControl
                         List<TaskSigDto> tskSigsDto = new List<TaskSigDto>();
                         using (RHDWContext db = new RHDWContext())
                         {
-                            var dbSigs = await db.TaskSigs.Where(w => w.TaskInfoID == tsk.ID).Include(p=>p.SigInfo).ToListAsync();
+                            var dbSigs = await db.TaskSigs.Where(w => w.TaskInfoID == tsk.ID).Include(p => p.SigInfo).ToListAsync();
                             if (!dbSigs.Any())
                             {
                                 DxHelper.MsgBoxHelper.ShowWarning($"请添加任务信号");
@@ -1101,9 +1103,13 @@ namespace XdCxRhDW.App.UserControl
             }
         }
 
-        public void RePosition(List<RePosRes> items)
+        public void RePosition(List<RePosRes> items, PosRequestByTimeRangeDto dto)
         {
-            if (items.Count == 0) return;
+            if (items.Count == 0)
+            {
+                MsgBoxHelper.ShowWarning($"查询任务[{dto.TaskInfoID}]开始时间:{dto.BeginTime:yyyy-MM-dd HH:mm:ss} 结束时间:{dto.EndTime:yyyy-MM-dd HH:mm:ss}无定位结果数据");
+                return;
+            }
             Task.Run(async () =>
             {
                 foreach (var item in items)
@@ -1356,7 +1362,7 @@ namespace XdCxRhDW.App.UserControl
                 var res = await HttpHelper.PostRequestAsync<List<RePosRes>>(baseUrl + "Pos/GetPosCgResByTimeRangeObsolete", dto, token: ct.Token);
                 if (res.code == 200)
                 {
-                    RePosition(res.data);
+                    RePosition(res.data, dto);
                 }
                 else
                 {
@@ -1365,8 +1371,9 @@ namespace XdCxRhDW.App.UserControl
             }
             catch (Exception ex)
             {
-                Serilog.Log.Error(ex, "重新定位结果查询异常");
-                MsgBoxHelper.ShowError("重新定位结果查询异常");
+                string msg = $"任务[{dto.TaskInfoID}]重新定位结果查询开始时间:{dto.BeginTime:yyyy-MM-dd HH:mm:ss} 结束时间:{dto.EndTime:yyyy-MM-dd HH:mm:ss}异常";
+                Serilog.Log.Error(ex, msg);
+                MsgBoxHelper.ShowError(msg);
             }