ソースを参照

添加调整后绩效计算模块

luocaiyang 3 年 前
コミット
1d00ae0fe8

+ 254 - 140
wispro.sp.api/Controllers/PerformanceItemController.cs

@@ -351,198 +351,296 @@ namespace wispro.sp.api.Controllers
             return ret;
         }
 
+        public double DegreeOfDifficulty(int year,int month, int? userId = null)
+        {
+            IDictionary<string, double> CaseXiShu = new Dictionary<string, double>();
+            var list = Context.CaseCeoffcients;
 
+            foreach(var cx in list.ToList<CaseCeoffcient>())
+            {
+                CaseXiShu.Add(cx.Ceoffcient, cx.Value);
+            }
 
-        /// <summary>
-        /// 计算指定用户,指定年月的绩效统计信息
-        /// </summary>
-        /// <param name="userid"></param>
-        /// <param name="year"></param>
-        /// <param name="month"></param>
-        /// <returns></returns>
-        public List<StaffStatistics> CalMyStatistics(int year,int month, int? userid=null)
-        {
-            CalMonth calMonth = Context.CalMonths.Where<CalMonth>(c => c.Month == month && c.Year == year).FirstOrDefault();
-            
-            if(calMonth == null)
+            var results = Context.PerformanceItems.Where<PerformanceItem>(p => p.CalMonth.Year == year && p.CalMonth.Month == month && ((p.Type == "新申请" && p.BasePoint > 0) || p.Type == "专案"));
+
+            if(userId != null)
             {
-                return null;
+                results = Context.PerformanceItems.Where<PerformanceItem>(p => 
+                p.CalMonth.Year == year && p.CalMonth.Month == month && ((p.Type == "新申请" && p.BasePoint >0) || p.Type == "专案") && 
+                (p.ItemStaffs.Where<ItemStaff>(s=>s.DoPerson.Id == userId).Count ()>0 || p.ReviewerId == userId ));
             }
-            else
+
+            var groupResult = results.GroupBy(x => x.CaseCoefficient).Select(g=> new { 
+                CaseCeoffcient = g.Key,
+                count = g.Count()
+            });
+
+            int iCount = 0;
+            double d = 0.0;
+            foreach(var g in groupResult)
             {
-                if(calMonth.Status  == 4)
+                if (!string.IsNullOrEmpty(g.CaseCeoffcient))
                 {
-                    //已归档,归档数据库中直接取出记录
-                    return null;
-                }
-                else
-                {
-                    //未归档,从绩效记录中统计数据
-
-                    var results = Context.PerformanceItems.Where<PerformanceItem>(s =>s.CalMonth.Id == calMonth.Id);
+                    
 
-                    if (userid != null)
+                    if (CaseXiShu.ContainsKey(g.CaseCeoffcient))
                     {
-                        results = Context.PerformanceItems.Where<PerformanceItem>(s =>
-                            (s.ItemStaffs.Where<ItemStaff>(iStaff => iStaff.DoPerson.Id == userid).Count() > 0 || s.Reviewer.Id == userid)
-                            && s.CalMonth.Id == calMonth.Id);
+                        d += g.count * CaseXiShu[g.CaseCeoffcient];
+                        iCount += g.count;
                     }
+                }
+            }
 
-                    List<PerformanceItem> ItemList = results
-                        .Include(pi => pi.ItemStaffs).ThenInclude(iStaff => iStaff.DoPerson)
-                        .Include(pi => pi.Reviewer)
-                        .OrderByDescending(o => o.Id)
-                        .ToList<PerformanceItem>();
+            return d/(double)iCount;
+        }
 
-                    List<StaffStatistics> retList = new List<StaffStatistics>();
-                    List<VerifyCoefficient> verifyCoefficients = Context.VerifyCoefficients.ToList<VerifyCoefficient>();
+        private List<StaffStatistics> _CalMyStatistics(CalMonth calMonth, int? userid = null)
+        {
+            
+            double gspjXS = DegreeOfDifficulty(calMonth.Year , calMonth.Month);
 
-                    foreach (PerformanceItem item in ItemList)
-                    {
-                        
-                        if (item.BasePoint != null && item.BasePoint.Value > 0)
-                        {
-                            double doPersonBasePoint = item.BasePoint.Value;
-                            
-                            System.Collections.Hashtable doPersonsBL = new System.Collections.Hashtable();
+            //未归档,从绩效记录中统计数据
+            var results = Context.PerformanceItems.Where<PerformanceItem>(s => s.CalMonth.Id == calMonth.Id);
 
-                            bool isPJFP = true;
-                            double total = item.ItemStaffs.Count();
-                            if(item.ItemStaffs.Where<ItemStaff>(p=>p.PerformancePoint == null || p.PerformancePoint ==0).Count() == 0)
-                            {
-                                total = item.ItemStaffs.Select(i => i.PerformancePoint.Value).Sum();
-                                isPJFP = false;
-                            }
+            if (userid != null)
+            {
+                results = Context.PerformanceItems.Where<PerformanceItem>(s =>
+                    (s.ItemStaffs.Where<ItemStaff>(iStaff => iStaff.DoPerson.Id == userid).Count() > 0 || s.Reviewer.Id == userid)
+                    && s.CalMonth.Id == calMonth.Id);
+            }
 
-                            List<StaffStatistics> itemStatistics = new List<StaffStatistics>();
+            List<PerformanceItem> ItemList = results
+                .Include(pi => pi.ItemStaffs).ThenInclude(iStaff => iStaff.DoPerson)
+                .Include(pi => pi.Reviewer)
+                .OrderByDescending(o => o.Id)
+                .ToList<PerformanceItem>();
 
-                            if (item.Reviewer != null)
-                            {
-                                Context.Entry(item.Reviewer).Reference(b => b.StaffGrade).Load();
-                            }
+            List<StaffStatistics> retList = new List<StaffStatistics>();
+            List<VerifyCoefficient> verifyCoefficients = Context.VerifyCoefficients.ToList<VerifyCoefficient>();
 
-                            foreach (ItemStaff itemStaff in item.ItemStaffs)
-                            {
-                                Context.Entry(itemStaff).Reference(b => b.DoPerson).Load();
-                                Context.Entry(itemStaff.DoPerson).Reference(b => b.StaffGrade).Load();
+            foreach (PerformanceItem item in ItemList)
+            {
 
-                                #region 计算审核人绩效点数,核稿人绩效点数按照核稿人与个处理人的核稿系数计算后加总,没有找到核稿系数(比如同级别),核稿系数为0
-                                if (item.ReviewerId != null && userid == item.ReviewerId)
-                                {
-                                    #region 取审核人等级审核等级系数
-                                    VerifyCoefficient vcoefficient = verifyCoefficients.Where<VerifyCoefficient>(v =>
-                                            v.CheckerId == item.Reviewer.StaffGrade.Id
-                                            && v.DoPersonId == itemStaff.DoPerson.StaffGradeId)
-                                    .FirstOrDefault<VerifyCoefficient>();
-                                    #endregion
-
-                                    if (vcoefficient != null)
-                                    {
-                                        double reviewerBasePoint = item.BasePoint.Value * vcoefficient.Coefficient;
+                if (item.BasePoint != null && item.BasePoint.Value > 0)
+                {
+                    double doPersonBasePoint = item.BasePoint.Value;
 
+                    System.Collections.Hashtable doPersonsBL = new System.Collections.Hashtable();
 
-                                        string temJxType = $"{item.Type}审核";
+                    bool isPJFP = true;
+                    double total = item.ItemStaffs.Count();
+                    if (item.ItemStaffs.Where<ItemStaff>(p => p.PerformancePoint == null || p.PerformancePoint == 0).Count() == 0)
+                    {
+                        total = item.ItemStaffs.Select(i => i.PerformancePoint.Value).Sum();
+                        isPJFP = false;
+                    }
 
-                                        var temReviewerStatic = itemStatistics.Where<StaffStatistics>(s => s.StaffId == item.ReviewerId && s.jxType == temJxType && s.CalMonth.Id == calMonth.Id).FirstOrDefault();
-                                        if (temReviewerStatic != null)
-                                        {
-                                            temReviewerStatic.totalBasePoint += reviewerBasePoint;
-                                        }
-                                        else
-                                        {
-                                            if (item.Reviewer.IsOnJob)  //判断是否在职
-                                            {
-                                                temReviewerStatic = new StaffStatistics()
-                                                {
-                                                    CalMonth = calMonth,
-                                                    CalMonthId = calMonth.Id,
-                                                    StaffId = item.ReviewerId.Value,
-                                                    totalBasePoint = reviewerBasePoint,
-                                                    jxType = temJxType
-                                                };
-
-                                                itemStatistics.Add(temReviewerStatic);
-                                            }
-                                        }
-                                    }
-                                }
-                                #endregion
+                    List<StaffStatistics> itemStatistics = new List<StaffStatistics>();
+
+                    if (item.Reviewer != null)
+                    {
+                        Context.Entry(item.Reviewer).Reference(b => b.StaffGrade).Load();
+                    }
+
+                    foreach (ItemStaff itemStaff in item.ItemStaffs)
+                    {
+                        Context.Entry(itemStaff).Reference(b => b.DoPerson).Load();
+                        Context.Entry(itemStaff.DoPerson).Reference(b => b.StaffGrade).Load();
+
+                        #region 计算审核人绩效点数,核稿人绩效点数按照核稿人与个处理人的核稿系数计算后加总,没有找到核稿系数(比如同级别),核稿系数为0
+                        if (item.ReviewerId != null && item.Type !="专案")
+                        {
+                            #region 取审核人等级审核等级系数
+                            VerifyCoefficient vcoefficient = verifyCoefficients.Where<VerifyCoefficient>(v =>
+                                    v.CheckerId == item.Reviewer.StaffGrade.Id
+                                    && v.DoPersonId == itemStaff.DoPerson.StaffGradeId)
+                            .FirstOrDefault<VerifyCoefficient>();
+                            #endregion
+
+                            if (vcoefficient != null)
+                            {
+                                double reviewerBasePoint = item.BasePoint.Value * vcoefficient.Coefficient;
 
-                                #region 计算个处理人的绩效点数
-                                double handlerBasePoint;
-                                if (isPJFP) {
-                                    handlerBasePoint = item.BasePoint.Value * 1.0/total;
-                                }
-                                else
-                                {
-                                    handlerBasePoint = item.BasePoint.Value * itemStaff.PerformancePoint.Value / total;
-                                }
 
-                                string handlerJxType = $"{item.Type}处理";
-                                var temStatic = itemStatistics.Where<StaffStatistics>(s => s.StaffId == itemStaff.DoPersonId && s.jxType == handlerJxType && s.CalMonth.Id == calMonth.Id).FirstOrDefault();
-                                if (temStatic != null)
+                                string temJxType = $"{item.Type}审核";
+
+                                var temReviewerStatic = itemStatistics.Where<StaffStatistics>(s => s.StaffId == item.ReviewerId && s.jxType == temJxType && s.CalMonth.Id == calMonth.Id).FirstOrDefault();
+                                if (temReviewerStatic != null)
                                 {
-                                    temStatic.totalBasePoint += handlerBasePoint * itemStaff.DoPerson.StaffGrade.Coefficient;
+                                    temReviewerStatic.totalBasePoint += reviewerBasePoint;
                                 }
                                 else
                                 {
-                                    if (itemStaff.DoPerson.StaffGrade != null && itemStaff.DoPerson.IsOnJob)
+                                    if (item.Reviewer.IsOnJob)  //判断是否在职
                                     {
-                                        temStatic = new StaffStatistics()
+                                        temReviewerStatic = new StaffStatistics()
                                         {
                                             CalMonth = calMonth,
                                             CalMonthId = calMonth.Id,
-                                            StaffId = itemStaff.DoPersonId,
-                                            totalBasePoint = handlerBasePoint * itemStaff.DoPerson.StaffGrade.Coefficient,
-                                            jxType = handlerJxType
+                                            StaffId = item.ReviewerId.Value,
+                                            totalBasePoint = reviewerBasePoint,
+                                            jxType = temJxType
                                         };
 
-
-                                        itemStatistics.Add(temStatic);
+                                        itemStatistics.Add(temReviewerStatic);
                                     }
                                 }
-                                #endregion
                             }
+                        }
+                        #endregion
 
-                            List<StaffStatistics> temItemStatics;
+                        #region 计算各处理人的绩效点数
+                        double handlerBasePoint;
+                        if (item.Type != "专案")
+                        {
+                            if (isPJFP)
+                            {
+                                handlerBasePoint = item.BasePoint.Value * 1.0 / total;
+                            }
+                            else
+                            {
+                                handlerBasePoint = item.BasePoint.Value * itemStaff.PerformancePoint.Value / total;
+                            }
+                        }
+                        else
+                        {
+                            handlerBasePoint = itemStaff.PerformancePoint.Value;
+                        }
 
-                            if(userid != null)
+                        string handlerJxType = $"{item.Type}处理";
+                        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 != "专案")
                             {
-                                temItemStatics = itemStatistics.Where<StaffStatistics>(s => s.StaffId == userid).ToList();
+                                temStatic.totalBasePoint += handlerBasePoint * itemStaff.DoPerson.StaffGrade.Coefficient;
                             }
                             else
                             {
-                                temItemStatics = itemStatistics;
+                                temStatic.totalBasePoint += handlerBasePoint;
                             }
-                            
-                            foreach (StaffStatistics  retUserValue in temItemStatics)
+                        }
+                        else
+                        {
+                            if (itemStaff.DoPerson.StaffGrade != null && itemStaff.DoPerson.IsOnJob)
                             {
-                                var temValue = retList.Where<StaffStatistics>(s => s.StaffId == retUserValue.StaffId && s.jxType == retUserValue.jxType && s.CalMonthId == calMonth.Id).FirstOrDefault();
-                                if (temValue != null)
+                                if (item.Type != "专案")
                                 {
-                                    temValue.totalBasePoint += retUserValue.totalBasePoint;
+                                    temStatic = new StaffStatistics()
+                                    {
+                                        CalMonth = calMonth,
+                                        CalMonthId = calMonth.Id,
+                                        StaffId = itemStaff.DoPersonId,
+                                        totalBasePoint = handlerBasePoint * itemStaff.DoPerson.StaffGrade.Coefficient,
+                                        jxType = handlerJxType
+                                    };
+
+
+                                    itemStatistics.Add(temStatic);
                                 }
                                 else
                                 {
-                                    retList.Add(retUserValue);
+                                    temStatic = new StaffStatistics()
+                                    {
+                                        CalMonth = calMonth,
+                                        CalMonthId = calMonth.Id,
+                                        StaffId = itemStaff.DoPersonId,
+                                        totalBasePoint = handlerBasePoint ,
+                                        jxType = handlerJxType
+                                    };
+
+
+                                    itemStatistics.Add(temStatic);
                                 }
                             }
                         }
+                        #endregion
+                    }
+
+                    List<StaffStatistics> temItemStatics;
 
+                    if (userid != null)
+                    {
+                        temItemStatics = itemStatistics.Where<StaffStatistics>(s => s.StaffId == userid).ToList();
+                    }
+                    else
+                    {
+                        temItemStatics = itemStatistics;
                     }
 
-                    foreach(StaffStatistics ss in retList)
+                    foreach (StaffStatistics retUserValue in temItemStatics)
                     {
-                        ss.CalMonth.PerformanceItems  = null;
+                        var temValue = retList.Where<StaffStatistics>(s => s.StaffId == retUserValue.StaffId && s.jxType == retUserValue.jxType && s.CalMonthId == calMonth.Id).FirstOrDefault();
+                        if (temValue != null)
+                        {
+                            temValue.totalBasePoint += retUserValue.totalBasePoint;
+                        }
+                        else
+                        {
+                            retList.Add(retUserValue);
+                        }
                     }
-                    return retList;
                 }
+
             }
-            
 
-            
+            if(userid != null)
+            {
+                retList = retList.Where<StaffStatistics>(s => s.StaffId == userid.Value).ToList();
+            }
+
+            IDictionary<int, double> staffXiShu = new Dictionary<int, double>();
+            foreach (StaffStatistics ss in retList)
+            {
+                if (ss.jxType.Contains("新申请") || ss.jxType.Contains("专案"))
+                {
+                    if (!staffXiShu.ContainsKey(ss.StaffId))
+                    {
+                        staffXiShu.Add(ss.StaffId, DegreeOfDifficulty(calMonth.Year ,calMonth.Month, ss.StaffId));
+                    }
+
+                    ss.totalActuallyPoint = ss.totalBasePoint * staffXiShu[ss.StaffId] / gspjXS;
+                }
+                else
+                {
+                    ss.totalActuallyPoint = ss.totalBasePoint;
+                }
+
+                ss.CalMonth.PerformanceItems = null;
+            }
+
+
+            return retList;
         }
 
+        /// <summary>
+        /// 计算指定用户,指定年月的绩效统计信息
+        /// </summary>
+        /// <param name="userid"></param>
+        /// <param name="year"></param>
+        /// <param name="month"></param>
+        /// <returns></returns>
+        public List<StaffStatistics> CalMyStatistics(int year,int month, int? userid=null)
+        {
+            CalMonth calMonth = Context.CalMonths.Where<CalMonth>(c => c.Month == month && c.Year == year).FirstOrDefault();
+            
+            if(calMonth == null)
+            {
+                return null;
+            }
+            else
+            {
+                if(calMonth.Status  == 4)
+                {
+                    //已归档,归档数据库中直接取出记录
+                    return null;
+                }
+                else
+                {
+                    return _CalMyStatistics(calMonth, userid);
+                }
+            }
+        }
         
         private string GetExpress(IList<FieldCondition> conditions)
         {
@@ -612,18 +710,34 @@ namespace wispro.sp.api.Controllers
 
             }
 
-            int totals;
-            response = response
-                .Include(pi => pi.ItemStaffs).ThenInclude(iStaff => iStaff.DoPerson)
-                .Include(pi => pi.Reviewer)
-                .Include(pi => pi.Customer)
-                .Include(pi => pi.CalMonth)
-                .OrderConditions<PerformanceItem>(queryFilter.Sorts)
-                .Pager<PerformanceItem>(queryFilter.PageIndex,queryFilter.PageSize,out totals);
+            int totals = response.ToList<PerformanceItem>().Count;
+
+            if (totals > 0 && totals < (queryFilter.PageIndex - 1) * queryFilter.PageSize) {
+                response = response
+                    .Include(pi => pi.ItemStaffs).ThenInclude(iStaff => iStaff.DoPerson)
+                    .Include(pi => pi.Reviewer)
+                    .Include(pi => pi.Customer)
+                    .Include(pi => pi.CalMonth)
+                    .OrderConditions<PerformanceItem>(queryFilter.Sorts)
+                    .Pager<PerformanceItem>(1, queryFilter.PageSize, out totals);
+            }
+            else
+            {
+                response = response
+                    .Include(pi => pi.ItemStaffs).ThenInclude(iStaff => iStaff.DoPerson)
+                    .Include(pi => pi.Reviewer)
+                    .Include(pi => pi.Customer)
+                    .Include(pi => pi.CalMonth)
+                    .OrderConditions<PerformanceItem>(queryFilter.Sorts)
+                    .Pager<PerformanceItem>(queryFilter.PageIndex, queryFilter.PageSize, out totals);
+            }
             ret.TotalCount = totals;
 
+            
+
             var retList = response.ToList<PerformanceItem>();
 
+
             #region 将某些属性设为null,避免循环取值造成返回json过大
             foreach (PerformanceItem item in retList)
             {

+ 28 - 0
wispro.sp.api/Controllers/WorkflowEngineController.cs

@@ -0,0 +1,28 @@
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+using wispro.sp.entity.workflowInstance;
+
+namespace wispro.sp.api.Controllers
+{
+    [Route("api/[controller]")]
+    [ApiController]
+    public class WorkflowEngineController : ControllerBase
+    {
+        public void DoAction(int instanceId,int stepId,int ActionId,List<stepInputValue> inputValues)
+        {
+            //1、取实例对象
+
+            //2、取步骤对象
+
+            //3、判断Action定义对象
+
+            //4、判断输入值合法性
+
+            //5、保存数据
+        }
+    }
+}

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

@@ -24,6 +24,7 @@ namespace wispro.sp.api.Utility
                 var interpreter = new Interpreter();
                 //item.ApplicationType
                 Func<PerformanceItem, bool> func = interpreter.ParseAsDelegate<Func<PerformanceItem, bool>>(rule.Rule, "p");
+                
                 bool result = func.Invoke(item);
 
                 if (result)

+ 50 - 10
wispro.sp.share/EFCoreExt.cs

@@ -283,21 +283,61 @@ namespace wispro.sp.share
         {
             foreach (var orderinfo in orderConditions)
             {
-                var t = typeof(T);
-                var propertyInfo = t.GetProperty(orderinfo.FieldName);
-                var parameter = Expression.Parameter(t);
-                Expression propertySelector = Expression.Property(parameter, propertyInfo);
-
-                var orderby = Expression.Lambda<Func<T, object>>(propertySelector, parameter);
-                if (orderinfo.Sort == 1)
-                    query = query.OrderByDescending(orderby);
-                else
-                    query = query.OrderBy(orderby);
+                //var t = typeof(T);
+
+                //var propertyInfo = t.GetProperty(orderinfo.FieldName);
+                //var parameter = Expression.Parameter(t);
+                //Expression propertySelector = Expression.Property(parameter, propertyInfo);
+
+                //var orderby = Expression.Lambda<Func<T, dynamic>>(propertySelector, parameter);
+                //if (orderinfo.Sort == 1)
+                //    query = query.OrderByDescending(orderby);
+                //else
+                //    query = query.OrderBy(orderby);
+
+                var parameter = Expression.Parameter(typeof(T));
+                var prop = Expression.PropertyOrField(parameter, orderinfo.FieldName);
+                var sortLambda = Expression.Lambda(prop, parameter);
+
+                Expression<Func<IOrderedQueryable<T>>> sortMethod = (() => query.OrderBy<T, object>(k => null));
+
+                if(orderinfo.Sort == 1)
+                {
+                    sortMethod = (() => query.OrderByDescending<T, object>(k => null));
+                }
+
+                var methodCallExpression = (sortMethod.Body as MethodCallExpression);
+                if (methodCallExpression == null)
+                    throw new Exception("Oops");
+
+                var method = methodCallExpression.Method.GetGenericMethodDefinition();
+                var genericSortMethod = method.MakeGenericMethod(typeof(T), prop.Type);
+                query = (IQueryable<T>)genericSortMethod.Invoke(query, new object[] { query, sortLambda });
+
 
             }
             return query;
         }
 
+        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);
+            var sortLambda = Expression.Lambda(prop, param);
+
+            Expression<Func<IOrderedQueryable<TEntityType>>> sortMethod = (() => query.OrderBy<TEntityType, object>(k => null));
+
+            var methodCallExpression = (sortMethod.Body as MethodCallExpression);
+            if (methodCallExpression == null)
+                throw new Exception("Oops");
+
+            var method = methodCallExpression.Method.GetGenericMethodDefinition();
+            var genericSortMethod = method.MakeGenericMethod(typeof(TEntityType), prop.Type);
+            var orderedQuery = (IOrderedQueryable<TEntityType>)genericSortMethod.Invoke(query, new object[] { query, sortLambda });
+
+            return orderedQuery;
+        }
+
         public static IQueryable<T> Pager<T>(this IQueryable<T> query, int pageindex, int pagesize, out int itemCount)
         {
             itemCount = query.Count();

+ 19 - 4
wispro.sp.web/Pages/AppCase/MyCaselist.razor

@@ -56,7 +56,7 @@
                                     <AntDesign.Col Span="4" style="border:1px solid #000000"></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>@_user.Name</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>核稿</center></AntDesign.Col>
                                     <AntDesign.Col Span="2" style="border:1px solid #000000"><center>承办</center></AntDesign.Col>
@@ -69,14 +69,27 @@
                                     <AntDesign.Col Span="4" style="border:1px solid #000000"><center>总计</center></AntDesign.Col>
                                 </AntDesign.Row>
                                 <AntDesign.Row>
-                                    <AntDesign.Col Span="2" style="border:1px solid #000000"><center>@_user.Name</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("新申请处理",true)</center></AntDesign.Col>
+                                    <AntDesign.Col Span="2" style="border:1px solid #000000"><center>@GetStatistics("新申请审核", true)</center></AntDesign.Col>
+                                    <AntDesign.Col Span="2" style="border:1px solid #000000"><center>@GetStatistics("OA处理", true)</center></AntDesign.Col>
+                                    <AntDesign.Col Span="2" style="border:1px solid #000000"><center>@GetStatistics("OA审核", true)</center></AntDesign.Col>
+                                    <AntDesign.Col Span="2" style="border:1px solid #000000"><center>@GetStatistics("其它处理", true)</center></AntDesign.Col>
+                                    <AntDesign.Col Span="2" style="border:1px solid #000000"><center>@GetStatistics("其它审核", true)</center></AntDesign.Col>
+                                    <AntDesign.Col Span="2" style="border:1px solid #000000"><center>@GetStatistics("专案处理", true)</center></AntDesign.Col>
+                                    <AntDesign.Col Span="2" style="border:1px solid #000000"><center>@GetStatistics("一次OA授权处理", true)</center></AntDesign.Col>
+                                    <AntDesign.Col Span="2" style="border:1px solid #000000"><center>@GetStatistics("一次OA授权审核", true)</center></AntDesign.Col>
+                                    <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>@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>
                                     <AntDesign.Col Span="2" style="border:1px solid #000000"><center>@GetStatistics("OA审核")</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></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>
                                     <AntDesign.Col Span="2" style="border:1px solid #000000"><center>@GetStatistics("一次OA授权审核")</center></AntDesign.Col>
                                     <AntDesign.Col Span="4" style="border:1px solid #000000"><center>@GetStatistics("ALL")</center></AntDesign.Col>
@@ -101,7 +114,9 @@
                             <AntDesign.Column Title="序号" TData="int" Width="50" Fixed="left">
                                 @serialNumber(_pageIndex, _pageSize, context.Id)
                             </AntDesign.Column>
-                            <AntDesign.Column Title="基础点数" TData="string" Width="120">@(context.BasePoint == null ? "" : context.BasePoint)</AntDesign.Column>
+                            <AntDesign.Column Title="基础点数" Width="100" @bind-Field="@context.BasePoint" Sortable>
+                                <span>@(context.BasePoint == null ? "" : context.BasePoint)</span> 
+                            </AntDesign.Column>
                             <AntDesign.Column Title="我方文号" @bind-Field="@context.CaseNo" Width="150" Sortable Filterable />
                             <AntDesign.Column Title="案件类型" @bind-Field="@context.CaseType" Width="120" Sortable Filterable />
                             <AntDesign.Column Title="申请类型" @bind-Field="@context.ApplicationType" Width="120" Sortable Filterable/>

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

@@ -109,7 +109,7 @@ namespace wispro.sp.web.Pages.AppCase
             
         }
 
-        private string GetStatistics(string strType)
+        private string GetStatistics(string strType,bool isBasePoint=false)
         {
             try
             {
@@ -117,18 +117,41 @@ namespace wispro.sp.web.Pages.AppCase
                 {
 
                     var tem = MyStatistics.Where<StaffStatistics>(s => s.jxType == strType).FirstOrDefault();
-                    if (tem != null)
+
+                    if (isBasePoint)
                     {
-                        return (tem.totalBasePoint.HasValue ? tem.totalBasePoint.Value.ToString("0.00") : "");
+                        if (tem != null)
+                        {
+                            return (tem.totalBasePoint.HasValue ? tem.totalBasePoint.Value.ToString("0.00") : "");
+                        }
+                        else
+                        {
+                            return "";
+                        }
                     }
                     else
                     {
-                        return "";
+                        if (tem != null)
+                        {
+                            return (tem.totalActuallyPoint.HasValue ? tem.totalActuallyPoint.Value.ToString("0.00") : "");
+                        }
+                        else
+                        {
+                            return "";
+                        }
                     }
+                    
                 }
                 else
                 {
-                    return MyStatistics.Select(s => s.totalBasePoint.Value).Sum().ToString("0.00");
+                    if (isBasePoint)
+                    {
+                        return MyStatistics.Select(s => s.totalBasePoint.Value).Sum().ToString("0.00");
+                    }
+                    else
+                    {
+                        return MyStatistics.Select(s => s.totalActuallyPoint.Value).Sum().ToString("0.00");
+                    }
                 }
             }
             catch

+ 1 - 1
wispro.sp.web/Services/PerformanceItemServices.cs

@@ -121,7 +121,7 @@ namespace wispro.sp.web.Services
                 }
             }
             var data = await _httpClient.Post<ListApiResponse<PerformanceItem>>($"PerformanceItem/QueryFilter",query);
-
+            Console.WriteLine(System.Text.Json.JsonSerializer.Serialize(queryModel));
             return data;
         }
 

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

@@ -173,7 +173,30 @@ namespace wispro.sp.winClient
 
         private async void button3_Click(object sender, EventArgs e)
         {
-            wispro.sp.utility.MailUtil.SendEmail("测试邮件标题","测试邮件内容","罗才洋","luocaiyang@139.com");
+            dynamic dynObj = new ExpandoObject();
+            dynObj.Name = "名称";
+            dynObj.Text = "aaabc";
+            
+
+            List<dynamic> list = new List<dynamic>();
+            for(int i = 0; i < 3; i++)
+            {
+                dynamic d = new ExpandoObject();
+                d.Id = i + 1;
+                d.Filed1 = $"Field{i}";
+                d.Date = DateTime.Now.AddDays(i);
+                list.Add(d);
+            }
+
+            dynObj.List = list;
+            var temTxt = System.Text.Json.JsonSerializer.Serialize(dynObj);
+
+            var dynamic = System.Text.Json.JsonSerializer.Deserialize<ExpandoObject>(temTxt);
+            
+
+            MessageBox.Show(((IDictionary<string, object>)dynamic)["Name"].ToString());
+
+            //wispro.sp.utility.MailUtil.SendEmail("测试邮件标题","测试邮件内容","罗才洋","luocaiyang@139.com");
             //CreateAppealModel model = new CreateAppealModel();
             //HttpClient http = new HttpClient();
             //PerformanceItem item = await http.GetFromJsonAsync<wispro.sp.entity.PerformanceItem>($"http://localhost:39476/api/PerformanceItem/Get?Id=7341");

+ 39 - 0
wospro.sp.entity/workflowDefine/Action.cs

@@ -0,0 +1,39 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace wispro.sp.entity.workflowDefine
+{
+    /// <summary>
+    /// 步骤操作
+    /// </summary>
+    public class Action
+    {
+        public int Id { get; set; }
+
+        /// <summary>
+        /// 名称
+        /// </summary>
+        public string Name { get; set; }
+
+        /// <summary>
+        /// 输入输入设定
+        /// </summary>
+        public List<inputValueSetting> inputValuesSettings { get; set; }
+
+        /// <summary>
+        /// 操作界面
+        /// </summary>
+        public string InputForm { get; set; }
+
+        /// <summary>
+        /// 所属步骤Id
+        /// </summary>
+        public int StepId { get; set; }
+
+
+
+    }
+}

+ 16 - 0
wospro.sp.entity/workflowDefine/EnmuFieldType.cs

@@ -0,0 +1,16 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace wispro.sp.entity.workflowDefine
+{
+    public enum EnumFieldType
+    {
+        Text,
+        Numberic,
+        Date,
+        List
+    }
+}

+ 9 - 1
wospro.sp.entity/workflowDefine/inputValueSetting.cs

@@ -17,15 +17,23 @@ namespace wispro.sp.entity.workflowDefine
         /// <summary>
         /// 值类型
         /// </summary>
-        public string valueType { get; set; }
+        public EnumFieldType valueType { get; set; }
 
         /// <summary>
         /// 绑定对象属性
         /// </summary>
         public string bindField { get; set; }
 
+        public string bindFieldSavetoObjectCondition { get; set; }
+
         public step step { get; set; }
 
         public int stepId { get; set; }
+
+        /// <summary>
+        /// 可选项目,多个以“|”隔开
+        /// 例如:选项一|选项二|选项三
+        /// </summary>
+        public string Options { get; set; }
     }
 }

+ 0 - 15
wospro.sp.entity/workflowDefine/step.cs

@@ -18,7 +18,6 @@ namespace wispro.sp.entity.workflowDefine
         /// </summary>
         public string Name { get; set; }
 
-
         /// <summary>
         /// 流程
         /// </summary>
@@ -30,11 +29,6 @@ namespace wispro.sp.entity.workflowDefine
         public int workflowId { get; set; }
 
         /// <summary>
-        /// 输入界面
-        /// </summary>
-        public string InputForm { get; set; }
-
-        /// <summary>
         /// 步骤类型
         /// 0:启动
         /// 1:普通
@@ -49,14 +43,5 @@ namespace wispro.sp.entity.workflowDefine
         /// </summary>
         public string defaultResponseSetting { get; set; }
 
-        /// <summary>
-        /// 输入输入设定
-        /// </summary>
-        public List<inputValueSetting> inputValuesSettings { get; set; }
-
-        
-
-        
-
     }
 }

+ 13 - 0
wospro.sp.entity/workflowDefine/trasferCondition.cs

@@ -11,6 +11,19 @@ namespace wispro.sp.entity.workflowDefine
     /// </summary>
     public class trasferCondition
     {
+        public int Id { get; set; }
+
+        /// <summary>
+        /// 所属步骤
+        /// </summary>
+        public step Step { get; set; }
+
+        /// <summary>
+        /// 所属步骤Id
+        /// </summary>
+        public int StepId{get;set;}
+
+
         /// <summary>
         /// 转移条件
         /// </summary>

+ 23 - 1
wospro.sp.entity/workflowDefine/workflow.cs

@@ -8,9 +8,31 @@ namespace wispro.sp.entity.workflowDefine
 {
     public class workflow
     {
+        /// <summary>
+        /// 流程编号
+        /// </summary>
         public int Id { get; set; }
+
+        /// <summary>
+        /// 流程名称
+        /// </summary>
         public string Name { get; set; }
 
-        public string FormContent { get; set; }
+        /// <summary>
+        /// 绑定对象类型
+        /// </summary>
+        public string ContentObjectType { get; set; }
+
+        /// <summary>
+        /// 初始化步骤Id
+        /// </summary>
+        public int InitStepId { get; set; }
+
+        /// <summary>
+        /// 结束步骤Id
+        /// 每个流程都有一个结束步骤,结束步骤只是一个标志,
+        /// 不能做任何操作
+        /// </summary>
+        public int EndStepId { get; set; }
     }
 }

+ 1 - 0
wospro.sp.entity/workflowInstance/stepInputValue.cs

@@ -16,5 +16,6 @@ namespace wispro.sp.entity.workflowInstance
         public int valueSettingId{get;set;}
 
         public string value { get; set; }
+
     }
 }

+ 2 - 0
wospro.sp.entity/workflowInstance/stepInstance.cs

@@ -18,5 +18,7 @@ namespace wispro.sp.entity.workflowInstance
         public workflowInstance workflowInstance { get; set; }
 
         public int workflowInstanceId { get; set; }
+
+        public int PreviousStepId { get; set; }
     }
 }