luocaiyang 3 lat temu
rodzic
commit
5fb5c6824f

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

@@ -109,7 +109,7 @@ namespace wispro.sp.api.AppealHandler
                     if (oldPersonExist)
                     {
                         ((spDbContext)spContext).ItemStaffs.RemoveRange(waitingRemoveObj);
-
+                        ((spDbContext)spContext).SaveChanges();
                         foreach (var temName in newPersons)
                         {
                             var newStaff = ((spDbContext)spContext).Staffs.FirstOrDefault(s => s.Name == temName.Trim());

+ 12 - 5
wispro.sp.api/AppealHandler/SpecialPointsHandler.cs

@@ -12,6 +12,18 @@ namespace wispro.sp.api.AppealHandler
         public void DoAppeal(AppealObject appeal, int appealRecordId, DbContext spContext)
         {
             bool isAggree = true;
+
+            foreach (var iv in appeal.inputFieldValues)
+            {
+                if (iv.InputField == null)
+                {
+                    iv.InputField = ((spDbContext)spContext).InputFields.FirstOrDefault(s => s.Id == iv.InputFieldId);
+                }
+            }
+
+            var temField = appeal.inputFieldValues.FirstOrDefault(iv => iv.InputField.FieldName == "审核意见" && iv.Value == "同意");
+
+            isAggree = (temField != null);
             
             if (isAggree)
             {
@@ -23,11 +35,6 @@ namespace wispro.sp.api.AppealHandler
 
                     foreach (var iv in appeal.inputFieldValues)
                     {
-                        if (iv.InputField == null)
-                        {
-                            iv.InputField = ((spDbContext)spContext).InputFields.FirstOrDefault(s => s.Id == iv.InputFieldId);
-                        }
-
                         if (iv.InputField.FieldName == "给定点数")
                         {
                             Item.BasePoint = double.Parse(iv.Value);

+ 3 - 2
wispro.sp.api/Controllers/AccountController.cs

@@ -37,9 +37,10 @@ namespace wispro.sp.api.Controllers
         {
             //添加验证代码
             
-            Staff staff = dbContext.Staffs.Where<Staff>(s => s.Account == loginUser.Name && s.Password == utility.MD5Utility.GetMD5(loginUser.Password)).FirstOrDefault(); //
+            Staff staff = dbContext.Staffs.Where<Staff>(s => s.Account == loginUser.Name ).FirstOrDefault(); //
 
-            if (staff != null)
+           
+            if (staff != null && staff.Password == utility.MD5Utility.GetMD5(loginUser.Password))
             {
                 return GetToken(staff);
             }

+ 91 - 0
wispro.sp.api/Controllers/OrganizationController.cs

@@ -7,6 +7,7 @@ using System.Collections.Generic;
 using System.Linq;
 using System.Threading.Tasks;
 using wispro.sp.entity;
+using wispro.sp.share;
 
 namespace wispro.sp.api.Controllers
 {
@@ -197,6 +198,96 @@ namespace wispro.sp.api.Controllers
             return Context.Customers.ToList();
         }
 
+        public ApiSaveResponse SaveCustomer(Customer customer)
+        {
+            ApiSaveResponse ret = new ApiSaveResponse();
+            try
+            {
+                if (customer.Id == 0)
+                {
+
+                    Customer temCustomer = Context.Customers.Where<Customer>(x => x.Name== customer.Name).FirstOrDefault();
+
+                    if (temCustomer != null)
+                    {
+                        if(temCustomer.Name != customer.Name)
+                        {
+                            temCustomer.Name = customer.Name;
+                        }
+
+                        if(temCustomer.ResponseManId != customer.ResponseManId)
+                        {
+                            temCustomer.ResponseManId = customer.ResponseManId;
+                        }
+
+                        if (temCustomer.ContactMan != customer.ContactMan)
+                        {
+                            temCustomer.ContactMan = customer.ContactMan;
+                        }
+
+                        if (temCustomer.Address != customer.Address)
+                        {
+                            temCustomer.Address = customer.Address;
+                        }
+
+                        Context.SaveChanges();
+                    }
+                    else
+                    {
+                        Context.Customers.Add(customer);
+                    }
+                }
+                else
+                {
+                    Customer temCustomer = Context.Customers.Where<Customer>(x => x.Id == customer.Id).FirstOrDefault();
+
+                    if (temCustomer != null)
+                    {
+                        if (temCustomer.Name != customer.Name)
+                        {
+                            temCustomer.Name = customer.Name;
+                        }
+
+                        if (temCustomer.ResponseManId != customer.ResponseManId)
+                        {
+                            temCustomer.ResponseManId = customer.ResponseManId;
+                        }
+
+                        if (temCustomer.ContactMan != customer.ContactMan)
+                        {
+                            temCustomer.ContactMan = customer.ContactMan;
+                        }
+
+                        if (temCustomer.Address != customer.Address)
+                        {
+                            temCustomer.Address = customer.Address;
+                        }
+
+                        Context.SaveChanges();
+
+                        //ret.Success = false;
+                        //ret.ErrorMessage = $"用户【{staff.Name}】已存在!";
+                    }
+                    else
+                    {
+                        ret.Success = false;
+                        ret.ErrorMessage = $"编号为【{customer.Id}】的客户不存在!";
+                    }
+                }
+
+                Context.SaveChanges();
+
+                ret.Success = true;
+            }
+            catch (Exception ex)
+            {
+                ret.Success = false;
+                ret.ErrorMessage = ex.Message;
+            }
+
+            return ret;
+        }
+
         public void InitUserDepartment()
         {
             Position ptPosition = Context.Positions.FirstOrDefault(s => s.Name == "普通员工");

+ 123 - 39
wispro.sp.api/Controllers/PerformanceItemController.cs

@@ -494,10 +494,10 @@ namespace wispro.sp.api.Controllers
             {
                 if (item.Item != null)
                 {
-                    if(item.Item.CaseNo == "PACN2220066")
-                    {
-                        System.Diagnostics.Debug.WriteLine("");
-                    }
+                    //if(item.Item.CaseNo == "PACN2220066")
+                    //{
+                    //    System.Diagnostics.Debug.WriteLine("");
+                    //}
                     //合写人数
                     decimal  CaseNumber = 1M;
 
@@ -508,7 +508,11 @@ namespace wispro.sp.api.Controllers
                             item.Item .ItemStaffs = spDb.ItemStaffs.Include(p => p.DoPerson).Where(p => p.ItemId == item.ItemId).ToList();
                         }
 
-                        CaseNumber = CaseNumber / (item.Item.ItemStaffs.Where(i=> i.DoPerson.IsCalPerformsnce==true || (i.DoPerson.Status !="试用期" && i.DoPerson.IsCalPerformsnce ==false)).Count());
+                        try
+                        {
+                            CaseNumber = CaseNumber / (item.Item.ItemStaffs.Where(i => i.DoPerson.IsCalPerformsnce == true || (i.DoPerson.Status != "试用期" && i.DoPerson.IsCalPerformsnce == false)).Count());
+                        }
+                        catch { }
                     }
 
                     string strCaseCeoffcient = item.Item.CaseCoefficient;
@@ -2101,7 +2105,7 @@ namespace wispro.sp.api.Controllers
 
                                 string temJxType = $"{item.Type}审核";
 
-                                var temReviewerStatic = itemStatistics.Where<StaffStatistics>(s => s.StaffId == item.ReviewerId && s.jxType == temJxType && s.CalMonth.Id == item.CalMonthId).FirstOrDefault();
+                                var temReviewerStatic = itemStatistics.Where<StaffStatistics>(s => s.StaffId == item.ReviewerId && s.jxType == temJxType && s.CalMonthId == item.CalMonthId).FirstOrDefault();
                                 if (temReviewerStatic != null)
                                 {
                                     temReviewerStatic.totalBasePoint += reviewerBasePoint;
@@ -2341,8 +2345,9 @@ namespace wispro.sp.api.Controllers
 
                         calMonth.Status = 4;
                         spDb.SaveChanges();
-
-                        StatisticsCount(calMonth.Id,spDb); //等级核算案件统计
+                        
+                        //等级核算案件统计
+                        _StatisticsLevelCount(calMonth.Year, calMonth.Month, spDb);
 
                         #region 将待审核的申诉全部修改为已审核
                         var aList = spDb.AppealRecords.Where(a => a.State == 0).ToList();
@@ -2614,6 +2619,7 @@ namespace wispro.sp.api.Controllers
 
                     if (item.ReviewerId != null && item.BasePoint.HasValue)
                     {
+                        System.Diagnostics.Debug.WriteLine($"{item.ReviewerId}");
                         var jxList = _calItemJX( verifyCoefficients, item, new spDbContext());
 
                         row["核稿系数"] = "";
@@ -3019,7 +3025,7 @@ namespace wispro.sp.api.Controllers
                 {
                     if (temObj.Reviewer != null)
                     {
-                        string strReViewer = temObj.Reviewer.ToString();
+                        string strReViewer = temObj.Reviewer.ToString().Replace("-君龙", ""); 
                         var temReviewer = Context.Staffs.Where(s => s.Name == strReViewer.Trim()).FirstOrDefault();
                         if (temReviewer != null)
                         {
@@ -3037,7 +3043,8 @@ namespace wispro.sp.api.Controllers
                     List<ItemStaff> itemStaffs = new List<ItemStaff>();
                     foreach (var doPerson in Persons)
                     {
-                        itemStaffs.Add(new ItemStaff() { DoPerson = new Staff() { Name = doPerson } });
+                        string strName = doPerson.Replace("-君龙","");
+                        itemStaffs.Add(new ItemStaff() { DoPerson = new Staff() { Name = strName } });
                     }
                     retObj.ItemStaffs = itemStaffs;
                 }
@@ -3124,17 +3131,65 @@ namespace wispro.sp.api.Controllers
             var retlist = new List<StaffStatisticsforLevel>();
 
             #region 新申请
-            var newList = spDb.PerformanceItems.Include(p => p.ItemStaffs)
+            var newList = spDb.PerformanceItems.Include(p => p.ItemStaffs).ThenInclude(p=>p.DoPerson)
+                .Include(p=>p.CalMonth)
                 .Where(p=>p.CalMonthId == calMonthId && p.BasePoint >0
                     && (p.Type =="新申请" || p.Type =="专案" || (p.Type == "其它" && p.WordCount >0 && (p.DoItem =="新申请" || p.DoItem == "翻译")))
                 ).ToList();
 
             foreach(var p in newList)
             {
+                #region 严重延期降系数
+                string strCaseCeoffcient = p.CaseCoefficient;
+                if (string.IsNullOrEmpty(strCaseCeoffcient))
+                {
+                    strCaseCeoffcient = "B";
+                }
+                if (p.isDanger() && string.IsNullOrEmpty(p.OverDueMemo))
+                {
+                    switch (p.CaseCoefficient)
+                    {
+                        case "S":
+                            strCaseCeoffcient = "A";
+                            break;
+                        case "A":
+                            strCaseCeoffcient = "B";
+                            break;
+                        case "B":
+                            strCaseCeoffcient = "C";
+                            break;
+                        case "C":
+                            strCaseCeoffcient = "D";
+                            break;
+                    }
+                }
+                #endregion
                 var pointList = spDb.StaffStatistics.Include(i=>i.Staff).Where(i=>i.ItemId == p.Id).ToList();
 
                 #region 新申请处理
                 var doList = pointList.Where(i => i.jxType.Contains("处理"));
+
+                int doPersons = doList.Count();
+                if (p.ItemStaffs.Count() > doList.Count())
+                {
+                    doPersons = p.ItemStaffs.Count;
+                    foreach (ItemStaff itemStaff in p.ItemStaffs)
+                    {
+                        Staff staff = itemStaff.DoPerson;
+                        if (staff == null)
+                        {
+                            staff = spDb.Staffs.FirstOrDefault(s => s.Id == itemStaff.DoPersonId);
+                        }
+
+                        
+
+                        if (staff.Status  == "试用期")
+                        {
+                            doPersons =doPersons- 1; 
+                        }
+                    }
+                }
+
                 foreach(var h in doList)
                 {
                     var temObj = retlist.FirstOrDefault(s=>s.StaffId == h.StaffId && s.Type == "新申请" && s.isReview == false);
@@ -3155,7 +3210,7 @@ namespace wispro.sp.api.Controllers
                         retlist.Add(temObj);
                     }
 
-                    switch (p.CaseCoefficient)
+                    switch (strCaseCeoffcient)
                     {
                         case "S":
                             if(p.Type == "专案")
@@ -3164,7 +3219,7 @@ namespace wispro.sp.api.Controllers
                             }
                             else
                             {
-                                temObj.S+=(double)(1.0M/ (decimal)doList.Count());
+                                temObj.S+=(double)(1.0M/ (decimal)doPersons);
                             }
                             break;
                         case "A":
@@ -3174,7 +3229,7 @@ namespace wispro.sp.api.Controllers
                             }
                             else
                             {
-                                temObj.A += (double)(1.0M / (decimal)doList.Count());
+                                temObj.A += (double)(1.0M / (decimal)doPersons);
                             }
                             break;
                         case "B":
@@ -3184,7 +3239,7 @@ namespace wispro.sp.api.Controllers
                             }
                             else
                             {
-                                temObj.B += (double)(1.0M / (decimal)doList.Count());
+                                temObj.B += (double)(1.0M / (decimal)doPersons);
                             }
                             break;
                         case "C":
@@ -3194,7 +3249,7 @@ namespace wispro.sp.api.Controllers
                             }
                             else
                             {
-                                temObj.C += (double)(1.0M / (decimal)doList.Count());
+                                temObj.C += (double)(1.0M / (decimal)doPersons);
                             }
                             break;
                         case "D":
@@ -3204,7 +3259,7 @@ namespace wispro.sp.api.Controllers
                             }
                             else
                             {
-                                temObj.D += (double)(1.0M / (decimal)doList.Count());
+                                temObj.D += (double)(1.0M / (decimal)doPersons);
                             }
                             break;
                     }
@@ -3234,7 +3289,7 @@ namespace wispro.sp.api.Controllers
                         retlist.Add(temObj);
                     }
 
-                    switch (p.CaseCoefficient)
+                    switch (strCaseCeoffcient)
                     {
                         case "S":
                             temObj.S += 1;
@@ -3246,7 +3301,7 @@ namespace wispro.sp.api.Controllers
                             temObj.B += 1;
                             break;
                         case "C":
-                            temObj.D += 1;
+                            temObj.C += 1;
                             break;
                         case "D":
                             temObj.D += 1;
@@ -3259,10 +3314,13 @@ namespace wispro.sp.api.Controllers
 
             #region 国内OA
             var cnOA = spDb.PerformanceItems.Include(x=>x.ItemStaffs)
-                .Where(x => x.CalMonthId == calMonthId && x.Type == "OA" && x.CaseNo.Contains("CN") && x.BasePoint > 0
-                && (x.CaseStage == "一通" || x.DoItemCoefficient.Contains("首次转入"))).ToList();
+                .Where(x => x.CalMonthId == calMonthId && x.Type == "OA" && x.CaseNo.Contains("CN") && x.BasePoint > 0.3
+                ).ToList();
 
-            foreach(var p in cnOA)
+            //因为不是所有的OA案件都是答复审查意见,所以有些应该没有一通或首次转入信息,去掉这个条件:
+            //&& (x.CaseStage == "一通" || x.DoItemCoefficient.Contains("首次转入"))
+
+            foreach (var p in cnOA)
             {
                 var pointList = spDb.StaffStatistics.Include(i => i.Staff).Where(i=> i.ItemId == p.Id).ToList();
 
@@ -3302,6 +3360,9 @@ namespace wispro.sp.api.Controllers
                         case "D":
                             temObj.D += (double)(1.0M / (decimal)doList.Count());
                             break;
+                        default:
+                            temObj.B += (double)(1.0M / (decimal)doList.Count());
+                            break;
                     }
 
                 }
@@ -3341,7 +3402,7 @@ namespace wispro.sp.api.Controllers
                             temObj.B += 1;
                             break;
                         case "C":
-                            temObj.D += 1;
+                            temObj.C += 1;
                             break;
                         case "D":
                             temObj.D += 1;
@@ -3354,7 +3415,7 @@ namespace wispro.sp.api.Controllers
 
             #region 涉外OA
             var gwOA = spDb.PerformanceItems.Include(x => x.ItemStaffs)
-                .Where(x => x.CalMonthId == calMonthId && x.Type == "OA" && !x.CaseNo.Contains("CN") && x.BasePoint>0
+                .Where(x => x.CalMonthId == calMonthId && x.Type == "OA" && !x.CaseNo.Contains("CN") && x.BasePoint>0.5
                 && (x.DoItemCoefficient.Contains("实质"))).ToList();
 
             foreach (var p in gwOA)
@@ -3397,6 +3458,9 @@ namespace wispro.sp.api.Controllers
                         case "D":
                             temObj.D += (double)(1.0M / (decimal)doList.Count());
                             break;
+                        default:
+                            temObj.B += (double)(1.0M / (decimal)doList.Count());
+                            break;
                     }
 
                 }
@@ -3436,11 +3500,15 @@ namespace wispro.sp.api.Controllers
                             temObj.B += 1;
                             break;
                         case "C":
-                            temObj.D += 1;
+                            temObj.C += 1;
                             break;
                         case "D":
                             temObj.D += 1;
                             break;
+                        default:
+                            temObj.C += 1;
+                            break;
+
                     }
                 }
                 #endregion
@@ -3536,21 +3604,32 @@ namespace wispro.sp.api.Controllers
         public LevelStatisticsResult CalAgentLevel(int year,int quarter,string GradeCode)
         {
             LevelStatisticsResult result = new LevelStatisticsResult();
-
+            DateTime tempDate=DateTime.Parse($"{year}-01-01");
             var Months = new List<int>() { 1,2,3};
             switch (quarter)
             {
                 case 1:
-                    Months = new List<int>() { 1, 2, 3 };
+                    if(year == 2022)
+                    {
+                        Months = new List<int>() { 2, 3 };
+                    }
+                    else
+                    {
+                        Months = new List<int>() { 1, 2, 3 };
+                    }
+                    tempDate = DateTime.Parse($"{year}-01-01");
                     break;
                 case 2:
                     Months = new List<int>() { 4,5,6 };
+                    tempDate = DateTime.Parse($"{year}-04-01");
                     break;
                 case 3:
                     Months = new List<int>() { 7,8,9};
+                    tempDate = DateTime.Parse($"{year}-07-01");
                     break;
                 case 4:
                     Months = new List<int>() { 10,11,12 };
+                    tempDate = DateTime.Parse($"{year}-10-01");
                     break;
             }
 
@@ -3562,7 +3641,7 @@ namespace wispro.sp.api.Controllers
             var resp = Context.StaffStatisticsforLevels
                 .Include(p => p.Staff)
                 .Include(p => p.Grade)
-                .Where(p => Months.Contains(p.CalMonth.Month) && p.CalMonth.Year == year);
+                .Where(p => Months.Contains(p.CalMonth.Month) && p.CalMonth.Year == year && p.Staff.RegularDate.Value < tempDate && p.Staff.IsGradeAssess);
             var temtList = resp.ToList();
 
             bool isReview = (GradeCode == "A");
@@ -3604,22 +3683,27 @@ namespace wispro.sp.api.Controllers
         {
             try
             {
-                var temObj = Context.CalMonths.FirstOrDefault(l => l.Year == year && l.Month == month);
+                _StatisticsLevelCount(year,month,Context);
 
-                if (temObj != null)
-                {
-                    var temList = Context.StaffStatisticsforLevels.Where(l => l.CalMonthId == temObj.Id);
-                    Context.StaffStatisticsforLevels.RemoveRange(temList);
+                return true;
+            }
+            catch { return false; }
+        }
 
-                    var NewList = StatisticsCount(temObj.Id,Context);
+        private void _StatisticsLevelCount(int year, int month,spDbContext spDb)
+        {
+            var temObj = spDb.CalMonths.FirstOrDefault(l => l.Year == year && l.Month == month);
 
-                    Context.StaffStatisticsforLevels.AddRange(NewList);
-                    Context.SaveChanges();
-                }
+            if (temObj != null)
+            {
+                var temList = spDb.StaffStatisticsforLevels.Where(l => l.CalMonthId == temObj.Id);
+                Context.StaffStatisticsforLevels.RemoveRange(temList);
 
-                return true;
+                var NewList = StatisticsCount(temObj.Id, spDb);
+
+                spDb.StaffStatisticsforLevels.AddRange(NewList);
+                spDb.SaveChanges();
             }
-            catch { return false; }
         }
         #endregion
     }

+ 41 - 15
wispro.sp.api/Controllers/StaffController.cs

@@ -265,6 +265,7 @@ namespace wispro.sp.api.Controllers
 
                         editObject.IsCalPerformsnce = saveUser.staff.IsCalPerformsnce;
                         editObject.IsOnJob = saveUser.staff.IsOnJob;
+                        editObject.IsGradeAssess = saveUser.staff.IsGradeAssess;
 
                         if (saveUser.staff.Mail != null && editObject.Mail != saveUser.staff.Mail)
                             editObject.Mail = saveUser.staff.Mail;
@@ -295,6 +296,10 @@ 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)
+                            editObject.RegularDate = saveUser.staff.RegularDate;
+
                         Context.SaveChanges();
 
                         var temDP = Context.DepartmentPositions
@@ -389,6 +394,7 @@ namespace wispro.sp.api.Controllers
                             editObject.EntyDate = staff.EntyDate;
                             editObject.IsCalPerformsnce = staff.IsCalPerformsnce;
                             editObject.IsOnJob = staff.IsOnJob;
+                            editObject.IsGradeAssess = staff.IsGradeAssess;
                             editObject.Mail = staff.Mail;
                             editObject.Memo = staff.Memo;
                             editObject.Mobile = staff.Mobile;
@@ -399,25 +405,29 @@ namespace wispro.sp.api.Controllers
                             editObject.Status = staff.Status;
                             editObject.Tel = staff.Tel;
                             editObject.WorkPlace = staff.WorkPlace;
+                            editObject.RegularDate =staff.RegularDate;
                             Context.SaveChanges();
 
-                            var temDP = Context.DepartmentPositions
-                                .Where<DepartmentPosition>(d =>
-                                    d.departmentId == saveUser.deptId &&
-                                    d.StaffId == editObject.Id).ToList<DepartmentPosition>();
-
-                            foreach (var depPosition in temDP)
+                            if (saveUser.deptId > 0)
                             {
-                                Context.DepartmentPositions.Remove(depPosition);
-                            }
-                            Context.SaveChanges();
+                                var temDP = Context.DepartmentPositions
+                                    .Where<DepartmentPosition>(d =>
+                                        d.departmentId == saveUser.deptId &&
+                                        d.StaffId == editObject.Id).ToList<DepartmentPosition>();
 
-                            DepartmentPosition dp = new DepartmentPosition();
-                            dp.departmentId = saveUser.deptId;
-                            dp.PositionId = saveUser.positionId;
-                            dp.StaffId = editObject.Id;
-                            Context.DepartmentPositions.Add(dp);
-                            Context.SaveChanges();
+                                foreach (var depPosition in temDP)
+                                {
+                                    Context.DepartmentPositions.Remove(depPosition);
+                                }
+                                Context.SaveChanges();
+
+                                DepartmentPosition dp = new DepartmentPosition();
+                                dp.departmentId = saveUser.deptId;
+                                dp.PositionId = saveUser.positionId;
+                                dp.StaffId = editObject.Id;
+                                Context.DepartmentPositions.Add(dp);
+                                Context.SaveChanges();
+                            }
 
                         }
                         else
@@ -469,6 +479,9 @@ namespace wispro.sp.api.Controllers
                         if (staff.IsCalPerformsnce != temStaff.IsCalPerformsnce)
                             temStaff.IsCalPerformsnce = staff.IsCalPerformsnce;
 
+                        if (staff.IsGradeAssess != temStaff.IsGradeAssess)
+                            temStaff.IsGradeAssess = staff.IsGradeAssess;
+
                         if (staff.IsOnJob != temStaff.IsOnJob)
                             temStaff.IsOnJob = staff.IsOnJob;
 
@@ -498,6 +511,11 @@ 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)
+                        {
+                            temStaff.RegularDate = staff.RegularDate;
+                        }
+
                         Context.SaveChanges();
 
                         //ret.Success = false;
@@ -526,6 +544,9 @@ namespace wispro.sp.api.Controllers
                         if (staff.IsCalPerformsnce != editObject.IsCalPerformsnce)
                             editObject.IsCalPerformsnce = staff.IsCalPerformsnce;
 
+                        if (staff.IsGradeAssess != editObject.IsGradeAssess)
+                            editObject.IsGradeAssess = staff.IsGradeAssess;
+
                         if (staff.IsOnJob != editObject.IsOnJob)
                             editObject.IsOnJob = staff.IsOnJob;
 
@@ -554,6 +575,11 @@ 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)
+                        {
+                            editObject.RegularDate = staff.RegularDate;
+                        }
                     }
                     else
                     {

+ 2 - 1
wispro.sp.api/Job/ImportReportJob.cs

@@ -57,7 +57,8 @@ namespace wispro.sp.api.Job
             "确认是否委托申请与类型",
             "专利交易",
             "专利权评价报告",
-            "专利权人发明人申请人信息变更+代理所变更"
+            "专利权人发明人申请人信息变更+代理所变更",
+            "补缴费用"
         };
 
         

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

@@ -58,6 +58,6 @@
     "/Report/StaticsTrend": "[94]-[1],[128]-[7],[44]-[5]"
   },
 
-  "Lastest_feedback_date": "8"
+  "Lastest_feedback_date": "30"
 
 }

+ 17 - 13
wispro.sp.share/LevelStatistics.cs

@@ -14,20 +14,24 @@ namespace wispro.sp.share
             int count = temList.Count();
 
             double ret = 0.0;
-            switch (Grade)
+
+            if (count > 0)
             {
-                case "A":
-                    ret=(double)((((decimal)temList.Sum(s => s.dS)*2.5M)+((decimal)temList.Sum(s=>s.dA)*1.5M))/(decimal)count);
-                    break;
-                case "B":
-                    ret = (double)((((decimal)temList.Sum(s => s.dS) * 2.5M) + ((decimal)temList.Sum(s => s.dA) * 1.5M) +((decimal)temList.Sum(s => s.dB))) / (decimal)count);
-                    break;
-                case "C":
-                    ret = (double)((((decimal)temList.Sum(s => s.dS) * 2.5M) + ((decimal)temList.Sum(s => s.dA) * 1.5M) + ((decimal)temList.Sum(s => s.dB))+((decimal)temList.Sum(s => s.dC)*0.7M)) / (decimal)count);
-                    break;
-                case "D":
-                    ret = (double)((((decimal)temList.Sum(s => s.dS) * 2.5M) + ((decimal)temList.Sum(s => s.dA) * 1.5M) + ((decimal)temList.Sum(s => s.dB)) + ((decimal)temList.Sum(s => s.dC) * 0.7M)) / (decimal)count);
-                    break;
+                switch (Grade)
+                {
+                    case "A":
+                        ret = (double)((((decimal)temList.Sum(s => s.dS) * 2.5M) + ((decimal)temList.Sum(s => s.dA) * 1.5M)) / (decimal)count);
+                        break;
+                    case "B":
+                        ret = (double)((((decimal)temList.Sum(s => s.dS) * 2.5M) + ((decimal)temList.Sum(s => s.dA) * 1.5M) + ((decimal)temList.Sum(s => s.dB))) / (decimal)count);
+                        break;
+                    case "C":
+                        ret = (double)((((decimal)temList.Sum(s => s.dS) * 2.5M) + ((decimal)temList.Sum(s => s.dA) * 1.5M) + ((decimal)temList.Sum(s => s.dB)) + ((decimal)temList.Sum(s => s.dC) * 0.7M)) / (decimal)count);
+                        break;
+                    case "D":
+                        ret = (double)((((decimal)temList.Sum(s => s.dS) * 2.5M) + ((decimal)temList.Sum(s => s.dA) * 1.5M) + ((decimal)temList.Sum(s => s.dB)) + ((decimal)temList.Sum(s => s.dC) * 0.7M)) / (decimal)count);
+                        break;
+                }
             }
 
             return ret;

+ 5 - 2
wispro.sp.web/Components/StaffSelect.razor.cs

@@ -22,13 +22,16 @@ namespace wispro.sp.web.Components
         [Parameter]
         public List<Staff> StaffLists { get; set; }
 
+        [Parameter]
+        public bool AutoSelectedFirstItem { get; set; } = true;
+
         [Inject] IUserService _UserService { get; set; }
 
 
         protected override void OnInitialized()
         {
             _ShowStaffs = StaffLists;
-            if(_ShowStaffs !=null && _ShowStaffs.Count > 0)
+            if(_ShowStaffs !=null && _ShowStaffs.Count > 0 && AutoSelectedFirstItem && StaffId ==null)
             {
                 StaffId = _ShowStaffs[0].Id;
             }
@@ -38,7 +41,7 @@ namespace wispro.sp.web.Components
         protected override Task OnParametersSetAsync()
         {
             _ShowStaffs = StaffLists;
-            if (_ShowStaffs != null && _ShowStaffs.Count > 0)
+            if (_ShowStaffs != null && _ShowStaffs.Count > 0 && AutoSelectedFirstItem && StaffId == null)
             {
                 StaffId = _ShowStaffs[0].Id;
             }

+ 9 - 4
wispro.sp.web/Pages/AppCase/CaseManager.razor.cs

@@ -138,16 +138,21 @@ namespace wispro.sp.web.Pages.AppCase
 
             while (!fileData.Finished)
             {
-                fileData = await _ItemService.getExportDataProcessing(fileData.Id);
-                await Task.Delay(20);
+                try
+                {
+                    fileData = await _ItemService.getExportDataProcessing(fileData.Id);
+                    await Task.Delay(100);
+                }
+                catch {
+                    await Task.Delay(1000);
+                }
+                
             }
 
             NavigationManager.NavigateTo($"{_configuration.GetValue<string>("APIUrl")}FileProcesTask/Download?Id={fileData.Id}");
 
             isDownloading = false;
 
-           
-
         }
 
         private async Task ExportJXDataAsync(CalMonth calMonth)

+ 78 - 21
wispro.sp.web/Pages/AppCase/MyCaselist.razor

@@ -36,6 +36,7 @@
                     <PageHeader>
                         <PageHeaderTitle>基础点数统计</PageHeaderTitle>
                         <PageHeaderExtra>
+                            
 
                             <Select DataSource="@_Items"
                                     @bind-Value="@DoingOrReview"
@@ -67,47 +68,47 @@
                         <PageHeaderContent>
                             <div style="border:1px solid #000000">
                                 <AntDesign.Row Align="center" Justify="center">
-                                    <AntDesign.Col Span="2" style="border-left:1px solid #000000"><center></center></AntDesign.Col>
+                                    <AntDesign.Col Span="3" style="border-left:1px solid #000000"><center></center></AntDesign.Col>
                                     <AntDesign.Col Span="4" style="border:1px solid #000000"><center>新申请</center></AntDesign.Col>
-                                    <AntDesign.Col Span="4" style="border:1px solid #000000"><center>OA(国内、涉外)</center></AntDesign.Col>
+                                    <AntDesign.Col Span="6" style="border:1px solid #000000"><center>OA(国内、涉外)</center></AntDesign.Col>
                                     <AntDesign.Col Span="4" style="border:1px solid #000000"><center>其它</center></AntDesign.Col>
-                                    <AntDesign.Col Span="2" style="border:1px solid #000000"></AntDesign.Col>
-                                    <AntDesign.Col Span="4" style="border:1px solid #000000">一次OA授权</AntDesign.Col>
+                                    <AntDesign.Col Span="3" style="border:1px solid #000000"></AntDesign.Col>
+                                    @*<AntDesign.Col Span="4" style="border:1px solid #000000">一次OA授权</AntDesign.Col>*@
                                     <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>@_user.Name</center></AntDesign.Col>
+                                    <AntDesign.Col Span="3" 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="3" style="border:1px solid #000000"><center>承办</center></AntDesign.Col>
+                                    <AntDesign.Col Span="3" 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>
-                                    <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>
-                                    <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="3" 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>*@
                                     <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>基础点数</center></AntDesign.Col>
+                                    <AntDesign.Col Span="3" 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="3" style="border:1px solid #000000"><center>@GetStatistics("OA处理", true)</center></AntDesign.Col>
+                                    <AntDesign.Col Span="3" 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="3" style="border:1px solid #000000"><center>@GetStatistics("专案处理", 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="3" 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="3" style="border:1px solid #000000"><center>@GetStatistics("OA处理")</center></AntDesign.Col>
+                                    <AntDesign.Col Span="3" 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>@GetStatistics("专案处理")</center></AntDesign.Col>
+                                    <AntDesign.Col Span="3" style="border:1px solid #000000"><center>@GetStatistics("专案处理")</center></AntDesign.Col>
                                     <AntDesign.Col Span="4" style="border:1px solid #000000"><center>@GetStatistics("ALL")</center></AntDesign.Col>
                                 </AntDesign.Row>
 
@@ -220,14 +221,24 @@
                             </div>
                         </ExpandTemplate>
                     </AntDesign.Table>
+                    
                 }
                 else
                 {
 
                     <PageHeader>
-                        <PageHeaderTitle></PageHeaderTitle>
+                        <PageHeaderTitle>基础点数统计</PageHeaderTitle>
                         <PageHeaderExtra>
-
+                            <Select DataSource="@calMonthList"
+                                    @bind-Value="@SelectedCalMonthId"
+                                    ValueName="@nameof(CalMonth.Id)"
+                                    DefaultActiveFirstItem
+                                    Style="width: 200px;"
+                                    OnSelectedItemChanged="OnSelectedCalMonthChangedHandler">
+                                    @*<ItemTemplate>
+                                        <span>@(context.Year)年@(context.Month)月 </span>
+                                    </ItemTemplate>*@
+                            </Select>
                             <Select DataSource="@_Items"
                                     @bind-Value="@DoingOrReview"
                                     ValueName="@nameof(SelectItem.Value)"
@@ -247,7 +258,53 @@
                             }
                         </PageHeaderExtra>
                         <PageHeaderContent>
-                           
+                            <div style="border:1px solid #000000">
+                                <AntDesign.Row Align="center" Justify="center">
+                                    <AntDesign.Col Span="3" style="border-left:1px solid #000000"><center></center></AntDesign.Col>
+                                    <AntDesign.Col Span="4" style="border:1px solid #000000"><center>新申请</center></AntDesign.Col>
+                                    <AntDesign.Col Span="6" style="border:1px solid #000000"><center>OA(国内、涉外)</center></AntDesign.Col>
+                                    <AntDesign.Col Span="4" style="border:1px solid #000000"><center>其它</center></AntDesign.Col>
+                                    <AntDesign.Col Span="3" style="border:1px solid #000000"></AntDesign.Col>
+                                    @*<AntDesign.Col Span="4" style="border:1px solid #000000">一次OA授权</AntDesign.Col>*@
+                                    <AntDesign.Col Span="4" style="border:1px solid #000000"></AntDesign.Col>
+                                </AntDesign.Row>
+                                <AntDesign.Row>
+                                    <AntDesign.Col Span="3" 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="3" style="border:1px solid #000000"><center>承办</center></AntDesign.Col>
+                                    <AntDesign.Col Span="3" 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>
+                                    <AntDesign.Col Span="3" 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>*@
+                                    <AntDesign.Col Span="4" style="border:1px solid #000000"><center>总计</center></AntDesign.Col>
+                                </AntDesign.Row>
+                                <AntDesign.Row>
+                                    <AntDesign.Col Span="3" 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="3" style="border:1px solid #000000"><center>@GetStatistics("OA处理", true)</center></AntDesign.Col>
+                                    <AntDesign.Col Span="3" 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="3" style="border:1px solid #000000"><center>@GetStatistics("专案处理", 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="3" 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="3" style="border:1px solid #000000"><center>@GetStatistics("OA处理")</center></AntDesign.Col>
+                                    <AntDesign.Col Span="3" 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="3" style="border:1px solid #000000"><center>@GetStatistics("专案处理")</center></AntDesign.Col>
+                                    <AntDesign.Col Span="4" style="border:1px solid #000000"><center>@GetStatistics("ALL")</center></AntDesign.Col>
+                                </AntDesign.Row>
+
+                            </div>
                         </PageHeaderContent>
                     </PageHeader>
                     <AntDesign.Table DataSource="_Datas" TItem="PerformanceItem" @ref="@table"

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

@@ -38,10 +38,11 @@ namespace wispro.sp.web.Pages.AppCase
 
         [Inject]
         protected AppealTypeService apTypeService { get; set; }
-
+        private List<CalMonth> calMonthList;
         private List<PerformanceItem> _Datas;
         private List<StaffStatistics> MyStatistics;
         IEnumerable<PerformanceItem> selectedItems = new List<PerformanceItem>();
+
         private CalMonth HandlingCalMonth;
         
 
@@ -51,6 +52,7 @@ namespace wispro.sp.web.Pages.AppCase
         bool _loading = false;
         PerformanceItem EditingItem = null;
         int DoingOrReview = 0;
+        int SelectedCalMonthId = 0;
 
         List<TabPaneItem> tabList = new List<TabPaneItem>() {
             new TabPaneItem(){ Key ="myListDoing", Tab ="本月待确认绩效" },
@@ -94,6 +96,14 @@ namespace wispro.sp.web.Pages.AppCase
             StateHasChanged();
         }
 
+        private async void OnSelectedCalMonthChangedHandler(CalMonth calMonth)
+        {
+            _pageIndex = 1;
+            await RefreshMyStatistics(calMonth);
+            table.ReloadData();
+            StateHasChanged();
+        }
+
         protected async override Task OnInitializedAsync()
         {
             if (isFirstInit)
@@ -106,6 +116,13 @@ namespace wispro.sp.web.Pages.AppCase
             }
 
             isFirstInit = false;
+
+            calMonthList = await _CalMonthService.GetAll();
+            if (calMonthList != null)
+            {
+                calMonthList = calMonthList.Where(c => c.Status != 0).ToList();
+            }
+
             await apTypeService.GetItems();
             _user = await _userService.GetUser();
             StateHasChanged();
@@ -136,12 +153,18 @@ namespace wispro.sp.web.Pages.AppCase
         private async Task RefreshMyStatistics()
         {
             var HandlingCalMonth = await _CalMonthService.GetHandlingMonth();
-            if (HandlingCalMonth != null)
+            await RefreshMyStatistics(HandlingCalMonth);
+
+        }
+
+        private async Task RefreshMyStatistics(CalMonth calMonth)
+        {
+            if (calMonth != null)
             {
                 var _user = await _userService.GetUser(); ;
                 if (_user.Userid != null)
                 {
-                    MyStatistics = await _ItemService.CalMyStatistics(HandlingCalMonth.Year, HandlingCalMonth.Month, _user.Userid.Value);
+                    MyStatistics = await _ItemService.CalMyStatistics(calMonth.Year, calMonth.Month, _user.Userid.Value);
                 }
                 else
                 {
@@ -153,6 +176,8 @@ namespace wispro.sp.web.Pages.AppCase
 
         private string GetStatistics(string strType, bool isBasePoint = false)
         {
+            
+            Console.WriteLine(strType);
             try
             {
                 if (strType != "ALL")
@@ -164,7 +189,7 @@ namespace wispro.sp.web.Pages.AppCase
                     {
                         if (tem != null)
                         {
-                            return (tem.FinianlPoint .HasValue ? tem.FinianlPoint.Value.ToString("0.00") : "");
+                            return (tem.FinianlPoint .HasValue ? tem.totalBasePoint.Value.ToString("0.00") : "");
                         }
                         else
                         {
@@ -188,7 +213,7 @@ namespace wispro.sp.web.Pages.AppCase
                 {
                     if (isBasePoint)
                     {
-                        return MyStatistics.Select(s => s.FinianlPoint.Value).Sum().ToString("0.00");
+                        return MyStatistics.Select(s => s.totalBasePoint.Value).Sum().ToString("0.00");
                     }
                     else
                     {
@@ -226,10 +251,16 @@ namespace wispro.sp.web.Pages.AppCase
             {
                 _loading = true;
 
-                var data = await _ItemService.Query(_user.Userid.Value, jxType.doing, queryModel, DoingOrReview);
+                HandlingCalMonth = await _CalMonthService.GetHandlingMonth();
+                await RefreshMyStatistics();
 
-                _Datas = data.Results;
-                _total = data.TotalCount;
+                if (HandlingCalMonth != null)
+                {
+                    var data = await _ItemService.Query(HandlingCalMonth.Id, _user.Userid.Value, jxType.doing, queryModel, DoingOrReview);
+
+                    _Datas = data.Results;
+                    _total = data.TotalCount;
+                }
                 _loading = false;
                 StateHasChanged();
             }
@@ -237,7 +268,14 @@ namespace wispro.sp.web.Pages.AppCase
             {
                 
                 _loading = true;
-                var data = await _ItemService.Query(_user.Userid.Value, jxType.finished, queryModel,DoingOrReview);
+
+                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);
 
                 _Datas = data.Results;
                 _total = data.TotalCount;
@@ -255,7 +293,16 @@ namespace wispro.sp.web.Pages.AppCase
         private async Task ExportDataAsync(jxType jxType)
         {
             isDownloading = true;
-            var fileData =await  _ItemService.ExportData(_user.Userid.Value, jxType,DoingOrReview);
+
+            FileProcessTask fileData = null;
+            if (jxType == jxType.doing)
+            {
+                fileData = await _ItemService.ExportData(HandlingCalMonth.Id, _user.Userid.Value, jxType, DoingOrReview);
+            }
+            else
+            {
+                fileData = await _ItemService.ExportData(SelectedCalMonthId, _user.Userid.Value, jxType, DoingOrReview);
+            }
 
             while(!fileData.Finished)
             {

+ 3 - 3
wispro.sp.web/Pages/CustomerList.razor

@@ -89,11 +89,11 @@
         </FormItem>
 
         <FormItem Label="负责人">
-            @if (context.ResponseMan == null)
+            @*@if (context.ResponseMan == null)
             {
                 context.ResponseMan = new Staff();
-            }
-            <Input @bind-Value="@context.ResponseMan.Name" />
+            }*@
+            <wispro.sp.web.Components.StaffSelect @bind-StaffId="@context.ResponseManId" StaffLists="_Staffs" AutoSelectedFirstItem =false/>
         </FormItem>
 
     </Form>

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

@@ -1,11 +1,13 @@
 using AntDesign;
 using AntDesign.TableModels;
+using Blazor.ECharts.Options.Enum;
 using Microsoft.AspNetCore.Components;
 using Microsoft.AspNetCore.Components.Web;
 using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Threading.Tasks;
+using wispro.sp.entity;
 using wispro.sp.web.Services;
 
 namespace wispro.sp.web.Pages
@@ -13,6 +15,7 @@ namespace wispro.sp.web.Pages
     public partial class CustomerList
     {
         private List<entity.Customer> _Customers =new List<entity.Customer>();
+        private List<entity.Staff> _Staffs = new List<entity.Staff>();
 
         IEnumerable<entity.Customer> selectedRows;
         ITable table;
@@ -29,12 +32,16 @@ namespace wispro.sp.web.Pages
         [Inject]OrganizationService  orgService { get; set; }
         [Inject] protected IAuthService _authService { get; set; }
 
+        [Inject] IUserService _UserService { get; set; }
+
         protected override async System.Threading.Tasks.Task OnInitializedAsync()
         {
             await _authService.CanVisitResource();
 
             _loading = true;
             _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");
 
@@ -100,6 +107,8 @@ namespace wispro.sp.web.Pages
 
             if (Editing != null)
             {
+               
+                //Console.WriteLine(System.Text.Json.JsonSerializer.Serialize(Editing));
                 _isAdd = false;
                 _visible = true;
             }
@@ -118,29 +127,23 @@ 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);
 
-            //var data = await Http.PostAsJsonAsync<wispro.sp.entity.StaffGrade>($"http://localhost:39476/api/StaffGrade/Save", EditingStaff);
-
-            //if (data.IsSuccessStatusCode)
-            //{
-            //    ApiSaveResponse result = await data.Content.ReadFromJsonAsync<ApiSaveResponse>();
-            //    await Task.Delay(1000);
-
-            //    if (result.Success)
-            //    {
-            //        await _message.Success("数据已保存!");
-            //    }
-            //    else
-            //    {
-            //        await _message.Error($"{result.ErrorMessage}");
-            //    }
-
-            //}
-            //else
-            //{
-            //    await _message.Error($"请求发生错误 {data.StatusCode}");
-            //}
+            if (data.Success)
+            {
+                if (_isAdd)
+                {
+                    _Customers = await orgService.GetAllCustomer();
+                    //table.ReloadData();
+                    StateHasChanged();
+                }
+                await _message.Success("数据已保存!");
+            }
+            else
+            {
+                await _message.Error($"{data.ErrorMessage}");
+            }
 
             _visible = false;
         }

+ 8 - 0
wispro.sp.web/Pages/Organization/Department.razor

@@ -151,6 +151,10 @@
             <Switch @bind-Value="@context.IsOnJob" />
         </FormItem>
 
+        <FormItem Label="是否参与等级计算">
+            <Switch @bind-Value="@context.IsGradeAssess" />
+        </FormItem>
+
         <FormItem Label="工程师等级">
             <wispro.sp.web.Components.UserGradeSelect @bind-StaffGradeId="@EditingStaff.StaffGradeId" />
         </FormItem>
@@ -184,6 +188,10 @@
             <DatePicker @bind-Value="@context.EntyDate" />
         </FormItem>
 
+        <FormItem Label="转正日期">
+            <DatePicker @bind-Value="@context.RegularDate" />
+        </FormItem>
+
         <FormItem Label="备注">
             <TextArea @bind-Value="@context.Memo" MinRows="4" />
         </FormItem>

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

@@ -260,6 +260,10 @@ namespace wispro.sp.web.Pages.Organization
         {
             //selectPosition = new Position() { Id = PositionId };
 
+            Console.WriteLine(System.Text.Json.JsonSerializer.Serialize(_editDepartment));
+
+            Console.WriteLine(System.Text.Json.JsonSerializer.Serialize(EditingStaff));
+
             var data = await orgService.SaveUser(_editDepartment, selectPosition, EditingStaff); // Http.PostAsJsonAsync<wispro.sp.entity.Staff>($"http://localhost:39476/api/Staff/Save", EditingStaff);
 
             if (data.Success)

+ 12 - 8
wispro.sp.web/Pages/Report/PieChart.razor.cs

@@ -63,17 +63,21 @@ namespace wispro.sp.web.Pages.Report
         [Obsolete]
         protected async override Task OnInitializedAsync()
         {
+            await base.OnInitializedAsync();
+
             await _authService.CanVisitResource();
-            Datas = await reportService.GetAppealReportData(1, DateTime.Parse("2022-02-01"), null, null);
 
-            if (Datas != null)
-            {
-                Option1 = GetPieOption(Datas);
-                pieChart.Refresh();
-                StateHasChanged();
-            }
+            await OnButtonClick();
+            //Datas = await reportService.GetAppealReportData(1, DateTime.Parse("2022-02-01"), null, null);
 
-            await base.OnInitializedAsync();
+            //if (Datas != null)
+            //{
+            //    Option1 = GetPieOption(Datas);
+            //    pieChart.Refresh();
+            //    StateHasChanged();
+            //}
+
+            
         }
 
         private EChartsOption<P.Pie> GetPieOption(share.ChartDatas datas)

+ 1 - 1
wispro.sp.web/Pages/Welcome.razor.cs

@@ -67,7 +67,7 @@ namespace wispro.sp.web.Pages
             {
                 //Console.WriteLine(System.Text.Json.JsonSerializer.Serialize())
                 
-                var data = await _ItemService.Query(_CurrentUser.Userid.Value, jxType.doing
+                var data = await _ItemService.Query(HandlingMonth.Id, _CurrentUser.Userid.Value, jxType.doing
                     ,null);
                 waitingHandleItems = data.TotalCount;
             }

+ 12 - 1
wispro.sp.web/Services/OrganizationService.cs

@@ -110,7 +110,11 @@ namespace wispro.sp.web.Services
         public async Task<ApiSaveResponse> SaveUser(Department dept,Position position,Staff staff)
         {
             SaveUserObject saveUser = new SaveUserObject();
-            saveUser.deptId = dept.Id;
+
+            if (dept != null)
+            {
+                saveUser.deptId = dept.Id;
+            }
             saveUser.positionId = position.Id;
             saveUser.staff = staff;
             var data =await _httpClient.Post<ApiSaveResponse>("Staff/SaveUser", saveUser);
@@ -118,6 +122,13 @@ namespace wispro.sp.web.Services
             return data;
         }
 
+        public async Task<ApiSaveResponse> SaveCustomer(Customer customer)
+        {
+            var data = await _httpClient.Post<ApiSaveResponse>("Organization/SaveCustomer", customer);
+
+            return data;
+        }
+
         public async Task Init()
         {
              await _httpClient.Get<ApiSaveResponse>("Staff/Init");

+ 4 - 2
wispro.sp.web/Services/PerformanceItemServices.cs

@@ -80,11 +80,12 @@ namespace wispro.sp.web.Services
             return fileData;
         }
 
-        public async Task<FileProcessTask> ExportData(int userid, jxType jxType,int DoingOrReview=0)
+        public async Task<FileProcessTask> ExportData(int calMonthId, int userid, jxType jxType,int DoingOrReview=0)
         {
             QueryFilter query = new QueryFilter();
             query.userId = userid;
             query.jxType = jxType;
+            query.CalMonthId = calMonthId;
             query.DoingOrReview = DoingOrReview;
 
             query.PageIndex = 1;
@@ -232,9 +233,10 @@ namespace wispro.sp.web.Services
 
         }
 
-        public async Task<ListApiResponse<PerformanceItem>> Query(int userid, jxType type, QueryModel<PerformanceItem> queryModel,int DoingOrReview=0)
+        public async Task<ListApiResponse<PerformanceItem>> Query(int calMonthId, int userid, jxType type, QueryModel<PerformanceItem> queryModel,int DoingOrReview=0)
         {
             QueryFilter query = new QueryFilter();
+            query.CalMonthId = calMonthId;
             query.userId = userid;
             query.jxType = type;
             query.DoingOrReview = DoingOrReview;

+ 27 - 21
wispro.sp.winClient/Form1.Designer.cs

@@ -35,14 +35,14 @@ namespace wispro.sp.winClient
             this.button5 = new System.Windows.Forms.Button();
             this.button6 = new System.Windows.Forms.Button();
             this.button7 = new System.Windows.Forms.Button();
+            this.button4 = new System.Windows.Forms.Button();
             this.SuspendLayout();
             // 
             // button1
             // 
-            this.button1.Location = new System.Drawing.Point(61, 80);
-            this.button1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.button1.Location = new System.Drawing.Point(52, 69);
             this.button1.Name = "button1";
-            this.button1.Size = new System.Drawing.Size(304, 79);
+            this.button1.Size = new System.Drawing.Size(257, 68);
             this.button1.TabIndex = 0;
             this.button1.Text = "合并反馈文档";
             this.button1.UseVisualStyleBackColor = true;
@@ -50,10 +50,9 @@ namespace wispro.sp.winClient
             // 
             // button2
             // 
-            this.button2.Location = new System.Drawing.Point(415, 80);
-            this.button2.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.button2.Location = new System.Drawing.Point(351, 69);
             this.button2.Name = "button2";
-            this.button2.Size = new System.Drawing.Size(304, 79);
+            this.button2.Size = new System.Drawing.Size(257, 68);
             this.button2.TabIndex = 0;
             this.button2.Text = "输入绩效基本点数";
             this.button2.UseVisualStyleBackColor = true;
@@ -61,10 +60,9 @@ namespace wispro.sp.winClient
             // 
             // button3
             // 
-            this.button3.Location = new System.Drawing.Point(749, 80);
-            this.button3.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.button3.Location = new System.Drawing.Point(634, 69);
             this.button3.Name = "button3";
-            this.button3.Size = new System.Drawing.Size(304, 79);
+            this.button3.Size = new System.Drawing.Size(257, 68);
             this.button3.TabIndex = 0;
             this.button3.Text = "计算绩效";
             this.button3.UseVisualStyleBackColor = true;
@@ -72,10 +70,9 @@ namespace wispro.sp.winClient
             // 
             // button5
             // 
-            this.button5.Location = new System.Drawing.Point(318, 186);
-            this.button5.Margin = new System.Windows.Forms.Padding(4);
+            this.button5.Location = new System.Drawing.Point(269, 159);
             this.button5.Name = "button5";
-            this.button5.Size = new System.Drawing.Size(202, 52);
+            this.button5.Size = new System.Drawing.Size(171, 45);
             this.button5.TabIndex = 1;
             this.button5.Text = "获取绩效报表";
             this.button5.UseVisualStyleBackColor = true;
@@ -83,10 +80,9 @@ namespace wispro.sp.winClient
             // 
             // button6
             // 
-            this.button6.Location = new System.Drawing.Point(584, 186);
-            this.button6.Margin = new System.Windows.Forms.Padding(4);
+            this.button6.Location = new System.Drawing.Point(494, 159);
             this.button6.Name = "button6";
-            this.button6.Size = new System.Drawing.Size(202, 52);
+            this.button6.Size = new System.Drawing.Size(171, 45);
             this.button6.TabIndex = 1;
             this.button6.Text = "更新绩效数据";
             this.button6.UseVisualStyleBackColor = true;
@@ -94,20 +90,30 @@ namespace wispro.sp.winClient
             // 
             // button7
             // 
-            this.button7.Location = new System.Drawing.Point(850, 186);
-            this.button7.Margin = new System.Windows.Forms.Padding(4);
+            this.button7.Location = new System.Drawing.Point(719, 159);
             this.button7.Name = "button7";
-            this.button7.Size = new System.Drawing.Size(202, 52);
+            this.button7.Size = new System.Drawing.Size(171, 45);
             this.button7.TabIndex = 1;
             this.button7.Text = "发送疑似问题通知";
             this.button7.UseVisualStyleBackColor = true;
             this.button7.Click += new System.EventHandler(this.button7_Click);
             // 
+            // button4
+            // 
+            this.button4.Location = new System.Drawing.Point(44, 158);
+            this.button4.Name = "button4";
+            this.button4.Size = new System.Drawing.Size(197, 44);
+            this.button4.TabIndex = 2;
+            this.button4.Text = "button4";
+            this.button4.UseVisualStyleBackColor = true;
+            this.button4.Click += new System.EventHandler(this.button4_Click_1);
+            // 
             // Form1
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(13F, 28F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(11F, 24F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(1093, 251);
+            this.ClientSize = new System.Drawing.Size(925, 215);
+            this.Controls.Add(this.button4);
             this.Controls.Add(this.button7);
             this.Controls.Add(this.button6);
             this.Controls.Add(this.button5);
@@ -115,7 +121,6 @@ namespace wispro.sp.winClient
             this.Controls.Add(this.button2);
             this.Controls.Add(this.button1);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
-            this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.Name = "Form1";
             this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
             this.Text = "人力绩效计算工具";
@@ -131,6 +136,7 @@ namespace wispro.sp.winClient
         private System.Windows.Forms.Button button5;
         private System.Windows.Forms.Button button6;
         private System.Windows.Forms.Button button7;
+        private System.Windows.Forms.Button button4;
     }
 }
 

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

@@ -610,7 +610,7 @@ namespace wispro.sp.winClient
             }
 
             //await CalJXPointAsync(2022,2);
-            await CalJXPointAsync(2022, 1);
+            await CalJXPointAsync(2022, 6);
         }
 
         private async Task RemoveDBNotFinishedDate()
@@ -955,7 +955,7 @@ namespace wispro.sp.winClient
             return retStr;
         }
 
-        string strAPIBaseUri = "http://47.106.221.167:8081"; //   "http://localhost:39476";// 
+        string strAPIBaseUri = "http://47.106.221.167:8081"; // "http://localhost:39476";//   
 
         userToken Token;
 
@@ -1033,6 +1033,13 @@ namespace wispro.sp.winClient
                 Token = await response.Content.ReadFromJsonAsync<userToken>();
             }
         }
+
+        private async Task StatisticsLevelCount(int year, int month)
+        {
+            HttpClient http = CreateHttp();
+            http.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("bearer", Token.Token);
+            await http.GetAsync($"{strAPIBaseUri}/api/PerformanceItem/StatisticsLevelCount?year={year}&month={month}");
+        }
         public async Task<entity.workflowDefine.Workflow> GetWorkflow(int Id, HttpClient _httpClient)
         {
             var ret = await _httpClient.GetFromJsonAsync<entity.workflowDefine.Workflow>($"{strAPIBaseUri}/api/WorkflowEngine/GetWorkflow?workflowId={Id}");
@@ -1342,5 +1349,24 @@ namespace wispro.sp.winClient
             var data = await http.GetFromJsonAsync<ApiSaveResponse>($"{strAPIBaseUri}/api/SystemData/SendInvaldDataMessage");
 
         }
+
+        private async void button4_Click_1(object sender, EventArgs e)
+        {
+            if (Token == null)
+            {
+                await Login();
+            }
+
+            //await StatisticsLevelCount(2022,2);
+
+            //await StatisticsLevelCount(2022, 3);
+
+            await StatisticsLevelCount(2022, 4);
+
+            await StatisticsLevelCount(2022, 5);
+
+            await StatisticsLevelCount(2022, 6);
+
+        }
     }
 }

+ 5 - 0
wospro.sp.entity/CalMonth.cs

@@ -44,5 +44,10 @@ namespace wispro.sp.entity
         public double? D { get; set; }
 
         public virtual List<PerformanceItem> PerformanceItems { get; set; }
+
+        public override string ToString()
+        {
+            return $"{Year}年{Month}月";
+        }
     }
 }

+ 10 - 0
wospro.sp.entity/Organization/Staff.cs

@@ -86,6 +86,16 @@ namespace wispro.sp.entity
         public DateTime? EntyDate { get; set; }
 
         /// <summary>
+        /// 转正日期
+        /// </summary>
+        public DateTime? RegularDate { get; set; }
+
+        /// <summary>
+        /// 是否参与等级考核
+        /// </summary>
+        public bool IsGradeAssess { get; set; }
+
+        /// <summary>
         /// 邮箱
         /// </summary>
         public string Mail { get; set; }