ソースを参照

发明一次OA授权 缺漏申请 添加了从“集中审查”处理事项获取处理人的逻辑

luocaiyang 1 年間 前
コミット
058786ec02

+ 45 - 30
wispro.sp.api/AppealHandler/MissingCaseReviewHandler.cs

@@ -76,43 +76,58 @@ namespace wispro.sp.api.AppealHandler
                 PerformanceItem Item = null;
                 if (strDoItem == "发明一次OA授权")
                 {
+                    
                     try
                     {
-                        Item = itemControler.GetItemInfoByCaseStage(strCaseNo, "处理审查意见", "");
+                        Item = itemControler.GetItemInfoByCaseStage(strCaseNo,new List<string>() { "处理审查意见", "电询", "集中审查", "补正","新申请" }, "");
                     }
                     catch { }
 
-                    if(Item == null || Item.ItemStaffs.Where(s => s.DoPerson.Name == appealRecord.Creater.Name).Count() ==0 )
-                    {
-                        Item = null;
-                        try
-                        {
-                            Item = itemControler.GetItemInfoByCaseStage(strCaseNo, "电询", "");
-                        }
-                        catch { }
+                    #region oldcode
+                    //if (Item == null || Item.ItemStaffs.Where(s => s.DoPerson.Name == appealRecord.Creater.Name).Count() ==0 )
+                    //{
+                    //    Item = null;
+                    //    try
+                    //    {
+                    //        Item = itemControler.GetItemInfoByCaseStage(strCaseNo, "电询", "");
+                    //    }
+                    //    catch { }
                         
-                    }
-
-                    if (Item == null || Item.ItemStaffs.Where(s => s.DoPerson.Name == appealRecord.Creater.Name).Count() == 0)
-                    {
-                        Item = null;
-                        try
-                        {
-                            Item = itemControler.GetItemInfoByCaseStage(strCaseNo, "补正", "");
-                        }
-                        catch { }
-                    }
-
-                    if (Item == null || Item.ItemStaffs.Where(s => s.DoPerson.Name == appealRecord.Creater.Name).Count() == 0)
-                    {
-                        Item = null;
+                    //}
+
+                    //if (Item == null || Item.ItemStaffs.Where(s => s.DoPerson.Name == appealRecord.Creater.Name).Count() == 0)
+                    //{
+                    //    Item = null;
+                    //    try
+                    //    {
+                    //        Item = itemControler.GetItemInfoByCaseStage(strCaseNo, "集中审查", "");
+                    //    }
+                    //    catch { }
+
+                    //}
+
+                    //if (Item == null || Item.ItemStaffs.Where(s => s.DoPerson.Name == appealRecord.Creater.Name).Count() == 0)
+                    //{
+                    //    Item = null;
+                    //    try
+                    //    {
+                    //        Item = itemControler.GetItemInfoByCaseStage(strCaseNo, "补正", "");
+                    //    }
+                    //    catch { }
+                    //}
+
+                    //if (Item == null || Item.ItemStaffs.Where(s => s.DoPerson.Name == appealRecord.Creater.Name).Count() == 0)
+                    //{
+                    //    Item = null;
                         
-                        try
-                        {
-                            Item = itemControler.GetItemInfoByCaseStage(strCaseNo, "新申请", "");
-                        }
-                        catch { }
-                    }
+                    //    try
+                    //    {
+                    //        Item = itemControler.GetItemInfoByCaseStage(strCaseNo, "新申请", "");
+                    //    }
+                    //    catch { }
+                    //}
+
+                    #endregion
                 }
                 else
                 {

+ 230 - 18
wispro.sp.api/Controllers/PerformanceItemController.cs

@@ -15,6 +15,7 @@ using System.Linq;
 using System.Linq.Expressions;
 using System.Threading;
 using System.Threading.Tasks;
+using wispro.sp.api.Job;
 using wispro.sp.api.Services;
 using wispro.sp.api.Utility;
 using wispro.sp.entity;
@@ -25,7 +26,7 @@ namespace wispro.sp.api.Controllers
 {
     [Route("api/[controller]/[action]")]
     [ApiController]
-    [Authorize]
+    
     public class PerformanceItemController : ControllerBase
     {
         spDbContext Context;
@@ -39,6 +40,7 @@ namespace wispro.sp.api.Controllers
 
         }
 
+        [Authorize]
         public ApiSaveResponse RemoveDBNotFinishDate(int year, int month)
         {
             ApiSaveResponse ret = new ApiSaveResponse();
@@ -74,6 +76,7 @@ namespace wispro.sp.api.Controllers
         }
 
 
+        [Authorize]
         public bool IsExist(PerformanceItem item)
         {
             var results = Context.PerformanceItems.Where<PerformanceItem>(x =>
@@ -93,6 +96,7 @@ namespace wispro.sp.api.Controllers
             }
 
         }
+        [Authorize]
         public ApiSaveResponse New(PerformanceItem item)
         {
             ApiSaveResponse ret = new ApiSaveResponse();
@@ -251,6 +255,7 @@ namespace wispro.sp.api.Controllers
         /// <param name="field">栏位,多个位以|杠隔开</param>
         /// <param name="value">栏位值,多个以|杠隔开</param>
         /// <returns></returns>
+        [Authorize]
         public ApiSaveResponse UpdateFieldValue(int id, string field, string value)
         {
             ApiSaveResponse ret = new ApiSaveResponse();
@@ -348,6 +353,7 @@ namespace wispro.sp.api.Controllers
 
             return ret;
         }
+        [Authorize]
         public ListApiResponse<PerformanceItem> Query(int pageIndex, int pageSize)
         {
             ListApiResponse<PerformanceItem> ret = new ListApiResponse<PerformanceItem>();
@@ -390,6 +396,7 @@ namespace wispro.sp.api.Controllers
             return ret;
         }
 
+        [Authorize]
         public PerformanceItem Get(int Id)
         {
             var results = Context.PerformanceItems
@@ -430,6 +437,7 @@ namespace wispro.sp.api.Controllers
         /// <param name="userid">用户id</param>
         /// <param name="type">获取类型;0:处理中;1:所有;4:已归档</param>
         /// <returns></returns>
+        [Authorize]
         public ListApiResponse<PerformanceItem> GetMyList(int userid, int type, int pageIndex = 1, int pageSize = 10)
         {
 
@@ -798,7 +806,7 @@ namespace wispro.sp.api.Controllers
             return retObj;
 
         }
-
+        [Authorize]
         public List<string> GetFeedbackString(int itemId)
         {
             PerformanceItem item = Context.PerformanceItems.FirstOrDefault<PerformanceItem>(p => p.Id == itemId);
@@ -810,7 +818,7 @@ namespace wispro.sp.api.Controllers
 
             return new List<string>();
         }
-
+        [Authorize]
         public FileProcessTask GetStaticsReport(int Year,int Month)
         {
             CalMonth calMonth = Context.CalMonths.FirstOrDefault(c => c.Year == Year && c.Month == Month);
@@ -1058,7 +1066,7 @@ namespace wispro.sp.api.Controllers
                 _CalJXPoint(calMonth, spDb);
             }
         }
-
+        [Authorize]
         public ApiSaveResponse RefreshBasePoint()
         {
             System.Threading.Thread t = new Thread(_RefreshBasePoint);
@@ -1068,7 +1076,7 @@ namespace wispro.sp.api.Controllers
                 Success = true
             };
         }
-
+        [Authorize]
         public void RefreshPoint(PerformanceItem item)
         {
             //spDbContext spDb = new spDbContext();
@@ -1115,7 +1123,7 @@ namespace wispro.sp.api.Controllers
 
             return null;
         }
-
+        [Authorize]
         public ApiSaveResponse UpdateOAStaff()
         {
             string strExcelFile = @"c:\temp\每月绩效统计--中国一次OA授权表.xlsx";
@@ -1197,7 +1205,7 @@ namespace wispro.sp.api.Controllers
                 Success = true
             };
         }
-
+        [Authorize]
         public ApiSaveResponse RefreshFromIPEasyById(int itemId)
         {
             var Item = Context.PerformanceItems.Include(p => p.Customer).Include(p => p.ItemStaffs).ThenInclude(p => p.DoPerson).FirstOrDefault(p => p.Id == itemId);
@@ -1224,6 +1232,7 @@ namespace wispro.sp.api.Controllers
                 Success = true
             };
         }
+        [Authorize]
 
         public ApiSaveResponse RefreshFromIPEasy_Batch(int type)
         {
@@ -1234,7 +1243,7 @@ namespace wispro.sp.api.Controllers
                 Success = true
             };
         }
-
+        [Authorize]
         public ApiSaveResponse RefreshFromIPEasy(string CaseNo, string DoItem, string caseStage)
         {
             var Item = Context.PerformanceItems.Include(p => p.Customer).FirstOrDefault(p => p.CaseNo == CaseNo && p.DoItem == DoItem && p.CaseStage == caseStage);
@@ -1248,7 +1257,7 @@ namespace wispro.sp.api.Controllers
                 Success = true
             };
         }
-
+        [Authorize]
         public ApiSaveResponse CompareExcel2DB()
         {
 
@@ -1262,7 +1271,7 @@ namespace wispro.sp.api.Controllers
         }
 
 
-
+        [Authorize]
         public FileProcessTask CurrentData2Excel(int Year,int Month)
         {
             CalMonth calMonth = Context.CalMonths.FirstOrDefault(c => c.Year == Year && c.Month == Month);
@@ -1982,7 +1991,7 @@ namespace wispro.sp.api.Controllers
         }
 
 
-
+        [Authorize]
         public List<StaffStatistics> CalItemJX(int itemid)
         {
             var Item = Context.PerformanceItems.Include(p => p.CalMonth)
@@ -2118,7 +2127,7 @@ namespace wispro.sp.api.Controllers
                     }
                     else
                     {
-                        if (itemStaff.PerformancePoint == null)
+                        if (itemStaff.PerformancePoint != null)
                         {
                             if (isPJFP)
                             {
@@ -2292,6 +2301,10 @@ namespace wispro.sp.api.Controllers
 
                 if (ss.jxType == "新申请处理" || ss.jxType == "专案处理")
                 {
+                    if(ss.StaffId == 222)
+                    {
+                        System.Diagnostics.Debug.WriteLine("");
+                    }
                     #region 新申请处理+专案处理
                     if (!staffXiShu.ContainsKey(ss.StaffId))
                     {
@@ -2352,6 +2365,7 @@ namespace wispro.sp.api.Controllers
             }
             #endregion
         }
+        [Authorize]
         public void CalJXPoint(int year, int month)
         {
             CalMonth calMonth = Context.CalMonths.Where<CalMonth>(c => c.Month == month && c.Year == year).FirstOrDefault();
@@ -2400,7 +2414,7 @@ namespace wispro.sp.api.Controllers
                 }
             }
         }
-
+        [Authorize]
         public ProcessTask FinishedCalMonth(int year,int month)
         {
             CalMonth calMonth = Context.CalMonths.FirstOrDefault(c => c.Year == year && c.Month == month);
@@ -2506,6 +2520,7 @@ namespace wispro.sp.api.Controllers
         /// <param name="year"></param>
         /// <param name="month"></param>
         /// <returns></returns>
+        [Authorize]
         public List<StaffStatistics> CalMyStatistics(int year,int month, int? userid=null)
         {
             //object retList;
@@ -2611,6 +2626,7 @@ namespace wispro.sp.api.Controllers
         }
 
         [HttpGet,HttpPost]
+        [Authorize]
         public FileProcessTask ExportData(QueryFilter queryFilter)
         {
             var filename = $"{DateTime.Now.ToString("yyyyMMddhhmmss")}-绩效数据下载.xlsx";
@@ -2787,6 +2803,7 @@ namespace wispro.sp.api.Controllers
         }
 
         [HttpPost]
+        [Authorize]
         public ListApiResponse<PerformanceItem> QueryFilter(QueryFilter queryFilter)
         {
 
@@ -2935,7 +2952,7 @@ namespace wispro.sp.api.Controllers
 
             return response;
         }
-
+        [Authorize]
         public ApiSaveResponse AddProjectContents(ProjectContents projectContents)
         {
             ApiSaveResponse retResponse = new ApiSaveResponse();
@@ -3012,7 +3029,7 @@ namespace wispro.sp.api.Controllers
 
             return retResponse;
         }
-
+        [Authorize]
         public PerformanceItem GetCaseInfo(string CaseNo)
         {
             var retObj = Context.PerformanceItems.OrderByDescending(p=>p.CalMonthId).FirstOrDefault<PerformanceItem>(p=>p.CaseNo == CaseNo.Trim());
@@ -3025,7 +3042,7 @@ namespace wispro.sp.api.Controllers
             return retObj;
             
         }
-
+        [Authorize]
         public PerformanceItem GetItemInfo(string CaseNo, string DoItem)
         {
             var retObj = Context.PerformanceItems.FirstOrDefault<PerformanceItem>(p => p.CaseNo == CaseNo.Trim() && p.DoItem == DoItem.Trim());
@@ -3037,7 +3054,7 @@ namespace wispro.sp.api.Controllers
 
             return retObj;
         }
-
+        [Authorize]
         public PerformanceItem GetItemInfoByCaseStage(string CaseNo, string DoItem,string caseStage,bool UpdateFromIPEasy=true)
         {
             var retObj = Context.PerformanceItems.Include(p=>p.Customer).FirstOrDefault<PerformanceItem>(p => p.CaseNo == CaseNo.Trim() 
@@ -3203,8 +3220,184 @@ namespace wispro.sp.api.Controllers
             return retObj;
         }
 
-       
+        [Authorize]
+        public PerformanceItem GetItemInfoByCaseStage(string CaseNo, List<string> DoItems, string caseStage, bool UpdateFromIPEasy = true)
+        {
+            PerformanceItem retObj = null;
+            
+            foreach (var DoItem in DoItems)
+            {
+                retObj = Context.PerformanceItems.Include(p => p.Customer).FirstOrDefault<PerformanceItem>(p => p.CaseNo == CaseNo.Trim()
+                    && p.DoItem == DoItem.Trim() && p.CaseStage == caseStage);
+                if(retObj != null)
+                {
+                    break;
+                }
+            }
+            
+
+            if (retObj == null || UpdateFromIPEasy)
+            {
+                var temObj = wispro.sp.utility.IPEasyUtility.GetPerformanceRecord(CaseNo, DoItems, caseStage);
+                //var temObj = new Job.UpdateJXDataFromIPEasyJob().GetItemFromIPEasyDB(
+                //    new PerformanceItem() { CaseNo = CaseNo, DoItem = DoItem, CaseStage = caseStage },
+                //    Context
+                //    );// IPEasyUtility.GetPerformanceRecord(CaseNo, DoItem, caseStage);
+
+
+                System.Dynamic.ExpandoObject temExpandoObject = (System.Dynamic.ExpandoObject)temObj;
+
+                retObj = new PerformanceItem();
+                retObj.CaseNo = temObj.CaseNo.ToString();
+                retObj.CaseName = temObj.CaseName.ToString();
+
+                try
+                {
+                    if (((IDictionary<String, Object>)temObj).Keys.Contains("ApplicationType") && temObj.ApplicationType != null)
+                        retObj.ApplicationType = temObj.ApplicationType.ToString();
+
+                    if (((IDictionary<String, Object>)temObj).Keys.Contains("CaseMemo") && temObj.CaseMemo != null)
+                        retObj.CaseMemo = temObj.CaseMemo.ToString();
+
+                    if (((IDictionary<String, Object>)temObj).Keys.Contains("BusinessType") && temObj.BusinessType != null)
+                        retObj.BusinessType = temObj.BusinessType.ToString();
+
+                    if (temObj.DoItem != null)
+                        retObj.DoItem = temObj.DoItem.ToString();
+
+
+                    if (((IDictionary<String, Object>)temObj).Keys.Contains("CaseStage") && temObj.CaseStage != null)
+                        retObj.CaseStage = temObj.CaseStage.ToString();
+
+                    if (((IDictionary<String, Object>)temObj).Keys.Contains("CaseType") && temObj.CaseType != null)
+                        retObj.CaseType = temObj.CaseType.ToString();
+
+                    if (((IDictionary<String, Object>)temObj).Keys.Contains("DoItemState") && temObj.DoItemState != null)
+                        retObj.DoItemState = temObj.DoItemState.ToString();
+
+                    if (((IDictionary<String, Object>)temObj).Keys.Contains("DoItemCoefficient") && temObj.DoItemCoefficient != null)
+                        retObj.DoItemCoefficient = temObj.DoItemCoefficient.ToString();
+
+                    if (((IDictionary<String, Object>)temObj).Keys.Contains("CaseCoefficient") && temObj.CaseCoefficient != null)
+                        retObj.CaseCoefficient = temObj.CaseCoefficient.ToString();
+
+                    if (((IDictionary<String, Object>)temObj).Keys.Contains("EntrustingDate") && temObj.EntrustingDate != null)
+                    {
+                        if (!string.IsNullOrEmpty(temObj.EntrustingDate.ToString()))
+                            retObj.EntrustingDate = DateTime.Parse(temObj.EntrustingDate.ToString());
+                    }
+
+                    if (((IDictionary<String, Object>)temObj).Keys.Contains("Country") && temObj.Country != null)
+                    {
+                        retObj.Country = temObj.Country.ToString();
+                    }
+
+
+                    if (((IDictionary<String, Object>)temObj).Keys.Contains("InternalDate") && temObj.InternalDate != null)
+                    {
+                        if (!string.IsNullOrEmpty(temObj.InternalDate.ToString()))
+                            retObj.InternalDate = DateTime.Parse(temObj.InternalDate.ToString());
+                    }
+
+                    if (((IDictionary<String, Object>)temObj).Keys.Contains("CustomerLimitDate") && temObj.CustomerLimitDate != null)
+                    {
+                        if (!string.IsNullOrEmpty(temObj.CustomerLimitDate.ToString()))
+                            retObj.CustomerLimitDate = DateTime.Parse(temObj.CustomerLimitDate.ToString());
+                    }
+
+
+                    if (((IDictionary<String, Object>)temObj).Keys.Contains("ReturnDate") && temObj.ReturnDate != null)
+                    {
+                        if (!string.IsNullOrEmpty(temObj.ReturnDate.ToString()))
+                            retObj.ReturnDate = DateTime.Parse(temObj.ReturnDate.ToString());
+                    }
+
+                    if (((IDictionary<String, Object>)temObj).Keys.Contains("FinalizationDate") && temObj.FinalizationDate != null)
+                    {
+                        if (!string.IsNullOrEmpty(temObj.FinalizationDate.ToString()))
+                            retObj.FinalizationDate = DateTime.Parse(temObj.FinalizationDate.ToString());
+                    }
+                    if (((IDictionary<String, Object>)temObj).Keys.Contains("FinishedDate") && temObj.FinishedDate != null)
+                    {
+                        if (!string.IsNullOrEmpty(temObj.FinishedDate.ToString()))
+                            retObj.FinishedDate = DateTime.Parse(temObj.FinishedDate.ToString());
+                    }
+                }
+                catch { }
+
+                int temWordCount;
+
+                if (temObj.WordCount != null)
+                {
+                    if (int.TryParse(temObj.WordCount, out temWordCount))
+                    {
+                        retObj.WordCount = temWordCount;
+                    }
+                }
+
+                try
+                {
+                    if (temObj.CustomerName != null)
+                    {
+                        string strCustomer = temObj.CustomerName.ToString();
+                        retObj.Customer = new Customer() { Name = strCustomer };
+                        var temCustomer = Context.Customers.Where(c => c.Name == strCustomer.Trim()).FirstOrDefault();
+                        if (temCustomer != null)
+                        {
+                            retObj.CustomerId = temCustomer.Id;
+                        }
+                    }
+                }
+                catch { }
+
+                try
+                {
+                    if (temObj.Reviewer != null)
+                    {
+                        string strReViewer = temObj.Reviewer.ToString().Replace("-君龙", "");
+                        var temReviewer = Context.Staffs.Where(s => s.Name == strReViewer.Trim()).FirstOrDefault();
+                        if (temReviewer != null)
+                        {
+                            retObj.ReviewerId = temReviewer.Id;
+                        }
+                    }
+                }
+                catch { }
+
+                try
+                {
+                    if (temObj.WorkflowUser != null)
+                    {
+                        string strWorkflowUser = temObj.WorkflowUser.ToString().Replace("-君龙", "");
+                        var temReviewer = Context.Staffs.Where(s => s.Name == strWorkflowUser.Trim()).FirstOrDefault();
+                        if (temReviewer != null)
+                        {
+                            retObj.WorkflowUserId = temReviewer.Id;
+                        }
+                    }
+                }
+                catch { }
+
+                if (temObj.DoPersons != null)
+                {
+                    string DoPersons = temObj.DoPersons.ToString();
+
+                    string[] Persons = DoPersons.Split(new char[] { ',' });
+                    List<ItemStaff> itemStaffs = new List<ItemStaff>();
+                    foreach (var doPerson in Persons)
+                    {
+                        string strName = doPerson.Replace("-君龙", "");
+                        itemStaffs.Add(new ItemStaff() { DoPerson = new Staff() { Name = strName } });
+                    }
+                    retObj.ItemStaffs = itemStaffs;
+                }
 
+            }
+
+            return retObj;
+        }
+
+        [Authorize]
         public PerformanceItem GetItemInfoByMonthId(string CaseNo, string DoItem, string caseStage,int calMonthId)
         {
             var retObj = Context.PerformanceItems.Include(p => p.Customer).FirstOrDefault<PerformanceItem>(p => p.CaseNo == CaseNo.Trim()
@@ -3234,6 +3427,7 @@ namespace wispro.sp.api.Controllers
             }
         }
 
+        [Authorize]
         public bool MovePerformance2ProjectInfo()
         {
             var response = Context.PerformanceItems.Include(p=>p.ItemStaffs)
@@ -3756,6 +3950,7 @@ namespace wispro.sp.api.Controllers
         /// <param name="quarter">考核季度,取值为1、2、3、4</param>
         /// <param name="GradeCode">等级</param>
         /// <returns></returns>
+        [Authorize]
         public LevelStatisticsResult CalAgentLevel(int year,int quarter,string GradeCode)
         {
             LevelStatisticsResult result = new LevelStatisticsResult();
@@ -3834,6 +4029,7 @@ namespace wispro.sp.api.Controllers
         /// </summary>
         /// <param name="year"></param>
         /// <param name="month"></param>
+        [Authorize]
         public bool StatisticsLevelCount(int year,int month)
         {
             try
@@ -3861,5 +4057,21 @@ namespace wispro.sp.api.Controllers
             }
         }
         #endregion
+
+        #region 导入绩效数据
+        /// <summary>
+        /// 从维德系统中下载报表,并导入到绩效数据库中
+        /// </summary>
+        /// <param name="dataType">
+        /// 0:每月绩效统计--发客户超过一个月未完成案件
+        /// 1:每月绩效统计--上个月递交完成案件
+        /// 2:每月绩效统计--中国一次OA授权表
+        /// </param>
+        [HttpGet,HttpPost]
+        public void ImportJXData(int dataType)
+        {
+            new ImportReportJob().ImportData(dataType);
+        }
+        #endregion
     }
 }

+ 2 - 0
wispro.sp.api/Controllers/ProjectController.cs

@@ -171,6 +171,8 @@ namespace wispro.sp.api.Controllers
                             Id = (pcRecord.Project.Customer == null) ? 0 : pcRecord.Project.Customer.Id,
                         }
                     };
+
+                    pcRecord.Project = temProj;
                 }
 
                 if (pcRecord.ProjectWorkContents != null)

+ 14 - 14
wispro.sp.api/Controllers/StaffController.cs

@@ -217,21 +217,21 @@ namespace wispro.sp.api.Controllers
             retStaffs.Add("刘桂兰",new List<string>() { "程利", "周心志" });
             retStaffs.Add("张庆玲", new List<string>() { "贾凤涛" });
             retStaffs.Add("石惠", new List<string>() { "贾凤涛" });
-            retStaffs.Add("钟锦光", new List<string>() { "李庆波" });
-            retStaffs.Add("向鑫旭", new List<string>() { "李庆波" });
-            retStaffs.Add("张晓薇", new List<string>() { "李庆波" });
-            retStaffs.Add("杨超", new List<string>() { "李庆波" });
-            retStaffs.Add("沈靖俞", new List<string>() { "李庆波" });
-            retStaffs.Add("何丽", new List<string>() { "李庆波" });
+            retStaffs.Add("钟锦光", new List<string>() { "李庆波", "陈舒敏" });
+            retStaffs.Add("向鑫旭", new List<string>() { "李庆波", "陈舒敏" });
+            retStaffs.Add("张晓薇", new List<string>() { "李庆波", "陈舒敏" });
+            retStaffs.Add("杨超", new List<string>() { "李庆波", "陈舒敏" });
+            retStaffs.Add("沈靖俞", new List<string>() { "李庆波", "陈舒敏" });
+            retStaffs.Add("何丽", new List<string>() { "李庆波", "陈舒敏" });
             retStaffs.Add("管自英", new List<string>() { "王建峰" });
-            retStaffs.Add("唐双", new List<string>() { "钟子敏" });
-            retStaffs.Add("李申", new List<string>() { "钟子敏" });
-            retStaffs.Add("翁旋艺", new List<string>() { "钟子敏" });
-            retStaffs.Add("何倚雯", new List<string>() { "钟子敏" });
-            retStaffs.Add("陆跃", new List<string>() { "钟子敏" });
-            retStaffs.Add("李姣", new List<string>() { "钟子敏" });
-            retStaffs.Add("李建民", new List<string>() { "钟子敏" });
-            retStaffs.Add("赵静", new List<string>() { "钟子敏" });
+            retStaffs.Add("唐双", new List<string>() { "钟子敏","陈舒敏" });
+            retStaffs.Add("李申", new List<string>() { "钟子敏", "陈舒敏" });
+            retStaffs.Add("翁旋艺", new List<string>() { "钟子敏", "陈舒敏" });
+            retStaffs.Add("何倚雯", new List<string>() { "钟子敏", "陈舒敏" });
+            retStaffs.Add("陆跃", new List<string>() { "钟子敏", "陈舒敏" });
+            retStaffs.Add("李姣", new List<string>() { "钟子敏", "陈舒敏" });
+            retStaffs.Add("李建民", new List<string>() { "钟子敏", "陈舒敏" });
+            retStaffs.Add("赵静", new List<string>() { "钟子敏", "陈舒敏" });
             return retStaffs;
         }
 

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

@@ -69,6 +69,48 @@ namespace wispro.sp.api.Job
         
         spDbContext spDb = new spDbContext();
         
+        public Task ImportData(int i)
+        {
+            CalMonth calMonth = new CalMonth()
+            {
+                Year = DateTime.Now.AddMonths(-1).Year,
+                Month = DateTime.Now.AddMonths(-1).Month,
+                Status = 0
+            };
+
+
+            var temCalMonth = spDb.CalMonths.Where<CalMonth>(x => x.Year == calMonth.Year && x.Month == calMonth.Month).FirstOrDefault();
+
+            if (temCalMonth != null)
+            {
+
+                var iCount = spDb.PerformanceItems.Where<PerformanceItem>(p => p.CalMonthId == temCalMonth.Id).Count<PerformanceItem>();
+
+                calMonth = temCalMonth;
+            }
+            else
+            {
+
+                spDb.CalMonths.Add(calMonth);
+                spDb.SaveChanges();
+
+            }
+
+            switch (i)
+            {
+                case 0:
+                    DownloadReport_SQL("每月绩效统计--发客户超过一个月未完成案件", calMonth, false);
+                    break;
+                case 1:
+                    DownloadReport_SQL("每月绩效统计--上个月递交完成案件", calMonth, true);
+                    break; 
+                case 2:
+                    DownloadReport_SQL("每月绩效统计--中国一次OA授权表", calMonth, true, true);
+                    break;
+            }
+
+            return Task.CompletedTask;
+        }
         
         public Task Execute(IJobExecutionContext context)
         {

+ 11 - 2
wispro.sp.api/Job/UpdateJXDataFromIPEasyJob.cs

@@ -366,6 +366,13 @@ namespace wispro.sp.api.Job
                 Item.CaseType = retObj.CaseType;
             }
 
+            if (keyValuePairs.ContainsKey("CaseStage") && Item.CaseStage != retObj.CaseStage && !string.IsNullOrEmpty(retObj.CaseStage))
+            {
+                Item.CaseStage = retObj.CaseStage;
+            }
+
+
+
             if (spDb.Entry(Item).State != EntityState.Unchanged)
             {
                 if (Item.AgentFeedbackMemo != "特殊点数申诉")
@@ -470,6 +477,7 @@ namespace wispro.sp.api.Job
                 {
                     if (i < lastUpdate)
                     {
+                        i++;
                         continue;
                     }
 
@@ -484,8 +492,9 @@ namespace wispro.sp.api.Job
                         
 
                         Log($"{DateTime.Now}\t{++i}/{lstItem.Count}\t{Item.CaseNo}");
-                        System.Diagnostics.Debug.WriteLine($"{DateTime.Now}\t{i}/{lstItem.Count}\t{Item.CaseNo}");
+                        //System.Diagnostics.Debug.WriteLine($"{DateTime.Now}\t{i}/{lstItem.Count}\t{Item.CaseNo}");
                         //}
+                        save(i);
                     }
                     catch(Exception ex)
                     {
@@ -494,7 +503,7 @@ namespace wispro.sp.api.Job
                             goto TryAgain;
                         }
 
-                        System.Diagnostics.Debug.WriteLine(ex.ToString());
+                        //System.Diagnostics.Debug.WriteLine(ex.ToString());
                         Log($"{DateTime.Now}\t{++i}\t{Item.CaseNo}\r\n{ex.ToString()}");
                     }
                 }

+ 19 - 9
wispro.sp.api/Properties/launchSettings.json

@@ -1,13 +1,4 @@
 {
-  "iisSettings": {
-    "windowsAuthentication": false,
-    "anonymousAuthentication": true,
-    "iisExpress": {
-      "applicationUrl": "http://localhost:39476",
-      "sslPort": 0
-    }
-  },
-  "$schema": "http://json.schemastore.org/launchsettings.json",
   "profiles": {
     "IIS Express": {
       "commandName": "IISExpress",
@@ -25,6 +16,25 @@
         "ASPNETCORE_ENVIRONMENT": "Development"
       },
       "applicationUrl": "http://localhost:5000"
+    },
+    "WSL": {
+      "commandName": "WSL2",
+      "launchBrowser": true,
+      "launchUrl": "http://localhost:5000/api/Staff/getAll",
+      "environmentVariables": {
+        "ASPNETCORE_ENVIRONMENT": "Development",
+        "ASPNETCORE_URLS": "http://localhost:5000"
+      },
+      "distributionName": ""
+    }
+  },
+  "$schema": "http://json.schemastore.org/launchsettings.json",
+  "iisSettings": {
+    "windowsAuthentication": false,
+    "anonymousAuthentication": true,
+    "iisExpress": {
+      "applicationUrl": "http://localhost:39476",
+      "sslPort": 0
     }
   }
 }

+ 1 - 1
wispro.sp.api/Utility/Utility.cs

@@ -13,7 +13,7 @@ namespace wispro.sp.api.Utility
         public static void CalBasePoint(PerformanceItem item, List<BasePointRule> rules)
         {
             
-            if (item.CaseNo.ToUpper().StartsWith("S") || item.AgentFeedbackMemo == "特殊点数申诉")
+            if ((item.CaseNo.ToUpper().StartsWith("S") && item.Type=="专案") || item.AgentFeedbackMemo == "特殊点数申诉")
             {
                 return;
             }

+ 2 - 2
wispro.sp.api/appsettings.json

@@ -30,9 +30,9 @@
     "isHeadless": "true",
     "Account": "caiyangl",
     "Password": "j)wx*lier*@3",
-    "ChormeDriverPath": "D:\\source\\repos\\StaffPerformance\\packages\\ChormeDriver\\114.0.5735.90",
+    "ChormeDriverPath": "D:\\source\\repos\\StaffPerformance\\packages\\ChormeDriver\\120.0.6099.109",
     "ScheduleSetting": "00 55 15 16 * ? *",
-    "IPEasyWeb": "http://47.106.221.167/Login.aspx"
+    "IPEasyWeb": "http://47.106.94.35/Login.aspx"
   },
   "MailSetting": {
     "Server": "smtp.exmail.qq.com",

+ 1 - 1
wispro.sp.share/wispro.sp.share.csproj

@@ -6,7 +6,7 @@
   </PropertyGroup>
 
   <ItemGroup>
-    <PackageReference Include="AntDesign.ProLayout" Version="0.1.8" />
+    <PackageReference Include="AntDesign.ProLayout" Version="0.1.10" />
     <PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.9" />
   </ItemGroup>
 

+ 368 - 16
wispro.sp.utility/IPEasyUtility.cs

@@ -1,12 +1,16 @@
 using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
 using System.Data;
 using System.Diagnostics;
 using System.Dynamic;
 using System.IO;
 using System.Linq;
+using System.Threading;
 using OpenQA.Selenium;
 using OpenQA.Selenium.Chrome;
 using OpenQA.Selenium.Support.Extensions;
+using OpenQA.Selenium.Support.UI;
 
 namespace wispro.sp.utility
 {
@@ -336,13 +340,13 @@ namespace wispro.sp.utility
 
             dynamic retObject = new ExpandoObject();
 
-            retObject.CaseNo = caseNo.Trim();
+             retObject.CaseNo = caseNo.Trim();
 
             using (IWebDriver driver = new OpenQA.Selenium.Chrome.ChromeDriver(ConfigHelper.GetSectionValue("IPEasySetting:ChormeDriverPath"), options))
             {
                 try
                 {
-                    driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(10);
+                    driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(5);
                     driver.Manage().Timeouts().PageLoad = TimeSpan.FromSeconds(100);
 
                     //进入登录界面
@@ -358,6 +362,17 @@ namespace wispro.sp.utility
                     //关闭提示遮罩层
                     driver.FindElement(By.Id("jpwClose")).Click();
 
+                    try
+                    {
+                        var okBtn = driver.FindElement(By.ClassName("ui_state_highlight"));
+                        if (okBtn != null && okBtn.TagName == "input")
+                        {
+                            okBtn.Click();
+                        }
+                    }
+                    catch { }
+                    
+
                     //点击顶部菜单栏中的案件管理菜单
                     driver.FindElement(By.Name("71A7CC35-F597-40E1-9FEF-BE622A3A3B63")).Click();
 
@@ -375,11 +390,27 @@ namespace wispro.sp.utility
 
                     var caseLink = driver.FindElement(By.XPath($"//a[contains(text(),'{caseNo}')]"));
                     caseLink.Click();
-                    System.Threading.Thread.Sleep(500);
 
                     driver.SwitchTo().ParentFrame().SwitchTo().Frame(2);
 
-                    driver.FindElement(By.Id("libase")).Click();
+                    WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(20));
+                    //等待页面上ID属性值为submitButton的元素加载完成
+                    IWebElement myElement = wait.Until((d) =>
+                    {
+                        try
+                        {
+                            driver.SwitchTo().ParentFrame().SwitchTo().Frame(2);
+                            return d.FindElement(By.Id("libase"));
+                        }
+                        catch {
+                            return null;
+                        }
+                        
+                    });
+
+                    myElement.Click();
+                    //driver.FindElement(By.Id("libase")).Click();
+
                     retObject.CaseName = driver.FindElement(By.Id("p_case_info__case_name")).GetAttribute("value");  //案件名称
                     retObject.CustomerName = driver.FindElement(By.Id("p_case_info__customer_id")).GetAttribute("value");  //客户名称
                     retObject.BusinessType = driver.FindElement(By.Id("p_case_info__business_type_id")).GetAttribute("value");     //业务类型
@@ -409,6 +440,257 @@ namespace wispro.sp.utility
 
             return retObject;
         }
+
+        public static dynamic GetPerformanceRecord(string caseNo, List<string> doItemNames, string caseStage = null)
+        {
+            string strFileSavePath = ConfigHelper.GetSectionValue("IPEasySetting:DownloadFileSavePath");
+            bool isheadless = (ConfigHelper.GetSectionValue("IPEasySetting:isHeadless") == "true");
+            string Account = ConfigHelper.GetSectionValue("IPEasySetting:Account");
+            string Password = ConfigHelper.GetSectionValue("IPEasySetting:Password");
+
+            OpenQA.Selenium.Chrome.ChromeOptions options = new OpenQA.Selenium.Chrome.ChromeOptions();
+
+
+            options.AddUserProfilePreference("download.default_directory", strFileSavePath);
+            options.AddUserProfilePreference("intl.accept_languages", "nl");
+            options.AddUserProfilePreference("disable-popup-blocking", "true");
+            options.AddUserProfilePreference("profile", new { default_content_setting_values = new { images = 2 } });
+
+            if (isheadless)
+            {
+                options.AddArgument("headless");
+            }
+
+            dynamic retObject = new ExpandoObject();
+
+            retObject.CaseNo = caseNo.Trim();
+            //retObject.DoItem = doItemName;
+
+            using (var Service = ChromeDriverService.CreateDefaultService(ConfigHelper.GetSectionValue("IPEasySetting:ChormeDriverPath")))
+            {
+
+                Service.Start();
+                using (IWebDriver driver = new OpenQA.Selenium.Chrome.ChromeDriver(Service, options))
+                {
+                    try
+                    {
+                        driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(20);
+                        driver.Manage().Timeouts().PageLoad = TimeSpan.FromSeconds(100);
+                        //driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(100);
+                        WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(20));
+
+                        //进入登录界面
+                        driver.Navigate().GoToUrl(ConfigHelper.GetSectionValue("IPEasySetting:IPEasyWeb"));
+
+                        //输入用户名和密码
+                        driver.FindElement(By.Id("txtUser")).SendKeys(Account);
+                        driver.FindElement(By.Id("txtPwd")).SendKeys(Password);
+
+                        //点击登录按钮
+                        driver.FindElement(By.Id("btnLogin")).Click();
+
+                        //关闭提示遮罩层
+                        driver.FindElement(By.Id("jpwClose")).Click();
+
+                        //try
+                        //{
+                        //    var okBtn = driver.FindElement(By.ClassName("ui_state_highlight"));
+                        //    if (okBtn != null && okBtn.TagName == "input")
+                        //    {
+                        //        okBtn.Click();
+                        //    }
+                        //}
+                        //catch { }
+
+                        //点击顶部菜单栏中的案件管理菜单
+                        driver.FindElement(By.Name("71A7CC35-F597-40E1-9FEF-BE622A3A3B63")).Click();
+                        System.Threading.Thread.Sleep(500);
+
+                        //点击左侧 查询 菜单
+                        driver.FindElement(By.Name("c3266ab3-521a-4815-8aaf-7dd0bc5a76af")).Click();
+
+
+                        //System.Threading.Thread.Sleep(500);
+                        var inputSearch = wait.Until((d) =>
+                        {
+                            try
+                            {
+                                //切换到自定义报表Frame
+                                d.SwitchTo().Frame(1);
+                                return d.FindElement(By.Id("case_volume"));
+                            }
+                            catch
+                            {
+                                return null;
+                            }
+
+                        });
+                        //切换到自定义报表Frame
+                        //driver.SwitchTo().Frame(1);
+
+                        //var inputSearch = driver.FindElement(By.Id("case_volume"));
+                        inputSearch.SendKeys(caseNo.Trim());
+
+                        var btnSearch = driver.FindElement(By.Id("btn_Search"));
+                        btnSearch.Click();
+
+                        var caseLink = wait.Until((d) =>
+                        {
+                            try
+                            {
+                                return d.FindElement(By.XPath($"//a[normalize-space()='{caseNo.Trim()}']"));
+                            }
+                            catch
+                            {
+                                return null;
+                            }
+
+                        });
+                        //System.Threading.Thread.Sleep(500);
+
+                        //var caseLink = driver.FindElement(By.XPath($"//a[normalize-space()='{caseNo.Trim()}']"));
+                        caseLink.Click();
+                        System.Threading.Thread.Sleep(500);
+
+                        driver.SwitchTo().ParentFrame().SwitchTo().Frame(2);
+                        IWebElement temDoItemLink = null;
+                        foreach (string doItemName in doItemNames)
+                        {
+                            var DoItemLinks = driver.FindElements(By.XPath($"//td[@colname='ctrl_proc'][normalize-space()='{doItemName}']"));
+                            if (DoItemLinks.Count > 0)
+                            {
+                                if (!string.IsNullOrEmpty(caseStage))
+                                {
+                                    foreach (var DoItemLink in DoItemLinks)
+                                    {
+                                        var temCaseStage = DoItemLink.FindElement(By.XPath("following-sibling::td[1]")).Text;
+                                        if (temCaseStage == caseStage)
+                                        {
+                                            retObject.CaseStage = DoItemLink.FindElement(By.XPath("following-sibling::td[1]")).Text; //案件阶段
+                                            retObject.DoItemState = DoItemLink.FindElement(By.XPath("following-sibling::td[2]")).Text;    //处理事项处理状态
+                                            retObject.InternalDate = DoItemLink.FindElement(By.XPath("following-sibling::td[4]")).Text;   //内部期限
+                                            retObject.CustomerLimitDate = DoItemLink.FindElement(By.XPath("following-sibling::td[5]")).Text;   //客户期限
+                                            retObject.FinishedDate = DoItemLink.FindElement(By.XPath("following-sibling::td[7]")).Text;   //处理事项完成日
+                                            retObject.DoPersons = DoItemLink.FindElement(By.XPath("following-sibling::td[8]")).Text;   //处理人
+                                            retObject.DoItemMemo = DoItemLink.FindElement(By.XPath("following-sibling::td[9]")).Text;   //处理事项备注
+                                            retObject.Reviewer = DoItemLink.FindElement(By.XPath("following-sibling::td[10]")).Text;   //核稿人
+
+                                            System.Threading.Thread.Sleep(4000);
+                                            temDoItemLink = DoItemLink;
+                                            //driver.ExecuteJavaScript("$(arguments[0]).click()", DoItemLink);
+                                            break;
+                                        }
+                                    }
+                                }
+                                else
+                                {
+                                    var DoItemLink = DoItemLinks[DoItemLinks.Count - 1];
+                                    retObject.CaseStage = DoItemLink.FindElement(By.XPath("following-sibling::td[1]")).Text; //案件阶段
+                                    retObject.DoItemState = DoItemLink.FindElement(By.XPath("following-sibling::td[2]")).Text;    //处理事项处理状态
+                                    retObject.InternalDate = DoItemLink.FindElement(By.XPath("following-sibling::td[4]")).Text;   //内部期限
+                                    retObject.CustomerLimitDate = DoItemLink.FindElement(By.XPath("following-sibling::td[5]")).Text;   //客户期限
+                                    retObject.FinishedDate = DoItemLink.FindElement(By.XPath("following-sibling::td[7]")).Text;   //处理事项完成日
+                                    retObject.DoPersons = DoItemLink.FindElement(By.XPath("following-sibling::td[8]")).Text;   //处理人
+                                    retObject.DoItemMemo = DoItemLink.FindElement(By.XPath("following-sibling::td[9]")).Text;   //处理事项备注
+                                    retObject.Reviewer = DoItemLink.FindElement(By.XPath("following-sibling::td[10]")).Text;   //核稿人
+
+                                    
+
+                                    temDoItemLink = DoItemLink;
+                                    //new WebDriverWait(driver, TimeSpan.FromSeconds(20)).Until(ExpectedConditions.ElementToBeClickable(DoItemLink)).Click();
+
+                                }
+
+                                retObject.DoItem = doItemName;
+                                break;
+                            }
+
+                        }
+
+                        if(temDoItemLink != null)
+                        {
+                            System.Threading.Thread.Sleep(4000);
+                            temDoItemLink.Click();
+                        }
+                        else
+                        {
+                            throw new ApplicationException("处理事项不存在!");
+                        }
+
+                        var p_proc_finish_doc_date = wait.Until((d) =>
+                        {
+                            try
+                            {
+                                return d.FindElement(By.Id("p_proc_info__finish_doc_date"));
+                            }
+                            catch
+                            {
+                                return null;
+                            }
+
+                        });
+                        //System.Threading.Thread.Sleep(500);
+
+                        retObject.FinalizationDate = p_proc_finish_doc_date.GetAttribute("value");   //定稿日
+                        retObject.ReturnDate = driver.FindElement(By.Id("p_proc_info__back_date")).GetAttribute("value");               //返稿日
+                        retObject.Reviewer = driver.FindElement(By.Id("p_proc_info__revise_user")).GetAttribute("value");               //核稿人
+                        retObject.DoItemCoefficient = driver.FindElement(By.Id("p_proc_info__proc_coefficient")).GetAttribute("value"); //处理事项系数
+                        retObject.WordCount = driver.FindElement(By.Id("p_proc_info__translate_count")).GetAttribute("value");          //翻译字数
+
+
+                        driver.FindElement(By.Id("libase")).Click();
+
+                        var p_case_info__case_name = wait.Until((d) =>
+                        {
+                            try
+                            {
+                                return d.FindElement(By.Id("p_case_info__case_name"));
+                            }
+                            catch
+                            {
+                                return null;
+                            }
+
+                        });
+                        //System.Threading.Thread.Sleep(500);
+                        retObject.CaseName = p_case_info__case_name.GetAttribute("value");  //案件名称
+                        retObject.CustomerName = driver.FindElement(By.Id("p_case_info__customer_id")).GetAttribute("value");  //客户名称
+                        retObject.BusinessType = driver.FindElement(By.Id("p_case_info__business_type_id")).GetAttribute("value");     //业务类型
+
+                        retObject.CaseState = GetSelectText(driver.FindElement(By.Id("p_case_info__case_status_id")));
+                        retObject.ApplicationType = GetSelectText(driver.FindElement(By.Id("p_case_info__apply_type_id")));
+
+
+                        retObject.CaseType = driver.FindElement(By.Id("p_case_info__case_type_id")).GetAttribute("value");  //案件类型
+                        retObject.EntrustingDate = driver.FindElement(By.Id("p_case_info__charge_date")).GetAttribute("value"); //委案日期
+                        retObject.CaseMemo = driver.FindElement(By.Id("p_case_info__remark")).GetAttribute("value");    //案件备注
+
+                        driver.FindElement(By.XPath($"//span[contains(text(),'扩展信息')]")).Click();
+                        //select[@id='p_case_info__case_coefficient_id']
+                        retObject.CaseCoefficient = GetSelectText(driver.FindElement(By.Id("p_case_info__case_coefficient_id")));
+
+
+
+                    }
+                    catch (Exception ex)
+                    {
+                        throw new Exception(ex.Message, ex);
+                    }
+                    finally
+                    {
+                        driver.Quit();
+
+                        killChromProcess();
+
+                    }
+                }
+
+                Service.Dispose();
+            }
+
+            return retObject;
+        }
+
         /// <summary>
         /// 获取案件处理事项记录
         /// </summary>
@@ -448,9 +730,10 @@ namespace wispro.sp.utility
                 {
                     try
                     {
-                        driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(10);
+                        driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(20);
                         driver.Manage().Timeouts().PageLoad = TimeSpan.FromSeconds(100);
-
+                        //driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(100);
+                        WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(20));
 
                         //进入登录界面
                         driver.Navigate().GoToUrl(ConfigHelper.GetSectionValue("IPEasySetting:IPEasyWeb"));
@@ -465,24 +748,63 @@ namespace wispro.sp.utility
                         //关闭提示遮罩层
                         driver.FindElement(By.Id("jpwClose")).Click();
 
+                        //try
+                        //{
+                        //    var okBtn = driver.FindElement(By.ClassName("ui_state_highlight"));
+                        //    if (okBtn != null && okBtn.TagName == "input")
+                        //    {
+                        //        okBtn.Click();
+                        //    }
+                        //}
+                        //catch { }
+
                         //点击顶部菜单栏中的案件管理菜单
                         driver.FindElement(By.Name("71A7CC35-F597-40E1-9FEF-BE622A3A3B63")).Click();
                         System.Threading.Thread.Sleep(500);
 
                         //点击左侧 查询 菜单
                         driver.FindElement(By.Name("c3266ab3-521a-4815-8aaf-7dd0bc5a76af")).Click();
-                        System.Threading.Thread.Sleep(500);
+
+                        
+                        //System.Threading.Thread.Sleep(500);
+                        var inputSearch = wait.Until((d) =>
+                        {
+                            try
+                            {
+                                //切换到自定义报表Frame
+                                d.SwitchTo().Frame(1);
+                                return d.FindElement(By.Id("case_volume"));
+                            }
+                            catch
+                            {
+                                return null;
+                            }
+
+                        });
                         //切换到自定义报表Frame
-                        driver.SwitchTo().Frame(1);
+                        //driver.SwitchTo().Frame(1);
 
-                        var inputSearch = driver.FindElement(By.Id("case_volume"));
+                        //var inputSearch = driver.FindElement(By.Id("case_volume"));
                         inputSearch.SendKeys(caseNo.Trim());
 
                         var btnSearch = driver.FindElement(By.Id("btn_Search"));
                         btnSearch.Click();
-                        System.Threading.Thread.Sleep(500);
 
-                        var caseLink = driver.FindElement(By.XPath($"//a[normalize-space()='{caseNo.Trim()}']"));
+                        var caseLink = wait.Until((d) =>
+                        {
+                            try
+                            {
+                                return d.FindElement(By.XPath($"//a[normalize-space()='{caseNo.Trim()}']"));
+                            }
+                            catch
+                            {
+                                return null;
+                            }
+
+                        });
+                        //System.Threading.Thread.Sleep(500);
+
+                        //var caseLink = driver.FindElement(By.XPath($"//a[normalize-space()='{caseNo.Trim()}']"));
                         caseLink.Click();
                         System.Threading.Thread.Sleep(500);
 
@@ -506,7 +828,9 @@ namespace wispro.sp.utility
                                         retObject.DoItemMemo = DoItemLink.FindElement(By.XPath("following-sibling::td[9]")).Text;   //处理事项备注
                                         retObject.Reviewer = DoItemLink.FindElement(By.XPath("following-sibling::td[10]")).Text;   //核稿人
 
+                                        System.Threading.Thread.Sleep(4000);
                                         DoItemLink.Click();
+                                        //driver.ExecuteJavaScript("$(arguments[0]).click()", DoItemLink);
                                         break;
                                     }
                                 }
@@ -523,14 +847,29 @@ namespace wispro.sp.utility
                                 retObject.DoItemMemo = DoItemLink.FindElement(By.XPath("following-sibling::td[9]")).Text;   //处理事项备注
                                 retObject.Reviewer = DoItemLink.FindElement(By.XPath("following-sibling::td[10]")).Text;   //核稿人
 
-
+                                System.Threading.Thread.Sleep(4000);
+                                
                                 DoItemLink.Click();
+                                //new WebDriverWait(driver, TimeSpan.FromSeconds(20)).Until(ExpectedConditions.ElementToBeClickable(DoItemLink)).Click();
+                                
                             }
                         }
 
-                        System.Threading.Thread.Sleep(500);
+                        var p_proc_finish_doc_date = wait.Until((d) =>
+                        {
+                            try
+                            {
+                                return d.FindElement(By.Id("p_proc_info__finish_doc_date"));
+                            }
+                            catch
+                            {
+                                return null;
+                            }
 
-                        retObject.FinalizationDate = driver.FindElement(By.Id("p_proc_info__finish_doc_date")).GetAttribute("value");   //定稿日
+                        });
+                        //System.Threading.Thread.Sleep(500);
+
+                        retObject.FinalizationDate = p_proc_finish_doc_date.GetAttribute("value");   //定稿日
                         retObject.ReturnDate = driver.FindElement(By.Id("p_proc_info__back_date")).GetAttribute("value");               //返稿日
                         retObject.Reviewer = driver.FindElement(By.Id("p_proc_info__revise_user")).GetAttribute("value");               //核稿人
                         retObject.DoItemCoefficient = driver.FindElement(By.Id("p_proc_info__proc_coefficient")).GetAttribute("value"); //处理事项系数
@@ -538,8 +877,21 @@ namespace wispro.sp.utility
 
 
                         driver.FindElement(By.Id("libase")).Click();
-                        System.Threading.Thread.Sleep(500);
-                        retObject.CaseName = driver.FindElement(By.Id("p_case_info__case_name")).GetAttribute("value");  //案件名称
+
+                        var p_case_info__case_name = wait.Until((d) =>
+                        {
+                            try
+                            {
+                                return d.FindElement(By.Id("p_case_info__case_name"));
+                            }
+                            catch
+                            {
+                                return null;
+                            }
+
+                        });
+                        //System.Threading.Thread.Sleep(500);
+                        retObject.CaseName = p_case_info__case_name.GetAttribute("value");  //案件名称
                         retObject.CustomerName = driver.FindElement(By.Id("p_case_info__customer_id")).GetAttribute("value");  //客户名称
                         retObject.BusinessType = driver.FindElement(By.Id("p_case_info__business_type_id")).GetAttribute("value");     //业务类型
 

+ 1 - 1
wispro.sp.utility/wispro.sp.utility.csproj

@@ -13,7 +13,7 @@
     <PackageReference Include="MailKit" Version="2.15.0" />
     <PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="5.0.10" />
     <PackageReference Include="Microsoft.Extensions.Configuration" Version="5.0.0" />
-    <PackageReference Include="NPOI" Version="2.5.4" />
+    <PackageReference Include="NPOI" Version="2.6.2" />
     <PackageReference Include="Selenium.Chrome.WebDriver" Version="85.0.0" />
     <PackageReference Include="Selenium.Support" Version="4.0.1" />
     <PackageReference Include="Selenium.WebDriver" Version="4.0.1" />

+ 10 - 0
wispro.sp.web/Components/CreateAppeal.razor.cs

@@ -118,6 +118,16 @@ namespace wispro.sp.web.Components
             //if(!string.IsNullOrEmpty(_Model.AppealType.ReviewerExpress))
             //{
                 _Staffs =await _UserService.GetReviewers(_Model.AppealRecord.ItemId, _Model.AppealType.Id);
+                
+                if (!string.IsNullOrWhiteSpace(warningMessage) && _Model.AppealType.Name == "案件系数复核")
+                {
+                    var zzmList = _Staffs.Where<Staff>(s => s.Name == "钟子敏");
+                    if (zzmList==null || zzmList.Count() == 0)
+                    {
+                        _Staffs.Add(await _UserService.GetUserByName("钟子敏"));
+                    }
+               
+                }
             //}
             //else
             //{

+ 21 - 0
wispro.sp.web/Services/UserService.cs

@@ -25,6 +25,8 @@ namespace wispro.sp.web.Services
         Task<List<Staff>> GetReviewers(int? itemId, int appealTypeId);
 
         Task<Staff> GetUser(int staffId);
+
+        Task<Staff> GetUserByName(string Name);
     }
 
     public class UserService : IUserService
@@ -133,5 +135,24 @@ namespace wispro.sp.web.Services
             }
         }
 
+        public async Task<Staff> GetUserByName(string Name)
+        {
+            try
+            {
+                var staff = await _httpClient.Get<Staff>($"Staff/GetByName?Name={Name}");
+                return staff;
+            }
+            catch (Exception ex)
+            {
+                if (ex.Message.Contains("Unauthorized"))
+                {
+                    _jwt.NotifyUserLogOut();
+                }
+
+                return null;
+
+            }
+        }
+
     }
 }

+ 1 - 1
wispro.sp.winClient/Form1.Designer.cs

@@ -124,7 +124,7 @@ namespace wispro.sp.winClient
             this.button8.Name = "button8";
             this.button8.Size = new System.Drawing.Size(202, 52);
             this.button8.TabIndex = 1;
-            this.button8.Text = "更新绩效数据";
+            this.button8.Text = "测试IPEasy";
             this.button8.UseVisualStyleBackColor = true;
             this.button8.Click += new System.EventHandler(this.button8_ClickAsync);
             // 

+ 10 - 2
wispro.sp.winClient/Form1.cs

@@ -961,7 +961,7 @@ namespace wispro.sp.winClient
             return retStr;
         }
 
-        string strAPIBaseUri = "http://1.116.113.26:81";//"http://localhost:39476";// "http://localhost:8080"; //   "http://47.106.221.167:8081"; //  
+        string strAPIBaseUri = "http://localhost:8080"; // "http://1.116.113.26:81";//   "http://47.106.221.167:8081"; //  
 
         userToken Token;
 
@@ -1465,12 +1465,20 @@ namespace wispro.sp.winClient
 
         private async void button8_ClickAsync(object sender, EventArgs e)
         {
+            //var caseInfo= IPEasyUtility.GetCaseInfo("PAEPO2213258-标准A+级-结案");
+            IPEasyUtility.GetPerformanceRecord("PAEPO2213258-标准A+级-结案", "欧洲案答辩");
+            return;
+
+            var downloader = new IPEasyDownloader();
+            downloader.login("caiyangl","j)wx*lier*@3");
+            downloader.Search("PACN2023");
+            return;
             //await RefreshPerformanceItem(1);
 
             //await RefreshPerformanceItem(2);
 
             //await RefreshPerformanceItem(3);
-            for(int i=0; i<10; i++)
+            for (int i=0; i<10; i++)
             {
                 save(i);
             }

ファイルの差分が大きいため隠しています
+ 67 - 0
wispro.sp.winClient/IPEasyDownloader.cs


+ 2 - 2
wispro.sp.winClient/appsettings.json

@@ -4,9 +4,9 @@
     "isHeadless": "false",
     "Account": "caiyangl",
     "Password": "j)wx*lier*@3",
-    "ChormeDriverPath": "D:\\source\\repos\\StaffPerformance\\packages\\ChormeDriver\\114.0.5735.90",
+    "ChormeDriverPath": "D:\\source\\repos\\StaffPerformance\\packages\\ChormeDriver\\119.0.6045.105",
     "ScheduleSetting": "00 55 10 3 * ? *",
-    "IPEasyWeb": "http://47.106.221.167/Login.aspx"
+    "IPEasyWeb": "http://47.106.94.35/Login.aspx"
   },
   "MailSetting": {
     "Server": "smtp.exmail.qq.com",

+ 12 - 0
wispro.sp.winClient/wispro.sp.winClient.csproj

@@ -15,6 +15,18 @@
     <Platforms>AnyCPU;x64;x86</Platforms>
   </PropertyGroup>
 
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
+    <Optimize>True</Optimize>
+  </PropertyGroup>
+
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <Optimize>True</Optimize>
+  </PropertyGroup>
+
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x86'">
+    <Optimize>True</Optimize>
+  </PropertyGroup>
+
   <ItemGroup>
     <None Remove="appsettings.json" />
     <None Remove="ExcelFiles\20210903-威世博常用绩效点数计算规则-v2-lcy.xls" />