Ver Fonte

添加客户修改权要前10案件通知部长、审核人、客户对接人
所有案件收件人添加姝然
申诉审核人添加姝然
宁德时代案件超时申诉审核时由审核人确认超时天数

luocaiyang há 6 meses atrás
pai
commit
cbda56bb65

+ 284 - 61
wispro.sp.api/Controllers/CaseFileCompareController.cs

@@ -8,6 +8,8 @@ using Microsoft.AspNetCore.Mvc;
 using Microsoft.EntityFrameworkCore;
 using Microsoft.EntityFrameworkCore.Query;
 using Microsoft.EntityFrameworkCore.Query.SqlExpressions;
+using NPOI.OpenXmlFormats.Vml.Spreadsheet;
+using NPOI.OpenXmlFormats.Wordprocessing;
 using System;
 using System.Collections;
 using System.Collections.Generic;
@@ -680,6 +682,85 @@ namespace wispro.sp.api.Controllers
             }
         }
 
+        private class retObject
+        {
+            public string CaseNo { get; set; }
+            public string CaseName { get; set; }
+
+            public string Customer { get; set; }
+            public string Handers { get; set; }
+
+
+            public string Reviewer { get; set; }
+
+            public double? InternalSim { get; set; }
+
+            public double? InternalAvg { get; set; }
+
+            public double? InternalStd { get; set; }
+
+            public double? InternalScore { get; set; }
+
+            public double? CustomerSim { get; set; }
+
+            public double? CustomerAvg { get; set; }
+
+            public double? CustomerStd { get; set; }
+
+            public double? CustomerScore { get; set; }
+
+            public string Memo { get; set; }
+
+            public DateTime? FinishedDate { get; set; }
+
+        }
+
+        private DataTable  CoverttoDatable(List<retObject> ObjList)
+        {
+            System.Data.DataTable dt = new System.Data.DataTable();
+            dt.Columns.Add("我方文号");
+            dt.Columns.Add("案件名称");
+            dt.Columns.Add("客户");
+            dt.Columns.Add("处理人");
+            dt.Columns.Add("核稿人");
+            dt.Columns.Add("内部核稿权要差异度");
+            dt.Columns.Add("内部客户平均值");
+            dt.Columns.Add("内部客户标准偏差");
+            dt.Columns.Add("内部核稿分数");
+            dt.Columns.Add("外部核稿权要差异度");
+            dt.Columns.Add("外部客户平均值");
+            dt.Columns.Add("外部客户标准偏差");
+            dt.Columns.Add("外部核稿分数");
+            dt.Columns.Add("备注");
+
+            foreach (var temObj in ObjList)
+            {
+                DataRow row = dt.NewRow();
+
+                row["我方文号"] = temObj.CaseNo;
+                row["案件名称"] = temObj.CaseName;
+                row["客户"] = temObj.Customer;
+                row["核稿人"] = temObj.Reviewer;
+                row["处理人"] = temObj.Handers;
+
+                row["内部核稿分数"] = temObj.InternalScore;
+
+                row["内部核稿权要差异度"] = temObj.InternalSim;
+                row["内部客户平均值"] = temObj.InternalAvg;
+                row["内部客户标准偏差"] = temObj.InternalStd;
+                row["内部核稿分数"] = temObj.InternalScore;
+
+                row["外部核稿权要差异度"] = temObj.CustomerSim;
+                row["外部客户平均值"] = temObj.CustomerAvg;
+                row["外部客户标准偏差"] = temObj.CustomerStd;
+                row["外部核稿分数"] = temObj.CustomerScore;
+                row["备注"] = temObj.Memo;
+
+                dt.Rows.Add(row);
+            }
+
+            return dt;
+        }
         /// <summary>
         /// 计算案件的zScore
         /// </summary>
@@ -693,12 +774,11 @@ namespace wispro.sp.api.Controllers
         /// 4: 基于权要文字修改差异度计算
         /// </param>
         /// <returns></returns>
-        public IList<Object> CalCustomer_mean(DateTime start,DateTime end,int type=0)
+        private IList<retObject> CalCustomer_mean(DateTime start,DateTime end,int type=0)
         {
-            
 
             var caseList = Context.CaseInfos.Where<CaseInfo>(
-                p => p.FinalVersionDate >= start && p.FinalVersionDate <= end)
+                p => p.CreateTime >= start && p.CreateTime < end)
                 .Include(p=>p.Customer)
                 .Include(p=>p.Reviewer)
                 .Include(p=>p.DRRAbstract)
@@ -714,7 +794,7 @@ namespace wispro.sp.api.Controllers
             int iTotals = caseList.Count();
             int iIndex = 0;
 
-            List<Object> retList = new List<Object>();
+            List<retObject> retList = new List<retObject>();
 
             #region 计算客户相似度平均值和标准方差
             List<CustomerAvg_Std> avg_std1 = new List<CustomerAvg_Std>();
@@ -759,26 +839,9 @@ namespace wispro.sp.api.Controllers
             }
             #endregion
 
-            System.Data.DataTable dt = new System.Data.DataTable();
-            dt.Columns.Add("我方文号");
-            dt.Columns.Add("案件名称");
-            dt.Columns.Add("客户");
-            dt.Columns.Add("处理人");
-            dt.Columns.Add("核稿人");
-            dt.Columns.Add("内部核稿相似度或差异度");
-            dt.Columns.Add("内部客户平均值");
-            dt.Columns.Add("内部客户标准偏差");
-            dt.Columns.Add("内部核稿分数");
-
-            dt.Columns.Add("外部核稿相似度或差异度");
-            dt.Columns.Add("外部客户平均值");
-            dt.Columns.Add("外部客户标准偏差");
-            dt.Columns.Add("外部核稿分数");
-
-            dt.Columns.Add("备注");
-
             foreach (var item in caseList)
             {
+                retObject temObj = new retObject();
                 string tmpCustomerName = "未知";
                 if (item.Customer != null)
                 {
@@ -788,38 +851,42 @@ namespace wispro.sp.api.Controllers
                 var two = avg_std2.Where<CustomerAvg_Std>(p => p.Name == tmpCustomerName).FirstOrDefault();
 
                 double? oneSim = getCalValue(item,type,0);
-                double? twoSim = getCalValue(item, type, 1); ;
+                double? twoSim = getCalValue(item, type, 1);
+                temObj.FinishedDate = item.CreateTime;
+
+                temObj.CaseNo = item.CaseNo;
+                temObj.CaseName = item.CaseName;
+                temObj.Customer = item.Customer?.Name;
+                temObj.Reviewer = item.Reviewer?.Name;
+                temObj.Handers = item.Handlers;
 
-                DataRow row = dt.NewRow();
-                row["我方文号"] = item.CaseNo;
-                row["案件名称"] = item.CaseName;
-                row["客户"] = item.Customer?.Name;
-                row["核稿人"] = item.Reviewer?.Name;
-                row["处理人"] = item.Handlers;
                 double? zScoreA = null;
                 if (oneSim != null)
                 {
                     zScoreA = (oneSim - one.Average) / one.Std_Deviation;
                     
                 }
-                row["内部核稿分数"] = zScoreA;
 
-                row["内部核稿相似度或差异度"] = oneSim;
-                row["内部客户平均值"] = one.Average;
-                row["内部客户标准偏差"] = one.Std_Deviation;
+                temObj.InternalScore = zScoreA;
+                temObj.InternalSim = oneSim;
+                temObj.InternalAvg = one.Average;
+                temObj.InternalStd = one.Std_Deviation;
                 
-                row["外部核稿相似度或差异度"] = twoSim;
-                row["外部客户平均值"] = two.Average;
-                row["外部客户标准偏差"] = two.Std_Deviation;
-
                 double? zScoreB = null;
                 if (twoSim != null)
                 {
                     zScoreB = (twoSim - two.Average) / two.Std_Deviation;
                     
                 }
-                row["外部核稿分数"] = zScoreB;
+                temObj.CustomerSim = twoSim;
+                temObj.CustomerAvg = two.Average;
+                temObj.CustomerStd = two.Std_Deviation;
+                temObj.CustomerScore = zScoreB;
+
+                string strMemo = "";
 
+                zScoreA = (zScoreA == null) ? 0 : zScoreA;
+                zScoreB = (zScoreB == null) ? 0 : zScoreB;
                 if (zScoreA != null && zScoreB != null)
                 {
                     var distince = Math.Sqrt(zScoreB.Value * zScoreB.Value + zScoreA.Value * zScoreA.Value);
@@ -830,22 +897,22 @@ namespace wispro.sp.api.Controllers
                         {
                             if (zScoreA.Value > 0 && zScoreB.Value > 0)
                             {
-                                row["备注"] = "内部核稿、外部核稿修改都较少![撰稿人给力或客户友好]";
+                                strMemo = "内部核稿、外部核稿修改都较少![撰稿人给力或客户友好]";
                             }
 
                             if (zScoreA.Value > 0 && zScoreB.Value < 0)
                             {
-                                row["备注"] = "内部核稿较少、外部核稿修改较多![核稿人没有尽责!]";
+                                strMemo = "内部核稿较少、外部核稿修改较多![核稿人没有尽责!]";
                             }
 
                             if (zScoreA.Value < 0 && zScoreB.Value > 0)
                             {
-                                row["备注"] = "内部核稿较多、外部核稿修改都较少![核稿人给力]";
+                                strMemo = "内部核稿较多、外部核稿修改都较少![核稿人给力]";
                             }
 
                             if (zScoreA.Value < 0 && zScoreB.Value < 0)
                             {
-                                row["备注"] = "内部核稿和外部核稿修改都较多![案件沟通问题?]";
+                                strMemo = "内部核稿和外部核稿修改都较多![案件沟通问题?]";
                             }
                         }
                     }
@@ -855,49 +922,205 @@ namespace wispro.sp.api.Controllers
                         {
                             if (zScoreA.Value > 0 && zScoreB.Value > 0)
                             {
-                                row["备注"] = "内部核稿和外部核稿修改都较多![案件沟通问题?]";
+                                strMemo = "内部核稿和外部核稿修改都较多![案件沟通问题?]";
 
                             }
 
                             if (zScoreA.Value > 0 && zScoreB.Value < 0)
                             {
-                                row["备注"] = "内部核稿较多、外部核稿修改都较少![核稿人给力]";
+                                strMemo = "内部核稿较多、外部核稿修改都较少![核稿人给力]";
                             }
 
                             if (zScoreA.Value < 0 && zScoreB.Value > 0)
                             {
-                                row["备注"] = "内部核稿较少、外部核稿修改较多![核稿人没有尽责!]";
+                                strMemo = "内部核稿较少、外部核稿修改较多![核稿人没有尽责!]";
                             }
 
                             if (zScoreA.Value < 0 && zScoreB.Value < 0)
                             {
-                                row["备注"] = "内部核稿、外部核稿修改都较少![撰稿人给力或客户友好]";
+                                strMemo = "内部核稿、外部核稿修改都较少![撰稿人给力或客户友好]";
                             }
                         }
                     }
                 }
+                temObj.Memo = strMemo;
+
+                retList.Add(temObj);
+            }
+
+            
+            //wispro.sp.utility.NPOIExcel.DataTableToExcel(dt,$"c:\\temp\\{DateTime.Now.ToString("yyyyMMdd")}-内部核稿外部核稿情况案件清单_{typeName(type)}.xlsx");
+            return retList;
+        }
+
+        public void MonthlyReport(int year,int month)
+        {
+            #region 获取一年的案件清单,并计算个案件的清单
+            DateTime endDate = new DateTime(year, month + 1, 1);
+            DateTime yStartDate = endDate.AddYears(-1);
+            var retList = CalCustomer_mean(yStartDate, endDate, 4);
+            #endregion
+
+            DateTime mStartDate = new DateTime(year, month, 1);
+
+            #region 获取前客户修改前10名的案件清单
+            var monthItemList = retList.Where<retObject>(
+                r => r.FinishedDate >= mStartDate && r.FinishedDate < endDate);
+
+            var top10List = monthItemList.OrderByDescending(r => r.CustomerSim)
+                .Take(10).ToList();
+
+            
+            Hashtable reviewerHash = new Hashtable(); //核稿人
+            Hashtable crHash = new Hashtable(); //客户对接人
+            Hashtable dphash = new Hashtable(); //部长
+            foreach (var item in top10List)
+            {
+                #region 核稿人
+                if (!string.IsNullOrEmpty(item.Reviewer)) {
+                    Staff reviewer = Context.Staffs.Where(s => s.Name == item.Reviewer).FirstOrDefault();
+                    List<retObject> rets = new List<retObject>();
+                    foreach (Staff k in reviewerHash.Keys)
+                    {
+                        if (k.Id == reviewer.Id)
+                        {
+                            rets = (List<retObject>)reviewerHash[k];
+                            break;
+                        }
+                    }
+                    if (rets.Count == 0)
+                    {
+                        reviewerHash.Add(reviewer, rets);
+                    }
+
+                    rets.Add(item);
+                }
+                #endregion
+
+                #region 客户对接人
                 
-                dt.Rows.Add(row);
+                if (!string.IsNullOrEmpty(item.Customer)) {
+                    Customer c = Context.Customers.Where(s => s.Name == item.Customer)
+                        .Include(s=>s.ResponseMan).FirstOrDefault();
+                    if (c != null && c.ResponseMan != null)
+                    {
+                        List<retObject> rets = new List<retObject>();
+                        foreach (Staff k in crHash.Keys)
+                        {
+                            if (k.Id == c.ResponseManId)
+                            {
+                                rets = (List<retObject>)crHash[k];
+                                break;
+                            }
+                        }
+                        if (rets.Count == 0)
+                        {
+                            crHash.Add(c.ResponseMan, rets);
+                        }
+                        rets.Add(item);
+                    }
+                }
+                #endregion
 
-                retList.Add(
+                #region 部长
                 
-                    new
+                string[] Handlers = item.Handers.Split(",");
+                foreach(string n in Handlers)
+                {
+                    var dpList = Context.DepartmentPositions.Where(d => d.Staff.Name == n).Include(d => d.department).ToList();
+                    foreach(var dp in dpList)
                     {
-                        Id = item.Id,
-                        CaseNo = item.CaseNo,
-                        CaseName = item.CaseName,
-                        Customer = item.Customer,
-                        Reviewer = item.Reviewer,
-                        Handlers = item.Handlers,
-                        zScoreA = (oneSim - one.Average) / one.Std_Deviation,
-                        zScoreB = (twoSim - two.Average) / two.Std_Deviation
+                        var dpObj = Context.DepartmentPositions.Where(d => d.departmentId == dp.departmentId && d.Position.Name == "部长").Include(d => d.Staff).FirstOrDefault();
+                        if(dpObj!= null)
+                        {
+                            List<retObject> rets = new List<retObject>();
+                            foreach(Staff k in dphash.Keys)
+                            {
+                                if(k.Id == dpObj.StaffId)
+                                {
+                                    rets = (List<retObject>)dphash[k];
+                                    break;
+                                }
+                            }
+                            if (rets.Count ==0)
+                            { 
+                                dphash.Add(dpObj.Staff, rets);
+                            }
+
+                            if(!rets.Contains(item))
+                                rets.Add(item);
+                        }
+
                     }
-                 );
+                    
+                }
+                #endregion
             }
 
-            
-            wispro.sp.utility.NPOIExcel.DataTableToExcel(dt,$"c:\\temp\\{DateTime.Now.ToString("yyyyMMdd")}-内部核稿外部核稿情况案件清单_{typeName(type)}.xlsx");
-            return retList;
+            foreach(Staff sf in reviewerHash.Keys)
+            {
+                List<retObject> temList = (List<retObject>)reviewerHash[sf];
+                DataTable temdt  = CoverttoDatable(temList);
+                string strPath = $"{year}年{month}月客户修改权要排名前10的案件清单(审核人).xlsx";
+                utility.NPOIExcel.DataTableToExcel(temdt, strPath, true, true, 0, "http://1.116.113.26/CompareFile/detail/{0}");
+                string strBody = $"{sf.Name},你好!<br>附件中的案件是{year}年{month}月您核稿的案件,客户权要修改率在前10的案件,请注意核稿质量!";
+                _ = QuartzUtil.AddMailJob($"{year}年{month}月申请文件比较邮件", strBody, sf.Name, sf.Mail, $"{strPath}");
+            }
+
+            foreach (Staff sf in crHash.Keys)
+            {
+                List<retObject> temList = (List<retObject>)crHash[sf];
+                DataTable temdt = CoverttoDatable(temList);
+                string strPath = $"{year}年{month}月客户修改权要排名前10的案件清单(客户对接人).xlsx";
+                utility.NPOIExcel.DataTableToExcel(temdt, strPath, true, true, 0, "http://1.116.113.26/CompareFile/detail/{0}");
+                string strBody = $"{sf.Name},你好!<br>附件中的案件是{year}年{month}月你对接的客户的案件,客户权要修改率在前10的案件,请注意!";
+                _ = QuartzUtil.AddMailJob($"{year}年{month}月申请文件比较邮件", strBody, sf.Name, sf.Mail, $"{strPath}");
+            }
+
+            foreach (Staff sf in dphash.Keys)
+            {
+                List<retObject> temList = (List<retObject>)dphash[sf];
+                DataTable temdt = CoverttoDatable(temList);
+                string strPath = $"{year}年{month}月客户修改权要排名前10的案件清单(部长).xlsx";
+                utility.NPOIExcel.DataTableToExcel(temdt, strPath, true, true, 0, "http://1.116.113.26/CompareFile/detail/{0}");
+                string strBody = $"{sf.Name},你好!<br>附件中的案件是{year}年{month}月贵部人员处理的,客户权要修改率在前10的案件,请注意!";
+                _ = QuartzUtil.AddMailJob($"{year}年{month}月申请文件比较邮件", strBody, sf.Name, sf.Mail, $"{strPath}");
+            }
+
+            DataTable dt = CoverttoDatable(top10List);
+            string top10_filePath = $"{year}年{month}月客户修改权要排名前10的案件清单.xlsx";
+            utility.NPOIExcel.DataTableToExcel(dt, top10_filePath, true, true, 0, "http://1.116.113.26/CompareFile/detail/{0}");
+            #endregion
+
+            #region 获取疑似问题清单
+            var excItemList = monthItemList.Where<retObject>(r => string.IsNullOrEmpty(r.Memo) == false)
+                .OrderBy(r => r.Customer).ThenByDescending(r => r.CustomerSim)
+                .ToList();
+
+
+            DataTable excdt = CoverttoDatable(excItemList);
+
+            string except_filePath = $"{year}年{month}月疑似有问题的案件清单.xlsx";
+            utility.NPOIExcel.DataTableToExcel(excdt, except_filePath, true, true, 0, "http://1.116.113.26/CompareFile/detail/{0}");
+            #endregion
+
+            #region 所有案件清单
+            var allItemList = monthItemList
+                .OrderBy(r => r.Customer).ThenByDescending(r=>r.CustomerSim)
+                .ToList();
+            DataTable alldt = CoverttoDatable(allItemList);
+
+            string all_filePath = $"{year}年{month}月案件清单.xlsx";
+            utility.NPOIExcel.DataTableToExcel(alldt, all_filePath, true, true, 0, "http://1.116.113.26/CompareFile/detail/{0}");
+
+            #endregion
+
+            #region 发邮件
+            _ = QuartzUtil.AddMailJob($"{year}年{month}月申请文件比较邮件", "FYI!", "罗才洋", "luocaiyang@china-wispro.com", $"{all_filePath};{except_filePath};{top10_filePath}");
+            _ = QuartzUtil.AddMailJob($"{year}年{month}月申请文件比较邮件", "FYI!", "李庆波", "liqingbo@china-wispro.com", $"{all_filePath};{except_filePath};{top10_filePath}");
+            _ = QuartzUtil.AddMailJob($"{year}年{month}月申请文件比较邮件", "FYI!", "钟子敏", "zhongzimin@china-wispro.com", $"{all_filePath};{except_filePath};{top10_filePath}");
+            _ = QuartzUtil.AddMailJob($"{year}年{month}月申请文件比较邮件", "FYI!", "王姝然", "zhongzimin@china-wispro.com", $"{all_filePath};{except_filePath};{top10_filePath}");
+            #endregion
         }
 
         private double? getCalValue(CaseInfo caseInfo,int type,int stage)

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

@@ -41,7 +41,7 @@
     "Password": "Qj7eGb3ffQfJ3tpt",
     "mail": "luocaiyang@china-wispro.com"
   },
-  "InvalidDataMessageMails": "罗才洋|luocaiyang@china-wispro.com,何青瓦|heqingwa@china-wispro.com,钟子敏|zhongzimin@china-wispro.com,吴芳|wufang@china-wispro.com,邢丽霞|xinglixia@china-wispro.com,田婵玉|tianchanyu@china-wispro.com,周珊珊|zhoushanshan@china-wispro.com",
+  "InvalidDataMessageMails": "王姝然|wangshuran@china-wispro.com,罗才洋|luocaiyang@china-wispro.com,何青瓦|heqingwa@china-wispro.com,钟子敏|zhongzimin@china-wispro.com,吴芳|wufang@china-wispro.com,邢丽霞|xinglixia@china-wispro.com,田婵玉|tianchanyu@china-wispro.com,周珊珊|zhoushanshan@china-wispro.com",
 
   "Authorize": {
     "/Department": "[94]-[1],[128]-[7],[44]-[5],[2]-[7]",

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

@@ -619,9 +619,24 @@ namespace wispro.sp.utility
                     var ictrlproc = waitGetElementById(wait, "i_ctrl_proc");
                     ictrlproc.Click();
 
+                    var ctrl_proc_id = waitGetElementById(wait, "ctrl_proc_id");
+                    ctrl_proc_id.FindElements(By.TagName("li"));
+                    var ellis = waitGetElementsByTagName(wait, "li", ctrl_proc_id);
+
+                    foreach(var elli in ellis)
+                    {
+                        if(elli.Text == "新申请")
+                        {
+                            var chk = waitGetElementByClassName(wait, "chk", elli);
+                            chk.Click();
+                            break;
+                        }
+                        System.Diagnostics.Debug.WriteLine(elli.Text);
+                    }
+
+                    //var chkXSQ = waitGetElementById(wait, "ctrl_proc_id_4_check");
+                    //chkXSQ.Click();
 
-                    var chkXSQ = waitGetElementById(wait, "ctrl_proc_id_3_check");
-                    chkXSQ.Click();
                     
 
                     var btnOk = waitGetElementById(wait, "ctrl_proc_ida_ok");

+ 55 - 55
wispro.sp.utility/NPOIExcle.cs

@@ -1,4 +1,5 @@
-using NPOI.HSSF.UserModel;
+using DocumentFormat.OpenXml.Spreadsheet;
+using NPOI.HSSF.UserModel;
 using NPOI.SS.UserModel;
 using NPOI.XSSF.UserModel;
 using System;
@@ -6,8 +7,11 @@ using System.Collections.Generic;
 using System.Data;
 using System.IO;
 using System.Linq;
+using System.Security.Policy;
 using System.Text;
 using System.Threading.Tasks;
+using CellType = NPOI.SS.UserModel.CellType;
+using IndexedColors = NPOI.SS.UserModel.IndexedColors;
 
 namespace wispro.sp.utility
 {
@@ -161,13 +165,41 @@ namespace wispro.sp.utility
             return ExcelToDataTable(v, false, true);
         }
 
+        // 创建超链接对象(兼容 xls/xlsx)
+        private static IHyperlink CreateHyperlink(IWorkbook workbook, HyperlinkType type, string address)
+        {
+            if (workbook is XSSFWorkbook)
+                return new XSSFHyperlink(type) { Address = address };
+            else
+                return new HSSFHyperlink(type) { Address = address };
+        }
+
+        // 设置超链接样式
+        private static void SetHyperlinkStyle(IWorkbook workbook, ICell cell)
+        {
+            IFont font = workbook.CreateFont();
+            font.Underline = FontUnderlineType.Single;
+            font.Color = IndexedColors.Blue.Index;
+            
+            ICellStyle cellStyle = workbook.CreateCellStyle();
+            cellStyle.BorderBottom = NPOI.SS.UserModel.BorderStyle.Thin;
+            cellStyle.BorderLeft = NPOI.SS.UserModel.BorderStyle.Thin;
+            cellStyle.BorderRight = NPOI.SS.UserModel.BorderStyle.Thin;
+            cellStyle.BorderTop = NPOI.SS.UserModel.BorderStyle.Thin;
+            cellStyle.WrapText = true;// 指定单元格自动换行
+            cellStyle.VerticalAlignment = VerticalAlignment.Center;//垂直居中
+            cellStyle.Alignment = HorizontalAlignment.Center;
+            cellStyle.SetFont(font);
+            cell.CellStyle = cellStyle;
+        }
+
         /// <summary>
         /// 写入excel
         /// </summary>
         /// <param name="dt">datatable</param>
         /// <param name="strFile">strFile</param>
         /// <returns></returns>
-        public static bool DataTableToExcel(DataTable dt, string strFile,bool isAutoColumnWidth=true)
+        public static bool DataTableToExcel(DataTable dt, string strFile,bool isAutoColumnWidth=true,bool isLink=false,int linkCol=0,string linkFortmat="")
         {
             bool result = false;
             IWorkbook workbook = null;
@@ -191,6 +223,8 @@ namespace wispro.sp.utility
                         cell = row.CreateCell(c);
                         cell.SetCellValue(dt.Columns[c].ColumnName);
 
+                        
+
                         ICellStyle cellStyleColumn = workbook.CreateCellStyle();
                         cellStyleColumn.BorderBottom = NPOI.SS.UserModel.BorderStyle.Thin;
                         cellStyleColumn.BorderLeft = NPOI.SS.UserModel.BorderStyle.Thin;
@@ -230,6 +264,8 @@ namespace wispro.sp.utility
                             
                             cell = row.CreateCell(j);//excel第二行开始写入数据
 
+
+
                             if(dt.Rows[i][j] is System.DBNull)
                             {
                                 cell.SetCellValue("");
@@ -259,18 +295,22 @@ namespace wispro.sp.utility
                                 }
                                 
                             }
+
+                            
                             cell.CellStyle = cellStyle;
 
+                            if (isLink && linkCol == j)
+                            {
+                                var url = string.Format(linkFortmat, cell.StringCellValue);
+                                cell.Hyperlink = CreateHyperlink(workbook, HyperlinkType.Url, url);
+                                SetHyperlinkStyle(workbook, cell);
+                            }
+
 
 
                         }
                     }
-                    using (fs = File.OpenWrite(strFile))
-                    {
-                        workbook.Write(fs);//向打开的这个xls文件中写入数据
-                        result = true;
-                        fs.Close();
-                    }
+                    
 
                     #region 设定列宽
                     if (isAutoColumnWidth)
@@ -311,6 +351,13 @@ namespace wispro.sp.utility
                         }
                     }
                     #endregion
+
+                    using (fs = File.OpenWrite(strFile))
+                    {
+                        workbook.Write(fs);//向打开的这个xls文件中写入数据
+                        result = true;
+                        fs.Close();
+                    }
                 }
                 return result;
             }
@@ -378,53 +425,6 @@ namespace wispro.sp.utility
         }
 
         /// <summary>
-        /// Datable导出成Excel
-        /// </summary>
-        /// <param name="dt"></param>
-        /// <param name="file">导出路径(包括文件名与扩展名)</param>
-        public static void TableToExcel(DataTable dt, string file)
-        {
-            IWorkbook workbook;
-            string fileExt = Path.GetExtension(file).ToLower();
-            if (fileExt == ".xlsx") { workbook = new XSSFWorkbook(); } 
-            else if (fileExt == ".xls") { workbook = new HSSFWorkbook(); } 
-            else { workbook = null; }
-            if (workbook == null) { return; }
-            ISheet sheet = string.IsNullOrEmpty(dt.TableName) ? workbook.CreateSheet("Sheet1") : workbook.CreateSheet(dt.TableName);
-
-            //表头  
-            IRow row = sheet.CreateRow(0);
-            for (int i = 0; i < dt.Columns.Count; i++)
-            {
-                ICell cell = row.CreateCell(i);
-                cell.SetCellValue(dt.Columns[i].ColumnName);
-            }
-
-            //数据  
-            for (int i = 0; i < dt.Rows.Count; i++)
-            {
-                IRow row1 = sheet.CreateRow(i + 1);
-                for (int j = 0; j < dt.Columns.Count; j++)
-                {
-                    ICell cell = row1.CreateCell(j);
-                    cell.SetCellValue(dt.Rows[i][j].ToString());
-                }
-            }
-
-            //转为字节数组  
-            MemoryStream stream = new MemoryStream();
-            workbook.Write(stream);
-            var buf = stream.ToArray();
-
-            //保存为Excel文件  
-            using (FileStream fs = new FileStream(file, FileMode.Create, FileAccess.Write))
-            {
-                fs.Write(buf, 0, buf.Length);
-                fs.Flush();
-            }
-        }
-
-        /// <summary>
         /// 获取单元格类型
         /// </summary>
         /// <param name="cell"></param>

+ 2 - 2
wispro.sp.web/Components/ReviewerAppeal.razor

@@ -116,10 +116,10 @@
 
         @foreach (InputField field in context.inputFields)
         {
-            @if (field.FieldName == "最终延迟天数" && _Model.Item.Type != "其他新申请")
+            @* @if (field.FieldName == "最终延迟天数" && _Model.Item.Type != "其他新申请")
             {
                 continue;
-            }
+            } *@
 
             List<InputFieldValue> fValues = context.inputFieldValues.Where<InputFieldValue>(iv => iv.InputFieldId == field.Id).ToList();
 

+ 2 - 2
wispro.sp.winClient/APIService.cs

@@ -21,7 +21,7 @@ namespace wispro.sp.winClient
             HttpClientHandler clientHandler = new HttpClientHandler();
             clientHandler.ServerCertificateCustomValidationCallback = (sender, cert, chain, sslPolicyErrors) => { return true; };
 
-            return new HttpClient(clientHandler) { Timeout=TimeSpan.FromMinutes(2)};
+            return new HttpClient(clientHandler) { Timeout=TimeSpan.FromSeconds(20)};
 
         }
 
@@ -32,7 +32,7 @@ namespace wispro.sp.winClient
             dto.Password = "Lqftiu807005";
             try
             {
-                var response = await CreateHttp().PostAsJsonAsync<loginDto>($"{strAPIBaseUri}/api/account/Login", dto);
+                var response = await CreateHttp().PostAsJsonAsync<loginDto>($"{strAPIBaseUri}/api/Account/Login", dto);
 
                 if (response.IsSuccessStatusCode)
                 {

+ 4 - 3
wispro.sp.winClient/appsettings.json

@@ -1,10 +1,10 @@
 {
   "IPEasySetting": {
     "DownloadFileSavePath": "c:\\temp",
-    "isHeadless": "false",
+    "isHeadless": "true",
     "Account": "caiyangl",
     "Password": "j)wx*lier*@3",
-    "ChormeDriverPath": "e:\\source\\repos\\StaffPerformance\\packages\\ChormeDriver\\131.0.6778.108",
+    "ChormeDriverPath": "e:\\source\\repos\\StaffPerformance\\packages\\ChormeDriver\\133.0.6943.126",
     "ScheduleSetting": "00 55 10 3 * ? *",
     "IPEasyWeb": "http://47.106.94.35/Login.aspx"
   },
@@ -17,6 +17,7 @@
 
   },
   "InvalidDataMessageMails": "罗才洋|luocaiyang@china-wispro.com,何青瓦|heqingwa@china-wispro.com,钟子敏|zhongzimin@china-wispro.com,吴芳|wufang@china-wispro.com,邢丽霞|xinglixia@china-wispro.com,田婵玉|tianchanyu@china-wispro.com,周珊珊|zhoushanshan@china-wispro.com",
-  "APIBaseUri": "http://localhost:39476"
+  "APIBaseUri": "http://localhost:39476/", 
+  "lastDate": "2025-02-01"
 
 }

+ 29 - 3
wispro.sp.winClient/frmCaseFileCompare.cs

@@ -260,6 +260,15 @@ namespace wispro.sp.winClient
 
 
                 }
+
+                try
+                {
+                    File.WriteAllText("lastDate.txt", end.ToString());
+                }
+                catch (Exception ex)
+                {
+                    Console.WriteLine($"创建文件时出错: {ex.Message}");
+                }
             }
 
             static void DebugLog(string str)
@@ -379,15 +388,32 @@ namespace wispro.sp.winClient
 
         }
 
-
+        
         CaseInfo caseInfo;
         private void button1_Click(object sender, EventArgs e)
         {
             if (string.IsNullOrEmpty(this.txtCaseNo.Text))
             {
-                if (MessageBox.Show("获取前一天所有的完成案件,并比较文档?", "提示框", MessageBoxButtons.YesNo) == DialogResult.Yes)
+                DateTime startDate = DateTime.Now.AddDays(-1);
+                startDate = new DateTime(startDate.Year, startDate.Month, startDate.Day);
+                string filePath = "lastDate.txt";
+                string strLastDate = DateTime.Today.AddDays(-1).ToString();
+                try
+                {
+                    strLastDate = File.ReadAllText(filePath);
+                }
+                catch { }
+
+                if (!string.IsNullOrEmpty(strLastDate))
                 {
-                    compareCaseFile(DateTime.Parse("2025-01-01"),DateTime.Parse("2025-01-31"));
+                    startDate = DateTime.Parse(strLastDate);
+                }
+
+                if (MessageBox.Show($"获取{startDate.ToString("yyyy-MM-dd")}以来所有的完成案件,并比较文档?", "提示框", MessageBoxButtons.YesNo) == DialogResult.Yes)
+                {
+                    compareCaseFile(startDate,DateTime.Today);
+
+                    
                     return;
                 }
                 else

+ 2 - 2
wospro.sp.entity/PerformanceItem.cs

@@ -244,7 +244,7 @@ namespace wispro.sp.entity
                 if (Type == "其他新申请")
                 {
                     //最终延迟天数大于0
-                    if (FinallyDelayDays != null && FinallyDelayDays.Value > 00)
+                    if (FinallyDelayDays != null && FinallyDelayDays.Value > 0)
                     {
                         return FinallyDelayDays.Value;
                     }
@@ -324,7 +324,7 @@ namespace wispro.sp.entity
         private bool _OtherAppCalDanger()
         {
             //最终延迟天数大于0
-            if (FinallyDelayDays != null && FinallyDelayDays.Value > 00)
+            if (FinallyDelayDays != null && FinallyDelayDays.Value > 0)
             {
                 return true;
             }