فهرست منبع

专案审核界面中添加了审核人查看本人历史审核案件清单功能,界面上还可以按照案号过滤

luocaiyang 3 هفته پیش
والد
کامیت
07bd25f0dc
100فایلهای تغییر یافته به همراه1947 افزوده شده و 1668 حذف شده
  1. 8 8
      UpdateUserDepartment/Form1.cs
  2. 13 13
      wispro.sp.api/AppealHandler/ChangeDoPersonReviewer.cs
  3. 4 4
      wispro.sp.api/AppealHandler/ChangeReviewerReviewer.cs
  4. 6 6
      wispro.sp.api/AppealHandler/MissingCaseAppealHandler.cs
  5. 15 15
      wispro.sp.api/AppealHandler/MissingCaseReviewHandler.cs
  6. 2 2
      wispro.sp.api/AppealHandler/SpecialPointsHandler.cs
  7. 31 30
      wispro.sp.api/Controllers/AccountController.cs
  8. 73 71
      wispro.sp.api/Controllers/AppealController.cs
  9. 4 4
      wispro.sp.api/Controllers/AttachFilesController.cs
  10. 5 5
      wispro.sp.api/Controllers/BasePointRuleController.cs
  11. 6 5
      wispro.sp.api/Controllers/CalMonthController.cs
  12. 98 89
      wispro.sp.api/Controllers/CaseFileCompareController.cs
  13. 14 13
      wispro.sp.api/Controllers/ConditinController.cs
  14. 1 1
      wispro.sp.api/Controllers/FileProcesTaskController.cs
  15. 18 15
      wispro.sp.api/Controllers/IPEasyController.cs
  16. 32 32
      wispro.sp.api/Controllers/OrganizationController.cs
  17. 277 271
      wispro.sp.api/Controllers/PerformanceItemController.cs
  18. 119 58
      wispro.sp.api/Controllers/ProjectController.cs
  19. 18 18
      wispro.sp.api/Controllers/ReportController.cs
  20. 47 46
      wispro.sp.api/Controllers/StaffController.cs
  21. 4 4
      wispro.sp.api/Controllers/StaffGradeController.cs
  22. 2 2
      wispro.sp.api/Controllers/SystemDataController.cs
  23. 2 2
      wispro.sp.api/Controllers/VerifyCoefficientController.cs
  24. 69 68
      wispro.sp.api/Controllers/WorkflowEngineController.cs
  25. 1 1
      wispro.sp.api/Job/GetPerformanceItemJob.cs
  26. 48 48
      wispro.sp.api/Job/ImportProjectInfoJob.cs
  27. 61 60
      wispro.sp.api/Job/ImportReportJob.cs
  28. 4 4
      wispro.sp.api/Job/InvalidDataMessageJob.cs
  29. 2 2
      wispro.sp.api/Job/MailJob.cs
  30. 2 2
      wispro.sp.api/Job/QuartzUtil.cs
  31. 24 24
      wispro.sp.api/Job/UpdateJXDataFromIPEasyJob.cs
  32. 1 1
      wispro.sp.api/Program.cs
  33. 4 4
      wispro.sp.api/Services/FileTaskCacheService.cs
  34. 5 4
      wispro.sp.api/Startup.cs
  35. 3 3
      wispro.sp.api/Utility/MyMemeryCache.cs
  36. 19 18
      wispro.sp.api/Utility/Utility.cs
  37. 81 66
      wispro.sp.api/spDbContext.cs
  38. 32 32
      wispro.sp.ipeasyApi/Controllers/ipEasyController.cs
  39. 2 1
      wispro.sp.ipeasyApi/Program.cs
  40. 1 1
      wispro.sp.share/Customer_Std.cs
  41. 17 15
      wispro.sp.share/EFCoreExt.cs
  42. 1 1
      wispro.sp.share/EnumType.cs
  43. 3 3
      wispro.sp.share/FileProcessTask.cs
  44. 1 1
      wispro.sp.share/InputValueSettingObject.cs
  45. 7 7
      wispro.sp.share/LevelStatistics.cs
  46. 1 1
      wispro.sp.share/ListApiResponse.cs
  47. 1 1
      wispro.sp.share/NanduStatics.cs
  48. 1 1
      wispro.sp.share/ProjectPointRecord.cs
  49. 2 2
      wispro.sp.share/QueryFilter.cs
  50. 1 1
      wispro.sp.share/SharePackage.cs
  51. 2 2
      wispro.sp.share/Utility/FlowChartUtility.cs
  52. 4 4
      wispro.sp.share/Utility/UserConditionHelper.cs
  53. 1 1
      wispro.sp.share/webViewObject/userToken.cs
  54. 21 19
      wispro.sp.utility/CompareDocx.cs
  55. 1 1
      wispro.sp.utility/ConfigHelper.cs
  56. 4 4
      wispro.sp.utility/CosineSimilarity.cs
  57. 3 3
      wispro.sp.utility/EmunHelper.cs
  58. 32 32
      wispro.sp.utility/ExcelHelper.cs
  59. 186 161
      wispro.sp.utility/IPEasyUtility.cs
  60. 2 2
      wispro.sp.utility/JiebaSegmenter.cs
  61. 10 9
      wispro.sp.utility/MailUtil.cs
  62. 19 19
      wispro.sp.utility/NPOIExcle.cs
  63. 7 7
      wispro.sp.web/Auth/JwtAuthenticationStateProvider.cs
  64. 2 2
      wispro.sp.web/Components/AutoCompleteStaff.razor.cs
  65. 2 2
      wispro.sp.web/Components/Chart.razor.cs
  66. 24 23
      wispro.sp.web/Components/CreateAppeal.razor.cs
  67. 5 5
      wispro.sp.web/Components/FlowChart.razor.cs
  68. 19 19
      wispro.sp.web/Components/InputValueSetting.razor.cs
  69. 1 1
      wispro.sp.web/Components/PerformanceItemDescriptionItem.razor.cs
  70. 4 4
      wispro.sp.web/Components/PerformanceItemRow.razor.cs
  71. 18 18
      wispro.sp.web/Components/ResponseManCondition.razor.cs
  72. 1 1
      wispro.sp.web/Components/ReviewerAppeal.razor.cs
  73. 3 3
      wispro.sp.web/Components/RightMenuTreeNode.razor.cs
  74. 8 8
      wispro.sp.web/Components/SSTable.razor.cs
  75. 4 4
      wispro.sp.web/Components/StaffAutoComplete.razor.cs
  76. 1 1
      wispro.sp.web/Components/StaffSelect.razor.cs
  77. 4 4
      wispro.sp.web/Components/SubmitWorkContent.razor.cs
  78. 5 5
      wispro.sp.web/Components/UserConditionInput.razor.cs
  79. 1 1
      wispro.sp.web/Components/UserGradeSelect.razor.cs
  80. 1 1
      wispro.sp.web/Components/WatingDownload.razor.cs
  81. 57 44
      wispro.sp.web/Extensions/DateTimeExtension.cs
  82. 1 1
      wispro.sp.web/Layouts/LoginLayout.razor.cs
  83. 5 5
      wispro.sp.web/Models/CreateAppealModel.cs
  84. 6 6
      wispro.sp.web/Models/ReviewerAppealModel.cs
  85. 2 2
      wispro.sp.web/Pages/AppCase/AppealRecords.razor.cs
  86. 25 22
      wispro.sp.web/Pages/AppCase/CaseManager.razor.cs
  87. 1 1
      wispro.sp.web/Pages/AppCase/LevelStatistics.razor.cs
  88. 28 28
      wispro.sp.web/Pages/AppCase/MyCaselist.razor.cs
  89. 3 3
      wispro.sp.web/Pages/AppCase/MyFistPage.razor.cs
  90. 5 5
      wispro.sp.web/Pages/ChangePassword.razor.cs
  91. 3 3
      wispro.sp.web/Pages/CompareFile/Detail.razor.cs
  92. 7 7
      wispro.sp.web/Pages/CompareFile/List.razor.cs
  93. 8 8
      wispro.sp.web/Pages/CustomerList.razor.cs
  94. 7 6
      wispro.sp.web/Pages/LoginPages.razor.cs
  95. 20 20
      wispro.sp.web/Pages/Organization/Department.razor.cs
  96. 12 11
      wispro.sp.web/Pages/Project/AssignPoint.razor.cs
  97. 3 3
      wispro.sp.web/Pages/Project/MyProject.razor.cs
  98. 104 27
      wispro.sp.web/Pages/Project/ProjectReviewer.razor
  99. 62 14
      wispro.sp.web/Pages/Project/ProjectReviewer.razor.cs
  100. 0 0
      wispro.sp.web/Pages/Project/ProjectSearch.razor.cs

+ 8 - 8
UpdateUserDepartment/Form1.cs

@@ -24,7 +24,7 @@ namespace UpdateUserDepartment
         {
             var ofd = new System.Windows.Forms.OpenFileDialog();
 
-            if(ofd.ShowDialog() == DialogResult.OK)
+            if (ofd.ShowDialog() == DialogResult.OK)
             {
                 string strPath = ofd.FileName;
                 var dt = wispro.sp.utility.NPOIExcel.ExcelToTable(strPath);
@@ -32,16 +32,16 @@ namespace UpdateUserDepartment
                 wispro.sp.api.spDbContext db = new wispro.sp.api.spDbContext();
                 var depList = db.Departments.ToList();
 
-                foreach ( DataRow row in dt.Rows )
+                foreach (DataRow row in dt.Rows)
                 {
                     string strId = row[0].ToString();
 
-                    
+
                     string strDepart = row["部门"].ToString();
 
-                    System.Diagnostics.Debug.WriteLine(string.Format( "部门:{0}",strDepart));
+                    System.Diagnostics.Debug.WriteLine(string.Format("部门:{0}", strDepart));
 
-                    if(!string.IsNullOrEmpty(strDepart))
+                    if (!string.IsNullOrEmpty(strDepart))
                     {
                         string[] deps = GetDepartmentPath(strDepart);
 
@@ -60,10 +60,10 @@ namespace UpdateUserDepartment
             static Department GetUserDepartment(string[] deps, wispro.sp.api.spDbContext db)
             {
                 Department temDept = null;
-                for (int i=0;i<deps.Length;i++)
+                for (int i = 0; i < deps.Length; i++)
                 {
                     Department dep = null;
-                    if(temDept == null)
+                    if (temDept == null)
                     {
                         dep = db.Departments.Where<Department>(d => d.Name == deps[i].Trim()).FirstOrDefault();
                     }
@@ -94,7 +94,7 @@ namespace UpdateUserDepartment
 
             static string[] GetDepartmentPath(string strDepart)
             {
-                if(string.IsNullOrEmpty(strDepart) || strDepart =="NULL")
+                if (string.IsNullOrEmpty(strDepart) || strDepart == "NULL")
                 {
                     return null;
                 }

+ 13 - 13
wispro.sp.api/AppealHandler/ChangeDoPersonReviewer.cs

@@ -28,7 +28,7 @@ namespace wispro.sp.api.AppealHandler
                 }
                 else
                 {
-                    if(iv.InputField.FieldName == "审核意见" && string.IsNullOrEmpty(iv.Value))
+                    if (iv.InputField.FieldName == "审核意见" && string.IsNullOrEmpty(iv.Value))
                     {
                         throw (new ApplicationException("请填写审核意见!"));
                     }
@@ -41,7 +41,7 @@ namespace wispro.sp.api.AppealHandler
 
                 string strOldPerson = "";
                 string strNewPerson = "";
-                
+
                 foreach (var iv in result)
                 {
                     if (iv.InputField == null)
@@ -65,20 +65,20 @@ namespace wispro.sp.api.AppealHandler
 
                 var appRecord = ((spDbContext)spContext).AppealRecords.FirstOrDefault(f => f.Id == appealRecordId);
 
-                if(appRecord != null)
+                if (appRecord != null)
                 {
-                    var itemStaffs = ((spDbContext)spContext).ItemStaffs.Include(p=>p.DoPerson).Where(s => s.ItemId == appRecord.ItemId.Value);
+                    var itemStaffs = ((spDbContext)spContext).ItemStaffs.Include(p => p.DoPerson).Where(s => s.ItemId == appRecord.ItemId.Value);
 
-                    var oldPersons = strOldPerson.Split(new char[] { ' ', ',', ',' },StringSplitOptions.RemoveEmptyEntries);
+                    var oldPersons = strOldPerson.Split(new char[] { ' ', ',', ',' }, StringSplitOptions.RemoveEmptyEntries);
                     var newPersons = strNewPerson.Split(new char[] { ' ', ',', ',' }, StringSplitOptions.RemoveEmptyEntries);
-                    
+
                     bool oldPersonExist = true;
                     List<ItemStaff> waitingRemoveObj = new List<ItemStaff>();
 
-                    foreach(var temName in oldPersons)
+                    foreach (var temName in oldPersons)
                     {
                         var temItemStaff = itemStaffs.Where(s => s.DoPerson.Name == temName).FirstOrDefault();
-                        if(temItemStaff == null)
+                        if (temItemStaff == null)
                         {
                             oldPersonExist = false;
                             break;
@@ -93,9 +93,9 @@ namespace wispro.sp.api.AppealHandler
                     //    if (oldPersons.Contains(staff.DoPerson.Name))
                     //    {
                     //        waitingRemoveObj.Add(staff);
-                            
+
                     //        oldPersonExist = true;
-                            
+
                     //    }
                     //    else
                     //    {
@@ -104,7 +104,7 @@ namespace wispro.sp.api.AppealHandler
                     //    }
                     //}
 
-                    
+
 
                     if (oldPersonExist)
                     {
@@ -113,8 +113,8 @@ namespace wispro.sp.api.AppealHandler
                         foreach (var temName in newPersons)
                         {
                             var newStaff = ((spDbContext)spContext).Staffs.FirstOrDefault(s => s.Name == temName.Trim());
-                            
-                            if (newStaff != null )
+
+                            if (newStaff != null)
                             {
                                 var temItemStaff = ((spDbContext)spContext).ItemStaffs.Where(s => s.ItemId == appRecord.ItemId.Value && s.DoPersonId == newStaff.Id).FirstOrDefault();
 

+ 4 - 4
wispro.sp.api/AppealHandler/ChangeReviewerReviewer.cs

@@ -34,7 +34,7 @@ namespace wispro.sp.api.AppealHandler
             }
             if (isAggree)
             {
-                var result = ((spDbContext)spContext).InputFieldValues.Where<InputFieldValue>(f => 
+                var result = ((spDbContext)spContext).InputFieldValues.Where<InputFieldValue>(f =>
                         f.AppealRecordId == appealRecordId && f.InputField.AppealState == 0)
                     .ToList();
 
@@ -53,13 +53,13 @@ namespace wispro.sp.api.AppealHandler
                     }
                 }
 
-                var appRecord = ((spDbContext)spContext).AppealRecords.Include(a=>a.Item).FirstOrDefault(f => f.Id == appealRecordId);
-                
+                var appRecord = ((spDbContext)spContext).AppealRecords.Include(a => a.Item).FirstOrDefault(f => f.Id == appealRecordId);
+
                 if (appRecord != null && appRecord.Item != null)
                 {
                     var newStaff = ((spDbContext)spContext).Staffs.FirstOrDefault(s => s.Name == strReviewerName.Trim());
 
-                    if(newStaff != null)
+                    if (newStaff != null)
                     {
                         appRecord.Item.ReviewerId = newStaff.Id;
                     }

+ 6 - 6
wispro.sp.api/AppealHandler/MissingCaseAppealHandler.cs

@@ -11,7 +11,7 @@ namespace wispro.sp.api.AppealHandler
 {
     public class MissingCaseAppealHandler : IDoAppealObject
     {
-        
+
 
         public void DoAppeal(AppealObject appeal, int appealRecordid, DbContext spContext)
         {
@@ -26,18 +26,18 @@ namespace wispro.sp.api.AppealHandler
 
             foreach (var iv in appeal.inputFieldValues)
             {
-                if(iv.InputField == null)
+                if (iv.InputField == null)
                 {
-                    iv.InputField = ((spDbContext)spContext).InputFields.FirstOrDefault(s=>s.Id == iv.InputFieldId);
+                    iv.InputField = ((spDbContext)spContext).InputFields.FirstOrDefault(s => s.Id == iv.InputFieldId);
                 }
 
-                if(iv.InputField.FieldName == "我方文号")
+                if (iv.InputField.FieldName == "我方文号")
                 {
                     job.JobDataMap.Put("CaseNo", iv.Value);
                     continue;
                 }
 
-                if(iv.InputField.FieldName =="处理事项")
+                if (iv.InputField.FieldName == "处理事项")
                 {
                     job.JobDataMap.Put("DoItem", iv.Value);
                     continue;
@@ -46,7 +46,7 @@ namespace wispro.sp.api.AppealHandler
                 if (iv.InputField.FieldName == "案件阶段")
                 {
                     job.JobDataMap.Put("CaseStage", iv.Value);
-                    
+
                     continue;
                 }
             }

+ 15 - 15
wispro.sp.api/AppealHandler/MissingCaseReviewHandler.cs

@@ -22,7 +22,7 @@ namespace wispro.sp.api.AppealHandler
                     iv.InputField = ((spDbContext)spContext).InputFields.FirstOrDefault(s => s.Id == iv.InputFieldId);
                 }
 
-                if (iv.InputField.FieldName == "审核意见" && iv.Value =="同意")
+                if (iv.InputField.FieldName == "审核意见" && iv.Value == "同意")
                 {
                     isAggree = true;
                     break;
@@ -38,12 +38,12 @@ namespace wispro.sp.api.AppealHandler
             }
             if (isAggree)
             {
-                var result = ((spDbContext)spContext).InputFieldValues.Where<InputFieldValue>(f => f.AppealRecordId == appealRecordId  && f.InputField.AppealState == 0).ToList();
+                var result = ((spDbContext)spContext).InputFieldValues.Where<InputFieldValue>(f => f.AppealRecordId == appealRecordId && f.InputField.AppealState == 0).ToList();
 
-                var appealRecord = ((spDbContext)spContext).AppealRecords.Where<AppealRecord>(f => f.Id == appealRecordId).Include(f=>f.Creater).FirstOrDefault();
+                var appealRecord = ((spDbContext)spContext).AppealRecords.Where<AppealRecord>(f => f.Id == appealRecordId).Include(f => f.Creater).FirstOrDefault();
 
-                string strCaseNo ="";
-                string strDoItem="";
+                string strCaseNo = "";
+                string strDoItem = "";
                 string strCaseStage = "";
                 foreach (var iv in result)
                 {
@@ -60,7 +60,7 @@ namespace wispro.sp.api.AppealHandler
 
                     if (iv.InputField.FieldName == "处理事项")
                     {
-                        strDoItem=iv.Value;
+                        strDoItem = iv.Value;
                         continue;
                     }
 
@@ -71,15 +71,15 @@ namespace wispro.sp.api.AppealHandler
                     }
                 }
 
-                var itemControler = new PerformanceItemController((spDbContext)spContext,new Services.FileTaskCacheService());
+                var itemControler = new PerformanceItemController((spDbContext)spContext, new Services.FileTaskCacheService());
 
                 PerformanceItem Item = null;
                 if (strDoItem == "发明一次OA授权")
                 {
-                    
+
                     try
                     {
-                        Item = itemControler.GetItemInfoByCaseStage(strCaseNo,new List<string>() { "处理审查意见", "电询", "集中审查", "补正", "主动补正", "主动修正", "新申请" }, "");
+                        Item = itemControler.GetItemInfoByCaseStage(strCaseNo, new List<string>() { "处理审查意见", "电询", "集中审查", "补正", "主动补正", "主动修正", "新申请" }, "");
                     }
                     catch { }
 
@@ -92,7 +92,7 @@ namespace wispro.sp.api.AppealHandler
                     //        Item = itemControler.GetItemInfoByCaseStage(strCaseNo, "电询", "");
                     //    }
                     //    catch { }
-                        
+
                     //}
 
                     //if (Item == null || Item.ItemStaffs.Where(s => s.DoPerson.Name == appealRecord.Creater.Name).Count() == 0)
@@ -119,7 +119,7 @@ namespace wispro.sp.api.AppealHandler
                     //if (Item == null || Item.ItemStaffs.Where(s => s.DoPerson.Name == appealRecord.Creater.Name).Count() == 0)
                     //{
                     //    Item = null;
-                        
+
                     //    try
                     //    {
                     //        Item = itemControler.GetItemInfoByCaseStage(strCaseNo, "新申请", "");
@@ -134,9 +134,9 @@ namespace wispro.sp.api.AppealHandler
                     Item = itemControler.GetItemInfoByCaseStage(strCaseNo, strDoItem, strCaseStage);
                 }
 
-                CalMonth calMonth = ((spDbContext)spContext).CalMonths.FirstOrDefault(c=>c.Status == 0);
+                CalMonth calMonth = ((spDbContext)spContext).CalMonths.FirstOrDefault(c => c.Status == 0);
 
-                if (calMonth != null )
+                if (calMonth != null)
                 {
                     if (Item.Id == 0 || Item.CalMonthId != calMonth.Id)
                     {
@@ -163,7 +163,7 @@ namespace wispro.sp.api.AppealHandler
             }
         }
 
-        private void SaveToDb(PerformanceItem item,spDbContext Context,CalMonth calMonth)
+        private void SaveToDb(PerformanceItem item, spDbContext Context, CalMonth calMonth)
         {
             try
             {
@@ -253,7 +253,7 @@ namespace wispro.sp.api.AppealHandler
             }
             catch (Exception ex)
             {
-                throw ex;
+                throw;
             }
         }
 

+ 2 - 2
wispro.sp.api/AppealHandler/SpecialPointsHandler.cs

@@ -24,14 +24,14 @@ namespace wispro.sp.api.AppealHandler
             var temField = appeal.inputFieldValues.FirstOrDefault(iv => iv.InputField.FieldName == "审核意见" && iv.Value == "同意");
 
             isAggree = (temField != null);
-            
+
             if (isAggree)
             {
                 var apRecord = ((spDbContext)spContext).AppealRecords.FirstOrDefault(p => p.Id == appealRecordId);
 
                 if (apRecord != null)
                 {
-                    var Item = ((spDbContext)spContext).PerformanceItems.FirstOrDefault(p=>p.Id == apRecord.ItemId);
+                    var Item = ((spDbContext)spContext).PerformanceItems.FirstOrDefault(p => p.Id == apRecord.ItemId);
 
                     foreach (var iv in appeal.inputFieldValues)
                     {

+ 31 - 30
wispro.sp.api/Controllers/AccountController.cs

@@ -26,39 +26,40 @@ namespace wispro.sp.api.Controllers
         public IConfiguration Configuration { get; }
         spDbContext dbContext;
 
-        public AccountController(IConfiguration configuration,spDbContext _dbContext)
+        public AccountController(IConfiguration configuration, spDbContext _dbContext)
         {
             Configuration = configuration;
             dbContext = _dbContext;
         }
-        
-        [HttpGet,HttpPost,Route("Login")]
+
+        [HttpGet, HttpPost, Route("Login")]
         public userToken Login(loginDto loginUser)
         {
             //添加验证代码
-            
-            Staff staff = dbContext.Staffs.Where<Staff>(s => s.Account == loginUser.Name ).FirstOrDefault(); //
-           
+
+            Staff staff = dbContext.Staffs.Where<Staff>(s => s.Account == loginUser.Name).FirstOrDefault(); //
+
             if (staff != null && staff.IsOnJob && staff.Password == utility.MD5Utility.GetMD5(loginUser.Password))
             {
                 return GetToken(staff);
             }
             else
             {
-                return new userToken() { 
+                return new userToken()
+                {
                     StatusCode = System.Net.HttpStatusCode.NotFound,
-                    Name = null, 
-                    Token = null 
+                    Name = null,
+                    Token = null
                 };
             }
-            
+
         }
 
         [Authorize]
         [HttpGet, HttpPost, Route("ChangePassword")]
         public bool ChangePassword(changePasswordDto dto)
         {
-            Staff staff = dbContext.Staffs.Where<Staff>(s => s.Id  == dto.UserId  && s.Password == utility.MD5Utility.GetMD5(dto.oldPassword)).FirstOrDefault();
+            Staff staff = dbContext.Staffs.Where<Staff>(s => s.Id == dto.UserId && s.Password == utility.MD5Utility.GetMD5(dto.oldPassword)).FirstOrDefault();
 
             if (staff != null)
             {
@@ -73,20 +74,20 @@ namespace wispro.sp.api.Controllers
         }
 
         [HttpGet, HttpPost, Route("ResetPassword")]
-        public ApiSaveResponse ResetPassword(string accountName,string mail)
+        public ApiSaveResponse ResetPassword(string accountName, string mail)
         {
             ApiSaveResponse ret = new ApiSaveResponse();
             ret.Success = true;
-            Staff staff = dbContext.Staffs.Where<Staff>(s => s.Account  == accountName  && s.Mail == mail).FirstOrDefault();
+            Staff staff = dbContext.Staffs.Where<Staff>(s => s.Account == accountName && s.Mail == mail).FirstOrDefault();
 
-            if(staff != null)
+            if (staff != null)
             {
                 string strPassword = "";
-                Random random = new Random(); 
-                for (int i = 0; i < 8; i++) 
+                Random random = new Random();
+                for (int i = 0; i < 8; i++)
                 {
-                    strPassword = $"{strPassword}{random.Next(0,9)}";
-                    
+                    strPassword = $"{strPassword}{random.Next(0, 9)}";
+
                 }
                 staff.Password = utility.MD5Utility.GetMD5(strPassword);
                 dbContext.SaveChanges();
@@ -105,7 +106,7 @@ namespace wispro.sp.api.Controllers
         }
 
         [HttpGet, HttpPost, Route("Modify")]
-        public ApiSaveResponse Modify(string accountName,string status, string mail)
+        public ApiSaveResponse Modify(string accountName, string status, string mail)
         {
             ApiSaveResponse ret = new ApiSaveResponse();
             ret.Success = true;
@@ -115,9 +116,9 @@ namespace wispro.sp.api.Controllers
             {
                 staff.Status = status;
                 staff.Mail = mail;
-                
+
                 dbContext.SaveChanges();
-                
+
                 return ret;
             }
             else
@@ -129,7 +130,7 @@ namespace wispro.sp.api.Controllers
         }
 
         [Authorize]
-        [HttpGet,Route("GetUser")]
+        [HttpGet, Route("GetUser")]
         public userToken GetUser()
         {
             if (User.Identity.IsAuthenticated)//如果Token有效
@@ -145,26 +146,26 @@ namespace wispro.sp.api.Controllers
                 }
                 else
                 {
-                    return new userToken() {StatusCode=System.Net.HttpStatusCode.NotFound, Name = null, Token = null };
+                    return new userToken() { StatusCode = System.Net.HttpStatusCode.NotFound, Name = null, Token = null };
                 }
             }
             else
             {
-                return new userToken() {StatusCode= System.Net.HttpStatusCode.NotFound, Name = null, Token = null };
+                return new userToken() { StatusCode = System.Net.HttpStatusCode.NotFound, Name = null, Token = null };
             }
         }
 
 
         private userToken GetToken(Staff staff)
         {
-            
+
 
             var claims = new List<Claim>()
             {
                 new Claim("Id",staff.Id.ToString()),
                 new Claim(ClaimTypes.Name,staff.Name),
                 new Claim(ClaimTypes.Email,(staff.Mail==null)?"":staff.Mail),
-                
+
             };
 
             var positions = dbContext.DepartmentPositions.Where<DepartmentPosition>(dp => dp.StaffId == staff.Id).ToList();
@@ -176,16 +177,16 @@ namespace wispro.sp.api.Controllers
             var key = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(Configuration["jwt:Key"]));
             var credential = new SigningCredentials(key, SecurityAlgorithms.HmacSha256);
             var expireTime = DateTime.Now.AddHours(5);
-            
+
             var token = new JwtSecurityToken(
                 issuer: Configuration["jwt:Issuer"],
                 audience: Configuration["jwt:Audience"],
                 claims: claims.ToArray(),
                 notBefore: DateTime.Now,
-                expires: expireTime,                
+                expires: expireTime,
                 signingCredentials: credential);
 
-            
+
             string jwtToken = new JwtSecurityTokenHandler().WriteToken(token);
 
             //建立UserToken物件後回傳client
@@ -218,5 +219,5 @@ namespace wispro.sp.api.Controllers
             return ret.ToList<string>();
         }
     }
-    
+
 }

+ 73 - 71
wispro.sp.api/Controllers/AppealController.cs

@@ -51,26 +51,26 @@ namespace wispro.sp.api.Controllers
         /// <param name="CustomerId">指定客户Id</param>
         /// <param name="CalmonthId">指定月份Id</param>
         /// <returns></returns>
-        public CaseCoefficientStatistics GetCCSRecord(int? CustomerId,int CalmonthId)
+        public CaseCoefficientStatistics GetCCSRecord(int? CustomerId, int CalmonthId)
         {
             CaseCoefficientStatistics retObject = new CaseCoefficientStatistics();
 
-            if(CustomerId != null)
+            if (CustomerId != null)
             {
                 retObject.customer = Context.Customers.FirstOrDefault(c => c.Id == CustomerId);
             }
-            
+
 
             var myGroups = Context.PerformanceItems
-                .Where(p=>
-                    p.Type=="新申请" 
+                .Where(p =>
+                    p.Type == "新申请"
                     && (p.AgentFeedbackMemo != "已算绩效" || string.IsNullOrEmpty(p.AgentFeedbackMemo))
                     && p.CalMonthId == CalmonthId
                     && p.CustomerId == CustomerId)
                 .GroupBy(p => p.CaseCoefficient)
                 .Select(g => new { CaseCoefficient = g.Key, Count = g.Count() });
 
-            if(CustomerId == null)
+            if (CustomerId == null)
             {
                 myGroups = Context.PerformanceItems
                 .Where(p =>
@@ -83,7 +83,7 @@ namespace wispro.sp.api.Controllers
 
             foreach (var g in myGroups)
             {
-                string strKey = ( string.IsNullOrEmpty(g.CaseCoefficient)) ? "B" : g.CaseCoefficient;
+                string strKey = (string.IsNullOrEmpty(g.CaseCoefficient)) ? "B" : g.CaseCoefficient;
                 switch (strKey)
                 {
                     case "A":
@@ -113,14 +113,14 @@ namespace wispro.sp.api.Controllers
             //{
             //    conn.Open();
             //}
-            
-            
+
+
             //try
             //{
             //    var cmd = conn.CreateCommand();
             //    cmd.CommandText = strSQL;
             //    var reader = cmd.ExecuteReader();
-                
+
             //    while (reader.Read())
             //    {
             //        string strKey = (reader.IsDBNull(0) || string.IsNullOrEmpty(reader.GetString(0))) ? "B" : reader.GetString(0);
@@ -138,7 +138,7 @@ namespace wispro.sp.api.Controllers
             //                retObject.Totals += reader.GetInt32(1);
             //                break;
             //        }
-                    
+
             //    }
 
             //    cmd.Dispose();
@@ -151,7 +151,7 @@ namespace wispro.sp.api.Controllers
             //}
             //finally
             //{
-                
+
             //    conn.Close();
             //}
             #endregion
@@ -204,16 +204,16 @@ namespace wispro.sp.api.Controllers
             dt.Columns.Add("客户名称");
             dt.Columns.Add("S案件阈值");
             dt.Columns.Add("A案件阈值");
-            dt.Columns.Add("案件总数",typeof(int));
+            dt.Columns.Add("案件总数", typeof(int));
             dt.Columns.Add("S案件数", typeof(int));
             dt.Columns.Add("A案件数", typeof(int));
 
-            foreach(var ccsObj in retList)
+            foreach (var ccsObj in retList)
             {
                 var row = dt.NewRow();
                 row["客户名称"] = ccsObj.customer.Name;
-                row["S案件阈值"] =$"{((ccsObj.customer.SRate == null) ? 5: ccsObj.customer.SRate)}%" ;
-                row["A案件阈值"] = $"{((ccsObj.customer.ARate == null) ? 30: ccsObj.customer.ARate)}%";
+                row["S案件阈值"] = $"{((ccsObj.customer.SRate == null) ? 5 : ccsObj.customer.SRate)}%";
+                row["A案件阈值"] = $"{((ccsObj.customer.ARate == null) ? 30 : ccsObj.customer.ARate)}%";
 
                 row["案件总数"] = ccsObj.Totals;
                 row["S案件数"] = ccsObj.SCount;
@@ -234,16 +234,17 @@ namespace wispro.sp.api.Controllers
                     && (p.AgentFeedbackMemo != "已算绩效" || string.IsNullOrEmpty(p.AgentFeedbackMemo))
                     && p.CalMonthId == CalmonthId)
                 .GroupBy(p => new { CustomerId = p.CustomerId, CaseCeoffcient = p.CaseCoefficient })
-                .Select(g => new { CaseCoefficient = g.Key.CaseCeoffcient,CustomerId=g.Key.CustomerId, Count = g.Count() });
+                .Select(g => new { CaseCoefficient = g.Key.CaseCeoffcient, CustomerId = g.Key.CustomerId, Count = g.Count() });
 
-            List<CaseCoefficientStatistics> retList= new List<CaseCoefficientStatistics>();
+            List<CaseCoefficientStatistics> retList = new List<CaseCoefficientStatistics>();
 
             foreach (var g in myGroups)
             {
-                CaseCoefficientStatistics temObject = retList.Where(p=>p.customer.Id == g.CustomerId).FirstOrDefault(); 
-                if(temObject == null)
+                CaseCoefficientStatistics temObject = retList.Where(p => p.customer.Id == g.CustomerId).FirstOrDefault();
+                if (temObject == null)
                 {
-                    temObject = new CaseCoefficientStatistics() { 
+                    temObject = new CaseCoefficientStatistics()
+                    {
                         customer = AllCustomers.FirstOrDefault(c => c.Id == g.CustomerId)
                     };
 
@@ -287,7 +288,7 @@ namespace wispro.sp.api.Controllers
             {
                 if (inputField.SelectValues != null)
                 {
-                    foreach(var ifValue in inputField.SelectValues)
+                    foreach (var ifValue in inputField.SelectValues)
                     {
                         ifValue.InputField = null;
                     }
@@ -309,9 +310,9 @@ namespace wispro.sp.api.Controllers
         {
             ApiSaveResponse response = new ApiSaveResponse();
             response.Success = true;
-            
+
             AppealRecord appealRecord = new AppealRecord();
-            if(ItemId > 0)
+            if (ItemId > 0)
             {
                 appealRecord.ItemId = ItemId;
             }
@@ -319,10 +320,10 @@ namespace wispro.sp.api.Controllers
             {
                 appealRecord.ItemId = null;
             }
-            
+
             appealRecord.TypeId = typeid;
             appealRecord.ReviewerId = reviewerId;
-            appealRecord.CreaterId =  Context.Staffs.Where<Staff>(s => s.Name == User.Identity.Name).FirstOrDefault().Id;
+            appealRecord.CreaterId = Context.Staffs.Where<Staff>(s => s.Name == User.Identity.Name).FirstOrDefault().Id;
             appealRecord.CreateTime = DateTime.Now;
 
             var t = Context.Database.BeginTransaction();
@@ -346,7 +347,7 @@ namespace wispro.sp.api.Controllers
 
                 Context.SaveChanges();
 
-                var temType = Context.AppealTypes.FirstOrDefault(c=>c.Id == appealRecord.TypeId);
+                var temType = Context.AppealTypes.FirstOrDefault(c => c.Id == appealRecord.TypeId);
                 if (!string.IsNullOrEmpty(temType.ApplealObject))
                 {
                     IDoAppealObject doAppeal = (IDoAppealObject)Activator.CreateInstance(Type.GetType(appealRecord.Type.ApplealObject));
@@ -357,9 +358,9 @@ namespace wispro.sp.api.Controllers
 
                 var Reviewer = Context.Staffs.Where<Staff>(s => s.Id == appealRecord.ReviewerId).FirstOrDefault();
 
-                if(appealRecord.Type == null)
+                if (appealRecord.Type == null)
                 {
-                    appealRecord.Type = Context.AppealTypes.FirstOrDefault(p=>p.Id == appealRecord.TypeId);
+                    appealRecord.Type = Context.AppealTypes.FirstOrDefault(p => p.Id == appealRecord.TypeId);
                 }
 
                 string strSubject = appealRecord.Type.Name;
@@ -387,21 +388,21 @@ namespace wispro.sp.api.Controllers
             }
         }
 
-        public ApiSaveResponse ReviewerAppeal(int appealRecordId,AppealObject appealObject)
+        public ApiSaveResponse ReviewerAppeal(int appealRecordId, AppealObject appealObject)
         {
             ApiSaveResponse response = new ApiSaveResponse();
             response.Success = true;
 
             var appealRecord = Context.AppealRecords.Where<AppealRecord>(p => p.Id == appealRecordId).FirstOrDefault();
 
-            
-            if(appealRecord != null)
+
+            if (appealRecord != null)
             {
                 if (appealRecord.ItemId.HasValue)
                 {
-                    var item = Context.PerformanceItems.Include(p=>p.CalMonth).FirstOrDefault(p => p.Id == appealRecord.ItemId.Value);
+                    var item = Context.PerformanceItems.Include(p => p.CalMonth).FirstOrDefault(p => p.Id == appealRecord.ItemId.Value);
 
-                    if(item == null)
+                    if (item == null)
                     {
                         response.Success = false;
                         response.ErrorMessage = "无效的ItemId!";
@@ -409,7 +410,7 @@ namespace wispro.sp.api.Controllers
                     }
                     else
                     {
-                        if(item.CalMonth.Status != 0)
+                        if (item.CalMonth.Status != 0)
                         {
                             response.Success = false;
                             response.ErrorMessage = "指定的绩效已经归档!";
@@ -446,42 +447,42 @@ namespace wispro.sp.api.Controllers
                     List<InputFieldValue> inputFieldValues = Context.InputFieldValues
                         .Where<InputFieldValue>(p => p.AppealRecordId == appealRecordId
                                     && p.InputField.MapObjectField != null)
-                        .Include(i=>i.InputField)
+                        .Include(i => i.InputField)
                         .ToList();
 
-                    foreach(InputFieldValue inputFieldValue in inputFieldValues)
+                    foreach (InputFieldValue inputFieldValue in inputFieldValues)
                     {
-                        
+
                         SaveValueToMapObject(appealRecord, inputFieldValue);
-                        
+
                     }
 
                     Context.SaveChanges();
 
-                    if(appealRecord.Type == null)
+                    if (appealRecord.Type == null)
                     {
-                        appealRecord.Type = Context.AppealTypes.FirstOrDefault(s=>s.Id == appealRecord.TypeId);
+                        appealRecord.Type = Context.AppealTypes.FirstOrDefault(s => s.Id == appealRecord.TypeId);
                     }
 
                     if (!string.IsNullOrEmpty(appealRecord.Type.ReviewObject))
                     {
                         IDoAppealObject doAppeal = (IDoAppealObject)Activator.CreateInstance(Type.GetType(appealRecord.Type.ReviewObject));
 
-                        doAppeal.DoAppeal(appealObject, appealRecord.Id,Context);
+                        doAppeal.DoAppeal(appealObject, appealRecord.Id, Context);
                     }
 
                     Context.SaveChanges();
 
-                    if(appealRecord.ItemId.HasValue)
+                    if (appealRecord.ItemId.HasValue)
                     {
                         var item = Context.PerformanceItems
                             .Include(p => p.ItemStaffs)
                             .Include(p => p.Customer)
-                            .Include(p=>p.Reviewer)
-                            .FirstOrDefault(p=>p.Id == appealRecord.ItemId);
+                            .Include(p => p.Reviewer)
+                            .FirstOrDefault(p => p.Id == appealRecord.ItemId);
                         new PerformanceItemController(Context, new Services.FileTaskCacheService()).RefreshPoint(item);
                     }
-                    
+
                     t.Commit();
 
                     return response;
@@ -501,7 +502,7 @@ namespace wispro.sp.api.Controllers
                 response.ErrorMessage = "申诉不存在!";
                 return response;
             }
-            
+
         }
 
         private object ConvertSimpleType(object value, Type destinationType)
@@ -568,7 +569,7 @@ namespace wispro.sp.api.Controllers
 
                             if (temValue != null)
                             {
-                                if(temValue.Value == conditions[2])
+                                if (temValue.Value == conditions[2])
                                 {
                                     isSave = true;
                                 }
@@ -577,15 +578,15 @@ namespace wispro.sp.api.Controllers
                                     if (string.IsNullOrEmpty(temValue.Value))
                                     {
 
-                                        throw (new ApplicationException(string.Format("请选择或输入栏位【{0}】的值!",temValue.InputField.FieldName)));
+                                        throw (new ApplicationException(string.Format("请选择或输入栏位【{0}】的值!", temValue.InputField.FieldName)));
                                     }
                                     else
                                     {
                                         isSave = false;
                                     }
-                                    
+
                                 }
-                                
+
                             }
                         }
                     }
@@ -601,12 +602,12 @@ namespace wispro.sp.api.Controllers
                     InputField field = inputFieldValue.InputField;
                     PerformanceItem Item = Context.PerformanceItems.Where<PerformanceItem>(p =>
                         p.Id == appealRecord.ItemId)
-                        .Include(p => p.ItemStaffs).ThenInclude(it=>it.DoPerson)
+                        .Include(p => p.ItemStaffs).ThenInclude(it => it.DoPerson)
                         .Include(p => p.Reviewer)
                         .FirstOrDefault();
 
                     bool ItemIsNull = false;
-                    if(Item == null)
+                    if (Item == null)
                     {
                         ItemIsNull = true;
                         Item = new PerformanceItem();
@@ -648,11 +649,11 @@ namespace wispro.sp.api.Controllers
                                     }
 
                                     objValue.GetType().GetProperty(pList[pList.Length - 1])
-                                        .SetValue(objValue, ConvertSimpleType(inputFieldValue.Value,Type.GetType(inputFieldValue.InputField.FieldType)));
+                                        .SetValue(objValue, ConvertSimpleType(inputFieldValue.Value, Type.GetType(inputFieldValue.InputField.FieldType)));
                                 }
                             }
                         }
-                        
+
                     }
                     else
                     {
@@ -683,7 +684,7 @@ namespace wispro.sp.api.Controllers
                     .Include(p => p.Type)
                     .OrderBy(p => p.State)
                     .ToList();
-                
+
 
                 foreach (var record in retList)
                 {
@@ -701,12 +702,12 @@ namespace wispro.sp.api.Controllers
                 Log(ex.ToString());
                 return new List<AppealRecord>();
             }
-            
+
         }
 
-        private  void replaceDataForSerialize(AppealRecord record)
+        private void replaceDataForSerialize(AppealRecord record)
         {
-            if(record.Creater !=null)
+            if (record.Creater != null)
             {
                 Staff temStaff = new Staff()
                 {
@@ -729,7 +730,8 @@ namespace wispro.sp.api.Controllers
 
             if (record.Reviewer != null)
             {
-                Staff temStaff = new Staff() { 
+                Staff temStaff = new Staff()
+                {
                     Name = record.Reviewer.Name,
                     Id = record.Creater.Id,
                     ItemStaffs = null,
@@ -757,7 +759,7 @@ namespace wispro.sp.api.Controllers
                     DoItem = record.Item.DoItem,
                     CaseName = record.Item.CaseName,
                     CalMonthId = record.Item.CalMonthId
-                    
+
                 };
 
                 record.Item = temItem;
@@ -770,7 +772,7 @@ namespace wispro.sp.api.Controllers
                 //record.Item.CalMonth = null;
             }
 
-            if(record.Type != null)
+            if (record.Type != null)
             {
                 record.Type.ReviewerExpress = null;
                 record.Type.CanDoExpress = null;
@@ -785,14 +787,14 @@ namespace wispro.sp.api.Controllers
         public List<AppealRecord> QueryByFilter(AppealRecordFilter filter)
         {
             var data = Context.AppealRecords.Where<AppealRecord>(s => true);
-            if(filter.AppealTypeId > 0)
+            if (filter.AppealTypeId > 0)
             {
-                data = Context.AppealRecords.Where(f=>f.TypeId == filter.AppealTypeId);
+                data = Context.AppealRecords.Where(f => f.TypeId == filter.AppealTypeId);
             }
 
-            if(!string.IsNullOrEmpty(filter.CaseNo))
+            if (!string.IsNullOrEmpty(filter.CaseNo))
             {
-                data = data.Where(s=>s.Item.CaseNo.Contains(filter.CaseNo));
+                data = data.Where(s => s.Item.CaseNo.Contains(filter.CaseNo));
             }
 
             if (!string.IsNullOrEmpty(filter.CreateUser))
@@ -807,7 +809,7 @@ namespace wispro.sp.api.Controllers
 
             if (filter.beginCreateTime.HasValue)
             {
-                data = data.Where(s => s.CreateTime>=filter.beginCreateTime.Value  );
+                data = data.Where(s => s.CreateTime >= filter.beginCreateTime.Value);
             }
 
             if (filter.endCreateTime.HasValue)
@@ -869,17 +871,17 @@ namespace wispro.sp.api.Controllers
             return result.ToList();
         }
 
-        public ApiSaveResponse ChangeRecordReviewer(int RecordId,int ReviewerId)
+        public ApiSaveResponse ChangeRecordReviewer(int RecordId, int ReviewerId)
         {
             var data = Context.AppealRecords.FirstOrDefault<AppealRecord>(ar => ar.Id == RecordId);
 
-            if(data != null)
+            if (data != null)
             {
                 var reviewer = Context.Staffs.FirstOrDefault(s => s.Id == ReviewerId);
 
-                var CurrentUser = Context.Staffs.FirstOrDefault(s=>s.Name == User.Identity.Name);
+                var CurrentUser = Context.Staffs.FirstOrDefault(s => s.Name == User.Identity.Name);
 
-                if ((CurrentUser.Id == data.CreaterId || CurrentUser.Id == data.ReviewerId) && data.State ==0)
+                if ((CurrentUser.Id == data.CreaterId || CurrentUser.Id == data.ReviewerId) && data.State == 0)
                 {
 
                     if (reviewer != null)

+ 4 - 4
wispro.sp.api/Controllers/AttachFilesController.cs

@@ -25,7 +25,7 @@ namespace wispro.sp.api.Controllers
         private readonly spDbContext Context;
 
         public AttachFilesController(IWebHostEnvironment env,
-            ILogger<AttachFilesController> logger,spDbContext context)
+            ILogger<AttachFilesController> logger, spDbContext context)
         {
             this.env = env;
             this.logger = logger;
@@ -45,7 +45,7 @@ namespace wispro.sp.api.Controllers
             return contentType;
         }
 
-        [HttpGet,DisableRequestSizeLimit]
+        [HttpGet, DisableRequestSizeLimit]
         public async Task<IActionResult> Download(string Id)
         {
             var filename = Context.AttachFiles.Where<AttachFile>(a => a.Id == new Guid(Id)).FirstOrDefault();
@@ -121,7 +121,7 @@ namespace wispro.sp.api.Controllers
                 var attachFile = new AttachFile();
                 string trustedFileNameForFileStorage;
                 var untrustedFileName = file.FileName;
-                attachFile.Name  = untrustedFileName;
+                attachFile.Name = untrustedFileName;
 
                 Staff uploadUser = Context.Staffs.Where<Staff>(s => s.Name == User.Identity.Name).FirstOrDefault();
 
@@ -149,7 +149,7 @@ namespace wispro.sp.api.Controllers
                             trustedFileNameForFileStorage = Path.GetRandomFileName();
 
                             var attachfileSavePath = utility.ConfigHelper.GetSectionValue("AttachFileSavePath");
-                            var path = Path.Combine(attachfileSavePath,                                
+                            var path = Path.Combine(attachfileSavePath,
                                 trustedFileNameForFileStorage);
 
                             await using FileStream fs = new(path, FileMode.Create);

+ 5 - 5
wispro.sp.api/Controllers/BasePointRuleController.cs

@@ -30,7 +30,7 @@ namespace wispro.sp.api.Controllers
             return Context.BasePointRules.ToList<BasePointRule>();
         }
 
-        
+
         [HttpGet("{id}")]
         public BasePointRule Get(int id)
         {
@@ -49,7 +49,7 @@ namespace wispro.sp.api.Controllers
                 Context.SaveChanges();
                 ret.Success = true;
             }
-            catch(Exception ex)
+            catch (Exception ex)
             {
                 ret.Success = false;
                 ret.ErrorMessage = ex.Message;
@@ -58,15 +58,15 @@ namespace wispro.sp.api.Controllers
             return ret;
         }
 
-        
+
         [HttpPost]
-        public void Update(int id, string field,string value)
+        public void Update(int id, string field, string value)
         {
             string strSQL = $"update basepointrule set {field}={value} where id={id}";
             Context.Database.ExecuteSqlRaw(strSQL);
         }
 
-        
+
         [HttpDelete("{id}")]
         public bool Delete(int id)
         {

+ 6 - 5
wispro.sp.api/Controllers/CalMonthController.cs

@@ -23,9 +23,9 @@ namespace wispro.sp.api.Controllers
 
         public CalMonth GetHandlingMonth()
         {
-            CalMonth calMonth= Context.CalMonths.Where<CalMonth>(c => c.Status != 4).FirstOrDefault();
+            CalMonth calMonth = Context.CalMonths.Where<CalMonth>(c => c.Status != 4).FirstOrDefault();
 
-            if(calMonth== null)
+            if (calMonth == null)
             {
                 return null;
             }
@@ -37,10 +37,11 @@ namespace wispro.sp.api.Controllers
 
         public List<CalMonth> GetAll()
         {
-            var lstAll= Context.CalMonths.ToList();
+            var lstAll = Context.CalMonths.ToList();
 
-            lstAll.Sort((x,y)=> {
-                DateTime str1 = DateTime.Parse( $"{x.Year}-{x.Month}-01");
+            lstAll.Sort((x, y) =>
+            {
+                DateTime str1 = DateTime.Parse($"{x.Year}-{x.Month}-01");
                 DateTime str2 = DateTime.Parse($"{y.Year}-{y.Month}-01");
 
                 return str2.CompareTo(str1);

+ 98 - 89
wispro.sp.api/Controllers/CaseFileCompareController.cs

@@ -111,7 +111,8 @@ namespace wispro.sp.api.Controllers
                     }
                     #endregion
 
-                    if (caseInfo.DRRAbstract != null) {
+                    if (caseInfo.DRRAbstract != null)
+                    {
                         Context.CaseCompareResults.Add(caseInfo.DRRAbstract);
                         Context.SaveChanges();
                         caseInfo.DRRAbstractId = caseInfo.DRRAbstract.Id;
@@ -179,7 +180,7 @@ namespace wispro.sp.api.Controllers
                     ret.ErrorMessage = ex.Message;
                     Context.Database.RollbackTransaction();
                 }
-               
+
             }
 
             return ret;
@@ -217,7 +218,7 @@ namespace wispro.sp.api.Controllers
                     .Include(pi => pi.DRRCalim)
                     .Include(pi => pi.DRRAbstract)
                     .Include(pi => pi.DRRFulltext)
-                    .Include(pi=>pi.DRRAll)
+                    .Include(pi => pi.DRRAll)
                     .Include(pi => pi.RFRCalim)
                     .Include(pi => pi.RFRAbstract)
                     .Include(pi => pi.RFRFulltext)
@@ -266,7 +267,7 @@ namespace wispro.sp.api.Controllers
         public static (double, double) UpdateStatistics(int n, double mean, double variance, double newValue)
         {
             double newMean = (n * mean + newValue) / (n + 1);
-            
+
             double newVariance = Math.Sqrt((n * (mean - newMean) * (mean - newMean) + (newValue - newMean) * (newValue - newMean) + n * variance * variance) / (n + 1));
 
             return (newMean, newVariance);
@@ -278,9 +279,9 @@ namespace wispro.sp.api.Controllers
         /// <param name="endDate">结束日期</param>
         /// /// <param name="customerName">客户名称,默认不指定,获取所有客户的平均权利要求差异度和标准方差</param>
         /// <returns></returns>
-        private List<CustomerCompareStatistics> getLaseYearMean_Variance(DateTime endDate,List<CaseInfo> caseList,string customerName=null)
+        private List<CustomerCompareStatistics> getLaseYearMean_Variance(DateTime endDate, List<CaseInfo> caseList, string customerName = null)
         {
-            if(caseList == null)
+            if (caseList == null)
             {
                 caseList = Context.CaseInfos.Where<CaseInfo>(
                         p => p.CreateTime >= endDate.AddYears(-1) &&
@@ -303,18 +304,20 @@ namespace wispro.sp.api.Controllers
 
             //IIncludableQueryable<CaseInfo, CompareResult> caseList;
             var temcaseList = caseList;
-            if (customerName != null) {
-                temcaseList = caseList.Where(p=> p.Customer.Name == customerName)
+            if (customerName != null)
+            {
+                temcaseList = caseList.Where(p => p.Customer.Name == customerName)
                 .ToList();
             }
-            
 
-            List < CustomerCompareStatistics > retList = new List < CustomerCompareStatistics >();
 
-            foreach ( var item in temcaseList)
+            List<CustomerCompareStatistics> retList = new List<CustomerCompareStatistics>();
+
+            foreach (var item in temcaseList)
             {
-                var temObj = retList.Where(p=>p.CustomerName == item.Customer.Name).FirstOrDefault<CustomerCompareStatistics>();
-                if(temObj == null) {
+                var temObj = retList.Where(p => p.CustomerName == item.Customer.Name).FirstOrDefault<CustomerCompareStatistics>();
+                if (temObj == null)
+                {
                     temObj = new CustomerCompareStatistics();
                     temObj.CustomerName = item.Customer.Name;
                     retList.Add(temObj);
@@ -324,7 +327,8 @@ namespace wispro.sp.api.Controllers
 
                 if (item.DRRCalim != null)
                 {
-                    if (temObj.Diff_FinalDrafted_Claims_Count > 0) {
+                    if (temObj.Diff_FinalDrafted_Claims_Count > 0)
+                    {
                         var retStatistics = UpdateStatistics(temObj.Diff_Drafted_Claims_Count, temObj.Diff_Drafted_Claims_Avg, temObj.Diff_Drafted_Claims_Std, item.DRRCalim.diffRate);
                         temObj.Diff_Drafted_Claims_Std = retStatistics.Item2;
                         temObj.Diff_Drafted_Claims_Avg = retStatistics.Item1;
@@ -370,10 +374,11 @@ namespace wispro.sp.api.Controllers
         ///     1:内部核稿差异率
         /// </param>
         /// <returns></returns>
-        private List<CaseInfo> getTop10DiffRateCases(DateTime start, DateTime end,string customerName,int type=0,List<CaseInfo> caseList=null)
+        private List<CaseInfo> getTop10DiffRateCases(DateTime start, DateTime end, string customerName, int type = 0, List<CaseInfo> caseList = null)
         {
-            if (caseList == null) {
-                
+            if (caseList == null)
+            {
+
                 caseList = Context.CaseInfos.Where<CaseInfo>(
                     p => p.CreateTime >= end.AddYears(-1) &&
                     p.CreateTime <= end &&
@@ -391,14 +396,15 @@ namespace wispro.sp.api.Controllers
                 .Include(p => p.RFRFulltext)
                 .Include(p => p.RFRAll)
                 .ToList();
-                
+
             }
-            if (type == 0) {
+            if (type == 0)
+            {
 
-                var top10Case = caseList.Where<CaseInfo>(p=>p.Customer.Name == customerName)
+                var top10Case = caseList.Where<CaseInfo>(p => p.Customer.Name == customerName)
                 .OrderByDescending(p => p.RFRCalim?.diffRate).Take(10);
 
-                return top10Case.Where<CaseInfo>(c=>c.CreateTime>=start).ToList();
+                return top10Case.Where<CaseInfo>(c => c.CreateTime >= start).ToList();
             }
             else
             {
@@ -416,19 +422,20 @@ namespace wispro.sp.api.Controllers
         /// <param name="end">结束日期</param>
         /// <param name="customerName">客户名称</param>
         /// <returns></returns>
-        private List<CaseInfo> GetAbnormalCases(DateTime start, DateTime end, string customerName,List<CaseInfo> caseList)
+        private List<CaseInfo> GetAbnormalCases(DateTime start, DateTime end, string customerName, List<CaseInfo> caseList)
         {
-            var customerStatics = getLaseYearMean_Variance(end, caseList,customerName);
+            var customerStatics = getLaseYearMean_Variance(end, caseList, customerName);
             var cStatics = customerStatics.Where(s => s.CustomerName == customerName).FirstOrDefault();
-            return _GetAbnormalCases(start, end, customerName, cStatics,caseList);
+            return _GetAbnormalCases(start, end, customerName, cStatics, caseList);
 
         }
 
-        private  List<CaseInfo> _GetAbnormalCases(DateTime start, DateTime end, string customerName, CustomerCompareStatistics cStatics,List<CaseInfo> caseList)
+        private List<CaseInfo> _GetAbnormalCases(DateTime start, DateTime end, string customerName, CustomerCompareStatistics cStatics, List<CaseInfo> caseList)
         {
             if (cStatics != null)
             {
-                if (caseList == null) {
+                if (caseList == null)
+                {
                     caseList = Context.CaseInfos.Where<CaseInfo>(
                         p => p.CreateTime >= end.AddYears(-1) &&
                         p.CreateTime <= end &&
@@ -451,7 +458,7 @@ namespace wispro.sp.api.Controllers
 
                 var retList = new List<CaseInfo>();
 
-                var temCaseList = caseList.Where(p=>p.Customer.Name== customerName).ToList();
+                var temCaseList = caseList.Where(p => p.Customer.Name == customerName).ToList();
 
                 foreach (var item in temCaseList)
                 {
@@ -511,7 +518,7 @@ namespace wispro.sp.api.Controllers
 
             public List<CaseInfo> Top10Cases { get; set; } = new List<CaseInfo>();
 
-            public List<CaseInfo> AbnormalCases { get; set; }= new List<CaseInfo>();
+            public List<CaseInfo> AbnormalCases { get; set; } = new List<CaseInfo>();
         }
 
         public void getMailCaseInfo(DateTime start, DateTime end)
@@ -533,20 +540,20 @@ namespace wispro.sp.api.Controllers
                 .Include(p => p.RFRAll)
                 .ToList();
 
-            List<string> defaultStaffNames = new List<string>() { "罗才洋","李庆波","钟子敏"};
+            List<string> defaultStaffNames = new List<string>() { "罗才洋", "李庆波", "钟子敏" };
             var DefaultEmailAccounts = Context.Staffs.Where(p => defaultStaffNames.Contains(p.Name)).ToList();
-            
-            var customerStatics = getLaseYearMean_Variance(end,caseList);
+
+            var customerStatics = getLaseYearMean_Variance(end, caseList);
             Hashtable staffMailInfo = new Hashtable();
             foreach (var cStatics in customerStatics)
             {
-                if(cStatics.CaseCount < 20)
+                if (cStatics.CaseCount < 20)
                 {
                     continue;
                 }
 
                 //var cStatics = customerStatics.Where(s => s.CustomerName == item.Customer.Name).FirstOrDefault();
-                var Top10Cases =getTop10DiffRateCases(start, end, cStatics.CustomerName,0,caseList);
+                var Top10Cases = getTop10DiffRateCases(start, end, cStatics.CustomerName, 0, caseList);
                 foreach (var caseInfo in Top10Cases)
                 {
                     foreach (Staff staff in DefaultEmailAccounts)
@@ -556,7 +563,7 @@ namespace wispro.sp.api.Controllers
 
                     if (caseInfo.Reviewer != null)
                     {
-                        AddtoHashTable(caseInfo,0, caseInfo.Reviewer,staffMailInfo,cStatics);
+                        AddtoHashTable(caseInfo, 0, caseInfo.Reviewer, staffMailInfo, cStatics);
                     }
 
                     if (caseInfo.Customer.ResponseManId != null)
@@ -569,10 +576,10 @@ namespace wispro.sp.api.Controllers
                     }
                 }
 
-                var AbnormalCases = _GetAbnormalCases(start,end, cStatics.CustomerName, cStatics,caseList);
+                var AbnormalCases = _GetAbnormalCases(start, end, cStatics.CustomerName, cStatics, caseList);
                 foreach (var caseInfo in AbnormalCases)
                 {
-                    foreach(Staff staff in DefaultEmailAccounts)
+                    foreach (Staff staff in DefaultEmailAccounts)
                     {
                         AddtoHashTable(caseInfo, 1, staff, staffMailInfo, cStatics);
                     }
@@ -593,15 +600,16 @@ namespace wispro.sp.api.Controllers
 
             }
 
-            if (staffMailInfo.Count > 0) { 
+            if (staffMailInfo.Count > 0)
+            {
                 foreach (var key in staffMailInfo.Keys)
                 {
                     Staff staff = key as Staff;
                     List<mailCaseInfo> mailCases = (List<mailCaseInfo>)staffMailInfo[key];
 
-                    
-                    string strMessage = string.Empty ;
-                    foreach(var m in mailCases)
+
+                    string strMessage = string.Empty;
+                    foreach (var m in mailCases)
                     {
                         if ((m.Top10Cases != null && m.Top10Cases.Count > 0) || (m.AbnormalCases != null && m.AbnormalCases.Count > 0))
                         {
@@ -615,7 +623,7 @@ namespace wispro.sp.api.Controllers
                                 strMessage += "<table border='1'><thead><td>案号</td><td>案件名称</td><td>处理人</td><td>核稿人</td><td>内部核稿修改率(%)</td><td>外部核稿修改率(%)</td></thead><body>";
                                 foreach (var c in m.Top10Cases)
                                 {
-                                    strMessage += $"<tr><td><a href=\"{($"http://1.116.113.26/CompareFile/detail/{c.CaseNo}")}\">{c.CaseNo}</a></td><td>{c.CaseName}</td><td>{c.Handlers}</td><td>{(c.Reviewer == null ? "" : c.Reviewer.Name)}</td><td>{(c.DRRCalim == null ? "" : (c.DRRCalim.diffRate*100).ToString("0.0000"))}</td><td>{(c.RFRCalim == null ? "" : (c.RFRCalim.diffRate * 100).ToString("0.0000"))}</td></tr>";
+                                    strMessage += $"<tr><td><a href=\"{($"http://1.116.113.26/CompareFile/detail/{c.CaseNo}")}\">{c.CaseNo}</a></td><td>{c.CaseName}</td><td>{c.Handlers}</td><td>{(c.Reviewer == null ? "" : c.Reviewer.Name)}</td><td>{(c.DRRCalim == null ? "" : (c.DRRCalim.diffRate * 100).ToString("0.0000"))}</td><td>{(c.RFRCalim == null ? "" : (c.RFRCalim.diffRate * 100).ToString("0.0000"))}</td></tr>";
                                 }
                                 strMessage += "</body></table>";
                             }
@@ -626,14 +634,14 @@ namespace wispro.sp.api.Controllers
                                 strMessage += "<table border='1'><thead><td>案号</td><td>案件名称</td><td>处理人</td><td>核稿人</td><td>内部核稿修改率</td><td>外部核稿修改率</td><td>异常说明</td></thead><body>";
                                 foreach (var c in m.AbnormalCases)
                                 {
-                                    strMessage += $"<tr><td><a href=\"{($"http://1.116.113.26/CompareFile/detail/{c.CaseNo}")}\">{c.CaseNo}</a></td><td>{c.CaseName}</td><td>{c.Handlers}</td><td>{(c.Reviewer == null ? "" : c.Reviewer.Name)}</td><td>{(c.DRRCalim == null ? "" : (c.DRRCalim.diffRate*100).ToString("0.0000"))}</td><td>{(c.RFRCalim == null ? "" : (c.RFRCalim.diffRate*100).ToString("0.0000"))}</td><td>{c.AbnormalMessage}</td></tr>";
+                                    strMessage += $"<tr><td><a href=\"{($"http://1.116.113.26/CompareFile/detail/{c.CaseNo}")}\">{c.CaseNo}</a></td><td>{c.CaseName}</td><td>{c.Handlers}</td><td>{(c.Reviewer == null ? "" : c.Reviewer.Name)}</td><td>{(c.DRRCalim == null ? "" : (c.DRRCalim.diffRate * 100).ToString("0.0000"))}</td><td>{(c.RFRCalim == null ? "" : (c.RFRCalim.diffRate * 100).ToString("0.0000"))}</td><td>{c.AbnormalMessage}</td></tr>";
                                 }
                                 strMessage += "</body></table><br/>";
                             }
 
                             strMessage += "</div>";
                         }
-                        
+
                     }
 
                     string strTem = $"如下是{start.ToString("yyyy-MM-dd")}到{end.ToString("yyyy-MM-dd")}国内专利申请案件在客户核稿处于年内修改率前10名的案件和疑似异常案件清单,请关注!";
@@ -645,7 +653,7 @@ namespace wispro.sp.api.Controllers
             }
         }
 
-        private void AddtoHashTable(CaseInfo caseInfo, int v, Staff staff, Hashtable staffMailInfo,CustomerCompareStatistics cStatics)
+        private void AddtoHashTable(CaseInfo caseInfo, int v, Staff staff, Hashtable staffMailInfo, CustomerCompareStatistics cStatics)
         {
             var staffCaseMailInfo = new mailCaseInfo()
             {
@@ -659,7 +667,7 @@ namespace wispro.sp.api.Controllers
             }
             else
             {
-                staffMailInfo.Add(staff,staffCaseMailInfos);
+                staffMailInfo.Add(staff, staffCaseMailInfos);
             }
 
             var temObj = staffCaseMailInfos.Where(p => p.CustomerCompareStatistics.CustomerName == caseInfo.Customer.Name).FirstOrDefault();
@@ -715,7 +723,7 @@ namespace wispro.sp.api.Controllers
 
         }
 
-        private DataTable  CoverttoDatable(List<retObject> ObjList)
+        private DataTable CoverttoDatable(List<retObject> ObjList)
         {
             System.Data.DataTable dt = new System.Data.DataTable();
             dt.Columns.Add("我方文号");
@@ -774,14 +782,14 @@ namespace wispro.sp.api.Controllers
         /// 4: 基于权要文字修改差异度计算
         /// </param>
         /// <returns></returns>
-        private IList<retObject> 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.CreateTime >= start && p.CreateTime < end)
-                .Include(p=>p.Customer)
-                .Include(p=>p.Reviewer)
-                .Include(p=>p.DRRAbstract)
+                .Include(p => p.Customer)
+                .Include(p => p.Reviewer)
+                .Include(p => p.DRRAbstract)
                 .Include(p => p.DRRAbstract)
                 .Include(p => p.DRRCalim)
                 .Include(p => p.DRRFulltext)
@@ -804,11 +812,11 @@ namespace wispro.sp.api.Controllers
                 iIndex++;
                 Debug.WriteLine($"{iIndex}/{iTotals}\t{caseInfo.CaseNo}\t{caseInfo.DRRAbstractId},{caseInfo.DRRCalimId},{caseInfo.DRRFulltextId},{caseInfo.DRRAllId},{caseInfo.RFRAbstractId},{caseInfo.RFRCalimId},{caseInfo.RFRFulltextId},{caseInfo.RFRAllId}");
                 string tmpCustomerName = "未知";
-                if(caseInfo.Customer!= null)
+                if (caseInfo.Customer != null)
                 {
                     tmpCustomerName = caseInfo.Customer.Name;
                 }
-                
+
                 var one = avg_std1.Where<CustomerAvg_Std>(p => p.Name == tmpCustomerName).FirstOrDefault();
                 if (one == null)
                 {
@@ -823,7 +831,7 @@ namespace wispro.sp.api.Controllers
                 }
 
                 double? oneTmp = getCalValue(caseInfo, type, 0);
-                if(oneTmp != null)
+                if (oneTmp != null)
                 {
                     one.Sum += oneTmp.Value;
                     one.SquareSum += oneTmp.Value * oneTmp.Value;
@@ -850,7 +858,7 @@ namespace wispro.sp.api.Controllers
                 var one = avg_std1.Where<CustomerAvg_Std>(p => p.Name == tmpCustomerName).FirstOrDefault();
                 var two = avg_std2.Where<CustomerAvg_Std>(p => p.Name == tmpCustomerName).FirstOrDefault();
 
-                double? oneSim = getCalValue(item,type,0);
+                double? oneSim = getCalValue(item, type, 0);
                 double? twoSim = getCalValue(item, type, 1);
                 temObj.FinishedDate = item.CreateTime;
 
@@ -864,19 +872,19 @@ namespace wispro.sp.api.Controllers
                 if (oneSim != null)
                 {
                     zScoreA = (oneSim - one.Average) / one.Std_Deviation;
-                    
+
                 }
 
                 temObj.InternalScore = zScoreA;
                 temObj.InternalSim = oneSim;
                 temObj.InternalAvg = one.Average;
                 temObj.InternalStd = one.Std_Deviation;
-                
+
                 double? zScoreB = null;
                 if (twoSim != null)
                 {
                     zScoreB = (twoSim - two.Average) / two.Std_Deviation;
-                    
+
                 }
                 temObj.CustomerSim = twoSim;
                 temObj.CustomerAvg = two.Average;
@@ -891,7 +899,7 @@ namespace wispro.sp.api.Controllers
                 {
                     var distince = Math.Sqrt(zScoreB.Value * zScoreB.Value + zScoreA.Value * zScoreA.Value);
 
-                    if (type == 0 || type == 2 || type==3)
+                    if (type == 0 || type == 2 || type == 3)
                     {
                         if (distince > 3)
                         {
@@ -948,12 +956,12 @@ namespace wispro.sp.api.Controllers
                 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)
+        public void MonthlyReport(int year, int month)
         {
             #region 获取一年的案件清单,并计算个案件的清单
             DateTime endDate = new DateTime(year, month + 1, 1);
@@ -1059,12 +1067,12 @@ namespace wispro.sp.api.Controllers
                 #endregion
             }
 
-            SendMail(year, month, reviewerHash,"核稿");
+            SendMail(year, month, reviewerHash, "核稿");
 
             SendMail(year, month, crHash, "对接客户");
 
             SendMail(year, month, dphash, "部门人员处理");
-            
+
 
             DataTable dt = CoverttoDatable(top10List);
             string top10_filePath = System.IO.Path.Combine(System.IO.Path.GetTempPath(), $"{year}年{month}月客户修改权要排名前10的案件清单.xlsx");
@@ -1089,7 +1097,7 @@ namespace wispro.sp.api.Controllers
                 .ToList();
             DataTable alldt = CoverttoDatable(allItemList);
 
-            string all_filePath = System.IO.Path.Combine(System.IO.Path.GetTempPath(),$"{year}年{month}月案件清单.xlsx");
+            string all_filePath = System.IO.Path.Combine(System.IO.Path.GetTempPath(), $"{year}年{month}月案件清单.xlsx");
             utility.NPOIExcel.DataTableToExcel(alldt, all_filePath, true, true, 0, "http://1.116.113.26/CompareFile/detail/{0}");
 
             #endregion
@@ -1102,7 +1110,7 @@ namespace wispro.sp.api.Controllers
             #endregion
         }
 
-        private void SendMail(int year, int month, Hashtable objHash,string type)
+        private void SendMail(int year, int month, Hashtable objHash, string type)
         {
             foreach (Staff sf in objHash.Keys)
             {
@@ -1111,26 +1119,26 @@ namespace wispro.sp.api.Controllers
                 string strPath = System.IO.Path.Combine(System.IO.Path.GetTempPath(), $"{year}年{month}月客户修改权要排名前10的案件清单({type})_{sf.Name}.xlsx");
                 utility.NPOIExcel.DataTableToExcel(temdt, strPath, true, true, 0, "http://1.116.113.26/CompareFile/detail/{0}");
                 string strBody = $"{sf.Name},你好!<br>附件中的案件是{year}年{month}月您{type}的案件,客户权要修改率在前10的案件,请注意!";
-                
+
                 _ = QuartzUtil.AddMailJob($"{year}年{month}月申请文件比较邮件", strBody, sf.Name, sf.Mail, $"{strPath}");
             }
         }
 
-        private double? getCalValue(CaseInfo caseInfo,int type,int stage)
+        private double? getCalValue(CaseInfo caseInfo, int type, int stage)
         {
             double? calValue = null;
             switch (type)
             {
                 case 0:
-                    if(stage == 0)
+                    if (stage == 0)
                     {
-                        if(caseInfo.DRRFulltext != null && caseInfo.DRRAbstract != null)
+                        if (caseInfo.DRRFulltext != null && caseInfo.DRRAbstract != null)
                         {
                             calValue = caseInfo.DRRAll.TextSimilarity;
                         }
                         else
                         {
-                            if(caseInfo.DRRCalim != null)
+                            if (caseInfo.DRRCalim != null)
                             {
                                 calValue = caseInfo.DRRCalim.TextSimilarity;
                             }
@@ -1184,19 +1192,19 @@ namespace wispro.sp.api.Controllers
                 case 2:
                     if (stage == 0)
                     {
-                        if(caseInfo.DRRFulltext != null && caseInfo.DRRCalim!= null)
+                        if (caseInfo.DRRFulltext != null && caseInfo.DRRCalim != null)
                         {
                             calValue = caseInfo.DRRCalim.TextSimilarity * 0.7 + caseInfo.DRRFulltext.TextSimilarity * 0.3;
                         }
                         else
                         {
-                            if( caseInfo.DRRCalim != null)
+                            if (caseInfo.DRRCalim != null)
                             {
                                 calValue = caseInfo.DRRCalim.TextSimilarity;
                             }
                             else
                             {
-                                if(caseInfo.DRRAll != null)
+                                if (caseInfo.DRRAll != null)
                                 {
                                     calValue = caseInfo.DRRAll.TextSimilarity;
                                 }
@@ -1228,7 +1236,7 @@ namespace wispro.sp.api.Controllers
                 case 3:
                     if (stage == 0)
                     {
-                        
+
                         if (caseInfo.DRRCalim != null)
                         {
                             calValue = caseInfo.DRRCalim.TextSimilarity;
@@ -1283,20 +1291,20 @@ namespace wispro.sp.api.Controllers
         }
 
 
-        public IList<Object> CalMean_Std(DateTime start,DateTime end)
+        public IList<Object> CalMean_Std(DateTime start, DateTime end)
         {
             double AverageA = Context.CaseInfos.Where<CaseInfo>(
-                p => p.FinalVersionDate >= start && p.FinalVersionDate <= end && p.DRRCalim!= null)
-                .Average(x=>x.DRRCalim.TextSimilarity);
-               
+                p => p.FinalVersionDate >= start && p.FinalVersionDate <= end && p.DRRCalim != null)
+                .Average(x => x.DRRCalim.TextSimilarity);
+
             double AverageB = Context.CaseInfos.Where<CaseInfo>(
                 p => p.FinalVersionDate >= start && p.FinalVersionDate <= end && p.RFRAll != null)
                 .Average(x => x.RFRAll.TextSimilarity);
 
-            double stdA = Math.Sqrt( Context.CaseInfos.Where<CaseInfo>(
+            double stdA = Math.Sqrt(Context.CaseInfos.Where<CaseInfo>(
                 p => p.FinalVersionDate >= start && p.FinalVersionDate <= end)
                 .Average((x => (x.DRRCalim.TextSimilarity - AverageA) * (x.DRRCalim.TextSimilarity - AverageA))));
-                
+
 
             double stdB = Math.Sqrt(Context.CaseInfos.Where<CaseInfo>(
                 p => p.FinalVersionDate >= start && p.FinalVersionDate <= end)
@@ -1304,23 +1312,24 @@ namespace wispro.sp.api.Controllers
 
             var response2 = Context.CaseInfos.Where<CaseInfo>(
                 p => p.FinalVersionDate >= start && p.FinalVersionDate <= end)
-                .Include(p=>p.DRRCalim)
-                .Include(p=>p.RFRAll);
-            
+                .Include(p => p.DRRCalim)
+                .Include(p => p.RFRAll);
+
             IList<Object> results = new List<Object>();
-            foreach(var item in response2.ToList())
+            foreach (var item in response2.ToList())
             {
                 results.Add(
-                    new { 
+                    new
+                    {
                         Id = item.Id,
                         CaseNo = item.CaseNo,
                         CaseName = item.CaseName,
                         Customer = item.Customer,
                         Reviewer = item.Reviewer,
                         Handlers = item.Handlers,
-                        zScoreA = (item.DRRCalim?.TextSimilarity -AverageA)/stdA,
-                        zScoreB = (item.RFRAll?.TextSimilarity - AverageB) /stdB
-                    }    
+                        zScoreA = (item.DRRCalim?.TextSimilarity - AverageA) / stdA,
+                        zScoreB = (item.RFRAll?.TextSimilarity - AverageB) / stdB
+                    }
                 );
             }
 
@@ -1357,7 +1366,7 @@ namespace wispro.sp.api.Controllers
         private IQueryable<CaseInfo> NewMethod(QueryFilter queryFilter)
         {
             string strExpress = "";
-            
+
             if (queryFilter.ConditionTree != null)
             {
                 strExpress = GetExpress(queryFilter.ConditionTree);
@@ -1366,7 +1375,7 @@ namespace wispro.sp.api.Controllers
             var interpreter = new Interpreter();
             if (string.IsNullOrEmpty(strExpress))
             {
-                return new spDbContext().CaseInfos.Where<CaseInfo>(p=>(p.Id>0));
+                return new spDbContext().CaseInfos.Where<CaseInfo>(p => (p.Id > 0));
             }
             else
             {

+ 14 - 13
wispro.sp.api/Controllers/ConditinController.cs

@@ -26,9 +26,9 @@ namespace wispro.sp.api.Controllers
             Context = context;
         }
 
-        
-        
-        private List<Staff> GetStaffList(UserField userField,object dynBindObject,entity.workflowInstance.WorkflowInstance Instance)
+
+
+        private List<Staff> GetStaffList(UserField userField, object dynBindObject, entity.workflowInstance.WorkflowInstance Instance)
         {
             switch (userField.UserConditionType)
             {
@@ -40,14 +40,15 @@ namespace wispro.sp.api.Controllers
                             (s.Positions.Where<DepartmentPosition>(p => p.departmentId == deptId).Count() > 0))
                             .ToList<Staff>();
                     }
-                    catch(Exception ex)
+                    catch (Exception ex)
                     {
-                        throw ex;
+                        throw;
                     }
-                    
+
                     break;
                 case UserConditionType.DepartmentPosition:
-                    try {
+                    try
+                    {
                         var deptId = int.Parse(userField.Department);
                         var pId = int.Parse(userField.Positon);
 
@@ -60,12 +61,12 @@ namespace wispro.sp.api.Controllers
                         throw new ApplicationException("没有找到指定的部门或职位");
                     }
                     break;
-                    
+
                 case UserConditionType.Staff:
-                    return new List<Staff>{ GetUser(userField, dynBindObject)};
+                    return new List<Staff> { GetUser(userField, dynBindObject) };
                     break;
                 case UserConditionType.UserDepartment:
-                    Staff temUser =  GetUser(userField, dynBindObject);
+                    Staff temUser = GetUser(userField, dynBindObject);
 
                     if (temUser != null)
                     {
@@ -73,7 +74,7 @@ namespace wispro.sp.api.Controllers
                             d.departmentId == int.Parse(userField.Department)
                             && d.StaffId == temUser.Id).FirstOrDefault();
                         var temDeptId = temDeptPosition.departmentId;
-                        var retList = Context.DepartmentPositions.Where<DepartmentPosition>(dp => 
+                        var retList = Context.DepartmentPositions.Where<DepartmentPosition>(dp =>
                             dp.departmentId == temDeptId)
                             .Select(s => s.Staff)
                             .ToList();
@@ -94,8 +95,8 @@ namespace wispro.sp.api.Controllers
                             d.departmentId == int.Parse(userField.Department)
                             && d.StaffId == temUser1.Id).FirstOrDefault();
                         var temDeptId = temDeptPosition.departmentId;
-                        var retList = Context.DepartmentPositions.Where<DepartmentPosition>(dp => 
-                            dp.departmentId == temDeptId && 
+                        var retList = Context.DepartmentPositions.Where<DepartmentPosition>(dp =>
+                            dp.departmentId == temDeptId &&
                             dp.PositionId == int.Parse(userField.Positon))
                             .Select(s => s.Staff)
                             .ToList();

+ 1 - 1
wispro.sp.api/Controllers/FileProcesTaskController.cs

@@ -30,7 +30,7 @@ namespace wispro.sp.api.Controllers
         [HttpGet, DisableRequestSizeLimit]
         public async Task<IActionResult> Download(string Id)
         {
-            
+
             var filename = fileTaskService.Get(Id);
 
             if (filename != null)

+ 18 - 15
wispro.sp.api/Controllers/IPEasyController.cs

@@ -23,7 +23,7 @@ namespace wispro.sp.api.Controllers
         }
 
         #region 将从IPEasy中获得的信息保存到临时文件或从文件中取出已存在的信息
-        private PerformanceItem GetFromCache(string CaseNo,string DoItem = null)
+        private PerformanceItem GetFromCache(string CaseNo, string DoItem = null)
         {
             var attachfileSavePath = utility.ConfigHelper.GetSectionValue("AttachFileSavePath");
             string fileName = $"{CaseNo}{(string.IsNullOrEmpty(DoItem) ? "" : $"-{DoItem}")}.json";
@@ -33,7 +33,7 @@ namespace wispro.sp.api.Controllers
 
             if (System.IO.File.Exists(path))
             {
-                if(new FileInfo(path).CreationTime < DateTime.Now.AddDays(-1))
+                if (new FileInfo(path).CreationTime < DateTime.Now.AddDays(-1))
                 {
                     return null;
                 }
@@ -46,9 +46,9 @@ namespace wispro.sp.api.Controllers
                     {
                         IgnoreNullValues = true
                     };
-                    return System.Text.Json.JsonSerializer.Deserialize<PerformanceItem>(strJson,options);
+                    return System.Text.Json.JsonSerializer.Deserialize<PerformanceItem>(strJson, options);
                 }
-                    
+
             }
             else
             {
@@ -69,18 +69,19 @@ namespace wispro.sp.api.Controllers
                 System.IO.File.Delete(path);
             }
 
-            JsonSerializerOptions options = new System.Text.Json.JsonSerializerOptions() {
+            JsonSerializerOptions options = new System.Text.Json.JsonSerializerOptions()
+            {
                 IgnoreNullValues = true
-                
+
             };
-            
-            string strJson = System.Text.Json.JsonSerializer.Serialize<PerformanceItem>(Item,options);
+
+            string strJson = System.Text.Json.JsonSerializer.Serialize<PerformanceItem>(Item, options);
 
             using (var file = System.IO.File.CreateText(path))
             {
                 file.Write(strJson);
             }
-              
+
         }
         #endregion
 
@@ -114,16 +115,18 @@ namespace wispro.sp.api.Controllers
 
         public PerformanceItem GetItemInfo(string CaseNo, string DoItem)
         {
-            var retItem = GetFromCache(CaseNo,DoItem);
+            var retItem = GetFromCache(CaseNo, DoItem);
             if (retItem != null)
             {
                 return retItem;
             }
             else
             {
-                dynamic retObj = new Job.UpdateJXDataFromIPEasyJob().GetItemFromIPEasyDB(new PerformanceItem() { 
-                    CaseNo = CaseNo,DoItem = DoItem
-                },new spDbContext());// wispro.sp.utility.IPEasyUtility.GetPerformanceRecord(CaseNo, DoItem);
+                dynamic retObj = new Job.UpdateJXDataFromIPEasyJob().GetItemFromIPEasyDB(new PerformanceItem()
+                {
+                    CaseNo = CaseNo,
+                    DoItem = DoItem
+                }, new spDbContext());// wispro.sp.utility.IPEasyUtility.GetPerformanceRecord(CaseNo, DoItem);
                 PerformanceItem Item = new PerformanceItem();
                 Item.CaseName = retObj.CaseName;
                 Item.CaseNo = retObj.CaseNo;
@@ -197,7 +200,7 @@ namespace wispro.sp.api.Controllers
             }
         }
 
-        public PerformanceItem GetDoItemInfo(string CaseNo, string DoItem,string caseStage)
+        public PerformanceItem GetDoItemInfo(string CaseNo, string DoItem, string caseStage)
         {
             var retItem = GetFromCache(CaseNo, DoItem);
             if (retItem != null)
@@ -207,7 +210,7 @@ namespace wispro.sp.api.Controllers
             else
             {
                 dynamic retObj = new Job.UpdateJXDataFromIPEasyJob().GetItemFromIPEasyDB(
-                    new PerformanceItem() { CaseNo =CaseNo,DoItem=DoItem,CaseStage = caseStage},
+                    new PerformanceItem() { CaseNo = CaseNo, DoItem = DoItem, CaseStage = caseStage },
                     new spDbContext()
                  );  //wispro.sp.utility.IPEasyUtility.GetPerformanceRecord(CaseNo, DoItem,caseStage);
 

+ 32 - 32
wispro.sp.api/Controllers/OrganizationController.cs

@@ -26,19 +26,19 @@ namespace wispro.sp.api.Controllers
         [HttpPost]
         public Department SaveDept(Department dept)
         {
-            if(dept.Id > 0)
+            if (dept.Id > 0)
             {
-                var inDbObj = Context.Departments.FirstOrDefault<Department>(d=>d.Id == dept.Id);
+                var inDbObj = Context.Departments.FirstOrDefault<Department>(d => d.Id == dept.Id);
 
                 inDbObj.Name = dept.Name;
                 inDbObj.Memo = dept.Memo;
 
-                if(dept.order_num != inDbObj.order_num)
+                if (dept.order_num != inDbObj.order_num)
                 {
                     inDbObj.order_num = dept.order_num;
                 }
 
-                if(dept.parentId != inDbObj.parentId)
+                if (dept.parentId != inDbObj.parentId)
                 {
                     inDbObj.parentId = dept.parentId;
                     Department parentDept = null;
@@ -46,7 +46,7 @@ namespace wispro.sp.api.Controllers
                     {
                         parentDept = Context.Departments.FirstOrDefault<Department>(d => d.Id == dept.parentId);
                     }
-                    
+
                     if (parentDept != null || !string.IsNullOrEmpty(parentDept.ancestors))
                     {
 
@@ -79,7 +79,7 @@ namespace wispro.sp.api.Controllers
                 Context.SaveChanges();
 
                 return inDbObj;
-                
+
             }
             else
             {
@@ -88,11 +88,11 @@ namespace wispro.sp.api.Controllers
                 {
                     parentDept = Context.Departments.FirstOrDefault<Department>(d => d.Id == dept.parentId);
                 }
-                
+
 
                 if (dept.order_num == null)
                 {
-                    if(parentDept == null)
+                    if (parentDept == null)
                     {
                         var temOrderNum = Context.Departments.Where<Department>(d => d.parentId == null).Max(d => d.order_num);
                         if (temOrderNum != null)
@@ -106,7 +106,7 @@ namespace wispro.sp.api.Controllers
                     }
                     else
                     {
-                        var temOrderNum = Context.Departments.Where<Department>(d => d.parentId == parentDept.Id ).Max(d => d.order_num);
+                        var temOrderNum = Context.Departments.Where<Department>(d => d.parentId == parentDept.Id).Max(d => d.order_num);
                         if (temOrderNum != null)
                         {
                             dept.order_num = temOrderNum + 1;
@@ -116,11 +116,11 @@ namespace wispro.sp.api.Controllers
                             dept.order_num = 1;
                         }
                     }
-                    
-                    
+
+
                 }
 
-                if(parentDept != null && !string.IsNullOrEmpty(parentDept.ancestors ))
+                if (parentDept != null && !string.IsNullOrEmpty(parentDept.ancestors))
                 {
 
                     dept.ancestors = $"{parentDept.ancestors},{parentDept.Id}";
@@ -146,7 +146,7 @@ namespace wispro.sp.api.Controllers
         {
             return Context.Departments.ToList();
         }
-        
+
 
         public bool DeleteDept(int Id)
         {
@@ -157,7 +157,7 @@ namespace wispro.sp.api.Controllers
                 Context.SaveChanges();
                 return true;
             }
-            catch(Exception ex)
+            catch (Exception ex)
             {
                 return false;
             }
@@ -179,10 +179,10 @@ namespace wispro.sp.api.Controllers
             }
         }
 
-        public Position GetPosition(int deptId,int staffId)
+        public Position GetPosition(int deptId, int staffId)
         {
             var data = Context.DepartmentPositions.Include(pi => pi.Position).FirstOrDefault<DepartmentPosition>(s => s.StaffId == staffId);
-            if(data != null)
+            if (data != null)
             {
                 return data.Position;
             }
@@ -211,16 +211,16 @@ namespace wispro.sp.api.Controllers
                 if (customer.Id == 0)
                 {
 
-                    Customer temCustomer = Context.Customers.Where<Customer>(x => x.Name== customer.Name).FirstOrDefault();
+                    Customer temCustomer = Context.Customers.Where<Customer>(x => x.Name == customer.Name).FirstOrDefault();
 
                     if (temCustomer != null)
                     {
-                        if(temCustomer.Name != customer.Name)
+                        if (temCustomer.Name != customer.Name)
                         {
                             temCustomer.Name = customer.Name;
                         }
 
-                        if(temCustomer.ResponseManId != customer.ResponseManId)
+                        if (temCustomer.ResponseManId != customer.ResponseManId)
                         {
                             temCustomer.ResponseManId = customer.ResponseManId;
                         }
@@ -268,7 +268,7 @@ namespace wispro.sp.api.Controllers
                             temCustomer.Address = customer.Address;
                         }
 
-                        if(temCustomer.ARate != customer.ARate)
+                        if (temCustomer.ARate != customer.ARate)
                         {
                             temCustomer.ARate = customer.ARate;
                         }
@@ -307,7 +307,7 @@ namespace wispro.sp.api.Controllers
         {
             Position ptPosition = Context.Positions.FirstOrDefault(s => s.Name == "普通员工");
 
-            if(ptPosition == null)
+            if (ptPosition == null)
             {
                 ptPosition = new Position() { Name = "普通员工" };
                 Context.Positions.Add(ptPosition);
@@ -315,7 +315,7 @@ namespace wispro.sp.api.Controllers
             }
             var lstStaff = Context.Staffs.ToList();
 
-            foreach(var sf in lstStaff)
+            foreach (var sf in lstStaff)
             {
                 if (!string.IsNullOrEmpty(sf.Department))
                 {
@@ -331,8 +331,8 @@ namespace wispro.sp.api.Controllers
                         {
                             string firstName = deptStrings[0].Substring(0, m.Index).Trim();
                             string secondName = m.Groups[1].Value.Trim();
-                            pDept = Context.Departments.First<Department>(s=>s.Name == firstName);
-                            if(pDept == null)
+                            pDept = Context.Departments.First<Department>(s => s.Name == firstName);
+                            if (pDept == null)
                             {
                                 pDept = new Department() { Name = firstName };
                                 Context.Departments.Add(pDept);
@@ -372,10 +372,10 @@ namespace wispro.sp.api.Controllers
                             }
                         }
 
-                        for(int i = 1; i < deptStrings.Length; i++)
+                        for (int i = 1; i < deptStrings.Length; i++)
                         {
-                            Department curDept = Context.Departments.FirstOrDefault<Department>(d=>d.parentId == pDept.Id && d.Name == deptStrings[i].Trim());
-                            if(curDept == null)
+                            Department curDept = Context.Departments.FirstOrDefault<Department>(d => d.parentId == pDept.Id && d.Name == deptStrings[i].Trim());
+                            if (curDept == null)
                             {
                                 curDept = new Department()
                                 {
@@ -387,13 +387,13 @@ namespace wispro.sp.api.Controllers
                                 Context.Departments.Add(curDept);
                                 Context.SaveChanges();
 
-                                
+
                             }
 
                             pDept = curDept;
                         }
 
-                        if(pDept != null)
+                        if (pDept != null)
                         {
 
                             DepartmentPosition dp = Context.DepartmentPositions.FirstOrDefault(p => p.StaffId == sf.Id);
@@ -418,15 +418,15 @@ namespace wispro.sp.api.Controllers
                                     Context.SaveChanges();
                                 }
 
-                                
+
                             }
 
                         }
-                        
+
                     }
                 }
             }
         }
-        
+
     }
 }

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 277 - 271
wispro.sp.api/Controllers/PerformanceItemController.cs


+ 119 - 58
wispro.sp.api/Controllers/ProjectController.cs

@@ -1,4 +1,4 @@
-using Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Authorization;
 using Microsoft.AspNetCore.Http;
 using Microsoft.AspNetCore.Mvc;
 using Microsoft.EntityFrameworkCore;
@@ -18,11 +18,11 @@ namespace wispro.sp.api.Controllers
     public class ProjectController : ControllerBase
     {
         spDbContext Context;
-        
+
         public ProjectController(spDbContext context)
         {
             Context = context;
-            
+
 
         }
 
@@ -44,13 +44,13 @@ namespace wispro.sp.api.Controllers
 
                 if (project.Reviewer != null)
                 {
-                    var temStaff = new Staff()  
+                    var temStaff = new Staff()
                     {
                         Name = project.Reviewer.Name,
                         Id = project.Reviewer.Id,
                     };
 
-                    project.Reviewer  = temStaff;
+                    project.Reviewer = temStaff;
                 }
 
                 if (project.WorkflowUser != null)
@@ -69,7 +69,7 @@ namespace wispro.sp.api.Controllers
         {
             var retList = Context.ProjectInfos
                 .Include(p => p.Customer)
-                .Include(p=>p.Reviewer)
+                .Include(p => p.Reviewer)
                 .Include(p => p.WorkflowUser)
                 .Where(s => s.CaseState == state).ToList();
 
@@ -91,13 +91,13 @@ namespace wispro.sp.api.Controllers
             return retList;
         }
 
-        
+
 
         public bool SetFinished(string caseNo)
         {
-            var obj = Context.ProjectInfos.FirstOrDefault(s=>s.CaseNo == caseNo );
+            var obj = Context.ProjectInfos.FirstOrDefault(s => s.CaseNo == caseNo);
 
-            if(obj != null)
+            if (obj != null)
             {
                 try
                 {
@@ -105,7 +105,7 @@ namespace wispro.sp.api.Controllers
                     Context.SaveChanges();
                     return true;
                 }
-                catch(Exception ex)
+                catch (Exception ex)
                 {
                     return false;
                 }
@@ -159,7 +159,7 @@ namespace wispro.sp.api.Controllers
                     pcRecord.Reviewer = temStaff;
                 }
 
-                if(pcRecord.Staff != null)
+                if (pcRecord.Staff != null)
                 {
                     var temStaff = new Staff()
                     {
@@ -167,7 +167,7 @@ namespace wispro.sp.api.Controllers
                         Id = pcRecord.Staff.Id,
                     };
 
-                    pcRecord.Staff  = temStaff;
+                    pcRecord.Staff = temStaff;
                 }
 
                 if (pcRecord.Project != null)
@@ -201,18 +201,18 @@ namespace wispro.sp.api.Controllers
             var retObj = Context.ProjectContentRecords
                 .Include(p => p.CalMonth)
                 .Include(p => p.Reviewer)
-                .Include(p => p.Project).ThenInclude(p=>p.Customer)
+                .Include(p => p.Project).ThenInclude(p => p.Customer)
                 .Include(p => p.ProjectWorkContents)
-                .FirstOrDefault(p=>p.Id == Id);
+                .FirstOrDefault(p => p.Id == Id);
 
-            if(retObj != null)
+            if (retObj != null)
             {
                 ProjectContents ret = new ProjectContents();
 
                 ret.ProjectContentRecord = retObj;
 
                 ret.ProjectWorkContents = new List<ViewProjectWorkContent>();
-                foreach(var wContent in retObj.ProjectWorkContents)
+                foreach (var wContent in retObj.ProjectWorkContents)
                 {
                     ViewProjectWorkContent tem = new ViewProjectWorkContent();
                     tem.modifyState = ModifyState.UnChanged;
@@ -220,7 +220,7 @@ namespace wispro.sp.api.Controllers
                     tem.Content = wContent.Content;
                     tem.ActualPerformance = wContent.ActualPerformance;
                     tem.ContentRecordId = wContent.ContentRecordId;
-                    tem.FinalPerformance  = wContent.FinalPerformance;
+                    tem.FinalPerformance = wContent.FinalPerformance;
                     tem.TakeTime = wContent.TakeTime;
                     tem.TimeSpan = wContent.TimeSpan;
                     tem.WorkDate = wContent.WorkDate;
@@ -237,7 +237,7 @@ namespace wispro.sp.api.Controllers
 
         }
 
-        private void _SaveProjectWorkContent(spDbContext dbContext,ProjectContents saveObj)
+        private void _SaveProjectWorkContent(spDbContext dbContext, ProjectContents saveObj)
         {
             if (saveObj.ProjectContentRecord.Id == 0)
             {
@@ -253,12 +253,12 @@ namespace wispro.sp.api.Controllers
                 var currentUser = Context.Staffs.FirstOrDefault(s => s.Name == User.Identity.Name);
                 saveObj.ProjectContentRecord.StaffId = currentUser.Id;
 
-                var temObj = Context.ProjectContentRecords.FirstOrDefault(p => 
-                                        p.StaffId == currentUser.Id && 
-                                        p.ProjectNo == saveObj.ProjectContentRecord.ProjectNo && 
-                                        p.CalMonthId== saveObj.ProjectContentRecord.CalMonthId );
+                var temObj = Context.ProjectContentRecords.FirstOrDefault(p =>
+                                        p.StaffId == currentUser.Id &&
+                                        p.ProjectNo == saveObj.ProjectContentRecord.ProjectNo &&
+                                        p.CalMonthId == saveObj.ProjectContentRecord.CalMonthId);
 
-                if(temObj != null)
+                if (temObj != null)
                 {
                     throw new ApplicationException($"本月已提交{temObj.ProjectNo}工作内容!");
                 }
@@ -332,10 +332,10 @@ namespace wispro.sp.api.Controllers
                 try
                 {
                     _SaveProjectWorkContent(Context, saveObj);
-                    
+
                     t.Commit();
                 }
-                catch(Exception ex)
+                catch (Exception ex)
                 {
                     t.Rollback();
                     ret.Success = false;
@@ -350,9 +350,9 @@ namespace wispro.sp.api.Controllers
         {
             ApiSaveResponse ret = new ApiSaveResponse();
             ret.Success = true;
-            var Reviewer = Context.Staffs.FirstOrDefault(p=>p.Name == User.Identity.Name);
+            var Reviewer = Context.Staffs.FirstOrDefault(p => p.Name == User.Identity.Name);
+
 
-            
 
             using (var t = Context.Database.BeginTransaction())
             {
@@ -360,23 +360,23 @@ namespace wispro.sp.api.Controllers
                 {
                     foreach (var saveObj in saveObjs)
                     {
-                        if (Reviewer.Id != saveObj.ProjectContentRecord.ReviewerId )
+                        if (Reviewer.Id != saveObj.ProjectContentRecord.ReviewerId)
                         {
                             ret.Success = false;
                             ret.ErrorMessage = "只有指定审核人员才能操作!";
                         }
-                        
+
                         saveObj.ProjectContentRecord.ReviewerId = Reviewer.Id;
-                        
+
 
                         saveObj.ProjectContentRecord.State = 2;
 
                         _SaveProjectWorkContent(Context, saveObj);
 
-                        if(saveObj.ProjectContentRecord.Project == null)
+                        if (saveObj.ProjectContentRecord.Project == null)
                         {
-                            saveObj.ProjectContentRecord.Project = Context.ProjectInfos.Include(p=>p.Customer)
-                                .FirstOrDefault(p=>p.CaseNo == saveObj.ProjectContentRecord.ProjectNo);
+                            saveObj.ProjectContentRecord.Project = Context.ProjectInfos.Include(p => p.Customer)
+                                .FirstOrDefault(p => p.CaseNo == saveObj.ProjectContentRecord.ProjectNo);
                         }
 
                         Dictionary<string, double> finanlJXDic = new Dictionary<string, double>();
@@ -434,7 +434,7 @@ namespace wispro.sp.api.Controllers
 
                             foreach (string strKey in finanlJXDic.Keys)
                             {
-                                if(finanlJXDic[strKey] == 0.00)
+                                if (finanlJXDic[strKey] == 0.00)
                                 {
                                     continue;
                                 }
@@ -445,7 +445,7 @@ namespace wispro.sp.api.Controllers
                                     p.CaseCoefficient == strKey &&
                                     p.CalMonthId == saveObj.ProjectContentRecord.CalMonthId);
 
-                                if(item == null)
+                                if (item == null)
                                 {
                                     item = new PerformanceItem();
                                     item.DoItem = "";
@@ -468,7 +468,7 @@ namespace wispro.sp.api.Controllers
                                     ItemStaff itemStaff = new ItemStaff();
                                     itemStaff.DoPersonId = saveObj.ProjectContentRecord.StaffId;
                                     itemStaff.ItemId = item.Id;
-                                    itemStaff.PerformancePoint = finanlJXDic[strKey]; 
+                                    itemStaff.PerformancePoint = finanlJXDic[strKey];
                                     Context.ItemStaffs.Add(itemStaff);
                                     Context.SaveChanges();
                                 }
@@ -482,7 +482,7 @@ namespace wispro.sp.api.Controllers
                                 new PerformanceItemController(Context, new Services.FileTaskCacheService()).CalItemJX(item.Id);
                             }
                         }
-                        
+
                     }
 
                     t.Commit();
@@ -506,25 +506,25 @@ namespace wispro.sp.api.Controllers
             {
                 try
                 {
-                    var temObj = Context.ProjectContentRecords.FirstOrDefault(p=>p.Id == Id);
-                    
+                    var temObj = Context.ProjectContentRecords.FirstOrDefault(p => p.Id == Id);
 
-                    if(temObj != null)
+
+                    if (temObj != null)
                     {
                         temObj.State = 1;
 
-                        var temStaff = Context.Staffs.FirstOrDefault(s=>s.Id == reviewerId);
+                        var temStaff = Context.Staffs.FirstOrDefault(s => s.Id == reviewerId);
 
-                        if(temStaff == null)
+                        if (temStaff == null)
                         {
                             ret.Success = false;
                             ret.ErrorMessage = "指定审核人不存在!";
                             return ret;
                         }
 
-                        var calMonth = Context.CalMonths.FirstOrDefault(f=>f.Status ==0);
+                        var calMonth = Context.CalMonths.FirstOrDefault(f => f.Status == 0);
 
-                        if(calMonth == null)
+                        if (calMonth == null)
                         {
                             ret.Success = false;
                             ret.ErrorMessage = "当前没有正在处理的绩效核算月份!";
@@ -564,11 +564,11 @@ namespace wispro.sp.api.Controllers
 
         public List<ProjectInfo> GetWaitingReviewProject()
         {
-            var user = Context.Staffs.FirstOrDefault(s=>s.Name == User.Identity.Name);
+            var user = Context.Staffs.FirstOrDefault(s => s.Name == User.Identity.Name);
 
             var retList = Context.ProjectContentRecords
-                .Include(p=>p.Project).ThenInclude(p=>p.Customer)
-                .Where(p => p.State == 1 && p.CalMonth.Status == 0 && p.ReviewerId == user.Id).Select(p=>p.Project).Distinct().ToList();
+                .Include(p => p.Project).ThenInclude(p => p.Customer)
+                .Where(p => p.State == 1 && p.CalMonth.Status == 0 && p.ReviewerId == user.Id).Select(p => p.Project).Distinct().ToList();
 
             formatRetProjects(retList);
             return retList;
@@ -592,14 +592,14 @@ namespace wispro.sp.api.Controllers
 
         public List<ProjectContents> GetProjectCanReviewWorkContent(string projectNo, int Year, int month)
         {
-            var pcrList  = Context.ProjectContentRecords
+            var pcrList = Context.ProjectContentRecords
                 .Include(p => p.CalMonth)
                 .Include(p => p.Reviewer)
                 .Include(p => p.Staff)
                 .Include(p => p.Project).ThenInclude(p => p.Customer)
                 .Include(p => p.ProjectWorkContents)
-                .Where(p => p.ProjectNo == projectNo && p.CalMonth.Year == Year && p.CalMonth.Month == month && p.State >0).ToList();
-            
+                .Where(p => p.ProjectNo == projectNo && p.CalMonth.Year == Year && p.CalMonth.Month == month && p.State > 0).ToList();
+
 
 
             List<ProjectContents> retList = new List<ProjectContents>();
@@ -607,11 +607,11 @@ namespace wispro.sp.api.Controllers
             {
                 ProjectContents ret = new ProjectContents();
 
-                if(retObj.Project.Customer != null)
+                if (retObj.Project.Customer != null)
                 {
                     retObj.Project.Customer.ResponseMan = null;
                 }
-                
+
 
                 ret.ProjectContentRecord = retObj;
                 ret.ProjectWorkContents = new List<ViewProjectWorkContent>();
@@ -639,7 +639,7 @@ namespace wispro.sp.api.Controllers
 
             return retList;
         }
-        public List<ProjectContents> GetProjectWorkContentRecord(string projectNo,int Year,int month,int? state)
+        public List<ProjectContents> GetProjectWorkContentRecord(string projectNo, int Year, int month, int? state)
         {
             var pcrList = new List<ProjectContentRecord>();
             if (!state.HasValue)
@@ -647,7 +647,7 @@ namespace wispro.sp.api.Controllers
                 pcrList = Context.ProjectContentRecords
                 .Include(p => p.CalMonth)
                 .Include(p => p.Reviewer)
-                .Include(p=>p.Staff)
+                .Include(p => p.Staff)
                 .Include(p => p.Project).ThenInclude(p => p.Customer)
                 .Include(p => p.ProjectWorkContents)
                 .Where(p => p.ProjectNo == projectNo && p.CalMonth.Year == Year && p.CalMonth.Month == month).ToList();
@@ -662,10 +662,10 @@ namespace wispro.sp.api.Controllers
                 .Include(p => p.ProjectWorkContents)
                 .Where(p => p.ProjectNo == projectNo && p.CalMonth.Year == Year && p.CalMonth.Month == month && p.State == state.Value).ToList();
             }
-                
+
 
             List<ProjectContents> retList = new List<ProjectContents>();
-            foreach(var retObj in pcrList)
+            foreach (var retObj in pcrList)
             {
                 ProjectContents ret = new ProjectContents();
 
@@ -705,9 +705,9 @@ namespace wispro.sp.api.Controllers
                 .Include(p => p.Project).ThenInclude(p => p.Customer)
                 .Include(p => p.ProjectWorkContents)
                 .Where(p => p.ProjectNo == projectNo && p.State == 2)
-                .OrderByDescending(p=>p.SubmitTime)
+                .OrderByDescending(p => p.SubmitTime)
                 .ToList();
-            
+
 
             List<ProjectContents> retList = new List<ProjectContents>();
             foreach (var retObj in pcrList)
@@ -740,5 +740,66 @@ namespace wispro.sp.api.Controllers
 
             return retList;
         }
+
+        /// <summary>
+        /// 获取审核人审核过的历史专案记录
+        /// </summary>
+        /// <returns></returns>
+        public List<ProjectContentRecord> GetReviewerHistoryProjects()
+        {
+            var user = Context.Staffs.FirstOrDefault(s => s.Name == User.Identity.Name);
+
+            var retList = Context.ProjectContentRecords
+                .Include(p => p.CalMonth)
+                .Include(p => p.Reviewer)
+                .Include(p => p.Staff)
+                .Include(p => p.Project).ThenInclude(p => p.Customer)
+                .Include(p => p.ProjectWorkContents) // 包含工作内容
+                .Where(p => p.ReviewerId == user.Id && p.State == 2) // 已审核完成的记录
+                .OrderByDescending(p => p.SubmitTime)
+                .ToList();
+
+            // 格式化数据以避免序列化循环引用
+            foreach (var record in retList)
+            {
+                if (record.Project != null && record.Project.Customer != null)
+                {
+                    record.Project.Customer = new Customer()
+                    {
+                        Name = record.Project.Customer.Name,
+                        Id = record.Project.Customer.Id
+                    };
+                }
+
+                if (record.Reviewer != null)
+                {
+                    record.Reviewer = new Staff()
+                    {
+                        Name = record.Reviewer.Name,
+                        Id = record.Reviewer.Id
+                    };
+                }
+
+                if (record.Staff != null)
+                {
+                    record.Staff = new Staff()
+                    {
+                        Name = record.Staff.Name,
+                        Id = record.Staff.Id
+                    };
+                }
+
+                // 保留工作内容列表,但清除循环引用
+                if (record.ProjectWorkContents != null)
+                {
+                    foreach (var workContent in record.ProjectWorkContents)
+                    {
+                        workContent.ContentRecord = null; // 避免循环引用
+                    }
+                }
+            }
+
+            return retList;
+        }
     }
 }

+ 18 - 18
wispro.sp.api/Controllers/ReportController.cs

@@ -35,11 +35,11 @@ namespace wispro.sp.api.Controllers
         /// <param name="end">结束时间</param>
         /// <param name="userId"></param>
         /// <returns></returns>
-        public ChartDatas AppealReport(int type,DateTime? start,DateTime? end,int? userId)
+        public ChartDatas AppealReport(int type, DateTime? start, DateTime? end, int? userId)
         {
             ChartDatas retDatas = new ChartDatas();
 
-            var results = Context.AppealRecords.Where(b=>(1==1));
+            var results = Context.AppealRecords.Where(b => (1 == 1));
             if (start.HasValue)
             {
                 results = results.Where(b => b.CreateTime >= start);
@@ -59,16 +59,16 @@ namespace wispro.sp.api.Controllers
             {
                 case 0:
                     var retData = results.GroupBy(c => c.Creater.Name)
-                        .Select(g => new { key = g.Key, Count = g.Count() }).OrderByDescending(g=>g.Count)
+                        .Select(g => new { key = g.Key, Count = g.Count() }).OrderByDescending(g => g.Count)
                         .ToDictionary(g => g.key, g => g.Count);
 
                     retDatas.ATitle = "申诉人";
                     retDatas.Title = "申诉人统计";
                     retDatas.Datas = new List<ChartData>();
-                    
+
                     foreach (var key in retData.Keys)
                     {
-                        retDatas.Datas.Add(new ChartData() { type = key,value=retData[key]} );
+                        retDatas.Datas.Add(new ChartData() { type = key, value = retData[key] });
                     }
                     return retDatas;
                     break;
@@ -80,7 +80,7 @@ namespace wispro.sp.api.Controllers
                     retDatas.ATitle = "申诉类型";
                     retDatas.Title = "申诉类型统计";
                     retDatas.Datas = new List<ChartData>();
-                    
+
                     foreach (var key in retData1.Keys)
                     {
                         retDatas.Datas.Add(new ChartData() { type = key, value = retData1[key] });
@@ -103,7 +103,7 @@ namespace wispro.sp.api.Controllers
                     return retDatas;
                     break;
                 case 3:
-                    var retData3 = results.GroupBy(c => new { c.Creater.Name,c.CreateTime.Year, c.CreateTime.Month })
+                    var retData3 = results.GroupBy(c => new { c.Creater.Name, c.CreateTime.Year, c.CreateTime.Month })
                         .Select(g => new { key = g.Key, Count = g.Count() }).OrderByDescending(g => g.Count)
                         .ToDictionary(g => g.key, g => g.Count);
 
@@ -117,7 +117,7 @@ namespace wispro.sp.api.Controllers
                         retDatas.Datas.Add(new ChartData() { type = key.Name, year = $" {DateTime.Parse($"{key.Year}-{key.Month}-1").ToString("yyyy-MM")}", value = retData3[key] });
                     }
                     return retDatas;
-                    
+
                     break;
                 case 4:
                     var retData4 = results.GroupBy(c => new { c.Type.Name, c.CreateTime.Year, c.CreateTime.Month })
@@ -157,7 +157,7 @@ namespace wispro.sp.api.Controllers
                     return null;
                     break;
             }
-            
+
         }
 
         /// <summary>
@@ -172,17 +172,17 @@ namespace wispro.sp.api.Controllers
         /// 是否按年统计,默认为false按月统计
         /// </param>
         /// <returns></returns>
-        public ChartDatas StaticsReport(int type,bool isYear=false)
+        public ChartDatas StaticsReport(int type, bool isYear = false)
         {
             ChartDatas retDatas = new ChartDatas();
             switch (type)
             {
                 case 0:
-                    
+
                     if (isYear)
                     {
                         var retYearData = Context.StaffStatistics.GroupBy(s => new { s.Staff.Name, s.CalMonth.Year })
-                        .Select(g => new { Name = g.Key.Name, Year = g.Key.Year ,  sum = g.Sum(s => s.FinianlPoint) })
+                        .Select(g => new { Name = g.Key.Name, Year = g.Key.Year, sum = g.Sum(s => s.FinianlPoint) })
                         .OrderByDescending(g => g.sum);
 
                         retDatas.ATitle = "代理人";
@@ -198,8 +198,8 @@ namespace wispro.sp.api.Controllers
                     }
                     else
                     {
-                        var retData = Context.StaffStatistics.GroupBy(s => new { s.Staff.Name, s.CalMonth.Year,s.CalMonth.Month  })
-                        .Select(g => new { Name = g.Key.Name,  Year=g.Key.Year,Month=g.Key.Month , sum = g.Sum(s => s.FinianlPoint) })
+                        var retData = Context.StaffStatistics.GroupBy(s => new { s.Staff.Name, s.CalMonth.Year, s.CalMonth.Month })
+                        .Select(g => new { Name = g.Key.Name, Year = g.Key.Year, Month = g.Key.Month, sum = g.Sum(s => s.FinianlPoint) })
                         .OrderByDescending(g => g.sum);
 
                         retDatas.ATitle = "代理人";
@@ -215,7 +215,7 @@ namespace wispro.sp.api.Controllers
 
                     }
 
-                    
+
 
                     break;
                 case 1:
@@ -232,13 +232,13 @@ namespace wispro.sp.api.Controllers
 
                         foreach (var key in retData2)
                         {
-                            retDatas.Datas.Add(new ChartData() { type = key.Name, year = $"{key.Year }", value = key.sum.HasValue ? key.sum.Value : 0 });
+                            retDatas.Datas.Add(new ChartData() { type = key.Name, year = $"{key.Year}", value = key.sum.HasValue ? key.sum.Value : 0 });
                         }
                         return retDatas;
                     }
                     else
                     {
-                        var retData1 = Context.StaffStatistics.GroupBy(s => new { s.Staff.Department, s.CalMonth.Year,s.CalMonth.Month  })
+                        var retData1 = Context.StaffStatistics.GroupBy(s => new { s.Staff.Department, s.CalMonth.Year, s.CalMonth.Month })
                             .Select(g => new { Name = g.Key.Department, Year = g.Key.Year, Month = g.Key.Month, sum = g.Sum(s => s.FinianlPoint) })
                             .OrderByDescending(g => g.sum);
 
@@ -255,7 +255,7 @@ namespace wispro.sp.api.Controllers
                     }
                     break;
                 case 2:
-                    var retData3 = Context.StaffStatistics.Where(s=>s.jxType.Contains("专案")).GroupBy(s => new { s.Staff.Name, s.CalMonth.Year, s.CalMonth.Month })
+                    var retData3 = Context.StaffStatistics.Where(s => s.jxType.Contains("专案")).GroupBy(s => new { s.Staff.Name, s.CalMonth.Year, s.CalMonth.Month })
                         .Select(g => new { Name = g.Key.Name, Year = g.Key.Year, Month = g.Key.Month, sum = g.Sum(s => s.FinianlPoint) })
                         .OrderByDescending(g => g.sum);
 

+ 47 - 46
wispro.sp.api/Controllers/StaffController.cs

@@ -26,14 +26,14 @@ namespace wispro.sp.api.Controllers
         {
             Context = context;
         }
-        
+
 
         public List<Staff> GetAll()
         {
             return Context.Staffs.ToList<Staff>();
         }
 
-        private List<Staff> GetStaffList(dynamic dynamic,UserField userField)
+        private List<Staff> GetStaffList(dynamic dynamic, UserField userField)
         {
             try
             {
@@ -46,7 +46,7 @@ namespace wispro.sp.api.Controllers
                         switch (userField.UserType)
                         {
                             case UserType.BindObjectProperty:
-                                
+
                                 if (dynamic == null)
                                 {
                                     return null;
@@ -86,10 +86,10 @@ namespace wispro.sp.api.Controllers
                         break;
                     case UserConditionType.Department:
                         var retList = Context.DepartmentPositions.Where(d => d.departmentId == int.Parse(userField.Department)).Select(p => p.Staff).ToList();
-                        return retList.Where(s=>s.IsOnJob ).ToList();
+                        return retList.Where(s => s.IsOnJob).ToList();
                         break;
                     case UserConditionType.Position:
-                        var query = Context.Staffs.Where(s=>true);
+                        var query = Context.Staffs.Where(s => true);
                         var queryList = from u in query
                                         where ((from dp in Context.DepartmentPositions.Where(d => d.PositionId == int.Parse(userField.Positon)) select dp.StaffId).Contains(u.Id))
                                         select u;
@@ -101,9 +101,9 @@ namespace wispro.sp.api.Controllers
                     case UserConditionType.UserDepartmentPosition:
                         break;
                     case UserConditionType.DepartmentPosition:
-                        var retList1 = Context.DepartmentPositions.Where(d => 
+                        var retList1 = Context.DepartmentPositions.Where(d =>
                             d.departmentId == int.Parse(userField.Department) &&
-                            d.PositionId  == int.Parse(userField.Positon)
+                            d.PositionId == int.Parse(userField.Positon)
                             )
                             .Select(p => p.Staff).ToList();
                         return retList1;
@@ -113,9 +113,9 @@ namespace wispro.sp.api.Controllers
 
                 return new List<Staff>();
             }
-            catch(Exception ex)
+            catch (Exception ex)
             {
-                throw ex;
+                throw;
             }
         }
 
@@ -125,10 +125,10 @@ namespace wispro.sp.api.Controllers
             try
             {
                 var item = Context.PerformanceItems
-                    .Include(p=>p.Reviewer)
-                    .Include(p=>p.ItemStaffs).ThenInclude(p=>p.DoPerson)
-                    .Include(p=>p.PreOastaff)
-                    .Include(p=>p.Customer)
+                    .Include(p => p.Reviewer)
+                    .Include(p => p.ItemStaffs).ThenInclude(p => p.DoPerson)
+                    .Include(p => p.PreOastaff)
+                    .Include(p => p.Customer)
                     .FirstOrDefault(p => p.Id == itemId);
 
                 var apType = Context.AppealTypes.FirstOrDefault(p => p.Id == appealTypeId);
@@ -142,7 +142,7 @@ namespace wispro.sp.api.Controllers
                 else
                 {
                     List<UserField> lstUserField = new List<UserField>();
-                    
+
                     if (apType.ReviewerExpress.StartsWith("p."))
                     {
                         UserField userField = new UserField();
@@ -158,15 +158,16 @@ namespace wispro.sp.api.Controllers
                     }
 
                     List<Staff> retStaffs = new List<Staff>();
-                    foreach(UserField uf in lstUserField)
+                    foreach (UserField uf in lstUserField)
                     {
                         var temStaffs = GetStaffList(item, uf);
 
-                        if(temStaffs != null)
+                        if (temStaffs != null)
                         {
-                            foreach(var staff in temStaffs)
+                            foreach (var staff in temStaffs)
                             {
-                                if(retStaffs.FirstOrDefault(s=>s.Id == staff.Id) == null) {
+                                if (retStaffs.FirstOrDefault(s => s.Id == staff.Id) == null)
+                                {
                                     staff.Customers = null;
                                     staff.StaffGrade = null;
                                     staff.ItemStaffs = null;
@@ -207,14 +208,14 @@ namespace wispro.sp.api.Controllers
             }
             catch (Exception ex)
             {
-                throw ex;
+                throw;
             }
         }
 
         private Hashtable AuditUsers()
         {
             Hashtable retStaffs = new Hashtable();
-            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>() { "李庆波", "钟子敏", "陈舒敏" });
@@ -224,7 +225,7 @@ 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>() { "钟子敏", "陈舒敏" });
@@ -237,35 +238,35 @@ namespace wispro.sp.api.Controllers
 
         public Staff GetUser(int Id)
         {
-            return Context.Staffs.FirstOrDefault(p=>p.Id == Id);
+            return Context.Staffs.FirstOrDefault(p => p.Id == Id);
         }
 
         public Staff GetByName(string Name)
         {
-            return Context.Staffs.FirstOrDefault(p => p.Name  == Name);
+            return Context.Staffs.FirstOrDefault(p => p.Name == Name);
         }
-        public ListApiResponse<Staff> Query(int pageIndex,int pageSize)
+        public ListApiResponse<Staff> Query(int pageIndex, int pageSize)
         {
             ListApiResponse<Staff> ret = new ListApiResponse<Staff>();
             ret.TotalCount = Context.Staffs.Count<Staff>();
 
             List<Staff> retList = Context.Staffs.Skip<Staff>((pageIndex - 1) * pageSize).Take(pageSize).ToList<Staff>();
-            
+
             ret.Results = retList;
 
             return ret;
         }
 
-        public ListApiResponse<Staff> QueryInDepartment(int deptId,int pageIndex,int pageSize)
+        public ListApiResponse<Staff> QueryInDepartment(int deptId, int pageIndex, int pageSize)
         {
             ListApiResponse<Staff> ret = new ListApiResponse<Staff>();
-            var dept = Context.Departments.FirstOrDefault<Department>(d=>d.Id == deptId);
+            var dept = Context.Departments.FirstOrDefault<Department>(d => d.Id == deptId);
             string strancestors = $"{dept.ancestors},{deptId}";
 
             if (dept != null)
             {
-                var retList = Context.Staffs.Where<Staff>(s => 
-                    s.Positions.Where<DepartmentPosition>(dp => dp.department.ancestors.StartsWith(strancestors) || dp.department.Id  == deptId).Count() > 0 );
+                var retList = Context.Staffs.Where<Staff>(s =>
+                    s.Positions.Where<DepartmentPosition>(dp => dp.department.ancestors.StartsWith(strancestors) || dp.department.Id == deptId).Count() > 0);
                 ret.TotalCount = retList.Count();
                 ret.Results = retList.Skip<Staff>((pageIndex - 1) * pageSize).Take(pageSize).ToList();
             }
@@ -284,14 +285,14 @@ namespace wispro.sp.api.Controllers
             Staff editObject = null;
             if (saveUser.staff.Id == 0)
             {
-                editObject = Context.Staffs.FirstOrDefault(p=>p.Name == saveUser.staff.Name);
+                editObject = Context.Staffs.FirstOrDefault(p => p.Name == saveUser.staff.Name);
             }
             else
             {
-                editObject = Context.Staffs.FirstOrDefault(p => p.Id  == saveUser.staff.Id);
+                editObject = Context.Staffs.FirstOrDefault(p => p.Id == saveUser.staff.Id);
             }
 
-            if(editObject == null)
+            if (editObject == null)
             {
                 ret.Success = false;
                 ret.ErrorMessage = "用户不存在";
@@ -302,7 +303,7 @@ namespace wispro.sp.api.Controllers
                 {
                     try
                     {
-                        if(saveUser.staff.Account != null && editObject.Account != saveUser.staff.Account)
+                        if (saveUser.staff.Account != null && editObject.Account != saveUser.staff.Account)
                             editObject.Account = saveUser.staff.Account;
 
                         if (saveUser.staff.Department != null && editObject.Department != saveUser.staff.Department)
@@ -327,7 +328,7 @@ namespace wispro.sp.api.Controllers
                         if (saveUser.staff.Name != null && editObject.Name != saveUser.staff.Name)
                             editObject.Name = saveUser.staff.Name;
 
-                        if (saveUser.staff.Password != null && saveUser.staff.Id >0)
+                        if (saveUser.staff.Password != null && saveUser.staff.Id > 0)
                             editObject.Password = utility.MD5Utility.GetMD5(saveUser.staff.Password);
 
                         if (saveUser.staff.Sex != null && editObject.Sex != saveUser.staff.Sex)
@@ -345,7 +346,7 @@ namespace wispro.sp.api.Controllers
                         if (saveUser.staff.WorkPlace != null && editObject.WorkPlace != saveUser.staff.WorkPlace)
                             editObject.WorkPlace = saveUser.staff.WorkPlace;
 
-                        if(saveUser.staff.RegularDate != null && editObject.RegularDate != saveUser.staff.RegularDate)
+                        if (saveUser.staff.RegularDate != null && editObject.RegularDate != saveUser.staff.RegularDate)
                             editObject.RegularDate = saveUser.staff.RegularDate;
 
                         Context.SaveChanges();
@@ -370,11 +371,11 @@ namespace wispro.sp.api.Controllers
 
                         t.Commit();
                     }
-                    catch(Exception ex)
+                    catch (Exception ex)
                     {
                         ret.Success = false;
                         ret.ErrorMessage = ex.Message;
-                        
+
                     }
                 }
 
@@ -382,7 +383,7 @@ namespace wispro.sp.api.Controllers
             return ret;
 
         }
-        
+
         public ApiSaveResponse SaveUser(SaveUserObject saveUser)
         {
             ApiSaveResponse ret = new ApiSaveResponse();
@@ -405,9 +406,9 @@ namespace wispro.sp.api.Controllers
                         }
                         else
                         {
-                            
 
-                            if(string.IsNullOrEmpty(staff.Account) || string.IsNullOrEmpty(staff.Password))
+
+                            if (string.IsNullOrEmpty(staff.Account) || string.IsNullOrEmpty(staff.Password))
                             {
                                 ret.Success = false;
                                 ret.ErrorMessage = $"用户名或密码没有设定";
@@ -453,7 +454,7 @@ namespace wispro.sp.api.Controllers
                             editObject.Status = staff.Status;
                             editObject.Tel = staff.Tel;
                             editObject.WorkPlace = staff.WorkPlace;
-                            editObject.RegularDate =staff.RegularDate;
+                            editObject.RegularDate = staff.RegularDate;
                             Context.SaveChanges();
 
                             if (saveUser.deptId > 0)
@@ -486,7 +487,7 @@ namespace wispro.sp.api.Controllers
 
                     }
 
-                    
+
                     t.Commit();
                     ret.Success = true;
 
@@ -510,7 +511,7 @@ namespace wispro.sp.api.Controllers
             {
                 if (staff.Id == 0)
                 {
-                    
+
                     Staff temStaff = Context.Staffs.Where<Staff>(x => x.Name == staff.Name).FirstOrDefault();
 
                     if (temStaff != null)
@@ -559,7 +560,7 @@ namespace wispro.sp.api.Controllers
                         if (staff.WorkPlace != null && staff.WorkPlace != temStaff.WorkPlace)
                             temStaff.WorkPlace = staff.WorkPlace;
 
-                        if(staff.RegularDate != null && staff.RegularDate != temStaff.RegularDate)
+                        if (staff.RegularDate != null && staff.RegularDate != temStaff.RegularDate)
                         {
                             temStaff.RegularDate = staff.RegularDate;
                         }
@@ -624,7 +625,7 @@ namespace wispro.sp.api.Controllers
                         if (staff.WorkPlace != null && staff.WorkPlace != editObject.WorkPlace)
                             editObject.WorkPlace = staff.WorkPlace;
 
-                        if(staff.RegularDate != null && staff.RegularDate != editObject.RegularDate)
+                        if (staff.RegularDate != null && staff.RegularDate != editObject.RegularDate)
                         {
                             editObject.RegularDate = staff.RegularDate;
                         }
@@ -634,7 +635,7 @@ namespace wispro.sp.api.Controllers
                         ret.Success = false;
                         ret.ErrorMessage = $"编号为【{staff.Id}】的用户不存在!";
                     }
-                    
+
                 }
 
                 Context.SaveChanges();

+ 4 - 4
wispro.sp.api/Controllers/StaffGradeController.cs

@@ -21,12 +21,12 @@ namespace wispro.sp.api.Controllers
             Context = context;
         }
 
-        
+
         public List<StaffGrade> GetAll()
         {
-            var result= Context.StaffGrades.Where<StaffGrade>(x=>x.Id >0);
+            var result = Context.StaffGrades.Where<StaffGrade>(x => x.Id > 0);
             return result.ToList<StaffGrade>();
-            
+
         }
 
         [HttpPost]
@@ -60,7 +60,7 @@ namespace wispro.sp.api.Controllers
 
                 ret.Success = true;
             }
-            catch(Exception ex)
+            catch (Exception ex)
             {
                 ret.Success = false;
                 ret.ErrorMessage = ex.Message;

+ 2 - 2
wispro.sp.api/Controllers/SystemDataController.cs

@@ -15,7 +15,7 @@ namespace wispro.sp.api.Controllers
         public ApiSaveResponse StartImportData()
         {
             System.Threading.Tasks.Task.Run(() => new ImportReportJob().Execute(null));
-            
+
             return new ApiSaveResponse()
             {
                 Success = true
@@ -25,7 +25,7 @@ namespace wispro.sp.api.Controllers
         public ApiSaveResponse UpdateJXData()
         {
             System.Threading.Tasks.Task.Run(() => new UpdateJXDataFromIPEasyJob().Execute(null));
-            
+
             return new ApiSaveResponse()
             {
                 Success = true

+ 2 - 2
wispro.sp.api/Controllers/VerifyCoefficientController.cs

@@ -26,8 +26,8 @@ namespace wispro.sp.api.Controllers
 
         public List<VerifyCoefficient> GetAll()
         {
-            var result = Context.VerifyCoefficients.Include(b=>b.DoPerson).Include(b=>b.Checker);
-                
+            var result = Context.VerifyCoefficients.Include(b => b.DoPerson).Include(b => b.Checker);
+
             return result.ToList<VerifyCoefficient>();
 
         }

+ 69 - 68
wispro.sp.api/Controllers/WorkflowEngineController.cs

@@ -23,14 +23,14 @@ namespace wispro.sp.api.Controllers
     public class WorkflowEngineController : ControllerBase
     {
         spDbContext Context;
-        
+
 
         public WorkflowEngineController(spDbContext context)
         {
             Context = context;
         }
 
-        public void DoAction(int instanceId,int stepId,int ActionId,List<InputValue> inputValues)
+        public void DoAction(int instanceId, int stepId, int ActionId, List<InputValue> inputValues)
         {
             //1、取实例对象
 
@@ -49,7 +49,7 @@ namespace wispro.sp.api.Controllers
             ApiSaveResponse ret = new ApiSaveResponse();
             ret.Success = true;
 
-            using(var t = Context.Database.BeginTransaction())
+            using (var t = Context.Database.BeginTransaction())
             {
                 try
                 {
@@ -58,15 +58,15 @@ namespace wispro.sp.api.Controllers
                         Context.Actions.Add(workflowObject.InitAction.Action);
                         Context.SaveChanges();
 
-                        foreach(var iv in workflowObject.InitAction.InputValueSettingObjects)
+                        foreach (var iv in workflowObject.InitAction.InputValueSettingObjects)
                         {
                             iv.InputValueSetting.actionId = workflowObject.InitAction.Action.Id;
                             Context.InputValueSettings.Add(iv.InputValueSetting);
                             Context.SaveChanges();
 
-                            if(iv.Children != null)
+                            if (iv.Children != null)
                             {
-                                foreach(var childIV in iv.Children)
+                                foreach (var childIV in iv.Children)
                                 {
                                     childIV.actionId = workflowObject.InitAction.Action.Id;
                                     childIV.ParentSettingId = iv.InputValueSetting.Id;
@@ -81,17 +81,18 @@ namespace wispro.sp.api.Controllers
                         throw new ApplicationException("没有设定初始化Action!");
                     }
 
-                    workflowObject.Workflow.InitActionId  = workflowObject.InitAction.Action.Id;
+                    workflowObject.Workflow.InitActionId = workflowObject.InitAction.Action.Id;
                     workflowObject.Workflow.CreateTime = DateTime.Now;
                     workflowObject.Workflow.CreateUserId = Context.Staffs.FirstOrDefault<Staff>(s => s.Name == User.Identity.Name).Id;
                     Context.Workflows.Add(workflowObject.Workflow);
 
-                    
+
                     Context.SaveChanges();
 
-                    entity.workflowDefine.Step endStep = new entity.workflowDefine.Step() { 
-                        Name = "结束", 
-                        workflowId = workflowObject.Workflow.Id ,
+                    entity.workflowDefine.Step endStep = new entity.workflowDefine.Step()
+                    {
+                        Name = "结束",
+                        workflowId = workflowObject.Workflow.Id,
                     };
                     Context.Steps.Add(endStep);
                     Context.SaveChanges();
@@ -101,7 +102,7 @@ namespace wispro.sp.api.Controllers
 
                     t.Commit();
                 }
-                catch(Exception ex)
+                catch (Exception ex)
                 {
                     t.Rollback();
                     ret.Success = false;
@@ -122,7 +123,7 @@ namespace wispro.sp.api.Controllers
                 try
                 {
                     var wInstanes = Context.WorkflowInstances.Where<WorkflowInstance>(w => w.workflowId == workflowId);
-                    if(wInstanes.Count() > 0)
+                    if (wInstanes.Count() > 0)
                     {
                         ret.Success = false;
                         ret.ErrorMessage = "流程已经使用,删除会影响到已有流程实例数据!";
@@ -130,10 +131,10 @@ namespace wispro.sp.api.Controllers
                     }
                     else
                     {
-                        var wf = Context.Workflows.FirstOrDefault(w=>w.Id == workflowId);
+                        var wf = Context.Workflows.FirstOrDefault(w => w.Id == workflowId);
                         if (wf != null)
                         {
-                            entity.workflowDefine.Action  initAction = new entity.workflowDefine.Action() { Id = wf.InitActionId};
+                            entity.workflowDefine.Action initAction = new entity.workflowDefine.Action() { Id = wf.InitActionId };
                             var tfs = GetTrasfers(workflowId);
                             var Actions = GetActions(workflowId);
                             var Steps = GetSteps(workflowId);
@@ -147,11 +148,11 @@ namespace wispro.sp.api.Controllers
 
                             foreach (var action in Actions)
                             {
-                                
+
                                 var ivSettings1 = Context.InputValueSettings.Where<entity.workflowDefine.InputValueSetting>(
                                     s => s.actionId == action.Id).ToList();
 
-                                foreach(var iv in ivSettings1)
+                                foreach (var iv in ivSettings1)
                                 {
                                     Context.InputValueSettings.Remove(iv);
                                 }
@@ -164,7 +165,7 @@ namespace wispro.sp.api.Controllers
                                 {
                                     initAction = action;
                                 }
-                                
+
                             }
                             Context.SaveChanges();
 
@@ -182,7 +183,7 @@ namespace wispro.sp.api.Controllers
                         }
                     }
                 }
-                catch(Exception ex)
+                catch (Exception ex)
                 {
                     t.Rollback();
                     ret.Success = false;
@@ -197,7 +198,7 @@ namespace wispro.sp.api.Controllers
         {
             var ret = new ApiSaveResponse();
             ret.Success = true;
-            
+
             using (var t = Context.Database.BeginTransaction())
             {
                 try
@@ -205,7 +206,7 @@ namespace wispro.sp.api.Controllers
                     var step = stepObj.Step;
                     var wf = GetWorkflow(step.workflowId);
 
-                    if(wf == null)
+                    if (wf == null)
                     {
                         throw new ApplicationException("步骤所属流程不存在!");
                     }
@@ -215,28 +216,28 @@ namespace wispro.sp.api.Controllers
                         Context.Steps.Add(step);
                         Context.SaveChanges();
 
-                        if(stepObj.NewActions != null)
+                        if (stepObj.NewActions != null)
                         {
-                            foreach(var ac in stepObj.NewActions)
+                            foreach (var ac in stepObj.NewActions)
                             {
                                 ac.Action.StepId = step.Id;
                                 Context.Actions.Add(ac.Action);
                                 Context.SaveChanges();
 
-                                if(ac.NewInputValueSettingObjects!= null)
+                                if (ac.NewInputValueSettingObjects != null)
                                 {
-                                    foreach(var iv in ac.NewInputValueSettingObjects)
+                                    foreach (var iv in ac.NewInputValueSettingObjects)
                                     {
                                         iv.InputValueSetting.actionId = ac.Action.Id;
                                         Context.InputValueSettings.Add(iv.InputValueSetting);
 
                                         Context.SaveChanges();
 
-                                        if(iv.InputValueSetting.valueType == entity.workflowDefine.EnumFieldType.List)
+                                        if (iv.InputValueSetting.valueType == entity.workflowDefine.EnumFieldType.List)
                                         {
-                                            if(iv.Children != null)
+                                            if (iv.Children != null)
                                             {
-                                                foreach(var cIV in iv.Children)
+                                                foreach (var cIV in iv.Children)
                                                 {
                                                     cIV.ParentSettingId = iv.InputValueSetting.Id;
                                                     Context.InputValueSettings.Add(cIV);
@@ -263,7 +264,7 @@ namespace wispro.sp.api.Controllers
                             temStep.Name = step.Name;
                             temStep.stepType = step.stepType;
                             temStep.defaultResponseSetting = step.defaultResponseSetting;
-                            
+
                             Context.SaveChanges();
 
                             if (stepObj.NewActions != null)
@@ -302,14 +303,14 @@ namespace wispro.sp.api.Controllers
                                 }
                             }
 
-                            if(stepObj.ModifyActions != null)
+                            if (stepObj.ModifyActions != null)
                             {
-                                foreach(var ac in stepObj.ModifyActions)
+                                foreach (var ac in stepObj.ModifyActions)
                                 {
 
-                                    var temAction = Context.Actions.FirstOrDefault(a=>a.Id == ac.Action.Id);
+                                    var temAction = Context.Actions.FirstOrDefault(a => a.Id == ac.Action.Id);
 
-                                    if(temAction != null)
+                                    if (temAction != null)
                                     {
                                         temAction.Name = ac.Action.Name;
                                         temAction.InputForm = ac.Action.InputForm;
@@ -317,7 +318,7 @@ namespace wispro.sp.api.Controllers
                                         temAction.OnActionObjectType = ac.Action.OnActionObjectType;
                                         Context.SaveChanges();
 
-                                        if(ac.NewInputValueSettingObjects != null)
+                                        if (ac.NewInputValueSettingObjects != null)
                                         {
                                             foreach (var iv in ac.NewInputValueSettingObjects)
                                             {
@@ -343,13 +344,13 @@ namespace wispro.sp.api.Controllers
                                             Context.SaveChanges();
                                         }
 
-                                        if(ac.UpdateInputValueSettingObjects != null)
+                                        if (ac.UpdateInputValueSettingObjects != null)
                                         {
                                             foreach (var iv in ac.UpdateInputValueSettingObjects)
                                             {
-                                                var temIvObj = Context.InputValueSettings.FirstOrDefault(s=>s.Id == iv.InputValueSetting.Id);
+                                                var temIvObj = Context.InputValueSettings.FirstOrDefault(s => s.Id == iv.InputValueSetting.Id);
 
-                                                if(temIvObj != null)
+                                                if (temIvObj != null)
                                                 {
                                                     temIvObj.actionId = iv.InputValueSetting.actionId;
                                                     temIvObj.bindField = iv.InputValueSetting.bindField;
@@ -359,12 +360,12 @@ namespace wispro.sp.api.Controllers
 
                                                     Context.SaveChanges();
                                                 }
-                                                
+
                                             }
                                             Context.SaveChanges();
                                         }
                                     }
-                                    
+
                                 }
                             }
 
@@ -379,7 +380,7 @@ namespace wispro.sp.api.Controllers
                     Context.SaveChanges();
                     t.Commit();
                 }
-                catch(Exception ex)
+                catch (Exception ex)
                 {
                     t.Rollback();
                     ret.Success = false;
@@ -426,7 +427,7 @@ namespace wispro.sp.api.Controllers
             return ret;
         }
 
-        
+
         public ApiSaveResponse DeleteTransfer(int Id)
         {
             ApiSaveResponse ret = new ApiSaveResponse();
@@ -436,11 +437,11 @@ namespace wispro.sp.api.Controllers
             {
                 try
                 {
-                    Context.TrasferConditions.Remove(new entity.workflowDefine.TrasferCondition() { Id=Id });
+                    Context.TrasferConditions.Remove(new entity.workflowDefine.TrasferCondition() { Id = Id });
                     Context.SaveChanges();
                     t.Commit();
                 }
-                catch (Exception ex) 
+                catch (Exception ex)
                 {
                     t.Rollback();
                     ret.Success = false;
@@ -484,14 +485,14 @@ namespace wispro.sp.api.Controllers
             {
                 try
                 {
-                    var step = Context.Steps.FirstOrDefault(s=>s.Id == Id);
+                    var step = Context.Steps.FirstOrDefault(s => s.Id == Id);
 
-                    if(step != null)
+                    if (step != null)
                     {
                         var Transfers = Context.TrasferConditions.Where<entity.workflowDefine.TrasferCondition>(t => t.StepId == step.Id || t.nextStepId == step.Id).ToList();
-                        if(Transfers != null)
+                        if (Transfers != null)
                         {
-                            foreach(var tf in Transfers)
+                            foreach (var tf in Transfers)
                             {
                                 Context.TrasferConditions.Remove(tf);
                             }
@@ -501,15 +502,15 @@ namespace wispro.sp.api.Controllers
 
                         var Actions = Context.Actions.Where<entity.workflowDefine.Action>(s => s.StepId == step.Id).ToList();
 
-                        if(Actions != null)
+                        if (Actions != null)
                         {
-                            foreach(var ac in Actions)
+                            foreach (var ac in Actions)
                             {
-                                foreach(var iv in Context.InputValueSettings.Where(p=>p.actionId== ac.Id).ToList())
+                                foreach (var iv in Context.InputValueSettings.Where(p => p.actionId == ac.Id).ToList())
                                 {
                                     Context.InputValueSettings.Remove(iv);
                                 }
-                                
+
 
                                 Context.Actions.Remove(ac);
                             }
@@ -577,13 +578,13 @@ namespace wispro.sp.api.Controllers
                             temAtion.inputValuesSettings = action.inputValuesSettings;
                             temAtion.OnActionObjectType = action.OnActionObjectType;
 
-                            if(temInputValueSettings != null)
+                            if (temInputValueSettings != null)
                             {
                                 foreach (var iv in temInputValueSettings)
                                 {
-                                    var temIV = Context.InputValueSettings.FirstOrDefault(p=>p.Id == iv.Id);
+                                    var temIV = Context.InputValueSettings.FirstOrDefault(p => p.Id == iv.Id);
 
-                                    if(temIV != null)
+                                    if (temIV != null)
                                     {
                                         temIV.actionId = iv.actionId;
                                         temIV.bindField = iv.bindField;
@@ -597,9 +598,9 @@ namespace wispro.sp.api.Controllers
                                         iv.actionId = action.Id;
                                         Context.InputValueSettings.Add(iv);
                                     }
-                                    
 
-                                    
+
+
                                 }
 
                                 Context.SaveChanges();
@@ -635,8 +636,8 @@ namespace wispro.sp.api.Controllers
             {
                 try
                 {
-                    
-                    
+
+
 
                     if (trasfer.Id == 0)
                     {
@@ -647,7 +648,7 @@ namespace wispro.sp.api.Controllers
                         var temTransfer = Context.TrasferConditions.FirstOrDefault(a => a.Id == trasfer.Id);
                         if (temTransfer != null)
                         {
-                            temTransfer.StepId  = trasfer.StepId;
+                            temTransfer.StepId = trasfer.StepId;
                             temTransfer.nextStepId = trasfer.nextStepId;
                             temTransfer.Condition = trasfer.Condition;
                         }
@@ -678,18 +679,18 @@ namespace wispro.sp.api.Controllers
 
         public entity.workflowDefine.Workflow GetWorkflow(int workflowId)
         {
-            return Context.Workflows.Include(d=>d.InitAction).Include(d=>d.CreateUser).FirstOrDefault<entity.workflowDefine.Workflow>(w => w.Id == workflowId);
+            return Context.Workflows.Include(d => d.InitAction).Include(d => d.CreateUser).FirstOrDefault<entity.workflowDefine.Workflow>(w => w.Id == workflowId);
         }
 
         public List<entity.workflowDefine.Step> GetSteps(int workflowId)
         {
-            return Context.Steps.Where<entity.workflowDefine.Step>(w => w.workflowId  == workflowId).ToList();
+            return Context.Steps.Where<entity.workflowDefine.Step>(w => w.workflowId == workflowId).ToList();
         }
 
         public List<entity.workflowDefine.Action> GetActions(int workflowId)
         {
             var workflow = Context.Workflows.FirstOrDefault<entity.workflowDefine.Workflow>(w => w.Id == workflowId);
-            return Context.Actions.Include(s=>s.step).Where<entity.workflowDefine.Action>(d => d.step.workflowId == workflowId || d.Id == workflow.InitActionId).ToList();
+            return Context.Actions.Include(s => s.step).Where<entity.workflowDefine.Action>(d => d.step.workflowId == workflowId || d.Id == workflow.InitActionId).ToList();
         }
 
         public List<entity.workflowDefine.TrasferCondition> GetTrasfers(int workflowId)
@@ -697,9 +698,9 @@ namespace wispro.sp.api.Controllers
             return Context.TrasferConditions.Where(d => d.Step.workflowId == workflowId || d.nextStep.workflowId == workflowId).ToList();
         }
 
-        public List<entity.workflowDefine.InputValueSetting>  getInputValueSteein(int actionId)
+        public List<entity.workflowDefine.InputValueSetting> getInputValueSteein(int actionId)
         {
-            var retList=  Context.InputValueSettings.Where<entity.workflowDefine.InputValueSetting>(p => p.actionId == actionId).ToList();
+            var retList = Context.InputValueSettings.Where<entity.workflowDefine.InputValueSetting>(p => p.actionId == actionId).ToList();
             return retList;
         }
 
@@ -724,12 +725,12 @@ namespace wispro.sp.api.Controllers
             Bitmap bitmap = svg.Draw();
             MemoryStream mStream = new MemoryStream();
             bitmap.Save(mStream, ImageFormat.Jpeg);
-            
+
             var filename = $"{workflow.Name}.jpg";
             mStream.Position = 0;
             return File(mStream, GetContentType(filename), filename);
 
-            
+
         }
 
         private string GetContentType(string path)
@@ -745,9 +746,9 @@ namespace wispro.sp.api.Controllers
             return contentType;
         }
 
-        public entity.workflowDefine.InputValueSetting  getInputValueSteeingById(int Id)
+        public entity.workflowDefine.InputValueSetting getInputValueSteeingById(int Id)
         {
-            return Context.InputValueSettings.FirstOrDefault(s=>s.Id == Id);
+            return Context.InputValueSettings.FirstOrDefault(s => s.Id == Id);
         }
     }
 }

+ 1 - 1
wispro.sp.api/Job/GetPerformanceItemJob.cs

@@ -21,7 +21,7 @@ namespace wispro.sp.api.Job
                 caseStage = temCaseStage.ToString();
             }
 
-            _ = new PerformanceItemController(new spDbContext(),new Services.FileTaskCacheService()).GetItemInfoByCaseStage(CaseNo, DoItem, caseStage);
+            _ = new PerformanceItemController(new spDbContext(), new Services.FileTaskCacheService()).GetItemInfoByCaseStage(CaseNo, DoItem, caseStage);
             return Task.CompletedTask;
         }
     }

+ 48 - 48
wispro.sp.api/Job/ImportProjectInfoJob.cs

@@ -23,22 +23,22 @@ namespace wispro.sp.api.Job
 
         private void DownloadProject_SQL()
         {
-            
+
             List<PerformanceItem> pfItems = new List<PerformanceItem>();
-            
-                DataTable data = GetDataFromIPEasy();
 
-                var Items = GetProjectItem(data);
+            DataTable data = GetDataFromIPEasy();
+
+            var Items = GetProjectItem(data);
 
-			foreach (var item in Items)
-			{
-				var temObj = pfItems.FirstOrDefault<PerformanceItem>(s => s.CaseNo == item.CaseNo);
-				if (temObj == null)
-				{
-					item.Type = "专案";
-					pfItems.Add(item);
-				}
-			}
+            foreach (var item in Items)
+            {
+                var temObj = pfItems.FirstOrDefault<PerformanceItem>(s => s.CaseNo == item.CaseNo);
+                if (temObj == null)
+                {
+                    item.Type = "专案";
+                    pfItems.Add(item);
+                }
+            }
 
             //List<BasePointRule> rules = spDb.BasePointRules.ToList<BasePointRule>();
             foreach (var item in pfItems)
@@ -82,40 +82,40 @@ namespace wispro.sp.api.Job
         }
 
         private List<PerformanceItem> GetProjectItem(DataTable dt)
-		{
-			#region 删除重复行
-			DataTable temdt = new DataTable();
-			foreach (DataColumn col in dt.Columns)
-			{
-
-				DataColumn temCol = new DataColumn();
-				temCol.ColumnName = col.ColumnName;
-				temCol.DataType = col.DataType;
-				temCol.Caption = col.Caption;
-
-				temdt.Columns.Add(temCol);
-			}
-
-			new ExcelHelper().MerageDataTable(temdt, dt);
-			#endregion
-
-			List<PerformanceItem> Items = new List<PerformanceItem>();
-			int iRow = 0;
-			foreach (DataRow row in temdt.Rows)
-			{
-				string strDebug = $"{++iRow}\t{row["我方文号"]}";
-				PerformanceItem item = null;
-				
-				item = Row2Item_3(row);
-				
-				if (item != null)
-				{
-					Items.Add(item);
-				}
-			}
-
-			return Items;
-		}
+        {
+            #region 删除重复行
+            DataTable temdt = new DataTable();
+            foreach (DataColumn col in dt.Columns)
+            {
+
+                DataColumn temCol = new DataColumn();
+                temCol.ColumnName = col.ColumnName;
+                temCol.DataType = col.DataType;
+                temCol.Caption = col.Caption;
+
+                temdt.Columns.Add(temCol);
+            }
+
+            new ExcelHelper().MerageDataTable(temdt, dt);
+            #endregion
+
+            List<PerformanceItem> Items = new List<PerformanceItem>();
+            int iRow = 0;
+            foreach (DataRow row in temdt.Rows)
+            {
+                string strDebug = $"{++iRow}\t{row["我方文号"]}";
+                PerformanceItem item = null;
+
+                item = Row2Item_3(row);
+
+                if (item != null)
+                {
+                    Items.Add(item);
+                }
+            }
+
+            return Items;
+        }
 
         private PerformanceItem Row2Item_3(DataRow row)
         {
@@ -371,7 +371,7 @@ namespace wispro.sp.api.Job
             return item;
         }
         private DataTable GetDataFromIPEasy()
-		{
+        {
             HttpClient http = new HttpClient();
             var bytRespon = http.GetAsync($"{ConfigHelper.GetSectionValue("IPEasySetting:ipEeasyApi")}/api/ipEasy/getProjectDataFromIPEasy").Result;
 

+ 61 - 60
wispro.sp.api/Job/ImportReportJob.cs

@@ -20,7 +20,7 @@ namespace wispro.sp.api.Job
 {
     public class ImportReportJob : Quartz.IJob
     {
-        
+
         /// <summary>
         /// 不需要计算绩效的处理事项
         /// </summary>
@@ -66,7 +66,7 @@ namespace wispro.sp.api.Job
             "补缴费用"
         };
 
-        
+
         spDbContext spDb = new spDbContext();
 
         public Task ImportData(string ReportName)
@@ -150,7 +150,7 @@ namespace wispro.sp.api.Job
                     break;
                 case 1:
                     DownloadReport_SQL("每月绩效统计--上个月递交完成案件", calMonth, true);
-                    break; 
+                    break;
                 case 2:
                     DownloadReport_SQL("每月绩效统计--中国一次OA授权表", calMonth, true, true);
                     break;
@@ -158,7 +158,7 @@ namespace wispro.sp.api.Job
 
             return Task.CompletedTask;
         }
-        
+
         public Task Execute(IJobExecutionContext context)
         {
             CalMonth calMonth = new CalMonth()
@@ -173,12 +173,12 @@ namespace wispro.sp.api.Job
 
             if (temCalMonth != null)
             {
-                
+
                 var iCount = spDb.PerformanceItems.Where<PerformanceItem>(p => p.CalMonthId == temCalMonth.Id).Count<PerformanceItem>();
 
                 if (iCount > 0)
                 {
-                     return Task.CompletedTask;
+                    return Task.CompletedTask;
                 }
                 calMonth = temCalMonth;
             }
@@ -195,7 +195,7 @@ namespace wispro.sp.api.Job
             //DownloadReport( "每月绩效统计--发客户超过一个月未完成案件", calMonth,false);
 
             //每月绩效统计--上个月递交完成案件
-            DownloadReport_SQL("每月绩效统计--上个月递交完成案件", calMonth,true);
+            DownloadReport_SQL("每月绩效统计--上个月递交完成案件", calMonth, true);
             //DownloadReport("每月绩效统计--上个月递交完成案件", calMonth, true);
 
             //每月绩效统计--中国一次OA授权表
@@ -212,16 +212,16 @@ namespace wispro.sp.api.Job
         {
             try
             {
-                DataTable data = GetDataFromIPEasy(ReportName,isModifyDate);
+                DataTable data = GetDataFromIPEasy(ReportName, isModifyDate);
                 InputPerformanctItem(calMonth, isFirstOA, data);
             }
             catch
             {
-                
+
             }
         }
 
-        
+
         private Task InputPerformanceItem(string strExcelFile, bool isColumnName, bool ignorHideRows = false, int ColumnNameRow = 0, CalMonth calMonth = null, bool isFirstOAFile = false)
         {
             DataTable dt = NPOIExcel.ExcelToDataTable(strExcelFile, isColumnName, ignorHideRows, ColumnNameRow);
@@ -230,7 +230,7 @@ namespace wispro.sp.api.Job
 
         private Task InputPerformanctItem(CalMonth calMonth, bool isFirstOAFile, DataTable dt)
         {
-            if(dt == null)
+            if (dt == null)
             {
                 return Task.CompletedTask;
             }
@@ -302,12 +302,12 @@ namespace wispro.sp.api.Job
             return (item.DoItem == "处理审查意见" && item.FinishedDate == null);
         }
 
-        private Task SavePerformanceItem(PerformanceItem item,List<BasePointRule> rules)
+        private Task SavePerformanceItem(PerformanceItem item, List<BasePointRule> rules)
         {
             try
             {
                 Utility.Utility.CalBasePoint(item, rules);
-                var ret= new Controllers.PerformanceItemController(new spDbContext(),new Services.FileTaskCacheService()).New(item);
+                var ret = new Controllers.PerformanceItemController(new spDbContext(), new Services.FileTaskCacheService()).New(item);
                 if (ret.Success == false)
                 {
                     System.Diagnostics.Debug.WriteLine(ret.ErrorMessage);
@@ -321,8 +321,8 @@ namespace wispro.sp.api.Job
             return Task.CompletedTask;
         }
 
-        
-        private PerformanceItem Row2Item_1(DataRow row,  CalMonth calMonth)
+
+        private PerformanceItem Row2Item_1(DataRow row, CalMonth calMonth)
         {
             PerformanceItem item = new PerformanceItem();
             item.ApplicationType = row["申请类型"].ToString().Trim();
@@ -337,7 +337,7 @@ namespace wispro.sp.api.Job
                 return null;
             }
 
-            
+
 
             if (calMonth != null)
             {
@@ -463,7 +463,7 @@ namespace wispro.sp.api.Job
 
             //案件备注
             item.CaseMemo = $"发文日期:{row["发文日期"].ToString().Trim()}\r\n客户文号:{row["客户文号"].ToString().Trim()}\r\n上传日期:{row["上传日期"].ToString().Trim()}\r\n文件描述:{row["文件描述"].ToString().Trim()}";
-            
+
             if (row.Table.Columns.Contains("翻译字数"))
             {
                 //item.ReviewerId = GetStaff(row["案件核稿人"].ToString().Trim());
@@ -476,14 +476,14 @@ namespace wispro.sp.api.Job
                         item.WordCount = int.Parse(strWordCount);
                     }
                     catch { }
-                    
+
                 }
             }
 
             return item;
         }
 
-        private PerformanceItem Row2Item(DataRow row,  CalMonth calMonth)
+        private PerformanceItem Row2Item(DataRow row, CalMonth calMonth)
         {
             PerformanceItem item = new PerformanceItem();
             item.CaseNo = row["我方文号"].ToString().Trim();
@@ -756,50 +756,51 @@ namespace wispro.sp.api.Job
             {
                 return wispro.sp.utility.IPEasyUtility.DownloadReport(ReportName, isModifyDate);
             }
-            catch {
+            catch
+            {
                 return null;
             }
             #region 利用维德系统服务器上的API获取
-        //    int iTry = 0;
-
-        //tryAgain:
-        //    try
-        //    {
-                
-        //        HttpClient http = new HttpClient();
-        //        var bytRespon = http.GetAsync($"{ConfigHelper.GetSectionValue("IPEasySetting:ipEeasyApi")}/api/ipEasy/GetDataFromIPEasy?ReportName={ReportName}&isModifyDate={isModifyDate}").Result;
-
-        //        if (bytRespon.IsSuccessStatusCode)
-        //        {
-        //            string result = bytRespon.Content.ReadAsStringAsync().Result.Replace("\"", string.Empty);
-        //            byte[] data = Convert.FromBase64String(result);
-        //            //byte[] data = bytRespon.Content.ReadAsByteArrayAsync().Result;//Here is the problem
-        //            XmlSerializer serializer = new XmlSerializer(typeof(System.Data.DataTable));
-        //            MemoryStream memory = new MemoryStream(data);
-        //            DataTable dt = (DataTable)serializer.Deserialize(memory);
-
-        //            return dt;
-        //        }
-        //        else
-        //        {
-        //            if (iTry < 3)
-        //            {
-        //                iTry++;
-        //                goto tryAgain;
-        //            }
-                    
-        //        }
-        //    }
-        //    catch (Exception ex)
-        //    {
-        //        if (iTry < 3)
-        //        {
-        //            iTry++;
-        //            goto tryAgain;
-        //        }
-        //    }
-
-        //    return null;
+            //    int iTry = 0;
+
+            //tryAgain:
+            //    try
+            //    {
+
+            //        HttpClient http = new HttpClient();
+            //        var bytRespon = http.GetAsync($"{ConfigHelper.GetSectionValue("IPEasySetting:ipEeasyApi")}/api/ipEasy/GetDataFromIPEasy?ReportName={ReportName}&isModifyDate={isModifyDate}").Result;
+
+            //        if (bytRespon.IsSuccessStatusCode)
+            //        {
+            //            string result = bytRespon.Content.ReadAsStringAsync().Result.Replace("\"", string.Empty);
+            //            byte[] data = Convert.FromBase64String(result);
+            //            //byte[] data = bytRespon.Content.ReadAsByteArrayAsync().Result;//Here is the problem
+            //            XmlSerializer serializer = new XmlSerializer(typeof(System.Data.DataTable));
+            //            MemoryStream memory = new MemoryStream(data);
+            //            DataTable dt = (DataTable)serializer.Deserialize(memory);
+
+            //            return dt;
+            //        }
+            //        else
+            //        {
+            //            if (iTry < 3)
+            //            {
+            //                iTry++;
+            //                goto tryAgain;
+            //            }
+
+            //        }
+            //    }
+            //    catch (Exception ex)
+            //    {
+            //        if (iTry < 3)
+            //        {
+            //            iTry++;
+            //            goto tryAgain;
+            //        }
+            //    }
+
+            //    return null;
             #endregion
 
 

+ 4 - 4
wispro.sp.api/Job/InvalidDataMessageJob.cs

@@ -15,11 +15,11 @@ namespace wispro.sp.api.Job
         {
             spDbContext spDb = new spDbContext();
 
-            
+
             var lstItem = spDb.PerformanceItems.Where<PerformanceItem>(p =>
-                (p.AgentFeedbackMemo != "已算绩效"  && p.CalMonth.Status == 0 && !p.CaseNo.StartsWith("J") 
-                && (p.BasePoint ==null || (string.IsNullOrEmpty(p.CaseCoefficient) && p.Type =="新申请")
-                || (p.Type =="OA" && string.IsNullOrEmpty(p.CaseCoefficient) && p.DoItemCoefficient =="实质")
+                (p.AgentFeedbackMemo != "已算绩效" && p.CalMonth.Status == 0 && !p.CaseNo.StartsWith("J")
+                && (p.BasePoint == null || (string.IsNullOrEmpty(p.CaseCoefficient) && p.Type == "新申请")
+                || (p.Type == "OA" && string.IsNullOrEmpty(p.CaseCoefficient) && p.DoItemCoefficient == "实质")
                 || (string.IsNullOrEmpty(p.DoItemCoefficient))
                 )))
                 .Include(p => p.Reviewer)

+ 2 - 2
wispro.sp.api/Job/MailJob.cs

@@ -10,13 +10,13 @@ namespace wispro.sp.api.Job
     {
         public Task Execute(IJobExecutionContext context)
         {
-            
+
             string Subject = context.JobDetail.JobDataMap.Get("Subject").ToString();
             string Body = context.JobDetail.JobDataMap.Get("Body").ToString();
             string To = context.JobDetail.JobDataMap.Get("To").ToString();
             string Reciver = context.JobDetail.JobDataMap.Get("Reciever").ToString();
             string AttachFiles = context.JobDetail.JobDataMap.Get("AttachFiles")?.ToString();
-            utility.MailUtil.SendEmail(Subject,Body,Reciver,To,AttachFiles);
+            utility.MailUtil.SendEmail(Subject, Body, Reciver, To, AttachFiles);
             return Task.CompletedTask;
         }
     }

+ 2 - 2
wispro.sp.api/Job/QuartzUtil.cs

@@ -53,7 +53,7 @@ namespace wispro.sp.api.Job
             await _scheduler.ScheduleJob(job, trigger);
         }
 
-        public static async Task AddMailJob(string Subject,string Body,string toName,string To,string AttachFiles=null)
+        public static async Task AddMailJob(string Subject, string Body, string toName, string To, string AttachFiles = null)
         {
             await Init();
 
@@ -65,7 +65,7 @@ namespace wispro.sp.api.Job
             var job = JobBuilder.Create(typeof(MailJob))
                 .Build();
 
-            job.JobDataMap.Put("Subject",Subject);
+            job.JobDataMap.Put("Subject", Subject);
             job.JobDataMap.Put("Body", Body);
             job.JobDataMap.Put("To", To);
             job.JobDataMap.Put("Reciever", toName);

+ 24 - 24
wispro.sp.api/Job/UpdateJXDataFromIPEasyJob.cs

@@ -21,10 +21,10 @@ namespace wispro.sp.api.Job
 {
     public class UpdateJXDataFromIPEasyJob : IJob
     {
-       
-        public dynamic  GetItemFromIPEasyDB(PerformanceItem Item, spDbContext spDb)
+
+        public dynamic GetItemFromIPEasyDB(PerformanceItem Item, spDbContext spDb)
         {
-            return wispro.sp.utility.IPEasyUtility.GetPerformanceRecord(Item.CaseNo, Item.DoItem,Item.CaseStage);
+            return wispro.sp.utility.IPEasyUtility.GetPerformanceRecord(Item.CaseNo, Item.DoItem, Item.CaseStage);
             #region 从维德系统服务上的API获取数据
             //HttpClient http = new HttpClient();
 
@@ -252,7 +252,7 @@ namespace wispro.sp.api.Job
             retItem.CaseType = row["case_type_zh_cn"].ToString();
             retItem.CaseState = row["case_status_zh_cn"].ToString();
             retItem.DoItemState = row["proc_status_zh_cn"].ToString();
-            retItem.DoItemMemo  = row["proc_note"].ToString();
+            retItem.DoItemMemo = row["proc_note"].ToString();
             retItem.CaseName = row["case_name"].ToString();
             retItem.EntrustingDate = row["charge_date"].ToString();
             retItem.CustomerLimitDate = row["cus_due_date"].ToString();
@@ -262,7 +262,7 @@ namespace wispro.sp.api.Job
             retItem.FinalizationDate = row["finish_doc_date"].ToString();
         }
 
-        public void UpdateFromIPEasy(PerformanceItem Item,spDbContext spDb)
+        public void UpdateFromIPEasy(PerformanceItem Item, spDbContext spDb)
         {
             List<string> caseNos = new List<string>()
             {
@@ -381,7 +381,7 @@ namespace wispro.sp.api.Job
 
             if (keyValuePairs.ContainsKey("CaseCoefficient") && Item.CaseCoefficient != retObj.CaseCoefficient && caseXS)
             {
-                if(!(retObj.CaseCoefficient == null && string.IsNullOrEmpty(Item.CaseCoefficient)))
+                if (!(retObj.CaseCoefficient == null && string.IsNullOrEmpty(Item.CaseCoefficient)))
                     Item.CaseCoefficient = retObj.CaseCoefficient;
             }
 
@@ -427,9 +427,9 @@ namespace wispro.sp.api.Job
         {
             spDbContext spDb = new spDbContext();
 
-            var Results = spDb.PerformanceItems.Include(p=>p.Customer).Where(p => 
-                (p.AgentFeedbackMemo != "已算绩效" || p.AgentFeedbackMemo == null) 
-                && p.CalMonth.Status == 0 
+            var Results = spDb.PerformanceItems.Include(p => p.Customer).Where(p =>
+                (p.AgentFeedbackMemo != "已算绩效" || p.AgentFeedbackMemo == null)
+                && p.CalMonth.Status == 0
                 && !p.CaseNo.StartsWith("J"));
 
             switch (type.ToString())
@@ -472,7 +472,7 @@ namespace wispro.sp.api.Job
                     System.Diagnostics.Debug.WriteLine(ex.ToString());
                     Log($"{DateTime.Now}\t{++i}/{listItems.Count}\t{Item.CaseNo}\t更新失败!");
                 }
-                
+
             }
 
 
@@ -483,16 +483,16 @@ namespace wispro.sp.api.Job
             spDbContext spDb = new spDbContext();
 
             int lastUpdate = getInt();
-            
+
 
             var lstItem = spDb.PerformanceItems.Where<PerformanceItem>(p =>
-                ((p.AgentFeedbackMemo != "已算绩效" || p.AgentFeedbackMemo==null ) 
-                    && p.CalMonth.Status == 0 && 
+                ((p.AgentFeedbackMemo != "已算绩效" || p.AgentFeedbackMemo == null)
+                    && p.CalMonth.Status == 0 &&
                     !p.CaseNo.StartsWith("J")))
-                .Include(p=>p.Reviewer)
-                .Include(p=>p.CalMonth)
-                .Include(p=>p.Customer)
-                .Include(p=>p.ItemStaffs).ThenInclude(p=>p.DoPerson)
+                .Include(p => p.Reviewer)
+                .Include(p => p.CalMonth)
+                .Include(p => p.Customer)
+                .Include(p => p.ItemStaffs).ThenInclude(p => p.DoPerson)
                 .ToList<PerformanceItem>();
 
             if (lstItem != null)
@@ -507,23 +507,23 @@ namespace wispro.sp.api.Job
                     }
 
                     System.Threading.Thread.Sleep(100);
-                    int iTryCount = 0;    
+                    int iTryCount = 0;
                 TryAgain:
                     try
                     {
                         iTryCount++;
-                        
+
                         UpdateFromIPEasy(Item, spDb);
-                        
+
 
                         Log($"{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)
+                    catch (Exception ex)
                     {
-                        if(iTryCount <= 3)
+                        if (iTryCount <= 3)
                         {
                             goto TryAgain;
                         }
@@ -543,7 +543,7 @@ namespace wispro.sp.api.Job
             return Task.CompletedTask;
         }
 
-        
+
         private void Log(string strMessage)
         {
             StreamWriter sw = File.AppendText("c:\\temp\\log.txt");
@@ -566,7 +566,7 @@ namespace wispro.sp.api.Job
             {
                 return 0;
             }
-            
+
         }
 
         private void save(int i)

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

@@ -115,6 +115,6 @@ namespace wispro.sp.api
                     webBuilder.UseStartup<Startup>();
                 });
 
-        
+
     }
 }

+ 4 - 4
wispro.sp.api/Services/FileTaskCacheService.cs

@@ -21,11 +21,11 @@ namespace wispro.sp.api.Services
 
         public bool Add(FileProcessTask processTask)
         {
-            if(processTask != null)
+            if (processTask != null)
             {
-                var temObj = lstFileTask.FirstOrDefault(s=>s.Id == processTask.Id);
+                var temObj = lstFileTask.FirstOrDefault(s => s.Id == processTask.Id);
 
-                if(temObj == null)
+                if (temObj == null)
                 {
                     lstFileTask.Add(processTask);
 
@@ -58,7 +58,7 @@ namespace wispro.sp.api.Services
                 return false;
             }
 
-           
+
         }
     }
 }

+ 5 - 4
wispro.sp.api/Startup.cs

@@ -43,7 +43,7 @@ namespace wispro.sp.api
                 });
             });
 
-            
+
             services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme).AddJwtBearer(option =>
             {
                 option.TokenValidationParameters = new TokenValidationParameters
@@ -73,7 +73,7 @@ namespace wispro.sp.api
                     options.JsonSerializerOptions.MaxDepth = 64;
                     //nullÖµ²»ÐòÁл¯Îªjson   
                     options.JsonSerializerOptions.IgnoreNullValues = true;
-                    
+
                 });
 
             services.AddDbContext<spDbContext>(optionsAction =>
@@ -87,7 +87,8 @@ namespace wispro.sp.api
 
             services.AddMemoryCache();
 
-            services.Configure<IISServerOptions>(options => { 
+            services.Configure<IISServerOptions>(options =>
+            {
                 options.MaxRequestBodySize = int.MaxValue;
             });
 
@@ -115,7 +116,7 @@ namespace wispro.sp.api
                 endpoints.MapControllers();
             });
 
-            
+
         }
     }
 }

+ 3 - 3
wispro.sp.api/Utility/MyMemeryCache.cs

@@ -10,18 +10,18 @@ namespace wispro.sp.api.Utility
     {
         static IMemoryCache _cache = new MemoryCache(new MemoryCacheOptions());
 
-        public static bool TryGetValue(string strKey,out object outValue)
+        public static bool TryGetValue(string strKey, out object outValue)
         {
             return _cache.TryGetValue(strKey, out outValue);
         }
 
-        public static void SetValue(string strKey,object value)
+        public static void SetValue(string strKey, object value)
         {
             var cacheEntryOptions = new MemoryCacheEntryOptions()
                     // Keep in cache for this time, reset time if accessed.
                     .SetSlidingExpiration(TimeSpan.FromHours(1));
 
-            _cache.Set(strKey, value,cacheEntryOptions);
+            _cache.Set(strKey, value, cacheEntryOptions);
         }
     }
 }

+ 19 - 18
wispro.sp.api/Utility/Utility.cs

@@ -12,8 +12,8 @@ namespace wispro.sp.api.Utility
     {
         public static void CalBasePoint(PerformanceItem item, List<BasePointRule> rules)
         {
-            
-            if ((item.CaseNo.ToUpper().StartsWith("S") && item.Type=="专案") || item.AgentFeedbackMemo == "特殊点数申诉")
+
+            if ((item.CaseNo.ToUpper().StartsWith("S") && item.Type == "专案") || item.AgentFeedbackMemo == "特殊点数申诉")
             {
                 return;
             }
@@ -36,18 +36,18 @@ namespace wispro.sp.api.Utility
                 var interpreter = new Interpreter(options)
                     .Reference(typeof(System.Linq.Enumerable));
 
-                
+
 
                 try
                 {
-                    
-                    Func<PerformanceItem,Customer, bool> func = interpreter.ParseAsDelegate<Func<PerformanceItem,Customer,bool>>(rule.Rule, "p","Customer");
 
-                    bool result = func.Invoke(item,item.Customer);
+                    Func<PerformanceItem, Customer, bool> func = interpreter.ParseAsDelegate<Func<PerformanceItem, Customer, bool>>(rule.Rule, "p", "Customer");
+
+                    bool result = func.Invoke(item, item.Customer);
 
                     if (result)
                     {
-                        
+
                         var temString = rule.PointExpress;
 
                         if (!rule.PointExpress.Contains("."))
@@ -56,10 +56,10 @@ namespace wispro.sp.api.Utility
                         }
 
                         var target = new Interpreter().SetVariable("p", item);
-                        
+
                         double? temPoint = (double?)target.Eval(temString);
                         string temType = rule.Type;
-                        if(temString.Contains("p.WordCount") && item.DoItem == "新申请" && temPoint.HasValue)
+                        if (temString.Contains("p.WordCount") && item.DoItem == "新申请" && temPoint.HasValue)
                         {
                             switch (item.DoItemCoefficient)
                             {
@@ -69,7 +69,7 @@ namespace wispro.sp.api.Utility
                                         temType = "新申请";
                                         temPoint = 1.9;
                                     }
-                                   
+
                                     break;
                                 case "中-英":
                                     if (1.8 > temPoint.Value)
@@ -89,17 +89,18 @@ namespace wispro.sp.api.Utility
                             }
                         }
 
-                        if(item.BasePoint != temPoint || item.Type !=temType)
+                        if (item.BasePoint != temPoint || item.Type != temType)
                         {
                             item.BasePoint = temPoint;
                             item.Type = temType;
                         }
-                        
+
                         break;
                     }
                 }
-                catch(Exception ex) {
-                    System.Diagnostics.Debug.WriteLine($"{rule.Rule}\t{ex.Message}" );
+                catch (Exception ex)
+                {
+                    System.Diagnostics.Debug.WriteLine($"{rule.Rule}\t{ex.Message}");
                 }
             }
             #endregion
@@ -163,12 +164,12 @@ namespace wispro.sp.api.Utility
             return retList;
         }
 
-        public  static  List<string> GetFeedbackMemos(PerformanceItem item, List<BasePointRule> rules)
+        public static List<string> GetFeedbackMemos(PerformanceItem item, List<BasePointRule> rules)
         {
             List<string> retList = new List<string>();
-            foreach(BasePointRule rule in rules)
+            foreach (BasePointRule rule in rules)
             {
-                Regex r= new System.Text.RegularExpressions.Regex("p.AgentFeedbackMemo==\"(.+?)\"");
+                Regex r = new System.Text.RegularExpressions.Regex("p.AgentFeedbackMemo==\"(.+?)\"");
 
                 Match m = r.Match(rule.Rule);
 
@@ -224,6 +225,6 @@ namespace wispro.sp.api.Utility
             return retList;
         }
 
-        
+
     }
 }

+ 81 - 66
wispro.sp.api/spDbContext.cs

@@ -37,7 +37,7 @@ namespace wispro.sp.api
 
         public virtual DbSet<Message> Messages { get; set; }
 
-        public virtual DbSet<MessageReadRecord> MessageReadRecords { get;set;}
+        public virtual DbSet<MessageReadRecord> MessageReadRecords { get; set; }
 
         public virtual DbSet<MessagePerformanceItem> MessagePerformanceItems { get; set; }
 
@@ -99,7 +99,7 @@ namespace wispro.sp.api
 
         public virtual DbSet<DepartmentPosition> DepartmentPositions { get; set; }
 
-        
+
         protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
         {
             if (!optionsBuilder.IsConfigured)
@@ -113,13 +113,14 @@ namespace wispro.sp.api
 
         protected override void OnModelCreating(ModelBuilder modelBuilder)
         {
-            modelBuilder.Entity<CaseCeoffcient>( entity=>
+            modelBuilder.Entity<CaseCeoffcient>(entity =>
             {
                 entity.ToTable("CaseCeofficient");
 
-                entity.HasKey(e=>e.Ceoffcient);
+                entity.HasKey(e => e.Ceoffcient);
             });
-            modelBuilder.Entity<BasePointRule>(entity=> {
+            modelBuilder.Entity<BasePointRule>(entity =>
+            {
                 entity.ToTable("BasePointRule");
 
                 entity.Property(e => e.PointExpress).HasMaxLength(100);
@@ -137,7 +138,7 @@ namespace wispro.sp.api
 
                     entity.Property(e => e.Status).HasColumnName("status");
                 }
-            ) ;
+            );
             modelBuilder.Entity<Customer>(entity =>
             {
                 entity.ToTable("Customer");
@@ -226,7 +227,7 @@ namespace wispro.sp.api
                 entity.Property(e => e.PreOastaffId).HasColumnName("PreOAStaffId");
 
                 entity.Property(e => e.ReturnDate).HasColumnType("date");
-                
+
 
                 entity.HasOne(d => d.Customer)
                     .WithMany(p => p.PerformanceItems)
@@ -264,7 +265,7 @@ namespace wispro.sp.api
             {
                 entity.ToTable("ProjectInfo");
 
-                entity.HasKey(entity=>entity.CaseNo);
+                entity.HasKey(entity => entity.CaseNo);
 
                 entity.HasOne(d => d.Customer)
                     .WithMany()
@@ -281,14 +282,14 @@ namespace wispro.sp.api
                     .HasForeignKey(d => d.ReviewerId)
                     .HasConstraintName("FK_ProjectInfo_Reviewer");
 
-                
+
             });
 
             modelBuilder.Entity<ProjectContentRecord>(entity =>
             {
                 entity.ToTable("ProjectContentRecord");
 
-                
+
                 entity.HasOne(d => d.CalMonth)
                     .WithMany()
                     .HasForeignKey(d => d.CalMonthId)
@@ -317,11 +318,11 @@ namespace wispro.sp.api
                 entity.ToTable("ProjectWorkContent");
 
                 entity.HasOne(d => d.ContentRecord)
-                    .WithMany(d=>d.ProjectWorkContents)
-                    .HasForeignKey(d=>d.ContentRecordId)
+                    .WithMany(d => d.ProjectWorkContents)
+                    .HasForeignKey(d => d.ContentRecordId)
                     .HasConstraintName("FK_ProjectRecord_WorkflowContent");
 
-                
+
             });
             #endregion
 
@@ -400,7 +401,7 @@ namespace wispro.sp.api
 
                 entity.HasOne(d => d.CalMonth)
                     .WithMany()
-                    .HasForeignKey(d=>d.CalMonthId);
+                    .HasForeignKey(d => d.CalMonthId);
 
                 entity.HasOne(d => d.Staff)
                     .WithMany()
@@ -428,7 +429,7 @@ namespace wispro.sp.api
                 entity.HasOne(d => d.Grade)
                     .WithMany()
                     .HasForeignKey(d => d.GradeId);
-                
+
             });
 
             modelBuilder.Entity<AllocationRatio>(entity =>
@@ -451,7 +452,7 @@ namespace wispro.sp.api
                     .HasForeignKey(d => d.ItemId)
                     .OnDelete(DeleteBehavior.ClientSetNull)
                     .HasConstraintName("FK_FK_AllocationRatio_PerformanceItem");
-                
+
             });
 
             modelBuilder.Entity<Message>(entity =>
@@ -473,7 +474,7 @@ namespace wispro.sp.api
 
             modelBuilder.Entity<MessageReadRecord>(entity =>
             {
-                entity.HasKey(e => new { e.MessageId,e.StaffId});
+                entity.HasKey(e => new { e.MessageId, e.StaffId });
 
                 entity.ToTable("MessageReadRecord");
 
@@ -493,16 +494,16 @@ namespace wispro.sp.api
 
             });
 
-            modelBuilder.Entity<MessagePerformanceItem>( entity =>
+            modelBuilder.Entity<MessagePerformanceItem>(entity =>
             {
-                entity.HasKey(e=> new { e.ItemId,e.MessageId});
+                entity.HasKey(e => new { e.ItemId, e.MessageId });
 
                 entity.HasOne(d => d.Message)
                     .WithMany(m => m.RelatedItem)
                     .HasForeignKey(d => d.MessageId)
                     .HasConstraintName("FK_MessagePerformanceItem_Message");
 
-                entity.HasOne(d => d.Item )
+                entity.HasOne(d => d.Item)
                     .WithMany()
                     .HasForeignKey(d => d.ItemId)
                     .HasConstraintName("FK_MessagePerformanceItem_Item");
@@ -513,7 +514,7 @@ namespace wispro.sp.api
 
                 entity.ToTable("AttachFile");
 
-                entity.Property(e=>e.Name).HasMaxLength(200);
+                entity.Property(e => e.Name).HasMaxLength(200);
                 entity.Property(e => e.SavePath).HasMaxLength(200);
 
                 entity.HasOne(d => d.UploadUser)
@@ -523,10 +524,10 @@ namespace wispro.sp.api
                     .OnDelete(DeleteBehavior.NoAction);
 
                 entity.HasOne(d => d.AppealRecord)
-                    .WithMany(a=>a.AttachFiles)
+                    .WithMany(a => a.AttachFiles)
                     .HasForeignKey(d => d.AppealRecordId)
                     .HasConstraintName("FK_AttachFile_AppealRecord")
-                    .IsRequired(false); 
+                    .IsRequired(false);
             });
 
             modelBuilder.Entity<AppealType>(entity =>
@@ -559,40 +560,43 @@ namespace wispro.sp.api
 
                 entity.HasOne(d => d.Item)
                     .WithMany()
-                    .HasForeignKey(d=>d.ItemId);
-            }) ;
+                    .HasForeignKey(d => d.ItemId);
+            });
 
-            modelBuilder.Entity<InputField>(entity=> {
+            modelBuilder.Entity<InputField>(entity =>
+            {
                 entity.ToTable("InputField");
 
-                entity.Property(e=>e.FieldName).HasMaxLength(50);
-                entity.Property(e => e.FieldType).HasMaxLength(50);                
+                entity.Property(e => e.FieldName).HasMaxLength(50);
+                entity.Property(e => e.FieldType).HasMaxLength(50);
                 entity.Property(e => e.MapObjectField).HasMaxLength(50);
 
                 entity.HasOne(d => d.AppealType)
                     .WithMany()
-                    .HasForeignKey(d=>d.AppealTypeId);
+                    .HasForeignKey(d => d.AppealTypeId);
 
                 //entity.HasKey(d=>new { d.AppealTypeId,d.AppealState});
 
             });
 
-            modelBuilder.Entity<SelectValue>(entity => {
+            modelBuilder.Entity<SelectValue>(entity =>
+            {
                 entity.ToTable("SelectValue");
-                
+
                 entity.HasOne(d => d.InputField)
-                    .WithMany(s=>s.SelectValues)
+                    .WithMany(s => s.SelectValues)
                     .HasForeignKey(d => d.InputFieldId);
 
                 //entity.HasKey(d=>new { d.AppealTypeId,d.AppealState});
 
             });
 
-            modelBuilder.Entity<InputFieldValue>(entity => {
+            modelBuilder.Entity<InputFieldValue>(entity =>
+            {
                 entity.ToTable("InputFieldValue");
 
                 entity.Property(e => e.Value).HasMaxLength(500);
-                
+
                 entity.HasOne(d => d.InputField)
                     .WithMany()
                     .HasForeignKey(d => d.InputFieldId);
@@ -601,20 +605,23 @@ namespace wispro.sp.api
                     .WithMany()
                     .HasForeignKey(d => d.AppealRecordId);
 
-               //entity.HasKey(d=>new { d.AppealRecordId,d.InputFieldId});
+                //entity.HasKey(d=>new { d.AppealRecordId,d.InputFieldId});
 
             });
 
-            modelBuilder.Entity<Department>(entity => {
+            modelBuilder.Entity<Department>(entity =>
+            {
                 entity.ToTable("Department");
-                
+
             });
 
-            modelBuilder.Entity<Position>(entity => {
+            modelBuilder.Entity<Position>(entity =>
+            {
                 entity.ToTable("Position");
             });
 
-            modelBuilder.Entity<DepartmentPosition>(entity=> {
+            modelBuilder.Entity<DepartmentPosition>(entity =>
+            {
                 entity.ToTable("DepartmentPosition");
 
                 entity.HasOne(d => d.department)
@@ -623,10 +630,10 @@ namespace wispro.sp.api
 
                 entity.HasOne(d => d.Position)
                     .WithMany()
-                    .HasForeignKey(d=>d.PositionId);
+                    .HasForeignKey(d => d.PositionId);
 
                 entity.HasOne(d => d.Staff)
-                    .WithMany(d=>d.Positions)
+                    .WithMany(d => d.Positions)
                     .HasForeignKey(d => d.StaffId);
             });
 
@@ -654,7 +661,7 @@ namespace wispro.sp.api
             modelBuilder.Entity<VerifyCoefficient>().HasData(
                 new VerifyCoefficient[]
                 {
-                    
+
                     new VerifyCoefficient() { CheckerId  = 1, DoPersonId =5, Coefficient =0.3},
                     new VerifyCoefficient() { CheckerId  = 1, DoPersonId =6, Coefficient =0.3},
                     new VerifyCoefficient() { CheckerId  = 1, DoPersonId =7, Coefficient =0.3},
@@ -664,7 +671,7 @@ namespace wispro.sp.api
                     new VerifyCoefficient() { CheckerId  = 1, DoPersonId =11, Coefficient =0.5},
                     new VerifyCoefficient() { CheckerId  = 1, DoPersonId =12, Coefficient =0.5},
                     new VerifyCoefficient() { CheckerId  = 1, DoPersonId =13, Coefficient =0.6},
-                    
+
                     new VerifyCoefficient() { CheckerId  = 2, DoPersonId =5, Coefficient =0.2},
                     new VerifyCoefficient() { CheckerId  = 2, DoPersonId =6, Coefficient =0.2},
                     new VerifyCoefficient() { CheckerId  = 2, DoPersonId =7, Coefficient =0.2},
@@ -674,7 +681,7 @@ namespace wispro.sp.api
                     new VerifyCoefficient() { CheckerId  = 2, DoPersonId =11, Coefficient =0.4},
                     new VerifyCoefficient() { CheckerId  = 2, DoPersonId =12, Coefficient =0.4},
                     new VerifyCoefficient() { CheckerId  = 2, DoPersonId =13, Coefficient =0.5},
-                    
+
                     new VerifyCoefficient() { CheckerId  = 3, DoPersonId =5, Coefficient =0.2},
                     new VerifyCoefficient() { CheckerId  = 3, DoPersonId =6, Coefficient =0.2},
                     new VerifyCoefficient() { CheckerId  = 3, DoPersonId =7, Coefficient =0.2},
@@ -684,7 +691,7 @@ namespace wispro.sp.api
                     new VerifyCoefficient() { CheckerId  = 3, DoPersonId =11, Coefficient =0.4},
                     new VerifyCoefficient() { CheckerId  = 3, DoPersonId =12, Coefficient =0.4},
                     new VerifyCoefficient() { CheckerId  = 3, DoPersonId =13, Coefficient =0.5},
-                    
+
                     new VerifyCoefficient() { CheckerId  = 4, DoPersonId =5, Coefficient =0.2},
                     new VerifyCoefficient() { CheckerId  = 4, DoPersonId =6, Coefficient =0.2},
                     new VerifyCoefficient() { CheckerId  = 4, DoPersonId =7, Coefficient =0.2},
@@ -694,7 +701,7 @@ namespace wispro.sp.api
                     new VerifyCoefficient() { CheckerId  = 4, DoPersonId =11, Coefficient =0.4},
                     new VerifyCoefficient() { CheckerId  = 4, DoPersonId =12, Coefficient =0.4},
                     new VerifyCoefficient() { CheckerId  = 4, DoPersonId =13, Coefficient =0.5},
-                    
+
                     new VerifyCoefficient() { CheckerId  = 5, DoPersonId =5, Coefficient =0.2},
                     new VerifyCoefficient() { CheckerId  = 5, DoPersonId =6, Coefficient =0.2},
                     new VerifyCoefficient() { CheckerId  = 5, DoPersonId =7, Coefficient =0.2},
@@ -704,7 +711,7 @@ namespace wispro.sp.api
                     new VerifyCoefficient() { CheckerId  = 5, DoPersonId =11, Coefficient =0.4},
                     new VerifyCoefficient() { CheckerId  = 5, DoPersonId =12, Coefficient =0.4},
                     new VerifyCoefficient() { CheckerId  = 5, DoPersonId =13, Coefficient =0.5},
-                    
+
                     new VerifyCoefficient() { CheckerId  = 6, DoPersonId =5, Coefficient =0.2},
                     new VerifyCoefficient() { CheckerId  = 6, DoPersonId =6, Coefficient =0.2},
                     new VerifyCoefficient() { CheckerId  = 6, DoPersonId =7, Coefficient =0.2},
@@ -736,7 +743,7 @@ namespace wispro.sp.api
                 entity.HasOne(d => d.Reviewer)
                     .WithMany()
                     .HasForeignKey(d => d.ReviewerId);
-            
+
 
                 entity.HasOne(d => d.DRRAbstract)
                     .WithMany()
@@ -827,7 +834,7 @@ namespace wispro.sp.api
                 new InputField(){Id=4,AppealTypeId =1,AppealState =1,FieldName ="备注",FieldType =typeof(string).ToString() },
                 new InputField(){Id=5,AppealTypeId =1,AppealState =1,FieldName ="审核意见",FieldType =typeof(string).ToString()},
 
-                
+
                 new InputField(){Id=6,AppealTypeId =2,AppealState =0,FieldName ="案件系数", MapObjectField ="CaseCoefficient",FieldType = typeof(string).ToString() },
                 new InputField(){Id=9,AppealTypeId =2,AppealState =1,FieldName ="备注",FieldType =typeof(string).ToString() },
                 new InputField(){Id=10,AppealTypeId =2,AppealState =1,FieldName ="审核意见",FieldType =typeof(string).ToString()},
@@ -841,7 +848,7 @@ namespace wispro.sp.api
                 new InputField(){Id=15,AppealTypeId =4,AppealState =0,FieldName ="处理事项", FieldType = typeof(string).ToString() },
                 new InputField(){Id=16,AppealTypeId =4,AppealState =1,FieldName ="备注",FieldType =typeof(string).ToString() },
                 new InputField(){Id=17,AppealTypeId =4,AppealState =1,FieldName ="审核意见",FieldType =typeof(string).ToString()},
-                 
+
                 new InputField(){Id=18,AppealTypeId =5,AppealState =0,FieldName ="超期说明",MapObjectField ="OverDueMemo", FieldType = typeof(string).ToString() },
                 new InputField(){Id=21,AppealTypeId =5,AppealState =1,FieldName ="审核意见", FieldType = typeof(string).ToString() },
                 new InputField(){Id=22,AppealTypeId =5,AppealState =1,FieldName ="备注", FieldType = typeof(string).ToString() },
@@ -898,7 +905,8 @@ namespace wispro.sp.api
 
             #region 流程定义
 
-            modelBuilder.Entity<Workflow>(entity => {
+            modelBuilder.Entity<Workflow>(entity =>
+            {
                 entity.ToTable("Workflow");
 
                 entity.HasOne(d => d.InitAction)
@@ -908,10 +916,11 @@ namespace wispro.sp.api
 
                 entity.HasOne(d => d.CreateUser)
                     .WithMany()
-                    .HasForeignKey(d=>d.CreateUserId);
+                    .HasForeignKey(d => d.CreateUserId);
             });
 
-            modelBuilder.Entity<Step>(entity => {
+            modelBuilder.Entity<Step>(entity =>
+            {
                 entity.ToTable("Step");
 
                 entity.HasOne(d => d.workflow)
@@ -919,12 +928,13 @@ namespace wispro.sp.api
                     .HasForeignKey(d => d.workflowId);
             });
 
-            modelBuilder.Entity<TrasferCondition>(entity=> {
+            modelBuilder.Entity<TrasferCondition>(entity =>
+            {
                 entity.ToTable("TrasferCondition");
 
-                entity.HasOne(d=>d.Step)
+                entity.HasOne(d => d.Step)
                     .WithMany()
-                    .HasForeignKey(d=>d.StepId)
+                    .HasForeignKey(d => d.StepId)
                     .OnDelete(DeleteBehavior.NoAction);
 
                 entity.HasOne(d => d.nextStep)
@@ -934,20 +944,22 @@ namespace wispro.sp.api
 
             });
 
-            modelBuilder.Entity<entity.workflowDefine.Action>(entity => {
+            modelBuilder.Entity<entity.workflowDefine.Action>(entity =>
+            {
                 entity.ToTable("Action");
 
                 entity.HasOne(d => d.step)
                     .WithMany()
                     .HasForeignKey(d => d.StepId);
-                
+
             });
 
-            modelBuilder.Entity<InputValueSetting>(entity => {
+            modelBuilder.Entity<InputValueSetting>(entity =>
+            {
                 entity.ToTable("InputValueSetting");
 
                 entity.HasOne(d => d.action)
-                    .WithMany(d=>d.inputValuesSettings)
+                    .WithMany(d => d.inputValuesSettings)
                     .HasForeignKey(d => d.actionId)
                     .OnDelete(DeleteBehavior.NoAction);
 
@@ -956,15 +968,17 @@ namespace wispro.sp.api
                     .HasForeignKey(d => d.ParentSettingId);
             });
 
-            modelBuilder.Entity<WorkflowInstance>(entity=> {
+            modelBuilder.Entity<WorkflowInstance>(entity =>
+            {
                 entity.ToTable("WorkflowInstance");
 
-                entity.HasOne(d=>d.workflow)
+                entity.HasOne(d => d.workflow)
                     .WithMany()
-                    .HasForeignKey(d=>d.workflowId);
+                    .HasForeignKey(d => d.workflowId);
             });
 
-            modelBuilder.Entity<StepInstance>(entity => {
+            modelBuilder.Entity<StepInstance>(entity =>
+            {
                 entity.ToTable("StepInstance");
 
                 entity.HasOne(d => d.Step)
@@ -977,7 +991,8 @@ namespace wispro.sp.api
                     .OnDelete(DeleteBehavior.NoAction);
             });
 
-            modelBuilder.Entity<InputValue>(entity => {
+            modelBuilder.Entity<InputValue>(entity =>
+            {
                 entity.ToTable("InputValue");
 
                 entity.HasOne(d => d.workflowInstance)
@@ -991,7 +1006,7 @@ namespace wispro.sp.api
 
             #endregion
 
-            
+
 
             OnModelCreatingPartial(modelBuilder);
         }

+ 32 - 32
wispro.sp.ipeasyApi/Controllers/ipEasyController.cs

@@ -16,12 +16,12 @@ namespace wispro.sp.ipeasyApi.Controllers
     [ApiController]
     public class ipEasyController : ControllerBase
     {
-		/// <summary>
-		/// 从维德系统中获取报表数据
-		/// </summary>
-		/// <param name="ReportName">报告名称</param>
-		/// <param name="isModifyDate">是否从上月1日开始取上月的整月数据</param>
-		/// <returns></returns>
+        /// <summary>
+        /// 从维德系统中获取报表数据
+        /// </summary>
+        /// <param name="ReportName">报告名称</param>
+        /// <param name="isModifyDate">是否从上月1日开始取上月的整月数据</param>
+        /// <returns></returns>
         public byte[] GetDataFromIPEasy(string ReportName, bool isModifyDate)
         {
             DataTable dt = new DataTable();
@@ -346,14 +346,14 @@ namespace wispro.sp.ipeasyApi.Controllers
                             dt.Load(reader);
                         }
 
-						cmd.Dispose();
+                        cmd.Dispose();
                     }
-					conn.Close();
-					conn.Dispose();
+                    conn.Close();
+                    conn.Dispose();
                 }
                 catch (Exception ex)
                 {
-                    throw ex;
+                    throw;
                 }
             }
 
@@ -363,16 +363,16 @@ namespace wispro.sp.ipeasyApi.Controllers
             System.Xml.XmlWriter writer = System.Xml.XmlWriter.Create(memory);
             serializer.Serialize(writer, dt);
             byte[] temp = memory.ToArray();
-            
-			return temp;
+
+            return temp;
         }
 
-		/// <summary>
-		/// 从维德系统中获取专案数据
-		/// </summary>
-		/// <returns></returns>
-		public byte[] getProjectDataFromIPEasy()
-		{
+        /// <summary>
+        /// 从维德系统中获取专案数据
+        /// </summary>
+        /// <returns></returns>
+        public byte[] getProjectDataFromIPEasy()
+        {
             DataTable dt = new DataTable();
             string strSQL = @"SELECT  p_case_info.case_volume as 我方文号,
 	                        p_case_info.case_volume_customer as 客户文号,
@@ -423,15 +423,15 @@ namespace wispro.sp.ipeasyApi.Controllers
                             dt.Load(reader);
                         }
 
-						cmd.Dispose();
+                        cmd.Dispose();
                     }
 
-					conn.Close();
-					conn.Dispose();
+                    conn.Close();
+                    conn.Dispose();
                 }
                 catch (Exception ex)
                 {
-                    throw ex;
+                    throw;
                 }
             }
             dt.TableName = $"专案数据";
@@ -452,7 +452,7 @@ namespace wispro.sp.ipeasyApi.Controllers
 		/// <param name="CaseStage">案件阶段,默认为空</param>
 		/// <returns>返回案件记录,如果数据库中有多条记录,返回完成日最后的那条记录</returns>
 		[HttpGet, HttpPost]
-        public ExpandoObject GetItemFromIPEasyDB(string CaseNo,string DoItem,string CaseStage=null)
+        public ExpandoObject GetItemFromIPEasyDB(string CaseNo, string DoItem, string CaseStage = null)
         {
             dynamic retItem = new ExpandoObject();
 
@@ -548,7 +548,7 @@ namespace wispro.sp.ipeasyApi.Controllers
                         cmd.CommandType = CommandType.Text;
                         cmd.Parameters.Add(new SqlParameter("DoItem", DoItem.Trim()));
                         cmd.Parameters.Add(new SqlParameter("CaseNo", CaseNo.Trim()));
-                        
+
                         using (var reader = cmd.ExecuteReader())
                         {
                             dt.Load(reader);
@@ -556,16 +556,16 @@ namespace wispro.sp.ipeasyApi.Controllers
                             if (dt.Rows.Count > 1)
                             {
                                 bool bRet = false;
-								DateTime preFinishedDate = DateTime.MinValue;
+                                DateTime preFinishedDate = DateTime.MinValue;
                                 foreach (DataRow row in dt.Rows)
                                 {
-                                    
+
                                     DateTime temDate = DateTime.Now;
                                     DateTime.TryParse(row["finish_date"].ToString(), out temDate);
                                     if ((preFinishedDate < temDate) &&
                                         (!string.IsNullOrEmpty(CaseStage) && CaseStage == row["review_stage"].ToString()))
                                     {
-										preFinishedDate = temDate;
+                                        preFinishedDate = temDate;
                                         GetItemData(retItem, row);
 
                                         bRet = true;
@@ -595,11 +595,11 @@ namespace wispro.sp.ipeasyApi.Controllers
 
                         }
 
-						cmd.Dispose();
+                        cmd.Dispose();
                     }
 
-					conn.Close();
-					conn.Dispose();
+                    conn.Close();
+                    conn.Dispose();
                 }
                 catch (Exception ex)
                 {
@@ -641,8 +641,8 @@ namespace wispro.sp.ipeasyApi.Controllers
             retItem.FirstDraftDate = row["first_doc_date"].ToString();
             retItem.CaseMemo = row["case_remark"].ToString();
             retItem.FinalizationDate = row["finish_doc_date"].ToString();
-			retItem.WorkflowUser = row["sales"].ToString();
-			retItem.Country = row["country_zh_cn"].ToString();
+            retItem.WorkflowUser = row["sales"].ToString();
+            retItem.Country = row["country_zh_cn"].ToString();
         }
 
     }

+ 2 - 1
wispro.sp.ipeasyApi/Program.cs

@@ -21,7 +21,8 @@ namespace wispro.sp.ipeasyApi
                 .ConfigureWebHostDefaults(webBuilder =>
                 {
                     webBuilder.UseStartup<Startup>()
-                    .ConfigureKestrel((content, options) => {
+                    .ConfigureKestrel((content, options) =>
+                    {
                         options.Limits.KeepAliveTimeout = TimeSpan.FromMinutes(500);
                         options.Limits.RequestHeadersTimeout = TimeSpan.FromMinutes(500);
                     }

+ 1 - 1
wispro.sp.share/Customer_Std.cs

@@ -22,7 +22,7 @@ namespace wispro.sp.share
         {
             get
             {
-                return Math.Sqrt(SquareSum/count - Average * Average);
+                return Math.Sqrt(SquareSum / count - Average * Average);
             }
         }
 

+ 17 - 15
wispro.sp.share/EFCoreExt.cs

@@ -8,10 +8,11 @@ using System.Threading.Tasks;
 namespace wispro.sp.share
 {
     [Serializable]
-    public class ExpressTree {
-        private ConditionTreeNode root ;
+    public class ExpressTree
+    {
+        private ConditionTreeNode root;
+
 
-        
         public void AddCondition(LogicEnum logic, FieldCondition fieldCondition)
         {
             FieldConditionNode rightNode = new FieldConditionNode() { FieldCondition = fieldCondition };
@@ -30,7 +31,7 @@ namespace wispro.sp.share
                 root1.Left = root;
                 Console.WriteLine("\t设定根节点为操作节点!");
                 root = root1;
-                Console.WriteLine((root != null)?"\t根节点不为空": "\t根节点为空");
+                Console.WriteLine((root != null) ? "\t根节点不为空" : "\t根节点为空");
 
             }
 
@@ -39,20 +40,20 @@ namespace wispro.sp.share
 
         public string ToExpressString(string prefix)
         {
-            if(root == null)
+            if (root == null)
             {
                 return null;
             }
             else
             {
-                if(root is FieldConditionNode)
+                if (root is FieldConditionNode)
                 {
                     return ((FieldConditionNode)root).FieldCondition.ToExpressString(prefix);
                 }
                 else
                 {
                     OperateNode operate = (OperateNode)root;
-                    if(root.Right != null && root.Left != null)
+                    if (root.Right != null && root.Left != null)
                     {
                         ExpressTree leftTree = new ExpressTree() { root = root.Left };
                         ExpressTree rightTree = new ExpressTree() { root = root.Right };
@@ -76,14 +77,14 @@ namespace wispro.sp.share
             }
         }
     }
-    
+
     [Serializable]
     public class ConditionTreeNode
     {
         public ConditionTreeNode Right { get; set; }
         public ConditionTreeNode Left { get; set; }
 
-        
+
     }
 
     [Serializable]
@@ -139,7 +140,8 @@ namespace wispro.sp.share
         {
             bool isString = (ValueType == typeof(string).ToString());
 
-            switch (Operator) {
+            switch (Operator)
+            {
                 case OperatorEnum.Contains:
                     if (isString)
                     {
@@ -200,7 +202,7 @@ namespace wispro.sp.share
                         return $"{prefix}.{FieldName} >= ({Value})";
                     }
                     break;
-                case OperatorEnum.Less :
+                case OperatorEnum.Less:
                     if (isString)
                     {
                         return $"{prefix}.{FieldName} < (\"{Value}\")";
@@ -220,7 +222,7 @@ namespace wispro.sp.share
                         return $"{prefix}.{FieldName} <= ({Value})";
                     }
                     break;
-                
+
                 case OperatorEnum.StartsWith:
                     if (isString)
                     {
@@ -247,7 +249,7 @@ namespace wispro.sp.share
                 //    break;
                 default:
                     throw (new ApplicationException("还未实现的操作符号!"));
-                
+
 
             }
         }
@@ -289,7 +291,7 @@ namespace wispro.sp.share
 
                 Expression<Func<IOrderedQueryable<T>>> sortMethod = (() => query.OrderBy<T, object>(k => null));
 
-                if(orderinfo.Sort == 1)
+                if (orderinfo.Sort == 1)
                 {
                     sortMethod = (() => query.OrderByDescending<T, object>(k => null));
                 }
@@ -307,7 +309,7 @@ namespace wispro.sp.share
             return query;
         }
 
-        public static IOrderedQueryable<TEntityType> SortMeDynamically<TEntityType>( this IQueryable<TEntityType> query, string propertyname)
+        public static IOrderedQueryable<TEntityType> SortMeDynamically<TEntityType>(this IQueryable<TEntityType> query, string propertyname)
         {
             var param = Expression.Parameter(typeof(TEntityType), "s");
             var prop = Expression.PropertyOrField(param, propertyname);

+ 1 - 1
wispro.sp.share/EnumType.cs

@@ -2,7 +2,7 @@
 {
     public enum jxType
     {
-        doing =0,
+        doing = 0,
         all = 1,
         finished = 4
     }

+ 3 - 3
wispro.sp.share/FileProcessTask.cs

@@ -15,14 +15,14 @@ namespace wispro.sp.share
 
         public bool Finished { get; set; }
 
-        public string ErrorMessage { get;set; }
+        public string ErrorMessage { get; set; }
     }
 
-    public class FileProcessTask: ProcessTask
+    public class FileProcessTask : ProcessTask
     {
         public string FileName { get; set; }
 
         public string FilePath { get; set; }
-        
+
     }
 }

+ 1 - 1
wispro.sp.share/InputValueSettingObject.cs

@@ -10,6 +10,6 @@ namespace wispro.sp.share
     {
         public entity.workflowDefine.InputValueSetting InputValueSetting { get; set; }
 
-        public List<entity.workflowDefine.InputValueSetting> Children{ get; set; }
+        public List<entity.workflowDefine.InputValueSetting> Children { get; set; }
     }
 }

+ 7 - 7
wispro.sp.share/LevelStatistics.cs

@@ -51,7 +51,7 @@ namespace wispro.sp.share
         {
             var temObj = Statistics.FirstOrDefault(s => s.StaffId == staffId);
 
-            if(temObj != null)
+            if (temObj != null)
             {
                 switch (Grade)
                 {
@@ -59,7 +59,7 @@ namespace wispro.sp.share
                         return (double)(((decimal)temObj.dS * 2.5M + (decimal)temObj.dA * 1.5M) / (decimal)doAverage());
                         break;
                     case "B":
-                        return (double)(((decimal)temObj.dS * 2.5M + (decimal)temObj.dA * 1.5M+(decimal)temObj.dB) / (decimal)doAverage());
+                        return (double)(((decimal)temObj.dS * 2.5M + (decimal)temObj.dA * 1.5M + (decimal)temObj.dB) / (decimal)doAverage());
                         break;
                     case "C":
                     case "D":
@@ -81,7 +81,7 @@ namespace wispro.sp.share
 
             if (temObj != null)
             {
-                return (double)(((decimal)temObj.vS * 2.5M + (decimal)temObj.vA * 1.5M + (decimal)temObj.vB + (decimal)temObj.vC * 0.7M)/(decimal)vAverage());
+                return (double)(((decimal)temObj.vS * 2.5M + (decimal)temObj.vA * 1.5M + (decimal)temObj.vB + (decimal)temObj.vC * 0.7M) / (decimal)vAverage());
             }
             else
             {
@@ -98,9 +98,9 @@ namespace wispro.sp.share
                     return (double)(((decimal)temObj.dS * 2.5M + (decimal)temObj.dA * 1.5M + (decimal)temObj.dB) / ((decimal)doAverage() * 0.95M));
                     break;
                 case "C":
-                    return (double)(((decimal)temObj.dS * 2.5M + (decimal)temObj.dA * 1.5M + (decimal)temObj.dB + (decimal)temObj.dC * 0.7M) / ((decimal)UpgradeBase*0.7M));
+                    return (double)(((decimal)temObj.dS * 2.5M + (decimal)temObj.dA * 1.5M + (decimal)temObj.dB + (decimal)temObj.dC * 0.7M) / ((decimal)UpgradeBase * 0.7M));
                     break;
-                case"D":
+                case "D":
                     return (double)(((decimal)temObj.dS * 2.5M + (decimal)temObj.dA * 1.5M + (decimal)temObj.dB + (decimal)temObj.dC * 0.7M) / 14M);
                 default:
                     return 0.0;
@@ -131,10 +131,10 @@ namespace wispro.sp.share
             switch (Grade)
             {
                 case "B":
-                    return (double)(((decimal)temObj.dS * 2.5M + (decimal)temObj.dA * 1.5M ) / ((decimal)UpgradeBase));
+                    return (double)(((decimal)temObj.dS * 2.5M + (decimal)temObj.dA * 1.5M) / ((decimal)UpgradeBase));
                     break;
                 case "C":
-                    return (double)(((decimal)temObj.dS * 2.5M + (decimal)temObj.dA * 1.5M + (decimal)temObj.dB ) / ((decimal)UpgradeBase * 0.9M));
+                    return (double)(((decimal)temObj.dS * 2.5M + (decimal)temObj.dA * 1.5M + (decimal)temObj.dB) / ((decimal)UpgradeBase * 0.9M));
                     break;
                 case "D":
                     return (double)(((decimal)temObj.dS * 2.5M + (decimal)temObj.dA * 1.5M + (decimal)temObj.dB + (decimal)temObj.dC * 0.7M) / 18M);

+ 1 - 1
wispro.sp.share/ListApiResponse.cs

@@ -7,7 +7,7 @@ using wispro.sp.entity;
 
 namespace wispro.sp.share
 {
-    public class  ListApiResponse<T>
+    public class ListApiResponse<T>
     {
         public List<T> Results { get; set; }
 

+ 1 - 1
wispro.sp.share/NanduStatics.cs

@@ -10,7 +10,7 @@ namespace wispro.sp.share
     {
         public double NanduXS { get; set; }
         public decimal S { get; set; }
-        public decimal  A { get; set; }
+        public decimal A { get; set; }
         public decimal B { get; set; }
         public decimal C { get; set; }
         public decimal D { get; set; }

+ 1 - 1
wispro.sp.share/ProjectPointRecord.cs

@@ -26,5 +26,5 @@ namespace wispro.sp.share
         New,
         Deleted
     }
-    
+
 }

+ 2 - 2
wispro.sp.share/QueryFilter.cs

@@ -9,7 +9,7 @@ namespace wispro.sp.share
 
         public int? CalMonthId { get; set; }
 
-        public IList<FieldCondition> ConditionTree { get; set; } =new  List<FieldCondition>();
+        public IList<FieldCondition> ConditionTree { get; set; } = new List<FieldCondition>();
 
         public jxType jxType { get; set; }
 
@@ -26,6 +26,6 @@ namespace wispro.sp.share
         public int PageIndex { get; set; } = 10;
     }
 
-    
+
 
 }

+ 1 - 1
wispro.sp.share/SharePackage.cs

@@ -16,7 +16,7 @@ namespace wispro.sp.share
 
     public class CalType
     {
-       
+
         public int ReviewerId { get; set; }
 
         public string AgentMemo { get; set; }

+ 2 - 2
wispro.sp.share/Utility/FlowChartUtility.cs

@@ -711,10 +711,10 @@ namespace wispro.sp.share.Utility
 
                         if (node.Type == 1)
                         {
-                            strReturn += $"<rect x =\"{(node.x-node.width/2)}\" y=\"{(node.y-node.height/2)}\" rx=\"10\" ry=\"10\" width=\"{node.width}\" height=\"{node.height}\" style=\"fill:{node.FillColor};stroke:black;stroke-width:3;opacity:0.5\"/>\r\n";
+                            strReturn += $"<rect x =\"{(node.x - node.width / 2)}\" y=\"{(node.y - node.height / 2)}\" rx=\"10\" ry=\"10\" width=\"{node.width}\" height=\"{node.height}\" style=\"fill:{node.FillColor};stroke:black;stroke-width:3;opacity:0.5\"/>\r\n";
                             strReturn += $"<a ondblclick =\"() => DoubleClickNode(node)\" onclick=\"()=>ClickNode(node)\">\r\n";
                             strReturn += $"<text x =\"{node.x}\" y=\"{node.y}\" fill=\"black\" alignment-baseline=\"middle\" text-anchor=\"middle\" font-size=\"{rectFontSize}\" font-weight=\"700\">\r\n";
-                            
+
                             if (node.NodeObject is entity.workflowDefine.Action)
                             {
                                 strReturn += ((workflow.InitAction == null || string.IsNullOrEmpty(workflow.InitAction.Name)) ? $"启动{workflow.Name}" : workflow.InitAction.Name) + "\r\n";

+ 4 - 4
wispro.sp.share/Utility/UserConditionHelper.cs

@@ -78,14 +78,14 @@ namespace wispro.sp.share.Utility
             return "";
         }
 
-        public static Dictionary<string,string> GetPropertyDescription<T>(string stringType)
+        public static Dictionary<string, string> GetPropertyDescription<T>(string stringType)
         {
             Dictionary<string, string> retDic = new Dictionary<string, string>();
 
-            Type type = Type.GetType(stringType); 
-            foreach(var property in type.GetProperties())
+            Type type = Type.GetType(stringType);
+            foreach (var property in type.GetProperties())
             {
-                if(property.PropertyType == typeof(T))
+                if (property.PropertyType == typeof(T))
                 {
                     DescriptionAttribute att =
                         property.GetCustomAttribute(typeof(DescriptionAttribute)) as DescriptionAttribute;

+ 1 - 1
wispro.sp.share/webViewObject/userToken.cs

@@ -14,7 +14,7 @@ namespace wispro.sp.share.webViewObject
         public int UserId { get; set; }
         public string Name { get; set; }
         public string Token { get; set; }
-        
+
         public DateTime ExpireTime { get; set; }
     }
 }

+ 21 - 19
wispro.sp.utility/CompareDocx.cs

@@ -20,7 +20,7 @@ namespace wispro.sp.utility
     {
         public class PatentDocument
         {
-            public string FilePath {  get; set; }
+            public string FilePath { get; set; }
 
             public string Abstract { get; set; }
 
@@ -30,14 +30,15 @@ namespace wispro.sp.utility
 
             public string DocumentString { get; set; }
 
-            public PatentDocument(string filePath) { 
+            public PatentDocument(string filePath)
+            {
                 this.FilePath = filePath;
 
-                if (!System.IO.File.Exists(this.FilePath) )
+                if (!System.IO.File.Exists(this.FilePath))
                 {
                     throw new ApplicationException("指定的文件不存在!");
                 }
-                
+
                 if (this.FilePath.EndsWith(".doc"))
                 {
                     DocumentString = GetDocTxt(this.FilePath);
@@ -132,7 +133,7 @@ namespace wispro.sp.utility
 
             private string List2String(List<string> lines)
             {
-                string[] array = { "权利要求书", "说明书摘要", "说明书" ,"背景技术","发明内容", "技术领域", "具体实施方式", "摘要附图", "说明书附图" };
+                string[] array = { "权利要求书", "说明书摘要", "说明书", "背景技术", "发明内容", "技术领域", "具体实施方式", "摘要附图", "说明书附图" };
 
                 StringBuilder sb = new StringBuilder();
                 string lastBlock = string.Empty;
@@ -142,14 +143,15 @@ namespace wispro.sp.utility
                     {
                         sb.Append(line.Trim() + "\r\n");
 
-                        
-                        if(Array.Exists(array, element => element == line.Replace("\u0001","").Replace(" ","").Trim()))
+
+                        if (Array.Exists(array, element => element == line.Replace("\u0001", "").Replace(" ", "").Trim()))
                         {
                             lastBlock = line.Replace("\u0001", "").Replace(" ", "").Trim();
                         }
                         else
                         {
-                            switch(lastBlock) {
+                            switch (lastBlock)
+                            {
                                 case "权利要求书":
                                     this.Claim = this.Claim + "\r\n" + line;
                                     break;
@@ -169,7 +171,7 @@ namespace wispro.sp.utility
                     }
                 }
 
-                this.Abstract = string.IsNullOrEmpty(this.Abstract)?string.Empty: this.Abstract.Trim();
+                this.Abstract = string.IsNullOrEmpty(this.Abstract) ? string.Empty : this.Abstract.Trim();
                 this.Claim = string.IsNullOrEmpty(this.Claim) ? string.Empty : this.Claim.Trim();
                 this.FullText = string.IsNullOrEmpty(this.FullText) ? string.Empty : this.FullText.Trim();
 
@@ -263,8 +265,8 @@ namespace wispro.sp.utility
         /// <param name="newFile"></param>
         public void Compare(string oldFile, string newFile)
         {
-            this.oldDocument =new PatentDocument(oldFile);
-            this.newDocument =new PatentDocument(newFile);
+            this.oldDocument = new PatentDocument(oldFile);
+            this.newDocument = new PatentDocument(newFile);
 
             if (!string.IsNullOrEmpty(this.oldDocument.Claim) && !string.IsNullOrEmpty(this.newDocument.Claim))
             {
@@ -286,17 +288,17 @@ namespace wispro.sp.utility
         /// 比较两个文档
         /// </summary>
         /// <exception cref="ApplicationException"></exception>
-        public CompareResult StringCompare(string oldtext,string newtext)
+        public CompareResult StringCompare(string oldtext, string newtext)
         {
             CompareResult result = new CompareResult();
             var differ = new Differ();
 
-            if(oldtext == null) { oldtext = ""; }
-            if(newtext == null) { newtext = ""; }
+            if (oldtext == null) { oldtext = ""; }
+            if (newtext == null) { newtext = ""; }
 
             result.oldWordCount = oldtext.Length;
             result.newWordCount = newtext.Length;
-            
+
             var diff = differ.CreateCharacterDiffs(oldtext, newtext, true);
             //result.EditCount = diff.DiffBlocks.Count;
 
@@ -308,7 +310,7 @@ namespace wispro.sp.utility
             foreach (var change in diff.DiffBlocks)
             {
                 string strModifyStr = "";
-                
+
 
                 lastResult += oldtext.Substring(lastPos, change.DeleteStartA - lastPos);
                 _CompareResultString += oldtext.Substring(lastPos, change.DeleteStartA - lastPos);
@@ -328,14 +330,14 @@ namespace wispro.sp.utility
                     lastResult += newtext.Substring(change.InsertStartB, change.InsertCountB);
                 }
 
-                if(!ModifyList.Contains(strModifyStr))
+                if (!ModifyList.Contains(strModifyStr))
                 {
                     ModifyList.Add(strModifyStr);
                     result.DeleteCount += change.DeleteCountA;
                     result.InsertCount += change.InsertCountB;
                     result.EditCount += 1;
                 }
-                
+
             }
 
             lastResult += oldtext.Substring(lastPos);
@@ -350,6 +352,6 @@ namespace wispro.sp.utility
 
         }
 
-        
+
     }
 }

+ 1 - 1
wispro.sp.utility/ConfigHelper.cs

@@ -35,6 +35,6 @@ namespace wispro.sp.utility
             return _configuration.GetSection(key).Value;
         }
 
-        
+
     }
 }

+ 4 - 4
wispro.sp.utility/CosineSimilarity.cs

@@ -41,19 +41,19 @@ namespace wispro.sp.utility
             }
             length = Math.Sqrt(length);
 
-            Dictionary<string,double> result = new Dictionary<string, double>();
+            Dictionary<string, double> result = new Dictionary<string, double>();
             foreach (var key in vector.Keys)
             {
-                result.Add(key, vector.GetValueOrDefault(key)/length);
+                result.Add(key, vector.GetValueOrDefault(key) / length);
             }
-            
+
             return result;
         }
 
 
         private static Dictionary<string, double> GetTermFrequencyVector(string text)
         {
-            var terms = new Jieba_Segmenter().Cut(text.Replace("\r\n","").Replace("\r","").Replace("\n", ""));
+            var terms = new Jieba_Segmenter().Cut(text.Replace("\r\n", "").Replace("\r", "").Replace("\n", ""));
             var vector = new Dictionary<string, double>();
 
             foreach (var term in terms)

+ 3 - 3
wispro.sp.utility/EmunHelper.cs

@@ -10,7 +10,7 @@ namespace wispro.sp.utility
 {
     public class EmunHelper
     {
-        
+
         ///// <summary>
         ///// 根据枚举的值获取枚举名称
         ///// </summary>
@@ -43,10 +43,10 @@ namespace wispro.sp.utility
             foreach (string key in strList)
             {
                 var obj = (T)Enum.Parse(type, key);
-                FieldInfo field=  obj.GetType().GetField(obj.ToString());
+                FieldInfo field = obj.GetType().GetField(obj.ToString());
 
                 DescriptionAttribute att = Attribute.GetCustomAttribute(field, typeof(DescriptionAttribute), false) as DescriptionAttribute;
-                
+
                 if (att == null)
                 {
                     resultList.Add(key, obj);

+ 32 - 32
wispro.sp.utility/ExcelHelper.cs

@@ -13,26 +13,26 @@ namespace wispro.sp.utility
     {
 
 
-        public DataTable MerageExcel(string desFileName,string[] excelFiles)
+        public DataTable MerageExcel(string desFileName, string[] excelFiles)
         {
             DataTable retDt = null;
-            foreach(string strFileName in excelFiles)
+            foreach (string strFileName in excelFiles)
             {
                 if (System.IO.File.Exists(strFileName))
                 {
                     if (retDt == null)
                     {
-                        retDt = NPOIExcel.ExcelToDataTable(strFileName, true,true);
+                        retDt = NPOIExcel.ExcelToDataTable(strFileName, true, true);
 
                         DataTable temdt = new DataTable();
-                        foreach(DataColumn col in retDt.Columns)
+                        foreach (DataColumn col in retDt.Columns)
                         {
-                            
+
                             DataColumn temCol = new DataColumn();
                             temCol.ColumnName = col.ColumnName;
                             temCol.DataType = col.DataType;
                             temCol.Caption = col.Caption;
-                            
+
                             temdt.Columns.Add(temCol);
                         }
 
@@ -69,7 +69,7 @@ namespace wispro.sp.utility
                 {
                     #region 添加我方案号和处理事项相同的项目到hashTable
                     string strKey = $"{row["我方文号"].ToString()}-{row["处理事项"].ToString()}";
-                    if(temHash.Contains(strKey))
+                    if (temHash.Contains(strKey))
                     {
                         List<DataRow> List = (List<DataRow>)temHash[strKey];
                         List.Add(row);
@@ -94,7 +94,7 @@ namespace wispro.sp.utility
                     #region 已核算绩效标记
                     string strTem = isCalculatedData(row, CalculatedTable);
 
-                    if(strTem != "")
+                    if (strTem != "")
                     {
                         if (!retDt.Columns.Contains("核查数据反馈"))
                         {
@@ -221,11 +221,11 @@ namespace wispro.sp.utility
             foreach (string strKey in temHash.Keys)
             {
                 List<DataRow> rows = (List<DataRow>)temHash[strKey];
-                if(rows.Count > 1)
+                if (rows.Count > 1)
                 {
                     DataRow retRow = null;
                     List<string> clrList = null;
-                    foreach(DataRow row in rows)
+                    foreach (DataRow row in rows)
                     {
                         if (retRow == null)
                         {
@@ -235,7 +235,7 @@ namespace wispro.sp.utility
                         else
                         {
                             List<string> temClrList = row["处理人"].ToString().Split(new char[] { ',', ',', '、' }).ToList<string>();
-                            if(temClrList.Count > clrList.Count)
+                            if (temClrList.Count > clrList.Count)
                             {
                                 delRows.Add(retRow);
                                 retRow = row;
@@ -251,14 +251,14 @@ namespace wispro.sp.utility
             }
             #endregion
 
-            foreach(DataRow row in delRows)
+            foreach (DataRow row in delRows)
             {
                 retDt.Rows.Remove(row);
             }
             #endregion
             CalculatedTable.Dispose();
 
-            NPOIExcel.DataTableToExcel(retDt ,desFileName);
+            NPOIExcel.DataTableToExcel(retDt, desFileName);
             return retDt;
         }
 
@@ -268,7 +268,7 @@ namespace wispro.sp.utility
             foreach (DataRow row in dt.Rows)
             {
                 iRow++;
-                
+
                 //判断是否有相同的记录,我方文号+处理事项+处理人相同+案件阶段
                 DataRow oldRow = isExists(row, retDt);
                 if (oldRow == null)
@@ -318,20 +318,20 @@ namespace wispro.sp.utility
             string strReturn = "";
             string[] Names = strName.Trim().Split(new char[] { ',' });
 
-            foreach(string name in Names)
+            foreach (string name in Names)
             {
-                
+
                 strReturn = string.IsNullOrEmpty(strReturn) ? name.Replace("-君龙", "") : $"{strReturn},{name.Replace("-君龙", "")}";
             }
 
             return strReturn;
         }
 
-        private DataRow isExists(DataRow row,DataTable dt)
+        private DataRow isExists(DataRow row, DataTable dt)
         {
             foreach (DataRow temRow in dt.Rows)
             {
-                if(row["我方文号"].ToString() == temRow["我方文号"].ToString() &&
+                if (row["我方文号"].ToString() == temRow["我方文号"].ToString() &&
                     row["处理事项"].ToString() == temRow["处理事项"].ToString() &&
                     row["处理人"].ToString() == temRow["处理人"].ToString())
                 {
@@ -354,46 +354,46 @@ namespace wispro.sp.utility
             return null;
         }
 
-        private string isCalculatedData(DataRow row ,DataTable CalculatedTable)
+        private string isCalculatedData(DataRow row, DataTable CalculatedTable)
         {
             foreach (DataRow temRow in CalculatedTable.Rows)
             {
                 if (row["我方文号"].ToString() == temRow["我方文号"].ToString() &&
-                    row["处理事项"].ToString() == temRow["处理事项"].ToString() )
+                    row["处理事项"].ToString() == temRow["处理事项"].ToString())
                 {
-                    if(row["处理事项"].ToString() == "处理审查意见")
+                    if (row["处理事项"].ToString() == "处理审查意见")
                     {
-                        if ( row["案件阶段"].ToString() == temRow["案件阶段"].ToString())
+                        if (row["案件阶段"].ToString() == temRow["案件阶段"].ToString())
                             return temRow["绩效核算月份"].ToString() + "已核算绩效!";
                     }
                     else
                     {
                         return temRow["绩效核算月份"].ToString() + "已核算绩效!";
                     }
-                    
+
                 }
             }
 
             return "";
         }
-        
+
         /// <summary>
         /// 填充点数
         /// </summary>
         /// <param name="strPath">总表文件路径</param>
         /// <param name="dianshuFilePath">点数规则文件路径</param>
-        public void FillDianShu(string strPath,string dianshuFilePath)
+        public void FillDianShu(string strPath, string dianshuFilePath)
         {
-            DataTable dsTable = NPOIExcel.ExcelToDataTable(dianshuFilePath,true);
+            DataTable dsTable = NPOIExcel.ExcelToDataTable(dianshuFilePath, true);
 
             //DataRow[] Rows = dsTable.Select("1=1", "转换条件");
 
             DataTable dt = NPOIExcel.ExcelToDataTable(strPath, true);
 
-            for(int iRow = dsTable.Rows.Count-1;iRow>=0;iRow--)
+            for (int iRow = dsTable.Rows.Count - 1; iRow >= 0; iRow--)
             //foreach(DataRow row in dsTable.Rows)
             {
-                
+
                 DataRow row = dsTable.Rows[iRow];
 
 
@@ -408,13 +408,13 @@ namespace wispro.sp.utility
                             dataRow["基本点数"] = double.Parse(row["点数"].ToString());
                         }
                     }
-                    catch(Exception ex)
+                    catch (Exception ex)
                     {
                         System.Diagnostics.Debug.WriteLine(ex.ToString());
                     }
                 }
             }
-           
+
 
             #region 翻译按字数计算
             DataRow[] fyList = dt.Select("处理事项='翻译'");
@@ -423,7 +423,7 @@ namespace wispro.sp.utility
                 string strBZ = dataRow["备注(填表注意事项)"].ToString();
                 System.Text.RegularExpressions.Regex r = new System.Text.RegularExpressions.Regex("(\\d{1,})字");
                 System.Text.RegularExpressions.Match m = r.Match(strBZ);
-                
+
 
                 if (m.Success)
                 {
@@ -431,7 +431,7 @@ namespace wispro.sp.utility
 
                     if (strBZ.Contains("中-英"))
                     {
-                        double ds = (iChar*0.16)/1000.00;
+                        double ds = (iChar * 0.16) / 1000.00;
                         dataRow["基本点数"] = ds.ToString();
                     }
                     else

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 186 - 161
wispro.sp.utility/IPEasyUtility.cs


+ 2 - 2
wispro.sp.utility/JiebaSegmenter.cs

@@ -4,7 +4,7 @@ using JiebaNet.Segmenter;
 
 namespace wispro.sp.utility
 {
-    
+
     public class Jieba_Segmenter
     {
         private readonly JiebaSegmenter _segmenter;
@@ -31,7 +31,7 @@ namespace wispro.sp.utility
         public List<string> CutAll(string text)
         {
             // 全模式
-            var words = _segmenter.Cut(text,true,true);
+            var words = _segmenter.Cut(text, true, true);
             return words.ToList();
         }
     }

+ 10 - 9
wispro.sp.utility/MailUtil.cs

@@ -12,17 +12,17 @@ namespace wispro.sp.utility
 {
     public class MailUtil
     {
-        public static void SendEmail(string subject, string body,string toMailName, string toEmail,string AttachFiles=null)
+        public static void SendEmail(string subject, string body, string toMailName, string toEmail, string AttachFiles = null)
         {
             MimeMessage message = new MimeMessage();
             string strMail = ConfigHelper.GetSectionValue("MailSetting:mail");
-            MailboxAddress from = new MailboxAddress("绩效系统",strMail);
+            MailboxAddress from = new MailboxAddress("绩效系统", strMail);
             message.From.Add(from);
             MailboxAddress to = new MailboxAddress(toMailName, toEmail);
             message.To.Add(to);
-            
+
             message.Subject = subject;
-            
+
 
             BodyBuilder bodyBuilder = new BodyBuilder();
             bodyBuilder.HtmlBody = body;
@@ -31,7 +31,7 @@ namespace wispro.sp.utility
             {
                 var files = AttachFiles.Split(';');
 
-                foreach(var file in files)
+                foreach (var file in files)
                 {
                     if (!string.IsNullOrEmpty(file.Trim()))
                     {
@@ -52,7 +52,7 @@ namespace wispro.sp.utility
             var strPassword = ConfigHelper.GetSectionValue("MailSetting:Password");
 
 
-            client.Connect(strServer , int.Parse(strPort),true);  //例如:smtp.exmail.qq.com,465
+            client.Connect(strServer, int.Parse(strPort), true);  //例如:smtp.exmail.qq.com,465
             client.Authenticate(strAccount, strPassword); //发送邮件的账户密码
             client.Send(message);
             client.Disconnect(true);
@@ -61,12 +61,13 @@ namespace wispro.sp.utility
 
         private static void SendCompletedCallback(object sender, AsyncCompletedEventArgs e)
         {
-            if(e.Error != null){
+            if (e.Error != null)
+            {
                 System.Diagnostics.Debug.WriteLine(e.Error.ToString());
             }
-            
+
         }
     }
 
-    
+
 }

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

@@ -25,7 +25,7 @@ namespace wispro.sp.utility
         /// <param name="ColumnNameRow">列名的所在行,0为第一行</param>
         /// <param name="IgnoreZeroHightRow">是否忽略隐藏行</param>
         /// <returns>返回datatable</returns>
-        public static DataTable ExcelToDataTable(string filePath, bool isColumnName,bool IgnoreZeroHightRow = false,int ColumnNameRow=0,int iSheet=0)
+        public static DataTable ExcelToDataTable(string filePath, bool isColumnName, bool IgnoreZeroHightRow = false, int ColumnNameRow = 0, int iSheet = 0)
         {
             DataTable dataTable = null;
             FileStream fs = null;
@@ -62,7 +62,7 @@ namespace wispro.sp.utility
                                 //构建datatable的列
                                 if (isColumnName)
                                 {
-                                    startRow = ColumnNameRow+1;//如果有列名,则从第列头行的下一行开始读取
+                                    startRow = ColumnNameRow + 1;//如果有列名,则从第列头行的下一行开始读取
                                     for (int i = firstRow.FirstCellNum; i < cellCount; ++i)
                                     {
                                         cell = firstRow.GetCell(i);
@@ -95,13 +95,13 @@ namespace wispro.sp.utility
                                     //}
                                     if (row != null && IgnoreZeroHightRow && row.ZeroHeight)
                                     {
-                                        System.Diagnostics.Debug.WriteLine (string.Format("[{0}]隐藏行:{1}", filePath, i));
+                                        System.Diagnostics.Debug.WriteLine(string.Format("[{0}]隐藏行:{1}", filePath, i));
                                         continue;
-                                        
+
                                     }
 
-                                    
-                                    if (row == null || row.Cells.Count ==0) continue;
+
+                                    if (row == null || row.Cells.Count == 0) continue;
 
                                     dataRow = dataTable.NewRow();
                                     for (int j = row.FirstCellNum; j < cellCount; ++j)
@@ -121,7 +121,7 @@ namespace wispro.sp.utility
                                                     break;
                                                 case CellType.Numeric:
                                                     short format = cell.CellStyle.DataFormat;
-                                                    
+
                                                     //对时间格式(2015.12.5、2015/12/5、2015-12-5等)的处理
                                                     if (DateUtil.IsCellDateFormatted(cell))// || format == 14 || format == 31 || format == 57 || format == 58 || format == 165 || format == 177 || format == 176)
                                                         try
@@ -137,7 +137,7 @@ namespace wispro.sp.utility
                                                     break;
                                                 case CellType.String:
                                                     dataRow[j] = cell.StringCellValue;
-                                                    
+
                                                     break;
                                             }
                                         }
@@ -180,7 +180,7 @@ namespace wispro.sp.utility
             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;
@@ -199,7 +199,7 @@ namespace wispro.sp.utility
         /// <param name="dt">datatable</param>
         /// <param name="strFile">strFile</param>
         /// <returns></returns>
-        public static bool DataTableToExcel(DataTable dt, string strFile,bool isAutoColumnWidth=true,bool isLink=false,int linkCol=0,string linkFortmat="")
+        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;
@@ -223,7 +223,7 @@ 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;
@@ -257,19 +257,19 @@ namespace wispro.sp.utility
                     for (int i = 0; i < rowCount; i++)
                     {
                         row = sheet.CreateRow(i + 1);
-                        row.Height = 30*20;
+                        row.Height = 30 * 20;
 
                         for (int j = 0; j < columnCount; j++)
                         {
-                            
+
                             cell = row.CreateCell(j);//excel第二行开始写入数据
 
 
 
-                            if(dt.Rows[i][j] is System.DBNull)
+                            if (dt.Rows[i][j] is System.DBNull)
                             {
                                 cell.SetCellValue("");
-                                
+
                             }
                             else
                             {
@@ -293,10 +293,10 @@ namespace wispro.sp.utility
                                         cell.SetCellValue(dt.Rows[i][j].ToString());
                                         break;
                                 }
-                                
+
                             }
 
-                            
+
                             cell.CellStyle = cellStyle;
 
                             if (isLink && linkCol == j)
@@ -310,7 +310,7 @@ namespace wispro.sp.utility
 
                         }
                     }
-                    
+
 
                     #region 设定列宽
                     if (isAutoColumnWidth)
@@ -324,7 +324,7 @@ namespace wispro.sp.utility
                         for (int columnNum = 0; columnNum <= columnCount; columnNum++)
                         {
                             int columnWidth = sheet.GetColumnWidth(columnNum) / 256;
-                            for (int rowNum = 0; rowNum <1; rowNum++)
+                            for (int rowNum = 0; rowNum < 1; rowNum++)
                             {
                                 IRow currentRow;
                                 //当前行未被使用过

+ 7 - 7
wispro.sp.web/Auth/JwtAuthenticationStateProvider.cs

@@ -30,13 +30,13 @@ namespace wispro.sp.web.Auth
         {
             //確認localstorage裡面是否有token
             var tokenInLocalStorage = await localStorageService.GetItemAsync<userToken>("authToken");
-            
+
             if (tokenInLocalStorage == null)
             {
                 //沒有的話,回傳匿名使用者
                 return anonymous;
             }
-            
+
             //將token取出轉為claim
             var claims = JwtParser.ParseClaimsFromJwt(tokenInLocalStorage.Token);
             //在每次request的header中帶入bearer token
@@ -49,15 +49,15 @@ namespace wispro.sp.web.Auth
 
         public void NotifyUserAuthentication(string token)
         {
-            
+
             var claims = JwtParser.ParseClaimsFromJwt(token);
-            
+
             var authenticatedUser = new ClaimsPrincipal(new ClaimsIdentity(claims, "jwt"));
-            
+
             var authState = Task.FromResult(new AuthenticationState(authenticatedUser));
-            
+
             NotifyAuthenticationStateChanged(authState);
-            
+
         }
 
         public void NotifyUserLogOut()

+ 2 - 2
wispro.sp.web/Components/AutoCompleteStaff.razor.cs

@@ -39,7 +39,7 @@ namespace wispro.sp.web.Components
         {
             if (a is Staff o1 && b is Staff o2)
             {
-                return o1.Name  == o2.Name ;
+                return o1.Name == o2.Name;
             }
             else
             {
@@ -49,7 +49,7 @@ namespace wispro.sp.web.Components
 
         void OnSelectionChange(AutoCompleteOption item)
         {
-            _SelectedItem  = (Staff)item.Value;
+            _SelectedItem = (Staff)item.Value;
             StaffId = _SelectedItem.Id;
         }
 

+ 2 - 2
wispro.sp.web/Components/Chart.razor.cs

@@ -6,12 +6,12 @@ namespace wispro.sp.web.Components
     public partial class Chart
     {
         [Parameter]
-        public int ChartType { get;set; }
+        public int ChartType { get; set; }
 
         [Parameter]
         public ChartDatas chartDatas { get; set; }
 
-        
+
 
     }
 }

+ 24 - 23
wispro.sp.web/Components/CreateAppeal.razor.cs

@@ -28,11 +28,11 @@ namespace wispro.sp.web.Components
         [Inject]
         protected AppealTypeService _atService { get; set; }
 
-       
+
         [Inject] IUserService _UserService { get; set; }
 
-        [Inject] 
-        protected IHttpService _httpClient{get;set;}
+        [Inject]
+        protected IHttpService _httpClient { get; set; }
 
         [Inject]
         protected IConfiguration _configuration { get; set; }
@@ -40,11 +40,11 @@ namespace wispro.sp.web.Components
         [Inject]
         protected OrganizationService _orgService { get; set; }
 
-        
+
         #region 文件上传控件设定
         //List<UploadFileItem> fileList = new List<UploadFileItem>();
 
-        Dictionary<string, object> attrs ;
+        Dictionary<string, object> attrs;
 
         void HandleChange(UploadInfo fileinfo)
         {
@@ -66,7 +66,8 @@ namespace wispro.sp.web.Components
                 var result = fileinfo.GetResponse<List<AttachFile>>();
                 return await _httpClient.Get<bool>($"{_configuration.GetValue<string>("APIUrl")}AttachFiles/Delete?id={result[0].Id}");
             }
-            catch {
+            catch
+            {
                 return false;
             }
         }
@@ -88,21 +89,21 @@ namespace wispro.sp.web.Components
 
             if (_Model.AppealType.Name == "案件系数复核")
             {
-                
+
                 //判断是否案件系数是否A或S是否超过限额
                 Customer customer = _Model.Item.Customer;
-                
+
                 if (customer == null)
                 {
                     //获取客户信息
-                    if(_Model.Item.CustomerId != null)
+                    if (_Model.Item.CustomerId != null)
                     {
                         customer = await _orgService.GetCustomer(_Model.Item.CustomerId.Value);
                     }
-                    
+
                 }
 
-                if(customer!= null)
+                if (customer != null)
                 {
                     Console.WriteLine(System.Text.Json.JsonSerializer.Serialize(customer));
                     _Model.cssObject = await _atService.GetCaseCoefficientStatistics(customer.Id, _Model.Item.CalMonthId);
@@ -112,22 +113,22 @@ namespace wispro.sp.web.Components
                         warningMessage = $"客戶:{customer.Name}新申请案件S和A案件数已超过阈值,如果需要申请A或S的案件系数,请将审核人设置为钟子敏!";
                     }
                 }
-                
+
             }
 
             //if(!string.IsNullOrEmpty(_Model.AppealType.ReviewerExpress))
             //{
-                _Staffs =await _UserService.GetReviewers(_Model.AppealRecord.ItemId, _Model.AppealType.Id);
-                
-                if (!string.IsNullOrWhiteSpace(warningMessage) && _Model.AppealType.Name == "案件系数复核")
+            _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)
                 {
-                    var zzmList = _Staffs.Where<Staff>(s => s.Name == "钟子敏");
-                    if (zzmList==null || zzmList.Count() == 0)
-                    {
-                        _Staffs.Add(await _UserService.GetUserByName("钟子敏"));
-                    }
-               
+                    _Staffs.Add(await _UserService.GetUserByName("钟子敏"));
                 }
+
+            }
             //}
             //else
             //{
@@ -142,7 +143,7 @@ namespace wispro.sp.web.Components
 
         private async void OnFinish()
         {
-            
+
             await base.OnFeedbackOkAsync(new ModalClosingEventArgs() { Cancel = true });
         }
 
@@ -153,6 +154,6 @@ namespace wispro.sp.web.Components
             //_ = feedbackRef.CloseAsync();
         }
 
-        
+
     }
 }

+ 5 - 5
wispro.sp.web/Components/FlowChart.razor.cs

@@ -52,11 +52,11 @@ namespace wispro.sp.web.Components
         [Parameter]
         public entity.workflowDefine.Workflow workflow { get; set; }
 
-        protected  override  void OnInitialized()
+        protected override void OnInitialized()
         {
             Refresh();
         }
-        
+
 
         public void Refresh()
         {
@@ -88,7 +88,7 @@ namespace wispro.sp.web.Components
         public EventCallback<entity.workflowDefine.Step> OnClickStep { get; set; }
 
         [Parameter]
-        public EventCallback<entity.workflowDefine.Action> OnClickAction{ get; set; }
+        public EventCallback<entity.workflowDefine.Action> OnClickAction { get; set; }
 
         [Parameter]
         public EventCallback<entity.workflowDefine.TrasferCondition> OnClickTransfer { get; set; }
@@ -132,7 +132,7 @@ namespace wispro.sp.web.Components
             SelectedObject = node.NodeObject;
             flowChartUtility.SelectedShape = node;
             //Console.WriteLine(System.Text.Json.JsonSerializer.Serialize(node.NodeObject));
-            
+
             if (node.NodeObject is entity.workflowDefine.Step)
             {
                 if (OnDoubleClickStep.HasDelegate)
@@ -143,7 +143,7 @@ namespace wispro.sp.web.Components
 
             if (node.NodeObject is entity.workflowDefine.Action)
             {
-                
+
                 if (OnDoubleClickAction.HasDelegate)
                 {
                     OnDoubleClickAction.InvokeAsync((entity.workflowDefine.Action)node.NodeObject);

+ 19 - 19
wispro.sp.web/Components/InputValueSetting.razor.cs

@@ -14,7 +14,7 @@ namespace wispro.sp.web.Components
         List<wispro.sp.entity.EnumnDescription<wispro.sp.entity.workflowDefine.EnumFieldType>> FieldTypes
             = entity.EnumHelper.getEnumDescriptionDic<wispro.sp.entity.workflowDefine.EnumFieldType>();
 
-        
+
         entity.workflowDefine.InputValueSetting EditObj;
 
         [Parameter]
@@ -23,9 +23,9 @@ namespace wispro.sp.web.Components
 
         IDictionary<string, (bool edit, entity.workflowDefine.InputValueSetting data)> editCache = new Dictionary<string, (bool edit, entity.workflowDefine.InputValueSetting data)>();
 
-        private List<entity.workflowDefine.InputValueSetting > GetChildItem(share.InputValueSettingObject setting)
+        private List<entity.workflowDefine.InputValueSetting> GetChildItem(share.InputValueSettingObject setting)
         {
-            if(setting.Children == null)
+            if (setting.Children == null)
             {
                 setting.Children = new List<entity.workflowDefine.InputValueSetting>();
             }
@@ -44,7 +44,7 @@ namespace wispro.sp.web.Components
                 valueType = entity.workflowDefine.EnumFieldType.Text,
                 DisplayName = "新添栏位",
                 //ParentSetting = setting
-                
+
             };
             EditObj = newObj;
 
@@ -53,11 +53,11 @@ namespace wispro.sp.web.Components
 
             if (setting != null)
             {
-                foreach(var ss in EditAction.InputValueSettingObjects)
+                foreach (var ss in EditAction.InputValueSettingObjects)
                 {
-                    if(ss.InputValueSetting == setting )
+                    if (ss.InputValueSetting == setting)
                     {
-                        if(ss.Children == null)
+                        if (ss.Children == null)
                         {
                             ss.Children = new List<entity.workflowDefine.InputValueSetting>();
                         }
@@ -92,7 +92,7 @@ namespace wispro.sp.web.Components
 
             foreach (var temObj in EditAction.InputValueSettingObjects)
             {
-                if (temObj.InputValueSetting.DisplayName  == setting.DisplayName )
+                if (temObj.InputValueSetting.DisplayName == setting.DisplayName)
                 {
                     EditAction.InputValueSettingObjects.Remove(temObj);
                 }
@@ -102,7 +102,7 @@ namespace wispro.sp.web.Components
                 {
                     foreach (var iv in temObj.Children)
                     {
-                        if (iv.DisplayName  == setting.DisplayName)
+                        if (iv.DisplayName == setting.DisplayName)
                         {
                             temObj.Children.Remove(iv);
                             isFound = true;
@@ -200,7 +200,7 @@ namespace wispro.sp.web.Components
             {
                 foreach (var temObj in EditAction.InputValueSettingObjects)
                 {
-                    if (temObj.Children != null && temObj.Children.Contains ( setting.InputValueSetting))
+                    if (temObj.Children != null && temObj.Children.Contains(setting.InputValueSetting))
                     {
                         temObj.Children.Remove(setting.InputValueSetting);
                         break;
@@ -264,7 +264,7 @@ namespace wispro.sp.web.Components
 
         void Save(entity.workflowDefine.InputValueSetting setting)
         {
-            
+
             if (setting.Id > 0)
             {
                 var temObj = EditAction.InputValueSettingObjects.FirstOrDefault(p => p.InputValueSetting.Id == setting.Id);
@@ -274,7 +274,7 @@ namespace wispro.sp.web.Components
                     if (EditAction.UpdateInputValueSettingObjects == null)
                     {
                         EditAction.UpdateInputValueSettingObjects = new List<share.InputValueSettingObject>();
-                        
+
                     }
 
                     if (!EditAction.UpdateInputValueSettingObjects.Contains(temObj))
@@ -290,18 +290,18 @@ namespace wispro.sp.web.Components
 
         async Task OnCancel(entity.workflowDefine.InputValueSetting setting)
         {
-            if(setting.Id == 0)
+            if (setting.Id == 0)
             {
-                foreach(var temobj in EditAction.InputValueSettingObjects)
+                foreach (var temobj in EditAction.InputValueSettingObjects)
                 {
-                    if(temobj.InputValueSetting == setting)
+                    if (temobj.InputValueSetting == setting)
                     {
                         EditAction.InputValueSettingObjects.Remove(temobj);
                         break;
                     }
                 }
 
-                foreach (var temobj in EditAction.NewInputValueSettingObjects )
+                foreach (var temobj in EditAction.NewInputValueSettingObjects)
                 {
                     if (temobj.InputValueSetting == setting)
                     {
@@ -321,7 +321,7 @@ namespace wispro.sp.web.Components
                     }
                 }
 
-                setting = await  wfService.getInputValueSteeingById(setting.Id);
+                setting = await wfService.getInputValueSteeingById(setting.Id);
 
             }
 
@@ -329,8 +329,8 @@ namespace wispro.sp.web.Components
         }
 
         [Inject]
-        Services.WorkflowService  wfService { get; set; }
+        Services.WorkflowService wfService { get; set; }
     }
 
-    
+
 }

+ 1 - 1
wispro.sp.web/Components/PerformanceItemDescriptionItem.razor.cs

@@ -75,6 +75,6 @@ namespace wispro.sp.web.Components
             }
         }
 
-        
+
     }
 }

+ 4 - 4
wispro.sp.web/Components/PerformanceItemRow.razor.cs

@@ -16,13 +16,13 @@ namespace wispro.sp.web.Components
         const string strReturnCasseNo = "ReturnCasseNo";
         const string strCaseCoefficient = "CaseCoefficient";
         const string strWordCount = "WordCount";
-        
+
         [Inject] public PerformanceItemServices _ItemService { get; set; }
         [Inject] public MessageService _message { get; set; }
 
         [Parameter]
         public PerformanceItem EditingItem { get; set; }
-        
+
         [Parameter]
         public EventCallback<PerformanceItem> OnSubmitShenSu { get; set; }
 
@@ -72,7 +72,7 @@ namespace wispro.sp.web.Components
             if (OnSubmitShenSu.HasDelegate)
             {
                 OnSubmitShenSu.InvokeAsync(EditingItem);
-                
+
 
             }
         }
@@ -97,7 +97,7 @@ namespace wispro.sp.web.Components
         {
             if (isInputChanged)
             {
-                var respone =  _ItemService.SaveFieldChange(EditingItem.Id,EditField ,EditField.GetType().GetProperty(EditField).GetValue(EditField,null).ToString());
+                var respone = _ItemService.SaveFieldChange(EditingItem.Id, EditField, EditField.GetType().GetProperty(EditField).GetValue(EditField, null).ToString());
 
                 //while (!respone.GetAwaiter().IsCompleted)
                 //{

+ 18 - 18
wispro.sp.web/Components/ResponseManCondition.razor.cs

@@ -14,7 +14,7 @@ namespace wispro.sp.web.Components
     {
         UserConditionInput UserConditionInput;
         UserConditionType userConditionType;
-        
+
         UserType _userType;
 
         List<Department> departments;
@@ -40,17 +40,17 @@ namespace wispro.sp.web.Components
         private List<CascaderNode> GetFromDepartment(List<Department> _departments)
         {
             List<CascaderNode> retList = new List<CascaderNode>();
-            foreach(var dept in _departments)
+            foreach (var dept in _departments)
             {
                 CascaderNode node = new CascaderNode() { Label = dept.Name, Value = dept.Id.ToString() };
                 retList.Add(node);
             }
 
-            foreach(var dept in _departments)
+            foreach (var dept in _departments)
             {
-                if(dept.parentId != null)
+                if (dept.parentId != null)
                 {
-                    var parentNode = FindNode(dept.parentId.Value.ToString(),retList);
+                    var parentNode = FindNode(dept.parentId.Value.ToString(), retList);
                     var currentNode = FindNode(dept.Id.ToString(), retList);
 
                     //Console.WriteLine($"Find:{dept.parentId},return:{System.Text.Json.JsonSerializer.Serialize(parentNode)}");
@@ -67,21 +67,21 @@ namespace wispro.sp.web.Components
                         retList.Remove(currentNode);
                     }
 
-                    
+
 
                 }
-                
+
             }
 
             return retList;
         }
 
-        private CascaderNode FindNode(string deptId,List<CascaderNode> retList)
+        private CascaderNode FindNode(string deptId, List<CascaderNode> retList)
         {
-            
-            foreach(var node in retList)
+
+            foreach (var node in retList)
             {
-                
+
                 if (node.Value == deptId)
                 {
                     //Console.WriteLine($"Founded:{System.Text.Json.JsonSerializer.Serialize(node)}");
@@ -94,15 +94,15 @@ namespace wispro.sp.web.Components
                         var temNode = FindNode(deptId, (List<CascaderNode>)node.Children);
                         if (temNode != null)
                         {
-                            
+
                             return temNode;
                         }
                     }
                 }
-                
+
             }
 
-            
+
             return null;
         }
 
@@ -116,7 +116,7 @@ namespace wispro.sp.web.Components
 
         protected async override Task OnInitializedAsync()
         {
-            departments =await  _orgService.GetDepartments();
+            departments = await _orgService.GetDepartments();
             lstPosition = await _orgService.getPositions(null);
 
             optoins = GetFromDepartment(departments);
@@ -134,7 +134,7 @@ namespace wispro.sp.web.Components
                     SelectPositionsId = int.Parse(UserField.Positon);
                 }
 
-                
+
             }
             await base.OnInitializedAsync();
         }
@@ -148,9 +148,9 @@ namespace wispro.sp.web.Components
         private async Task OnDeptChange(CascaderNode[] selectedNodes)
         {
             int deptId = int.Parse(selectedNodes[0].Value);
-            if(userConditionType == UserConditionType.DepartmentPosition || userConditionType == UserConditionType.DepartmentPosition)
+            if (userConditionType == UserConditionType.DepartmentPosition || userConditionType == UserConditionType.DepartmentPosition)
             {
-                lstPosition =await _orgService.getPositions(deptId);
+                lstPosition = await _orgService.getPositions(deptId);
             }
         }
 

+ 1 - 1
wispro.sp.web/Components/ReviewerAppeal.razor.cs

@@ -14,7 +14,7 @@ using wispro.sp.web.Services;
 
 namespace wispro.sp.web.Components
 {
-    public partial  class ReviewerAppeal
+    public partial class ReviewerAppeal
     {
         private ReviewerAppealModel _Model;
         private IFeedbackRef feedbackRef;

+ 3 - 3
wispro.sp.web/Components/RightMenuTreeNode.razor.cs

@@ -30,7 +30,7 @@ namespace wispro.sp.web.Components
             {
                 OnCreate.InvokeAsync(dept);
             }
-            
+
         }
 
         private void _OnEdit(Department dept)
@@ -51,8 +51,8 @@ namespace wispro.sp.web.Components
 
         }
 
-        
-        private  void ShowMenu(bool isShowmenu)
+
+        private void ShowMenu(bool isShowmenu)
         {
             menuVisiable = isShowmenu;
         }

+ 8 - 8
wispro.sp.web/Components/SSTable.razor.cs

@@ -16,10 +16,10 @@ namespace wispro.sp.web.Components
         protected AntDesign.Table<AppealRecord> table;
         AntDesign.Column<AppealRecord> column;
         int _total;
-        int _pageIndex=1;
-        int _pageSize=10;
+        int _pageIndex = 1;
+        int _pageSize = 10;
         bool _loading;
-        
+
         [Parameter]
         public List<AppealRecord> Datas { get; set; }
 
@@ -40,7 +40,7 @@ namespace wispro.sp.web.Components
         List<AttachFile> attachFiles;
         async Task ShowDetail(AppealRecord appealRecord)
         {
-            
+
             CurrentAppealRecord = appealRecord;
             _FieldValues = await _atService.GetInputFieldValues(appealRecord.Id, 0);
             attachFiles = await _atService.GetAppealRecordAttachFiles(CurrentAppealRecord.Id);
@@ -96,7 +96,7 @@ namespace wispro.sp.web.Components
             //}
 
             var queryModel = table.GetQueryModel();
-            
+
 
             if (table.SortDirections.Count() > 0)
             {
@@ -127,7 +127,7 @@ namespace wispro.sp.web.Components
                         }
                         else
                         {
-                            if(frist[i].SelectedValues != second[i].SelectedValues)
+                            if (frist[i].SelectedValues != second[i].SelectedValues)
                             {
                                 return false;
                             }
@@ -154,7 +154,7 @@ namespace wispro.sp.web.Components
             //    _pageIndex = 1;
             //    //_pageIndex = queryModel.PageSize;
             //}
-            
+
             //StateHasChanged();
         }
         private void HandlePageChange(PaginationEventArgs args)
@@ -177,7 +177,7 @@ namespace wispro.sp.web.Components
                 await OnReview.InvokeAsync(appealRecord);
             }
         }
-        
+
 
         private async void _OnChangeReviewer(AppealRecord appealRecord)
         {

+ 4 - 4
wispro.sp.web/Components/StaffAutoComplete.razor.cs

@@ -11,7 +11,7 @@ namespace wispro.sp.web.Components
 {
     public partial class StaffAutoComplete
     {
-        
+
         private List<Staff> ShowStaffs = new List<Staff>();
 
         [Parameter]
@@ -38,7 +38,7 @@ namespace wispro.sp.web.Components
             }
         }
 
-        
+
         void OnSelectionChange(AutoCompleteOption item)
         {
             SelectNameChanged.InvokeAsync(item.Value.ToString());
@@ -53,9 +53,9 @@ namespace wispro.sp.web.Components
         void OnInput(ChangeEventArgs e)
         {
             var v = e.Value.ToString();
-            
+
             this.ShowStaffs = Staffs.Where<Staff>(s => s.Name.Contains(v)).ToList();
-            
+
         }
 
     }

+ 1 - 1
wispro.sp.web/Components/StaffSelect.razor.cs

@@ -31,7 +31,7 @@ namespace wispro.sp.web.Components
         protected override void OnInitialized()
         {
             _ShowStaffs = StaffLists;
-            if(_ShowStaffs !=null && _ShowStaffs.Count > 0 && AutoSelectedFirstItem && StaffId ==null)
+            if (_ShowStaffs != null && _ShowStaffs.Count > 0 && AutoSelectedFirstItem && StaffId == null)
             {
                 StaffId = _ShowStaffs[0].Id;
             }

+ 4 - 4
wispro.sp.web/Components/SubmitWorkContent.razor.cs

@@ -13,15 +13,15 @@ namespace wispro.sp.web.Components
     {
         ProjectContentRecord _Model;
         private IFeedbackRef feedbackRef;
-        
+
         [Inject] IUserService _UserService { get; set; }
 
         List<Staff> Staffs;
-        
+
         protected override async void OnInitialized()
         {
             _Model = base.Options ?? new ProjectContentRecord();
-            
+
             if (_Model.ReviewerId.HasValue && _Model.Reviewer == null)
             {
                 _Model.Reviewer = await _UserService.GetUser(_Model.ReviewerId.Value);
@@ -33,6 +33,6 @@ namespace wispro.sp.web.Components
             feedbackRef = base.FeedbackRef;
             StateHasChanged();
         }
-        
+
     }
 }

+ 5 - 5
wispro.sp.web/Components/UserConditionInput.razor.cs

@@ -25,7 +25,7 @@ namespace wispro.sp.web.Components
         List<UserItem> UserItems = new List<UserItem>();
 
         UserItem SelectedUserItem;
-        string _selectedValue ;
+        string _selectedValue;
 
         [Parameter]
         public Workflow Workflow { get; set; }
@@ -69,9 +69,9 @@ namespace wispro.sp.web.Components
                 }
             }
 
-            var actions =await wfService.GetActions(Workflow.Id);
+            var actions = await wfService.GetActions(Workflow.Id);
             //Console.WriteLine(System.Text.Json.JsonSerializer.Serialize(actions));
-            foreach(var action in actions)
+            foreach (var action in actions)
             {
                 if (action.Id == Workflow.InitActionId)
                 {
@@ -103,7 +103,7 @@ namespace wispro.sp.web.Components
                 GroupName = EnumHelper.GetDescription<UserType>(UserType.LoginUser)
             });
 
-            var Staffs =await  _UserService.GetAll();
+            var Staffs = await _UserService.GetAll();
             //Console.WriteLine(System.Text.Json.JsonSerializer.Serialize(Staffs));
             foreach (var sf in Staffs)
             {
@@ -115,7 +115,7 @@ namespace wispro.sp.web.Components
                     GroupName = EnumHelper.GetDescription<UserType>(UserType.Staff)
                 });
             }
-            
+
         }
 
         private void OnSelectedItemChangedHandler(UserItem value)

+ 1 - 1
wispro.sp.web/Components/UserGradeSelect.razor.cs

@@ -13,7 +13,7 @@ namespace wispro.sp.web.Components
         private List<StaffGrade> _StaffGrades;
         private StaffGrade _SelectedItem;
 
-        [Inject] StaffGradeService _staffGradeService{get;set;}
+        [Inject] StaffGradeService _staffGradeService { get; set; }
 
         [Parameter]
         public int? StaffGradeId { get; set; }

+ 1 - 1
wispro.sp.web/Components/WatingDownload.razor.cs

@@ -11,7 +11,7 @@ namespace wispro.sp.web.Components
         private share.FileProcessTask processTask;
         private IFeedbackRef feedbackRef;
 
-        protected override  Task OnInitializedAsync()
+        protected override Task OnInitializedAsync()
         {
             processTask = base.Options ?? new share.FileProcessTask();
             base.OnInitialized();

+ 57 - 44
wispro.sp.web/Extensions/DateTimeExtension.cs

@@ -1,49 +1,62 @@
 using System;
 
-namespace wispro.sp.web {
-  public static class DateTimeExtension {
-    private const int Second = 1;
-    private const int Minute = 60 * Second;
-    private const int Hour = 60 * Minute;
-    private const int Day = 24 * Hour;
-    private const int Month = 30 * Day;
+namespace wispro.sp.web
+{
+    public static class DateTimeExtension
+    {
+        private const int Second = 1;
+        private const int Minute = 60 * Second;
+        private const int Hour = 60 * Minute;
+        private const int Day = 24 * Hour;
+        private const int Month = 30 * Day;
 
-    // todo: Need to be localized
-    public static string ToFriendlyDisplay(this DateTime dateTime) {
-      var ts = DateTime.Now - dateTime;
-      var delta = ts.TotalSeconds;
-      if (delta < 0) {
-        return "not yet";
-      }
-      if (delta < 1 * Minute) {
-        return ts.Seconds == 1 ? "1 秒前" : ts.Seconds + " 秒前";
-      }
-      if (delta < 2 * Minute) {
-        return "1 分钟前";
-      }
-      if (delta < 45 * Minute) {
-        return ts.Minutes + "分钟";
-      }
-      if (delta < 90 * Minute) {
-        return "1 小说前";
-      }
-      if (delta < 24 * Hour) {
-        return ts.Hours + "小时前";
-      }
-      if (delta < 48 * Hour) {
-        return "昨天";
-      }
-      if (delta < 30 * Day) {
-        return ts.Days + "天前";
-      }
-      if (delta < 12 * Month) {
-        var months = Convert.ToInt32(Math.Floor((double)ts.Days / 30));
-        return months <= 1 ? "一月前" : months + "月前";
-      }
-      else {
-        var years = Convert.ToInt32(Math.Floor((double)ts.Days / 365));
-        return years <= 1 ? "一年前" : years + "年前";
-      }
+        // todo: Need to be localized
+        public static string ToFriendlyDisplay(this DateTime dateTime)
+        {
+            var ts = DateTime.Now - dateTime;
+            var delta = ts.TotalSeconds;
+            if (delta < 0)
+            {
+                return "not yet";
+            }
+            if (delta < 1 * Minute)
+            {
+                return ts.Seconds == 1 ? "1 秒前" : ts.Seconds + " 秒前";
+            }
+            if (delta < 2 * Minute)
+            {
+                return "1 分钟前";
+            }
+            if (delta < 45 * Minute)
+            {
+                return ts.Minutes + "分钟";
+            }
+            if (delta < 90 * Minute)
+            {
+                return "1 小说前";
+            }
+            if (delta < 24 * Hour)
+            {
+                return ts.Hours + "小时前";
+            }
+            if (delta < 48 * Hour)
+            {
+                return "昨天";
+            }
+            if (delta < 30 * Day)
+            {
+                return ts.Days + "天前";
+            }
+            if (delta < 12 * Month)
+            {
+                var months = Convert.ToInt32(Math.Floor((double)ts.Days / 30));
+                return months <= 1 ? "一月前" : months + "月前";
+            }
+            else
+            {
+                var years = Convert.ToInt32(Math.Floor((double)ts.Days / 365));
+                return years <= 1 ? "一年前" : years + "年前";
+            }
+        }
     }
-  }
 }

+ 1 - 1
wispro.sp.web/Layouts/LoginLayout.razor.cs

@@ -11,7 +11,7 @@ namespace wispro.sp.web.Layouts
         [Parameter]
         public string Style { get; set; } = "min-height:100vh;";
 
-        
+
         EventCallback _layoutStyleCallBack = EventCallback.Empty;
         EventCallback LayoutStyleCallBack
         {

+ 5 - 5
wispro.sp.web/Models/CreateAppealModel.cs

@@ -31,7 +31,7 @@ namespace wispro.sp.web.Models
 
         public CreateAppealModel() { }
 
-        public async Task Init(AppealTypeService _atService,PerformanceItem item,AppealType appealType)
+        public async Task Init(AppealTypeService _atService, PerformanceItem item, AppealType appealType)
         {
             FileList = new List<UploadFileItem>();
             AppealType = appealType;
@@ -55,14 +55,14 @@ namespace wispro.sp.web.Models
             {
                 inputFieldValues = new List<InputFieldValue>();
 
-                inputFields =await _atService.GetInputFields(AppealType.Id, 0);
+                inputFields = await _atService.GetInputFields(AppealType.Id, 0);
 
                 foreach (var field in inputFields)
                 {
                     if (!string.IsNullOrEmpty(field.MapObjectField) && !string.IsNullOrEmpty(field.MapObjectFieldLabel))
                     {
                         List<InputFieldValue> temValues = new List<InputFieldValue>();
-                        string[] pList = field.MapObjectField.Split(new char[] { '.'});
+                        string[] pList = field.MapObjectField.Split(new char[] { '.' });
                         string[] plList = field.MapObjectFieldLabel.Split(new char[] { '.' });
 
                         var pInfo = Item.GetType().GetProperty(pList[0]);
@@ -121,9 +121,9 @@ namespace wispro.sp.web.Models
                     }
                 }
             }
-            
+
         }
 
-        
+
     }
 }

+ 6 - 6
wispro.sp.web/Models/ReviewerAppealModel.cs

@@ -31,19 +31,19 @@ namespace wispro.sp.web.Models
 
         public async Task Init(AppealTypeService _atService, int appealRecordId)
         {
-            this.AppealRecord =await _atService.getAppealRecord(appealRecordId);
+            this.AppealRecord = await _atService.getAppealRecord(appealRecordId);
             Item = this.AppealRecord.Item;
             CreateInputFields = await _atService.GetInputFields(this.AppealRecord.TypeId, 0);
-            CreateAppealFieldValues = await _atService.GetInputFieldValues(this.AppealRecord.Id,0);
+            CreateAppealFieldValues = await _atService.GetInputFieldValues(this.AppealRecord.Id, 0);
             inputFields = await _atService.GetInputFields(this.AppealRecord.TypeId, 1);
             attachFiles = await _atService.GetAppealRecordAttachFiles(this.AppealRecord.Id);
 
-            if(AppealRecord.Type.Name == "案件系数复核")
+            if (AppealRecord.Type.Name == "案件系数复核")
             {
                 cssObject = await _atService.GetCaseCoefficientStatistics(Item.CustomerId, Item.CalMonthId);
                 MonthCCSObj = await _atService.GetCaseCoefficientStatistics(null, Item.CalMonthId);
             }
-            
+
 
             inputFieldValues = new List<InputFieldValue>();
             foreach (var field in inputFields)
@@ -110,9 +110,9 @@ namespace wispro.sp.web.Models
                 }
             }
 
-            
 
-            
+
+
         }
 
     }

+ 2 - 2
wispro.sp.web/Pages/AppCase/AppealRecords.razor.cs

@@ -39,7 +39,7 @@ namespace wispro.sp.web.Pages.AppCase
 
         string GetDescription(AppealRecord context)
         {
-            if(context.State == 0)
+            if (context.State == 0)
             {
                 if (context.Item != null)
                 {
@@ -75,7 +75,7 @@ namespace wispro.sp.web.Pages.AppCase
         List<AttachFile> attachFiles;
         async Task ShowDetail(AppealRecord appealRecord)
         {
-            CurrentAppealRecord = appealRecord ;
+            CurrentAppealRecord = appealRecord;
             _FieldValues = await _atService.GetInputFieldValues(appealRecord.Id, 0);
             attachFiles = await _atService.GetAppealRecordAttachFiles(CurrentAppealRecord.Id);
 

+ 25 - 22
wispro.sp.web/Pages/AppCase/CaseManager.razor.cs

@@ -19,7 +19,7 @@ namespace wispro.sp.web.Pages.AppCase
     public partial class CaseManager
     {
         [Inject]
-        protected  IconService iconService { get; set; }
+        protected IconService iconService { get; set; }
 
         public TableFilter<string>[] CaseCoeFilters = new TableFilter<string>[] {
             new() { Text = "S", Value = "S" },
@@ -64,13 +64,13 @@ namespace wispro.sp.web.Pages.AppCase
 
         [Inject] protected IAuthService _authService { get; set; }
 
-        [Inject] protected AppealTypeService AppealTypeService { get;set; }
+        [Inject] protected AppealTypeService AppealTypeService { get; set; }
 
         protected override async Task OnInitializedAsync()
         {
             await _authService.CanVisitResource();
             await iconService.CreateFromIconfontCN("//at.alicdn.com/t/font_8d5l8fzk5b87iudi.js");
-            calMonths  = await _CalMonthService.GetAll();
+            calMonths = await _CalMonthService.GetAll();
 
             if (calMonths != null && calMonths.Count > 0)
             {
@@ -82,9 +82,9 @@ namespace wispro.sp.web.Pages.AppCase
         private async Task HandleTableChange(QueryModel<PerformanceItem> queryModel)
         {
             var _user = await _userService.GetUser();
-            
+
             _loading = true;
-            
+
             var data = await _ItemService.Query(HandlingCalMonth, queryModel);
 
             _Datas = data.Results;
@@ -97,7 +97,7 @@ namespace wispro.sp.web.Pages.AppCase
         {
             HandlingCalMonth = calMonth;
 
-            var data = await _ItemService.Query(HandlingCalMonth,_pageIndex ,_pageSize,null);
+            var data = await _ItemService.Query(HandlingCalMonth, _pageIndex, _pageSize, null);
 
             _Datas = data.Results;
             _total = data.TotalCount;
@@ -157,10 +157,11 @@ namespace wispro.sp.web.Pages.AppCase
                     fileData = await _ItemService.getExportDataProcessing(fileData.Id);
                     await Task.Delay(100);
                 }
-                catch {
+                catch
+                {
                     await Task.Delay(1000);
                 }
-                
+
             }
 
             NavigationManager.NavigateTo($"{_configuration.GetValue<string>("APIUrl")}FileProcesTask/Download?Id={fileData.Id}");
@@ -172,19 +173,19 @@ namespace wispro.sp.web.Pages.AppCase
         private async Task ExportJXDataAsync(CalMonth calMonth)
         {
             isDownloading = true;
-            var fileData = await _ItemService.ExportJXReport(calMonth.Year,calMonth.Month);
+            var fileData = await _ItemService.ExportJXReport(calMonth.Year, calMonth.Month);
 
             while (!fileData.Finished)
             {
                 fileData = await _ItemService.getExportDataProcessing(fileData.Id);
                 await Task.Delay(20);
-            } 
+            }
 
             NavigationManager.NavigateTo($"{_configuration.GetValue<string>("APIUrl")}FileProcesTask/Download?Id={fileData.Id}");
 
             isDownloading = false;
 
-            
+
 
         }
 
@@ -294,14 +295,15 @@ namespace wispro.sp.web.Pages.AppCase
             CurrentItem = item;
             allocationRatios = await _ItemService.getARatios(item);
 
-            if(allocationRatios == null)
+            if (allocationRatios == null)
             {
-                allocationRatios= new List<AllocationRatio>();
+                allocationRatios = new List<AllocationRatio>();
             }
 
-            if(item.ReviewerId != null && allocationRatios.Where(p=>p.PersonId == item.ReviewerId ).Count()==0)
+            if (item.ReviewerId != null && allocationRatios.Where(p => p.PersonId == item.ReviewerId).Count() == 0)
             {
-                allocationRatios.Add(new AllocationRatio() { 
+                allocationRatios.Add(new AllocationRatio()
+                {
                     ItemId = item.Id,
                     PersonId = item.ReviewerId.Value,
                     Ratio = 0,
@@ -320,7 +322,7 @@ namespace wispro.sp.web.Pages.AppCase
                 });
             }
 
-            foreach(var iStaff in item.ItemStaffs)
+            foreach (var iStaff in item.ItemStaffs)
             {
                 if (allocationRatios.Where(p => p.PersonId == iStaff.DoPersonId).Count() == 0)
                 {
@@ -336,18 +338,19 @@ namespace wispro.sp.web.Pages.AppCase
             ShowSettingModal = true;
         }
 
-       
+
         private AllocationRatio getAllocationRatio(Staff person)
         {
-            var retObj= allocationRatios.Where(a => a.PersonId == person.Id).FirstOrDefault();
+            var retObj = allocationRatios.Where(a => a.PersonId == person.Id).FirstOrDefault();
             if (retObj == null)
             {
-                retObj = new AllocationRatio() { 
+                retObj = new AllocationRatio()
+                {
                     Person = person,
                     PersonId = person.Id,
                     Ratio = 0,
                     ItemId = CurrentItem.Id
-                    
+
                 };
             }
             return retObj;
@@ -355,14 +358,14 @@ namespace wispro.sp.web.Pages.AppCase
 
         private async System.Threading.Tasks.Task btnOk(MouseEventArgs e)
         {
-            foreach(var ar in allocationRatios)
+            foreach (var ar in allocationRatios)
             {
                 ar.Person = null;
                 ar.Item = null;
             }
             Console.WriteLine("1");
             var zeros = allocationRatios.Where(i => i.Ratio.Value == 0).ToList();
-            foreach(var a in zeros)
+            foreach (var a in zeros)
             {
                 allocationRatios.Remove(a);
             }

+ 1 - 1
wispro.sp.web/Pages/AppCase/LevelStatistics.razor.cs

@@ -118,6 +118,6 @@ namespace wispro.sp.web.Pages.AppCase
             await ShowSelectedDate();
         }
 
-        
+
     }
 }

+ 28 - 28
wispro.sp.web/Pages/AppCase/MyCaselist.razor.cs

@@ -46,7 +46,7 @@ namespace wispro.sp.web.Pages.AppCase
         IEnumerable<PerformanceItem> selectedItems = new List<PerformanceItem>();
 
         private CalMonth HandlingCalMonth;
-        
+
 
         int _pageIndex = 1;
         int _pageSize = 10;
@@ -69,7 +69,7 @@ namespace wispro.sp.web.Pages.AppCase
         [Inject] protected CalMonthServices _CalMonthService { get; set; }
         [Inject] protected IJSRuntime JSRuntime { get; set; }
 
-        [Inject] IConfiguration configuration{get;set;}
+        [Inject] IConfiguration configuration { get; set; }
 
 
         private bool isFirstInit = true;
@@ -141,7 +141,7 @@ namespace wispro.sp.web.Pages.AppCase
             }
             else
             {
-                if(DateTime.Now.Day <= int.Parse(strlfd))
+                if (DateTime.Now.Day <= int.Parse(strlfd))
                 {
                     return true;
                 }
@@ -178,7 +178,7 @@ namespace wispro.sp.web.Pages.AppCase
 
         private string GetStatistics(string strType, bool isBasePoint = false)
         {
-            
+
             //Console.WriteLine(strType);
             try
             {
@@ -191,7 +191,7 @@ namespace wispro.sp.web.Pages.AppCase
                     {
                         if (tem != null)
                         {
-                            return (tem.FinianlPoint .HasValue ? tem.totalBasePoint.Value.ToString("0.00") : "");
+                            return (tem.FinianlPoint.HasValue ? tem.totalBasePoint.Value.ToString("0.00") : "");
                         }
                         else
                         {
@@ -219,7 +219,7 @@ namespace wispro.sp.web.Pages.AppCase
                     }
                     else
                     {
-                        return MyStatistics.Where(s=>s.jxType !="其他新申请").Select(s => s.FinianlPoint.Value).Sum().ToString("0.00");
+                        return MyStatistics.Where(s => s.jxType != "其他新申请").Select(s => s.FinianlPoint.Value).Sum().ToString("0.00");
                     }
                 }
             }
@@ -248,7 +248,7 @@ namespace wispro.sp.web.Pages.AppCase
         private async Task HandleTableChange(QueryModel<PerformanceItem> queryModel)
         {
             var _user = await _userService.GetUser();
-            
+
             if (_CurrentKey == tabList[0].Key)
             {
                 _loading = true;
@@ -268,27 +268,27 @@ namespace wispro.sp.web.Pages.AppCase
             }
             else
             {
-                
+
                 _loading = true;
 
-                if(SelectedCalMonthId == 0 && calMonthList !=null && calMonthList.Count >0)
+                if (SelectedCalMonthId == 0 && calMonthList != null && calMonthList.Count > 0)
                 {
                     SelectedCalMonthId = calMonthList[0].Id;
                     await RefreshMyStatistics(calMonthList[0]);
                 }
 
-                var data = await _ItemService.Query(SelectedCalMonthId, _user.Userid.Value, jxType.finished, queryModel,DoingOrReview);
+                var data = await _ItemService.Query(SelectedCalMonthId, _user.Userid.Value, jxType.finished, queryModel, DoingOrReview);
 
                 _Datas = data.Results;
                 _total = data.TotalCount;
                 _loading = false;
                 StateHasChanged();
-                
+
             }
 
 
         }
-        
+
         [Inject] IConfiguration _configuration { get; set; }
 
         bool isDownloading = false;
@@ -306,9 +306,9 @@ namespace wispro.sp.web.Pages.AppCase
                 fileData = await _ItemService.ExportData(SelectedCalMonthId, _user.Userid.Value, jxType, DoingOrReview);
             }
 
-            while(!fileData.Finished)
+            while (!fileData.Finished)
             {
-                fileData =await  _ItemService.getExportDataProcessing(fileData.Id);
+                fileData = await _ItemService.getExportDataProcessing(fileData.Id);
                 await Task.Delay(20);
             }
 
@@ -350,15 +350,15 @@ namespace wispro.sp.web.Pages.AppCase
         }
 
         #region 特殊绩效字段选择框变更时处理代码
-        async void SelectChanged(Reason  value)
+        async void SelectChanged(Reason value)
         {
             if (!_loading && EditingItem != null)
             {
-                var respone =await _ItemService.SaveFieldChange(EditingItem.Id, strAgentFeedbackMemo, EditingItem.AgentFeedbackMemo);
-                var item = await _ItemService.GetPerformancItem(EditingItem.Id) ;
+                var respone = await _ItemService.SaveFieldChange(EditingItem.Id, strAgentFeedbackMemo, EditingItem.AgentFeedbackMemo);
+                var item = await _ItemService.GetPerformancItem(EditingItem.Id);
                 EditingItem.BasePoint = item.BasePoint;
                 _ = RefreshMyStatistics();
-                
+
                 EditingItem = null;
                 //table.ReloadData();
             }
@@ -366,7 +366,7 @@ namespace wispro.sp.web.Pages.AppCase
 
         void ClearSelect(int itemId)
         {
-            var respone = _ItemService.SaveFieldChange(itemId, strAgentFeedbackMemo,"");
+            var respone = _ItemService.SaveFieldChange(itemId, strAgentFeedbackMemo, "");
             EditingItem = null;
 
             _ = RefreshMyStatistics();
@@ -378,7 +378,7 @@ namespace wispro.sp.web.Pages.AppCase
         {
             Dictionary<string, object> ret = new Dictionary<string, object>();
 
-            
+
             ret.Add("onclick", ((Action)delegate
             {
                 EditingItem = row.Data;
@@ -405,13 +405,13 @@ namespace wispro.sp.web.Pages.AppCase
 
         private ModalRef _modalRef;
         [Inject] ModalService _ModalService { get; set; }
-        [Inject]protected AppealTypeService _atService { get; set; }
+        [Inject] protected AppealTypeService _atService { get; set; }
 
         [Inject] IUserService _UserService { get; set; }
 
         private bool isExistAllocationRatios(PerformanceItem item)
         {
-            return (item.AllocationRatios != null && item.AllocationRatios.Count >0);
+            return (item.AllocationRatios != null && item.AllocationRatios.Count > 0);
         }
 
         private Double ActualAmount(PerformanceItem item)
@@ -451,13 +451,13 @@ namespace wispro.sp.web.Pages.AppCase
             string strTem = "";
             var ratios = await _ItemService.getARatios(item);
             item.AllocationRatios = ratios;
-            
+
             StateHasChanged();
         }
-        async Task ShowModel(PerformanceItem Item,AppealType appealType)
+        async Task ShowModel(PerformanceItem Item, AppealType appealType)
         {
             var templateOptions = new Models.CreateAppealModel();
-            await templateOptions.Init(_atService,Item, appealType);
+            await templateOptions.Init(_atService, Item, appealType);
 
             //Console.WriteLine(System.Text.Json.JsonSerializer.Serialize(Item));
 
@@ -522,7 +522,7 @@ namespace wispro.sp.web.Pages.AppCase
                     //    if (temCssObj.isExceedingLimit())
                     //    {
                     //        var reviewer = await _UserService.GetUser(templateOptions.AppealRecord.ReviewerId.Value);
-                            
+
                     //        if (reviewer.Name != "钟子敏")
                     //        {
                     //            var SuccessConfig1 = new ConfirmOptions()
@@ -531,7 +531,7 @@ namespace wispro.sp.web.Pages.AppCase
                     //            };
 
                     //            _ModalService.Error(SuccessConfig1);
-                                
+
                     //            //await JSRuntime.InvokeAsync<object>("alert", $"客户:【{temCssObj.customer.Name}】新申请案件系数A或者S超出阈值,需要提交给“钟子敏”审核!");
                     //            return;
                     //        }
@@ -578,6 +578,6 @@ namespace wispro.sp.web.Pages.AppCase
             StateHasChanged();
         }
 
-        
+
     }
 }

+ 3 - 3
wispro.sp.web/Pages/AppCase/MyFistPage.razor.cs

@@ -19,16 +19,16 @@ namespace wispro.sp.web.Pages.AppCase
         [Inject] public PerformanceItemServices _ItemService { get; set; }
         [Inject] public MessageService _message { get; set; }
         [Inject] protected NavigationManager NavigationManager { get; set; }
-        [Inject] protected  IUserService _userService { get; set; }
+        [Inject] protected IUserService _userService { get; set; }
 
         protected async override Task OnInitializedAsync()
         {
-            
+
             _loading = true;
 
             //System.Diagnostics.Debug.WriteLine(_userService.CurrentUser.Userid);
             var _user = await _userService.GetUser();
-            var data = await _ItemService.GetMyList(_user.Userid.Value,jxType.doing);
+            var data = await _ItemService.GetMyList(_user.Userid.Value, jxType.doing);
 
 
             _Datas = data.Results;

+ 5 - 5
wispro.sp.web/Pages/ChangePassword.razor.cs

@@ -28,7 +28,7 @@ namespace wispro.sp.web.Pages
 
         protected async override Task OnInitializedAsync()
         {
-            user =await userService.GetUser();
+            user = await userService.GetUser();
             dto = new changePasswordDto();
             dto.UserId = user.Userid.Value;
 
@@ -37,7 +37,7 @@ namespace wispro.sp.web.Pages
         }
 
         private string ErrorMsg;
-        public async  void OnSubmit()
+        public async void OnSubmit()
         {
             //Console.WriteLine($"OnSubmit:{System.Text.Json.JsonSerializer.Serialize(user)}");
             //Console.WriteLine($"用户ID:{dto.UserId}");
@@ -45,17 +45,17 @@ namespace wispro.sp.web.Pages
             //Console.WriteLine($"旧密码:{dto.oldPassword}");
             //Console.WriteLine($"新密码:{dto.newPassword}");
             //Console.WriteLine($"Check新密码:{ChecknewPassword}");
-            
+
             ErrorMsg = "";
 
-            if(dto.newPassword  == ChecknewPassword)
+            if (dto.newPassword == ChecknewPassword)
             {
                 if (string.IsNullOrEmpty(dto.newPassword))
                 {
                     ErrorMsg = "密码不能为空!";
                     return;
                 }
-                
+
                 var result = await authService.ChangePassword(dto);
 
                 if (result)

+ 3 - 3
wispro.sp.web/Pages/CompareFile/Detail.razor.cs

@@ -21,7 +21,7 @@ namespace wispro.sp.web.Pages.CompareFile
 
         protected override async Task OnInitializedAsync()
         {
-            
+
             QueryFilter _filter = new QueryFilter();
             _filter.ConditionTree.Add(
                     new FieldCondition()
@@ -36,8 +36,8 @@ namespace wispro.sp.web.Pages.CompareFile
 
             _filter.PageIndex = 1;
             _filter.PageSize = 10;
-            
-            
+
+
             var data = await _CompareFileService.Query(_filter);
             var _caseList = data.Results;
             var _total = data.TotalCount;

+ 7 - 7
wispro.sp.web/Pages/CompareFile/List.razor.cs

@@ -14,8 +14,8 @@ using System.Linq;
 
 namespace wispro.sp.web.Pages.CompareFile
 {
-     public partial class List
-     {
+    public partial class List
+    {
         [Inject] public CompareFileService _CompareFileService { get; set; }
 
         int _pageIndex = 1;
@@ -30,7 +30,7 @@ namespace wispro.sp.web.Pages.CompareFile
         int _value = 1;
         int _ShowResultString = 1;
 
-        List<Field> _fields = new List<Field>() { 
+        List<Field> _fields = new List<Field>() {
             new Field(){ FieldName="处理人",FieldValue="Handlers"},
             new Field(){ FieldName="审核人",FieldValue="Reviewer.Name"},
             new Field(){ FieldName="客户",FieldValue="Customer.Name"},
@@ -44,7 +44,7 @@ namespace wispro.sp.web.Pages.CompareFile
             await GetData();
 
             StateHasChanged();
-            
+
         }
 
         private void OnSelectedItemChangedHandler(Field value)
@@ -76,10 +76,10 @@ namespace wispro.sp.web.Pages.CompareFile
 
         private string ConvertFiledCondition2String(FieldCondition c)
         {
-            if(c != null)
+            if (c != null)
             {
                 var f = _fields.Where(s => s.FieldValue == c.FieldName).FirstOrDefault();
-                if(f != null)
+                if (f != null)
                 {
                     return $"{f.FieldName}={c.Value}";
                 }
@@ -95,7 +95,7 @@ namespace wispro.sp.web.Pages.CompareFile
 
             _pageIndex = 1;
             _filter.ConditionTree.Remove(c);
-            
+
             await GetData();
             StateHasChanged();
         }

+ 8 - 8
wispro.sp.web/Pages/CustomerList.razor.cs

@@ -14,7 +14,7 @@ namespace wispro.sp.web.Pages
 {
     public partial class CustomerList
     {
-        private List<entity.Customer> _Customers =new List<entity.Customer>();
+        private List<entity.Customer> _Customers = new List<entity.Customer>();
         private List<entity.Staff> _Staffs = new List<entity.Staff>();
 
         IEnumerable<entity.Customer> selectedRows;
@@ -29,7 +29,7 @@ namespace wispro.sp.web.Pages
         bool _visible = false;
         bool _isAdd = false;
 
-        [Inject]OrganizationService  orgService { get; set; }
+        [Inject] OrganizationService orgService { get; set; }
         [Inject] protected IAuthService _authService { get; set; }
 
         [Inject] IUserService _UserService { get; set; }
@@ -39,8 +39,8 @@ namespace wispro.sp.web.Pages
             await _authService.CanVisitResource();
 
             _loading = true;
-            _Customers = await  orgService.GetAllCustomer();
-            
+            _Customers = await orgService.GetAllCustomer();
+
             _Staffs = await _UserService.GetAll();
             //await System.Threading.Thread.Sleep();
             //List<wispro.sp.entity.StaffGrade> data = await Http.GetFromJsonAsync<List<wispro.sp.entity.StaffGrade>>($"http://localhost:39476/api/StaffGrade/GetAll");
@@ -71,8 +71,8 @@ namespace wispro.sp.web.Pages
             ret.Add("id", row.Data.Id);
             ret.Add("onclick", ((Action)delegate
             {
-            //_message.Info($"row {row.Data.Grade} was clicked");
-        }));
+                //_message.Info($"row {row.Data.Grade} was clicked");
+            }));
 
 
             return ret;
@@ -107,7 +107,7 @@ namespace wispro.sp.web.Pages
 
             if (Editing != null)
             {
-               
+
                 //Console.WriteLine(System.Text.Json.JsonSerializer.Serialize(Editing));
                 _isAdd = false;
                 _visible = true;
@@ -127,7 +127,7 @@ namespace wispro.sp.web.Pages
         }
 
         private async Task HandleOk(MouseEventArgs e)
-{
+        {
             var data = await orgService.SaveCustomer(Editing); // Http.PostAsJsonAsync<wispro.sp.entity.Staff>($"http://localhost:39476/api/Staff/Save", EditingStaff);
 
             if (data.Success)

+ 7 - 6
wispro.sp.web/Pages/LoginPages.razor.cs

@@ -35,9 +35,9 @@ namespace wispro.sp.web.Pages
         {
             isLoading = true;
 
-            
+
             bool result = await authService.LoginAsync(model);
-            
+
             if (result)
             {
                 if (model.Password == "12345678")
@@ -52,9 +52,9 @@ namespace wispro.sp.web.Pages
             else
             {
                 _ = MsgSvr.Error($"用户名或密码错误");
-                
+
             }
-            
+
             isLoading = false;
         }
 
@@ -68,11 +68,12 @@ namespace wispro.sp.web.Pages
 
         private async System.Threading.Tasks.Task HandleOk(MouseEventArgs e)
         {
-            if(String.IsNullOrEmpty(EditingStaff.Account ) || string.IsNullOrEmpty(EditingStaff.Mail)){
+            if (String.IsNullOrEmpty(EditingStaff.Account) || string.IsNullOrEmpty(EditingStaff.Mail))
+            {
                 await MsgSvr.Success("请输入账号名称和邮箱!");
                 return;
             }
-            var data = await authService.ResetPassword(EditingStaff.Account,EditingStaff.Mail);
+            var data = await authService.ResetPassword(EditingStaff.Account, EditingStaff.Mail);
 
             if (data.Success)
             {

+ 20 - 20
wispro.sp.web/Pages/Organization/Department.razor.cs

@@ -28,7 +28,7 @@ namespace wispro.sp.web.Pages.Organization
 
         [Inject] protected NavigationManager NavigationManager { get; set; }
 
-        [Inject] protected  IAuthService _authService { get; set; }
+        [Inject] protected IAuthService _authService { get; set; }
 
         [Inject] protected IUserService userService { get; set; }
 
@@ -39,12 +39,12 @@ namespace wispro.sp.web.Pages.Organization
         protected override async System.Threading.Tasks.Task OnInitializedAsync()
         {
             await _authService.CanVisitResource();
-            
-            
+
+
 
             _loading = true;
 
-            departments =await orgService.GetDepartments();
+            departments = await orgService.GetDepartments();
 
             var data = await orgService.GetStaffs(null, 1, 10);
             _loading = false;
@@ -58,7 +58,7 @@ namespace wispro.sp.web.Pages.Organization
 
         #region 部门操作
         bool newModal = false;
-        
+
         private void AddNew(entity.Department parentDept)
         {
             _editDepartment = new entity.Department();
@@ -74,14 +74,14 @@ namespace wispro.sp.web.Pages.Organization
                 //{
                 //    _editDepartment.ancestors  = parentDept.Id.ToString();
                 //}
-                
+
                 //_editDepartment.order_num = GetChildren(parentDept).Count + 1;
             }
-            
-            newModal = true; 
+
+            newModal = true;
         }
 
-        
+
 
 
 
@@ -125,13 +125,13 @@ namespace wispro.sp.web.Pages.Organization
 
         }
 
-        
+
 
         private List<wispro.sp.entity.Department> GetChildren(wispro.sp.entity.Department dept)
         {
-            if(dept == null)
+            if (dept == null)
             {
-                var retList = departments.Where<wispro.sp.entity.Department>(x => x.parentId == null).OrderBy(x=>x.order_num).ToList();
+                var retList = departments.Where<wispro.sp.entity.Department>(x => x.parentId == null).OrderBy(x => x.order_num).ToList();
                 return retList;
             }
             else
@@ -139,7 +139,7 @@ namespace wispro.sp.web.Pages.Organization
                 var retList = departments.Where<wispro.sp.entity.Department>(x => x.parentId == dept.Id).OrderBy(x => x.order_num).ToList();
                 return retList;
             }
-            
+
         }
 
 
@@ -151,7 +151,7 @@ namespace wispro.sp.web.Pages.Organization
         int _pageIndex = 1;
         int _pageSize = 10;
         int _total = 0;
-        
+
 
         Staff EditingStaff = null;
 
@@ -196,7 +196,7 @@ namespace wispro.sp.web.Pages.Organization
                 }
             }
 
-            return  iIndex;
+            return iIndex;
         }
 
         private async Task Edit(Staff staff)
@@ -204,15 +204,15 @@ namespace wispro.sp.web.Pages.Organization
             EditingStaff = staff;
             selectPosition = await orgService.getPosition(staff, _editDepartment);
 
-            
-            if(selectPosition == null)
+
+            if (selectPosition == null)
             {
                 selectPosition = new Position();
             }
             //Console.WriteLine($"Edit:{JsonSerializer.Serialize(selectPosition)}");
             PositionId = selectPosition.Id;
             _isAdd = false;
-            _newUserModal  = true;
+            _newUserModal = true;
         }
 
         private void Delete(Staff staff)
@@ -263,7 +263,7 @@ namespace wispro.sp.web.Pages.Organization
         }
 
         private List<Position> _allPositions;
-        Position selectPosition= new Position();
+        Position selectPosition = new Position();
         int PositionId;
         private async System.Threading.Tasks.Task HandleOk(MouseEventArgs e)
         {
@@ -300,7 +300,7 @@ namespace wispro.sp.web.Pages.Organization
 
         private void OnSelectedItemChangedHandler(Position value)
         {
-            selectPosition  = value;
+            selectPosition = value;
             //PositionIdChanged.InvokeAsync(_SelectedItem.Id);
         }
 

+ 12 - 11
wispro.sp.web/Pages/Project/AssignPoint.razor.cs

@@ -20,7 +20,8 @@ namespace wispro.sp.web.Pages.Project
         [Inject] protected IProjectService _itemService { get; set; }
         [Inject] NavigationManager _NavigationManager { get; set; }
 
-        ProjectContents task = new() {
+        ProjectContents task = new()
+        {
             ProjectContentRecord = new ProjectContentRecord(),
             ProjectWorkContents = new List<ViewProjectWorkContent>()
         };
@@ -37,7 +38,7 @@ namespace wispro.sp.web.Pages.Project
         [Parameter]
         public int? Id { get; set; }
 
-        
+
 
         private void AddNew()
         {
@@ -52,9 +53,9 @@ namespace wispro.sp.web.Pages.Project
         protected async override Task OnInitializedAsync()
         {
             isLoading = true;
-            ProjectInfos =await _itemService.GetProjectInfos(0);
+            ProjectInfos = await _itemService.GetProjectInfos(0);
             ShowProjectInfos = ProjectInfos;
-            
+
             if (Id.HasValue)
             {
                 task = await _itemService.getProjectWorkContent(Id.Value);
@@ -72,7 +73,7 @@ namespace wispro.sp.web.Pages.Project
             {
                 //Console.WriteLine(System.Text.Json.JsonSerializer.Serialize(value));
 
-                
+
                 task.ProjectContentRecord.ProjectNo = value.CaseNo;
                 task.ProjectContentRecord.Project = value;
             }
@@ -90,7 +91,7 @@ namespace wispro.sp.web.Pages.Project
         void startEdit(ViewProjectWorkContent pw)
         {
             addDoItem = pw;
-            
+
         }
 
         void deletePersonPoint(ViewProjectWorkContent pw)
@@ -109,11 +110,11 @@ namespace wispro.sp.web.Pages.Project
 
         void stopEdit()
         {
-            if(addDoItem.modifyState != ModifyState.New)
+            if (addDoItem.modifyState != ModifyState.New)
             {
                 addDoItem.modifyState = ModifyState.Modified;
             }
-            
+
             addDoItem = null;
         }
 
@@ -134,7 +135,7 @@ namespace wispro.sp.web.Pages.Project
         {
             return task.ProjectWorkContents.Where(p => p.modifyState != ModifyState.Deleted).ToList();
         }
-       
+
         async Task OnSave()
         {
             //添加保存代码
@@ -159,8 +160,8 @@ namespace wispro.sp.web.Pages.Project
             _NavigationManager.NavigateTo("/Project/MyProjects");
         }
 
-        
+
     }
 
-    
+
 }

+ 3 - 3
wispro.sp.web/Pages/Project/MyProject.razor.cs

@@ -65,7 +65,7 @@ namespace wispro.sp.web.Pages.Project
 
             if (!result)
             {
-               await MsgSvr.Error($"设定专案[{CaseNo}]为已完成时出错,请稍后再试!");
+                await MsgSvr.Error($"设定专案[{CaseNo}]为已完成时出错,请稍后再试!");
             }
         }
 
@@ -121,7 +121,7 @@ namespace wispro.sp.web.Pages.Project
                 strRet = $"{strRet}{projectContent.PointS}D,";
             }
 
-            if(strRet.Length > 0)
+            if (strRet.Length > 0)
             {
                 strRet = strRet.Substring(0, strRet.Length - 1);
             }
@@ -159,7 +159,7 @@ namespace wispro.sp.web.Pages.Project
                         {
                             Content = @"提交成功!"
                         };
-                       
+
                         modalConfig.DestroyOnClose = true;
                         _ModalService.Success(SuccessConfig);
 

+ 104 - 27
wispro.sp.web/Pages/Project/ProjectReviewer.razor

@@ -1,10 +1,11 @@
-@page "/Project/Reviewer/{ProjectNo?}"
+@page "/Project/Reviewer/{ProjectNo?}"
 @attribute [Authorize]
+
 <PageContainer>
     <Breadcrumb>
         <Breadcrumb>
             <BreadcrumbItem>
-                <a href="/Home"><Icon Type="home"></Icon></a>
+                <a href="/Home"><Icon Type="home" /></a>
             </BreadcrumbItem>
             <BreadcrumbItem>
                 <span>专案审核</span>
@@ -13,6 +14,7 @@
     </Breadcrumb>
     <Content>
         <Button Type="primary" Icon="plus" OnClick="Save" Style="float:right">保存</Button>
+        <Button Type="default" Icon="history" OnClick="ShowReviewerHistory" Style="float:right;margin-right: 10px;">查看审核历史</Button>
     </Content>
     <ChildContent>
         <Space>
@@ -23,7 +25,7 @@
             else
             {
                 <SpaceItem>@ProjectNo</SpaceItem>
-                <SpaceItem><Button Type="primary" Icon="" OnClick="ReviewHistory">查看往期点数</Button></SpaceItem>
+                <SpaceItem><Button Type="primary" Icon="" OnClick="ReviewHistory">查看历史点数</Button></SpaceItem>
             }
         </Space>
 
@@ -35,7 +37,7 @@
                     <Extra>
                         <Space>
                             <SpaceItem>
-                                最终绩效点数:
+                                最终绩效点数
                                 <AntDesign.InputNumber @bind-Value="@pContent.ProjectContentRecord.PointS" Step="0.01" Size="@InputSize.Small" />S
                             </SpaceItem>
                             <SpaceItem><AntDesign.InputNumber @bind-Value="@pContent.ProjectContentRecord.PointA" Step="0.01" Size="@InputSize.Small" />A</SpaceItem>
@@ -59,20 +61,15 @@
                                 <AntDesign.Column Title="耗时" TData="string">
                                     @pp.TakeTime 小时
                                 </AntDesign.Column>
-                                <AntDesign.Column Title="工作难度系数" TData="string">
-                                    <Input Type="text" @bind-Value="@pp.DifficultFactor" Size="20" @oninput="()=>ContentChanged(pp)" />
+                                <AntDesign.Column Title="难度系数" TData="string">
+                                    <Input Type="text" @bind-Value="@pp.DifficultFactor" Size="20" @oninput="() => ContentChanged(pp)" />
                                 </AntDesign.Column>
                                 <AntDesign.Column Title="实际绩效" TData="string">
-                                    <Input Type="text" @bind-Value="@pp.ActualPerformance" OnBlur="stopEdit" Size="20" @oninput="()=>ContentChanged(pp)" />
+                                    <Input Type="text" @bind-Value="@pp.ActualPerformance" OnBlur="stopEdit" Size="20" @oninput="() => ContentChanged(pp)" />
                                 </AntDesign.Column>
-                                @*<AntDesign.Column Title="最终绩效" TData="string">
-                                    <Input Type="text" @bind-Value="@pp.FinalPerformance" OnBlur="stopEdit" Size="20" @oninput="()=>ContentChanged(pp)" />
-                                </AntDesign.Column>*@
                             </ChildContent>
                         </Table>
-
                     </Body>
-
                 </Card>
             }
         }
@@ -83,28 +80,26 @@
     </ChildContent>
 </PageContainer>
 
-<Drawer Height="600" Visible="_ShowHistory" Placement="bottom" Title='($"【{ProjectNo}】历史点数")' OnClose="_=>CloseDetail()">
-
+<Drawer Height="600" Visible="_ShowHistory" Placement="bottom" Title="@($"[{ProjectNo}] 历史点数")" OnClose="CloseDetail">
     @if(HistroyContents != null){
     <div>
         @foreach(CalMonth calMonth in GetMonth(HistroyContents))
         {
-            <span><b>@($"{calMonth.Year}年{calMonth.Month}月")</b></span>
+            <span><b>@($"{calMonth.Year}  {calMonth.Month} 月")</b></span>
             <Divider/>
-
             foreach(share.ProjectContents pContent in GetByMonth(calMonth, HistroyContents))
             {
                 <Card Title="@pContent.ProjectContentRecord.Staff.Name">
                     <Extra>
                         <Space>
                             <SpaceItem>
-                                最终绩效点数:
+                                最终绩效点数
                             </SpaceItem>
-                            <SpaceItem><span style ="text-decoration:underline;">@($"{GetPointString(pContent.ProjectContentRecord,"S")}") </span><b>S</b></SpaceItem>
-                            <SpaceItem><span style ="text-decoration:underline;">@($"{GetPointString(pContent.ProjectContentRecord,"A")}") </span><b>A</b></SpaceItem>
-                            <SpaceItem><span style ="text-decoration:underline;">@($"{GetPointString(pContent.ProjectContentRecord,"B")}") </span><b>B</b></SpaceItem>
-                            <SpaceItem><span style ="text-decoration:underline;">@($"{GetPointString(pContent.ProjectContentRecord,"C")}") </span><b>C</b></SpaceItem>
-                            <SpaceItem><span style ="text-decoration:underline;">@($"{GetPointString(pContent.ProjectContentRecord,"D")}") </span><b>D</b></SpaceItem>
+                            <SpaceItem><span style="text-decoration:underline;">@($"{GetPointString(pContent.ProjectContentRecord,"S")}") </span><b>S</b></SpaceItem>
+                            <SpaceItem><span style="text-decoration:underline;">@($"{GetPointString(pContent.ProjectContentRecord,"A")}") </span><b>A</b></SpaceItem>
+                            <SpaceItem><span style="text-decoration:underline;">@($"{GetPointString(pContent.ProjectContentRecord,"B")}") </span><b>B</b></SpaceItem>
+                            <SpaceItem><span style="text-decoration:underline;">@($"{GetPointString(pContent.ProjectContentRecord,"C")}") </span><b>C</b></SpaceItem>
+                            <SpaceItem><span style="text-decoration:underline;">@($"{GetPointString(pContent.ProjectContentRecord,"D")}") </span><b>D</b></SpaceItem>
                         </Space>
                     </Extra>
                     <Body>
@@ -122,7 +117,7 @@
                                 <AntDesign.Column Title="耗时" TData="string">
                                     @pp.TakeTime 小时
                                 </AntDesign.Column>
-                                <AntDesign.Column Title="工作难度系数" TData="string">
+                                <AntDesign.Column Title="难度系数" TData="string">
                                     @pp.DifficultFactor
                                 </AntDesign.Column>
                                 <AntDesign.Column Title="实际绩效" TData="string">
@@ -130,15 +125,97 @@
                                 </AntDesign.Column>
                             </ChildContent>
                         </Table>
-
                     </Body>
                 </Card>
             }
         }
     </div>
     }
-    
 </Drawer>
 
-
-
+<Drawer Width="1200" Visible="_ShowReviewerHistory" Placement="right" Title="@("审核历史")" OnClose="CloseReviewerHistory">
+    <div>
+        <div style="margin-bottom: 16px;">
+            <InputGroup Compact>
+                <Input Placeholder="请输入案件编号" Style="width: 300px;" @bind-Value="@projectNoSearchText" OnPressEnter="() => OnSearchTextChanged(projectNoSearchText)" />
+                <Button Type="@ButtonType.Primary" OnClick="() => OnSearchTextChanged(projectNoSearchText)">搜索</Button>
+            </InputGroup>
+        </div>
+        @{
+            var filteredProjects = GetFilteredReviewerHistory();
+        }
+        @if (filteredProjects != null && filteredProjects.Count > 0)
+        {
+            // 按案件编号分组
+            var projectGroups = filteredProjects.GroupBy(p => p.ProjectNo).OrderByDescending(g => g.Max(p => p.SubmitTime));
+            
+            foreach (var projectGroup in projectGroups)
+            {
+                <Card Style="margin-bottom: 20px;">
+                    <TitleTemplate>
+                        <b>案件编号:@projectGroup.Key</b>
+                    </TitleTemplate>
+                    <Body>
+                        @foreach (var record in projectGroup.OrderByDescending(r => r.SubmitTime))
+                        {
+                            <Card Style="margin-bottom: 10px;" Size="small">
+                                <TitleTemplate>
+                                    <Space>
+                                        <SpaceItem><b>处理人:</b>@record.Staff?.Name</SpaceItem>
+                                        <SpaceItem><b>绩效月份:</b>@(record.CalMonth?.Year) 年 @(record.CalMonth?.Month) 月</SpaceItem>
+                                        <SpaceItem><b>提交时间:</b>@record.SubmitTime.ToString("yyyy-MM-dd")</SpaceItem>
+                                    </Space>
+                                </TitleTemplate>
+                                <Extra>
+                                    <Space>
+                                        <SpaceItem><b>绩效点数:</b></SpaceItem>
+                                        @if (record.PointS.HasValue) { <SpaceItem>S: @record.PointS</SpaceItem> }
+                                        @if (record.PointA.HasValue) { <SpaceItem>A: @record.PointA</SpaceItem> }
+                                        @if (record.PointB.HasValue) { <SpaceItem>B: @record.PointB</SpaceItem> }
+                                        @if (record.PointC.HasValue) { <SpaceItem>C: @record.PointC</SpaceItem> }
+                                        @if (record.PointD.HasValue) { <SpaceItem>D: @record.PointD</SpaceItem> }
+                                    </Space>
+                                </Extra>
+                                <Body>
+                                    @if (record.ProjectWorkContents != null && record.ProjectWorkContents.Count > 0)
+                                    {
+                                        <Table DataSource="record.ProjectWorkContents" Context="workContent" Size="@TableSize.Small" HidePagination="@true">
+                                            <ChildContent>
+                                                <AntDesign.Column Title="工作内容" TData="string">
+                                                    @workContent.Content
+                                                </AntDesign.Column>
+                                                <AntDesign.Column Title="工作日期" TData="string">
+                                                    @workContent.WorkDate.ToString("yyyy-MM-dd")
+                                                </AntDesign.Column>
+                                                <AntDesign.Column Title="时间跨度" TData="string">
+                                                    @workContent.TimeSpan 天
+                                                </AntDesign.Column>
+                                                <AntDesign.Column Title="耗时" TData="string">
+                                                    @workContent.TakeTime 小时
+                                                </AntDesign.Column>
+                                                <AntDesign.Column Title="难度系数" TData="string">
+                                                    @workContent.DifficultFactor
+                                                </AntDesign.Column>
+                                                <AntDesign.Column Title="实际绩效" TData="string">
+                                                    @workContent.ActualPerformance
+                                                </AntDesign.Column>
+                                            </ChildContent>
+                                        </Table>
+                                    }
+                                    else
+                                    {
+                                        <Empty Description="@("无工作内容")" />
+                                    }
+                                </Body>
+                            </Card>
+                        }
+                    </Body>
+                </Card>
+            }
+        }
+        else
+        {
+            <Empty />
+        }
+    </div>
+</Drawer>

+ 62 - 14
wispro.sp.web/Pages/Project/ProjectReviewer.razor.cs

@@ -1,4 +1,4 @@
-using AntDesign;
+using AntDesign;
 using Microsoft.AspNetCore.Components;
 using Microsoft.AspNetCore.Components.Web;
 using System;
@@ -11,16 +11,21 @@ using wispro.sp.web.Services;
 
 namespace wispro.sp.web.Pages.Project
 {
-    public partial class ProjectReviewer
+    public partial class ProjectReviewer : ComponentBase
     {
         private List<ProjectContents> projectContents;
         private ProjectInfo projectInfo;
         private List<ProjectInfo> waitingReviewProjects;
         private ViewProjectWorkContent editObj;
 
+        // 新增:审核人历史记录相关字段
+        private List<ProjectContentRecord> reviewerHistoryProjects;
+        private bool _ShowReviewerHistory = false;
+        private string projectNoSearchText = ""; // 专案编号搜索关键字
+
         [Parameter]
         public string ProjectNo { get; set; }
-        
+
         [Inject]
         IProjectService projectService { get; set; }
 
@@ -31,9 +36,9 @@ namespace wispro.sp.web.Pages.Project
 
         [Inject] NavigationManager _NavigationManager { get; set; }
 
-        protected async override  Task OnInitializedAsync()
+        protected override async Task OnInitializedAsync()
         {
-            CalMonth cal =await calMonthServices.GetHandlingMonth();
+            CalMonth cal = await calMonthServices.GetHandlingMonth();
             if (!string.IsNullOrEmpty(ProjectNo))
             {
                 projectContents = await projectService.GetProjectCanReviewWorkContent(ProjectNo, cal);
@@ -78,18 +83,18 @@ namespace wispro.sp.web.Pages.Project
             {
                 _NavigationManager.NavigateTo("/Home");
                 await _message.Success("保存成功!");
-                
+
             }
             else
             {
-               await _message.Error(ret.ErrorMessage);
+                await _message.Error(ret.ErrorMessage);
             }
 
         }
 
         List<ProjectContents> HistroyContents;
         bool _ShowHistory = false;
-        async void ReviewHistory()
+        async Task ReviewHistory()
         {
             if (HistroyContents == null)
             {
@@ -112,7 +117,7 @@ namespace wispro.sp.web.Pages.Project
             foreach (var projectContentsItem in projectContents)
             {
                 CalMonth calMonth = projectContentsItem.ProjectContentRecord.CalMonth;
-                var temMonth =monthList.FirstOrDefault(c => c.Month == calMonth.Month && c.Year == calMonth.Year);
+                var temMonth = monthList.FirstOrDefault(c => c.Month == calMonth.Month && c.Year == calMonth.Year);
 
                 if (temMonth == null)
                 {
@@ -121,17 +126,17 @@ namespace wispro.sp.web.Pages.Project
             }
 
             return monthList;
-            
+
         }
 
         private List<ProjectContents> GetByMonth(CalMonth calMonth, List<ProjectContents> projectContents)
         {
-            return projectContents.Where(p => p.ProjectContentRecord.CalMonthId == calMonth.Id).ToList(); 
+            return projectContents.Where(p => p.ProjectContentRecord.CalMonthId == calMonth.Id).ToList();
         }
 
-        private string GetPointString(ProjectContentRecord record,string CaseXS)
+        private string GetPointString(ProjectContentRecord record, string CaseXS)
         {
-            if(record != null)
+            if (record != null)
             {
                 switch (CaseXS)
                 {
@@ -156,5 +161,48 @@ namespace wispro.sp.web.Pages.Project
             return "";
         }
 
+        // 新增:显示审核人历史记录
+        async Task ShowReviewerHistory()
+        {
+            if (reviewerHistoryProjects == null)
+            {
+                reviewerHistoryProjects = await projectService.GetReviewerHistoryProjects();
+            }
+
+            _ShowReviewerHistory = true;
+            StateHasChanged();
+        }
+
+        // 新增:关闭审核人历史记录抽屉
+        void CloseReviewerHistory()
+        {
+            _ShowReviewerHistory = false;
+        }
+
+        // 新增:获取过滤后的审核历史记录
+        private List<ProjectContentRecord> GetFilteredReviewerHistory()
+        {
+            if (reviewerHistoryProjects == null || reviewerHistoryProjects.Count == 0)
+            {
+                return new List<ProjectContentRecord>();
+            }
+
+            if (string.IsNullOrWhiteSpace(projectNoSearchText))
+            {
+                return reviewerHistoryProjects;
+            }
+
+            return reviewerHistoryProjects
+                .Where(p => p.ProjectNo != null && p.ProjectNo.Contains(projectNoSearchText, StringComparison.OrdinalIgnoreCase))
+                .ToList();
+        }
+
+        // 新增:搜索文本改变事件
+        void OnSearchTextChanged(string value)
+        {
+            projectNoSearchText = value ?? "";
+            StateHasChanged();
+        }
+
     }
-}
+}

+ 0 - 0
wispro.sp.web/Pages/Project/ProjectSearch.razor.cs


برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است