Ver código fonte

修订日期输入时日期栏位不在可视范围导致出错的问题
从报表中获取数据时添加获取对外处理人栏位
添加宁德时代超期计算代码(完成日-委托日>45天为超期)

luocaiyang 10 meses atrás
pai
commit
054bd05c4f

+ 15 - 0
wispro.sp.api/Job/ImportReportJob.cs

@@ -617,6 +617,21 @@ namespace wispro.sp.api.Job
                 }
             }
 
+            if (row.Table.Columns.Contains("对外处理人"))
+            {
+                if (!string.IsNullOrEmpty(row["对外处理人"].ToString().Trim()))
+                {
+                    string name = row["对外处理人"].ToString();
+                    string temName = name.Trim().Split(new char[] { '-' }, StringSplitOptions.RemoveEmptyEntries)[0];
+
+                    if (!name.Contains("君龙"))
+                    {
+                        temName = name.Trim();
+                    }
+                    item.ExternalHandlerId = GetStaff(temName);
+                }
+            }
+
             if (row.Table.Columns.Contains("业务人员"))
             {
                 if (!string.IsNullOrEmpty(row["业务人员"].ToString().Trim()))

+ 4 - 2
wispro.sp.utility/IPEasyUtility.cs

@@ -439,9 +439,9 @@ namespace wispro.sp.utility
                             var startDate = wait.Until((d) => {
                                 return d.FindElement(By.Id("finish_date_start"));
                             });
-
+                            driver.ExecuteJavaScript("arguments[0].scrollIntoView();", startDate);
                             startDate.Click();
-
+                            System.Threading.Thread.Sleep(500);
                             startDate.SendKeys(DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd"));
 
                             Log($"{DateTime.Now}\t输入处理事项完成日期:结束日期");
@@ -459,7 +459,9 @@ namespace wispro.sp.utility
 
                             });
 
+                            driver.ExecuteJavaScript("arguments[0].scrollIntoView();", endDate);
                             endDate.Click();
+                            System.Threading.Thread.Sleep (500);
                             endDate.SendKeys(DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd"));
                         }
                     }

+ 20 - 1
wospro.sp.entity/PerformanceItem.cs

@@ -236,7 +236,12 @@ namespace wispro.sp.entity
         {
             if (!String.IsNullOrEmpty(DoItem) && DoItem.ToString() == "新申请")
             {
-                DateTime dt1 = DateTime.MinValue;
+                if(Type == "其他新申请")
+                {
+                    return _OtherAppCalDanger();
+                }
+
+                DateTime dt1 = DateTime.Now;
                 if (ReturnDate != null)
                 {
                     dt1 = ReturnDate.Value;
@@ -275,6 +280,20 @@ namespace wispro.sp.entity
 
             return false;
         }
+
+        private bool _OtherAppCalDanger()
+        {
+            DateTime? dt1 = this.EntrustingDate;
+            DateTime? dt2 = this.FinishedDate;
+
+            if (dt2 == null)
+            {
+                dt2 = DateTime.Now;
+            }
+
+            return (dt2.Value - dt1.Value).TotalDays > 45;
+
+        }
     }
 }