浏览代码

修改绩效计算模块;
添加申诉趋势统计模块

luocaiyang 3 年之前
父节点
当前提交
2557e488ec

+ 134 - 45
wispro.sp.api/Controllers/PerformanceItemController.cs

@@ -521,13 +521,7 @@ namespace wispro.sp.api.Controllers
 
         private List<StaffStatistics> _CalMyStatistics(CalMonth calMonth, int? userid = null)
         {
-            NanduStatics gspjXS = DegreeOfDifficulty(calMonth);
-            calMonth.NanduXS = gspjXS.NanduXS;
-            calMonth.S = gspjXS.S;
-            calMonth.A = gspjXS.A;
-            calMonth.B = gspjXS.B;
-            calMonth.C = gspjXS.C;
-            calMonth.D = gspjXS.D;
+            
 
             //未归档,从绩效记录中统计数据
             var results = Context.PerformanceItems.Where<PerformanceItem>(s => s.CalMonth.Id == calMonth.Id);
@@ -588,6 +582,7 @@ namespace wispro.sp.api.Controllers
                         if (temValue != null)
                         {
                             temValue.totalBasePoint += retUserValue.totalBasePoint;
+                            temValue.totalActuallyPoint += retUserValue.totalActuallyPoint;
                         }
                         else
                         {
@@ -603,32 +598,7 @@ namespace wispro.sp.api.Controllers
                 retList = retList.Where<StaffStatistics>(s => s.StaffId == userid.Value).ToList();
             }
 
-            IDictionary<int, NanduStatics> staffXiShu = new Dictionary<int, NanduStatics>();
-            foreach (StaffStatistics ss in retList)
-            {
-                if (ss.jxType.Contains("新申请") || ss.jxType.Contains("专案"))
-                {
-                    if (!staffXiShu.ContainsKey(ss.StaffId))
-                    {
-                        NanduStatics nandu = DegreeOfDifficulty(calMonth, ss.StaffId);
-                        staffXiShu.Add(ss.StaffId, nandu);
-                    }
-
-                    ss.totalActuallyPoint = ss.totalBasePoint * staffXiShu[ss.StaffId].NanduXS / gspjXS.NanduXS;
-                    ss.NanduXS = staffXiShu[ss.StaffId].NanduXS;
-                    ss.S = staffXiShu[ss.StaffId].S;
-                    ss.A = staffXiShu[ss.StaffId].A;
-                    ss.B = staffXiShu[ss.StaffId].B;
-                    ss.C = staffXiShu[ss.StaffId].C;
-                    ss.D = staffXiShu[ss.StaffId].D;
-                }
-                else
-                {
-                    ss.totalActuallyPoint = ss.totalBasePoint;
-                }
-
-                //ss.CalMonth.PerformanceItems = null;
-            }
+           
 
 
             return retList;
@@ -787,6 +757,7 @@ namespace wispro.sp.api.Controllers
             dt.Columns.Add("客户期限", typeof(string));
             dt.Columns.Add("内部期限", typeof(string));
             dt.Columns.Add("初稿日", typeof(string));
+            dt.Columns.Add("翻译字数", typeof(string));
             dt.Columns.Add("备注(发文严重超期是否属客观原因,若为否,请填写原因", typeof(string));
             dt.Columns.Add("绩效类型", typeof(string));
             dt.Columns.Add("案件备注", typeof(string));
@@ -802,7 +773,10 @@ namespace wispro.sp.api.Controllers
             file.Size = items.Count;
             foreach(var p in items)
             {
-                
+                if(p.CaseNo == "PAUS2117245")
+                {
+                    System.Diagnostics.Debug.WriteLine("");
+                }
                 System.Diagnostics.Debug.WriteLine(p.CaseNo);
                 
 
@@ -914,7 +888,15 @@ namespace wispro.sp.api.Controllers
                         row["案件备注"] = $"{row["案件备注"]}\r\n处理人{iStaff.DoPerson.Name}未转正";
                         row["处理人"] = p.Reviewer?.Name;
                         row["处理人等级"] = p.Reviewer?.StaffGrade?.Grade;
-                        row["基本点数"] = (p.BasePoint / total).ToString();
+
+                        if (isPJFP)
+                        {
+                            row["基本点数"] = (p.BasePoint  / total).ToString();
+                        }
+                        else
+                        {
+                            row["基本点数"] = (p.BasePoint * iStaff.PerformancePoint / total).ToString();
+                        }
                         row["处理人绩效系数"] = p.Reviewer?.StaffGrade?.Coefficient;
 
                         var clrJX = jxList.Where(j => j.StaffId == p.ReviewerId && j.jxType.Contains("处理")).FirstOrDefault();
@@ -933,7 +915,15 @@ namespace wispro.sp.api.Controllers
                     {
                         row["处理人"] = iStaff.DoPerson.Name;
                         row["处理人等级"] = iStaff.DoPerson.StaffGrade?.Grade;
-                        row["基本点数"] = (p.BasePoint / total).ToString();
+
+                        if (isPJFP)
+                        {
+                            row["基本点数"] = (p.BasePoint / total).ToString();
+                        }
+                        else
+                        {
+                            row["基本点数"] = (p.BasePoint * iStaff.PerformancePoint / total).ToString();
+                        }
                         row["处理人绩效系数"] = iStaff.DoPerson.StaffGrade?.Coefficient;
                         
 
@@ -1001,6 +991,7 @@ namespace wispro.sp.api.Controllers
                     row["客户期限"] = p.CustomerLimitDate?.ToString("yyyy-MM-dd");
                     row["内部期限"] = p.InternalDate?.ToString("yyyy-MM-dd");
                     row["初稿日"] = p.FirstDraftDate?.ToString("yyyy-MM-dd");
+                    row["翻译字数"] = p.WordCount;
                     row["备注(发文严重超期是否属客观原因,若为否,请填写原因"] = p.OverDueMemo;
                     row["绩效类型"] = p.Type;
                     row["案件备注"] = $"{p.CaseMemo}\r\n{row["案件备注"]}";
@@ -1510,7 +1501,10 @@ namespace wispro.sp.api.Controllers
             
             System.Collections.Hashtable doPersonsBL = new System.Collections.Hashtable();
 
-            
+            if(item.Type == "专案")
+            {
+                System.Diagnostics.Debug.WriteLine("");
+            }
 
             List<StaffStatistics> itemStatistics = new List<StaffStatistics>();
 
@@ -1521,6 +1515,7 @@ namespace wispro.sp.api.Controllers
             }
 
             List<ItemStaff> temIStaffs = new List<ItemStaff>();
+            int syqUsers = 0;
             foreach(var itemStaff in item.ItemStaffs)
             {
                 if (itemStaff.DoPerson == null)
@@ -1528,10 +1523,23 @@ namespace wispro.sp.api.Controllers
                     itemStaff.DoPerson = spDb.Staffs.Include(s => s.StaffGrade).FirstOrDefault(p => p.Id == itemStaff.DoPersonId);
                 }
 
-                if(itemStaff.DoPerson.Status != "试用期")
+                if(itemStaff.DoPerson.Status != "试用期" || !itemStaff.DoPerson.IsCalPerformsnce )
                 {
                     temIStaffs.Add(itemStaff);
                 }
+                else
+                {
+                    syqUsers += 1;
+                }
+            }
+
+            if(syqUsers == item.ItemStaffs.Count)
+            {
+                if(item.Reviewer != null)
+                {
+                    temIStaffs.Add(new ItemStaff() { DoPersonId = item.ReviewerId.Value, ItemId = item.Id });
+                }
+                
             }
 
             bool isPJFP = true;
@@ -1640,13 +1648,15 @@ namespace wispro.sp.api.Controllers
                 var temStatic = itemStatistics.Where<StaffStatistics>(s => s.StaffId == itemStaff.DoPersonId && s.jxType == handlerJxType && s.CalMonth.Id == calMonth.Id).FirstOrDefault();
                 if (temStatic != null)
                 {
-                    if (item.Type == "OA" || item.Type =="新申请")
+                    temStatic.totalBasePoint += handlerBasePoint;
+
+                    if (item.Type == "OA" || item.Type == "新申请")
                     {
-                        temStatic.totalBasePoint += handlerBasePoint * itemStaff.DoPerson.StaffGrade.Coefficient;
+                        temStatic.totalActuallyPoint += handlerBasePoint * itemStaff.DoPerson.StaffGrade.Coefficient;
                     }
                     else
                     {
-                        temStatic.totalBasePoint += handlerBasePoint;
+                        temStatic.totalActuallyPoint += handlerBasePoint;
                     }
                 }
                 else
@@ -1662,7 +1672,8 @@ namespace wispro.sp.api.Controllers
                                     CalMonth = calMonth,
                                     CalMonthId = calMonth.Id,
                                     StaffId = item.Reviewer.Id,
-                                    totalBasePoint = handlerBasePoint * item.Reviewer.StaffGrade.Coefficient,
+                                    totalActuallyPoint= handlerBasePoint * item.Reviewer.StaffGrade.Coefficient,
+                                    totalBasePoint = handlerBasePoint,
                                     jxType = handlerJxType
                                 };
 
@@ -1677,11 +1688,11 @@ namespace wispro.sp.api.Controllers
                                     CalMonth = calMonth,
                                     CalMonthId = calMonth.Id,
                                     StaffId = itemStaff.DoPersonId,
-                                    totalBasePoint = handlerBasePoint * itemStaff.DoPerson.StaffGrade.Coefficient,
+                                    totalActuallyPoint = handlerBasePoint * itemStaff.DoPerson.StaffGrade.Coefficient,
+                                    totalBasePoint = handlerBasePoint,
                                     jxType = handlerJxType
                                 };
 
-
                                 itemStatistics.Add(temStatic);
                             }
                         }
@@ -1693,10 +1704,10 @@ namespace wispro.sp.api.Controllers
                                 CalMonthId = calMonth.Id,
                                 StaffId = itemStaff.DoPersonId,
                                 totalBasePoint = handlerBasePoint,
+                                totalActuallyPoint = handlerBasePoint,
                                 jxType = handlerJxType
                             };
 
-
                             itemStatistics.Add(temStatic);
                         }
                     }
@@ -1707,14 +1718,92 @@ namespace wispro.sp.api.Controllers
             return itemStatistics;
         }
 
+        /// <summary>
+        /// 新申请/专案: 
+        ///     调整点数 = 分配比例点数/分配比例点数之和*总点数
+        ///     等级调整点数+项目组点数之和 =  基础点数 * 代理人等级系数 + 项目组案件调整点数
+        ///     分配比例点数 = 个人平均难度系数 / 总平均难度系数 *(等级调整点数+项目组点数之和)
+        ///     总点数=等级调整点数+项目组点数之和+奖励点数
+        ///     奖励点数= S案数量*1.5 + A案数量 * 0.5
+        ///     难度系数=(S案数量*2.5 + A案数量* 1.5 + B案数量*1.0 + C案数量*0.7+ D案数量*0.4) / 总案件数量
+        ///     总案件数量= S案数量 + A案数量 + B案数量 + C案数量+ D案数量
+        /// OA :  
+        ///     调整点数=  基础点数 * 等级系数
+        /// 其他:  
+        ///     直接加和基础点数 不需要乘以系数
+        /// </summary>
+        /// <param name="year"></param>
+        /// <param name="month"></param>
+        /// <returns></returns>
         public ApiSaveResponse FinishedCalMonth(int year,int month)
         {
             CalMonth calMonth = Context.CalMonths.Where<CalMonth>(c => c.Month == month && c.Year == year).FirstOrDefault();
 
             if (calMonth != null || calMonth.Status !=4)
             {
+                NanduStatics gspjXS = DegreeOfDifficulty(calMonth);
+                calMonth.NanduXS = gspjXS.NanduXS;
+                calMonth.S = gspjXS.S;
+                calMonth.A = gspjXS.A;
+                calMonth.B = gspjXS.B;
+                calMonth.C = gspjXS.C;
+                calMonth.D = gspjXS.D;
+
                 var retList = _CalMyStatistics(calMonth);
 
+                double? totalActualPoint = retList.Where(s => s.jxType.Contains("新申请") || s.jxType.Contains("专案")).Sum(s => s.totalActuallyPoint);
+
+                #region 奖励点数
+                if (calMonth.S.HasValue)
+                {
+                    totalActualPoint = totalActualPoint + (calMonth.S.Value * 1.5);
+                }
+
+                if (calMonth.A.HasValue)
+                {
+                    totalActualPoint = totalActualPoint + (calMonth.S.Value * 0.5);
+                }
+                #endregion
+
+                double? totalFPBLPoint = 0; //分配比率总点数
+
+                #region 难度系数
+                IDictionary<int, NanduStatics> staffXiShu = new Dictionary<int, NanduStatics>();
+                foreach (StaffStatistics ss in retList)
+                {
+                    if (ss.jxType.Contains("新申请") || ss.jxType.Contains("专案"))
+                    {
+                        if (!staffXiShu.ContainsKey(ss.StaffId))
+                        {
+                            NanduStatics nandu = DegreeOfDifficulty(calMonth, ss.StaffId);
+                            staffXiShu.Add(ss.StaffId, nandu);
+                        }
+
+                        ss.FinianlPoint  = ss.totalActuallyPoint * staffXiShu[ss.StaffId].NanduXS / gspjXS.NanduXS;
+                        totalFPBLPoint += ss.FinianlPoint;
+                        ss.NanduXS = staffXiShu[ss.StaffId].NanduXS;
+                        ss.S = staffXiShu[ss.StaffId].S;
+                        ss.A = staffXiShu[ss.StaffId].A;
+                        ss.B = staffXiShu[ss.StaffId].B;
+                        ss.C = staffXiShu[ss.StaffId].C;
+                        ss.D = staffXiShu[ss.StaffId].D;
+                    }
+                    else
+                    {
+                        ss.FinianlPoint = ss.totalActuallyPoint;
+                    }
+                }
+
+                foreach(StaffStatistics ss in retList)
+                {
+                    if (ss.jxType.Contains("新申请") || ss.jxType.Contains("专案"))
+                    {
+                        ss.FinianlPoint = ss.FinianlPoint / totalFPBLPoint * totalActualPoint;
+                        
+                    }
+                }
+                #endregion
+
                 using (var t = Context.Database.BeginTransaction())
                 {
                     try

+ 21 - 4
wispro.sp.api/Controllers/ReportController.cs

@@ -56,7 +56,7 @@ namespace wispro.sp.api.Controllers
                     
                     foreach (var key in retData.Keys)
                     {
-                        retDatas.Datas.Add(new ChartData() { ColumnA = key,value=retData[key]} );
+                        retDatas.Datas.Add(new ChartData() { type = key,value=retData[key]} );
                     }
                     return retDatas;
                     break;
@@ -71,7 +71,7 @@ namespace wispro.sp.api.Controllers
                     
                     foreach (var key in retData1.Keys)
                     {
-                        retDatas.Datas.Add(new ChartData() { ColumnA = key, value = retData1[key] });
+                        retDatas.Datas.Add(new ChartData() { type = key, value = retData1[key] });
                     }
                     return retDatas;
                     break;
@@ -86,7 +86,7 @@ namespace wispro.sp.api.Controllers
 
                     foreach (var key in retData2.Keys)
                     {
-                        retDatas.Datas.Add(new ChartData() { ColumnA = key, value = retData2[key] });
+                        retDatas.Datas.Add(new ChartData() { type = key, value = retData2[key] });
                     }
                     return retDatas;
                     break;
@@ -102,11 +102,28 @@ namespace wispro.sp.api.Controllers
 
                     foreach (var key in retData3.Keys)
                     {
-                        retDatas.Datas.Add(new ChartData() { ColumnA = key.Name, ColumnB = $"{key.Year}-{key.Month}", value = retData3[key] });
+                        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 })
+                        .Select(g => new { key = g.Key, Count = g.Count() }).OrderByDescending(g => g.Count)
+                        .ToDictionary(g => g.key, g => g.Count);
+
+                    retDatas.ATitle = "申诉类型";
+                    retDatas.BTitle = "绩效月份";
+                    retDatas.Title = "申诉类型每月申诉统计";
+                    retDatas.Datas = new List<ChartData>();
+
+                    foreach (var key in retData4.Keys)
+                    {
+                        retDatas.Datas.Add(new ChartData() { type = key.Name, year = $" {DateTime.Parse($"{key.Year}-{key.Month}-1").ToString("yyyy-MM")}", value = retData4[key] });
+                    }
+                    return retDatas;
+
+                    break;
                 default:
                     return null;
                     break;

+ 29 - 6
wispro.sp.api/Job/ImportReportJob.cs

@@ -453,11 +453,11 @@ namespace wispro.sp.api.Job
                 }
             }
 
-            if (row.Table.Columns.Contains("流程负责人"))
+            if (row.Table.Columns.Contains("业务人员"))
             {
-                item.WorkflowUserId  = GetStaff(row["流程负责人"].ToString().Trim());
+                item.WorkflowUserId = GetStaff(row["业务人员"].ToString().Trim());
             }
-           
+
             return item;
         }
         private PerformanceItem Row2Item_2(DataRow row, CalMonth calMonth)
@@ -565,10 +565,17 @@ namespace wispro.sp.api.Job
                 }
             }
 
-            if (row.Table.Columns.Contains("流程负责人"))
+            if (row.Table.Columns.Contains("业务人员"))
             {
-                item.WorkflowUserId = GetStaff(row["流程负责人"].ToString().Trim());
+                if (!string.IsNullOrEmpty(row["业务人员"].ToString().Trim()))
+                {
+                    string temName = row["业务人员"].ToString().Trim().Split(new char[] { '-' }, StringSplitOptions.RemoveEmptyEntries)[0];
+                    item.WorkflowUserId = GetStaff(temName);
+                }
             }
+            
+
+            
 
             return item;
         }
@@ -677,6 +684,15 @@ namespace wispro.sp.api.Job
                 }
             }
 
+            if (row.Table.Columns.Contains("业务人员"))
+            {
+                if (!string.IsNullOrEmpty(row["业务人员"].ToString().Trim()))
+                {
+                    string temName = row["业务人员"].ToString().Trim().Split(new char[] { '-' }, StringSplitOptions.RemoveEmptyEntries)[0];
+                    item.WorkflowUserId = GetStaff(temName);
+                }
+            }
+
             item.Customer = new Customer() { Name = row["客户名称"].ToString().Trim() };
             item.ApplicationName = row["申请人"].ToString().Trim();
             item.CaseName = row["案件名称"].ToString().Trim();
@@ -815,7 +831,14 @@ namespace wispro.sp.api.Job
                 }
             }
 
-
+            if (row.Table.Columns.Contains("业务人员"))
+            {
+                if (!string.IsNullOrEmpty(row["业务人员"].ToString().Trim()))
+                {
+                    string temName = row["业务人员"].ToString().Trim().Split(new char[] { '-' }, StringSplitOptions.RemoveEmptyEntries)[0];
+                    item.WorkflowUserId = GetStaff(temName);
+                }
+            }
 
 
             item.Customer = new Customer() { Name = row["客户名称"].ToString().Trim() };

+ 1 - 0
wispro.sp.api/Job/InvalidDataMessageJob.cs

@@ -53,6 +53,7 @@ namespace wispro.sp.api.Job
                     row["基础点数"] = p.BasePoint;
                     row["绩效类型"] = p.Type;
                     row["备注"] = p.CaseMemo;
+                    row["业务人员"] = p.WorkflowUser?.Name;
 
                     dt.Rows.Add(row);
                 }

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

@@ -12,10 +12,11 @@ namespace wispro.sp.api.Utility
     {
         public static void CalBasePoint(PerformanceItem item, List<BasePointRule> rules)
         {
-            if(item.CaseNo == "PAUS2116474")
+            if(item.CaseNo == "PAUS2117047")
             {
                 System.Diagnostics.Debug.WriteLine("");
             }
+
             if (item.CaseNo.ToUpper().StartsWith("S"))
             {
                 return;

+ 4 - 4
wispro.sp.share/ChartData.cs

@@ -8,13 +8,13 @@ namespace wispro.sp.share
 {
     public class ChartData
     {
-        public string ColumnA { get; set; }
+        public string type { get; set; }
 
-        public string CustomerColumnA { get; set; }
+        public string CustomerType { get; set; }
 
-        public string ColumnB { get; set; }
+        public string year { get; set; }
 
-        public string CustomerColumnB { get; set; }
+        public string CustomerYear { get; set; }
 
         public double value { get; set; }
     }

+ 10 - 2
wispro.sp.web/Layouts/BasicLayout.razor

@@ -123,11 +123,19 @@
             {
                 new MenuDataItem
                 {
-                    Path ="/Report/PieChart",
-                    Name ="申诉类型统计",
+                    Path ="/Report/SingleChart",
+                    Name ="申诉单选统计",
                     Key= "appealType",
                     Icon = "pie-chart"
+                },
+                new MenuDataItem
+                {
+                    Path ="/Report/AppealTrend",
+                    Name ="申诉趋势统计",
+                    Key= "appealTrend",
+                    Icon = "line-chart"
                 }
+                
             }
         },
         new MenuDataItem

+ 1 - 1
wispro.sp.web/Pages/AppCase/MyCaselist.razor

@@ -102,7 +102,7 @@
                                     <AntDesign.Col Span="4" style="border:1px solid #000000"><center>@GetStatistics("ALL", true)</center></AntDesign.Col>
                                 </AntDesign.Row>
                                 <AntDesign.Row>
-                                    <AntDesign.Col Span="2" style="border:1px solid #000000"><center>调整点数</center></AntDesign.Col>
+                                    <AntDesign.Col Span="2" style="border:1px solid #000000"><center>等级调整点数</center></AntDesign.Col>
                                     <AntDesign.Col Span="2" style="border:1px solid #000000"><center>@GetStatistics("新申请处理")</center></AntDesign.Col>
                                     <AntDesign.Col Span="2" style="border:1px solid #000000"><center>@GetStatistics("新申请审核")</center></AntDesign.Col>
                                     <AntDesign.Col Span="2" style="border:1px solid #000000"><center>@GetStatistics("OA处理")</center></AntDesign.Col>

+ 87 - 0
wispro.sp.web/Pages/Report/AppealTrend.razor

@@ -0,0 +1,87 @@
+@page  "/Report/AppealTrend"
+
+<PageContainer>
+    <Breadcrumb>
+        <Breadcrumb>
+            <BreadcrumbItem>
+                <a href="/Home"><Icon Type="home"></Icon></a>
+            </BreadcrumbItem>
+            <BreadcrumbItem>
+                <span>申诉单项统计</span>
+            </BreadcrumbItem>
+        </Breadcrumb>
+    </Breadcrumb>
+    <Content>
+        <Space>
+            <SpaceItem>统计类型:</SpaceItem>
+            <SpaceItem>
+                <Select DataSource="@Types"
+                        @bind-Value="@iType"
+                        LabelName="@nameof(TJType.Name)"
+                        ValueName="@nameof(TJType.value)"
+                        Placeholder="请选择统计类型">
+                </Select>
+            </SpaceItem>
+            <SpaceItem>申诉开始时间</SpaceItem>
+            <SpaceItem>
+                <RangePicker TValue="DateTime?[]" Picker="@DatePickerType.Month" DefaultValue="new DateTime?[] { start, end }" OnChange="OnTimeRangeChange" />
+            </SpaceItem>
+            <SpaceItem><Button Icon="search" Loading="_noIconLoading" OnClick="OnButtonClick">开始统计</Button></SpaceItem>
+        </Space>
+    </Content>
+    <ChildContent>
+        <div>
+            @if (Datas == null)
+            {
+
+            }
+            else
+            {
+            <div>
+                <AntDesign.Charts.Line Data="Datas.Datas" Config="config" @ref="@chart" />
+
+            <center>
+
+            @{
+                System.Data.DataTable tableData = GetTableData(Datas);
+
+                <table width="80%" border="1">
+                    <thead>
+                    <th>序号</th>
+
+                    @foreach (System.Data.DataColumn column in tableData.Columns)
+                    {
+                        <th>@column.ColumnName</th>
+                    }
+
+                    </thead>
+                    <tbody>
+                        @{
+                            int iIndex = 1;
+                            foreach (System.Data.DataRow row in tableData.Rows)
+                            {
+                                <tr>
+                                    <td style="text-align: center;">@iIndex</td>
+
+                                    @foreach (System.Data.DataColumn column in tableData.Columns)
+                                    {
+                                        <td>@row[column.ColumnName].ToString()</td>
+                                    }
+                                </tr>
+                                iIndex++;
+                            }
+                        }
+                    </tbody>
+                </table>
+             }
+
+
+                    
+                </center>
+            </div>
+            }
+        </div>
+    </ChildContent>
+</PageContainer>
+
+

+ 225 - 0
wispro.sp.web/Pages/Report/AppealTrend.razor.cs

@@ -0,0 +1,225 @@
+using AntDesign;
+using AntDesign.Charts;
+using Microsoft.AspNetCore.Components;
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Linq;
+using System.Text.Json;
+using System.Threading.Tasks;
+using wispro.sp.share;
+using wispro.sp.web.Services;
+
+namespace wispro.sp.web.Pages.Report
+{
+    public partial class AppealTrend
+    {
+        private int iType = 3;
+        private DateTime? start = new DateTime(DateTime.Now.Year, 1, 1);
+        private DateTime? end = DateTime.Now;
+
+        internal class TJType
+        {
+            public string Name { get; set; }
+
+            public int value { get; set; }
+        }
+        List<TJType> Types = new List<TJType>
+        {
+            new TJType { value = 3,Name = "申诉人统计" },
+            new TJType { value = 4,Name = "申诉类型统计" },
+            new TJType { value = 4,Name = "部门申诉统计" },
+            
+        };
+
+        share.ChartDatas Datas = new share.ChartDatas()
+        {
+            Title = "初始化标题",
+            Datas = new List<share.ChartData>() {
+                new share.ChartData(){ type ="部门一", value =1, year="2022-01", CustomerType ="", CustomerYear=""},
+                new share.ChartData(){ type ="部门一",value =5, year="2022-02",CustomerType ="", CustomerYear=""},
+                new share.ChartData(){ type ="部门二", value =3, year="2022-01", CustomerType ="", CustomerYear=""},
+                new share.ChartData(){ type ="部门二",value =4, year="2022-02",CustomerType ="", CustomerYear=""},
+                new share.ChartData(){ type ="部门三",value =2.5, year="2022-02",CustomerType ="", CustomerYear=""}
+            },
+            ATitle = "部门",
+            BTitle = "申诉月份"
+        };
+
+        LineConfig config = new LineConfig
+        {
+            Title = new AntDesign.Charts.Title
+            {
+                Visible = true,
+                Text = "带数据点的折线图"
+            },
+            ForceFit = true,
+
+            Padding = "auto",
+            XField = "year",
+            YField = "value",
+            SeriesField = "type",
+            
+            Point = new LineViewConfigPoint
+            {
+                Visible = true
+            },
+            Label = new Label
+            {
+                Visible = true,
+                Type = "point"
+            },
+            Legend = new Legend
+            {
+                Visible = false,
+                Position = "bottom",
+            },
+           
+            XAxis = new ValueCatTimeAxis
+            {
+                Type="time",
+                //Visible= true,
+                //Label = new BaseAxisLabel()
+                //{
+                //    AutoRotate = true
+                //},
+                //Title = new BaseAxisTitle()
+                //{
+                //    Text = "绩效月份",
+                //    AutoRotate = true
+                //}
+            },
+            YAxis = new ValueAxis
+            {
+                Label = new BaseAxisLabel()
+                {
+                    AutoRotate=true
+                },
+                Title = new BaseAxisTitle()
+                {
+                    Visible=true,
+                    Text = "申诉数量"
+                }
+            }
+        };
+
+
+        [Inject] ReportService reportService { get; set; }
+
+        [Inject] MessageService msgService { get; set; }
+
+        private AntDesign.Charts.IChartComponent chart;
+
+        private void OnTimeRangeChange(DateRangeChangedEventArgs args)
+        {
+            msgService.Info($"Selected Time: {JsonSerializer.Serialize(args.Dates)}");
+            Console.WriteLine($"Selected Time: {JsonSerializer.Serialize(args.Dates)}");
+            Console.WriteLine($"Formatted Selected Time: {JsonSerializer.Serialize(args.DateStrings)}");
+
+            if (args.Dates?.Length > 0)
+            {
+                Console.WriteLine(args.Dates[0]);
+                start = args.Dates[0];
+            }
+
+            if (args.Dates?.Length > 1)
+            {
+                Console.WriteLine(args.Dates[1]);
+                end = args.Dates[1];
+            }
+
+        }
+
+        private bool _noIconLoading;
+        private async Task OnButtonClick()
+        {
+            _noIconLoading = true;
+            Datas = await reportService.GetAppealReportData(iType, start, end, null);
+
+            if (Datas != null)
+            {
+                config.Title.Text = Datas.Title;
+                config.XField = Datas.ATitle;
+                await chart.ChangeData(Datas.Datas);
+                await chart.UpdateChart(config);
+                StateHasChanged();
+            }
+            _noIconLoading = false;
+        }
+
+        protected async override Task OnInitializedAsync()
+        {
+            //Datas = await reportService.GetAppealReportData(iType, DateTime.Parse("2022-01-01"), DateTime.Now, null);
+
+            if (Datas != null)
+            {
+                config.Title.Text = Datas.Title;
+                
+                await chart.ChangeData(Datas.Datas);
+                await chart.UpdateChart(config);
+                StateHasChanged();
+            }
+
+            await base.OnInitializedAsync();
+        }
+
+        private List<string> GetColumns(List<ChartData> chartDatas)
+        {
+            List<string> retColumns = new List<string>();
+
+            foreach(var cData in chartDatas)
+            {
+                if (!retColumns.Contains(cData.year))
+                {
+                    retColumns.Add(cData.year);
+                }
+            }
+
+            retColumns.Sort();
+
+            return retColumns;
+        }
+
+        private DataTable GetTableData(ChartDatas chartDatas)
+        {
+            DataTable retTable = new DataTable();
+            List<string> Columns = GetColumns(chartDatas.Datas);
+            retTable.Columns.Add(chartDatas.ATitle);
+
+            foreach(string col in Columns)
+            {
+                retTable.Columns.Add(col);
+            }
+
+            foreach(var cData in chartDatas.Datas)
+            {
+                int iIndex = Columns.IndexOf(cData.year);
+
+                DataRow row = null;
+                foreach(DataRow temRow in retTable.Rows)
+                {
+                    if(temRow[chartDatas.ATitle].ToString()== cData.type)
+                    {
+                        row = temRow;
+                        break;
+                    }
+                }
+
+                if (row!= null)
+                {
+                    row[cData.year] = cData.value;
+                }
+                else
+                {
+                    row = retTable.NewRow();
+                    row[chartDatas.ATitle] = cData.type;
+                    row[cData.year] = cData.value;
+                    retTable.Rows.Add(row);
+                    
+                }
+            }
+
+            return retTable;
+        }
+    }
+}

+ 46 - 5
wispro.sp.web/Pages/Report/PieChart.razor

@@ -1,4 +1,4 @@
-@page  "/Report/PieChart"
+@page  "/Report/SingleChart"
 
 <PageContainer>
     <Breadcrumb>
@@ -7,11 +7,28 @@
                 <a href="/Home"><Icon Type="home"></Icon></a>
             </BreadcrumbItem>
             <BreadcrumbItem>
-                <span>报表</span>
+                <span>申诉单项统计</span>
             </BreadcrumbItem>
         </Breadcrumb>
     </Breadcrumb>
-    <Content></Content>
+    <Content>
+        <Space>
+            <SpaceItem>统计类型:</SpaceItem>
+            <SpaceItem>
+                <Select DataSource="@Types"
+                        @bind-Value="@iType"
+                        LabelName="@nameof(TJType.Name)"
+                        ValueName="@nameof(TJType.value)"
+                        Placeholder="请选择统计类型">
+                </Select>
+            </SpaceItem>
+            <SpaceItem>申诉开始时间</SpaceItem>
+            <SpaceItem>
+                <RangePicker TValue="DateTime?[]" DefaultValue="new DateTime?[] { start, end }" OnChange="OnTimeRangeChange"/>
+            </SpaceItem>
+            <SpaceItem><Button Icon="search" Loading="_noIconLoading" OnClick="OnButtonClick">开始统计</Button></SpaceItem>
+        </Space>
+    </Content>
     <ChildContent>
         <div>
             @if (Datas == null)
@@ -20,9 +37,33 @@
             }
             else
             {
+            <div>
                 <Pie Data="Datas.Datas" Config="config4" @ref="@chart" />
-                //chart.ChangeData(Datas.Datas);
-                //chart.UpdateConfig(config4);
+                <center>
+                    <table width="80%" border="1">
+                        <thead>
+                        <th>序号</th>
+                        <th>@Datas.ATitle</th>
+                        <th>数量</th>
+                        </thead>
+                        <tbody>
+                            @{
+                                int iIndex = 1;
+                                foreach (var cData in Datas.Datas)
+                                {
+                                    <tr>
+                                        <td style="text-align: center;">@iIndex</td>
+                                        <td>@cData.type</td>
+                                        <td style="text-align: center;">@cData.value</td>
+                                    </tr>
+                                    iIndex++;
+                                }
+                            }
+                        </tbody>
+                        
+                    </table>
+                </center>
+            </div>
             }
         </div>
     </ChildContent>

+ 87 - 14
wispro.sp.web/Pages/Report/PieChart.razor.cs

@@ -1,8 +1,10 @@
-using AntDesign.Charts;
+using AntDesign;
+using AntDesign.Charts;
 using Microsoft.AspNetCore.Components;
 using System;
 using System.Collections.Generic;
 using System.Linq;
+using System.Text.Json;
 using System.Threading.Tasks;
 using wispro.sp.web.Services;
 
@@ -10,15 +12,40 @@ namespace wispro.sp.web.Pages.Report
 {
     public partial class PieChart
     {
+        private int iType = 1;
+        private DateTime? start = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1);
+        private DateTime? end = DateTime.Now;
+
+        internal class TJType
+        {
+            public string Name { get; set; }
+
+            public int value { get; set; }
+        }
+        List<TJType> Types = new List<TJType>
+        {
+            new TJType { value  = 0,Name = "申诉人统计" },
+            new TJType { value  = 1,Name = "申诉类型统计" },
+            new TJType { value = 2, Name = "部门申诉统计" },
+            //new TJType { value = 3, Name = "申诉人每月申诉统计" },
+        };
+        
         private AntDesign.Charts.IChartComponent chart;
         private PieConfig config4 = new PieConfig
         {
             ForceFit = true,
-            Title = new Title
+            Title = new AntDesign.Charts.Title
             {
                 Visible = true,
-                Text = "Pie Chart-Graphic Tab Spider Layout",
-                AlignTo= "left"
+                Text = "初始化标题",
+                AlignTo = "middle",
+                Style= new TextStyle()
+                {
+                    FontSize=20, 
+                    Stroke="#2a3b4c",
+                    Fill = "#AABBDD",
+                    Opacity= 10
+                }
             },
             Description = new Description
             {
@@ -26,40 +53,52 @@ namespace wispro.sp.web.Pages.Report
                 Text = "When the type of the pie chart label is set to spider, the labels are divided into two groups, and they are displayed in alignment by pulling lines on both sides of the chart. Generally speaking, the labels of the spider layout are less likely to block each other."
             },
             Radius = 0.8,
+            InnerRadius =0.5,
             AngleField = "value",
-            ColorField = "ColumnA",
+            ColorField = "type",            
             Label = new PieLabelConfig
             {
                 Visible = true,
-                Type = "spider"
+                Type = "spider",//"inner",//"outer"//,
+                //Formatter= "() => $'{(percent * 100).toFixed(0)}%'",
+            },
+            Legend= new Legend
+            {
+                Visible=false,
+                Position= "bottom",
             }
         };
 
-        
-
-        private share.ChartDatas Datas=new share.ChartDatas() { 
+        share.ChartDatas Datas=new share.ChartDatas() { 
             Title ="初始化标题",
             Datas = new List<share.ChartData>() { 
-                new share.ChartData(){ ColumnA ="A",value =1}
+                new share.ChartData(){ type ="A", value =1, year="", CustomerType ="", CustomerYear=""},
+                new share.ChartData(){ type ="B",value =5, year="",CustomerType ="", CustomerYear=""}
             },
-            ATitle =""
+            ATitle ="ATitle",
+            BTitle="",
         };
 
+        List<object> ShowData = new List<object>()
+        {
+            new {type="A",value=1},
+            new {type="B",value=5}
+        };
         
 
         [Inject] ReportService reportService { get; set; }
 
+        [Inject] MessageService msgService { get; set; }
+
         [Obsolete]
         protected async override Task OnInitializedAsync()
         {
-            Datas = await reportService.GetAppealReportData(1,DateTime.Parse("2022-02-01"),null,null);
+            Datas = await reportService.GetAppealReportData(1, DateTime.Parse("2022-02-01"), null, null);
 
             if (Datas != null)
             {
-
                 config4.Title.Text = Datas.Title;
                 config4.XField = Datas.ATitle;
-
                 await chart.ChangeData(Datas.Datas);
                 await chart.UpdateChart(config4);
                 StateHasChanged();
@@ -67,5 +106,39 @@ namespace wispro.sp.web.Pages.Report
 
             await base.OnInitializedAsync();
         }
+
+        private void OnTimeRangeChange(DateRangeChangedEventArgs args)
+        {
+            msgService.Info($"Selected Time: {JsonSerializer.Serialize(args.Dates)}");
+            Console.WriteLine($"Selected Time: {JsonSerializer.Serialize(args.Dates)}");
+            Console.WriteLine($"Formatted Selected Time: {JsonSerializer.Serialize(args.DateStrings)}");
+
+            if (args.Dates?.Length > 0){
+                start = args.Dates[0];
+            }
+
+            if (args.Dates?.Length > 1)
+            {
+                end = args.Dates[1];
+            }
+            
+        }
+
+        private bool _noIconLoading;
+        private async Task OnButtonClick()
+        {
+            _noIconLoading = true;
+            Datas = await reportService.GetAppealReportData(iType, start, end, null);
+
+            if (Datas != null)
+            {
+                config4.Title.Text = Datas.Title;
+                config4.XField = Datas.ATitle;
+                await chart.ChangeData(Datas.Datas);
+                await chart.UpdateChart(config4);
+                StateHasChanged();
+            }
+            _noIconLoading = false;
+        }
     }
 }

+ 63 - 44
wispro.sp.winClient/Form1.cs

@@ -770,7 +770,7 @@ namespace wispro.sp.winClient
             return retStr;
         }
 
-        string strAPIBaseUri = "http://localhost:39476";// "https://47.106.221.167"; // 
+        string strAPIBaseUri = "https://47.106.221.167"; // "http://localhost:39476";//
 
         userToken Token;
 
@@ -796,7 +796,7 @@ namespace wispro.sp.winClient
                 file.Write(data, 0, data.Length);
             }
                 
-
+            
             #region aaa
             //DataTable dt = utility.NPOIExcel.ExcelToDataTable("C:\\temp\\userList.xlsx", true, false, 0);
 
@@ -1028,50 +1028,69 @@ namespace wispro.sp.winClient
         {
             Stopwatch watch = new Stopwatch();
             watch.Start();
-           
-            dynamic retObj = wispro.sp.utility.IPEasyUtility.GetPerformanceRecord("S2112392-洗碗机调查分析","提出报告");
-            PerformanceItem Item = new PerformanceItem();
-            Item.CaseName = retObj.CaseName;
-            Item.CaseNo = retObj.CaseNo;
-            Item.DoItem = retObj.DoItem;
-
-            Item.CustomerLimitDate = string.IsNullOrEmpty(retObj.CustomerLimitDate) ? null : DateTime.Parse(retObj.CustomerLimitDate);
-            Item.Customer = new Customer();
-            Item.Customer.Name = retObj.CustomerName;
-            Item.DoItemCoefficient = retObj.DoItemCoefficient;
-            Item.DoItemMemo = retObj.DoItemMemo;
-            Item.DoItemState = retObj.DoItemState;
-            Item.EntrustingDate = string.IsNullOrEmpty(retObj.EntrustingDate) ? null : DateTime.Parse(retObj.EntrustingDate);
-            Item.FinalizationDate = string.IsNullOrEmpty(retObj.FinalizationDate) ? null : DateTime.Parse(retObj.FinalizationDate);
-            Item.FinishedDate = string.IsNullOrEmpty(retObj.FinishedDate) ? null : DateTime.Parse(retObj.FinishedDate);
-            //Item.FirstDraftDate = string.IsNullOrEmpty(retObj.FirstDraftDate) ? null : DateTime.Parse(retObj.FirstDraftDate);
-            Item.InternalDate = string.IsNullOrEmpty(retObj.InternalDate) ? null : DateTime.Parse(retObj.InternalDate);
-            
-            if (!string.IsNullOrEmpty(retObj.DoPersons))
-            {
-                Item.ItemStaffs = new List<ItemStaff>();
-                string[] names = retObj.DoPersons.ToString().Split(new char[] { ','},StringSplitOptions.RemoveEmptyEntries);
-                foreach(var name in names)
-                {
-                    ItemStaff iStaff = new ItemStaff();
-                    iStaff.DoPerson = new Staff() { Name = name };
-                    Item.ItemStaffs.Add(iStaff);
-                }
-            }
 
-            Item.ReturnDate = string.IsNullOrEmpty(retObj.ReturnDate) ? null : DateTime.Parse(retObj.ReturnDate);
+            //每月绩效统计--发客户超过一个月未完成案件
+            //DownloadReport("每月绩效统计--发客户超过一个月未完成案件", calMonth, false);
 
-            if (!string.IsNullOrEmpty(retObj.Reviewer))
-            {
-                Item.Reviewer = new Staff() { Name = retObj.Reviewer };
-            }
-            Item.ApplicationType = retObj.ApplicationType;
-            Item.BusinessType = retObj.BusinessType;
-            Item.CaseCoefficient = retObj.CaseCoefficient;
-            Item.CaseMemo = retObj.CaseMemo;
-            Item.CaseStage = retObj.CaseStage;
-            Item.CaseState = retObj.CaseState;
-            Item.CaseType = retObj.CaseType;
+            //每月绩效统计--上个月递交完成案件
+            //DownloadReport("每月绩效统计--上个月递交完成案件", calMonth, true);
+
+            //每月绩效统计--中国一次OA授权表
+            //DownloadReport("每月绩效统计--中国一次OA授权表", calMonth, true, true);
+
+            //"每月绩效统计--专案进度跟踪~S卷", "每月绩效统计--专案开卷报表~S卷"
+
+            wispro.sp.utility.IPEasyUtility.DownloadReport("每月绩效统计--发客户超过一个月未完成案件", false);
+            wispro.sp.utility.IPEasyUtility.DownloadReport("每月绩效统计--上个月递交完成案件", true);
+            wispro.sp.utility.IPEasyUtility.DownloadReport("每月绩效统计--中国一次OA授权表", true);
+            wispro.sp.utility.IPEasyUtility.DownloadReport("每月绩效统计--专案进度跟踪~S卷", false);
+            wispro.sp.utility.IPEasyUtility.DownloadReport("每月绩效统计--专案开卷报表~S卷", false);
+
+            #region aaa
+            //dynamic retObj = wispro.sp.utility.IPEasyUtility.GetPerformanceRecord("S2112392-洗碗机调查分析","提出报告");
+            //PerformanceItem Item = new PerformanceItem();
+            //Item.CaseName = retObj.CaseName;
+            //Item.CaseNo = retObj.CaseNo;
+            //Item.DoItem = retObj.DoItem;
+
+            //Item.CustomerLimitDate = string.IsNullOrEmpty(retObj.CustomerLimitDate) ? null : DateTime.Parse(retObj.CustomerLimitDate);
+            //Item.Customer = new Customer();
+            //Item.Customer.Name = retObj.CustomerName;
+            //Item.DoItemCoefficient = retObj.DoItemCoefficient;
+            //Item.DoItemMemo = retObj.DoItemMemo;
+            //Item.DoItemState = retObj.DoItemState;
+            //Item.EntrustingDate = string.IsNullOrEmpty(retObj.EntrustingDate) ? null : DateTime.Parse(retObj.EntrustingDate);
+            //Item.FinalizationDate = string.IsNullOrEmpty(retObj.FinalizationDate) ? null : DateTime.Parse(retObj.FinalizationDate);
+            //Item.FinishedDate = string.IsNullOrEmpty(retObj.FinishedDate) ? null : DateTime.Parse(retObj.FinishedDate);
+            ////Item.FirstDraftDate = string.IsNullOrEmpty(retObj.FirstDraftDate) ? null : DateTime.Parse(retObj.FirstDraftDate);
+            //Item.InternalDate = string.IsNullOrEmpty(retObj.InternalDate) ? null : DateTime.Parse(retObj.InternalDate);
+
+            //if (!string.IsNullOrEmpty(retObj.DoPersons))
+            //{
+            //    Item.ItemStaffs = new List<ItemStaff>();
+            //    string[] names = retObj.DoPersons.ToString().Split(new char[] { ','},StringSplitOptions.RemoveEmptyEntries);
+            //    foreach(var name in names)
+            //    {
+            //        ItemStaff iStaff = new ItemStaff();
+            //        iStaff.DoPerson = new Staff() { Name = name };
+            //        Item.ItemStaffs.Add(iStaff);
+            //    }
+            //}
+
+            //Item.ReturnDate = string.IsNullOrEmpty(retObj.ReturnDate) ? null : DateTime.Parse(retObj.ReturnDate);
+
+            //if (!string.IsNullOrEmpty(retObj.Reviewer))
+            //{
+            //    Item.Reviewer = new Staff() { Name = retObj.Reviewer };
+            //}
+            //Item.ApplicationType = retObj.ApplicationType;
+            //Item.BusinessType = retObj.BusinessType;
+            //Item.CaseCoefficient = retObj.CaseCoefficient;
+            //Item.CaseMemo = retObj.CaseMemo;
+            //Item.CaseStage = retObj.CaseStage;
+            //Item.CaseState = retObj.CaseState;
+            //Item.CaseType = retObj.CaseType;
+            #endregion
 
             watch.Stop();
             System.Diagnostics.Debug.WriteLine("用时{0}毫秒", watch.ElapsedMilliseconds);//获取当前实例测量得出的总运行时间(以毫秒为单位)

+ 6 - 1
wospro.sp.entity/StaffStatistics.cs

@@ -44,10 +44,15 @@ namespace wispro.sp.entity
         public double? totalBasePoint { get; set; }
 
         /// <summary>
-        /// 难度系数调整后点数统计
+        /// 等级调整点数
         /// </summary>
         public double? totalActuallyPoint { get; set; }
 
+        /// <summary>
+        /// 最终点数
+        /// </summary>
+        public double? FinianlPoint { get; set; }
+
         public double? NanduXS { get; set; }
 
         public int? S { get; set; }